@cccsaurora/clue-ui 1.2.3-dev.266 → 1.2.3
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.
- package/ActionForm-DlOXqMUx.js +4460 -0
- package/AnnotationDetails-Bk-p0F6h.js +160 -0
- package/AnnotationPreview-jzZvkCxJ.js +140 -0
- package/ClueEnrichContext-KqRuuWNS.js +418 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_MapCache-BiTi0iqu.js +180 -0
- package/_Uint8Array-BQNOM9Rr.js +101 -0
- package/_baseAssignValue-CNMLQZco.js +20 -0
- package/_baseClone-BnT-6pyM.js +207 -0
- package/_baseExtremum-Ca2EHgy2.js +16 -0
- package/_baseFlatten-Bfr_Molw.js +72 -0
- package/_baseGet-DSZygzyq.js +79 -0
- package/_baseIsEqual-VgvaAFZG.js +147 -0
- package/_baseIteratee-Dbfsw5z8.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-BJcj69PL.js +79 -0
- package/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/_createAggregator-k3TuAnxT.js +53 -0
- package/_getPrototype-Cr1Mk7BC.js +5 -0
- package/_getTag-CK2Sffaq.js +90 -0
- package/_isIterateeCall-DkJP7Rbx.js +13 -0
- package/_setToArray-C7yMOeww.js +29 -0
- package/cloneDeep-CF8TtLHr.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +97 -110
- package/components/EnrichedChip.js +105 -130
- package/components/EnrichedTypography.js +107 -133
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +59 -75
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +23 -39
- package/components/actions/formats/FileResult.js +59 -86
- package/components/actions/formats/index.js +10 -21
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +91 -111
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +202 -261
- package/components/display/graph/visualizations/Leaf.js +69 -88
- package/components/display/graph/visualizations/cloud/index.js +81 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +306 -408
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +5770 -8678
- package/components/enrichment/EnrichPopover.js +46 -54
- package/components/fetchers/Fetcher.js +119 -158
- package/components/fetchers/PreviewModal.js +17 -20
- package/components/fetchers/StatusChip.js +17 -21
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +65 -76
- package/components/stats/QueryStatus.js +33 -43
- package/countBy-CdYegFSu.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-CH7kz5Ix.js +8 -0
- package/groupBy-br8xmD2R.js +8 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +13 -19
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +56 -83
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +2 -2
- package/hooks/useAnnotations.js +31 -47
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useFetcherResult.js +24 -33
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-BBckr5AQ.js +1263 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +69 -85
- package/icons/Context.js +63 -77
- package/icons/Opinion.js +60 -76
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-BHAe_V9n.js +12768 -0
- package/index-BK-zfYhR.js +358 -0
- package/index-CA5CUNZO.js +975 -0
- package/index-Dj5C04IX.js +568 -0
- package/index-p5_wX7q1.js +11729 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-BatpeCIi.js +29 -0
- package/isSymbol-C3_SC0Qp.js +8 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +60 -60
- package/maxBy-Bc0dYHcO.js +8 -0
- package/package.json +1 -1
- package/sortBy-DY2JBf9n.js +75 -0
- package/sumBy-DuMASLPd.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/useClueTypeConfig-Ct9Ygter.js +2292 -0
- package/utils/chain.js +65 -92
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +10 -35
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +27 -41
- package/utils/time.js +423 -423
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-DmwSUrum.js +129 -0
- package/ActionForm-uDp92tN2.js +0 -5941
- package/AnnotationDetails-DGYfOiWm.js +0 -175
- package/AnnotationPreview-bHObsb3P.js +0 -188
- package/ClueEnrichContext-CJEJxrgs.js +0 -541
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_MapCache-WmuDdwuH.js +0 -222
- package/_Uint8Array-B7JqpgFX.js +0 -128
- package/_baseAssignValue-CGTuELqU.js +0 -25
- package/_baseClone-CkNrTyhm.js +0 -283
- package/_baseExtremum-kob8QXyt.js +0 -18
- package/_baseFlatten-jIR_sN_-.js +0 -92
- package/_baseGet-Bx3A4Qfp.js +0 -108
- package/_baseIsEqual-C5OTWzTk.js +0 -208
- package/_baseIteratee-avi7MX2o.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-BI9GIHMF.js +0 -115
- package/_commonjsHelpers-DWwsNxpa.js +0 -8
- package/_createAggregator-QD8MzKwe.js +0 -63
- package/_getPrototype-CU0j_POw.js +0 -5
- package/_getTag-Ckxxfr88.js +0 -126
- package/_isIterateeCall-Ds3sw2SF.js +0 -17
- package/_setToArray-CaPKQhcz.js +0 -33
- package/cloneDeep-DJrLSw8W.js +0 -8
- package/countBy-c6S3dvSW.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-DSsNkRQs.js +0 -8
- package/groupBy-xqz-n0Vd.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-AMfoEg_6.js +0 -696
- package/index-B6C2a_Lg.js +0 -1172
- package/index-C12gPw2W.js +0 -17698
- package/index-DCKkHTvx.js +0 -15750
- package/index-JcKyZeoY.js +0 -465
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/last-CUCl67Im.js +0 -7
- package/maxBy-IKHzFrCS.js +0 -8
- package/sortBy-DfSj8IoJ.js +0 -96
- package/sumBy-D-hb_NY-.js +0 -8
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-Z1LFp01b.js +0 -3289
- package/utils-HmNPuoDB.js +0 -199
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
var Y = Object.defineProperty;
|
|
2
|
+
var Z = (t, e, n) => e in t ? Y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var _ = (t, e, n) => Z(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { jsx as f, jsxs as N } from "react/jsx-runtime";
|
|
5
|
+
import { ClickAwayListener as $, TextField as P, InputAdornment as D, Popper as ee, Paper as te, MenuList as ne, MenuItem as se, ListItemText as re, useTheme as ie, Stack as ae, Skeleton as ue } from "@mui/material";
|
|
6
|
+
import { useRef as I, useState as O, useEffect as z, useMemo as T, lazy as oe } from "react";
|
|
7
|
+
import { r as ce, s as he, f as fe } from "./utils-DmwSUrum.js";
|
|
8
|
+
import { ClueComponentContext as L } from "./hooks/ClueComponentContext.js";
|
|
9
|
+
import { useMyLocalStorageItem as j } from "./hooks/useMyLocalStorage.js";
|
|
10
|
+
import { StorageKey as J } from "./utils/constants.js";
|
|
11
|
+
import { u as K } from "./index-Dj5C04IX.js";
|
|
12
|
+
const de = "Enter", le = "Escape", me = "ArrowLeft", pe = "ArrowUp", _e = "ArrowRight", ye = "ArrowDown", ke = "Backspace", be = " ";
|
|
13
|
+
function x(t, e) {
|
|
14
|
+
return t === e;
|
|
15
|
+
}
|
|
16
|
+
function xe(t) {
|
|
17
|
+
return x(t, pe);
|
|
18
|
+
}
|
|
19
|
+
function ge(t) {
|
|
20
|
+
return x(t, ye);
|
|
21
|
+
}
|
|
22
|
+
function we(t) {
|
|
23
|
+
return x(t, me);
|
|
24
|
+
}
|
|
25
|
+
function Ie(t) {
|
|
26
|
+
return x(t, _e);
|
|
27
|
+
}
|
|
28
|
+
function Ae(t) {
|
|
29
|
+
return x(t, le);
|
|
30
|
+
}
|
|
31
|
+
function Re(t) {
|
|
32
|
+
return x(t, de);
|
|
33
|
+
}
|
|
34
|
+
function Ee(t) {
|
|
35
|
+
return x(t, ke);
|
|
36
|
+
}
|
|
37
|
+
function Se(t) {
|
|
38
|
+
return x(t, be);
|
|
39
|
+
}
|
|
40
|
+
function V(t) {
|
|
41
|
+
return {
|
|
42
|
+
key: t.key,
|
|
43
|
+
isCtrl: t.ctrlKey,
|
|
44
|
+
isEnter: Re(t.key),
|
|
45
|
+
isSpace: Se(t.key),
|
|
46
|
+
isBackspace: Ee(t.key),
|
|
47
|
+
isEscape: Ae(t.key),
|
|
48
|
+
isArrowLeft: we(t.key),
|
|
49
|
+
isArrowRight: Ie(t.key),
|
|
50
|
+
isArrowUp: xe(t.key),
|
|
51
|
+
isArrowDown: ge(t.key)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
class Ce {
|
|
55
|
+
constructor() {
|
|
56
|
+
_(this, "_phrase", null);
|
|
57
|
+
_(this, "_buffer", null);
|
|
58
|
+
_(this, "_tokens", null);
|
|
59
|
+
_(this, "_consumers", null);
|
|
60
|
+
_(this, "_consumer", null);
|
|
61
|
+
_(this, "_startIndex", 0);
|
|
62
|
+
_(this, "_endIndex", -1);
|
|
63
|
+
}
|
|
64
|
+
find(e, n) {
|
|
65
|
+
const r = n.findIndex((h) => h.startIndex <= e && e <= h.endIndex), s = n.at(r);
|
|
66
|
+
return { index: r, token: s };
|
|
67
|
+
}
|
|
68
|
+
parse(e, n = 0) {
|
|
69
|
+
this._phrase = e, this._buffer = [], this._tokens = [], this._consumers = this.consumers(), this._consumer = null, this._startIndex = 0, this._endIndex = -1;
|
|
70
|
+
for (let o = 0; o < this._phrase.length; o++) {
|
|
71
|
+
this._endIndex += 1;
|
|
72
|
+
const k = this._phrase[o];
|
|
73
|
+
this._buffer.push(k);
|
|
74
|
+
let l = !1;
|
|
75
|
+
if (this._consumer || (this._consumer = this.lock(), this._consumer && (l = !0, this._consumer.init(this._buffer, this))), this._consumer) {
|
|
76
|
+
l ? l = !1 : this._consumer.append(k, this);
|
|
77
|
+
const m = this._consumer.consume(this);
|
|
78
|
+
m && (this._tokens.push(m), this._buffer = [], this._consumer = null, this._startIndex = this._endIndex + 1);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this._tokens.push({ type: "eop", startIndex: e.length, endIndex: e.length, value: "" });
|
|
82
|
+
const r = this._tokens.flatMap((o) => o.children && o.children.length > 0 ? o.children : [o]), { token: s, index: h } = this.find(n, this._tokens), { token: c, index: y } = this.find(n, r), d = n === c.startIndex && r[y - 1] ? r[y - 1] : c;
|
|
83
|
+
return {
|
|
84
|
+
cursor: n,
|
|
85
|
+
parentIndex: h,
|
|
86
|
+
parent: s,
|
|
87
|
+
currentIndex: y,
|
|
88
|
+
current: c,
|
|
89
|
+
suggest: {
|
|
90
|
+
token: d,
|
|
91
|
+
parent: this.find(d.startIndex, this._tokens).token,
|
|
92
|
+
value: d.value.substring(0, n - d.startIndex)
|
|
93
|
+
},
|
|
94
|
+
tokens: this._tokens
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
lock() {
|
|
98
|
+
return this._consumers.find((e) => e.lock(this));
|
|
99
|
+
}
|
|
100
|
+
buffer() {
|
|
101
|
+
return this._buffer;
|
|
102
|
+
}
|
|
103
|
+
bufferValue() {
|
|
104
|
+
return this._buffer.join("");
|
|
105
|
+
}
|
|
106
|
+
start() {
|
|
107
|
+
return this._startIndex;
|
|
108
|
+
}
|
|
109
|
+
end() {
|
|
110
|
+
return this._endIndex;
|
|
111
|
+
}
|
|
112
|
+
ahead(e) {
|
|
113
|
+
const n = this._endIndex + 1;
|
|
114
|
+
return e ? this._phrase.slice(n, n + e) : this._phrase.substring(n);
|
|
115
|
+
}
|
|
116
|
+
behind(e) {
|
|
117
|
+
return e ? this.bufferValue().slice(-e) : this.bufferValue();
|
|
118
|
+
}
|
|
119
|
+
behindEndsWithAny(e, ...n) {
|
|
120
|
+
const r = e ? this.behind().trimEnd() : this.behind();
|
|
121
|
+
return n.some((s) => r.endsWith(s));
|
|
122
|
+
}
|
|
123
|
+
testBehind(e) {
|
|
124
|
+
return e.test(this.behind());
|
|
125
|
+
}
|
|
126
|
+
aheadStartsWithAny(e, ...n) {
|
|
127
|
+
const r = e ? this.ahead().trimStart() : this.ahead();
|
|
128
|
+
return n.some((s) => r.startsWith(s));
|
|
129
|
+
}
|
|
130
|
+
aheadIsEmpty(e = !1) {
|
|
131
|
+
return e ? this.ahead().trim().length === 0 : this.ahead().length === 0;
|
|
132
|
+
}
|
|
133
|
+
testAhead(e) {
|
|
134
|
+
return e.test(this.ahead());
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
class B {
|
|
138
|
+
constructor() {
|
|
139
|
+
_(this, "_buffer", []);
|
|
140
|
+
}
|
|
141
|
+
reset() {
|
|
142
|
+
this._buffer = [];
|
|
143
|
+
}
|
|
144
|
+
init(e, n) {
|
|
145
|
+
this._buffer = [...e];
|
|
146
|
+
}
|
|
147
|
+
append(e, n) {
|
|
148
|
+
this._buffer.push(e);
|
|
149
|
+
}
|
|
150
|
+
bufferValue() {
|
|
151
|
+
return this._buffer.join("");
|
|
152
|
+
}
|
|
153
|
+
endsWithAny(...e) {
|
|
154
|
+
const n = this.bufferValue();
|
|
155
|
+
return e.some((r) => n.endsWith(r));
|
|
156
|
+
}
|
|
157
|
+
test(e) {
|
|
158
|
+
return e.test(this.bufferValue());
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
class Te extends B {
|
|
162
|
+
lock(e) {
|
|
163
|
+
return e.bufferValue().match(/\s/) && e.ahead(1) !== " ";
|
|
164
|
+
}
|
|
165
|
+
consume(e) {
|
|
166
|
+
return e.ahead(1) !== " " ? {
|
|
167
|
+
type: "whitespace",
|
|
168
|
+
startIndex: e.start(),
|
|
169
|
+
endIndex: e.end(),
|
|
170
|
+
value: this._buffer.join("")
|
|
171
|
+
} : null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
class Oe extends B {
|
|
175
|
+
lock(e) {
|
|
176
|
+
return !e.bufferValue().match(/\s/) && (e.ahead(1) === " " || e.ahead(1) === "");
|
|
177
|
+
}
|
|
178
|
+
consume(e) {
|
|
179
|
+
return e.ahead(1) === " " || e.aheadIsEmpty(!0) ? {
|
|
180
|
+
type: "word",
|
|
181
|
+
startIndex: e.start(),
|
|
182
|
+
endIndex: e.end(),
|
|
183
|
+
value: this._buffer.join("")
|
|
184
|
+
} : null;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
class We extends Ce {
|
|
188
|
+
consumers() {
|
|
189
|
+
return [new Oe(), new Te()];
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
class M {
|
|
193
|
+
constructor(e) {
|
|
194
|
+
this.suggestions = e;
|
|
195
|
+
}
|
|
196
|
+
suggest(e) {
|
|
197
|
+
return this.suggestions.filter((n) => n.indexOf(e.suggest.value) > -1);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function ve({
|
|
201
|
+
value: t = "",
|
|
202
|
+
variant: e = "outlined",
|
|
203
|
+
suggestions: n = [],
|
|
204
|
+
lexer: r,
|
|
205
|
+
suggester: s,
|
|
206
|
+
startAdornment: h,
|
|
207
|
+
endAdornment: c,
|
|
208
|
+
onChange: y,
|
|
209
|
+
onKeyDown: d,
|
|
210
|
+
...o
|
|
211
|
+
}) {
|
|
212
|
+
const k = I(), l = I(), m = I(), W = I(r || new We()), A = I(), R = I(s || new M(n)), [w, g] = O(!1), [b, S] = O(n);
|
|
213
|
+
z(() => {
|
|
214
|
+
R.current = s || new M(n);
|
|
215
|
+
}, [s, n]);
|
|
216
|
+
const C = (i, p = 0) => {
|
|
217
|
+
let u = l.current.querySelector("input").selectionStart + p;
|
|
218
|
+
return u = u < 0 ? 0 : u > i.length ? i.length : u, A.current = W.current.parse(i, u), A.current;
|
|
219
|
+
}, E = (i, p = 0) => {
|
|
220
|
+
const u = R.current.suggest(C(i, p));
|
|
221
|
+
S((u == null ? void 0 : u.length) > 0 ? u : [...n]);
|
|
222
|
+
}, a = (i) => {
|
|
223
|
+
y(i.target.value);
|
|
224
|
+
}, q = (i) => {
|
|
225
|
+
const p = V(i), { isEnter: u, isCtrl: H, isSpace: G, isEscape: Q, isArrowDown: X } = p;
|
|
226
|
+
X ? (i.preventDefault(), m.current.focus()) : H && G ? (g(!0), E(t)) : Q && g(!w), u && w && b.length === 1 ? (v(b[0]), i.preventDefault()) : d && d(p);
|
|
227
|
+
}, U = (i) => {
|
|
228
|
+
w && E(i.target.value);
|
|
229
|
+
}, F = (i) => {
|
|
230
|
+
const { isEscape: p } = V(i);
|
|
231
|
+
p && (l.current.focus(), g(!1));
|
|
232
|
+
}, v = (i) => {
|
|
233
|
+
const { suggest: p } = A.current, u = l.current.querySelector("input");
|
|
234
|
+
u.focus(), u.setSelectionRange(p.token.startIndex, p.token.endIndex + 1), document.execCommand("insertText", !1, i), g(!1);
|
|
235
|
+
};
|
|
236
|
+
return /* @__PURE__ */ f($, { onClickAway: () => g(!1), children: /* @__PURE__ */ N("div", { ref: k, style: { position: "relative" }, children: [
|
|
237
|
+
/* @__PURE__ */ f(
|
|
238
|
+
P,
|
|
239
|
+
{
|
|
240
|
+
ref: l,
|
|
241
|
+
...o,
|
|
242
|
+
fullWidth: !0,
|
|
243
|
+
autoComplete: "off",
|
|
244
|
+
value: t,
|
|
245
|
+
variant: e,
|
|
246
|
+
onChange: a,
|
|
247
|
+
onKeyDown: q,
|
|
248
|
+
InputProps: {
|
|
249
|
+
...o.InputProps,
|
|
250
|
+
onSelectCapture: U,
|
|
251
|
+
startAdornment: h && /* @__PURE__ */ f(D, { position: "start", children: h }),
|
|
252
|
+
endAdornment: c && /* @__PURE__ */ f(D, { position: "end", children: c })
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
),
|
|
256
|
+
/* @__PURE__ */ f(
|
|
257
|
+
ee,
|
|
258
|
+
{
|
|
259
|
+
anchorEl: k.current,
|
|
260
|
+
style: { width: "100%", zIndex: 100 },
|
|
261
|
+
open: w && b.length > 0,
|
|
262
|
+
disablePortal: !0,
|
|
263
|
+
children: /* @__PURE__ */ f(
|
|
264
|
+
te,
|
|
265
|
+
{
|
|
266
|
+
elevation: 2,
|
|
267
|
+
sx: { maxHeight: 200, overflow: "auto", borderTopRightRadius: 0, borderTopLeftRadius: 0 },
|
|
268
|
+
children: /* @__PURE__ */ f(
|
|
269
|
+
ne,
|
|
270
|
+
{
|
|
271
|
+
ref: m,
|
|
272
|
+
onKeyDown: F,
|
|
273
|
+
sx: {
|
|
274
|
+
"&:focus": {
|
|
275
|
+
outline: "none"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
children: b == null ? void 0 : b.map((i) => /* @__PURE__ */ f(se, { onClick: () => v(i), children: /* @__PURE__ */ f(re, { children: i }) }, i))
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
)
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
] }) });
|
|
286
|
+
}
|
|
287
|
+
const Be = ({ data: t, collapse: e = !0, hideSearch: n = !1, forceCompact: r = !1, slotProps: s }) => {
|
|
288
|
+
var S, C, E;
|
|
289
|
+
const h = ie(), [c] = j(J.COMPACT_JSON), [y] = j(J.FLATTEN_JSON), d = K(L, (a) => a == null ? void 0 : a.ReactJson), { t: o } = K(L, (a) => a == null ? void 0 : a.i18next), [k, l] = O(null), [m, W] = O(""), A = T(() => h.palette.mode === "dark", [h]), R = T(() => ce(t, c || r), [c, t, r]), w = T(() => {
|
|
290
|
+
const a = he(R, m);
|
|
291
|
+
return y ? fe(a) : a;
|
|
292
|
+
}, [R, y, m]), g = T(() => {
|
|
293
|
+
try {
|
|
294
|
+
return new RegExp(m), !1;
|
|
295
|
+
} catch {
|
|
296
|
+
return !0;
|
|
297
|
+
}
|
|
298
|
+
}, [m]);
|
|
299
|
+
z(() => {
|
|
300
|
+
l(d ? () => d : oe(() => import("@microlink/react-json-view")));
|
|
301
|
+
}, [d]);
|
|
302
|
+
const b = (a) => a.name !== "root" && a.type !== "object" || a.namespace.length > 3;
|
|
303
|
+
return t ? /* @__PURE__ */ N(
|
|
304
|
+
ae,
|
|
305
|
+
{
|
|
306
|
+
direction: "column",
|
|
307
|
+
spacing: 1,
|
|
308
|
+
...s == null ? void 0 : s.stack,
|
|
309
|
+
sx: {
|
|
310
|
+
"& > div:first-of-type": { mt: 1, mr: 0.5 },
|
|
311
|
+
...Array.isArray((S = s == null ? void 0 : s.stack) == null ? void 0 : S.sx) ? (C = s == null ? void 0 : s.stack) == null ? void 0 : C.sx : [(E = s == null ? void 0 : s.stack) == null ? void 0 : E.sx]
|
|
312
|
+
},
|
|
313
|
+
children: [
|
|
314
|
+
!n && /* @__PURE__ */ f(
|
|
315
|
+
ve,
|
|
316
|
+
{
|
|
317
|
+
value: m,
|
|
318
|
+
onChange: W,
|
|
319
|
+
size: "small",
|
|
320
|
+
error: g,
|
|
321
|
+
label: o("json.viewer.search.label"),
|
|
322
|
+
placeholder: o("json.viewer.search.prompt")
|
|
323
|
+
}
|
|
324
|
+
),
|
|
325
|
+
k && /* @__PURE__ */ f(
|
|
326
|
+
k,
|
|
327
|
+
{
|
|
328
|
+
src: w,
|
|
329
|
+
theme: A ? "summerfruit" : "summerfruit:inverted",
|
|
330
|
+
indentWidth: 2,
|
|
331
|
+
displayDataTypes: !c && !r,
|
|
332
|
+
displayObjectSize: !c && !r,
|
|
333
|
+
shouldCollapse: e ? b : !1,
|
|
334
|
+
quotesOnKeys: !1,
|
|
335
|
+
style: {
|
|
336
|
+
flex: 1,
|
|
337
|
+
overflow: "auto",
|
|
338
|
+
height: "100%",
|
|
339
|
+
fontSize: c || r ? "small" : "smaller",
|
|
340
|
+
borderRadius: h.shape.borderRadius,
|
|
341
|
+
padding: h.spacing(1)
|
|
342
|
+
},
|
|
343
|
+
enableClipboard: (a) => {
|
|
344
|
+
typeof a.src == "string" ? navigator.clipboard.writeText(a.src) : navigator.clipboard.writeText(JSON.stringify(a.src));
|
|
345
|
+
},
|
|
346
|
+
// Type declaration is wrong - this is a valid prop
|
|
347
|
+
displayArrayKey: !c && !r,
|
|
348
|
+
...s == null ? void 0 : s.json
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
) : /* @__PURE__ */ f(ue, { width: "100%", height: "95%", variant: "rounded" });
|
|
354
|
+
};
|
|
355
|
+
export {
|
|
356
|
+
Be as J,
|
|
357
|
+
V as p
|
|
358
|
+
};
|