@cccsaurora/clue-ui 1.0.1-dev.55 → 1.0.1
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-WIj7BfD5.js +340 -0
- package/AnnotationPreview-DWRDhxUB.js +140 -0
- package/ClueEnrichContext-CbJVBm4w.js +397 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_Map-DXNg_Z-q.js +54 -0
- package/_MapCache-Cu25RRDU.js +129 -0
- package/_Uint8Array-DlJCtTvG.js +102 -0
- package/_baseAssignValue-CUmzp727.js +20 -0
- package/_baseClone-BlMmRXeX.js +208 -0
- package/_baseExtremum-P_0akmCi.js +27 -0
- package/_baseFlatten-CN7vDNEQ.js +72 -0
- package/_baseGet-Dgf6_xCm.js +80 -0
- package/_baseIsEqual-Cpjtfb3Q.js +173 -0
- package/_baseIteratee-CP1bocOX.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-tMFmk80M.js +61 -0
- package/_commonjsHelpers-C6fGbg64.js +6 -0
- package/_createAggregator-B4Cav8ZM.js +53 -0
- package/_getPrototype-CHAFQYL_.js +5 -0
- package/_getTag-BV_UoLYG.js +90 -0
- package/cloneDeep-BPVpFBzJ.js +8 -0
- package/components/AnnotationBody.js +34 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +94 -109
- package/components/AnnotationEntry.js +52 -55
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +92 -104
- package/components/EnrichedChip.js +109 -134
- package/components/EnrichedTypography.js +110 -136
- 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 +50 -64
- package/components/actions/ResultModal.js +34 -37
- package/components/actions/form/schemaAdapter.js +20 -39
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +76 -92
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +200 -258
- 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/DynamicTabs.js +17 -22
- package/components/display/markdown/index.js +5674 -8531
- package/components/display/markdown/markdownPlugins/tabs.js +1 -1
- package/components/enrichment/EnrichPopover.js +47 -55
- package/components/fetchers/Fetcher.js +95 -123
- package/components/fetchers/PreviewModal.js +17 -20
- package/components/fetchers/StatusChip.js +18 -22
- 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 +28 -37
- package/countBy-DOutsa_w.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-Bow1vKwx.js +8 -0
- package/groupBy-BheQYl6f.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 +46 -74
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +11 -22
- package/hooks/useAnnotations.js +32 -48
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +5 -5
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +43 -63
- package/iconify-BBckr5AQ.js +1263 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +68 -84
- package/icons/Context.js +61 -75
- package/icons/Opinion.js +65 -77
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-4YFAh_sa.js +358 -0
- package/index-E7g8cRyW.js +568 -0
- package/index-HuYhutsd.js +975 -0
- package/index-WvFmjbxF.js +12734 -0
- package/index-p5_wX7q1.js +11729 -0
- package/isEmpty-g47Qir2A.js +21 -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/isUndefined-DiNCDKoz.js +10 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +68 -68
- package/package.json +1 -1
- package/sortBy-ITdmD17L.js +79 -0
- package/sumBy-DxJUU2E8.js +8 -0
- package/tabs-CgADNA57.js +195 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/useClueTypeConfig-BQ33EiyB.js +2273 -0
- package/utils/chain.js +64 -91
- package/utils/classificationParser.js +254 -504
- 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 +29 -41
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-C_RX5uMP.js +2704 -0
- package/ActionForm-c5hLIfQ-.js +0 -436
- package/AnnotationPreview-BvNpZOP0.js +0 -188
- package/ClueEnrichContext-m-4vn9rz.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/cloneDeep-CjP5k9zW.js +0 -8
- package/countBy-C69WslUA.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-D3C3lEU3.js +0 -8
- package/groupBy-DC2oOuBN.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-BDVjGvMI.js +0 -696
- package/index-BDrtH5ec.js +0 -465
- package/index-BbPn6-Mw.js +0 -15750
- package/index-C9lySIVX.js +0 -1172
- package/index-Dn2NHyXg.js +0 -17654
- 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/sortBy-B-UKp4GT.js +0 -100
- package/sumBy-MYkDPHZL.js +0 -8
- package/tabs-xGuUGsJd.js +0 -254
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-D4zcy8Gr.js +0 -3184
- package/utils-CxIhC2xH.js +0 -4182
|
@@ -1,162 +1,150 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { I as
|
|
3
|
-
import { useTheme, Card, CardHeader, Stack, CircularProgress, Divider
|
|
4
|
-
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
|
-
import { useClueEnrichSelector } from "../hooks/selectors.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { ICON_MAP } from "../icons/iconMap.js";
|
|
12
|
-
import
|
|
13
|
-
import { memo, useState, useMemo, useCallback } from "react";
|
|
14
|
-
import { u as
|
|
15
|
-
import
|
|
16
|
-
import { u as
|
|
17
|
-
const
|
|
18
|
-
type,
|
|
19
|
-
value,
|
|
20
|
-
classification:
|
|
21
|
-
contextIcon =
|
|
22
|
-
counters =
|
|
23
|
-
hideLoading =
|
|
24
|
-
...
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { I as h } from "../iconify-BBckr5AQ.js";
|
|
3
|
+
import { useTheme as q, Card as F, CardHeader as M, Stack as O, CircularProgress as W, Divider as $, CardContent as B, Grid as s, Chip as C, Typography as g, Tooltip as D, Box as G } from "@mui/material";
|
|
4
|
+
import { ClueComponentContext as H } from "../hooks/ClueComponentContext.js";
|
|
5
|
+
import { useClueEnrichSelector as b } from "../hooks/selectors.js";
|
|
6
|
+
import N from "../hooks/useAnnotations.js";
|
|
7
|
+
import J from "../hooks/useErrors.js";
|
|
8
|
+
import K from "../icons/Assessment.js";
|
|
9
|
+
import L from "../icons/Context.js";
|
|
10
|
+
import Q from "../icons/Opinion.js";
|
|
11
|
+
import { ICON_MAP as T } from "../icons/iconMap.js";
|
|
12
|
+
import R from "../text/Frequency.js";
|
|
13
|
+
import { memo as U, useState as V, useMemo as z, useCallback as X } from "react";
|
|
14
|
+
import { u as Y } from "../index-E7g8cRyW.js";
|
|
15
|
+
import Z from "./AnnotationEntry.js";
|
|
16
|
+
import { u as _ } from "../ClueEnrichContext-CbJVBm4w.js";
|
|
17
|
+
const P = ({
|
|
18
|
+
type: o,
|
|
19
|
+
value: r,
|
|
20
|
+
classification: f,
|
|
21
|
+
contextIcon: I = !1,
|
|
22
|
+
counters: m = !1,
|
|
23
|
+
hideLoading: y = !1,
|
|
24
|
+
...e
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const errors = useErrors(value);
|
|
37
|
-
const options = useMemo(() => ["all", ...uniq(annotations.map((annotation) => annotation.type))], [annotations]);
|
|
38
|
-
const forceEnrich = useCallback(() => {
|
|
39
|
-
return enrich(type, value, {
|
|
40
|
-
classification,
|
|
41
|
-
timeout: 15,
|
|
42
|
-
force: true
|
|
43
|
-
});
|
|
44
|
-
}, [classification, enrich, type, value]);
|
|
45
|
-
return /* @__PURE__ */ jsxs(
|
|
46
|
-
Card,
|
|
26
|
+
const p = q(), { t: E } = Y(H, (i) => i.i18next), u = b((i) => i.defaultClassification), x = b((i) => i.enrich), [S, A] = V("all"), l = z(
|
|
27
|
+
() => f ?? u,
|
|
28
|
+
[f, u]
|
|
29
|
+
), [n, k] = N(o, r, l), c = J(r), v = z(() => ["all", ..._(n.map((i) => i.type))], [n]), w = X(() => x(o, r, {
|
|
30
|
+
classification: l,
|
|
31
|
+
timeout: 15,
|
|
32
|
+
force: !0
|
|
33
|
+
}), [l, x, o, r]);
|
|
34
|
+
return /* @__PURE__ */ a(
|
|
35
|
+
F,
|
|
47
36
|
{
|
|
48
37
|
sx: [
|
|
49
38
|
{
|
|
50
39
|
maxWidth: "900px"
|
|
51
40
|
},
|
|
52
|
-
...Array.isArray(
|
|
41
|
+
...Array.isArray(e == null ? void 0 : e.sx) ? e == null ? void 0 : e.sx : [e == null ? void 0 : e.sx]
|
|
53
42
|
],
|
|
54
|
-
...
|
|
43
|
+
...e,
|
|
55
44
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
45
|
+
/* @__PURE__ */ t(
|
|
46
|
+
M,
|
|
58
47
|
{
|
|
59
|
-
title: /* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
48
|
+
title: /* @__PURE__ */ a(O, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
49
|
+
/* @__PURE__ */ t(R, { annotations: n, value: r, variant: "h6" }),
|
|
50
|
+
/* @__PURE__ */ t(
|
|
51
|
+
K,
|
|
63
52
|
{
|
|
64
|
-
value: { type, value, classification },
|
|
65
|
-
annotations,
|
|
66
|
-
counters,
|
|
53
|
+
value: { type: o, value: r, classification: l },
|
|
54
|
+
annotations: n,
|
|
55
|
+
counters: m,
|
|
67
56
|
fontSize: "1em",
|
|
68
|
-
disableTooltip:
|
|
57
|
+
disableTooltip: !0
|
|
69
58
|
}
|
|
70
59
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
60
|
+
/* @__PURE__ */ t(
|
|
61
|
+
Q,
|
|
73
62
|
{
|
|
74
|
-
value: { type, value, classification },
|
|
75
|
-
annotations,
|
|
76
|
-
counters,
|
|
63
|
+
value: { type: o, value: r, classification: l },
|
|
64
|
+
annotations: n,
|
|
65
|
+
counters: m,
|
|
77
66
|
fontSize: "1em",
|
|
78
|
-
disableTooltip:
|
|
67
|
+
disableTooltip: !0
|
|
79
68
|
}
|
|
80
69
|
),
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
L,
|
|
83
72
|
{
|
|
84
|
-
value: { type, value, classification },
|
|
85
|
-
annotations,
|
|
86
|
-
counters,
|
|
87
|
-
showExtraIcon:
|
|
73
|
+
value: { type: o, value: r, classification: l },
|
|
74
|
+
annotations: n,
|
|
75
|
+
counters: m,
|
|
76
|
+
showExtraIcon: I,
|
|
88
77
|
fontSize: "inherit",
|
|
89
|
-
disableTooltip:
|
|
78
|
+
disableTooltip: !0
|
|
90
79
|
}
|
|
91
80
|
),
|
|
92
|
-
|
|
81
|
+
k && !y && /* @__PURE__ */ t(W, { color: "primary", size: 18 })
|
|
93
82
|
] })
|
|
94
83
|
}
|
|
95
84
|
),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
85
|
+
/* @__PURE__ */ t($, { sx: { mx: 1 } }),
|
|
86
|
+
/* @__PURE__ */ a(B, { sx: { p: 1 }, children: [
|
|
87
|
+
/* @__PURE__ */ a(s, { container: !0, spacing: 0.5, sx: { mb: 1 }, children: [
|
|
88
|
+
v.map((i, d) => (
|
|
100
89
|
// eslint-disable-next-line react/no-array-index-key
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
90
|
+
/* @__PURE__ */ t(s, { item: !0, children: /* @__PURE__ */ t(
|
|
91
|
+
C,
|
|
103
92
|
{
|
|
104
93
|
size: "small",
|
|
105
|
-
variant:
|
|
106
|
-
icon:
|
|
107
|
-
label: /* @__PURE__ */
|
|
108
|
-
|
|
94
|
+
variant: i === S ? "filled" : "outlined",
|
|
95
|
+
icon: T[i] && /* @__PURE__ */ t(h, { icon: T[i] }),
|
|
96
|
+
label: /* @__PURE__ */ a(g, { variant: "caption", textTransform: "capitalize", children: [
|
|
97
|
+
i,
|
|
109
98
|
":",
|
|
110
99
|
" ",
|
|
111
|
-
|
|
100
|
+
i === "all" ? n.length : n.filter((j) => j.type === i).length
|
|
112
101
|
] }),
|
|
113
|
-
onClick: () =>
|
|
102
|
+
onClick: () => A(i)
|
|
114
103
|
}
|
|
115
|
-
) },
|
|
104
|
+
) }, d)
|
|
116
105
|
)),
|
|
117
|
-
(
|
|
118
|
-
|
|
106
|
+
(c == null ? void 0 : c.length) > 0 && /* @__PURE__ */ t(s, { item: !0, children: /* @__PURE__ */ t(
|
|
107
|
+
D,
|
|
119
108
|
{
|
|
120
|
-
title: /* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
109
|
+
title: /* @__PURE__ */ t("div", { onClick: (i) => i.stopPropagation(), children: c.map((i) => /* @__PURE__ */ a("div", { children: [
|
|
110
|
+
/* @__PURE__ */ t("span", { style: { textTransform: "capitalize" }, children: i.source.replace(/-/g, " ") }),
|
|
122
111
|
":",
|
|
123
112
|
" ",
|
|
124
|
-
|
|
125
|
-
] },
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
-
|
|
113
|
+
i.message
|
|
114
|
+
] }, i.source)) }),
|
|
115
|
+
children: /* @__PURE__ */ t(
|
|
116
|
+
C,
|
|
128
117
|
{
|
|
129
118
|
size: "small",
|
|
130
119
|
variant: "outlined",
|
|
131
|
-
icon: /* @__PURE__ */
|
|
132
|
-
|
|
120
|
+
icon: /* @__PURE__ */ t(
|
|
121
|
+
h,
|
|
133
122
|
{
|
|
134
123
|
icon: "material-symbols:timer-outline",
|
|
135
|
-
color:
|
|
124
|
+
color: p.palette.error.main,
|
|
136
125
|
style: { filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" }
|
|
137
126
|
}
|
|
138
127
|
),
|
|
139
|
-
label: /* @__PURE__ */
|
|
140
|
-
|
|
128
|
+
label: /* @__PURE__ */ a(g, { variant: "caption", textTransform: "capitalize", children: [
|
|
129
|
+
E("annotation.failed"),
|
|
141
130
|
": ",
|
|
142
|
-
|
|
131
|
+
c.length
|
|
143
132
|
] }),
|
|
144
|
-
onClick:
|
|
133
|
+
onClick: w
|
|
145
134
|
}
|
|
146
135
|
)
|
|
147
136
|
}
|
|
148
137
|
) })
|
|
149
138
|
] }),
|
|
150
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ t(s, { container: !0, spacing: 1, alignItems: "stretch", children: n.map((i, d) => (
|
|
151
140
|
// eslint-disable-next-line react/no-array-index-key
|
|
152
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ t(s, { item: !0, xs: 6, minWidth: "300px", children: /* @__PURE__ */ t(G, { sx: { border: `thin solid ${p.palette.divider}`, p: 1, height: "100%" }, children: /* @__PURE__ */ t(Z, { annotation: i }) }) }, d)
|
|
153
142
|
)) })
|
|
154
143
|
] })
|
|
155
144
|
]
|
|
156
145
|
}
|
|
157
146
|
);
|
|
158
|
-
};
|
|
159
|
-
const EnrichedCard$1 = memo(EnrichedCard);
|
|
147
|
+
}, hi = U(P);
|
|
160
148
|
export {
|
|
161
|
-
|
|
149
|
+
hi as default
|
|
162
150
|
};
|
|
@@ -1,176 +1,151 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Chip, Tooltip, Box
|
|
3
|
-
import
|
|
4
|
-
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
|
-
import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
|
|
6
|
-
import { C as
|
|
7
|
-
import { useClueEnrichSelector } from "../hooks/selectors.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { u as
|
|
16
|
-
const
|
|
1
|
+
import { jsx as l, 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-DWRDhxUB.js";
|
|
7
|
+
import { useClueEnrichSelector as Q } from "../hooks/selectors.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 x, useCallback as Z, useEffect as _, memo as F } from "react";
|
|
15
|
+
import { u as d } from "../index-E7g8cRyW.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: b,
|
|
19
|
+
value: o,
|
|
20
|
+
classification: k,
|
|
21
|
+
contextIcon: y = !1,
|
|
22
|
+
counters: a = !1,
|
|
23
|
+
hideDetails: T = !1,
|
|
24
|
+
hideLoading: A = !1,
|
|
25
|
+
forceDetails: f = !1,
|
|
26
|
+
setForceDetails: u = null,
|
|
27
|
+
useDetailsIcon: p = !1,
|
|
28
|
+
skipEnrichment: R = !1,
|
|
29
|
+
slotProps: s = {},
|
|
30
|
+
...t
|
|
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 } = d(L, (i) => i.i18next), C = Y(), S = d(N, (i) => i == null ? void 0 : i.type), w = Q((i) => i.defaultClassification), n = x(() => b ?? S, [b, S]), e = x(
|
|
33
|
+
() => k ?? w,
|
|
34
|
+
[k, w]
|
|
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
|
-
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
|
-
() => !loading ? !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 [m, c] = U(n, o, e, { skipEnrichment: R }), g = d(E, (i) => i.showInfo), M = d(E, (i) => i.closeInfo), h = Z(() => {
|
|
39
|
+
const i = {};
|
|
40
|
+
return u && (i.onClose = () => u(!1)), s != null && s.popover && (i.popoverProps = s.popover), i;
|
|
41
|
+
}, [u, s.popover]), I = x(
|
|
42
|
+
() => c ? (
|
|
65
43
|
// We need to give a dummy callback when loading so the popover doesn't get confused
|
|
66
|
-
(
|
|
67
|
-
var
|
|
68
|
-
(
|
|
44
|
+
(i) => {
|
|
45
|
+
var r;
|
|
46
|
+
(r = t.onClick) == null || r.call(t, i);
|
|
69
47
|
}
|
|
70
|
-
)
|
|
48
|
+
) : !T || p ? (i) => {
|
|
49
|
+
var r;
|
|
50
|
+
g("details", C.current, { type: n, value: o, classification: e }, h()), (r = t.onClick) == null || r.call(t, i), i.stopPropagation(), i.preventDefault();
|
|
51
|
+
} : t.onClick,
|
|
71
52
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
|
-
[
|
|
53
|
+
[c, T, p, t, n, o, e]
|
|
73
54
|
);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}, [classification, forceDetails, type, value]);
|
|
85
|
-
return /* @__PURE__ */ jsx(
|
|
86
|
-
Chip,
|
|
55
|
+
return _(() => {
|
|
56
|
+
f ? g("details", C.current, { type: n, value: o, classification: e }, h()) : M("details", {
|
|
57
|
+
type: n,
|
|
58
|
+
value: o,
|
|
59
|
+
classification: e
|
|
60
|
+
});
|
|
61
|
+
}, [e, f, n, o]), /* @__PURE__ */ l(
|
|
62
|
+
B,
|
|
87
63
|
{
|
|
88
|
-
...
|
|
89
|
-
ref:
|
|
90
|
-
variant:
|
|
64
|
+
...t,
|
|
65
|
+
ref: C,
|
|
66
|
+
variant: t.variant || "outlined",
|
|
91
67
|
sx: {
|
|
92
|
-
height:
|
|
68
|
+
height: t.size !== "small" ? "40px" : "unset",
|
|
93
69
|
"& .MuiChip-label": { overflow: "visible" },
|
|
94
|
-
...
|
|
70
|
+
...t.sx ?? {}
|
|
95
71
|
},
|
|
96
|
-
label: /* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
72
|
+
label: /* @__PURE__ */ O(H, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
73
|
+
/* @__PURE__ */ l(
|
|
74
|
+
v,
|
|
99
75
|
{
|
|
100
|
-
ubiquitous:
|
|
101
|
-
value: { type, value, classification },
|
|
102
|
-
annotations,
|
|
103
|
-
counters,
|
|
104
|
-
disableTooltip:
|
|
76
|
+
ubiquitous: !0,
|
|
77
|
+
value: { type: n, value: o, classification: e },
|
|
78
|
+
annotations: m,
|
|
79
|
+
counters: a,
|
|
80
|
+
disableTooltip: f,
|
|
105
81
|
style: { flexShrink: 0 }
|
|
106
82
|
}
|
|
107
83
|
),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
|
|
84
|
+
/* @__PURE__ */ l(
|
|
85
|
+
z,
|
|
110
86
|
{
|
|
111
|
-
ubiquitous:
|
|
112
|
-
value: { type, value, classification },
|
|
113
|
-
annotations,
|
|
114
|
-
counters,
|
|
115
|
-
disableTooltip:
|
|
87
|
+
ubiquitous: !0,
|
|
88
|
+
value: { type: n, value: o, classification: e },
|
|
89
|
+
annotations: m,
|
|
90
|
+
counters: a,
|
|
91
|
+
disableTooltip: f,
|
|
116
92
|
style: { flexShrink: 0 }
|
|
117
93
|
}
|
|
118
94
|
),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
95
|
+
/* @__PURE__ */ l(
|
|
96
|
+
q,
|
|
121
97
|
{
|
|
122
|
-
ubiquitous:
|
|
123
|
-
value: { type, value, classification },
|
|
124
|
-
annotations,
|
|
125
|
-
counters,
|
|
126
|
-
showExtraIcon:
|
|
127
|
-
disableTooltip:
|
|
98
|
+
ubiquitous: !0,
|
|
99
|
+
value: { type: n, value: o, classification: e },
|
|
100
|
+
annotations: m,
|
|
101
|
+
counters: a,
|
|
102
|
+
showExtraIcon: y,
|
|
103
|
+
disableTooltip: f,
|
|
128
104
|
style: { flexShrink: 0 }
|
|
129
105
|
}
|
|
130
106
|
),
|
|
131
|
-
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
|
|
107
|
+
t.label ?? /* @__PURE__ */ l(W, { fontSize: "inherit", annotations: m, value: o }),
|
|
108
|
+
/* @__PURE__ */ l(
|
|
109
|
+
v,
|
|
134
110
|
{
|
|
135
|
-
value: { type, value, classification },
|
|
136
|
-
annotations,
|
|
137
|
-
counters,
|
|
138
|
-
disableTooltip:
|
|
111
|
+
value: { type: n, value: o, classification: e },
|
|
112
|
+
annotations: m,
|
|
113
|
+
counters: a,
|
|
114
|
+
disableTooltip: f,
|
|
139
115
|
style: { flexShrink: 0 }
|
|
140
116
|
}
|
|
141
117
|
),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
118
|
+
/* @__PURE__ */ l(
|
|
119
|
+
z,
|
|
144
120
|
{
|
|
145
|
-
value: { type, value, classification },
|
|
146
|
-
annotations,
|
|
147
|
-
counters,
|
|
148
|
-
disableTooltip:
|
|
121
|
+
value: { type: n, value: o, classification: e },
|
|
122
|
+
annotations: m,
|
|
123
|
+
counters: a,
|
|
124
|
+
disableTooltip: f,
|
|
149
125
|
style: { flexShrink: 0 }
|
|
150
126
|
}
|
|
151
127
|
),
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
|
|
128
|
+
/* @__PURE__ */ l(
|
|
129
|
+
q,
|
|
154
130
|
{
|
|
155
|
-
value: { type, value, classification },
|
|
156
|
-
annotations,
|
|
157
|
-
counters,
|
|
158
|
-
showExtraIcon:
|
|
159
|
-
disableTooltip:
|
|
131
|
+
value: { type: n, value: o, classification: e },
|
|
132
|
+
annotations: m,
|
|
133
|
+
counters: a,
|
|
134
|
+
showExtraIcon: y,
|
|
135
|
+
disableTooltip: f,
|
|
160
136
|
style: { flexShrink: 0 }
|
|
161
137
|
}
|
|
162
138
|
),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
|
|
139
|
+
/* @__PURE__ */ l(V, { counters: a, value: { type: n, value: o, classification: e }, disableTooltip: f }),
|
|
140
|
+
c && !A && /* @__PURE__ */ l(J, { color: "primary", size: 16 })
|
|
165
141
|
] }),
|
|
166
|
-
onClick:
|
|
167
|
-
onDelete: !
|
|
168
|
-
deleteIcon:
|
|
142
|
+
onClick: p ? void 0 : I,
|
|
143
|
+
onDelete: !c && p ? I : void 0,
|
|
144
|
+
deleteIcon: p ? /* @__PURE__ */ l(G, { title: j("details.open"), children: /* @__PURE__ */ l($, { component: "span", sx: { pr: 1 }, children: /* @__PURE__ */ l(K, { icon: "ic:outline-info" }) }) }) : null
|
|
169
145
|
}
|
|
170
146
|
);
|
|
171
147
|
}
|
|
172
|
-
);
|
|
173
|
-
const EnrichedChip$1 = memo(EnrichedChip);
|
|
148
|
+
), ui = F(D);
|
|
174
149
|
export {
|
|
175
|
-
|
|
150
|
+
ui as default
|
|
176
151
|
};
|