@cccsaurora/clue-ui 1.0.0-dev.49 → 1.0.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 (180) hide show
  1. package/ActionForm-WIj7BfD5.js +340 -0
  2. package/AnnotationPreview-DWRDhxUB.js +140 -0
  3. package/ClueEnrichContext-CbJVBm4w.js +397 -0
  4. package/FlexOne-BXWFOd1T.js +6 -0
  5. package/_Map-DXNg_Z-q.js +54 -0
  6. package/_MapCache-Cu25RRDU.js +129 -0
  7. package/_Uint8Array-DlJCtTvG.js +102 -0
  8. package/_baseAssignValue-CUmzp727.js +20 -0
  9. package/_baseClone-BlMmRXeX.js +208 -0
  10. package/_baseExtremum-P_0akmCi.js +27 -0
  11. package/_baseFlatten-CN7vDNEQ.js +72 -0
  12. package/_baseGet-Dgf6_xCm.js +80 -0
  13. package/_baseIsEqual-Cpjtfb3Q.js +173 -0
  14. package/_baseIteratee-CP1bocOX.js +95 -0
  15. package/_baseSlice-M5RKzt1A.js +10 -0
  16. package/_baseSum-wEbgNeUs.js +10 -0
  17. package/_baseUniq-tMFmk80M.js +61 -0
  18. package/_commonjsHelpers-C6fGbg64.js +6 -0
  19. package/_createAggregator-B4Cav8ZM.js +53 -0
  20. package/_getPrototype-CHAFQYL_.js +5 -0
  21. package/_getTag-BV_UoLYG.js +90 -0
  22. package/cloneDeep-BPVpFBzJ.js +8 -0
  23. package/components/AnnotationBody.js +34 -49
  24. package/components/AnnotationDetailPopover.js +30 -36
  25. package/components/AnnotationDetails.js +94 -109
  26. package/components/AnnotationEntry.js +52 -55
  27. package/components/AnnotationPreview.js +5 -5
  28. package/components/ClassificationChip.js +23 -44
  29. package/components/CountBadge.js +26 -31
  30. package/components/EnrichedCard.js +92 -104
  31. package/components/EnrichedChip.js +109 -134
  32. package/components/EnrichedTypography.js +110 -136
  33. package/components/ErrorBoundary.js +24 -28
  34. package/components/RetryFailedEnrichments.js +9 -10
  35. package/components/SourcePicker.js +49 -57
  36. package/components/actions/ActionForm.js +4 -4
  37. package/components/actions/ExecutePopover.js +50 -64
  38. package/components/actions/ResultModal.js +34 -37
  39. package/components/actions/form/schemaAdapter.js +20 -39
  40. package/components/display/graph/ExpandMoreButton.js +10 -10
  41. package/components/display/graph/elements/NodeCard.js +76 -92
  42. package/components/display/graph/elements/NodeTag.js +13 -15
  43. package/components/display/graph/index.js +200 -258
  44. package/components/display/graph/visualizations/Leaf.js +69 -88
  45. package/components/display/graph/visualizations/cloud/index.js +81 -98
  46. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  47. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  48. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  49. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  50. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  51. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  52. package/components/display/graph/visualizations/icons/index.js +13 -14
  53. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  54. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  55. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  56. package/components/display/graph/visualizations/tree/index.js +305 -407
  57. package/components/display/icons/Iconified.js +12 -27
  58. package/components/display/json/index.js +4 -4
  59. package/components/display/markdown/DynamicTabs.js +17 -22
  60. package/components/display/markdown/index.js +5674 -8531
  61. package/components/display/markdown/markdownPlugins/tabs.js +1 -1
  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 +18 -22
  66. package/components/group/Entry.js +11 -13
  67. package/components/group/Group.js +10 -13
  68. package/components/group/GroupControl.js +65 -76
  69. package/components/stats/QueryStatus.js +28 -37
  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 +6 -6
  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 +11 -22
  86. package/hooks/useAnnotations.js +32 -48
  87. package/hooks/useClue.js +4 -6
  88. package/hooks/useClueActions.js +3 -3
  89. package/hooks/useClueConfig.js +5 -5
  90. package/hooks/useClueTypeConfig.js +3 -3
  91. package/hooks/useComparator.js +435 -722
  92. package/hooks/useErrors.js +18 -22
  93. package/hooks/useMyHighlights.js +36 -66
  94. package/hooks/useMyLocalStorage.js +43 -63
  95. package/iconify-BBckr5AQ.js +1263 -0
  96. package/icons/Action.js +49 -66
  97. package/icons/Assessment.js +68 -84
  98. package/icons/Context.js +61 -75
  99. package/icons/Opinion.js +65 -77
  100. package/icons/iconMap.js +2 -2
  101. package/identity-ByMq8VxU.js +6 -0
  102. package/index-4YFAh_sa.js +358 -0
  103. package/index-E7g8cRyW.js +568 -0
  104. package/index-HuYhutsd.js +975 -0
  105. package/index-WvFmjbxF.js +12734 -0
  106. package/index-p5_wX7q1.js +11729 -0
  107. package/isEmpty-g47Qir2A.js +21 -0
  108. package/isNil-CjWwlQS3.js +6 -0
  109. package/isObject-B53jY8Qg.js +7 -0
  110. package/isObjectLike-BatpeCIi.js +29 -0
  111. package/isSymbol-C3_SC0Qp.js +8 -0
  112. package/isUndefined-DiNCDKoz.js +10 -0
  113. package/last-7CdUxN0r.js +7 -0
  114. package/main.js +68 -68
  115. package/package.json +1 -1
  116. package/sortBy-ITdmD17L.js +79 -0
  117. package/sumBy-DxJUU2E8.js +8 -0
  118. package/tabs-CgADNA57.js +195 -0
  119. package/text/Frequency.js +23 -42
  120. package/toFinite-BMy6GObD.js +14 -0
  121. package/toNumber-YVhnnJv4.js +31 -0
  122. package/useClueTypeConfig-BQ33EiyB.js +2273 -0
  123. package/utils/chain.js +64 -91
  124. package/utils/classificationParser.js +254 -504
  125. package/utils/constants.js +10 -35
  126. package/utils/graph.js +45 -72
  127. package/utils/hashUtil.js +7 -7
  128. package/utils/line.js +81 -131
  129. package/utils/loggerUtil.js +3 -5
  130. package/utils/sessionStorage.js +29 -41
  131. package/utils/utils.js +9 -9
  132. package/utils/window.js +10 -21
  133. package/utils-C_RX5uMP.js +2704 -0
  134. package/ActionForm-c5hLIfQ-.js +0 -436
  135. package/AnnotationPreview-BvNpZOP0.js +0 -188
  136. package/ClueEnrichContext-m-4vn9rz.js +0 -518
  137. package/FlexOne-BSYAhhtG.js +0 -9
  138. package/_Map-kgDsDYxq.js +0 -64
  139. package/_MapCache-DabaaWfq.js +0 -161
  140. package/_Uint8Array-BlVVH1tp.js +0 -129
  141. package/_baseAssignValue-CNbcU6Nb.js +0 -25
  142. package/_baseClone-D3a8Pa4T.js +0 -284
  143. package/_baseExtremum-B1o1zHjR.js +0 -33
  144. package/_baseFlatten-D4huXoEI.js +0 -92
  145. package/_baseGet-BSK_nnoz.js +0 -109
  146. package/_baseIsEqual-B5xLoweL.js +0 -238
  147. package/_baseIteratee-p6Nj07-n.js +0 -126
  148. package/_baseSlice-GAv_YFTT.js +0 -20
  149. package/_baseSum-D0WC1dN0.js +0 -13
  150. package/_baseUniq-CpupKWcL.js +0 -89
  151. package/_commonjsHelpers-CUmg6egw.js +0 -6
  152. package/_createAggregator-BpVy5xMi.js +0 -63
  153. package/_getPrototype-D1LAdQKO.js +0 -5
  154. package/_getTag-D3ToyefI.js +0 -126
  155. package/cloneDeep-CjP5k9zW.js +0 -8
  156. package/countBy-C69WslUA.js +0 -14
  157. package/debounce-bV0h5FC5.js +0 -92
  158. package/get-D3C3lEU3.js +0 -8
  159. package/groupBy-DC2oOuBN.js +0 -14
  160. package/iconify-CXMreGTg.js +0 -1782
  161. package/identity-CPGTqrE4.js +0 -6
  162. package/index-BDVjGvMI.js +0 -696
  163. package/index-BDrtH5ec.js +0 -465
  164. package/index-BbPn6-Mw.js +0 -15750
  165. package/index-C9lySIVX.js +0 -1172
  166. package/index-Dn2NHyXg.js +0 -17654
  167. package/isEmpty-BQkZubqU.js +0 -29
  168. package/isNil-CIubwp4T.js +0 -6
  169. package/isObject-FTY-5JQX.js +0 -7
  170. package/isObjectLike-OAgjjZye.js +0 -48
  171. package/isSymbol-Xd2FsJyp.js +0 -8
  172. package/isUndefined-CE8h73dH.js +0 -10
  173. package/last-CUCl67Im.js +0 -7
  174. package/sortBy-B-UKp4GT.js +0 -100
  175. package/sumBy-MYkDPHZL.js +0 -8
  176. package/tabs-xGuUGsJd.js +0 -254
  177. package/toFinite-Bc55msYj.js +0 -16
  178. package/toNumber-DPxy1FBy.js +0 -39
  179. package/useClueTypeConfig-D4zcy8Gr.js +0 -3184
  180. package/utils-CxIhC2xH.js +0 -4182
