@cccsaurora/clue-ui 1.1.0-dev.91 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/ActionForm-myEAs2UC.js +435 -0
  2. package/AnnotationDetails-BdfWMISw.js +160 -0
  3. package/AnnotationPreview-CKMGCoUH.js +140 -0
  4. package/ClueEnrichContext-CrFpdYhh.js +414 -0
  5. package/FlexOne-BXWFOd1T.js +6 -0
  6. package/_Map-DXNg_Z-q.js +54 -0
  7. package/_MapCache-Cu25RRDU.js +129 -0
  8. package/_Uint8Array-DlJCtTvG.js +102 -0
  9. package/_baseAssignValue-CUmzp727.js +20 -0
  10. package/_baseClone-BlMmRXeX.js +208 -0
  11. package/_baseExtremum-P_0akmCi.js +27 -0
  12. package/_baseFlatten-CN7vDNEQ.js +72 -0
  13. package/_baseGet-Dgf6_xCm.js +80 -0
  14. package/_baseIsEqual-Cpjtfb3Q.js +173 -0
  15. package/_baseIteratee-CP1bocOX.js +95 -0
  16. package/_baseSlice-M5RKzt1A.js +10 -0
  17. package/_baseSum-wEbgNeUs.js +10 -0
  18. package/_baseUniq-tMFmk80M.js +61 -0
  19. package/_commonjsHelpers-DaMA6jEr.js +8 -0
  20. package/_createAggregator-B4Cav8ZM.js +53 -0
  21. package/_getPrototype-CHAFQYL_.js +5 -0
  22. package/_getTag-BV_UoLYG.js +90 -0
  23. package/cloneDeep-BPVpFBzJ.js +8 -0
  24. package/components/AnnotationBody.js +35 -49
  25. package/components/AnnotationDetailPopover.js +30 -36
  26. package/components/AnnotationDetails.js +6 -6
  27. package/components/AnnotationEntry.js +47 -50
  28. package/components/AnnotationPreview.js +5 -5
  29. package/components/ClassificationChip.d.ts +2 -1
  30. package/components/ClassificationChip.js +23 -44
  31. package/components/CountBadge.js +26 -31
  32. package/components/EnrichedCard.js +97 -110
  33. package/components/EnrichedChip.js +105 -130
  34. package/components/EnrichedTypography.js +107 -133
  35. package/components/ErrorBoundary.js +24 -28
  36. package/components/RetryFailedEnrichments.js +9 -10
  37. package/components/SourcePicker.js +49 -57
  38. package/components/actions/ActionForm.js +4 -4
  39. package/components/actions/ExecutePopover.js +50 -64
  40. package/components/actions/ResultModal.js +5 -5
  41. package/components/actions/form/schemaAdapter.js +23 -38
  42. package/components/display/graph/ExpandMoreButton.js +10 -10
  43. package/components/display/graph/elements/NodeCard.js +94 -92
  44. package/components/display/graph/elements/NodeTag.js +13 -15
  45. package/components/display/graph/index.js +202 -261
  46. package/components/display/graph/visualizations/Leaf.js +69 -88
  47. package/components/display/graph/visualizations/cloud/index.js +81 -98
  48. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  49. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  50. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  51. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  53. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  54. package/components/display/graph/visualizations/icons/index.js +13 -14
  55. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  56. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  57. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  58. package/components/display/graph/visualizations/tree/index.js +305 -407
  59. package/components/display/icons/Iconified.js +12 -27
  60. package/components/display/json/index.js +4 -4
  61. package/components/display/markdown/index.js +5761 -8662
  62. package/components/enrichment/EnrichPopover.js +47 -55
  63. package/components/fetchers/Fetcher.js +95 -123
  64. package/components/fetchers/PreviewModal.js +17 -20
  65. package/components/fetchers/StatusChip.js +17 -21
  66. package/components/group/Entry.js +11 -13
  67. package/components/group/Group.js +10 -13
  68. package/components/group/GroupControl.js +66 -77
  69. package/components/stats/QueryStatus.js +31 -41
  70. package/countBy-DOutsa_w.js +8 -0
  71. package/data/event.js +4 -6
  72. package/database/index.js +2 -2
  73. package/debounce-DryYcbJ4.js +56 -0
  74. package/get-Bow1vKwx.js +8 -0
  75. package/groupBy-BheQYl6f.js +8 -0
  76. package/hooks/ClueActionContext.js +7 -7
  77. package/hooks/ClueComponentContext.js +23 -29
  78. package/hooks/ClueConfigProvider.js +12 -14
  79. package/hooks/ClueDatabaseContext.js +13 -19
  80. package/hooks/ClueEnrichContext.js +8 -8
  81. package/hooks/ClueFetcherContext.js +46 -74
  82. package/hooks/ClueGroupContext.js +14 -17
  83. package/hooks/CluePopupContext.js +5 -5
  84. package/hooks/ClueProvider.js +10 -12
  85. package/hooks/selectors.js +10 -21
  86. package/hooks/useActionResult.js +2 -2
  87. package/hooks/useAnnotations.js +29 -45
  88. package/hooks/useClue.js +4 -6
  89. package/hooks/useClueActions.js +3 -3
  90. package/hooks/useClueConfig.js +4 -6
  91. package/hooks/useClueTypeConfig.js +3 -3
  92. package/hooks/useComparator.js +435 -722
  93. package/hooks/useErrors.js +18 -22
  94. package/hooks/useMyHighlights.js +36 -66
  95. package/hooks/useMyLocalStorage.js +37 -66
  96. package/iconify-BBckr5AQ.js +1263 -0
  97. package/icons/Action.js +49 -66
  98. package/icons/Assessment.js +68 -84
  99. package/icons/Context.js +63 -77
  100. package/icons/Opinion.js +65 -77
  101. package/icons/iconMap.js +2 -2
  102. package/identity-ByMq8VxU.js +6 -0
  103. package/index-BXxfAxFt.js +12734 -0
  104. package/index-C15OYgRY.js +358 -0
  105. package/index-E7g8cRyW.js +568 -0
  106. package/index-p5_wX7q1.js +11729 -0
  107. package/index-vF6IyBhz.js +975 -0
  108. package/isEmpty-g47Qir2A.js +21 -0
  109. package/isNil-CjWwlQS3.js +6 -0
  110. package/isObject-B53jY8Qg.js +7 -0
  111. package/isObjectLike-BatpeCIi.js +29 -0
  112. package/isSymbol-C3_SC0Qp.js +8 -0
  113. package/last-7CdUxN0r.js +7 -0
  114. package/main.js +62 -62
  115. package/package.json +2 -2
  116. package/sortBy-ITdmD17L.js +79 -0
  117. package/sumBy-DxJUU2E8.js +8 -0
  118. package/text/Frequency.js +23 -42
  119. package/toFinite-BMy6GObD.js +14 -0
  120. package/toNumber-YVhnnJv4.js +31 -0
  121. package/useClueTypeConfig-DyeBcXQX.js +2214 -0
  122. package/utils/chain.js +64 -91
  123. package/utils/classificationParser.js +256 -519
  124. package/utils/constants.js +10 -35
  125. package/utils/graph.js +45 -72
  126. package/utils/hashUtil.js +7 -7
  127. package/utils/line.js +81 -131
  128. package/utils/loggerUtil.js +3 -5
  129. package/utils/sessionStorage.js +27 -41
  130. package/utils/time.js +423 -423
  131. package/utils/utils.js +9 -9
  132. package/utils/window.js +10 -21
  133. package/utils-BnmI_6N8.js +130 -0
  134. package/ActionForm-ByeOzpc4.js +0 -555
  135. package/AnnotationDetails-DknbKDyl.js +0 -175
  136. package/AnnotationPreview-CQwKs8se.js +0 -188
  137. package/ClueEnrichContext-6NJfXpUB.js +0 -536
  138. package/FlexOne-BSYAhhtG.js +0 -9
  139. package/_Map-kgDsDYxq.js +0 -64
  140. package/_MapCache-DabaaWfq.js +0 -161
  141. package/_Uint8Array-BlVVH1tp.js +0 -129
  142. package/_baseAssignValue-CNbcU6Nb.js +0 -25
  143. package/_baseClone-D3a8Pa4T.js +0 -284
  144. package/_baseExtremum-B1o1zHjR.js +0 -33
  145. package/_baseFlatten-D4huXoEI.js +0 -92
  146. package/_baseGet-BSK_nnoz.js +0 -109
  147. package/_baseIsEqual-B5xLoweL.js +0 -238
  148. package/_baseIteratee-p6Nj07-n.js +0 -126
  149. package/_baseSlice-GAv_YFTT.js +0 -20
  150. package/_baseSum-D0WC1dN0.js +0 -13
  151. package/_baseUniq-CpupKWcL.js +0 -89
  152. package/_commonjsHelpers-DWwsNxpa.js +0 -8
  153. package/_createAggregator-BpVy5xMi.js +0 -63
  154. package/_getPrototype-D1LAdQKO.js +0 -5
  155. package/_getTag-D3ToyefI.js +0 -126
  156. package/cloneDeep-CjP5k9zW.js +0 -8
  157. package/countBy-C69WslUA.js +0 -14
  158. package/debounce-bV0h5FC5.js +0 -92
  159. package/get-D3C3lEU3.js +0 -8
  160. package/groupBy-DC2oOuBN.js +0 -14
  161. package/iconify-CXMreGTg.js +0 -1782
  162. package/identity-CPGTqrE4.js +0 -6
  163. package/index-BDVjGvMI.js +0 -696
  164. package/index-BbPn6-Mw.js +0 -15750
  165. package/index-Bi21Wb23.js +0 -465
  166. package/index-C3lkTD69.js +0 -1172
  167. package/index-CC12Ux-9.js +0 -17654
  168. package/isEmpty-BQkZubqU.js +0 -29
  169. package/isNil-CIubwp4T.js +0 -6
  170. package/isObject-FTY-5JQX.js +0 -7
  171. package/isObjectLike-OAgjjZye.js +0 -48
  172. package/isSymbol-Xd2FsJyp.js +0 -8
  173. package/last-CUCl67Im.js +0 -7
  174. package/sortBy-B-UKp4GT.js +0 -100
  175. package/sumBy-MYkDPHZL.js +0 -8
  176. package/toFinite-Bc55msYj.js +0 -16
  177. package/toNumber-DPxy1FBy.js +0 -39
  178. package/useClueTypeConfig-XvGvIw2S.js +0 -3201
  179. package/utils-7OtvGnmf.js +0 -200
