@cccsaurora/clue-ui 1.2.3 → 1.2.4-dev.278

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 (188) hide show
  1. package/ActionForm-BdW0Za1y.js +5956 -0
  2. package/AnnotationDetails-BHZFzyt-.js +175 -0
  3. package/AnnotationPreview-DGoyoxRb.js +188 -0
  4. package/ClueEnrichContext-CJEJxrgs.js +541 -0
  5. package/FlexOne-BSYAhhtG.js +9 -0
  6. package/_MapCache-WmuDdwuH.js +222 -0
  7. package/_Uint8Array-B7JqpgFX.js +128 -0
  8. package/_baseAssignValue-CGTuELqU.js +25 -0
  9. package/_baseClone-CkNrTyhm.js +283 -0
  10. package/_baseExtremum-kob8QXyt.js +18 -0
  11. package/_baseFlatten-jIR_sN_-.js +92 -0
  12. package/_baseGet-Bx3A4Qfp.js +108 -0
  13. package/_baseIsEqual-C5OTWzTk.js +208 -0
  14. package/_baseIteratee-avi7MX2o.js +126 -0
  15. package/_baseSlice-GAv_YFTT.js +20 -0
  16. package/_baseSum-D0WC1dN0.js +13 -0
  17. package/_baseUniq-BI9GIHMF.js +115 -0
  18. package/_commonjsHelpers-DWwsNxpa.js +8 -0
  19. package/_createAggregator-QD8MzKwe.js +63 -0
  20. package/_getPrototype-CU0j_POw.js +5 -0
  21. package/_getTag-Ckxxfr88.js +126 -0
  22. package/_isIterateeCall-Ds3sw2SF.js +17 -0
  23. package/_setToArray-CaPKQhcz.js +33 -0
  24. package/cloneDeep-DJrLSw8W.js +8 -0
  25. package/components/AnnotationBody.js +49 -35
  26. package/components/AnnotationDetailPopover.js +36 -30
  27. package/components/AnnotationDetails.js +7 -7
  28. package/components/AnnotationEntry.js +35 -35
  29. package/components/AnnotationPreview.js +5 -5
  30. package/components/ClassificationChip.js +44 -23
  31. package/components/CountBadge.js +31 -26
  32. package/components/EnrichedCard.js +110 -97
  33. package/components/EnrichedChip.js +130 -105
  34. package/components/EnrichedTypography.js +133 -107
  35. package/components/ErrorBoundary.js +28 -24
  36. package/components/RetryFailedEnrichments.js +10 -9
  37. package/components/SourcePicker.js +57 -49
  38. package/components/actions/ActionForm.js +4 -4
  39. package/components/actions/ExecutePopover.js +75 -59
  40. package/components/actions/ResultModal.js +4 -4
  41. package/components/actions/form/schemaAdapter.js +39 -23
  42. package/components/actions/formats/FileResult.js +86 -59
  43. package/components/actions/formats/index.js +21 -10
  44. package/components/display/graph/ExpandMoreButton.js +10 -10
  45. package/components/display/graph/elements/NodeCard.js +111 -91
  46. package/components/display/graph/elements/NodeTag.js +15 -13
  47. package/components/display/graph/index.js +261 -202
  48. package/components/display/graph/visualizations/Leaf.js +88 -69
  49. package/components/display/graph/visualizations/cloud/index.js +98 -81
  50. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  51. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  53. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  55. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  56. package/components/display/graph/visualizations/icons/index.js +14 -13
  57. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  58. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  59. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  60. package/components/display/graph/visualizations/tree/index.js +408 -306
  61. package/components/display/icons/Iconified.js +27 -12
  62. package/components/display/json/index.js +4 -4
  63. package/components/display/markdown/index.js +8678 -5770
  64. package/components/enrichment/EnrichPopover.js +54 -46
  65. package/components/fetchers/Fetcher.js +158 -119
  66. package/components/fetchers/PreviewModal.js +20 -17
  67. package/components/fetchers/StatusChip.js +21 -17
  68. package/components/group/Entry.js +13 -11
  69. package/components/group/Group.js +13 -10
  70. package/components/group/GroupControl.js +76 -65
  71. package/components/stats/QueryStatus.js +43 -33
  72. package/countBy-c6S3dvSW.js +14 -0
  73. package/data/event.js +6 -4
  74. package/database/index.js +2 -2
  75. package/debounce-bV0h5FC5.js +92 -0
  76. package/en/translation.json +1 -1
  77. package/fr/translation.json +1 -1
  78. package/get-DSsNkRQs.js +8 -0
  79. package/groupBy-xqz-n0Vd.js +14 -0
  80. package/hooks/ClueActionContext.js +6 -6
  81. package/hooks/ClueComponentContext.js +29 -23
  82. package/hooks/ClueConfigProvider.js +14 -12
  83. package/hooks/ClueDatabaseContext.js +19 -13
  84. package/hooks/ClueEnrichContext.js +8 -8
  85. package/hooks/ClueFetcherContext.js +83 -56
  86. package/hooks/ClueGroupContext.js +17 -14
  87. package/hooks/CluePopupContext.js +5 -5
  88. package/hooks/ClueProvider.js +12 -10
  89. package/hooks/selectors.js +7 -7
  90. package/hooks/useActionResult.d.ts +1 -0
  91. package/hooks/useActionResult.js +4 -2
  92. package/hooks/useAnnotations.js +47 -31
  93. package/hooks/useClue.js +6 -4
  94. package/hooks/useClueActions.js +3 -3
  95. package/hooks/useClueConfig.js +6 -4
  96. package/hooks/useClueTypeConfig.js +3 -3
  97. package/hooks/useComparator.js +722 -435
  98. package/hooks/useErrors.js +22 -18
  99. package/hooks/useFetcherResult.d.ts +1 -0
  100. package/hooks/useFetcherResult.js +33 -24
  101. package/hooks/useMyHighlights.js +66 -36
  102. package/hooks/useMyLocalStorage.js +66 -37
  103. package/iconify-CXMreGTg.js +1782 -0
  104. package/icons/Action.js +66 -49
  105. package/icons/Assessment.js +85 -69
  106. package/icons/Context.js +77 -63
  107. package/icons/Opinion.js +76 -60
  108. package/icons/iconMap.js +2 -2
  109. package/identity-CPGTqrE4.js +6 -0
  110. package/index-AMfoEg_6.js +696 -0
  111. package/index-B6C2a_Lg.js +1172 -0
  112. package/index-C12gPw2W.js +17698 -0
  113. package/index-DCKkHTvx.js +15750 -0
  114. package/index-JcKyZeoY.js +465 -0
  115. package/isNil-CIubwp4T.js +6 -0
  116. package/isObject-FTY-5JQX.js +7 -0
  117. package/isObjectLike-OAgjjZye.js +48 -0
  118. package/isSymbol-Xd2FsJyp.js +8 -0
  119. package/last-CUCl67Im.js +7 -0
  120. package/main.js +60 -60
  121. package/maxBy-IKHzFrCS.js +8 -0
  122. package/package.json +1 -1
  123. package/sortBy-DfSj8IoJ.js +96 -0
  124. package/sumBy-D-hb_NY-.js +8 -0
  125. package/text/Frequency.js +42 -23
  126. package/toFinite-Bc55msYj.js +16 -0
  127. package/toNumber-DPxy1FBy.js +39 -0
  128. package/types/WithActionData.d.ts +2 -1
  129. package/useClueTypeConfig-Z1LFp01b.js +3289 -0
  130. package/utils/chain.js +92 -65
  131. package/utils/classificationParser.js +519 -256
  132. package/utils/constants.js +35 -10
  133. package/utils/graph.js +72 -45
  134. package/utils/hashUtil.js +7 -7
  135. package/utils/line.js +131 -81
  136. package/utils/loggerUtil.js +5 -3
  137. package/utils/sessionStorage.js +41 -27
  138. package/utils/time.js +423 -423
  139. package/utils/utils.js +9 -9
  140. package/utils/window.js +21 -10
  141. package/utils-HmNPuoDB.js +199 -0
  142. package/ActionForm-DlOXqMUx.js +0 -4460
  143. package/AnnotationDetails-Bk-p0F6h.js +0 -160
  144. package/AnnotationPreview-jzZvkCxJ.js +0 -140
  145. package/ClueEnrichContext-KqRuuWNS.js +0 -418
  146. package/FlexOne-BXWFOd1T.js +0 -6
  147. package/_MapCache-BiTi0iqu.js +0 -180
  148. package/_Uint8Array-BQNOM9Rr.js +0 -101
  149. package/_baseAssignValue-CNMLQZco.js +0 -20
  150. package/_baseClone-BnT-6pyM.js +0 -207
  151. package/_baseExtremum-Ca2EHgy2.js +0 -16
  152. package/_baseFlatten-Bfr_Molw.js +0 -72
  153. package/_baseGet-DSZygzyq.js +0 -79
  154. package/_baseIsEqual-VgvaAFZG.js +0 -147
  155. package/_baseIteratee-Dbfsw5z8.js +0 -95
  156. package/_baseSlice-M5RKzt1A.js +0 -10
  157. package/_baseSum-wEbgNeUs.js +0 -10
  158. package/_baseUniq-BJcj69PL.js +0 -79
  159. package/_commonjsHelpers-DaMA6jEr.js +0 -8
  160. package/_createAggregator-k3TuAnxT.js +0 -53
  161. package/_getPrototype-Cr1Mk7BC.js +0 -5
  162. package/_getTag-CK2Sffaq.js +0 -90
  163. package/_isIterateeCall-DkJP7Rbx.js +0 -13
  164. package/_setToArray-C7yMOeww.js +0 -29
  165. package/cloneDeep-CF8TtLHr.js +0 -8
  166. package/countBy-CdYegFSu.js +0 -8
  167. package/debounce-DryYcbJ4.js +0 -56
  168. package/get-CH7kz5Ix.js +0 -8
  169. package/groupBy-br8xmD2R.js +0 -8
  170. package/iconify-BBckr5AQ.js +0 -1263
  171. package/identity-ByMq8VxU.js +0 -6
  172. package/index-BHAe_V9n.js +0 -12768
  173. package/index-BK-zfYhR.js +0 -358
  174. package/index-CA5CUNZO.js +0 -975
  175. package/index-Dj5C04IX.js +0 -568
  176. package/index-p5_wX7q1.js +0 -11729
  177. package/isNil-CjWwlQS3.js +0 -6
  178. package/isObject-B53jY8Qg.js +0 -7
  179. package/isObjectLike-BatpeCIi.js +0 -29
  180. package/isSymbol-C3_SC0Qp.js +0 -8
  181. package/last-7CdUxN0r.js +0 -7
  182. package/maxBy-Bc0dYHcO.js +0 -8
  183. package/sortBy-DY2JBf9n.js +0 -75
  184. package/sumBy-DuMASLPd.js +0 -8
  185. package/toFinite-BMy6GObD.js +0 -14
  186. package/toNumber-YVhnnJv4.js +0 -31
  187. package/useClueTypeConfig-Ct9Ygter.js +0 -2292
  188. package/utils-DmwSUrum.js +0 -129
