@cccsaurora/clue-ui 1.0.1 → 1.1.0-dev.10
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-D4ryHO0M.js +436 -0
- package/AnnotationDetails-YAPoqw3R.js +175 -0
- package/AnnotationPreview-DiQDjt9s.js +188 -0
- package/ClueEnrichContext-DIn6g8tw.js +522 -0
- package/FlexOne-BSYAhhtG.js +9 -0
- package/_Map-kgDsDYxq.js +64 -0
- package/_MapCache-DabaaWfq.js +161 -0
- package/_Uint8Array-BlVVH1tp.js +129 -0
- package/_baseAssignValue-CNbcU6Nb.js +25 -0
- package/_baseClone-D3a8Pa4T.js +284 -0
- package/_baseExtremum-B1o1zHjR.js +33 -0
- package/_baseFlatten-D4huXoEI.js +92 -0
- package/_baseGet-BSK_nnoz.js +109 -0
- package/_baseIsEqual-B5xLoweL.js +238 -0
- package/_baseIteratee-p6Nj07-n.js +126 -0
- package/_baseSlice-GAv_YFTT.js +20 -0
- package/_baseSum-D0WC1dN0.js +13 -0
- package/_baseUniq-CpupKWcL.js +89 -0
- package/_commonjsHelpers-CUmg6egw.js +6 -0
- package/_createAggregator-BpVy5xMi.js +63 -0
- package/_getPrototype-D1LAdQKO.js +5 -0
- package/_getTag-D3ToyefI.js +126 -0
- package/api/lookup/enrich.d.ts +3 -3
- package/cloneDeep-CjP5k9zW.js +8 -0
- package/components/AnnotationBody.js +49 -34
- package/components/AnnotationDetailPopover.js +36 -30
- package/components/AnnotationDetails.js +21 -155
- package/components/AnnotationEntry.js +50 -52
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +44 -23
- package/components/CountBadge.js +31 -26
- package/components/EnrichedCard.js +104 -92
- package/components/EnrichedChip.js +134 -109
- package/components/EnrichedTypography.js +136 -110
- package/components/ErrorBoundary.js +28 -24
- package/components/RetryFailedEnrichments.js +10 -9
- package/components/SourcePicker.js +57 -49
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +64 -50
- package/components/actions/ResultModal.js +37 -34
- package/components/actions/form/schemaAdapter.js +39 -20
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +92 -76
- package/components/display/graph/elements/NodeTag.js +15 -13
- package/components/display/graph/index.js +258 -200
- package/components/display/graph/visualizations/Leaf.js +88 -69
- package/components/display/graph/visualizations/cloud/index.js +98 -81
- package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +14 -13
- package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
- package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +407 -305
- package/components/display/icons/Iconified.js +27 -12
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/DynamicTabs.js +22 -17
- package/components/display/markdown/index.js +8527 -5670
- package/components/display/markdown/markdownPlugins/tabs.js +1 -1
- package/components/enrichment/EnrichPopover.js +55 -47
- package/components/fetchers/Fetcher.js +123 -95
- package/components/fetchers/PreviewModal.js +20 -17
- package/components/fetchers/StatusChip.js +22 -18
- 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 +37 -28
- package/countBy-C69WslUA.js +14 -0
- package/data/event.js +6 -4
- package/database/index.js +2 -2
- package/debounce-bV0h5FC5.js +92 -0
- package/get-D3C3lEU3.js +8 -0
- package/groupBy-DC2oOuBN.js +14 -0
- package/hooks/ClueActionContext.d.ts +1 -1
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +29 -23
- package/hooks/ClueConfigProvider.js +14 -12
- package/hooks/ClueDatabaseContext.js +19 -13
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +74 -46
- package/hooks/ClueGroupContext.js +17 -14
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +12 -10
- package/hooks/selectors.js +22 -11
- package/hooks/useAnnotations.js +45 -33
- package/hooks/useClue.js +6 -4
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +5 -5
- package/hooks/useClueTypeConfig.d.ts +2 -1
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +722 -435
- package/hooks/useErrors.js +22 -18
- package/hooks/useMyHighlights.js +66 -36
- package/hooks/useMyLocalStorage.js +63 -43
- package/iconify-CXMreGTg.js +1782 -0
- package/icons/Action.js +66 -49
- package/icons/Assessment.js +84 -68
- package/icons/Context.js +75 -61
- package/icons/Opinion.js +77 -65
- package/icons/iconMap.js +2 -2
- package/identity-CPGTqrE4.js +6 -0
- package/index-BDVjGvMI.js +696 -0
- package/index-BHPT3qoB.js +1172 -0
- package/index-BMxyILVD.js +465 -0
- package/index-BbPn6-Mw.js +15750 -0
- package/index-Dz1kF2MU.js +17654 -0
- package/isEmpty-BQkZubqU.js +29 -0
- package/isNil-CIubwp4T.js +6 -0
- package/isObject-FTY-5JQX.js +7 -0
- package/isObjectLike-OAgjjZye.js +48 -0
- package/isSymbol-Xd2FsJyp.js +8 -0
- package/last-CUCl67Im.js +7 -0
- package/main.d.ts +0 -1
- package/main.js +58 -68
- package/package.json +1 -1
- package/sortBy-B-UKp4GT.js +100 -0
- package/sumBy-MYkDPHZL.js +8 -0
- package/tabs-xGuUGsJd.js +254 -0
- package/text/Frequency.js +42 -23
- package/toFinite-Bc55msYj.js +16 -0
- package/toNumber-DPxy1FBy.js +39 -0
- package/useClueTypeConfig-CH-nGq6a.js +3184 -0
- package/utils/chain.js +91 -64
- package/utils/classificationParser.d.ts +8 -8
- package/utils/classificationParser.js +517 -267
- package/utils/constants.js +35 -10
- package/utils/graph.js +72 -45
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +131 -81
- package/utils/loggerUtil.js +5 -3
- package/utils/sessionStorage.js +41 -29
- package/utils/utils.js +9 -9
- package/utils/window.js +21 -10
- package/utils-Dr4wbKBZ.js +4182 -0
- package/ActionForm-WIj7BfD5.js +0 -340
- package/AnnotationPreview-DWRDhxUB.js +0 -140
- package/ClueEnrichContext-CbJVBm4w.js +0 -397
- package/FlexOne-BXWFOd1T.js +0 -6
- package/_Map-DXNg_Z-q.js +0 -54
- package/_MapCache-Cu25RRDU.js +0 -129
- package/_Uint8Array-DlJCtTvG.js +0 -102
- package/_baseAssignValue-CUmzp727.js +0 -20
- package/_baseClone-BlMmRXeX.js +0 -208
- package/_baseExtremum-P_0akmCi.js +0 -27
- package/_baseFlatten-CN7vDNEQ.js +0 -72
- package/_baseGet-Dgf6_xCm.js +0 -80
- package/_baseIsEqual-Cpjtfb3Q.js +0 -173
- package/_baseIteratee-CP1bocOX.js +0 -95
- package/_baseSlice-M5RKzt1A.js +0 -10
- package/_baseSum-wEbgNeUs.js +0 -10
- package/_baseUniq-tMFmk80M.js +0 -61
- package/_commonjsHelpers-C6fGbg64.js +0 -6
- package/_createAggregator-B4Cav8ZM.js +0 -53
- package/_getPrototype-CHAFQYL_.js +0 -5
- package/_getTag-BV_UoLYG.js +0 -90
- package/cloneDeep-BPVpFBzJ.js +0 -8
- package/countBy-DOutsa_w.js +0 -8
- package/debounce-DryYcbJ4.js +0 -56
- package/get-Bow1vKwx.js +0 -8
- package/groupBy-BheQYl6f.js +0 -8
- package/iconify-BBckr5AQ.js +0 -1263
- package/identity-ByMq8VxU.js +0 -6
- package/index-4YFAh_sa.js +0 -358
- package/index-E7g8cRyW.js +0 -568
- package/index-HuYhutsd.js +0 -975
- package/index-WvFmjbxF.js +0 -12734
- package/index-p5_wX7q1.js +0 -11729
- package/isEmpty-g47Qir2A.js +0 -21
- package/isNil-CjWwlQS3.js +0 -6
- package/isObject-B53jY8Qg.js +0 -7
- package/isObjectLike-BatpeCIi.js +0 -29
- package/isSymbol-C3_SC0Qp.js +0 -8
- package/isUndefined-DiNCDKoz.js +0 -10
- package/last-7CdUxN0r.js +0 -7
- package/sortBy-ITdmD17L.js +0 -79
- package/sumBy-DxJUU2E8.js +0 -8
- package/tabs-CgADNA57.js +0 -195
- package/toFinite-BMy6GObD.js +0 -14
- package/toNumber-YVhnnJv4.js +0 -31
- package/useClueTypeConfig-BQ33EiyB.js +0 -2273
- package/utils-C_RX5uMP.js +0 -2704
|
@@ -1,157 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
const ii = ({ enrichRequest: o, setReady: d, updatePosition: p }) => {
|
|
22
|
-
const v = M(), { t: c } = P(F, (a) => a.i18next), [r, I] = W("all"), y = H((a) => a.enrich), [t, C] = K(
|
|
23
|
-
o == null ? void 0 : o.type,
|
|
24
|
-
o == null ? void 0 : o.value,
|
|
25
|
-
o == null ? void 0 : o.classification,
|
|
26
|
-
{ skipEnrichment: !0 }
|
|
27
|
-
), m = L(o == null ? void 0 : o.value), B = k(
|
|
28
|
-
() => ["all", ...q((t ?? []).map((a) => a.type))],
|
|
29
|
-
[t]
|
|
30
|
-
), b = k(() => R(t ?? [], "type"), [t]), h = G(async () => {
|
|
31
|
-
await y(o.type, o.value, {
|
|
32
|
-
classification: o.classification,
|
|
33
|
-
timeout: 15,
|
|
34
|
-
force: !0
|
|
35
|
-
});
|
|
36
|
-
}, [o, y]);
|
|
37
|
-
return J(() => {
|
|
38
|
-
d && (d(o && !w(t)), p == null || p());
|
|
39
|
-
}, [t, o, d, p]), o && !w(t) && /* @__PURE__ */ n(l, { direction: "column", sx: { p: 1, width: "100%" }, spacing: 1, children: [
|
|
40
|
-
/* @__PURE__ */ n(l, { spacing: 1, children: [
|
|
41
|
-
/* @__PURE__ */ n(l, { direction: "row", spacing: 1, children: [
|
|
42
|
-
/* @__PURE__ */ n(l, { children: [
|
|
43
|
-
/* @__PURE__ */ n(l, { direction: "row", spacing: 1, children: [
|
|
44
|
-
/* @__PURE__ */ i(s, { variant: "body1", fontWeight: "bold", children: "Clue" }),
|
|
45
|
-
o.classification && /* @__PURE__ */ i(Y, { size: "small", classification: o.classification })
|
|
46
|
-
] }),
|
|
47
|
-
/* @__PURE__ */ n(s, { variant: "caption", color: "text.secondary", children: [
|
|
48
|
-
o.type.toLocaleUpperCase(),
|
|
49
|
-
" ",
|
|
50
|
-
c("enrichment")
|
|
51
|
-
] })
|
|
52
|
-
] }),
|
|
53
|
-
/* @__PURE__ */ i("div", { style: { flex: 1 } }),
|
|
54
|
-
/* @__PURE__ */ i(x, { title: c("refresh"), children: /* @__PURE__ */ i(z, { sx: { alignSelf: "center", m: -1 }, children: /* @__PURE__ */ i(A, { onClick: () => h(), disabled: C, children: C ? /* @__PURE__ */ i(N, { variant: "indeterminate", size: 20 }) : /* @__PURE__ */ i(g, { icon: "ic:baseline-replay", fontSize: "small" }) }) }) }),
|
|
55
|
-
/* @__PURE__ */ i(x, { title: c("clipboard"), children: /* @__PURE__ */ i(
|
|
56
|
-
A,
|
|
57
|
-
{
|
|
58
|
-
sx: { alignSelf: "center", m: -1 },
|
|
59
|
-
onClick: () => {
|
|
60
|
-
navigator.clipboard.writeText(o.value), U(
|
|
61
|
-
new CustomEvent(O, {
|
|
62
|
-
detail: {
|
|
63
|
-
message: `${o.value} ${c("clipboard.success")}`,
|
|
64
|
-
level: "success"
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
);
|
|
68
|
-
},
|
|
69
|
-
children: /* @__PURE__ */ i(g, { icon: "ic:outline-assignment", fontSize: "small" })
|
|
70
|
-
}
|
|
71
|
-
) }),
|
|
72
|
-
/* @__PURE__ */ i(Z, { selector: o }),
|
|
73
|
-
/* @__PURE__ */ i(Q, { selectors: [o] })
|
|
74
|
-
] }),
|
|
75
|
-
/* @__PURE__ */ n(l, { direction: "row", spacing: 0.5, children: [
|
|
76
|
-
B.map((a, e) => /* @__PURE__ */ i(
|
|
77
|
-
S,
|
|
78
|
-
{
|
|
79
|
-
size: "small",
|
|
80
|
-
variant: a === r ? "filled" : "outlined",
|
|
81
|
-
icon: T[a] && /* @__PURE__ */ i(E, { icon: T[a] }),
|
|
82
|
-
label: /* @__PURE__ */ n(s, { variant: "caption", textTransform: "capitalize", children: [
|
|
83
|
-
a,
|
|
84
|
-
":",
|
|
85
|
-
" ",
|
|
86
|
-
a === "all" ? t.length : t.filter((f) => f.type === a).length
|
|
87
|
-
] }),
|
|
88
|
-
onClick: () => I(a)
|
|
89
|
-
},
|
|
90
|
-
e
|
|
91
|
-
)),
|
|
92
|
-
(m == null ? void 0 : m.length) > 0 && /* @__PURE__ */ i(
|
|
93
|
-
x,
|
|
94
|
-
{
|
|
95
|
-
title: /* @__PURE__ */ i("div", { onClick: (a) => a.stopPropagation(), children: m.map((a, e) => /* @__PURE__ */ n("div", { children: [
|
|
96
|
-
/* @__PURE__ */ i("span", { style: { textTransform: "capitalize" }, children: a.source.replace(/-/g, " ") }),
|
|
97
|
-
":",
|
|
98
|
-
" ",
|
|
99
|
-
a.message
|
|
100
|
-
] }, e)) }),
|
|
101
|
-
children: /* @__PURE__ */ i(
|
|
102
|
-
S,
|
|
103
|
-
{
|
|
104
|
-
size: "small",
|
|
105
|
-
variant: "outlined",
|
|
106
|
-
icon: /* @__PURE__ */ i(E, { icon: "material-symbols:timer-outline", color: v.palette.error.main }),
|
|
107
|
-
label: /* @__PURE__ */ n(s, { variant: "caption", textTransform: "capitalize", children: [
|
|
108
|
-
c("annotation.failed"),
|
|
109
|
-
": ",
|
|
110
|
-
m.length
|
|
111
|
-
] }),
|
|
112
|
-
onClick: h
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
] })
|
|
118
|
-
] }),
|
|
119
|
-
/* @__PURE__ */ i(z, {}),
|
|
120
|
-
Object.keys(b).filter((a) => !r || r === "all" || a === r).map((a, e) => /* @__PURE__ */ n(
|
|
121
|
-
$,
|
|
122
|
-
{
|
|
123
|
-
defaultExpanded: !0,
|
|
124
|
-
sx: {
|
|
125
|
-
marginTop: `${v.spacing(1)} !important`,
|
|
126
|
-
marginBottom: "0 !important",
|
|
127
|
-
"&:before": { height: 0 }
|
|
128
|
-
},
|
|
129
|
-
children: [
|
|
130
|
-
r === "all" && /* @__PURE__ */ i(
|
|
131
|
-
j,
|
|
132
|
-
{
|
|
133
|
-
expandIcon: /* @__PURE__ */ i(g, { icon: "ic:baseline-arrow-drop-down" }),
|
|
134
|
-
sx: {
|
|
135
|
-
minHeight: "initial !important",
|
|
136
|
-
mt: 0.5,
|
|
137
|
-
mb: 0,
|
|
138
|
-
px: 1,
|
|
139
|
-
"& .MuiAccordionSummary-content": { my: 0.5, mx: 0 },
|
|
140
|
-
"& .MuiAccordionSummary-content.Mui-expanded": { my: 0.5, mx: 0 }
|
|
141
|
-
},
|
|
142
|
-
children: /* @__PURE__ */ i(s, { variant: "body1", textTransform: "capitalize", children: a }, a)
|
|
143
|
-
}
|
|
144
|
-
),
|
|
145
|
-
/* @__PURE__ */ n(_, { sx: { px: 1 }, children: [
|
|
146
|
-
r === "all" && /* @__PURE__ */ i(u, { orientation: "horizontal", sx: { mb: 1 } }),
|
|
147
|
-
/* @__PURE__ */ i(l, { spacing: 1, divider: /* @__PURE__ */ i(u, { orientation: "horizontal", flexItem: !0 }), children: b[a].map((f, D) => /* @__PURE__ */ i(X, { annotation: f }, D)) })
|
|
148
|
-
] })
|
|
149
|
-
]
|
|
150
|
-
},
|
|
151
|
-
e
|
|
152
|
-
))
|
|
153
|
-
] });
|
|
154
|
-
}, Ei = V(ii);
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../iconify-CXMreGTg.js";
|
|
3
|
+
import "@mui/material";
|
|
4
|
+
import "./display/icons/Iconified.js";
|
|
5
|
+
import "../data/event.js";
|
|
6
|
+
import "../hooks/ClueComponentContext.js";
|
|
7
|
+
import "../hooks/selectors.js";
|
|
8
|
+
import "../hooks/useAnnotations.js";
|
|
9
|
+
import "../hooks/useErrors.js";
|
|
10
|
+
import "../icons/iconMap.js";
|
|
11
|
+
import "../utils/window.js";
|
|
12
|
+
import "../groupBy-DC2oOuBN.js";
|
|
13
|
+
import { A } from "../AnnotationDetails-YAPoqw3R.js";
|
|
14
|
+
import "../ClueEnrichContext-DIn6g8tw.js";
|
|
15
|
+
import "react";
|
|
16
|
+
import "../index-BDVjGvMI.js";
|
|
17
|
+
import "./actions/ExecutePopover.js";
|
|
18
|
+
import "./AnnotationEntry.js";
|
|
19
|
+
import "./ClassificationChip.js";
|
|
20
|
+
import "./enrichment/EnrichPopover.js";
|
|
155
21
|
export {
|
|
156
|
-
|
|
22
|
+
A as default
|
|
157
23
|
};
|
|
@@ -1,56 +1,54 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { I as
|
|
3
|
-
import { Stack
|
|
4
|
-
import
|
|
5
|
-
import { t as
|
|
6
|
-
import { memo
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { I as Icon } from "../iconify-CXMreGTg.js";
|
|
3
|
+
import { Stack, Typography, Chip, IconButton } from "@mui/material";
|
|
4
|
+
import Iconified from "./display/icons/Iconified.js";
|
|
5
|
+
import { t as twitterShort } from "../utils-Dr4wbKBZ.js";
|
|
6
|
+
import { memo } from "react";
|
|
7
|
+
import AnnotationBody from "./AnnotationBody.js";
|
|
8
|
+
import ClassificationChip from "./ClassificationChip.js";
|
|
9
|
+
const AnnotatonEntry = ({ annotation }) => {
|
|
10
|
+
return /* @__PURE__ */ jsxs(Stack, { direction: "column", spacing: 1, children: [
|
|
11
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
12
|
+
annotation.analytic_icon && /* @__PURE__ */ jsx(
|
|
13
|
+
Icon,
|
|
14
|
+
{
|
|
15
|
+
style: { alignSelf: "center", filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" },
|
|
16
|
+
icon: annotation.analytic_icon
|
|
17
|
+
}
|
|
18
|
+
),
|
|
19
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", sx: { textTransform: "capitalize", maxWidth: "275px" }, children: annotation.analytic ?? annotation.author }),
|
|
20
|
+
annotation.quantity > 1 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", children: [
|
|
21
|
+
"(x",
|
|
22
|
+
annotation.quantity,
|
|
23
|
+
")"
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
26
|
+
annotation.version && /* @__PURE__ */ jsx(
|
|
27
|
+
Chip,
|
|
28
|
+
{
|
|
29
|
+
size: "small",
|
|
30
|
+
label: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31
|
+
"v",
|
|
32
|
+
annotation.version.replace(/^v/, "")
|
|
33
|
+
] })
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
annotation.link && /* @__PURE__ */ jsx(IconButton, { component: "a", href: annotation.link, target: "_blank", rel: "noreferrer", size: "small", children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-open-in-new", fontSize: "small" }) }),
|
|
37
|
+
annotation.classification && /* @__PURE__ */ jsx(ClassificationChip, { size: "small", classification: annotation.classification })
|
|
23
38
|
] }),
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
href: r.link,
|
|
34
|
-
onClick: () => window.open(r.link, "_blank", "noreferrer"),
|
|
35
|
-
target: "_blank",
|
|
36
|
-
rel: "noreferrer",
|
|
37
|
-
size: "small",
|
|
38
|
-
children: /* @__PURE__ */ e(a, { icon: "ic:baseline-open-in-new", fontSize: "small" })
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
r.classification && /* @__PURE__ */ e(f, { size: "small", classification: r.classification })
|
|
42
|
-
] }),
|
|
43
|
-
/* @__PURE__ */ e(d, { annotation: r }),
|
|
44
|
-
/* @__PURE__ */ e(c, { variant: "caption", color: "text.secondary", children: r.summary }),
|
|
45
|
-
/* @__PURE__ */ i(l, { direction: "row", children: [
|
|
46
|
-
/* @__PURE__ */ e(c, { variant: "caption", color: "text.secondary", fontSize: "10px", children: m(r.timestamp) }),
|
|
47
|
-
/* @__PURE__ */ e("div", { style: { flex: 1 } }),
|
|
48
|
-
!!r.latency && /* @__PURE__ */ i(c, { variant: "caption", color: "text.secondary", fontSize: "10px", children: [
|
|
49
|
-
Math.round(r.latency),
|
|
50
|
-
"ms"
|
|
39
|
+
/* @__PURE__ */ jsx(AnnotationBody, { annotation }),
|
|
40
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: annotation.summary }),
|
|
41
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", children: [
|
|
42
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", fontSize: "10px", children: twitterShort(annotation.timestamp) }),
|
|
43
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
44
|
+
!!annotation.latency && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", fontSize: "10px", children: [
|
|
45
|
+
Math.round(annotation.latency),
|
|
46
|
+
"ms"
|
|
47
|
+
] })
|
|
51
48
|
] })
|
|
52
|
-
] })
|
|
53
|
-
|
|
49
|
+
] });
|
|
50
|
+
};
|
|
51
|
+
const AnnotationEntry = memo(AnnotatonEntry);
|
|
54
52
|
export {
|
|
55
|
-
|
|
53
|
+
AnnotationEntry as default
|
|
56
54
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../iconify-
|
|
2
|
+
import "../iconify-CXMreGTg.js";
|
|
3
3
|
import "@mui/material";
|
|
4
|
-
import { A
|
|
4
|
+
import { A } from "../AnnotationPreview-DiQDjt9s.js";
|
|
5
5
|
import "../hooks/useAnnotations.js";
|
|
6
|
-
import "../utils-
|
|
6
|
+
import "../utils-Dr4wbKBZ.js";
|
|
7
7
|
import "react";
|
|
8
|
-
import "../index-
|
|
8
|
+
import "../index-BDVjGvMI.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
A as default
|
|
11
11
|
};
|
|
@@ -1,31 +1,52 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { Tooltip
|
|
3
|
-
import
|
|
4
|
-
import { getParts
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip, Chip } from "@mui/material";
|
|
3
|
+
import useClueConfig from "../hooks/useClueConfig.js";
|
|
4
|
+
import { getParts, normalizedClassification } from "../utils/classificationParser.js";
|
|
5
|
+
import React__default, { useMemo, memo } from "react";
|
|
6
|
+
const THEME_TYPES = ["default", "primary", "secondary", "error", "info", "success", "warning"];
|
|
7
|
+
const ClassificationChip = React__default.memo(
|
|
8
|
+
({ classification, ...otherProps }) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const { config } = useClueConfig();
|
|
11
|
+
const parts = useMemo(() => {
|
|
12
|
+
if (!config.c12nDef) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return getParts(classification, config.c12nDef, "short", true);
|
|
16
|
+
}, [classification, config.c12nDef]);
|
|
17
|
+
const normalized = useMemo(() => {
|
|
18
|
+
if (!config.c12nDef || !parts) {
|
|
19
|
+
return classification;
|
|
20
|
+
}
|
|
21
|
+
return normalizedClassification(parts, config.c12nDef, "short", true);
|
|
22
|
+
}, [classification, config.c12nDef, parts]);
|
|
23
|
+
const chipProps = useMemo(() => {
|
|
24
|
+
var _a2, _b2, _c;
|
|
25
|
+
const definedColor = (_c = (_b2 = config.c12nDef) == null ? void 0 : _b2.levels_styles_map[(_a2 = config.c12nDef) == null ? void 0 : _a2.levels_map[parts.lvlIdx]]) == null ? void 0 : _c.color;
|
|
26
|
+
if (THEME_TYPES.includes(definedColor)) {
|
|
27
|
+
return { color: definedColor };
|
|
28
|
+
}
|
|
29
|
+
if (definedColor) {
|
|
30
|
+
return { sx: { color: definedColor } };
|
|
31
|
+
}
|
|
32
|
+
return { color: "default" };
|
|
33
|
+
}, [(_a = config.c12nDef) == null ? void 0 : _a.levels_map, (_b = config.c12nDef) == null ? void 0 : _b.levels_styles_map, parts.lvlIdx]);
|
|
34
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: classification, children: /* @__PURE__ */ jsx(
|
|
35
|
+
Chip,
|
|
16
36
|
{
|
|
17
|
-
variant:
|
|
18
|
-
label:
|
|
19
|
-
...
|
|
20
|
-
...
|
|
37
|
+
variant: otherProps.variant || "outlined",
|
|
38
|
+
label: normalized,
|
|
39
|
+
...chipProps,
|
|
40
|
+
...otherProps,
|
|
21
41
|
sx: [
|
|
22
|
-
...Array.isArray(
|
|
23
|
-
...Array.isArray(
|
|
42
|
+
...Array.isArray(chipProps.sx) ? chipProps.sx : [chipProps.sx],
|
|
43
|
+
...Array.isArray(otherProps.sx) ? otherProps.sx : [otherProps.sx]
|
|
24
44
|
]
|
|
25
45
|
}
|
|
26
46
|
) });
|
|
27
47
|
}
|
|
28
|
-
)
|
|
48
|
+
);
|
|
49
|
+
const ClassificationChip$1 = memo(ClassificationChip);
|
|
29
50
|
export {
|
|
30
|
-
|
|
51
|
+
ClassificationChip$1 as default
|
|
31
52
|
};
|
package/components/CountBadge.js
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { Badge
|
|
3
|
-
import { forwardRef
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ref: o,
|
|
8
|
-
...e,
|
|
9
|
-
badgeContent: t < 100 ? t : "99+",
|
|
10
|
-
color: a,
|
|
11
|
-
sx: (i) => ({
|
|
12
|
-
"& .MuiBadge-badge": {
|
|
13
|
-
backgroundColor: "transparent",
|
|
14
|
-
color: i.palette[a].main,
|
|
15
|
-
fontWeight: "bold",
|
|
16
|
-
right: 0,
|
|
17
|
-
top: 0,
|
|
18
|
-
transform: `translateY(-25%) translateX(${Math.min(Math.ceil(Math.log10(t)), 3) * 10}%)`,
|
|
19
|
-
px: 0,
|
|
20
|
-
fontSize: ".85rem"
|
|
21
|
-
},
|
|
22
|
-
pr: 1.5
|
|
23
|
-
}),
|
|
24
|
-
children: r
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Badge } from "@mui/material";
|
|
3
|
+
import { forwardRef, cloneElement, Children } from "react";
|
|
4
|
+
const CountBadge = forwardRef(({ children, color = "primary", count, disabled, ...props }, ref) => {
|
|
5
|
+
if (disabled) {
|
|
6
|
+
return cloneElement(Children.only(children), { ref, ...props });
|
|
25
7
|
}
|
|
26
|
-
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Badge,
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
...props,
|
|
13
|
+
badgeContent: count < 100 ? count : "99+",
|
|
14
|
+
color,
|
|
15
|
+
sx: (theme) => ({
|
|
16
|
+
"& .MuiBadge-badge": {
|
|
17
|
+
backgroundColor: "transparent",
|
|
18
|
+
color: theme.palette[color].main,
|
|
19
|
+
fontWeight: "bold",
|
|
20
|
+
right: 0,
|
|
21
|
+
top: 0,
|
|
22
|
+
transform: `translateY(-25%) translateX(${Math.min(Math.ceil(Math.log10(count)), 3) * 10}%)`,
|
|
23
|
+
px: 0,
|
|
24
|
+
fontSize: ".85rem"
|
|
25
|
+
},
|
|
26
|
+
pr: 1.5
|
|
27
|
+
}),
|
|
28
|
+
children
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
});
|
|
27
32
|
export {
|
|
28
|
-
|
|
33
|
+
CountBadge as default
|
|
29
34
|
};
|