@cccsaurora/clue-ui 1.0.2 → 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.
Files changed (180) hide show
  1. package/ActionForm-D4ryHO0M.js +436 -0
  2. package/AnnotationDetails-YAPoqw3R.js +175 -0
  3. package/AnnotationPreview-DiQDjt9s.js +188 -0
  4. package/ClueEnrichContext-DIn6g8tw.js +522 -0
  5. package/FlexOne-BSYAhhtG.js +9 -0
  6. package/_Map-kgDsDYxq.js +64 -0
  7. package/_MapCache-DabaaWfq.js +161 -0
  8. package/_Uint8Array-BlVVH1tp.js +129 -0
  9. package/_baseAssignValue-CNbcU6Nb.js +25 -0
  10. package/_baseClone-D3a8Pa4T.js +284 -0
  11. package/_baseExtremum-B1o1zHjR.js +33 -0
  12. package/_baseFlatten-D4huXoEI.js +92 -0
  13. package/_baseGet-BSK_nnoz.js +109 -0
  14. package/_baseIsEqual-B5xLoweL.js +238 -0
  15. package/_baseIteratee-p6Nj07-n.js +126 -0
  16. package/_baseSlice-GAv_YFTT.js +20 -0
  17. package/_baseSum-D0WC1dN0.js +13 -0
  18. package/_baseUniq-CpupKWcL.js +89 -0
  19. package/_commonjsHelpers-CUmg6egw.js +6 -0
  20. package/_createAggregator-BpVy5xMi.js +63 -0
  21. package/_getPrototype-D1LAdQKO.js +5 -0
  22. package/_getTag-D3ToyefI.js +126 -0
  23. package/cloneDeep-CjP5k9zW.js +8 -0
  24. package/components/AnnotationBody.js +49 -34
  25. package/components/AnnotationDetailPopover.js +36 -30
  26. package/components/AnnotationDetails.js +6 -6
  27. package/components/AnnotationEntry.js +50 -47
  28. package/components/AnnotationPreview.js +5 -5
  29. package/components/ClassificationChip.js +44 -23
  30. package/components/CountBadge.js +31 -26
  31. package/components/EnrichedCard.js +104 -92
  32. package/components/EnrichedChip.js +134 -109
  33. package/components/EnrichedTypography.js +136 -110
  34. package/components/ErrorBoundary.js +28 -24
  35. package/components/RetryFailedEnrichments.js +10 -9
  36. package/components/SourcePicker.js +57 -49
  37. package/components/actions/ActionForm.js +4 -4
  38. package/components/actions/ExecutePopover.js +64 -50
  39. package/components/actions/ResultModal.js +37 -34
  40. package/components/actions/form/schemaAdapter.js +39 -20
  41. package/components/display/graph/ExpandMoreButton.js +10 -10
  42. package/components/display/graph/elements/NodeCard.js +92 -76
  43. package/components/display/graph/elements/NodeTag.js +15 -13
  44. package/components/display/graph/index.js +258 -200
  45. package/components/display/graph/visualizations/Leaf.js +88 -69
  46. package/components/display/graph/visualizations/cloud/index.js +98 -81
  47. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  48. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  49. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  50. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  51. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  53. package/components/display/graph/visualizations/icons/index.js +14 -13
  54. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  55. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  56. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  57. package/components/display/graph/visualizations/tree/index.js +407 -305
  58. package/components/display/icons/Iconified.js +27 -12
  59. package/components/display/json/index.js +4 -4
  60. package/components/display/markdown/DynamicTabs.js +22 -17
  61. package/components/display/markdown/index.js +8527 -5670
  62. package/components/display/markdown/markdownPlugins/tabs.js +1 -1
  63. package/components/enrichment/EnrichPopover.js +55 -47
  64. package/components/fetchers/Fetcher.js +123 -95
  65. package/components/fetchers/PreviewModal.js +20 -17
  66. package/components/fetchers/StatusChip.js +22 -18
  67. package/components/group/Entry.js +13 -11
  68. package/components/group/Group.js +13 -10
  69. package/components/group/GroupControl.js +76 -65
  70. package/components/stats/QueryStatus.js +37 -28
  71. package/countBy-C69WslUA.js +14 -0
  72. package/data/event.js +6 -4
  73. package/database/index.js +2 -2
  74. package/debounce-bV0h5FC5.js +92 -0
  75. package/get-D3C3lEU3.js +8 -0
  76. package/groupBy-DC2oOuBN.js +14 -0
  77. package/hooks/ClueActionContext.js +6 -6
  78. package/hooks/ClueComponentContext.js +29 -23
  79. package/hooks/ClueConfigProvider.js +14 -12
  80. package/hooks/ClueDatabaseContext.js +19 -13
  81. package/hooks/ClueEnrichContext.js +8 -8
  82. package/hooks/ClueFetcherContext.js +74 -46
  83. package/hooks/ClueGroupContext.js +17 -14
  84. package/hooks/CluePopupContext.js +5 -5
  85. package/hooks/ClueProvider.js +12 -10
  86. package/hooks/selectors.js +22 -11
  87. package/hooks/useAnnotations.js +45 -29
  88. package/hooks/useClue.js +6 -4
  89. package/hooks/useClueActions.js +3 -3
  90. package/hooks/useClueConfig.js +5 -5
  91. package/hooks/useClueTypeConfig.js +3 -3
  92. package/hooks/useComparator.js +722 -435
  93. package/hooks/useErrors.js +22 -18
  94. package/hooks/useMyHighlights.js +66 -36
  95. package/hooks/useMyLocalStorage.js +63 -43
  96. package/iconify-CXMreGTg.js +1782 -0
  97. package/icons/Action.js +66 -49
  98. package/icons/Assessment.js +84 -68
  99. package/icons/Context.js +75 -61
  100. package/icons/Opinion.js +77 -65
  101. package/icons/iconMap.js +2 -2
  102. package/identity-CPGTqrE4.js +6 -0
  103. package/index-BDVjGvMI.js +696 -0
  104. package/index-BHPT3qoB.js +1172 -0
  105. package/index-BMxyILVD.js +465 -0
  106. package/index-BbPn6-Mw.js +15750 -0
  107. package/index-Dz1kF2MU.js +17654 -0
  108. package/isEmpty-BQkZubqU.js +29 -0
  109. package/isNil-CIubwp4T.js +6 -0
  110. package/isObject-FTY-5JQX.js +7 -0
  111. package/isObjectLike-OAgjjZye.js +48 -0
  112. package/isSymbol-Xd2FsJyp.js +8 -0
  113. package/last-CUCl67Im.js +7 -0
  114. package/main.js +58 -58
  115. package/package.json +1 -1
  116. package/sortBy-B-UKp4GT.js +100 -0
  117. package/sumBy-MYkDPHZL.js +8 -0
  118. package/tabs-xGuUGsJd.js +254 -0
  119. package/text/Frequency.js +42 -23
  120. package/toFinite-Bc55msYj.js +16 -0
  121. package/toNumber-DPxy1FBy.js +39 -0
  122. package/useClueTypeConfig-CH-nGq6a.js +3184 -0
  123. package/utils/chain.js +91 -64
  124. package/utils/classificationParser.js +519 -256
  125. package/utils/constants.js +35 -10
  126. package/utils/graph.js +72 -45
  127. package/utils/hashUtil.js +7 -7
  128. package/utils/line.js +131 -81
  129. package/utils/loggerUtil.js +5 -3
  130. package/utils/sessionStorage.js +41 -29
  131. package/utils/utils.js +9 -9
  132. package/utils/window.js +21 -10
  133. package/utils-Dr4wbKBZ.js +4182 -0
  134. package/ActionForm-BtTv0s4P.js +0 -340
  135. package/AnnotationDetails-D5tBIeEw.js +0 -160
  136. package/AnnotationPreview-CZr_CcZC.js +0 -140
  137. package/ClueEnrichContext-DH9lqjwH.js +0 -401
  138. package/FlexOne-BXWFOd1T.js +0 -6
  139. package/_Map-DXNg_Z-q.js +0 -54
  140. package/_MapCache-Cu25RRDU.js +0 -129
  141. package/_Uint8Array-DlJCtTvG.js +0 -102
  142. package/_baseAssignValue-CUmzp727.js +0 -20
  143. package/_baseClone-BlMmRXeX.js +0 -208
  144. package/_baseExtremum-P_0akmCi.js +0 -27
  145. package/_baseFlatten-CN7vDNEQ.js +0 -72
  146. package/_baseGet-Dgf6_xCm.js +0 -80
  147. package/_baseIsEqual-Cpjtfb3Q.js +0 -173
  148. package/_baseIteratee-CP1bocOX.js +0 -95
  149. package/_baseSlice-M5RKzt1A.js +0 -10
  150. package/_baseSum-wEbgNeUs.js +0 -10
  151. package/_baseUniq-tMFmk80M.js +0 -61
  152. package/_commonjsHelpers-C6fGbg64.js +0 -6
  153. package/_createAggregator-B4Cav8ZM.js +0 -53
  154. package/_getPrototype-CHAFQYL_.js +0 -5
  155. package/_getTag-BV_UoLYG.js +0 -90
  156. package/cloneDeep-BPVpFBzJ.js +0 -8
  157. package/countBy-DOutsa_w.js +0 -8
  158. package/debounce-DryYcbJ4.js +0 -56
  159. package/get-Bow1vKwx.js +0 -8
  160. package/groupBy-BheQYl6f.js +0 -8
  161. package/iconify-BBckr5AQ.js +0 -1263
  162. package/identity-ByMq8VxU.js +0 -6
  163. package/index-BUcHmehh.js +0 -975
  164. package/index-Bo-v5IAc.js +0 -12754
  165. package/index-CnaCBNrd.js +0 -358
  166. package/index-E7g8cRyW.js +0 -568
  167. package/index-p5_wX7q1.js +0 -11729
  168. package/isEmpty-g47Qir2A.js +0 -21
  169. package/isNil-CjWwlQS3.js +0 -6
  170. package/isObject-B53jY8Qg.js +0 -7
  171. package/isObjectLike-BatpeCIi.js +0 -29
  172. package/isSymbol-C3_SC0Qp.js +0 -8
  173. package/last-7CdUxN0r.js +0 -7
  174. package/sortBy-ITdmD17L.js +0 -79
  175. package/sumBy-DxJUU2E8.js +0 -8
  176. package/tabs-CgADNA57.js +0 -195
  177. package/toFinite-BMy6GObD.js +0 -14
  178. package/toNumber-YVhnnJv4.js +0 -31
  179. package/useClueTypeConfig-CneP98N_.js +0 -2260
  180. package/utils-CD0rFIFU.js +0 -2704
