@cccsaurora/clue-ui 1.2.0-dev.253 → 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.
Files changed (179) hide show
  1. package/ActionForm-pWyIi01Z.js +4460 -0
  2. package/AnnotationDetails-11P7yhyx.js +160 -0
  3. package/AnnotationPreview-BGqlBBcp.js +140 -0
  4. package/ClueEnrichContext-DDZf646J.js +418 -0
  5. package/FlexOne-BXWFOd1T.js +6 -0
  6. package/_MapCache-BiTi0iqu.js +180 -0
  7. package/_Uint8Array-TJBs9NS2.js +101 -0
  8. package/_baseAssignValue-CNMLQZco.js +20 -0
  9. package/_baseClone-DajKHDCs.js +207 -0
  10. package/_baseExtremum-DhV10dXG.js +27 -0
  11. package/_baseFlatten-C8CjmqQ-.js +72 -0
  12. package/_baseGet-DSZygzyq.js +79 -0
  13. package/_baseIsEqual-C08cUUpA.js +147 -0
  14. package/_baseIteratee-DGZdhdqr.js +95 -0
  15. package/_baseSlice-M5RKzt1A.js +10 -0
  16. package/_baseSum-wEbgNeUs.js +10 -0
  17. package/_baseUniq-CGlHphLr.js +79 -0
  18. package/_commonjsHelpers-DaMA6jEr.js +8 -0
  19. package/_createAggregator-BvcoTZto.js +53 -0
  20. package/_getPrototype-Dm06JiGv.js +5 -0
  21. package/_getTag-Cfxlub3L.js +90 -0
  22. package/_setToArray-C7yMOeww.js +29 -0
  23. package/cloneDeep-wjl3XmFj.js +8 -0
  24. package/components/AnnotationBody.js +35 -49
  25. package/components/AnnotationDetailPopover.js +30 -36
  26. package/components/AnnotationDetails.js +7 -7
  27. package/components/AnnotationEntry.js +35 -35
  28. package/components/AnnotationPreview.js +5 -5
  29. package/components/ClassificationChip.js +23 -44
  30. package/components/CountBadge.js +26 -31
  31. package/components/EnrichedCard.js +97 -110
  32. package/components/EnrichedChip.js +105 -130
  33. package/components/EnrichedTypography.js +107 -133
  34. package/components/ErrorBoundary.js +24 -28
  35. package/components/RetryFailedEnrichments.js +9 -10
  36. package/components/SourcePicker.js +49 -57
  37. package/components/actions/ActionForm.js +4 -4
  38. package/components/actions/ExecutePopover.js +59 -75
  39. package/components/actions/ResultModal.js +4 -4
  40. package/components/actions/form/schemaAdapter.js +23 -39
  41. package/components/actions/formats/FileResult.js +59 -86
  42. package/components/actions/formats/index.js +10 -21
  43. package/components/display/graph/ExpandMoreButton.js +10 -10
  44. package/components/display/graph/elements/NodeCard.js +91 -111
  45. package/components/display/graph/elements/NodeTag.js +13 -15
  46. package/components/display/graph/index.js +202 -261
  47. package/components/display/graph/visualizations/Leaf.js +69 -88
  48. package/components/display/graph/visualizations/cloud/index.js +81 -98
  49. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  50. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  51. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  53. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  55. package/components/display/graph/visualizations/icons/index.js +13 -14
  56. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  57. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  58. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  59. package/components/display/graph/visualizations/tree/index.js +305 -407
  60. package/components/display/icons/Iconified.js +12 -27
  61. package/components/display/json/index.js +4 -4
  62. package/components/display/markdown/index.js +5770 -8678
  63. package/components/enrichment/EnrichPopover.js +46 -54
  64. package/components/fetchers/Fetcher.js +117 -155
  65. package/components/fetchers/PreviewModal.js +17 -20
  66. package/components/fetchers/StatusChip.js +17 -21
  67. package/components/group/Entry.js +11 -13
  68. package/components/group/Group.js +10 -13
  69. package/components/group/GroupControl.js +65 -76
  70. package/components/stats/QueryStatus.js +33 -43
  71. package/countBy-pIyxNZhO.js +8 -0
  72. package/data/event.js +4 -6
  73. package/database/index.js +2 -2
  74. package/debounce-DryYcbJ4.js +56 -0
  75. package/get-CH7kz5Ix.js +8 -0
  76. package/groupBy-yNrpdipq.js +8 -0
  77. package/hooks/ClueActionContext.js +6 -6
  78. package/hooks/ClueComponentContext.js +23 -29
  79. package/hooks/ClueConfigProvider.js +12 -14
  80. package/hooks/ClueDatabaseContext.js +13 -19
  81. package/hooks/ClueEnrichContext.js +8 -8
  82. package/hooks/ClueFetcherContext.js +56 -83
  83. package/hooks/ClueGroupContext.js +14 -17
  84. package/hooks/CluePopupContext.js +5 -5
  85. package/hooks/ClueProvider.js +10 -12
  86. package/hooks/selectors.js +7 -7
  87. package/hooks/useActionResult.js +2 -2
  88. package/hooks/useAnnotations.js +31 -47
  89. package/hooks/useClue.js +4 -6
  90. package/hooks/useClueActions.js +3 -3
  91. package/hooks/useClueConfig.js +4 -6
  92. package/hooks/useClueTypeConfig.js +3 -3
  93. package/hooks/useComparator.js +435 -722
  94. package/hooks/useErrors.js +18 -22
  95. package/hooks/useFetcherResult.js +24 -33
  96. package/hooks/useMyHighlights.js +36 -66
  97. package/hooks/useMyLocalStorage.js +37 -66
  98. package/iconify-BBckr5AQ.js +1263 -0
  99. package/icons/Action.js +49 -66
  100. package/icons/Assessment.js +68 -84
  101. package/icons/Context.js +63 -77
  102. package/icons/Opinion.js +65 -77
  103. package/icons/iconMap.js +2 -2
  104. package/identity-ByMq8VxU.js +6 -0
  105. package/index-BHAe_V9n.js +12768 -0
  106. package/index-CA5CUNZO.js +975 -0
  107. package/index-D_ZywK71.js +358 -0
  108. package/index-Dj5C04IX.js +568 -0
  109. package/index-p5_wX7q1.js +11729 -0
  110. package/isNil-CjWwlQS3.js +6 -0
  111. package/isObject-B53jY8Qg.js +7 -0
  112. package/isObjectLike-BatpeCIi.js +29 -0
  113. package/isSymbol-C3_SC0Qp.js +8 -0
  114. package/last-7CdUxN0r.js +7 -0
  115. package/main.js +60 -60
  116. package/package.json +1 -1
  117. package/sortBy-0BpKRt8p.js +79 -0
  118. package/sumBy-Do6Ff4Bw.js +8 -0
  119. package/text/Frequency.js +23 -42
  120. package/toFinite-BMy6GObD.js +14 -0
  121. package/toNumber-YVhnnJv4.js +31 -0
  122. package/useClueTypeConfig-77zd_zdF.js +2292 -0
  123. package/utils/chain.js +64 -91
  124. package/utils/classificationParser.js +256 -519
  125. package/utils/constants.js +10 -35
  126. package/utils/graph.js +45 -72
  127. package/utils/hashUtil.js +7 -7
  128. package/utils/line.js +81 -131
  129. package/utils/loggerUtil.js +3 -5
  130. package/utils/sessionStorage.js +27 -41
  131. package/utils/time.js +423 -423
  132. package/utils/utils.js +9 -9
  133. package/utils/window.js +10 -21
  134. package/utils-D5hPDE7N.js +129 -0
  135. package/ActionForm-C0aE9HUv.js +0 -5941
  136. package/AnnotationDetails-CEou0vCc.js +0 -175
  137. package/AnnotationPreview-CLMVD6Ec.js +0 -188
  138. package/ClueEnrichContext-BkD9ZwM9.js +0 -541
  139. package/FlexOne-BSYAhhtG.js +0 -9
  140. package/_MapCache-WmuDdwuH.js +0 -222
  141. package/_Uint8Array-DdG4KLKn.js +0 -128
  142. package/_baseAssignValue-CGTuELqU.js +0 -25
  143. package/_baseClone-BpWiBnMp.js +0 -283
  144. package/_baseExtremum-BY663UjY.js +0 -33
  145. package/_baseFlatten-B69cDsaV.js +0 -92
  146. package/_baseGet-Bx3A4Qfp.js +0 -108
  147. package/_baseIsEqual-B4IufFlL.js +0 -208
  148. package/_baseIteratee-7AQvAy1o.js +0 -126
  149. package/_baseSlice-GAv_YFTT.js +0 -20
  150. package/_baseSum-D0WC1dN0.js +0 -13
  151. package/_baseUniq-B8fK6hI-.js +0 -115
  152. package/_commonjsHelpers-DWwsNxpa.js +0 -8
  153. package/_createAggregator-CwGPThny.js +0 -63
  154. package/_getPrototype-CblfEidB.js +0 -5
  155. package/_getTag-jwz4XLoZ.js +0 -126
  156. package/_setToArray-CaPKQhcz.js +0 -33
  157. package/cloneDeep-DmUylbkM.js +0 -8
  158. package/countBy-DqlU5OwT.js +0 -14
  159. package/debounce-bV0h5FC5.js +0 -92
  160. package/get-DSsNkRQs.js +0 -8
  161. package/groupBy-ChDRT7uy.js +0 -14
  162. package/iconify-CXMreGTg.js +0 -1782
  163. package/identity-CPGTqrE4.js +0 -6
  164. package/index-AMfoEg_6.js +0 -696
  165. package/index-B6C2a_Lg.js +0 -1172
  166. package/index-C12gPw2W.js +0 -17698
  167. package/index-DCKkHTvx.js +0 -15750
  168. package/index-UkW8Sur3.js +0 -465
  169. package/isNil-CIubwp4T.js +0 -6
  170. package/isObject-FTY-5JQX.js +0 -7
  171. package/isObjectLike-OAgjjZye.js +0 -48
  172. package/isSymbol-Xd2FsJyp.js +0 -8
  173. package/last-CUCl67Im.js +0 -7
  174. package/sortBy-C7mGPI_D.js +0 -100
  175. package/sumBy-CGALjmwQ.js +0 -8
  176. package/toFinite-Bc55msYj.js +0 -16
  177. package/toNumber-DPxy1FBy.js +0 -39
  178. package/useClueTypeConfig-D2tf4-NM.js +0 -3289
  179. package/utils-71DpzFrA.js +0 -199