@@ -1,178 +1,152 @@
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-BvNpZOP0.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 N, Tooltip as Q, IconButton as U } from "@mui/material";
3
+ import V from "./display/icons/Iconified.js";
4
+ import { ClueComponentContext as W } from "../hooks/ClueComponentContext.js";
5
+ import { ClueGroupContext as X } from "../hooks/ClueGroupContext.js";
6
+ import { C as S } from "../AnnotationPreview-DWRDhxUB.js";
7
+ import { useClueEnrichSelector as Y } from "../hooks/selectors.js";
8
+ import Z from "../hooks/useAnnotations.js";
9
+ import F from "../icons/Action.js";
10
+ import j from "../icons/Assessment.js";
11
+ import z from "../icons/Context.js";
12
+ import O from "../icons/Opinion.js";
13
+ import _ from "../text/Frequency.js";
14
+ import { memo as D, useRef as P, useMemo as y, useCallback as ii, useEffect as ni } from "react";
15
+ import { u as C } from "../index-E7g8cRyW.js";
16
+ const oi = ({
17
+ type: k,
18
+ value: t,
19
+ classification: s,
20
+ contextIcon: g = !1,
21
+ counters: r = !1,
22
+ hideDetails: l = !1,
23
+ hideLoading: R = !1,
24
+ forceDetails: c = !1,
25
+ setForceDetails: b = null,
26
+ useDetailsIcon: p = !1,
27
+ skipEnrichment: $ = !1,
28
+ slotProps: n = {},
29
+ children: G,
30
+ ...m
31
31
  }) => {
32
- var _a, _b, _c;
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 q, v, B;
33
+ const { t: M } = C(W, (i) => i.i18next), x = K(), T = P(), I = C(X, (i) => i == null ? void 0 : i.type), w = Y((i) => i.defaultClassification), o = y(() => k ?? I, [k, I]), e = y(
34
+ () => s ?? w,
35
+ [s, w]
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
- () => !loading ? !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 [f, d] = Z(o, t, e, { skipEnrichment: $ }), E = C(S, (i) => i.showInfo), H = C(S, (i) => i.closeInfo), h = ii(() => {
40
+ const i = {};
41
+ return b && (i.onClose = () => b(!1)), n != null && n.popover && (i.popoverProps = n.popover), i;
42
+ }, [b, n.popover]), A = y(
43
+ () => d ? (
67
44
  // We need to give a dummy callback when loading so the popover doesn't get confused
68
- (e) => {
69
- var _a2;
70
- (_a2 = otherProps.onClick) == null ? void 0 : _a2.call(otherProps, e);
45
+ (i) => {
46
+ var u;
47
+ (u = m.onClick) == null || u.call(m, i);
71
48
  }
72
- ),
49
+ ) : !l || p ? (i) => {
50
+ var u;
51
+ E("details", T.current, { type: o, value: t, classification: e }, h()), (u = m.onClick) == null || u.call(m, i), i.stopPropagation(), i.preventDefault();
52
+ } : m.onClick,
73
53
  // eslint-disable-next-line react-hooks/exhaustive-deps
74
- [loading, hideDetails, useDetailsIcon, otherProps, type, value, classification]
54
+ [d, l, p, m, o, t, e]
75
55
  );
76
- useEffect(() => {
77
- if (forceDetails) {
78
- showInfo("details", anchorRef.current, { type, value, classification }, buildOptions());
79
- } else {
80
- closeInfo("details", {
81
- type,
82
- value,
83
- classification
84
- });
85
- }
86
- }, [classification, forceDetails, type, value]);
87
- return /* @__PURE__ */ jsxs(
88
- Stack,
56
+ return ni(() => {
57
+ c ? E("details", T.current, { type: o, value: t, classification: e }, h()) : H("details", {
58
+ type: o,
59
+ value: t,
60
+ classification: e
61
+ });
62
+ }, [e, c, o, t]), /* @__PURE__ */ J(
63
+ L,
89
64
  {
90
- ref: anchorRef,
65
+ ref: T,
91
66
  direction: "row",
92
67
  spacing: 1,
93
68
  alignItems: "center",
94
- ...slotProps == null ? void 0 : slotProps.stack,
69
+ ...n == null ? void 0 : n.stack,
95
70
  sx: [
96
71
  {
97
- cursor: !loading && !hideDetails ? "pointer" : "inherit",
72
+ cursor: !d && !l ? "pointer" : "inherit",
98
73
  borderBottom: "1px solid transparent",
99
- transition: theme.transitions.create(["border-bottom-color"]),
74
+ transition: x.transitions.create(["border-bottom-color"]),
100
75
  "&:hover": {
101
- borderBottomColor: !loading && (!hideDetails ? theme.palette.primary.light : null)
76
+ borderBottomColor: !d && (l ? null : x.palette.primary.light)
102
77
  }
103
78
  },
104
- ...Array.isArray((_a = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _a.sx) ? (_b = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _b.sx : [(_c = slotProps == null ? void 0 : slotProps.stack) == null ? void 0 : _c.sx]
79
+ ...Array.isArray((q = n == null ? void 0 : n.stack) == null ? void 0 : q.sx) ? (v = n == null ? void 0 : n.stack) == null ? void 0 : v.sx : [(B = n == null ? void 0 : n.stack) == null ? void 0 : B.sx]
105
80
  ],
106
- onClick: !useDetailsIcon ? clicker : void 0,
81
+ onClick: p ? void 0 : A,
107
82
  children: [
108
- /* @__PURE__ */ jsx(
109
- AssessmentIcon,
83
+ /* @__PURE__ */ a(
84
+ j,
110
85
  {
111
- ubiquitous: true,
112
- value: { type, value, classification },
113
- annotations,
114
- counters,
115
- disableTooltip: forceDetails
86
+ ubiquitous: !0,
87
+ value: { type: o, value: t, classification: e },
88
+ annotations: f,
89
+ counters: r,
90
+ disableTooltip: c
116
91
  }
117
92
  ),
118
- /* @__PURE__ */ jsx(
119
- OpinionIcon,
93
+ /* @__PURE__ */ a(
94
+ O,
120
95
  {
121
- ubiquitous: true,
122
- value: { type, value, classification },
123
- annotations,
124
- counters,
125
- disableTooltip: forceDetails
96
+ ubiquitous: !0,
97
+ value: { type: o, value: t, classification: e },
98
+ annotations: f,
99
+ counters: r,
100
+ disableTooltip: c
126
101
  }
127
102
  ),
128
- /* @__PURE__ */ jsx(
129
- ContextIcon,
103
+ /* @__PURE__ */ a(
104
+ z,
130
105
  {
131
- ubiquitous: true,
132
- value: { type, value, classification },
133
- annotations,
134
- counters,
135
- showExtraIcon: contextIcon,
136
- disableTooltip: forceDetails
106
+ ubiquitous: !0,
107
+ value: { type: o, value: t, classification: e },
108
+ annotations: f,
109
+ counters: r,
110
+ showExtraIcon: g,
111
+ disableTooltip: c
137
112
  }
138
113
  ),
139
- children ?? /* @__PURE__ */ jsx(FrequencyText, { id: `enriched-${type}-value`, ...otherProps, annotations, value }),
140
- /* @__PURE__ */ jsx(
141
- AssessmentIcon,
114
+ G ?? /* @__PURE__ */ a(_, { id: `enriched-${o}-value`, ...m, annotations: f, value: t }),
115
+ /* @__PURE__ */ a(
116
+ j,
142
117
  {
143
- value: { type, value, classification },
144
- annotations,
145
- counters,
146
- disableTooltip: forceDetails
118
+ value: { type: o, value: t, classification: e },
119
+ annotations: f,
120
+ counters: r,
121
+ disableTooltip: c
147
122
  }
148
123
  ),
149
- /* @__PURE__ */ jsx(
150
- OpinionIcon,
124
+ /* @__PURE__ */ a(
125
+ O,
151
126
  {
152
- value: { type, value, classification },
153
- annotations,
154
- counters,
155
- disableTooltip: forceDetails
127
+ value: { type: o, value: t, classification: e },
128
+ annotations: f,
129
+ counters: r,
130
+ disableTooltip: c
156
131
  }
157
132
  ),
158
- /* @__PURE__ */ jsx(
159
- ContextIcon,
133
+ /* @__PURE__ */ a(
134
+ z,
160
135
  {
161
- value: { type, value, classification },
162
- annotations,
163
- counters,
164
- showExtraIcon: contextIcon,
165
- disableTooltip: forceDetails
136
+ value: { type: o, value: t, classification: e },
137
+ annotations: f,
138
+ counters: r,
139
+ showExtraIcon: g,
140
+ disableTooltip: c
166
141
  }
167
142
  ),
168
- /* @__PURE__ */ jsx(ActionIcon, { counters, value: { type, value, classification }, disableTooltip: forceDetails }),
169
- loading && !hideLoading && /* @__PURE__ */ jsx(CircularProgress, { color: "primary", size: 18 }),
170
- !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" }) }) })
143
+ /* @__PURE__ */ a(F, { counters: r, value: { type: o, value: t, classification: e }, disableTooltip: c }),
144
+ d && !R && /* @__PURE__ */ a(N, { color: "primary", size: 18 }),
145
+ !d && p && /* @__PURE__ */ a(Q, { title: M("details.open"), children: /* @__PURE__ */ a(U, { size: "small", onClick: A, sx: { color: x.palette.action.disabled }, children: /* @__PURE__ */ a(V, { icon: "ic:outline-info" }) }) })
171
146
  ]
172
147
  }
173
148
  );
174
- };
175
- const EnrichedTypography$1 = memo(EnrichedTypography);
149
+ }, yi = D(oi);
176
150
  export {
177
- EnrichedTypography$1 as default
151
+ yi as default
178
152
  };
@@ -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,14 +3,14 @@ import "@jsonforms/material-renderers";
3
3
  import "@jsonforms/react";
4
4
  import "@mui/material";
5
5
  import "../display/icons/Iconified.js";
6
- import "../../index-BDrtH5ec.js";
6
+ import "../../index-4YFAh_sa.js";
7
7
  import "../../hooks/ClueComponentContext.js";
8
- import { A } from "../../ActionForm-c5hLIfQ-.js";
8
+ import { A } from "../../ActionForm-WIj7BfD5.js";
9
9
  import "react";
10
- import "../../index-BDVjGvMI.js";
10
+ import "../../index-E7g8cRyW.js";
11
11
  import "../ErrorBoundary.js";
12
12
  import "./form/schemaAdapter.js";
13
- import "../../utils-CxIhC2xH.js";
13
+ import "../../utils-C_RX5uMP.js";
14
14
  export {
15
15
  A as default
16
16
  };