@@ -1,4 +1,4 @@
1
- import { c } from "../../../../tabs-CgADNA57.js";
1
+ import { c } from "../../../../tabs-xGuUGsJd.js";
2
2
  export {
3
3
  c as codeTabs
4
4
  };
@@ -1,80 +1,88 @@
1
- import { jsxs as y, Fragment as C, jsx as e } from "react/jsx-runtime";
2
- import { useTheme as k, Tooltip as S, IconButton as E, CircularProgress as d, Button as z, Popover as I, Paper as j, Stack as c, Box as P, Typography as B, Divider as O } from "@mui/material";
3
- import { useClueComponentSelector as T, useClueEnrichSelector as p } from "../../hooks/selectors.js";
4
- import { c as w } from "../../ActionForm-BtTv0s4P.js";
5
- import { useState as m, useRef as M, useCallback as D, useEffect as F } from "react";
6
- import g from "../display/icons/Iconified.js";
7
- const J = ({ show: t = !1, size: b = "small", selector: n }) => {
8
- const { t: s } = T((i) => i.i18next), h = k(), l = p((i) => i.availableSources), u = p((i) => i.enrich), [x, o] = m(t), [r, f] = m(!1), a = M(null), v = D(
9
- async (i) => {
10
- f(!0);
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { useTheme, Tooltip, IconButton, CircularProgress, Button, Popover, Paper, Stack, Box, Typography, Divider } from "@mui/material";
3
+ import { useClueComponentSelector, useClueEnrichSelector } from "../../hooks/selectors.js";
4
+ import { c as capitalize } from "../../ActionForm-D4ryHO0M.js";
5
+ import { useState, useRef, useCallback, useEffect } from "react";
6
+ import Iconified from "../display/icons/Iconified.js";
7
+ const EnrichPopover = ({ show = false, size = "small", selector }) => {
8
+ const { t } = useClueComponentSelector((ctx) => ctx.i18next);
9
+ const theme = useTheme();
10
+ const availableSources = useClueEnrichSelector((ctx) => ctx.availableSources);
11
+ const _enrich = useClueEnrichSelector((ctx) => ctx.enrich);
12
+ const [showEnrichMenu, setShowEnrichMenu] = useState(show);
13
+ const [loading, setLoading] = useState(false);
14
+ const enrichEl = useRef(null);
15
+ const enrich = useCallback(
16
+ async (_source) => {
17
+ setLoading(true);
11
18
  try {
12
- await u(n.type, n.value, {
13
- classification: n.classification,
19
+ await _enrich(selector.type, selector.value, {
20
+ classification: selector.classification,
14
21
  timeout: 30,
15
- force: !0,
16
- noCache: !0,
17
- sources: [i],
18
- append: !0
22
+ force: true,
23
+ noCache: true,
24
+ sources: [_source],
25
+ append: true
19
26
  });
20
27
  } finally {
21
- f(!1);
28
+ setLoading(false);
22
29
  }
23
30
  },
24
- [u, n.classification, n.type, n.value]
31
+ [_enrich, selector.classification, selector.type, selector.value]
25
32
  );
26
- return F(() => {
27
- o(t);
28
- }, [t]), /* @__PURE__ */ y(C, { children: [
29
- b === "small" ? /* @__PURE__ */ e(S, { ref: a, title: s("enrich"), children: /* @__PURE__ */ e("span", { style: { alignSelf: "center" }, children: /* @__PURE__ */ e(
30
- E,
33
+ useEffect(() => {
34
+ setShowEnrichMenu(show);
35
+ }, [show]);
36
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
37
+ size === "small" ? /* @__PURE__ */ jsx(Tooltip, { ref: enrichEl, title: t("enrich"), children: /* @__PURE__ */ jsx("span", { style: { alignSelf: "center" }, children: /* @__PURE__ */ jsx(
38
+ IconButton,
31
39
  {
32
- onClick: () => o(!0),
33
- disabled: Object.keys(l).length < 1 || r,
40
+ onClick: () => setShowEnrichMenu(true),
41
+ disabled: Object.keys(availableSources).length < 1 || loading,
34
42
  color: "info",
35
- children: r ? /* @__PURE__ */ e(d, { color: "info", size: "24px" }) : /* @__PURE__ */ e(g, { icon: "ic:baseline-auto-fix-high" })
43
+ children: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "info", size: "24px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-auto-fix-high" })
36
44
  }
37
- ) }) }) : /* @__PURE__ */ e(
38
- z,
45
+ ) }) }) : /* @__PURE__ */ jsx(
46
+ Button,
39
47
  {
40
- ref: a,
48
+ ref: enrichEl,
41
49
  variant: "outlined",
42
50
  color: "info",
43
- disabled: Object.keys(l).length < 1 || r,
44
- startIcon: r ? /* @__PURE__ */ e(d, { color: "info", size: "20px" }) : /* @__PURE__ */ e(g, { icon: "ic:baseline-auto-fix-high" }),
51
+ disabled: Object.keys(availableSources).length < 1 || loading,
52
+ startIcon: loading ? /* @__PURE__ */ jsx(CircularProgress, { color: "info", size: "20px" }) : /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-auto-fix-high" }),
45
53
  sx: { alignSelf: "stretch" },
46
- onClick: () => o(!0),
47
- children: s("enrich")
54
+ onClick: () => setShowEnrichMenu(true),
55
+ children: t("enrich")
48
56
  }
49
57
  ),
50
- /* @__PURE__ */ e(
51
- I,
58
+ /* @__PURE__ */ jsx(
59
+ Popover,
52
60
  {
53
61
  sx: { zIndex: 2e3 },
54
- open: x,
55
- disablePortal: !0,
56
- onClose: () => o(!1),
57
- anchorEl: a.current,
62
+ open: showEnrichMenu,
63
+ disablePortal: true,
64
+ onClose: () => setShowEnrichMenu(false),
65
+ anchorEl: enrichEl.current,
58
66
  anchorOrigin: { horizontal: "left", vertical: "bottom" },
59
- children: /* @__PURE__ */ e(j, { onClick: () => o(!1), children: /* @__PURE__ */ e(c, { divider: /* @__PURE__ */ e(O, { flexItem: !0, orientation: "horizontal" }), children: l.map((i) => /* @__PURE__ */ e(
60
- P,
67
+ children: /* @__PURE__ */ jsx(Paper, { onClick: () => setShowEnrichMenu(false), children: /* @__PURE__ */ jsx(Stack, { divider: /* @__PURE__ */ jsx(Divider, { flexItem: true, orientation: "horizontal" }), children: availableSources.map((_source) => /* @__PURE__ */ jsx(
68
+ Box,
61
69
  {
62
70
  sx: {
63
71
  px: 3,
64
72
  py: 1,
65
73
  cursor: "pointer",
66
- transition: h.transitions.create("background-color"),
67
- "&:hover": { backgroundColor: h.palette.background.default }
74
+ transition: theme.transitions.create("background-color"),
75
+ "&:hover": { backgroundColor: theme.palette.background.default }
68
76
  },
69
- onClick: () => v(i),
70
- children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(c, { direction: "row", spacing: 1, alignItems: "center", children: /* @__PURE__ */ e(B, { variant: "body1", children: i.split("-").map(w).join(" ") }) }) })
77
+ onClick: () => enrich(_source),
78
+ children: /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1, alignItems: "center", children: /* @__PURE__ */ jsx(Typography, { variant: "body1", children: _source.split("-").map(capitalize).join(" ") }) }) })
71
79
  },
72
- i
80
+ _source
73
81
  )) }) })
74
82
  }
75
83
  )
76
84
  ] });
77
85
  };
78
86
  export {
79
- J as default
87
+ EnrichPopover as default
80
88
  };
@@ -1,77 +1,104 @@
1
- import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
- import { I } from "../../iconify-BBckr5AQ.js";
3
- import { useTheme as J, Skeleton as A, Chip as N, Tooltip as z, Paper as O, Stack as x, Box as D, IconButton as E } from "@mui/material";
4
- import { F } from "../../FlexOne-BXWFOd1T.js";
5
- import w from "../display/icons/Iconified.js";
6
- import { J as G } from "../../index-CnaCBNrd.js";
7
- import { ClueComponentContext as H } from "../../hooks/ClueComponentContext.js";
8
- import { useClueFetcherSelector as g } from "../../hooks/selectors.js";
9
- import L, { useState as s, useEffect as V, memo as W } from "react";
10
- import { u as $ } from "../../index-E7g8cRyW.js";
11
- import q from "../display/graph/index.js";
12
- import K from "../display/markdown/index.js";
13
- import Q from "./PreviewModal.js";
14
- import U from "./StatusChip.js";
15
- const X = L.memo(
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { I as Icon } from "../../iconify-CXMreGTg.js";
3
+ import { useTheme, Skeleton, Chip, Tooltip, Paper, Stack, Box, IconButton } from "@mui/material";
4
+ import { F as FlexOne } from "../../FlexOne-BSYAhhtG.js";
5
+ import Iconified from "../display/icons/Iconified.js";
6
+ import { J as JSONViewer } from "../../index-BMxyILVD.js";
7
+ import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
8
+ import { useClueFetcherSelector } from "../../hooks/selectors.js";
9
+ import React__default, { useState, useEffect, memo } from "react";
10
+ import { u as useContextSelector } from "../../index-BDVjGvMI.js";
11
+ import Graph from "../display/graph/index.js";
12
+ import Markdown from "../display/markdown/index.js";
13
+ import PreviewModal from "./PreviewModal.js";
14
+ import StatusChip from "./StatusChip.js";
15
+ const Fetcher = React__default.memo(
16
16
  ({
17
- type: c,
18
- value: f,
19
- classification: h,
20
- fetcherId: a,
17
+ type,
18
+ value,
19
+ classification,
20
+ fetcherId,
21
21
  slotProps: {
22
- paper: t = {},
23
- preview: j = {},
24
- stack: r = {},
25
- image: M = {},
26
- chip: C = {},
27
- skeleton: n = {}
22
+ paper: paperProps = {},
23
+ preview: previewProps = {},
24
+ stack: stackProps = {},
25
+ image: imageProps = {},
26
+ chip: chipProps = {},
27
+ skeleton: skeletonProps = {}
28
28
  } = {}
29
29
  }) => {
30
- var v;
31
- const l = J(), u = g((o) => o.fetchers), y = g((o) => o.fetchSelector), R = g((o) => o.fetchCompleted), { t: d } = $(H, (o) => o == null ? void 0 : o.i18next), [i, _] = s(null), [B, S] = s(!0), [T, b] = s(!1);
32
- if (V(() => {
30
+ var _a;
31
+ const theme = useTheme();
32
+ const fetchers = useClueFetcherSelector((ctx) => ctx.fetchers);
33
+ const fetchSelector = useClueFetcherSelector((ctx) => ctx.fetchSelector);
34
+ const fetchCompleted = useClueFetcherSelector((ctx) => ctx.fetchCompleted);
35
+ const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx == null ? void 0 : ctx.i18next);
36
+ const [result, setResult] = useState(null);
37
+ const [loading, setLoading] = useState(true);
38
+ const [showPreview, setShowPreview] = useState(false);
39
+ useEffect(() => {
33
40
  (async () => {
34
41
  try {
35
- S(!0), _(await y(a, { type: c, value: f, classification: h }));
42
+ setLoading(true);
43
+ setResult(await fetchSelector(fetcherId, { type, value, classification }));
36
44
  } finally {
37
- S(!1);
45
+ setLoading(false);
38
46
  }
39
47
  })();
40
- }, [h, y, a, c, f]), R)
41
- if (a)
42
- if (a.includes(".")) {
43
- if (!(a in u))
44
- return console.warn("Fetcher ID does not correspond to a registered fetcher. Component will not render."), null;
45
- } else return console.warn(
48
+ }, [classification, fetchSelector, fetcherId, type, value]);
49
+ if (fetchCompleted) {
50
+ if (!fetcherId) {
51
+ console.warn("Missing fetcher Id. Component will not render.");
52
+ return null;
53
+ } else if (!fetcherId.includes(".")) {
54
+ console.warn(
46
55
  "Invalid fetcher id. Must be in the format '<plugin_id>.<fetcher_id>'. Component will not render."
47
- ), null;
48
- else return console.warn("Missing fetcher Id. Component will not render."), null;
49
- else
50
- return null;
51
- return B ? ((v = u[a]) == null ? void 0 : v.format) === "status" ? /* @__PURE__ */ e(
52
- A,
53
- {
54
- variant: "rounded",
55
- height: "32px",
56
- width: "150px",
57
- ...n,
58
- sx: [
59
- { borderRadius: "16px" },
60
- ...Array.isArray(n == null ? void 0 : n.sx) ? n == null ? void 0 : n.sx : [n == null ? void 0 : n.sx]
61
- ]
56
+ );
57
+ return null;
58
+ } else if (!(fetcherId in fetchers)) {
59
+ console.warn("Fetcher ID does not correspond to a registered fetcher. Component will not render.");
60
+ return null;
62
61
  }
63
- ) : /* @__PURE__ */ e(A, { variant: "rounded", height: "325px", width: "300px", ...n }) : (i == null ? void 0 : i.outcome) === "failure" && u[a].format === "status" ? /* @__PURE__ */ e(
64
- N,
65
- {
66
- icon: /* @__PURE__ */ e(z, { title: i.error, children: /* @__PURE__ */ e(I, { icon: "mdi:information-outline", fontSize: "1.25rem" }) }),
67
- label: d("error"),
68
- color: "error",
69
- ...C
62
+ } else {
63
+ return null;
64
+ }
65
+ if (loading) {
66
+ if (((_a = fetchers[fetcherId]) == null ? void 0 : _a.format) === "status") {
67
+ return /* @__PURE__ */ jsx(
68
+ Skeleton,
69
+ {
70
+ variant: "rounded",
71
+ height: "32px",
72
+ width: "150px",
73
+ ...skeletonProps,
74
+ sx: [
75
+ { borderRadius: "16px" },
76
+ ...Array.isArray(skeletonProps == null ? void 0 : skeletonProps.sx) ? skeletonProps == null ? void 0 : skeletonProps.sx : [skeletonProps == null ? void 0 : skeletonProps.sx]
77
+ ]
78
+ }
79
+ );
80
+ } else {
81
+ return /* @__PURE__ */ jsx(Skeleton, { variant: "rounded", height: "325px", width: "300px", ...skeletonProps });
70
82
  }
71
- ) : (i == null ? void 0 : i.format) === "status" ? /* @__PURE__ */ e(U, { data: i.data, ...C }) : /* @__PURE__ */ e(
72
- O,
83
+ }
84
+ if ((result == null ? void 0 : result.outcome) === "failure" && fetchers[fetcherId].format === "status") {
85
+ return /* @__PURE__ */ jsx(
86
+ Chip,
87
+ {
88
+ icon: /* @__PURE__ */ jsx(Tooltip, { title: result.error, children: /* @__PURE__ */ jsx(Icon, { icon: "mdi:information-outline", fontSize: "1.25rem" }) }),
89
+ label: t("error"),
90
+ color: "error",
91
+ ...chipProps
92
+ }
93
+ );
94
+ }
95
+ if ((result == null ? void 0 : result.format) === "status") {
96
+ return /* @__PURE__ */ jsx(StatusChip, { data: result.data, ...chipProps });
97
+ }
98
+ return /* @__PURE__ */ jsx(
99
+ Paper,
73
100
  {
74
- ...t,
101
+ ...paperProps,
75
102
  sx: [
76
103
  {
77
104
  p: 1,
@@ -80,16 +107,16 @@ const X = L.memo(
80
107
  width: "100%",
81
108
  minWidth: "300px"
82
109
  },
83
- ...Array.isArray(t == null ? void 0 : t.sx) ? t == null ? void 0 : t.sx : [t == null ? void 0 : t.sx]
110
+ ...Array.isArray(paperProps == null ? void 0 : paperProps.sx) ? paperProps == null ? void 0 : paperProps.sx : [paperProps == null ? void 0 : paperProps.sx]
84
111
  ],
85
- children: /* @__PURE__ */ m(
86
- x,
112
+ children: /* @__PURE__ */ jsxs(
113
+ Stack,
87
114
  {
88
115
  sx: {
89
116
  "& > img": {
90
117
  borderRadius: "3px",
91
118
  cursor: "zoom-in",
92
- transition: l.transitions.create("border-color", { duration: l.transitions.duration.shortest }),
119
+ transition: theme.transitions.create("border-color", { duration: theme.transitions.duration.shortest }),
93
120
  border: "3px solid transparent",
94
121
  "&:hover": {
95
122
  borderColor: "primary.main"
@@ -97,64 +124,65 @@ const X = L.memo(
97
124
  }
98
125
  },
99
126
  children: [
100
- (i == null ? void 0 : i.outcome) === "failure" && /* @__PURE__ */ e("code", { style: { color: l.palette.error.main }, children: /* @__PURE__ */ e("pre", { style: { marginTop: 0, marginBottom: 0 }, children: i.error }) }),
101
- (i == null ? void 0 : i.format) === "markdown" && /* @__PURE__ */ e(K, { md: i.data }),
102
- (i == null ? void 0 : i.format) === "image" && /* @__PURE__ */ e("img", { src: i.data.image, alt: i.data.alt, ...M, onClick: () => b(!0) }),
103
- (i == null ? void 0 : i.format) === "json" && /* @__PURE__ */ e(D, { sx: { ".react-json-view": { backgroundColor: "transparent !important" } }, children: /* @__PURE__ */ e(G, { data: i.data }) }),
104
- (i == null ? void 0 : i.format) === "graph" && /* @__PURE__ */ e(q, { graph: i.data, sx: { minHeight: "600px" } }),
105
- /* @__PURE__ */ e(F, {}),
106
- /* @__PURE__ */ m(
107
- x,
127
+ (result == null ? void 0 : result.outcome) === "failure" && /* @__PURE__ */ jsx("code", { style: { color: theme.palette.error.main }, children: /* @__PURE__ */ jsx("pre", { style: { marginTop: 0, marginBottom: 0 }, children: result.error }) }),
128
+ (result == null ? void 0 : result.format) === "markdown" && /* @__PURE__ */ jsx(Markdown, { md: result.data }),
129
+ (result == null ? void 0 : result.format) === "image" && /* @__PURE__ */ jsx("img", { src: result.data.image, alt: result.data.alt, ...imageProps, onClick: () => setShowPreview(true) }),
130
+ (result == null ? void 0 : result.format) === "json" && /* @__PURE__ */ jsx(Box, { sx: { ".react-json-view": { backgroundColor: "transparent !important" } }, children: /* @__PURE__ */ jsx(JSONViewer, { data: result.data }) }),
131
+ (result == null ? void 0 : result.format) === "graph" && /* @__PURE__ */ jsx(Graph, { graph: result.data, sx: { minHeight: "600px" } }),
132
+ /* @__PURE__ */ jsx(FlexOne, {}),
133
+ /* @__PURE__ */ jsxs(
134
+ Stack,
108
135
  {
109
136
  direction: "row",
110
137
  spacing: 1,
111
- ...r,
138
+ ...stackProps,
112
139
  sx: [
113
140
  {
114
- py: l.spacing(0.5),
141
+ py: theme.spacing(0.5),
115
142
  display: "flex",
116
143
  alignItems: "center"
117
144
  },
118
- ...Array.isArray(r == null ? void 0 : r.sx) ? r == null ? void 0 : r.sx : [r == null ? void 0 : r.sx]
145
+ ...Array.isArray(stackProps == null ? void 0 : stackProps.sx) ? stackProps == null ? void 0 : stackProps.sx : [stackProps == null ? void 0 : stackProps.sx]
119
146
  ],
120
147
  children: [
121
- /* @__PURE__ */ e(w, { icon: "ic:baseline-landscape", color: "primary", fontSize: "small" }),
122
- /* @__PURE__ */ e(
123
- z,
148
+ /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-landscape", color: "primary", fontSize: "small" }),
149
+ /* @__PURE__ */ jsx(
150
+ Tooltip,
124
151
  {
125
- title: /* @__PURE__ */ m(x, { spacing: 0.5, children: [
126
- /* @__PURE__ */ m("span", { children: [
127
- d("type"),
152
+ title: /* @__PURE__ */ jsxs(Stack, { spacing: 0.5, children: [
153
+ /* @__PURE__ */ jsxs("span", { children: [
154
+ t("type"),
128
155
  ": ",
129
- c
156
+ type
130
157
  ] }),
131
- /* @__PURE__ */ m("span", { children: [
132
- d("value"),
158
+ /* @__PURE__ */ jsxs("span", { children: [
159
+ t("value"),
133
160
  ": ",
134
- f
161
+ value
135
162
  ] }),
136
- /* @__PURE__ */ m("span", { children: [
137
- d("classification"),
163
+ /* @__PURE__ */ jsxs("span", { children: [
164
+ t("classification"),
138
165
  ": ",
139
- h ?? "N/A"
166
+ classification ?? "N/A"
140
167
  ] })
141
168
  ] }),
142
- children: /* @__PURE__ */ e(w, { icon: "ic:outline-info", fontSize: "small" })
169
+ children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-info", fontSize: "small" })
143
170
  }
144
171
  ),
145
- /* @__PURE__ */ e(F, {}),
146
- (i == null ? void 0 : i.link) && /* @__PURE__ */ e(E, { size: "small", component: "a", href: i.link, children: /* @__PURE__ */ e(w, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
172
+ /* @__PURE__ */ jsx(FlexOne, {}),
173
+ (result == null ? void 0 : result.link) && /* @__PURE__ */ jsx(IconButton, { size: "small", component: "a", href: result.link, children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
147
174
  ]
148
175
  }
149
176
  ),
150
- /* @__PURE__ */ e(Q, { ...j, open: T, result: i, onClose: () => b(!1) })
177
+ /* @__PURE__ */ jsx(PreviewModal, { ...previewProps, open: showPreview, result, onClose: () => setShowPreview(false) })
151
178
  ]
152
179
  }
153
180
  )
154
181
  }
155
182
  );
156
183
  }
157
- ), di = W(X);
184
+ );
185
+ const Fetcher$1 = memo(Fetcher);
158
186
  export {
159
- di as default
187
+ Fetcher$1 as default
160
188
  };
@@ -1,19 +1,22 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { Modal as n, Paper as f } from "@mui/material";
3
- import { memo as l } from "react";
4
- const c = ({ result: i, onClose: d, open: x = !1, ...a }) => /* @__PURE__ */ m(
5
- n,
6
- {
7
- open: x,
8
- sx: [
9
- { display: "flex", alignItems: "center", justifyContent: "center" },
10
- ...Array.isArray(a == null ? void 0 : a.sx) ? a == null ? void 0 : a.sx : [a == null ? void 0 : a.sx]
11
- ],
12
- onClose: d,
13
- ...a,
14
- children: /* @__PURE__ */ m(f, { sx: { maxHeight: "90%", maxWidth: "90%", p: 2, overflow: "auto" }, children: (i == null ? void 0 : i.format) === "image" && /* @__PURE__ */ m("img", { src: i.data.image, alt: i.data.alt, style: { maxWidth: "100%" } }) })
15
- }
16
- ), t = l(c);
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Modal, Paper } from "@mui/material";
3
+ import { memo } from "react";
4
+ const PreviewModal = ({ result, onClose, open = false, ...otherProps }) => {
5
+ return /* @__PURE__ */ jsx(
6
+ Modal,
7
+ {
8
+ open,
9
+ sx: [
10
+ { display: "flex", alignItems: "center", justifyContent: "center" },
11
+ ...Array.isArray(otherProps == null ? void 0 : otherProps.sx) ? otherProps == null ? void 0 : otherProps.sx : [otherProps == null ? void 0 : otherProps.sx]
12
+ ],
13
+ onClose,
14
+ ...otherProps,
15
+ children: /* @__PURE__ */ jsx(Paper, { sx: { maxHeight: "90%", maxWidth: "90%", p: 2, overflow: "auto" }, children: (result == null ? void 0 : result.format) === "image" && /* @__PURE__ */ jsx("img", { src: result.data.image, alt: result.data.alt, style: { maxWidth: "100%" } }) })
16
+ }
17
+ );
18
+ };
19
+ const PreviewModal$1 = memo(PreviewModal);
17
20
  export {
18
- t as default
21
+ PreviewModal$1 as default
19
22
  };
@@ -1,26 +1,30 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { I as r } from "../../iconify-BBckr5AQ.js";
3
- import { useTheme as f, Chip as x } from "@mui/material";
4
- import { ClueComponentContext as g } from "../../hooks/ClueComponentContext.js";
5
- import { u as s } from "../../index-E7g8cRyW.js";
6
- const S = ({ data: e, ...n }) => {
7
- var t;
8
- const m = f(), { i18n: i, t: u } = s(g, (o) => o.i18next);
9
- return e != null && e.empty ? null : /* @__PURE__ */ l(
10
- x,
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { I as Icon } from "../../iconify-CXMreGTg.js";
3
+ import { useTheme, Chip } from "@mui/material";
4
+ import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
5
+ import { u as useContextSelector } from "../../index-BDVjGvMI.js";
6
+ const StatusChip = ({ data, ...chipProps }) => {
7
+ var _a;
8
+ const theme = useTheme();
9
+ const { i18n, t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
10
+ if (data == null ? void 0 : data.empty) {
11
+ return null;
12
+ }
13
+ return /* @__PURE__ */ jsx(
14
+ Chip,
11
15
  {
12
- icon: e.icon && /* @__PURE__ */ l(r, { icon: e.icon, fontSize: "1.25rem" }),
13
- deleteIcon: /* @__PURE__ */ l("a", { href: e.link, rel: "noreferrer", target: "_blank", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ l(r, { icon: "mdi:open-in-new", color: m.palette.text.primary, fontSize: "1.25rem" }) }),
14
- ...n,
15
- onDelete: e.link ? () => console.log("Navigating to %s", e.link) : null,
16
- label: ((t = e.labels.find((o) => o.language === i.language) ?? e.labels[0]) == null ? void 0 : t.label) ?? u("unknown"),
16
+ icon: data.icon && /* @__PURE__ */ jsx(Icon, { icon: data.icon, fontSize: "1.25rem" }),
17
+ deleteIcon: /* @__PURE__ */ jsx("a", { href: data.link, rel: "noreferrer", target: "_blank", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(Icon, { icon: "mdi:open-in-new", color: theme.palette.text.primary, fontSize: "1.25rem" }) }),
18
+ ...chipProps,
19
+ onDelete: data.link ? () => console.log("Navigating to %s", data.link) : null,
20
+ label: ((_a = data.labels.find((label) => label.language === i18n.language) ?? data.labels[0]) == null ? void 0 : _a.label) ?? t("unknown"),
17
21
  sx: [
18
- ...Array.isArray(n == null ? void 0 : n.sx) ? n == null ? void 0 : n.sx : [n == null ? void 0 : n.sx],
19
- e.color && { backgroundColor: e.color }
22
+ ...Array.isArray(chipProps == null ? void 0 : chipProps.sx) ? chipProps == null ? void 0 : chipProps.sx : [chipProps == null ? void 0 : chipProps.sx],
23
+ data.color && { backgroundColor: data.color }
20
24
  ]
21
25
  }
22
26
  );
23
27
  };
24
28
  export {
25
- S as default
29
+ StatusChip as default
26
30
  };
@@ -1,13 +1,15 @@
1
- import { ClueGroupContext as s } from "../../hooks/ClueGroupContext.js";
2
- import { i as u } from "../../utils-CD0rFIFU.js";
3
- import { memo as i, useEffect as a } from "react";
4
- import { u as n } from "../../index-E7g8cRyW.js";
5
- const p = ({ children: e, entry: t, selected: m = !1 }) => {
6
- const r = n(s, (o) => o == null ? void 0 : o.setValues);
7
- return a(() => {
8
- r == null || r((o) => [...o.filter((f) => !u(f, t)), ...m ? [t] : []]);
9
- }, [t, m, r]), e;
10
- }, G = i(p);
1
+ import { ClueGroupContext } from "../../hooks/ClueGroupContext.js";
2
+ import { i as isEqual } from "../../utils-Dr4wbKBZ.js";
3
+ import { memo, useEffect } from "react";
4
+ import { u as useContextSelector } from "../../index-BDVjGvMI.js";
5
+ const Entry = ({ children, entry, selected = false }) => {
6
+ const setValues = useContextSelector(ClueGroupContext, (ctx) => ctx == null ? void 0 : ctx.setValues);
7
+ useEffect(() => {
8
+ setValues == null ? void 0 : setValues((_values) => [..._values.filter((value) => !isEqual(value, entry)), ...selected ? [entry] : []]);
9
+ }, [entry, selected, setValues]);
10
+ return children;
11
+ };
12
+ const Entry$1 = memo(Entry);
11
13
  export {
12
- G as default
14
+ Entry$1 as default
13
15
  };
@@ -1,12 +1,15 @@
1
- import { jsx as m, jsxs as i } from "react/jsx-runtime";
2
- import { Stack as u } from "@mui/material";
3
- import { ClueGroupProvider as c } from "../../hooks/ClueGroupContext.js";
4
- import { memo as n } from "react";
5
- import f from "./GroupControl.js";
6
- const p = ({ children: o, showHeader: t = !0, slotProps: r, ...e }) => /* @__PURE__ */ m(c, { ...e, children: t ? /* @__PURE__ */ i(u, { direction: "column", alignSelf: "stretch", ...(r == null ? void 0 : r.stack) ?? {}, children: [
7
- /* @__PURE__ */ m(f, {}),
8
- o
9
- ] }) : o }), h = n(p);
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Stack } from "@mui/material";
3
+ import { ClueGroupProvider } from "../../hooks/ClueGroupContext.js";
4
+ import { memo } from "react";
5
+ import GroupControl from "./GroupControl.js";
6
+ const Group = ({ children, showHeader = true, slotProps, ...groupProps }) => {
7
+ return /* @__PURE__ */ jsx(ClueGroupProvider, { ...groupProps, children: showHeader ? /* @__PURE__ */ jsxs(Stack, { direction: "column", alignSelf: "stretch", ...(slotProps == null ? void 0 : slotProps.stack) ?? {}, children: [
8
+ /* @__PURE__ */ jsx(GroupControl, {}),
9
+ children
10
+ ] }) : children });
11
+ };
12
+ const Group$1 = memo(Group);
10
13
  export {
11
- h as default
14
+ Group$1 as default
12
15
  };