@cccsaurora/clue-ui 1.2.1-patch.256 → 1.3.0-dev.255

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 (181) hide show
  1. package/ActionForm-C0aE9HUv.js +5941 -0
  2. package/AnnotationDetails-CEou0vCc.js +175 -0
  3. package/AnnotationPreview-CLMVD6Ec.js +188 -0
  4. package/ClueEnrichContext-BkD9ZwM9.js +541 -0
  5. package/FlexOne-BSYAhhtG.js +9 -0
  6. package/_MapCache-WmuDdwuH.js +222 -0
  7. package/_Uint8Array-DdG4KLKn.js +128 -0
  8. package/_baseAssignValue-CGTuELqU.js +25 -0
  9. package/_baseClone-BpWiBnMp.js +283 -0
  10. package/_baseExtremum-BY663UjY.js +33 -0
  11. package/_baseFlatten-B69cDsaV.js +92 -0
  12. package/_baseGet-Bx3A4Qfp.js +108 -0
  13. package/_baseIsEqual-B4IufFlL.js +208 -0
  14. package/_baseIteratee-7AQvAy1o.js +126 -0
  15. package/_baseSlice-GAv_YFTT.js +20 -0
  16. package/_baseSum-D0WC1dN0.js +13 -0
  17. package/_baseUniq-B8fK6hI-.js +115 -0
  18. package/_commonjsHelpers-DWwsNxpa.js +8 -0
  19. package/_createAggregator-CwGPThny.js +63 -0
  20. package/_getPrototype-CblfEidB.js +5 -0
  21. package/_getTag-jwz4XLoZ.js +126 -0
  22. package/_setToArray-CaPKQhcz.js +33 -0
  23. package/cloneDeep-DmUylbkM.js +8 -0
  24. package/components/AnnotationBody.js +49 -35
  25. package/components/AnnotationDetailPopover.js +36 -30
  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 +44 -23
  30. package/components/CountBadge.js +31 -26
  31. package/components/EnrichedCard.js +110 -97
  32. package/components/EnrichedChip.js +130 -105
  33. package/components/EnrichedTypography.js +133 -107
  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 +75 -59
  39. package/components/actions/ResultModal.js +4 -4
  40. package/components/actions/form/schemaAdapter.js +39 -23
  41. package/components/actions/formats/FileResult.js +86 -59
  42. package/components/actions/formats/index.js +21 -10
  43. package/components/display/graph/ExpandMoreButton.js +10 -10
  44. package/components/display/graph/elements/NodeCard.js +111 -91
  45. package/components/display/graph/elements/NodeTag.js +15 -13
  46. package/components/display/graph/index.js +261 -202
  47. package/components/display/graph/visualizations/Leaf.js +88 -69
  48. package/components/display/graph/visualizations/cloud/index.js +98 -81
  49. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  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 +14 -13
  56. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  57. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  58. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  59. package/components/display/graph/visualizations/tree/index.js +407 -306
  60. package/components/display/icons/Iconified.js +27 -12
  61. package/components/display/json/index.js +4 -4
  62. package/components/display/markdown/index.js +8678 -5770
  63. package/components/enrichment/EnrichPopover.js +54 -46
  64. package/components/fetchers/Fetcher.js +155 -117
  65. package/components/fetchers/PreviewModal.js +20 -17
  66. package/components/fetchers/StatusChip.js +21 -17
  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 +43 -33
  71. package/countBy-DqlU5OwT.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-DSsNkRQs.js +8 -0
  76. package/groupBy-ChDRT7uy.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 +83 -56
  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 +7 -7
  87. package/hooks/useActionResult.js +2 -2
  88. package/hooks/useAnnotations.js +47 -31
  89. package/hooks/useClue.js +6 -4
  90. package/hooks/useClueActions.js +3 -3
  91. package/hooks/useClueConfig.js +6 -4
  92. package/hooks/useClueTypeConfig.js +3 -3
  93. package/hooks/useComparator.js +722 -435
  94. package/hooks/useErrors.js +22 -18
  95. package/hooks/useFetcherResult.js +33 -24
  96. package/hooks/useMyHighlights.js +66 -36
  97. package/hooks/useMyLocalStorage.js +66 -37
  98. package/iconify-CXMreGTg.js +1782 -0
  99. package/icons/Action.js +66 -49
  100. package/icons/Assessment.js +84 -69
  101. package/icons/Context.js +77 -63
  102. package/icons/Opinion.js +78 -60
  103. package/icons/iconMap.js +2 -2
  104. package/identity-CPGTqrE4.js +6 -0
  105. package/index-AMfoEg_6.js +696 -0
  106. package/index-B6C2a_Lg.js +1172 -0
  107. package/index-C12gPw2W.js +17698 -0
  108. package/index-DCKkHTvx.js +15750 -0
  109. package/index-UkW8Sur3.js +465 -0
  110. package/isNil-CIubwp4T.js +6 -0
  111. package/isObject-FTY-5JQX.js +7 -0
  112. package/isObjectLike-OAgjjZye.js +48 -0
  113. package/isSymbol-Xd2FsJyp.js +8 -0
  114. package/last-CUCl67Im.js +7 -0
  115. package/main.js +60 -60
  116. package/package.json +1 -1
  117. package/sortBy-C7mGPI_D.js +100 -0
  118. package/sumBy-CGALjmwQ.js +8 -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-D2tf4-NM.js +3289 -0
  123. package/utils/chain.js +91 -65
  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 -27
  131. package/utils/time.js +423 -423
  132. package/utils/utils.js +9 -9
  133. package/utils/window.js +21 -10
  134. package/utils-71DpzFrA.js +199 -0
  135. package/ActionForm-DlOXqMUx.js +0 -4460
  136. package/AnnotationDetails-Bk-p0F6h.js +0 -160
  137. package/AnnotationPreview-jzZvkCxJ.js +0 -140
  138. package/ClueEnrichContext-KqRuuWNS.js +0 -418
  139. package/FlexOne-BXWFOd1T.js +0 -6
  140. package/_MapCache-BiTi0iqu.js +0 -180
  141. package/_Uint8Array-BQNOM9Rr.js +0 -101
  142. package/_baseAssignValue-CNMLQZco.js +0 -20
  143. package/_baseClone-BnT-6pyM.js +0 -207
  144. package/_baseExtremum-Ca2EHgy2.js +0 -16
  145. package/_baseFlatten-Bfr_Molw.js +0 -72
  146. package/_baseGet-DSZygzyq.js +0 -79
  147. package/_baseIsEqual-VgvaAFZG.js +0 -147
  148. package/_baseIteratee-Dbfsw5z8.js +0 -95
  149. package/_baseSlice-M5RKzt1A.js +0 -10
  150. package/_baseSum-wEbgNeUs.js +0 -10
  151. package/_baseUniq-BJcj69PL.js +0 -79
  152. package/_commonjsHelpers-DaMA6jEr.js +0 -8
  153. package/_createAggregator-k3TuAnxT.js +0 -53
  154. package/_getPrototype-Cr1Mk7BC.js +0 -5
  155. package/_getTag-CK2Sffaq.js +0 -90
  156. package/_isIterateeCall-DkJP7Rbx.js +0 -13
  157. package/_setToArray-C7yMOeww.js +0 -29
  158. package/cloneDeep-CF8TtLHr.js +0 -8
  159. package/countBy-CdYegFSu.js +0 -8
  160. package/debounce-DryYcbJ4.js +0 -56
  161. package/get-CH7kz5Ix.js +0 -8
  162. package/groupBy-br8xmD2R.js +0 -8
  163. package/iconify-BBckr5AQ.js +0 -1263
  164. package/identity-ByMq8VxU.js +0 -6
  165. package/index-BHAe_V9n.js +0 -12768
  166. package/index-BK-zfYhR.js +0 -358
  167. package/index-CA5CUNZO.js +0 -975
  168. package/index-Dj5C04IX.js +0 -568
  169. package/index-p5_wX7q1.js +0 -11729
  170. package/isNil-CjWwlQS3.js +0 -6
  171. package/isObject-B53jY8Qg.js +0 -7
  172. package/isObjectLike-BatpeCIi.js +0 -29
  173. package/isSymbol-C3_SC0Qp.js +0 -8
  174. package/last-7CdUxN0r.js +0 -7
  175. package/maxBy-Bc0dYHcO.js +0 -8
  176. package/sortBy-DY2JBf9n.js +0 -75
  177. package/sumBy-DuMASLPd.js +0 -8
  178. package/toFinite-BMy6GObD.js +0 -14
  179. package/toNumber-YVhnnJv4.js +0 -31
  180. package/useClueTypeConfig-Ct9Ygter.js +0 -2292
  181. package/utils-DmwSUrum.js +0 -129