@@ -0,0 +1,465 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { ClickAwayListener, TextField, InputAdornment, Popper, Paper, MenuList, MenuItem, ListItemText, useTheme, Stack, Skeleton } from "@mui/material";
6
+ import { useRef, useState, useEffect, useMemo, lazy } from "react";
7
+ import { r as removeEmpty, s as searchObject, f as flatten } from "./utils-HmNPuoDB.js";
8
+ import { ClueComponentContext } from "./hooks/ClueComponentContext.js";
9
+ import { useMyLocalStorageItem } from "./hooks/useMyLocalStorage.js";
10
+ import { StorageKey } from "./utils/constants.js";
11
+ import { u as useContextSelector } from "./index-AMfoEg_6.js";
12
+ const ENTER = "Enter";
13
+ const ESCAPE = "Escape";
14
+ const ARROW_LEFT = "ArrowLeft";
15
+ const ARROW_UP = "ArrowUp";
16
+ const ARROW_RIGHT = "ArrowRight";
17
+ const ARROW_DOWN = "ArrowDown";
18
+ const BACKSPACE = "Backspace";
19
+ const SPACE = " ";
20
+ function is(key, check) {
21
+ return key === check;
22
+ }
23
+ function isArrowUp(key) {
24
+ return is(key, ARROW_UP);
25
+ }
26
+ function isArrowDown(key) {
27
+ return is(key, ARROW_DOWN);
28
+ }
29
+ function isArrowLeft(key) {
30
+ return is(key, ARROW_LEFT);
31
+ }
32
+ function isArrowRight(key) {
33
+ return is(key, ARROW_RIGHT);
34
+ }
35
+ function isEscape(key) {
36
+ return is(key, ESCAPE);
37
+ }
38
+ function isEnter(key) {
39
+ return is(key, ENTER);
40
+ }
41
+ function isBackspace(key) {
42
+ return is(key, BACKSPACE);
43
+ }
44
+ function isSpace(key) {
45
+ return is(key, SPACE);
46
+ }
47
+ function parseEvent(event) {
48
+ return {
49
+ key: event.key,
50
+ isCtrl: event.ctrlKey,
51
+ isEnter: isEnter(event.key),
52
+ isSpace: isSpace(event.key),
53
+ isBackspace: isBackspace(event.key),
54
+ isEscape: isEscape(event.key),
55
+ isArrowLeft: isArrowLeft(event.key),
56
+ isArrowRight: isArrowRight(event.key),
57
+ isArrowUp: isArrowUp(event.key),
58
+ isArrowDown: isArrowDown(event.key)
59
+ };
60
+ }
61
+ class TuiPhraseLexer {
62
+ constructor() {
63
+ __publicField(this, "_phrase", null);
64
+ __publicField(this, "_buffer", null);
65
+ __publicField(this, "_tokens", null);
66
+ __publicField(this, "_consumers", null);
67
+ __publicField(this, "_consumer", null);
68
+ __publicField(this, "_startIndex", 0);
69
+ __publicField(this, "_endIndex", -1);
70
+ }
71
+ find(cursor, tokens) {
72
+ const index = tokens.findIndex((t) => t.startIndex <= cursor && cursor <= t.endIndex);
73
+ const token = tokens.at(index);
74
+ return { index, token };
75
+ }
76
+ parse(phrase, cursor = 0) {
77
+ this._phrase = phrase;
78
+ this._buffer = [];
79
+ this._tokens = [];
80
+ this._consumers = this.consumers();
81
+ this._consumer = null;
82
+ this._startIndex = 0;
83
+ this._endIndex = -1;
84
+ for (let i = 0; i < this._phrase.length; i++) {
85
+ this._endIndex += 1;
86
+ const next = this._phrase[i];
87
+ this._buffer.push(next);
88
+ let newLock = false;
89
+ if (!this._consumer) {
90
+ this._consumer = this.lock();
91
+ if (this._consumer) {
92
+ newLock = true;
93
+ this._consumer.init(this._buffer, this);
94
+ }
95
+ }
96
+ if (this._consumer) {
97
+ if (newLock) {
98
+ newLock = false;
99
+ } else {
100
+ this._consumer.append(next, this);
101
+ }
102
+ const token = this._consumer.consume(this);
103
+ if (token) {
104
+ this._tokens.push(token);
105
+ this._buffer = [];
106
+ this._consumer = null;
107
+ this._startIndex = this._endIndex + 1;
108
+ }
109
+ }
110
+ }
111
+ this._tokens.push({ type: "eop", startIndex: phrase.length, endIndex: phrase.length, value: "" });
112
+ const flatTokens = this._tokens.flatMap((t) => t.children && t.children.length > 0 ? t.children : [t]);
113
+ const { token: parent, index: parentIndex } = this.find(cursor, this._tokens);
114
+ const { token: current, index: currentIndex } = this.find(cursor, flatTokens);
115
+ const filter = cursor === current.startIndex && flatTokens[currentIndex - 1] ? flatTokens[currentIndex - 1] : current;
116
+ return {
117
+ cursor,
118
+ parentIndex,
119
+ parent,
120
+ currentIndex,
121
+ current,
122
+ suggest: {
123
+ token: filter,
124
+ parent: this.find(filter.startIndex, this._tokens).token,
125
+ value: filter.value.substring(0, cursor - filter.startIndex)
126
+ },
127
+ tokens: this._tokens
128
+ };
129
+ }
130
+ lock() {
131
+ return this._consumers.find((c) => c.lock(this));
132
+ }
133
+ buffer() {
134
+ return this._buffer;
135
+ }
136
+ bufferValue() {
137
+ return this._buffer.join("");
138
+ }
139
+ start() {
140
+ return this._startIndex;
141
+ }
142
+ end() {
143
+ return this._endIndex;
144
+ }
145
+ ahead(inc) {
146
+ const start = this._endIndex + 1;
147
+ if (inc) {
148
+ return this._phrase.slice(start, start + inc);
149
+ }
150
+ return this._phrase.substring(start);
151
+ }
152
+ behind(inc) {
153
+ if (inc) {
154
+ return this.bufferValue().slice(-inc);
155
+ }
156
+ return this.bufferValue();
157
+ }
158
+ behindEndsWithAny(trim, ...values) {
159
+ const behind = trim ? this.behind().trimEnd() : this.behind();
160
+ return values.some((v) => behind.endsWith(v));
161
+ }
162
+ testBehind(regex) {
163
+ return regex.test(this.behind());
164
+ }
165
+ aheadStartsWithAny(trim, ...values) {
166
+ const ahead = trim ? this.ahead().trimStart() : this.ahead();
167
+ return values.some((v) => ahead.startsWith(v));
168
+ }
169
+ aheadIsEmpty(trim = false) {
170
+ return trim ? this.ahead().trim().length === 0 : this.ahead().length === 0;
171
+ }
172
+ testAhead(regex) {
173
+ return regex.test(this.ahead());
174
+ }
175
+ }
176
+ class TuiPhraseConsumer {
177
+ constructor() {
178
+ __publicField(this, "_buffer", []);
179
+ }
180
+ reset() {
181
+ this._buffer = [];
182
+ }
183
+ init(buffer, lexer) {
184
+ this._buffer = [...buffer];
185
+ }
186
+ append(next, lexer) {
187
+ this._buffer.push(next);
188
+ }
189
+ bufferValue() {
190
+ return this._buffer.join("");
191
+ }
192
+ endsWithAny(...values) {
193
+ const _bufferValue = this.bufferValue();
194
+ return values.some((v) => _bufferValue.endsWith(v));
195
+ }
196
+ test(regex) {
197
+ return regex.test(this.bufferValue());
198
+ }
199
+ }
200
+ class WhitespaceConsumer extends TuiPhraseConsumer {
201
+ lock(lexer) {
202
+ return lexer.bufferValue().match(/\s/) && lexer.ahead(1) !== " ";
203
+ }
204
+ consume(lexer) {
205
+ if (lexer.ahead(1) !== " ") {
206
+ return {
207
+ type: "whitespace",
208
+ startIndex: lexer.start(),
209
+ endIndex: lexer.end(),
210
+ value: this._buffer.join("")
211
+ };
212
+ }
213
+ return null;
214
+ }
215
+ }
216
+ class WordConsumer extends TuiPhraseConsumer {
217
+ lock(lexer) {
218
+ return !lexer.bufferValue().match(/\s/) && (lexer.ahead(1) === " " || lexer.ahead(1) === "");
219
+ }
220
+ consume(lexer) {
221
+ if (lexer.ahead(1) === " " || lexer.aheadIsEmpty(true)) {
222
+ return {
223
+ type: "word",
224
+ startIndex: lexer.start(),
225
+ endIndex: lexer.end(),
226
+ value: this._buffer.join("")
227
+ };
228
+ }
229
+ return null;
230
+ }
231
+ }
232
+ class WordLexer extends TuiPhraseLexer {
233
+ consumers() {
234
+ return [new WordConsumer(), new WhitespaceConsumer()];
235
+ }
236
+ }
237
+ class WordSuggestor {
238
+ constructor(suggestions) {
239
+ this.suggestions = suggestions;
240
+ }
241
+ suggest(phrase) {
242
+ return this.suggestions.filter((s) => s.indexOf(phrase.suggest.value) > -1);
243
+ }
244
+ }
245
+ function TuiPhrase({
246
+ value = "",
247
+ variant = "outlined",
248
+ suggestions = [],
249
+ lexer,
250
+ suggester,
251
+ startAdornment,
252
+ endAdornment,
253
+ onChange,
254
+ onKeyDown,
255
+ ...props
256
+ }) {
257
+ const containerRef = useRef();
258
+ const inputRef = useRef();
259
+ const menuRef = useRef();
260
+ const lexerRef = useRef(lexer || new WordLexer());
261
+ const analysisRef = useRef();
262
+ const suggesterRef = useRef(suggester || new WordSuggestor(suggestions));
263
+ const [optionsOpen, setOptionsOpen] = useState(false);
264
+ const [options, setOptions] = useState(suggestions);
265
+ useEffect(() => {
266
+ suggesterRef.current = suggester || new WordSuggestor(suggestions);
267
+ }, [suggester, suggestions]);
268
+ const lex = (inputValue, offset = 0) => {
269
+ let cursor = inputRef.current.querySelector("input").selectionStart + offset;
270
+ cursor = cursor < 0 ? 0 : cursor > inputValue.length ? inputValue.length : cursor;
271
+ analysisRef.current = lexerRef.current.parse(inputValue, cursor);
272
+ return analysisRef.current;
273
+ };
274
+ const _suggest = (inputValue, offset = 0) => {
275
+ const _suggestions = suggesterRef.current.suggest(lex(inputValue, offset));
276
+ setOptions((_suggestions == null ? void 0 : _suggestions.length) > 0 ? _suggestions : [...suggestions]);
277
+ };
278
+ const _onChange = (event) => {
279
+ onChange(event.target.value);
280
+ };
281
+ const _onInputKeyDown = (event) => {
282
+ const parsedEvent = parseEvent(event);
283
+ const { isEnter: isEnter2, isCtrl, isSpace: isSpace2, isEscape: isEscape2, isArrowDown: isArrowDown2 } = parsedEvent;
284
+ if (isArrowDown2) {
285
+ event.preventDefault();
286
+ menuRef.current.focus();
287
+ } else if (isCtrl && isSpace2) {
288
+ setOptionsOpen(true);
289
+ _suggest(value);
290
+ } else if (isEscape2) {
291
+ setOptionsOpen(!optionsOpen);
292
+ }
293
+ if (isEnter2 && optionsOpen && options.length === 1) {
294
+ onWordClick(options[0]);
295
+ event.preventDefault();
296
+ } else if (onKeyDown) {
297
+ onKeyDown(parsedEvent);
298
+ }
299
+ };
300
+ const _onSelectCapture = (event) => {
301
+ if (optionsOpen) {
302
+ _suggest(event.target.value);
303
+ }
304
+ };
305
+ const _onMenuKeyDown = (event) => {
306
+ const { isEscape: isEscape2 } = parseEvent(event);
307
+ if (isEscape2) {
308
+ inputRef.current.focus();
309
+ setOptionsOpen(false);
310
+ }
311
+ };
312
+ const onWordClick = (word) => {
313
+ const { suggest } = analysisRef.current;
314
+ const inputEl = inputRef.current.querySelector("input");
315
+ inputEl.focus();
316
+ inputEl.setSelectionRange(suggest.token.startIndex, suggest.token.endIndex + 1);
317
+ document.execCommand("insertText", false, word);
318
+ setOptionsOpen(false);
319
+ };
320
+ return /* @__PURE__ */ jsx(ClickAwayListener, { onClickAway: () => setOptionsOpen(false), children: /* @__PURE__ */ jsxs("div", { ref: containerRef, style: { position: "relative" }, children: [
321
+ /* @__PURE__ */ jsx(
322
+ TextField,
323
+ {
324
+ ref: inputRef,
325
+ ...props,
326
+ fullWidth: true,
327
+ autoComplete: "off",
328
+ value,
329
+ variant,
330
+ onChange: _onChange,
331
+ onKeyDown: _onInputKeyDown,
332
+ InputProps: {
333
+ ...props.InputProps,
334
+ onSelectCapture: _onSelectCapture,
335
+ startAdornment: startAdornment && /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: startAdornment }),
336
+ endAdornment: endAdornment && /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: endAdornment })
337
+ }
338
+ }
339
+ ),
340
+ /* @__PURE__ */ jsx(
341
+ Popper,
342
+ {
343
+ anchorEl: containerRef.current,
344
+ style: { width: "100%", zIndex: 100 },
345
+ open: optionsOpen && options.length > 0,
346
+ disablePortal: true,
347
+ children: /* @__PURE__ */ jsx(
348
+ Paper,
349
+ {
350
+ elevation: 2,
351
+ sx: { maxHeight: 200, overflow: "auto", borderTopRightRadius: 0, borderTopLeftRadius: 0 },
352
+ children: /* @__PURE__ */ jsx(
353
+ MenuList,
354
+ {
355
+ ref: menuRef,
356
+ onKeyDown: _onMenuKeyDown,
357
+ sx: {
358
+ "&:focus": {
359
+ outline: "none"
360
+ }
361
+ },
362
+ children: options == null ? void 0 : options.map((o) => /* @__PURE__ */ jsx(MenuItem, { onClick: () => onWordClick(o), children: /* @__PURE__ */ jsx(ListItemText, { children: o }) }, o))
363
+ }
364
+ )
365
+ }
366
+ )
367
+ }
368
+ )
369
+ ] }) });
370
+ }
371
+ const JSONViewer = ({ data, collapse = true, hideSearch = false, forceCompact = false, slotProps }) => {
372
+ var _a, _b, _c;
373
+ const theme = useTheme();
374
+ const [compact] = useMyLocalStorageItem(StorageKey.COMPACT_JSON);
375
+ const [flat] = useMyLocalStorageItem(StorageKey.FLATTEN_JSON);
376
+ const _ProvidedReactJson = useContextSelector(ClueComponentContext, (ctx) => ctx == null ? void 0 : ctx.ReactJson);
377
+ const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx == null ? void 0 : ctx.i18next);
378
+ const [ReactJson, setReactJson] = useState(null);
379
+ const [query, setQuery] = useState("");
380
+ const isDark = useMemo(() => theme.palette.mode === "dark", [theme]);
381
+ const filteredData = useMemo(() => removeEmpty(data, compact || forceCompact), [compact, data, forceCompact]);
382
+ const searchedData = useMemo(() => {
383
+ const _searchedData = searchObject(filteredData, query);
384
+ return flat ? flatten(_searchedData) : _searchedData;
385
+ }, [filteredData, flat, query]);
386
+ const hasError = useMemo(() => {
387
+ try {
388
+ new RegExp(query);
389
+ return false;
390
+ } catch {
391
+ return true;
392
+ }
393
+ }, [query]);
394
+ useEffect(() => {
395
+ if (_ProvidedReactJson) {
396
+ setReactJson(() => _ProvidedReactJson);
397
+ } else {
398
+ setReactJson(lazy(() => import("@microlink/react-json-view")));
399
+ }
400
+ }, [_ProvidedReactJson]);
401
+ const shouldCollapse = (field) => {
402
+ return field.name !== "root" && field.type !== "object" || field.namespace.length > 3;
403
+ };
404
+ return data ? /* @__PURE__ */ jsxs(
405
+ Stack,
406
+ {
407
+ direction: "column",
408
+ spacing: 1,
409
+ ...slotProps == null ? void 0 : slotProps.stack,
410
+ sx: {
411
+ "& > div:first-of-type": { mt: 1, mr: 0.5 },
412
+ ...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]
413
+ },
414
+ children: [
415
+ !hideSearch && /* @__PURE__ */ jsx(
416
+ TuiPhrase,
417
+ {
418
+ value: query,
419
+ onChange: setQuery,
420
+ size: "small",
421
+ error: hasError,
422
+ label: t("json.viewer.search.label"),
423
+ placeholder: t("json.viewer.search.prompt")
424
+ }
425
+ ),
426
+ ReactJson && /* @__PURE__ */ jsx(
427
+ ReactJson,
428
+ {
429
+ src: searchedData,
430
+ theme: isDark ? "summerfruit" : "summerfruit:inverted",
431
+ indentWidth: 2,
432
+ displayDataTypes: !compact && !forceCompact,
433
+ displayObjectSize: !compact && !forceCompact,
434
+ shouldCollapse: collapse ? shouldCollapse : false,
435
+ quotesOnKeys: false,
436
+ style: {
437
+ flex: 1,
438
+ overflow: "auto",
439
+ height: "100%",
440
+ fontSize: compact || forceCompact ? "small" : "smaller",
441
+ borderRadius: theme.shape.borderRadius,
442
+ padding: theme.spacing(1)
443
+ },
444
+ enableClipboard: (_data) => {
445
+ if (typeof _data.src === "string") {
446
+ navigator.clipboard.writeText(_data.src);
447
+ } else {
448
+ navigator.clipboard.writeText(JSON.stringify(_data.src));
449
+ }
450
+ },
451
+ ...{
452
+ // Type declaration is wrong - this is a valid prop
453
+ displayArrayKey: !compact && !forceCompact
454
+ },
455
+ ...slotProps == null ? void 0 : slotProps.json
456
+ }
457
+ )
458
+ ]
459
+ }
460
+ ) : /* @__PURE__ */ jsx(Skeleton, { width: "100%", height: "95%", variant: "rounded" });
461
+ };
462
+ export {
463
+ JSONViewer as J,
464
+ parseEvent as p
465
+ };
@@ -0,0 +1,6 @@
1
+ function isNil(value) {
2
+ return value == null;
3
+ }
4
+ export {
5
+ isNil as i
6
+ };
@@ -0,0 +1,7 @@
1
+ function isObject(value) {
2
+ var type = typeof value;
3
+ return value != null && (type == "object" || type == "function");
4
+ }
5
+ export {
6
+ isObject as i
7
+ };
@@ -0,0 +1,48 @@
1
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
2
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
3
+ var root = freeGlobal || freeSelf || Function("return this")();
4
+ var Symbol$1 = root.Symbol;
5
+ var objectProto$1 = Object.prototype;
6
+ var hasOwnProperty = objectProto$1.hasOwnProperty;
7
+ var nativeObjectToString$1 = objectProto$1.toString;
8
+ var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
9
+ function getRawTag(value) {
10
+ var isOwn = hasOwnProperty.call(value, symToStringTag$1), tag = value[symToStringTag$1];
11
+ try {
12
+ value[symToStringTag$1] = void 0;
13
+ var unmasked = true;
14
+ } catch (e) {
15
+ }
16
+ var result = nativeObjectToString$1.call(value);
17
+ if (unmasked) {
18
+ if (isOwn) {
19
+ value[symToStringTag$1] = tag;
20
+ } else {
21
+ delete value[symToStringTag$1];
22
+ }
23
+ }
24
+ return result;
25
+ }
26
+ var objectProto = Object.prototype;
27
+ var nativeObjectToString = objectProto.toString;
28
+ function objectToString(value) {
29
+ return nativeObjectToString.call(value);
30
+ }
31
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
32
+ var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
33
+ function baseGetTag(value) {
34
+ if (value == null) {
35
+ return value === void 0 ? undefinedTag : nullTag;
36
+ }
37
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
38
+ }
39
+ function isObjectLike(value) {
40
+ return value != null && typeof value == "object";
41
+ }
42
+ export {
43
+ Symbol$1 as S,
44
+ baseGetTag as b,
45
+ freeGlobal as f,
46
+ isObjectLike as i,
47
+ root as r
48
+ };
@@ -0,0 +1,8 @@
1
+ import { i as isObjectLike, b as baseGetTag } from "./isObjectLike-OAgjjZye.js";
2
+ var symbolTag = "[object Symbol]";
3
+ function isSymbol(value) {
4
+ return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
5
+ }
6
+ export {
7
+ isSymbol as i
8
+ };
@@ -0,0 +1,7 @@
1
+ function last(array) {
2
+ var length = array == null ? 0 : array.length;
3
+ return length ? array[length - 1] : void 0;
4
+ }
5
+ export {
6
+ last as l
7
+ };
package/main.js CHANGED
@@ -1,63 +1,63 @@
1
- import { A as t, u as r, a, b as f, c as u } from "./ActionForm-DlOXqMUx.js";
2
- import { default as n } from "./components/AnnotationDetailPopover.js";
3
- import { A as l } from "./AnnotationDetails-Bk-p0F6h.js";
4
- import { default as m } from "./components/AnnotationEntry.js";
5
- import { A as d, C as i } from "./AnnotationPreview-jzZvkCxJ.js";
6
- import { default as A } from "./components/CountBadge.js";
7
- import { default as E } from "./components/EnrichedCard.js";
8
- import { default as b } from "./components/EnrichedChip.js";
9
- import { default as D } from "./components/EnrichedTypography.js";
10
- import { default as g } from "./components/fetchers/Fetcher.js";
11
- import { default as I } from "./components/fetchers/StatusChip.js";
12
- import { default as T } from "./components/group/Entry.js";
13
- import { default as G } from "./components/group/Group.js";
14
- import { default as _ } from "./components/group/GroupControl.js";
15
- import { default as q } from "./components/SourcePicker.js";
16
- import { SNACKBAR_EVENT_ID as K } from "./data/event.js";
17
- import { b as R } from "./index-BHAe_V9n.js";
18
- import { ClueComponentContext as j } from "./hooks/ClueComponentContext.js";
19
- import { ClueConfigContext as H } from "./hooks/ClueConfigProvider.js";
20
- import { ClueDatabaseContext as L } from "./hooks/ClueDatabaseContext.js";
21
- import { C as Q } from "./ClueEnrichContext-KqRuuWNS.js";
22
- import { ClueProvider as W } from "./hooks/ClueProvider.js";
23
- import { default as Y } from "./hooks/useClue.js";
24
- import { default as $ } from "./hooks/useClueConfig.js";
25
- import { default as oe } from "./icons/Assessment.js";
26
- import { default as re } from "./icons/Context.js";
27
- import { default as fe } from "./icons/Opinion.js";
28
- import { default as se } from "./text/Frequency.js";
1
+ import { A, u, a, b, c } from "./ActionForm-BdW0Za1y.js";
2
+ import { default as default2 } from "./components/AnnotationDetailPopover.js";
3
+ import { A as A2 } from "./AnnotationDetails-BHZFzyt-.js";
4
+ import { default as default3 } from "./components/AnnotationEntry.js";
5
+ import { A as A3, C } from "./AnnotationPreview-DGoyoxRb.js";
6
+ import { default as default4 } from "./components/CountBadge.js";
7
+ import { default as default5 } from "./components/EnrichedCard.js";
8
+ import { default as default6 } from "./components/EnrichedChip.js";
9
+ import { default as default7 } from "./components/EnrichedTypography.js";
10
+ import { default as default8 } from "./components/fetchers/Fetcher.js";
11
+ import { default as default9 } from "./components/fetchers/StatusChip.js";
12
+ import { default as default10 } from "./components/group/Entry.js";
13
+ import { default as default11 } from "./components/group/Group.js";
14
+ import { default as default12 } from "./components/group/GroupControl.js";
15
+ import { default as default13 } from "./components/SourcePicker.js";
16
+ import { SNACKBAR_EVENT_ID } from "./data/event.js";
17
+ import { b as b2 } from "./index-C12gPw2W.js";
18
+ import { ClueComponentContext } from "./hooks/ClueComponentContext.js";
19
+ import { ClueConfigContext } from "./hooks/ClueConfigProvider.js";
20
+ import { ClueDatabaseContext } from "./hooks/ClueDatabaseContext.js";
21
+ import { C as C2 } from "./ClueEnrichContext-CJEJxrgs.js";
22
+ import { ClueProvider } from "./hooks/ClueProvider.js";
23
+ import { default as default14 } from "./hooks/useClue.js";
24
+ import { default as default15 } from "./hooks/useClueConfig.js";
25
+ import { default as default16 } from "./icons/Assessment.js";
26
+ import { default as default17 } from "./icons/Context.js";
27
+ import { default as default18 } from "./icons/Opinion.js";
28
+ import { default as default19 } from "./text/Frequency.js";
29
29
  export {
30
- t as ActionForm,
31
- n as AnnotationDetailPopover,
32
- l as AnnotationDetails,
33
- m as AnnotationEntry,
34
- d as AnnotationPreview,
35
- oe as AssessmentIcon,
36
- j as ClueComponentContext,
37
- H as ClueConfigContext,
38
- L as ClueDatabaseContext,
39
- Q as ClueEnrichContext,
40
- i as CluePopupContext,
41
- W as ClueProvider,
42
- re as ContextIcon,
43
- A as CountBadge,
44
- E as EnrichedCard,
45
- b as EnrichedChip,
46
- D as EnrichedTypography,
47
- T as Entry,
48
- g as Fetcher,
49
- se as FrequencyText,
50
- G as Group,
51
- _ as GroupControl,
52
- fe as OpinionIcon,
53
- K as SNACKBAR_EVENT_ID,
54
- q as SourcePicker,
55
- I as StatusChip,
56
- R as buildDatabase,
57
- Y as useClue,
58
- r as useClueActions,
30
+ A as ActionForm,
31
+ default2 as AnnotationDetailPopover,
32
+ A2 as AnnotationDetails,
33
+ default3 as AnnotationEntry,
34
+ A3 as AnnotationPreview,
35
+ default16 as AssessmentIcon,
36
+ ClueComponentContext,
37
+ ClueConfigContext,
38
+ ClueDatabaseContext,
39
+ C2 as ClueEnrichContext,
40
+ C as CluePopupContext,
41
+ ClueProvider,
42
+ default17 as ContextIcon,
43
+ default4 as CountBadge,
44
+ default5 as EnrichedCard,
45
+ default6 as EnrichedChip,
46
+ default7 as EnrichedTypography,
47
+ default10 as Entry,
48
+ default8 as Fetcher,
49
+ default19 as FrequencyText,
50
+ default11 as Group,
51
+ default12 as GroupControl,
52
+ default18 as OpinionIcon,
53
+ SNACKBAR_EVENT_ID,
54
+ default13 as SourcePicker,
55
+ default9 as StatusChip,
56
+ b2 as buildDatabase,
57
+ default14 as useClue,
58
+ u as useClueActions,
59
59
  a as useClueActionsSelector,
60
- $ as useClueConfig,
61
- f as useClueEnrichSelector,
62
- u as useClueFetcherSelector
60
+ default15 as useClueConfig,
61
+ b as useClueEnrichSelector,
62
+ c as useClueFetcherSelector
63
63
  };
@@ -0,0 +1,8 @@
1
+ import { b as baseExtremum, a as baseGt } from "./_baseExtremum-kob8QXyt.js";
2
+ import { b as baseIteratee } from "./_baseIteratee-avi7MX2o.js";
3
+ function maxBy(array, iteratee) {
4
+ return array && array.length ? baseExtremum(array, baseIteratee(iteratee), baseGt) : void 0;
5
+ }
6
+ export {
7
+ maxBy as m
8
+ };
package/package.json CHANGED
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "type": "module",
68
68
  "types": "main.d.ts",
69
- "version": "1.2.3",
69
+ "version": "1.2.4-dev.278",
70
70
  "exports": {
71
71
  ".": "./main.js",
72
72
  "./index.css": "./index.css",