@@ -1,173 +1,147 @@
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-CQwKs8se.js";
7
- import { useClueEnrichSelector } from "../hooks/selectors.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-BDVjGvMI.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
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 $ } from "../AnnotationPreview-CKMGCoUH.js";
7
+ import { useClueEnrichSelector as Z } from "../hooks/selectors.js";
8
+ import F from "../hooks/useAnnotations.js";
9
+ import _ from "../icons/Action.js";
10
+ import j from "../icons/Assessment.js";
11
+ import z from "../icons/Context.js";
12
+ import N 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-E7g8cRyW.js";
16
+ const ei = ({
17
+ type: T,
18
+ value: e,
19
+ classification: h,
20
+ contextIcon: k = !1,
21
+ counters: c = !1,
22
+ hideDetails: d = !1,
23
+ hideLoading: O = !1,
24
+ forceDetails: r = !1,
25
+ setForceDetails: C = null,
26
+ useDetailsIcon: u = !1,
27
+ skipEnrichment: R = !1,
28
+ slotProps: i = {},
29
+ children: G,
30
+ ...f
31
31
  }) => {
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]
32
+ var A, q, v, B;
33
+ const { t: M } = l(X, (n) => n.i18next), b = K(), y = ii(), s = l(Y, (n) => n == null ? void 0 : n.type), g = Z((n) => n.defaultClassification), o = x(() => T ?? s, [T, s]), t = x(
34
+ () => h ?? g,
35
+ [h, g]
42
36
  );
