@cccsaurora/clue-ui 0.15.0-dev.30 → 0.15.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 (257) hide show
  1. package/package.json +141 -37
  2. package/ActionForm-DgfJwTzt.js +0 -436
  3. package/AnnotationPreview-BvNpZOP0.js +0 -188
  4. package/ClueEnrichContext-DXwLVp0M.js +0 -518
  5. package/FlexOne-BSYAhhtG.js +0 -9
  6. package/_Map-kgDsDYxq.js +0 -64
  7. package/_MapCache-DabaaWfq.js +0 -161
  8. package/_Uint8Array-BlVVH1tp.js +0 -129
  9. package/_baseAssignValue-CNbcU6Nb.js +0 -25
  10. package/_baseClone-D3a8Pa4T.js +0 -284
  11. package/_baseExtremum-B1o1zHjR.js +0 -33
  12. package/_baseFlatten-D4huXoEI.js +0 -92
  13. package/_baseGet-BSK_nnoz.js +0 -109
  14. package/_baseIsEqual-B5xLoweL.js +0 -238
  15. package/_baseIteratee-p6Nj07-n.js +0 -126
  16. package/_baseSlice-GAv_YFTT.js +0 -20
  17. package/_baseSum-D0WC1dN0.js +0 -13
  18. package/_baseUniq-CpupKWcL.js +0 -89
  19. package/_commonjsHelpers-CUmg6egw.js +0 -6
  20. package/_createAggregator-BpVy5xMi.js +0 -63
  21. package/_getPrototype-D1LAdQKO.js +0 -5
  22. package/_getTag-D3ToyefI.js +0 -126
  23. package/api/lookup/enrich.d.ts +0 -10
  24. package/api/lookup/index.d.ts +0 -5
  25. package/api/lookup/types.d.ts +0 -5
  26. package/api/lookup/types_detection.d.ts +0 -5
  27. package/cloneDeep-CjP5k9zW.js +0 -8
  28. package/components/AnnotationBody.d.ts +0 -6
  29. package/components/AnnotationBody.js +0 -56
  30. package/components/AnnotationDetailPopover.d.ts +0 -14
  31. package/components/AnnotationDetailPopover.js +0 -61
  32. package/components/AnnotationDetails.d.ts +0 -8
  33. package/components/AnnotationDetails.js +0 -172
  34. package/components/AnnotationEntry.d.ts +0 -6
  35. package/components/AnnotationEntry.js +0 -59
  36. package/components/AnnotationPreview.d.ts +0 -14
  37. package/components/AnnotationPreview.js +0 -11
  38. package/components/ClassificationChip.d.ts +0 -11
  39. package/components/ClassificationChip.js +0 -52
  40. package/components/CountBadge.d.ts +0 -8
  41. package/components/CountBadge.js +0 -34
  42. package/components/EnrichedCard.d.ts +0 -14
  43. package/components/EnrichedCard.js +0 -162
  44. package/components/EnrichedChip.d.ts +0 -9
  45. package/components/EnrichedChip.js +0 -176
  46. package/components/EnrichedTypography.d.ts +0 -16
  47. package/components/EnrichedTypography.js +0 -178
  48. package/components/ErrorBoundary.d.ts +0 -15
  49. package/components/ErrorBoundary.js +0 -36
  50. package/components/RetryFailedEnrichments.d.ts +0 -2
  51. package/components/RetryFailedEnrichments.js +0 -13
  52. package/components/SourcePicker.d.ts +0 -2
  53. package/components/SourcePicker.js +0 -98
  54. package/components/actions/ActionForm.d.ts +0 -6
  55. package/components/actions/ActionForm.js +0 -16
  56. package/components/actions/ExecutePopover.d.ts +0 -10
  57. package/components/actions/ExecutePopover.js +0 -93
  58. package/components/actions/ResultModal.d.ts +0 -9
  59. package/components/actions/ResultModal.js +0 -46
  60. package/components/actions/form/schemaAdapter.d.ts +0 -3
  61. package/components/actions/form/schemaAdapter.js +0 -47
  62. package/components/display/graph/ExpandMoreButton.d.ts +0 -7
  63. package/components/display/graph/ExpandMoreButton.js +0 -18
  64. package/components/display/graph/elements/NodeCard.d.ts +0 -10
  65. package/components/display/graph/elements/NodeCard.js +0 -146
  66. package/components/display/graph/elements/NodeTag.d.ts +0 -9
  67. package/components/display/graph/elements/NodeTag.js +0 -17
  68. package/components/display/graph/index.d.ts +0 -9
  69. package/components/display/graph/index.js +0 -438
  70. package/components/display/graph/visualizations/Leaf.d.ts +0 -25
  71. package/components/display/graph/visualizations/Leaf.js +0 -125
  72. package/components/display/graph/visualizations/cloud/index.d.ts +0 -24
  73. package/components/display/graph/visualizations/cloud/index.js +0 -141
  74. package/components/display/graph/visualizations/icons/BaseIcon.d.ts +0 -12
  75. package/components/display/graph/visualizations/icons/BaseIcon.js +0 -37
  76. package/components/display/graph/visualizations/icons/BugIcon.d.ts +0 -5
  77. package/components/display/graph/visualizations/icons/BugIcon.js +0 -18
  78. package/components/display/graph/visualizations/icons/HostIcon.d.ts +0 -5
  79. package/components/display/graph/visualizations/icons/HostIcon.js +0 -24
  80. package/components/display/graph/visualizations/icons/NetworkIcon.d.ts +0 -5
  81. package/components/display/graph/visualizations/icons/NetworkIcon.js +0 -24
  82. package/components/display/graph/visualizations/icons/ProcessIcon.d.ts +0 -5
  83. package/components/display/graph/visualizations/icons/ProcessIcon.js +0 -18
  84. package/components/display/graph/visualizations/icons/TargetIcon.d.ts +0 -5
  85. package/components/display/graph/visualizations/icons/TargetIcon.js +0 -19
  86. package/components/display/graph/visualizations/icons/index.d.ts +0 -2
  87. package/components/display/graph/visualizations/icons/index.js +0 -16
  88. package/components/display/graph/visualizations/panels/NodePanel.d.ts +0 -8
  89. package/components/display/graph/visualizations/panels/NodePanel.js +0 -12
  90. package/components/display/graph/visualizations/tree/BundleLine.d.ts +0 -29
  91. package/components/display/graph/visualizations/tree/BundleLine.js +0 -121
  92. package/components/display/graph/visualizations/tree/Triangle.d.ts +0 -9
  93. package/components/display/graph/visualizations/tree/Triangle.js +0 -26
  94. package/components/display/graph/visualizations/tree/index.d.ts +0 -36
  95. package/components/display/graph/visualizations/tree/index.js +0 -485
  96. package/components/display/graph/visualizations/tree/types.d.ts +0 -11
  97. package/components/display/graph/visualizations/tree/types.js +0 -1
  98. package/components/display/icons/Iconified.d.ts +0 -9
  99. package/components/display/icons/Iconified.js +0 -29
  100. package/components/display/json/index.d.ts +0 -14
  101. package/components/display/json/index.js +0 -12
  102. package/components/display/markdown/DynamicTabs.d.ts +0 -8
  103. package/components/display/markdown/DynamicTabs.js +0 -26
  104. package/components/display/markdown/index.d.ts +0 -9
  105. package/components/display/markdown/index.js +0 -13389
  106. package/components/display/markdown/markdownPlugins/tabs.d.ts +0 -3
  107. package/components/display/markdown/markdownPlugins/tabs.js +0 -4
  108. package/components/enrichment/EnrichPopover.d.ts +0 -10
  109. package/components/enrichment/EnrichPopover.js +0 -88
  110. package/components/fetchers/Fetcher.d.ts +0 -17
  111. package/components/fetchers/Fetcher.js +0 -188
  112. package/components/fetchers/PreviewModal.d.ts +0 -8
  113. package/components/fetchers/PreviewModal.js +0 -22
  114. package/components/fetchers/StatusChip.d.ts +0 -8
  115. package/components/fetchers/StatusChip.js +0 -30
  116. package/components/group/Entry.d.ts +0 -8
  117. package/components/group/Entry.js +0 -15
  118. package/components/group/Group.d.ts +0 -12
  119. package/components/group/Group.js +0 -15
  120. package/components/group/GroupControl.d.ts +0 -4
  121. package/components/group/GroupControl.js +0 -103
  122. package/components/stats/QueryStatus.d.ts +0 -4
  123. package/components/stats/QueryStatus.js +0 -61
  124. package/countBy-C69WslUA.js +0 -14
  125. package/data/event.d.ts +0 -12
  126. package/data/event.js +0 -8
  127. package/database/index.d.ts +0 -4
  128. package/database/index.js +0 -4
  129. package/database/selector.schema.json.d.ts +0 -119
  130. package/database/status.schema.json.d.ts +0 -38
  131. package/database/types.d.ts +0 -64
  132. package/debounce-bV0h5FC5.js +0 -92
  133. package/en/translation.json +0 -135
  134. package/fr/translation.json +0 -135
  135. package/get-D3C3lEU3.js +0 -8
  136. package/groupBy-DC2oOuBN.js +0 -14
  137. package/hooks/ClueActionContext.d.ts +0 -86
  138. package/hooks/ClueActionContext.js +0 -18
  139. package/hooks/ClueComponentContext.d.ts +0 -10
  140. package/hooks/ClueComponentContext.js +0 -40
  141. package/hooks/ClueConfigProvider.d.ts +0 -12
  142. package/hooks/ClueConfigProvider.js +0 -23
  143. package/hooks/ClueDatabaseContext.d.ts +0 -10
  144. package/hooks/ClueDatabaseContext.js +0 -23
  145. package/hooks/ClueEnrichContext.d.ts +0 -6
  146. package/hooks/ClueEnrichContext.js +0 -15
  147. package/hooks/ClueEnrichContextType.d.ts +0 -113
  148. package/hooks/ClueEnrichProps.d.ts +0 -81
  149. package/hooks/ClueFetcherContext.d.ts +0 -35
  150. package/hooks/ClueFetcherContext.js +0 -88
  151. package/hooks/ClueGroupContext.d.ts +0 -14
  152. package/hooks/ClueGroupContext.js +0 -23
  153. package/hooks/CluePopupContext.d.ts +0 -24
  154. package/hooks/CluePopupContext.js +0 -12
  155. package/hooks/ClueProvider.d.ts +0 -9
  156. package/hooks/ClueProvider.js +0 -14
  157. package/hooks/selectors.d.ts +0 -10
  158. package/hooks/selectors.js +0 -24
  159. package/hooks/useAnnotations.d.ts +0 -24
  160. package/hooks/useAnnotations.js +0 -69
  161. package/hooks/useClue.d.ts +0 -4
  162. package/hooks/useClue.js +0 -8
  163. package/hooks/useClueActions.d.ts +0 -4
  164. package/hooks/useClueActions.js +0 -5
  165. package/hooks/useClueConfig.d.ts +0 -1
  166. package/hooks/useClueConfig.js +0 -8
  167. package/hooks/useClueTypeConfig.d.ts +0 -17
  168. package/hooks/useClueTypeConfig.js +0 -7
  169. package/hooks/useComparator.d.ts +0 -16
  170. package/hooks/useComparator.js +0 -1060
  171. package/hooks/useErrors.d.ts +0 -17
  172. package/hooks/useErrors.js +0 -35
  173. package/hooks/useMyHighlights.d.ts +0 -11
  174. package/hooks/useMyHighlights.js +0 -74
  175. package/hooks/useMyLocalStorage.d.ts +0 -16
  176. package/hooks/useMyLocalStorage.js +0 -80
  177. package/iconify-CXMreGTg.js +0 -1782
  178. package/icons/Action.d.ts +0 -9
  179. package/icons/Action.js +0 -90
  180. package/icons/Assessment.d.ts +0 -11
  181. package/icons/Assessment.js +0 -123
  182. package/icons/Context.d.ts +0 -12
  183. package/icons/Context.js +0 -83
  184. package/icons/Opinion.d.ts +0 -11
  185. package/icons/Opinion.js +0 -125
  186. package/icons/iconMap.d.ts +0 -7
  187. package/icons/iconMap.js +0 -10
  188. package/identity-CPGTqrE4.js +0 -6
  189. package/index-BDVjGvMI.js +0 -696
  190. package/index-BDrtH5ec.js +0 -465
  191. package/index-C9lySIVX.js +0 -1172
  192. package/index-DJYqRcxJ.js +0 -15750
  193. package/index-Dn2NHyXg.js +0 -17654
  194. package/index.css +0 -21
  195. package/isEmpty-BQkZubqU.js +0 -29
  196. package/isNil-CIubwp4T.js +0 -6
  197. package/isObject-FTY-5JQX.js +0 -7
  198. package/isObjectLike-OAgjjZye.js +0 -48
  199. package/isSymbol-Xd2FsJyp.js +0 -8
  200. package/isUndefined-CE8h73dH.js +0 -10
  201. package/last-CUCl67Im.js +0 -7
  202. package/main.d.ts +0 -42
  203. package/main.js +0 -70
  204. package/public/manifest.json +0 -16
  205. package/public/robots.txt +0 -3
  206. package/public/svg/dark/clue-h.svg +0 -52
  207. package/public/svg/dark/clue-icon1-simple.svg +0 -33
  208. package/public/svg/dark/clue-icon1.svg +0 -44
  209. package/public/svg/dark/clue-icon2-simple.svg +0 -26
  210. package/public/svg/dark/clue-icon2.svg +0 -37
  211. package/public/svg/dark/clue-name.svg +0 -14
  212. package/public/svg/dark/clue-v.svg +0 -52
  213. package/public/svg/light/clue-h.svg +0 -60
  214. package/public/svg/light/clue-icon1-simple.svg +0 -37
  215. package/public/svg/light/clue-icon1.svg +0 -48
  216. package/public/svg/light/clue-icon2-simple.svg +0 -30
  217. package/public/svg/light/clue-icon2.svg +0 -41
  218. package/public/svg/light/clue-name.svg +0 -14
  219. package/public/svg/light/clue-v.svg +0 -60
  220. package/sortBy-B-UKp4GT.js +0 -100
  221. package/sumBy-MYkDPHZL.js +0 -8
  222. package/tabs-xGuUGsJd.js +0 -254
  223. package/text/Frequency.d.ts +0 -9
  224. package/text/Frequency.js +0 -49
  225. package/toFinite-CArjry_l.js +0 -16
  226. package/toNumber-DPxy1FBy.js +0 -39
  227. package/types/EnrichmentProps.d.ts +0 -73
  228. package/types/RunningActionData.d.ts +0 -15
  229. package/types/WithActionData.d.ts +0 -9
  230. package/types/action.d.ts +0 -25
  231. package/types/config.d.ts +0 -16
  232. package/types/fetcher.d.ts +0 -60
  233. package/types/graph.d.ts +0 -101
  234. package/types/lookup.d.ts +0 -62
  235. package/types/network.d.ts +0 -9
  236. package/useClueTypeConfig-D9ZSxa4F.js +0 -3096
  237. package/utils/chain.d.ts +0 -14
  238. package/utils/chain.js +0 -106
  239. package/utils/classificationParser.d.ts +0 -195
  240. package/utils/classificationParser.js +0 -553
  241. package/utils/constants.d.ts +0 -26
  242. package/utils/constants.js +0 -36
  243. package/utils/graph.d.ts +0 -13
  244. package/utils/graph.js +0 -79
  245. package/utils/hashUtil.d.ts +0 -6
  246. package/utils/hashUtil.js +0 -11
  247. package/utils/line.d.ts +0 -28
  248. package/utils/line.js +0 -136
  249. package/utils/loggerUtil.d.ts +0 -6
  250. package/utils/loggerUtil.js +0 -8
  251. package/utils/sessionStorage.d.ts +0 -9
  252. package/utils/sessionStorage.js +0 -51
  253. package/utils/utils.d.ts +0 -13
  254. package/utils/utils.js +0 -11
  255. package/utils/window.d.ts +0 -3
  256. package/utils/window.js +0 -24
  257. package/utils-CxIhC2xH.js +0 -4182