package/icons/Opinion.js CHANGED
@@ -1,125 +1,113 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { I as Icon } from "../iconify-CXMreGTg.js";
3
- import { useTheme, Stack, Chip, Divider, Grid } from "@mui/material";
4
- import CountBadge from "../components/CountBadge.js";
5
- import { C as CluePopupContext } from "../AnnotationPreview-CLMVD6Ec.js";
6
- import chain from "../utils/chain.js";
7
- import { g as groupBy } from "../groupBy-ChDRT7uy.js";
8
- import { s as sortBy } from "../sortBy-C7mGPI_D.js";
9
- import { s as sumBy } from "../sumBy-CGALjmwQ.js";
10
- import { memo, useRef, useMemo, useCallback, useEffect } from "react";
11
- import { u as useContextSelector } from "../index-AMfoEg_6.js";
12
- const OpinionIcon = ({ annotations, value, counters = true, disableTooltip = false, ubiquitous = false, ...otherProps }) => {
13
- const theme = useTheme();
14
- const showInfo = useContextSelector(CluePopupContext, (state) => state.showInfo);
15
- const closeInfo = useContextSelector(CluePopupContext, (state) => state.closeInfo);
16
- const anchorRef = useRef();
17
- const opinionAnnotations = useMemo(
18
- () => annotations.filter((annotation) => annotation.type === "opinion" && annotation.ubiquitous === ubiquitous),
19
- [annotations, ubiquitous]
20
- );
21
- const sortedOpinions = useMemo(
22
- () => chain(
23
- Object.entries(groupBy(opinionAnnotations, "value")).map(([_value, _annotations]) => [
24
- _value,
25
- sumBy(_annotations, "quantity")
1
+ import { jsxs as d, Fragment as $, jsx as r } from "react/jsx-runtime";
2
+ import { I as u } from "../iconify-BBckr5AQ.js";
3
+ import { useTheme as B, Stack as x, Chip as v, Divider as O, Grid as y } from "@mui/material";
4
+ import k from "../components/CountBadge.js";
5
+ import { C as b } from "../AnnotationPreview-BGqlBBcp.js";
6
+ import j from "../utils/chain.js";
7
+ import { g as q } from "../groupBy-yNrpdipq.js";
8
+ import { s as M } from "../sortBy-0BpKRt8p.js";
9
+ import { s as S } from "../sumBy-Do6Ff4Bw.js";
10
+ import { memo as R, useRef as D, useMemo as a, useCallback as E, useEffect as F } from "react";
11
+ import { u as I } from "../index-Dj5C04IX.js";
12
+ const G = ({ annotations: m, value: l, counters: C = !0, disableTooltip: c = !1, ubiquitous: p = !1, ...f }) => {
13
+ const i = B(), w = I(b, (e) => e.showInfo), h = I(b, (e) => e.closeInfo), g = D(), s = a(
14
+ () => m.filter((e) => e.type === "opinion" && e.ubiquitous === p),
15
+ [m, p]
16
+ ), o = a(
17
+ () => j(
18
+ Object.entries(q(s, "value")).map(([e, t]) => [
19
+ e,
20
+ S(t, "quantity")
26
21
  ])
27
- ).sortBy(([__, count]) => count).reverse().value(),
28
- [opinionAnnotations]
29
- );
30
- const icon = useCallback(
31
- (_opinion) => _opinion === "benign" ? "mdi:shield-check" : _opinion === "suspicious" ? "mdi:warning-outline" : _opinion === "obscure" ? "bi:eye-slash-fill" : "mdi:warning-decagram",
22
+ ).sortBy(([e, t]) => t).reverse().value(),
23
+ [s]
24
+ ), n = E(
25
+ (e) => e === "benign" ? "mdi:shield-check" : e === "suspicious" ? "mdi:warning-outline" : e === "obscure" ? "bi:eye-slash-fill" : "mdi:warning-decagram",
32
26
  []
33
27
  );
34
- useEffect(() => {
35
- if (disableTooltip) {
36
- closeInfo("opinion", value);
37
- }
38
- }, [disableTooltip]);
39
- const tooltipContent = useMemo(
40
- () => /* @__PURE__ */ jsxs(Stack, { spacing: 1, onClick: (e) => e.stopPropagation(), children: [
41
- opinionAnnotations.length > 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
42
- /* @__PURE__ */ jsx(Stack, { direction: "row", children: sortedOpinions.map(([type, count]) => /* @__PURE__ */ jsx(
43
- Chip,
28
+ F(() => {
29
+ c && h("opinion", l);
30
+ }, [c]);
31
+ const z = a(
32
+ () => /* @__PURE__ */ d(x, { spacing: 1, onClick: (e) => e.stopPropagation(), children: [
33
+ s.length > 1 && /* @__PURE__ */ d($, { children: [
34
+ /* @__PURE__ */ r(x, { direction: "row", children: o.map(([e, t]) => /* @__PURE__ */ r(
35
+ v,
44
36
  {
45
37
  size: "small",
46
38
  variant: "outlined",
47
- label: `${type}: ${count}`,
48
- icon: /* @__PURE__ */ jsx(Icon, { icon: icon(type) }),
39
+ label: `${e}: ${t}`,
40
+ icon: /* @__PURE__ */ r(u, { icon: n(e) }),
49
41
  sx: { textTransform: "capitalize" },
50
42
  color: {
51
43
  benign: "success",
52
44
  suspicious: "warning",
53
45
  obscure: "error",
54
46
  malicious: "error"
55
- }[type]
47
+ }[e]
56
48
  },
57
- type
49
+ e
58
50
  )) }),
59
- /* @__PURE__ */ jsx(Divider, { orientation: "horizontal", flexItem: true })
51
+ /* @__PURE__ */ r(O, { orientation: "horizontal", flexItem: !0 })
60
52
  ] }),
61
- /* @__PURE__ */ jsx(
62
- Grid,
53
+ /* @__PURE__ */ r(
54
+ y,
63
55
  {
64
56
  sx: {
65
- mt: opinionAnnotations.length < 2 && `${theme.spacing(-0.5)} !important`,
66
- ml: `${theme.spacing(-0.5)} !important`
57
+ mt: s.length < 2 && `${i.spacing(-0.5)} !important`,
58
+ ml: `${i.spacing(-0.5)} !important`
67
59
  },
68
- container: true,
60
+ container: !0,
69
61
  spacing: 0.5,
70
62
  maxWidth: "500px",
71
- children: sortBy(opinionAnnotations, "value").map((annotation) => /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
72
- Chip,
63
+ children: M(s, "value").map((e) => /* @__PURE__ */ r(y, { item: !0, children: /* @__PURE__ */ r(
64
+ v,
73
65
  {
74
66
  size: "small",
75
67
  variant: "outlined",
76
- label: (annotation.analytic ?? annotation.author) + (annotation.quantity > 1 ? ` (x${annotation.quantity})` : ""),
77
- icon: /* @__PURE__ */ jsx(Icon, { icon: icon(annotation.value) }),
68
+ label: (e.analytic ?? e.author) + (e.quantity > 1 ? ` (x${e.quantity})` : ""),
69
+ icon: /* @__PURE__ */ r(u, { icon: n(e.value) }),
78
70
  color: {
79
71
  benign: "success",
80
72
  suspicious: "warning",
81
73
  obscure: "error",
82
74
  malicious: "error"
83
- }[annotation.value]
75
+ }[e.value]
84
76
  }
85
- ) }, (annotation.analytic ?? annotation.author) + annotation.value))
77
+ ) }, (e.analytic ?? e.author) + e.value))
86
78
  }
87
79
  )
88
80
  ] }),
89
- [icon, opinionAnnotations, sortedOpinions, theme]
81
+ [n, s, o, i]
90
82
  );
91
- if ((opinionAnnotations == null ? void 0 : opinionAnnotations.length) < 1) {
92
- return null;
93
- }
94
- return /* @__PURE__ */ jsx(
83
+ return (s == null ? void 0 : s.length) < 1 ? null : /* @__PURE__ */ r(
95
84
  "span",
96
85
  {
97
- ref: anchorRef,
86
+ ref: g,
98
87
  style: { display: "flex" },
99
- onMouseOver: disableTooltip ? void 0 : () => showInfo("assessment", anchorRef.current, value, { content: tooltipContent }),
100
- onMouseLeave: disableTooltip ? void 0 : () => closeInfo("assessment", value),
101
- children: /* @__PURE__ */ jsx(CountBadge, { disabled: !counters, count: sortedOpinions[0][1], children: /* @__PURE__ */ jsx(
102
- Icon,
88
+ onMouseOver: c ? void 0 : () => w("assessment", g.current, l, { content: z }),
89
+ onMouseLeave: c ? void 0 : () => h("assessment", l),
90
+ children: /* @__PURE__ */ r(k, { disabled: !C, count: o[0][1], children: /* @__PURE__ */ r(
91
+ u,
103
92
  {
104
93
  fontSize: "1.25em",
105
- ...otherProps,
106
- icon: icon(sortedOpinions[0][0]),
94
+ ...f,
95
+ icon: n(o[0][0]),
107
96
  color: {
108
- benign: theme.palette.success.light,
109
- suspicious: theme.palette.warning.light,
110
- obscure: theme.palette.error.light,
111
- malicious: theme.palette.error.light
112
- }[sortedOpinions[0][0]],
97
+ benign: i.palette.success.light,
98
+ suspicious: i.palette.warning.light,
99
+ obscure: i.palette.error.light,
100
+ malicious: i.palette.error.light
101
+ }[o[0][0]],
113
102
  style: {
114
103
  zIndex: 2,
115
- ...otherProps.style ?? {}
104
+ ...f.style ?? {}
116
105
  }
117
106
  }
118
107
  ) })
119
108
  }
120
109
  );
121
- };
122
- const OpinionIcon$1 = memo(OpinionIcon);
110
+ }, Y = R(G);
123
111
  export {
124
- OpinionIcon$1 as default
112
+ Y as default
125
113
  };
package/icons/iconMap.js CHANGED
@@ -1,4 +1,4 @@
1
- const ICON_MAP = {
1
+ const o = {
2
2
  context: "material-symbols:contextual-token",
3
3
  opinion: "material-symbols:how-to-vote-rounded",
4
4
  mitigation: "material-symbols:shield-locked-rounded",
@@ -6,5 +6,5 @@ const ICON_MAP = {
6
6
  assessment: "material-symbols:menu-book"
7
7
  };
8
8
  export {
9
- ICON_MAP
9
+ o as ICON_MAP
10
10
  };
@@ -0,0 +1,6 @@
1
+ function i(t) {
2
+ return t;
3
+ }
4
+ export {
5
+ i
6
+ };