@@ -1,147 +1,173 @@
1
- import { jsxs as J, jsx as a } from "react/jsx-runtime";
2
- import { useTheme as K, Stack as L, CircularProgress as Q, Tooltip as U, IconButton as V } from "@mui/material";
3
- import W from "./display/icons/Iconified.js";
4
- import { ClueComponentContext as X } from "../hooks/ClueComponentContext.js";
5
- import { ClueGroupContext as Y } from "../hooks/ClueGroupContext.js";
6
- import { C as j } from "../AnnotationPreview-jzZvkCxJ.js";
7
- import { b as Z } from "../ActionForm-DlOXqMUx.js";
8
- import F from "../hooks/useAnnotations.js";
9
- import _ from "../icons/Action.js";
10
- import z from "../icons/Assessment.js";
11
- import N from "../icons/Context.js";
12
- import O from "../icons/Opinion.js";
13
- import D from "../text/Frequency.js";
14
- import { memo as P, useRef as ii, useMemo as x, useCallback as ni, useEffect as oi } from "react";
15
- import { u as l } from "../index-Dj5C04IX.js";
16
- const ei = ({
17
- type: T,
18
- value: e,
19
- classification: s,
20
- contextIcon: h = !1,
21
- counters: c = !1,
22
- hideDetails: d = !1,
23
- hideLoading: R = !1,
24
- forceDetails: r = !1,
25
- setForceDetails: C = null,
26
- useDetailsIcon: u = !1,
27
- skipEnrichment: $ = !1,
28
- slotProps: i = {},
29
- children: G,
30
- ...f
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useTheme, Stack, CircularProgress, Tooltip, IconButton } from "@mui/material";
3
+ import Iconified from "./display/icons/Iconified.js";
4
+ import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
5
+ import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
6
+ import { C as CluePopupContext } from "../AnnotationPreview-CLMVD6Ec.js";
7
+ import { b as useClueEnrichSelector } from "../ActionForm-C0aE9HUv.js";
8
+ import useAnnotations from "../hooks/useAnnotations.js";
9
+ import ActionIcon from "../icons/Action.js";
10
+ import AssessmentIcon from "../icons/Assessment.js";
11
+ import ContextIcon from "../icons/Context.js";
12
+ import OpinionIcon from "../icons/Opinion.js";
13
+ import FrequencyText from "../text/Frequency.js";
14
+ import { memo, useRef, useMemo, useCallback, useEffect } from "react";
15
+ import { u as useContextSelector } from "../index-AMfoEg_6.js";
16
+ const EnrichedTypography = ({
17
+ type: _type,
18
+ value,
19
+ classification: _classification,
20
+ contextIcon = false,
21
+ counters = false,
22
+ hideDetails = false,
23
+ hideLoading = false,
24
+ forceDetails = false,
25
+ setForceDetails = null,
26
+ useDetailsIcon = false,
27
+ skipEnrichment = false,
28
+ slotProps = {},
29
+ children,
30
+ ...otherProps
31
31
  }) => {
32
- var A, q, v, B;
33
- const { t: M } = l(X, (n) => n.i18next), b = K(), y = ii(), k = l(Y, (n) => n == null ? void 0 : n.type), g = Z((n) => n.defaultClassification), o = x(() => T ?? k, [T, k]), t = x(
34
- () => s ?? g,
35
- [s, g]
32
+ var _a, _b, _c, _d;
33
+ const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
34
+ const theme = useTheme();
35
+ const anchorRef = useRef();
36
+ const groupType = useContextSelector(ClueGroupContext, (ctx) => ctx == null ? void 0 : ctx.type);
37
+ const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
38
+ const type = useMemo(() => _type ?? groupType, [_type, groupType]);
39
+ const classification = useMemo(
40
+ () => _classification ?? defaultClassification,
41
+ [_classification, defaultClassification]
36
42
  );
37
- if (!o)
43
+ if (!type) {
38
44
  throw new Error("Type was not provided as a prop, and component is not used in a group context.");
39
- const [m, p] = F(o, e, t, { skipEnrichment: $ }), I = l(j, (n) => n.showInfo), H = l(j, (n) => n.closeInfo), w = ni(() => {
40
- const n = {};
41
- return C && (n.onClose = () => C(!1)), i != null && i.popover && (n.popoverProps = i.popover), n;
42
- }, [C, i.popover]), E = x(
43
- () => !d || u ? (n) => {
44
- var S;
45
- I("details", y.current, { type: o, value: e, classification: t }, w()), (S = f.onClick) == null || S.call(f, n), n.stopPropagation(), n.preventDefault();
46
- } : f.onClick,
45
+ }
46
+ const [annotations, loading] = useAnnotations(type, value, classification, { skipEnrichment });
47
+ const showInfo = useContextSelector(CluePopupContext, (state) => state.showInfo);
48
+ const closeInfo = useContextSelector(CluePopupContext, (state) => state.closeInfo);
49
+ const buildOptions = useCallback(() => {
50
+ const options = {};
51
+ if (setForceDetails) {
52
+ options.onClose = () => setForceDetails(false);
53
+ }
54
+ if (slotProps == null ? void 0 : slotProps.popover) {
55
+ options.popoverProps = slotProps.popover;
56
+ }
57
+ return options;
58
+ }, [setForceDetails, slotProps.popover]);
59
+ const clicker = useMemo(
60
+ () => !hideDetails || useDetailsIcon ? (e) => {
61
+ var _a2;
62
+ showInfo("details", anchorRef.current, { type, value, classification }, buildOptions());
63
+ (_a2 = otherProps.onClick) == null ? void 0 : _a2.call(otherProps, e);
64
+ e.stopPropagation();
65
+ e.preventDefault();
66
+ } : otherProps.onClick,
47
67
  // eslint-disable-next-line react-hooks/exhaustive-deps
48
- [d, u, f, o, e, t]
68
+ [hideDetails, useDetailsIcon, otherProps, type, value, classification]
49
69
  );
50
- return oi(() => {
51
- r ? I("details", y.current, { type: o, value: e, classification: t }, w()) : H("details", {
52
- type: o,
53
- value: e,
54
- classification: t
55
- });
56
- }, [t, r, o, e]), /* @__PURE__ */ J(
57
- L,
70
+ useEffect(() => {
71
+ if (forceDetails) {
72
+ showInfo("details", anchorRef.current, { type, value, classification }, buildOptions());
73
+ } else {
74
+ closeInfo("details", {
75
+ type,
76
+ value,
77
+ classification
78
+ });
79
+ }
80
+ }, [classification, forceDetails, type, value]);
81
+ return /* @__PURE__ */ jsxs(
82
+ Stack,
58
83
  {
59
- ref: y,
84
+ ref: anchorRef,
60
85
  direction: "row",
61
86
  spacing: 1,
62
87
  alignItems: "center",
63
- ...i == null ? void 0 : i.stack,
64
- className: `enriched-typography ${((A = i == null ? void 0 : i.stack) == null ? void 0 : A.className) ?? ""}`.trim(),
88
+ ...slotProps == null ? void 0 : slotProps.stack,
89
+ className: `enriched-typography ${((_a = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _a.className) ?? ""}`.trim(),
65
90
  sx: [
66
91
  {
67
- cursor: !p && !d ? "pointer" : "inherit",
92
+ cursor: !loading && !hideDetails ? "pointer" : "inherit",
68
93
  borderBottom: "1px solid transparent",
69
- transition: b.transitions.create(["border-bottom-color"]),
94
+ transition: theme.transitions.create(["border-bottom-color"]),
70
95
  "&:hover": {
71
- borderBottomColor: !p && (d ? null : b.palette.primary.light)
96
+ borderBottomColor: !loading && (!hideDetails ? theme.palette.primary.light : null)
72
97
  }
73
98
  },
74
- ...Array.isArray((q = i == null ? void 0 : i.stack) == null ? void 0 : q.sx) ? (v = i == null ? void 0 : i.stack) == null ? void 0 : v.sx : [(B = i == null ? void 0 : i.stack) == null ? void 0 : B.sx]
99
+ ...Array.isArray((_b = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _b.sx) ? (_c = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _c.sx : [(_d = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _d.sx]
75
100
  ],
76
- onClick: u ? void 0 : E,
101
+ onClick: !useDetailsIcon ? clicker : void 0,
77
102
  children: [
78
- /* @__PURE__ */ a(
79
- z,
103
+ /* @__PURE__ */ jsx(
104
+ AssessmentIcon,
80
105
  {
81
- ubiquitous: !0,
82
- value: { type: o, value: e, classification: t },
83
- annotations: m,
84
- counters: c,
85
- disableTooltip: r
106
+ ubiquitous: true,
107
+ value: { type, value, classification },
108
+ annotations,
109
+ counters,
110
+ disableTooltip: forceDetails
86
111
  }
87
112
  ),
88
- /* @__PURE__ */ a(
89
- O,
113
+ /* @__PURE__ */ jsx(
114
+ OpinionIcon,
90
115
  {
91
- ubiquitous: !0,
92
- value: { type: o, value: e, classification: t },
93
- annotations: m,
94
- counters: c,
95
- disableTooltip: r
116
+ ubiquitous: true,
117
+ value: { type, value, classification },
118
+ annotations,
119
+ counters,
120
+ disableTooltip: forceDetails
96
121
  }
97
122
  ),
98
- /* @__PURE__ */ a(
99
- N,
123
+ /* @__PURE__ */ jsx(
124
+ ContextIcon,
100
125
  {
101
- ubiquitous: !0,
102
- value: { type: o, value: e, classification: t },
103
- annotations: m,
104
- counters: c,
105
- showExtraIcon: h,
106
- disableTooltip: r
126
+ ubiquitous: true,
127
+ value: { type, value, classification },
128
+ annotations,
129
+ counters,
130
+ showExtraIcon: contextIcon,
131
+ disableTooltip: forceDetails
107
132
  }
108
133
  ),
109
- G ?? /* @__PURE__ */ a(D, { id: `enriched-${o}-value`, ...f, annotations: m, value: e }),
110
- /* @__PURE__ */ a(
111
- z,
134
+ children ?? /* @__PURE__ */ jsx(FrequencyText, { id: `enriched-${type}-value`, ...otherProps, annotations, value }),
135
+ /* @__PURE__ */ jsx(
136
+ AssessmentIcon,
112
137
  {
113
- value: { type: o, value: e, classification: t },
114
- annotations: m,
115
- counters: c,
116
- disableTooltip: r
138
+ value: { type, value, classification },
139
+ annotations,
140
+ counters,
141
+ disableTooltip: forceDetails
117
142
  }
118
143
  ),
119
- /* @__PURE__ */ a(
120
- O,
144
+ /* @__PURE__ */ jsx(
145
+ OpinionIcon,
121
146
  {
122
- value: { type: o, value: e, classification: t },
123
- annotations: m,
124
- counters: c,
125
- disableTooltip: r
147
+ value: { type, value, classification },
148
+ annotations,
149
+ counters,
150
+ disableTooltip: forceDetails
126
151
  }
127
152
  ),
128
- /* @__PURE__ */ a(
129
- N,
153
+ /* @__PURE__ */ jsx(
154
+ ContextIcon,
130
155
  {
131
- value: { type: o, value: e, classification: t },
132
- annotations: m,
133
- counters: c,
134
- showExtraIcon: h,
135
- disableTooltip: r
156
+ value: { type, value, classification },
157
+ annotations,
158
+ counters,
159
+ showExtraIcon: contextIcon,
160
+ disableTooltip: forceDetails
136
161
  }
137
162
  ),
138
- /* @__PURE__ */ a(_, { counters: c, value: { type: o, value: e, classification: t }, disableTooltip: r }),
139
- p && !R && /* @__PURE__ */ a(Q, { color: "primary", size: 18 }),
140
- !p && u && /* @__PURE__ */ a(U, { title: M("details.open"), children: /* @__PURE__ */ a(V, { size: "small", onClick: E, sx: { color: b.palette.action.disabled }, children: /* @__PURE__ */ a(W, { icon: "ic:outline-info" }) }) })
163
+ /* @__PURE__ */ jsx(ActionIcon, { counters, value: { type, value, classification }, disableTooltip: forceDetails }),
164
+ loading && !hideLoading && /* @__PURE__ */ jsx(CircularProgress, { color: "primary", size: 18 }),
165
+ !loading && useDetailsIcon && /* @__PURE__ */ jsx(Tooltip, { title: t("details.open"), children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: clicker, sx: { color: theme.palette.action.disabled }, children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:outline-info" }) }) })
141
166
  ]
142
167
  }
143
168
  );
144
- }, si = P(ei);
169
+ };
170
+ const EnrichedTypography_default = memo(EnrichedTypography);
145
171
  export {
146
- si as default
172
+ EnrichedTypography_default as default
147
173
  };
@@ -1,32 +1,36 @@
1
- import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
- import { Box as n, Accordion as i, AccordionSummary as a, Typography as t, AccordionDetails as s } from "@mui/material";
3
- import c from "./display/icons/Iconified.js";
4
- import d from "react";
5
- class f extends d.Component {
6
- constructor(e) {
7
- super(e), this.state = { hasError: !1, error: null };
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Box, Accordion, AccordionSummary, Typography, AccordionDetails } from "@mui/material";
3
+ import Iconified from "./display/icons/Iconified.js";
4
+ import React__default from "react";
5
+ class ErrorBoundary extends React__default.Component {
6
+ constructor(props) {
7
+ super(props);
8
+ this.state = { hasError: false, error: null };
8
9
  }
9
- static getDerivedStateFromError(e) {
10
- return { hasError: !0, error: e };
10
+ static getDerivedStateFromError(error) {
11
+ return { hasError: true, error };
11
12
  }
12
- componentDidCatch(e) {
13
- this.setState({ hasError: !0, error: e });
13
+ componentDidCatch(error) {
14
+ this.setState({ hasError: true, error });
14
15
  }
15
16
  render() {
16
- return this.state.hasError ? /* @__PURE__ */ r(n, { pt: 6, textAlign: "center", fontSize: 20, children: /* @__PURE__ */ o(i, { elevation: 0, children: [
17
- /* @__PURE__ */ r(
18
- a,
19
- {
20
- expandIcon: /* @__PURE__ */ r(c, { icon: "ic:baseline-expand-more" }),
21
- "aria-controls": "panel1-content",
22
- id: "panel1-header",
23
- children: /* @__PURE__ */ r(t, { align: "center", sx: { width: "100%", fontSize: "1.2rem" }, variant: "h5", children: this.state.error.message })
24
- }
25
- ),
26
- /* @__PURE__ */ r(s, { children: /* @__PURE__ */ r("code", { children: /* @__PURE__ */ r(t, { variant: "h6", children: this.state.error.stack }) }) })
27
- ] }) }) : this.props.children;
17
+ if (this.state.hasError) {
18
+ return /* @__PURE__ */ jsx(Box, { pt: 6, textAlign: "center", fontSize: 20, children: /* @__PURE__ */ jsxs(Accordion, { elevation: 0, children: [
19
+ /* @__PURE__ */ jsx(
20
+ AccordionSummary,
21
+ {
22
+ expandIcon: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-expand-more" }),
23
+ "aria-controls": "panel1-content",
24
+ id: "panel1-header",
25
+ children: /* @__PURE__ */ jsx(Typography, { align: "center", sx: { width: "100%", fontSize: "1.2rem" }, variant: "h5", children: this.state.error.message })
26
+ }
27
+ ),
28
+ /* @__PURE__ */ jsx(AccordionDetails, { children: /* @__PURE__ */ jsx("code", { children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: this.state.error.stack }) }) })
29
+ ] }) });
30
+ }
31
+ return this.props.children;
28
32
  }
29
33
  }
30
34
  export {
31
- f as default
35
+ ErrorBoundary as default
32
36
  };
@@ -1,12 +1,13 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { Button as o } from "@mui/material";
3
- import { ClueComponentContext as i } from "../hooks/ClueComponentContext.js";
4
- import { b as c } from "../ActionForm-DlOXqMUx.js";
5
- import { u as m } from "../index-Dj5C04IX.js";
6
- const p = () => {
7
- const t = c((e) => e.enrichFailedEnrichments), { t: r } = m(i, (e) => e.i18next);
8
- return /* @__PURE__ */ n(o, { onClick: t, children: r("retry.enrich") });
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button } from "@mui/material";
3
+ import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
4
+ import { b as useClueEnrichSelector } from "../ActionForm-C0aE9HUv.js";
5
+ import { u as useContextSelector } from "../index-AMfoEg_6.js";
6
+ const RetryFailedEnrichments = () => {
7
+ const enrichFailedEnrichments = useClueEnrichSelector((ctx) => ctx.enrichFailedEnrichments);
8
+ const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
9
+ return /* @__PURE__ */ jsx(Button, { onClick: enrichFailedEnrichments, children: t("retry.enrich") });
9
10
  };
10
11
  export {
11
- p as default
12
+ RetryFailedEnrichments as default
12
13
  };
@@ -1,90 +1,98 @@
1
- import { jsxs as n, Fragment as k, jsx as l } from "react/jsx-runtime";
2
- import { Button as v, Popover as w, TextField as z, Divider as _, Stack as F, FormControlLabel as d, Checkbox as m } from "@mui/material";
3
- import { d as E, b as a } from "../ActionForm-DlOXqMUx.js";
4
- import { memo as P, useState as g, useEffect as T } from "react";
5
- const L = () => {
6
- const { t: r } = E((e) => e.i18next), o = a((e) => e.availableSources), t = a((e) => e.sources), c = a((e) => e.setSources), [s, i] = g(null), [h, x] = g(), f = (e) => {
7
- i(e.currentTarget);
8
- }, C = () => {
9
- i(null);
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { Button, Popover, TextField, Divider, Stack, FormControlLabel, Checkbox } from "@mui/material";
3
+ import { d as useClueComponentSelector, b as useClueEnrichSelector } from "../ActionForm-C0aE9HUv.js";
4
+ import { memo, useState, useEffect } from "react";
5
+ const SourcePicker = () => {
6
+ const { t } = useClueComponentSelector((ctx) => ctx.i18next);
7
+ const availableSources = useClueEnrichSelector((state) => state.availableSources);
8
+ const sources = useClueEnrichSelector((state) => state.sources);
9
+ const setSources = useClueEnrichSelector((state) => state.setSources);
10
+ const [anchorEl, setAnchorEl] = useState(null);
11
+ const [sourceFilter, setSourceFilter] = useState();
12
+ const handleClick = (event) => {
13
+ setAnchorEl(event.currentTarget);
10
14
  };
11
- T(() => {
12
- c(o);
13
- }, [o]);
14
- const u = s ? "sources-popover" : void 0;
15
- return /* @__PURE__ */ n(k, { children: [
16
- /* @__PURE__ */ n(v, { "aria-describedby": u, variant: "outlined", onClick: f, children: [
17
- r("sources"),
15
+ const handleClose = () => {
16
+ setAnchorEl(null);
17
+ };
18
+ useEffect(() => {
19
+ setSources(availableSources);
20
+ }, [availableSources]);
21
+ const id = !!anchorEl ? "sources-popover" : void 0;
22
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
23
+ /* @__PURE__ */ jsxs(Button, { "aria-describedby": id, variant: "outlined", onClick: handleClick, children: [
24
+ t("sources"),
18
25
  " (",
19
- t.length === o.length ? r("all") : t.length,
26
+ sources.length === availableSources.length ? t("all") : sources.length,
20
27
  ")"
21
28
  ] }),
22
- /* @__PURE__ */ n(
23
- w,
29
+ /* @__PURE__ */ jsxs(
30
+ Popover,
24
31
  {
25
- id: u,
26
- open: !!s,
27
- anchorEl: s,
28
- onClose: C,
32
+ id,
33
+ open: !!anchorEl,
34
+ anchorEl,
35
+ onClose: handleClose,
29
36
  anchorOrigin: {
30
37
  vertical: "bottom",
31
38
  horizontal: "left"
32
39
  },
33
40
  children: [
34
- /* @__PURE__ */ l(
35
- z,
41
+ /* @__PURE__ */ jsx(
42
+ TextField,
36
43
  {
37
- fullWidth: !0,
44
+ fullWidth: true,
38
45
  sx: { p: 1, width: "350px" },
39
- placeholder: r("quicksearch.placeholder"),
40
- onChange: (e) => x(e.target.value.toLowerCase())
46
+ placeholder: t("quicksearch.placeholder"),
47
+ onChange: (event) => setSourceFilter(event.target.value.toLowerCase())
41
48
  }
42
49
  ),
43
- /* @__PURE__ */ l(_, { orientation: "horizontal" }),
44
- /* @__PURE__ */ n(F, { spacing: 0.5, m: 1, sx: { maxHeight: "500px", overflow: "auto" }, onClick: (e) => e.stopPropagation(), children: [
45
- /* @__PURE__ */ l(
46
- d,
50
+ /* @__PURE__ */ jsx(Divider, { orientation: "horizontal" }),
51
+ /* @__PURE__ */ jsxs(Stack, { spacing: 0.5, m: 1, sx: { maxHeight: "500px", overflow: "auto" }, onClick: (e) => e.stopPropagation(), children: [
52
+ /* @__PURE__ */ jsx(
53
+ FormControlLabel,
47
54
  {
48
- control: /* @__PURE__ */ l(
49
- m,
55
+ control: /* @__PURE__ */ jsx(
56
+ Checkbox,
50
57
  {
51
58
  size: "small",
52
- checked: t.length === o.length,
59
+ checked: sources.length === availableSources.length,
53
60
  sx: { mr: 1 },
54
- onChange: (e, p) => {
55
- c(p ? o : []);
61
+ onChange: (__, checked) => {
62
+ setSources(checked ? availableSources : []);
56
63
  }
57
64
  }
58
65
  ),
59
- label: t.length < o.length ? r("sources.select.all") : r("sources.select.none"),
66
+ label: sources.length < availableSources.length ? t("sources.select.all") : t("sources.select.none"),
60
67
  sx: { whiteSpace: "nowrap", textTransform: "capitalize" }
61
68
  }
62
69
  ),
63
- o.filter((e) => !h || e.toLowerCase().includes(h)).map((e) => /* @__PURE__ */ l(
64
- d,
70
+ availableSources.filter((source) => !sourceFilter || source.toLowerCase().includes(sourceFilter)).map((source) => /* @__PURE__ */ jsx(
71
+ FormControlLabel,
65
72
  {
66
- control: /* @__PURE__ */ l(
67
- m,
73
+ control: /* @__PURE__ */ jsx(
74
+ Checkbox,
68
75
  {
69
76
  size: "small",
70
- checked: t.includes(e),
71
- onChange: (p, S) => {
72
- c(S ? [...t, e] : t.filter((b) => b !== e));
77
+ checked: sources.includes(source),
78
+ onChange: (__, checked) => {
79
+ setSources(checked ? [...sources, source] : sources.filter((src) => src !== source));
73
80
  },
74
81
  sx: { mr: 1 }
75
82
  }
76
83
  ),
77
- label: e.replace(/[_-]/g, " "),
84
+ label: source.replace(/[_-]/g, " "),
78
85
  sx: { whiteSpace: "nowrap", textTransform: "capitalize" }
79
86
  },
80
- e
87
+ source
81
88
  ))
82
89
  ] })
83
90
  ]
84
91
  }
85
92
  )
86
93
  ] });
87
- }, B = P(L);
94
+ };
95
+ const SourcePicker_default = memo(SourcePicker);
88
96
  export {
89
- B as default
97
+ SourcePicker_default as default
90
98
  };
@@ -3,12 +3,12 @@ import "@jsonforms/material-renderers";
3
3
  import "@jsonforms/react";
4
4
  import "@mui/material";
5
5
  import "../display/icons/Iconified.js";
6
- import "../../index-BK-zfYhR.js";
6
+ import "../../index-UkW8Sur3.js";
7
7
  import "../../hooks/ClueComponentContext.js";
8
- import { A } from "../../ActionForm-DlOXqMUx.js";
9
- import "../../utils-DmwSUrum.js";
8
+ import { A } from "../../ActionForm-C0aE9HUv.js";
9
+ import "../../utils-71DpzFrA.js";
10
10
  import "react";
11
- import "../../index-Dj5C04IX.js";
11
+ import "../../index-AMfoEg_6.js";
12
12
  import "../ErrorBoundary.js";
13
13
  import "./form/schemaAdapter.js";
14
14
  export {