@@ -1,125 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { i as isObjectLike, b as baseGetTag } from "../../../../isObjectLike-OAgjjZye.js";
3
- import { useState, useMemo, useCallback, useEffect } from "react";
4
- var numberTag = "[object Number]";
5
- function isNumber(value) {
6
- return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
7
- }
8
- const DEFAULT_NODE_RADIUS = 10;
9
- const Leaf = ({
10
- nodeId,
11
- label = nodeId,
12
- x,
13
- y,
14
- height,
15
- nodeRadius = DEFAULT_NODE_RADIUS,
16
- nodeColor,
17
- nodeOpacity = 1,
18
- letterSize,
19
- letterWidth,
20
- textColor,
21
- style = {},
22
- selected = false,
23
- alwaysShowText = false,
24
- onHoverChanged,
25
- onClick,
26
- children
27
- }) => {
28
- const [isSelected, setIsSelected] = useState(selected);
29
- const [isHovered, setIsHovered] = useState(false);
30
- const classNames = useMemo(() => {
31
- const _classNames = ["node"];
32
- if (isHovered) {
33
- _classNames.push("hover");
34
- }
35
- if (isSelected) {
36
- _classNames.push("selected");
37
- }
38
- return _classNames;
39
- }, [isHovered, isSelected]);
40
- const handleOnClick = useCallback(
41
- (event) => {
42
- onClick == null ? void 0 : onClick(nodeId, !isSelected, event);
43
- setIsSelected(!isSelected);
44
- },
45
- [nodeId, onClick, isSelected]
46
- );
47
- const handleOnHoverChanged = useCallback(
48
- (value) => {
49
- setIsHovered(value);
50
- onHoverChanged == null ? void 0 : onHoverChanged(nodeId, value);
51
- },
52
- [nodeId, onHoverChanged]
53
- );
54
- useEffect(() => setIsSelected(selected), [selected]);
55
- let strokeWidth = `${nodeRadius}px`;
56
- if (style.strokeWidth) {
57
- if (isNumber(style.strokeWidth)) {
58
- strokeWidth = `${nodeRadius * style.strokeWidth}px`;
59
- } else {
60
- strokeWidth = style.strokeWidth;
61
- }
62
- }
63
- return /* @__PURE__ */ jsxs(
64
- "g",
65
- {
66
- id: "node-" + nodeId.replace(/[^A-Za-z0-9]*/g, ""),
67
- style: { strokeLinecap: "round" },
68
- className: classNames.join(" "),
69
- onClick: handleOnClick,
70
- onMouseOver: () => handleOnHoverChanged(true),
71
- onMouseLeave: () => handleOnHoverChanged(false),
72
- children: [
73
- children,
74
- /* @__PURE__ */ jsx(
75
- "path",
76
- {
77
- className: "border",
78
- d: `M ${x} ${y} L ${x} ${y + Math.max(height, 0)}`,
79
- style: {
80
- strokeOpacity: nodeOpacity,
81
- ...style,
82
- strokeWidth: `calc(${strokeWidth} * 2)`,
83
- stroke: style.stroke ?? nodeColor.border
84
- }
85
- },
86
- nodeId + "-border"
87
- ),
88
- /* @__PURE__ */ jsx(
89
- "path",
90
- {
91
- className: "center",
92
- d: `M ${x} ${y} L ${x} ${y + Math.max(height, 0)}`,
93
- style: {
94
- strokeOpacity: nodeOpacity,
95
- ...style,
96
- strokeWidth,
97
- stroke: style.fill ?? nodeColor.center
98
- }
99
- },
100
- nodeId + "-middle"
101
- ),
102
- (isHovered || alwaysShowText) && label.split("\n").reverse().map((_label, index, arr) => /* @__PURE__ */ jsx(
103
- "text",
104
- {
105
- x: x + letterWidth,
106
- y: y - letterSize / 2 + arr.length - index * letterSize,
107
- fill: textColor,
108
- style: {
109
- cursor: "default",
110
- fontFamily: '"Lucida Console", monospace',
111
- fontSize: letterSize + "px",
112
- fillOpacity: nodeOpacity
113
- },
114
- children: _label
115
- },
116
- nodeId + "-label-" + _label
117
- ))
118
- ]
119
- },
120
- nodeId
121
- );
122
- };
123
- export {
124
- Leaf as default
125
- };
@@ -1,24 +0,0 @@
1
- import { NestedDataset } from "../../../../../types/graph";
2
- import { MutableRefObject } from 'react';
3
-
4
- declare const DEFAULT_OPTIONS: {
5
- width: string;
6
- backgroundColor: string;
7
- textColor: string;
8
- nodeColor: {
9
- border: string;
10
- center: string;
11
- };
12
- letterSize: number;
13
- letterWidth: number;
14
- nodeRadius: number;
15
- lineWidth: number;
16
- circlePadding: any;
17
- };
18
- type Options = Partial<typeof DEFAULT_OPTIONS>;
19
- declare const _default: import('react').NamedExoticComponent<{
20
- svgRef?: MutableRefObject<SVGSVGElement>;
21
- graph: NestedDataset;
22
- options?: Options;
23
- }>;
24
- export default _default;
@@ -1,141 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { o as ordinal, d as d3, S as Spectral, a as index, h as hierarchy } from "../../../../../index-DJYqRcxJ.js";
3
- import useMyHighlights from "../../../../../hooks/useMyHighlights.js";
4
- import { useMyLocalStorageItem } from "../../../../../hooks/useMyLocalStorage.js";
5
- import { StorageKey } from "../../../../../utils/constants.js";
6
- import { cyrb53 } from "../../../../../utils/graph.js";
7
- import { c as countBy } from "../../../../../countBy-C69WslUA.js";
8
- import { s as sumBy } from "../../../../../sumBy-MYkDPHZL.js";
9
- import { memo, useRef, useMemo, useCallback } from "react";
10
- import Leaf from "../Leaf.js";
11
- const DEFAULT_OPTIONS = {
12
- width: "100%",
13
- backgroundColor: "grey",
14
- textColor: "black",
15
- nodeColor: {
16
- border: "black",
17
- center: "white"
18
- },
19
- letterSize: 12,
20
- letterWidth: 8,
21
- nodeRadius: 8,
22
- lineWidth: 2,
23
- circlePadding: null
24
- // We'll make this dynamic
25
- };
26
- DEFAULT_OPTIONS.circlePadding = 3 * DEFAULT_OPTIONS.nodeRadius;
27
- const Cloud = ({ svgRef, graph, options = {} }) => {
28
- const {
29
- width,
30
- backgroundColor,
31
- textColor,
32
- letterSize,
33
- letterWidth,
34
- circlePadding,
35
- nodeRadius,
36
- nodeColor,
37
- lineWidth
38
- } = {
39
- ...DEFAULT_OPTIONS,
40
- ...options
41
- };
42
- const { onNodeHoveredChanged, onNodeClicked, nodeOpacities, highlightedPath } = useMyHighlights(graph);
43
- const [colorScheme] = useMyLocalStorageItem(StorageKey.COLOR_SCHEME, "Spectral");
44
- const currentX = useRef(2 * nodeRadius);
45
- const currentY = useRef(letterSize + nodeRadius);
46
- const nodeLocations = useRef({});
47
- const nodes = useMemo(
48
- () => graph.data.flatMap(
49
- (cloud, cloudIndex) => cloud.map((node) => ({
50
- ...node,
51
- cloud: cloudIndex.toString()
52
- }))
53
- ),
54
- [graph.data]
55
- );
56
- const clouds = useMemo(() => countBy(nodes, (node) => node.cloud), [nodes]);
57
- const colors = useMemo(
58
- () => ordinal(
59
- Object.keys(clouds).map((cloud) => (d3[`interpolate${colorScheme}`] ?? Spectral)(cyrb53(cloud)))
60
- ),
61
- [clouds, colorScheme]
62
- );
63
- const links = useMemo(
64
- () => nodes.flatMap(
65
- (node) => ((node == null ? void 0 : node.edges) ?? []).map((parent) => ({
66
- source: node.id,
67
- target: parent
68
- }))
69
- ),
70
- [nodes]
71
- );
72
- const pack = useMemo(() => index().size([600, 600]).padding(circlePadding), [circlePadding]);
73
- const cloudLocations = useMemo(() => {
74
- const data = Object.entries(clouds).map(([id]) => ({
75
- id,
76
- children: nodes.filter((node) => node.cloud === id).map((node) => ({
77
- ...node,
78
- value: 1
79
- }))
80
- }));
81
- return pack(
82
- hierarchy({ children: data }).sum((d) => d.children ? sumBy(d.children, (c) => c.value) : d.value)
83
- ).children;
84
- }, [clouds, nodes, pack]);
85
- const opacities = useCallback(
86
- (link) => highlightedPath.size === 0 || highlightedPath.has(link.source) && highlightedPath.has(link.target) ? 1 : 0.2,
87
- [highlightedPath]
88
- );
89
- currentX.current = 2 * nodeRadius;
90
- currentY.current = letterSize + nodeRadius;
91
- nodeLocations.current = {};
92
- return /* @__PURE__ */ jsx("svg", { id: "viz", ref: svgRef, width, height: 600, style: { backgroundColor }, children: /* @__PURE__ */ jsxs("g", { id: "view", children: [
93
- cloudLocations.map((cloud) => /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("circle", { cx: cloud.x, cy: cloud.y, r: cloud.r, strokeWidth: 4, stroke: colors(cloud.data.id), fill: "none" }) }, cloud.data.id)),
94
- links.map((link) => {
95
- const source = cloudLocations.flatMap((c) => c.children).find((node) => node.data.id === link.source);
96
- const target = cloudLocations.flatMap((c) => c.children).find((node) => node.data.id === link.target);
97
- return /* @__PURE__ */ jsxs("g", { children: [
98
- /* @__PURE__ */ jsx(
99
- "path",
100
- {
101
- d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
102
- stroke: "black",
103
- strokeWidth: lineWidth + 3,
104
- strokeOpacity: opacities(link)
105
- }
106
- ),
107
- /* @__PURE__ */ jsx(
108
- "path",
109
- {
110
- d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
111
- stroke: "white",
112
- strokeWidth: lineWidth,
113
- strokeOpacity: opacities(link)
114
- }
115
- )
116
- ] }, source.data.id + target.data.id);
117
- }),
118
- cloudLocations.map((cloud) => /* @__PURE__ */ jsx("g", { children: cloud.children.map((node) => /* @__PURE__ */ jsx(
119
- Leaf,
120
- {
121
- nodeId: node.data.id,
122
- height: 0,
123
- x: node.x,
124
- y: node.y,
125
- nodeRadius,
126
- nodeColor,
127
- nodeOpacity: nodeOpacities(node.data.id),
128
- letterSize,
129
- letterWidth,
130
- textColor,
131
- onHoverChanged: onNodeHoveredChanged,
132
- onClick: onNodeClicked
133
- },
134
- node.data.id
135
- )) }, cloud.id))
136
- ] }) });
137
- };
138
- const Cloud$1 = memo(Cloud);
139
- export {
140
- Cloud$1 as default
141
- };
@@ -1,12 +0,0 @@
1
- import { CSSProperties, FC, SVGProps } from 'react';
2
-
3
- export interface IconProps extends SVGProps<SVGSVGElement> {
4
- x?: number;
5
- y?: number;
6
- width?: number;
7
- height?: number;
8
- size?: number;
9
- circleStyle?: CSSProperties;
10
- }
11
- declare const BaseIcon: FC<IconProps>;
12
- export default BaseIcon;
@@ -1,37 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- const DEFAULTS = {
4
- size: 20
5
- };
6
- const BaseIcon = (props) => {
7
- const { width, height, size } = {
8
- ...DEFAULTS,
9
- ...props
10
- };
11
- const x = (props.x ?? 0) - (width ?? size) / 2;
12
- const y = (props.y ?? 0) - (height ?? size) / 2;
13
- const trimmedProps = useMemo(() => {
14
- const _props = { ...props };
15
- delete _props.circleStyle;
16
- return _props;
17
- }, [props]);
18
- return /* @__PURE__ */ jsxs("g", { children: [
19
- /* @__PURE__ */ jsx("circle", { cx: props.x, cy: props.y, r: size / 2, style: props.circleStyle ?? {} }),
20
- /* @__PURE__ */ jsx(
21
- "svg",
22
- {
23
- xmlns: "http://www.w3.org/2000/svg",
24
- viewBox: "0 -960 960 960",
25
- width: width ?? size,
26
- height: height ?? size,
27
- ...trimmedProps,
28
- x,
29
- y,
30
- children: props.children
31
- }
32
- )
33
- ] });
34
- };
35
- export {
36
- BaseIcon as default
37
- };
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import { IconProps } from './BaseIcon';
3
-
4
- declare const BugIcon: FC<IconProps>;
5
- export default BugIcon;
@@ -1,18 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- import BaseIcon from "./BaseIcon.js";
4
- const BugIcon = (props) => {
5
- const theme = useTheme();
6
- return /* @__PURE__ */ jsx(
7
- BaseIcon,
8
- {
9
- ...props,
10
- style: { fill: theme.palette.getContrastText(theme.palette.error.dark), ...props.style },
11
- circleStyle: { fill: theme.palette.error.dark, ...props.style },
12
- children: /* @__PURE__ */ jsx("path", { d: "M480-200q66 0 113-47t47-113v-160q0-66-47-113t-113-47q-66 0-113 47t-47 113v160q0 66 47 113t113 47Zm-80-120h160v-80H400v80Zm0-160h160v-80H400v80Zm80 40Zm0 320q-65 0-120.5-32T272-240H160v-80h84q-3-20-3.5-40t-.5-40h-80v-80h80q0-20 .5-40t3.5-40h-84v-80h112q14-23 31.5-43t40.5-35l-64-66 56-56 86 86q28-9 57-9t57 9l88-86 56 56-66 66q23 15 41.5 34.5T688-640h112v80h-84q3 20 3.5 40t.5 40h80v80h-80q0 20-.5 40t-3.5 40h84v80H688q-32 56-87.5 88T480-120Z" })
13
- }
14
- );
15
- };
16
- export {
17
- BugIcon as default
18
- };
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import { IconProps } from './BaseIcon';
3
-
4
- declare const HostIcon: FC<IconProps>;
5
- export default HostIcon;
@@ -1,24 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- import BaseIcon from "./BaseIcon.js";
4
- const HostIcon = (props) => {
5
- const theme = useTheme();
6
- return /* @__PURE__ */ jsx(
7
- BaseIcon,
8
- {
9
- ...props,
10
- style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
11
- circleStyle: { fill: theme.palette.info.dark, ...props.style },
12
- children: /* @__PURE__ */ jsx(
13
- "path",
14
- {
15
- style: { transform: "scale(0.75) translateX(16%) translateY(-18%)" },
16
- d: "M40-120v-80h880v80H40Zm120-120q-33 0-56.5-23.5T80-320v-440q0-33 23.5-56.5T160-840h640q33 0 56.5 23.5T880-760v440q0 33-23.5 56.5T800-240H160Zm0-80h640v-440H160v440Zm0 0v-440 440Z"
17
- }
18
- )
19
- }
20
- );
21
- };
22
- export {
23
- HostIcon as default
24
- };
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import { IconProps } from './BaseIcon';
3
-
4
- declare const NetworkIcon: FC<IconProps>;
5
- export default NetworkIcon;
@@ -1,24 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- import BaseIcon from "./BaseIcon.js";
4
- const NetworkIcon = (props) => {
5
- const theme = useTheme();
6
- return /* @__PURE__ */ jsx(
7
- BaseIcon,
8
- {
9
- ...props,
10
- style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
11
- circleStyle: { fill: theme.palette.info.dark, ...props.style },
12
- children: /* @__PURE__ */ jsx(
13
- "path",
14
- {
15
- style: { transform: "scale(0.75) translateX(16%) translateY(-18%)" },
16
- d: "M120-80v-280h120v-160h200v-80H320v-280h320v280H520v80h200v160h120v280H520v-280h120v-80H320v80h120v280H120Zm280-600h160v-120H400v120ZM200-160h160v-120H200v120Zm400 0h160v-120H600v120ZM480-680ZM360-280Zm240 0Z"
17
- }
18
- )
19
- }
20
- );
21
- };
22
- export {
23
- NetworkIcon as default
24
- };
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import { IconProps } from './BaseIcon';
3
-
4
- declare const ProcessIcon: FC<IconProps>;
5
- export default ProcessIcon;
@@ -1,18 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme, colors } from "@mui/material";
3
- import BaseIcon from "./BaseIcon.js";
4
- const ProcessIcon = (props) => {
5
- const theme = useTheme();
6
- return /* @__PURE__ */ jsx(
7
- BaseIcon,
8
- {
9
- ...props,
10
- style: { fill: theme.palette.getContrastText(colors.grey[500]), ...props.style },
11
- circleStyle: { fill: colors.grey[500], ...props.style },
12
- children: /* @__PURE__ */ jsx("path", { d: "M360-360v-240h240v240H360Zm80-80h80v-80h-80v80Zm-80 320v-80h-80q-33 0-56.5-23.5T200-280v-80h-80v-80h80v-80h-80v-80h80v-80q0-33 23.5-56.5T280-760h80v-80h80v80h80v-80h80v80h80q33 0 56.5 23.5T760-680v80h80v80h-80v80h80v80h-80v80q0 33-23.5 56.5T680-200h-80v80h-80v-80h-80v80h-80Zm320-160v-400H280v400h400ZM480-480Z" })
13
- }
14
- );
15
- };
16
- export {
17
- ProcessIcon as default
18
- };
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import { IconProps } from './BaseIcon';
3
-
4
- declare const TargetIcon: FC<IconProps>;
5
- export default TargetIcon;
@@ -1,19 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- import BaseIcon from "./BaseIcon.js";
4
- const TargetIcon = (props) => {
5
- const theme = useTheme();
6
- return /* @__PURE__ */ jsx(
7
- BaseIcon,
8
- {
9
- ...props,
10
- ...props,
11
- style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
12
- circleStyle: { fill: theme.palette.info.dark, ...props.style },
13
- children: /* @__PURE__ */ jsx("path", { d: "M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-80q-100 0-170-70t-70-170q0-100 70-170t170-70q100 0 170 70t70 170q0 100-70 170t-170 70Zm0-80q66 0 113-47t47-113q0-66-47-113t-113-47q-66 0-113 47t-47 113q0 66 47 113t113 47Zm0-80q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Z" })
14
- }
15
- );
16
- };
17
- export {
18
- TargetIcon as default
19
- };
@@ -1,2 +0,0 @@
1
- declare const getIcon: (icon: string) => any;
2
- export default getIcon;
@@ -1,16 +0,0 @@
1
- import BugIcon from "./BugIcon.js";
2
- import HostIcon from "./HostIcon.js";
3
- import NetworkIcon from "./NetworkIcon.js";
4
- import ProcessIcon from "./ProcessIcon.js";
5
- import TargetIcon from "./TargetIcon.js";
6
- const ICON_MAP = {
7
- bug: BugIcon,
8
- target: TargetIcon,
9
- host: HostIcon,
10
- network: NetworkIcon,
11
- process: ProcessIcon
12
- };
13
- const getIcon = (icon) => ICON_MAP[icon];
14
- export {
15
- getIcon as default
16
- };
@@ -1,8 +0,0 @@
1
- import { RawEntry } from "../../../../../types/graph";
2
- import { FC } from 'react';
3
-
4
- declare const NodePanel: FC<{
5
- selectedNodeIds: string[];
6
- findNode: (id: string) => RawEntry;
7
- }>;
8
- export default NodePanel;
@@ -1,12 +0,0 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { Skeleton } from "@mui/material";
3
- import NodeCard from "../../elements/NodeCard.js";
4
- const NodePanel = ({ selectedNodeIds, findNode }) => {
5
- return /* @__PURE__ */ jsxs(Fragment, { children: [
6
- selectedNodeIds.map((selectedNodeId) => findNode(selectedNodeId)).filter((node) => !!node).map((node) => /* @__PURE__ */ jsx(NodeCard, { node }, node.id)),
7
- selectedNodeIds.length < 1 && /* @__PURE__ */ jsx(Skeleton, { variant: "rounded", height: 150 })
8
- ] });
9
- };
10
- export {
11
- NodePanel as default
12
- };
@@ -1,29 +0,0 @@
1
- import { FC } from 'react';
2
- import { Bundle } from './types';
3
-
4
- declare const BundleLine: FC<{
5
- bundle: Bundle;
6
- linesByLevel: {
7
- [level: number]: Set<string>;
8
- };
9
- paddingByLevel: {
10
- [level: number]: number;
11
- };
12
- nodeLocations: {
13
- [id: string]: [number, number, number];
14
- };
15
- inputsByNode: {
16
- [id: string]: Set<string>;
17
- };
18
- outputsByNode: {
19
- [id: string]: Set<string>;
20
- };
21
- lineWidth: number;
22
- linePaddingX: number;
23
- linePaddingY: number;
24
- maxArcRadius: number;
25
- highlightedPath: Set<string>;
26
- lineDirection: 'horizontal' | 'vertical';
27
- colorTheme?: string;
28
- }>;
29
- export default BundleLine;