43
- if (!type) {
37
+ if (!o)
44
38
  throw new Error("Type was not provided as a prop, and component is not used in a group context.");
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,
39
+ const [m, p] = F(o, e, t, { skipEnrichment: R }), I = l($, (n) => n.showInfo), H = l($, (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,
67
47
  // eslint-disable-next-line react-hooks/exhaustive-deps
68
- [hideDetails, useDetailsIcon, otherProps, type, value, classification]
48
+ [d, u, f, o, e, t]
69
49
  );
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,
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,
83
58
  {
84
- ref: anchorRef,
59
+ ref: y,
85
60
  direction: "row",
86
61
  spacing: 1,
87
62
  alignItems: "center",
88
- ...slotProps == null ? void 0 : slotProps.stack,
89
- className: `enriched-typography ${((_a = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _a.className) ?? ""}`.trim(),
63
+ ...i == null ? void 0 : i.stack,
64
+ className: `enriched-typography ${((A = i == null ? void 0 : i.stack) == null ? void 0 : A.className) ?? ""}`.trim(),
90
65
  sx: [
91
66
  {
92
- cursor: !loading && !hideDetails ? "pointer" : "inherit",
67
+ cursor: !p && !d ? "pointer" : "inherit",
93
68
  borderBottom: "1px solid transparent",
94
- transition: theme.transitions.create(["border-bottom-color"]),
69
+ transition: b.transitions.create(["border-bottom-color"]),
95
70
  "&:hover": {
96
- borderBottomColor: !loading && (!hideDetails ? theme.palette.primary.light : null)
71
+ borderBottomColor: !p && (d ? null : b.palette.primary.light)
97
72
  }
98
73
  },
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]
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]
100
75
  ],
101
- onClick: !useDetailsIcon ? clicker : void 0,
76
+ onClick: u ? void 0 : E,
102
77
  children: [
103
- /* @__PURE__ */ jsx(
104
- AssessmentIcon,
78
+ /* @__PURE__ */ a(
79
+ j,
105
80
  {
106
- ubiquitous: true,
107
- value: { type, value, classification },
108
- annotations,
109
- counters,
110
- disableTooltip: forceDetails
81
+ ubiquitous: !0,
82
+ value: { type: o, value: e, classification: t },
83
+ annotations: m,
84
+ counters: c,
85
+ disableTooltip: r
111
86
  }
112
87
  ),
113
- /* @__PURE__ */ jsx(
114
- OpinionIcon,
88
+ /* @__PURE__ */ a(
89
+ N,
115
90
  {
116
- ubiquitous: true,
117
- value: { type, value, classification },
118
- annotations,
119
- counters,
120
- disableTooltip: forceDetails
91
+ ubiquitous: !0,
92
+ value: { type: o, value: e, classification: t },
93
+ annotations: m,
94
+ counters: c,
95
+ disableTooltip: r
121
96
  }
122
97
  ),
123
- /* @__PURE__ */ jsx(
124
- ContextIcon,
98
+ /* @__PURE__ */ a(
99
+ z,
125
100
  {
126
- ubiquitous: true,
127
- value: { type, value, classification },
128
- annotations,
129
- counters,
130
- showExtraIcon: contextIcon,
131
- disableTooltip: forceDetails
101
+ ubiquitous: !0,
102
+ value: { type: o, value: e, classification: t },
103
+ annotations: m,
104
+ counters: c,
105
+ showExtraIcon: k,
106
+ disableTooltip: r
132
107
  }
133
108
  ),
134
- children ?? /* @__PURE__ */ jsx(FrequencyText, { id: `enriched-${type}-value`, ...otherProps, annotations, value }),
135
- /* @__PURE__ */ jsx(
136
- AssessmentIcon,
109
+ G ?? /* @__PURE__ */ a(D, { id: `enriched-${o}-value`, ...f, annotations: m, value: e }),
110
+ /* @__PURE__ */ a(
111
+ j,
137
112
  {
138
- value: { type, value, classification },
139
- annotations,
140
- counters,
141
- disableTooltip: forceDetails
113
+ value: { type: o, value: e, classification: t },
114
+ annotations: m,
115
+ counters: c,
116
+ disableTooltip: r
142
117
  }
143
118
  ),
144
- /* @__PURE__ */ jsx(
145
- OpinionIcon,
119
+ /* @__PURE__ */ a(
120
+ N,
146
121
  {
147
- value: { type, value, classification },
148
- annotations,
149
- counters,
150
- disableTooltip: forceDetails
122
+ value: { type: o, value: e, classification: t },
123
+ annotations: m,
124
+ counters: c,
125
+ disableTooltip: r
151
126
  }
152
127
  ),
153
- /* @__PURE__ */ jsx(
154
- ContextIcon,
128
+ /* @__PURE__ */ a(
129
+ z,
155
130
  {
156
- value: { type, value, classification },
157
- annotations,
158
- counters,
159
- showExtraIcon: contextIcon,
160
- disableTooltip: forceDetails
131
+ value: { type: o, value: e, classification: t },
132
+ annotations: m,
133
+ counters: c,
134
+ showExtraIcon: k,
135
+ disableTooltip: r
161
136
  }
162
137
  ),
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" }) }) })
138
+ /* @__PURE__ */ a(_, { counters: c, value: { type: o, value: e, classification: t }, disableTooltip: r }),
139
+ p && !O && /* @__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" }) }) })
166
141
  ]
167
142
  }
168
143
  );
169
- };
170
- const EnrichedTypography$1 = memo(EnrichedTypography);
144
+ }, hi = P(ei);
171
145
  export {
172
- EnrichedTypography$1 as default
146
+ hi as default
173
147
  };
@@ -1,36 +1,32 @@
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 };
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 };
9
8
  }
10
- static getDerivedStateFromError(error) {
11
- return { hasError: true, error };
9
+ static getDerivedStateFromError(e) {
10
+ return { hasError: !0, error: e };
12
11
  }
13
- componentDidCatch(error) {
14
- this.setState({ hasError: true, error });
12
+ componentDidCatch(e) {
13
+ this.setState({ hasError: !0, error: e });
15
14
  }
16
15
  render() {
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;
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;
32
28
  }
33
29
  }
34
30
  export {
35
- ErrorBoundary as default
31
+ f as default
36
32
  };
@@ -1,13 +1,12 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Button } from "@mui/material";
3
- import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
4
- import { useClueEnrichSelector } from "../hooks/selectors.js";
5
- import { u as useContextSelector } from "../index-BDVjGvMI.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") });
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 { useClueEnrichSelector as c } from "../hooks/selectors.js";
5
+ import { u as m } from "../index-E7g8cRyW.js";
6
+ const a = () => {
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") });
10
9
  };
11
10
  export {
12
- RetryFailedEnrichments as default
11
+ a as default
13
12
  };
@@ -1,98 +1,90 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { Button, Popover, TextField, Divider, Stack, FormControlLabel, Checkbox } from "@mui/material";
3
- import { useClueComponentSelector, useClueEnrichSelector } from "../hooks/selectors.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);
1
+ import { jsxs as n, Fragment as v, jsx as l } from "react/jsx-runtime";
2
+ import { Button as b, Popover as w, TextField as z, Divider as F, Stack as _, FormControlLabel as m, Checkbox as d } from "@mui/material";
3
+ import { useClueComponentSelector as E, useClueEnrichSelector as a } from "../hooks/selectors.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(), C = (e) => {
7
+ i(e.currentTarget);
8
+ }, f = () => {
9
+ i(null);
14
10
  };
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"),
11
+ T(() => {
12
+ c(o);
13
+ }, [o]);
14
+ const u = s ? "sources-popover" : void 0;
15
+ return /* @__PURE__ */ n(v, { children: [
16
+ /* @__PURE__ */ n(b, { "aria-describedby": u, variant: "outlined", onClick: C, children: [
17
+ r("sources"),
25
18
  " (",
26
- sources.length === availableSources.length ? t("all") : sources.length,
19
+ t.length === o.length ? r("all") : t.length,
27
20
  ")"
28
21
  ] }),
29
- /* @__PURE__ */ jsxs(
30
- Popover,
22
+ /* @__PURE__ */ n(
23
+ w,
31
24
  {
32
- id,
33
- open: !!anchorEl,
34
- anchorEl,
35
- onClose: handleClose,
25
+ id: u,
26
+ open: !!s,
27
+ anchorEl: s,
28
+ onClose: f,
36
29
  anchorOrigin: {
37
30
  vertical: "bottom",
38
31
  horizontal: "left"
39
32
  },
40
33
  children: [
41
- /* @__PURE__ */ jsx(
42
- TextField,
34
+ /* @__PURE__ */ l(
35
+ z,
43
36
  {
44
- fullWidth: true,
37
+ fullWidth: !0,
45
38
  sx: { p: 1, width: "350px" },
46
- placeholder: t("quicksearch.placeholder"),
47
- onChange: (event) => setSourceFilter(event.target.value.toLowerCase())
39
+ placeholder: r("quicksearch.placeholder"),
40
+ onChange: (e) => x(e.target.value.toLowerCase())
48
41
  }
49
42
  ),
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,
43
+ /* @__PURE__ */ l(F, { orientation: "horizontal" }),
44
+ /* @__PURE__ */ n(_, { spacing: 0.5, m: 1, sx: { maxHeight: "500px", overflow: "auto" }, onClick: (e) => e.stopPropagation(), children: [
45
+ /* @__PURE__ */ l(
46
+ m,
54
47
  {
55
- control: /* @__PURE__ */ jsx(
56
- Checkbox,
48
+ control: /* @__PURE__ */ l(
49
+ d,
57
50
  {
58
51
  size: "small",
59
- checked: sources.length === availableSources.length,
52
+ checked: t.length === o.length,
60
53
  sx: { mr: 1 },
61
- onChange: (__, checked) => {
62
- setSources(checked ? availableSources : []);
54
+ onChange: (e, p) => {
55
+ c(p ? o : []);
63
56
  }
64
57
  }
65
58
  ),
66
- label: sources.length < availableSources.length ? t("sources.select.all") : t("sources.select.none"),
59
+ label: t.length < o.length ? r("sources.select.all") : r("sources.select.none"),
67
60
  sx: { whiteSpace: "nowrap", textTransform: "capitalize" }
68
61
  }
69
62
  ),
70
- availableSources.filter((source) => !sourceFilter || source.toLowerCase().includes(sourceFilter)).map((source) => /* @__PURE__ */ jsx(
71
- FormControlLabel,
63
+ o.filter((e) => !h || e.toLowerCase().includes(h)).map((e) => /* @__PURE__ */ l(
64
+ m,
72
65
  {
73
- control: /* @__PURE__ */ jsx(
74
- Checkbox,
66
+ control: /* @__PURE__ */ l(
67
+ d,
75
68
  {
76
69
  size: "small",
77
- checked: sources.includes(source),
78
- onChange: (__, checked) => {
79
- setSources(checked ? [...sources, source] : sources.filter((src) => src !== source));
70
+ checked: t.includes(e),
71
+ onChange: (p, S) => {
72
+ c(S ? [...t, e] : t.filter((k) => k !== e));
80
73
  },
81
74
  sx: { mr: 1 }
82
75
  }
83
76
  ),
84
- label: source.replace(/[_-]/g, " "),
77
+ label: e.replace(/[_-]/g, " "),
85
78
  sx: { whiteSpace: "nowrap", textTransform: "capitalize" }
86
79
  },
87
- source
80
+ e
88
81
  ))
89
82
  ] })
90
83
  ]
91
84
  }
92
85
  )
93
86
  ] });
94
- };
95
- const SourcePicker$1 = memo(SourcePicker);
87
+ }, B = P(L);
96
88
  export {
97
- SourcePicker$1 as default
89
+ B as default
98
90
  };
@@ -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-Bi21Wb23.js";
6
+ import "../../index-C15OYgRY.js";
7
7
  import "../../hooks/ClueComponentContext.js";
8
- import { A } from "../../ActionForm-ByeOzpc4.js";
9
- import "../../utils-7OtvGnmf.js";
8
+ import { A } from "../../ActionForm-myEAs2UC.js";
9
+ import "../../utils-BnmI_6N8.js";
10
10
  import "react";
11
- import "../../index-BDVjGvMI.js";
11
+ import "../../index-E7g8cRyW.js";
12
12
  import "../ErrorBoundary.js";
13
13
  import "./form/schemaAdapter.js";
14
14
  export {