@m4l/components 9.24.1-beta-feature-731-code-editor.1 → 9.24.1-beta-feature-731-code-editor.2
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/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +302 -327
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +75 -102
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts +2 -2
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/constants.js +11 -11
- package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +1 -0
- package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/dictionary.js +4 -3
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +1 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +1 -1
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +6 -4
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +35 -32
- package/components/extended/ReactSimpleCodeEditor/types.d.ts +9 -8
- package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,405 +1,380 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useHostTools as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
function
|
|
15
|
-
return
|
|
1
|
+
import { jsx as r, jsxs as A } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useHostTools as it, useModuleDictionary as lt, useModuleSkeleton as st, EmitEvents as be } from "@m4l/core";
|
|
3
|
+
import B from "clsx";
|
|
4
|
+
import { SettingsLimitOutlined as dt } from "@m4l/icons";
|
|
5
|
+
import { useId as ut, useState as D, useRef as z, useMemo as I, useEffect as s, useCallback as v } from "react";
|
|
6
|
+
import { useTheme as ct } from "@mui/material/styles";
|
|
7
|
+
import { getPropDataTestId as N, getNameDataTestId as De } from "../../../test/getNameDataTestId.js";
|
|
8
|
+
import { CODE_EDITOR_DEFAULT_MAX_LINES as gt, CODE_EDITOR_DEFAULT_MIN_LINES as mt, CODE_EDITOR_DEFAULT_LANGUAGE as ht, CODE_EDITOR_LINE_HEIGHT_BY_SIZE as Et, CODE_EDITOR_CLASSES as R, CODE_EDITOR_KEY_COMPONENT as m, CODE_EDITOR_TOGGLE_LINE_NUMBERS_LABEL as ft, CODE_EDITOR_READ_ONLY_LABEL as pt, CODE_EDITOR_PADDING_PX as Ie, CODE_EDITOR_LANGUAGE_CHIP_ICON_INSTANCE_ID as Lt } from "./constants.js";
|
|
9
|
+
import { CODE_EDITOR_DICTIONARY as w } from "./dictionary.js";
|
|
10
|
+
import { resolveCodeEditorLanguageIcon as Ct } from "./helpers/languageIcon.js";
|
|
11
|
+
import { getCodeEditorLineCount as Tt, ensureCodeEditorRuntimeDependencies as yt, createCodeEditorPrismTheme as _t, resolveCodeEditorLanguageTemplate as St, validateCodeEditorSyntax as bt, highlightCode as Dt } from "./helpers/highlighting.js";
|
|
12
|
+
import { SkeletonStyled as It, RootStyled as vt, HeaderStyled as Nt, LanguageChipStyled as Rt, LanguageChipIconStyled as Ot, LineNumbersToggleStyled as xt, HeaderBadgesStyled as Ht, ReadOnlyChipStyled as Mt, BodyResizeShellStyled as At, BodyStyled as Bt, LineNumbersStyled as zt, LineNumberStyled as wt, EditorScrollerStyled as Vt, PlaceholderStyled as Pt, EditorStyled as kt } from "./slots/CodeEditorSlots.js";
|
|
13
|
+
import { CodeEditorSlots as h } from "./slots/CodeEditorEnum.js";
|
|
14
|
+
function te(o) {
|
|
15
|
+
return o === "dark" ? "dark" : "light";
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
function Gt(o, i) {
|
|
18
|
+
return o.length !== i.length ? !1 : o.every((l, a) => l === i[a]);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
return
|
|
20
|
+
function ve(o, i, l) {
|
|
21
|
+
const a = l ? Ie : Ie * 2;
|
|
22
|
+
return o * i + a;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
24
|
+
function Ut(o, i, l) {
|
|
25
|
+
return ve(o, i, l);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return t + n;
|
|
29
|
-
}
|
|
30
|
-
function ve(t, n) {
|
|
31
|
-
return t + (n ? W : 0);
|
|
32
|
-
}
|
|
33
|
-
function Wt(t, n, i) {
|
|
34
|
-
return Math.max(
|
|
35
|
-
Math.round(t - n - W),
|
|
36
|
-
i
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
function mn(t) {
|
|
27
|
+
function nn(o) {
|
|
40
28
|
const {
|
|
41
|
-
className:
|
|
42
|
-
customLanguages:
|
|
43
|
-
dataTestId:
|
|
44
|
-
defaultValue:
|
|
45
|
-
disabled:
|
|
46
|
-
editorClassName:
|
|
47
|
-
error:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
29
|
+
className: i,
|
|
30
|
+
customLanguages: l,
|
|
31
|
+
dataTestId: a,
|
|
32
|
+
defaultValue: Ne,
|
|
33
|
+
disabled: d = !1,
|
|
34
|
+
editorClassName: Re,
|
|
35
|
+
error: Oe = !1,
|
|
36
|
+
forceHeader: xe = !1,
|
|
37
|
+
highlightTheme: ne,
|
|
38
|
+
id: He,
|
|
39
|
+
insertSpaces: Me,
|
|
40
|
+
languageIcon: Ae,
|
|
41
|
+
languageLabel: Be,
|
|
42
|
+
languageTemplate: u,
|
|
43
|
+
languageText: ze,
|
|
44
|
+
maxLines: we = gt,
|
|
45
|
+
minLines: O = mt,
|
|
57
46
|
onBlur: Ve,
|
|
58
|
-
onChange:
|
|
59
|
-
placeholder:
|
|
47
|
+
onChange: V,
|
|
48
|
+
placeholder: P,
|
|
60
49
|
preClassName: Pe,
|
|
61
|
-
readOnly:
|
|
50
|
+
readOnly: C = !1,
|
|
62
51
|
readOnlyLabel: ke,
|
|
63
|
-
resizable:
|
|
64
|
-
runtimeDependencies:
|
|
65
|
-
showLineNumbers:
|
|
66
|
-
showPlaceholder:
|
|
67
|
-
size:
|
|
68
|
-
syntaxValidator:
|
|
52
|
+
resizable: E = !0,
|
|
53
|
+
runtimeDependencies: T,
|
|
54
|
+
showLineNumbers: k = !1,
|
|
55
|
+
showPlaceholder: re = !0,
|
|
56
|
+
size: oe = "medium",
|
|
57
|
+
syntaxValidator: G,
|
|
69
58
|
skeleton: Ge = !1,
|
|
70
|
-
textareaClassName:
|
|
71
|
-
validateSyntax:
|
|
72
|
-
value:
|
|
73
|
-
variant:
|
|
59
|
+
textareaClassName: Ue,
|
|
60
|
+
validateSyntax: ae = !1,
|
|
61
|
+
value: y,
|
|
62
|
+
variant: Ye = "outlined",
|
|
74
63
|
...x
|
|
75
|
-
} =
|
|
76
|
-
() =>
|
|
77
|
-
), [
|
|
78
|
-
|
|
79
|
-
), [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
) || (
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
),
|
|
96
|
-
()
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
bottom: {
|
|
103
|
-
...e.bottom,
|
|
104
|
-
bottom: "0px",
|
|
105
|
-
height: `${W}px`,
|
|
106
|
-
left: "0px",
|
|
107
|
-
right: "0px"
|
|
108
|
-
}
|
|
64
|
+
} = o, Fe = ut(), $e = He || Fe, U = ct(), { events_add_listener: ie, events_remove_listener: le } = it(), { getLabel: se } = lt(), je = st() || Ge, _ = V === void 0, [Y, qe] = D(0), F = z([]), de = z(null), $ = z(!1), j = z(null), [q, ue] = D(
|
|
65
|
+
() => te(U.palette.mode)
|
|
66
|
+
), [Xe, ce] = D(
|
|
67
|
+
y ?? Ne ?? ""
|
|
68
|
+
), [H, ge] = D(k), [f, X] = D(null), me = I(() => T ? Array.isArray(T) ? T : [T] : [], [T]);
|
|
69
|
+
Gt(
|
|
70
|
+
F.current,
|
|
71
|
+
me
|
|
72
|
+
) || (F.current = me);
|
|
73
|
+
const K = F.current, c = _ ? Xe : y ?? "", Ke = re && c.length === 0 && !!P, Z = Et[oe], he = Tt(c), Ee = Math.max(he, O), J = Math.max(O, we), fe = Math.min(Ee, J), Q = he >= J, pe = ve(
|
|
74
|
+
fe,
|
|
75
|
+
Z,
|
|
76
|
+
Q
|
|
77
|
+
), g = Ut(
|
|
78
|
+
O,
|
|
79
|
+
Z,
|
|
80
|
+
Q
|
|
81
|
+
), Ze = E ? Math.max(f ?? pe, g) : pe;
|
|
82
|
+
s(() => {
|
|
83
|
+
_ && y !== void 0 && ce(y);
|
|
84
|
+
}, [_, y]), s(() => {
|
|
85
|
+
ge(k);
|
|
86
|
+
}, [k]), s(() => {
|
|
87
|
+
ue(te(U.palette.mode));
|
|
88
|
+
}, [U.palette.mode]), s(() => {
|
|
89
|
+
const e = (n) => {
|
|
90
|
+
ue(te(n));
|
|
109
91
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
position: "relative"
|
|
113
|
-
}), []);
|
|
114
|
-
y(() => {
|
|
115
|
-
D && T !== void 0 && se(T);
|
|
116
|
-
}, [D, T]), y(() => {
|
|
117
|
-
le(Q(G.palette.mode));
|
|
118
|
-
}, [G.palette.mode]), y(() => {
|
|
119
|
-
const e = (a) => {
|
|
120
|
-
le(Q(a));
|
|
121
|
-
};
|
|
122
|
-
return ae(
|
|
123
|
-
Re.EMMIT_EVENT_HOST_THEME_CHANGE,
|
|
92
|
+
return ie(
|
|
93
|
+
be.EMMIT_EVENT_HOST_THEME_CHANGE,
|
|
124
94
|
e
|
|
125
95
|
), () => {
|
|
126
|
-
|
|
127
|
-
|
|
96
|
+
le(
|
|
97
|
+
be.EMMIT_EVENT_HOST_THEME_CHANGE,
|
|
128
98
|
e
|
|
129
99
|
);
|
|
130
100
|
};
|
|
131
|
-
}, [
|
|
132
|
-
if (!
|
|
101
|
+
}, [ie, le]), s(() => {
|
|
102
|
+
if (!K.length)
|
|
133
103
|
return;
|
|
134
104
|
let e = !0;
|
|
135
|
-
return
|
|
105
|
+
return yt(K).catch(() => {
|
|
136
106
|
}).then(() => {
|
|
137
|
-
e &&
|
|
107
|
+
e && qe((n) => n + 1);
|
|
138
108
|
}), () => {
|
|
139
109
|
e = !1;
|
|
140
110
|
};
|
|
141
|
-
}, [
|
|
142
|
-
!
|
|
143
|
-
}, [
|
|
144
|
-
|
|
145
|
-
}, [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
), v = d(() => {
|
|
176
|
-
if (k)
|
|
177
|
-
return k({
|
|
178
|
-
code: u,
|
|
179
|
-
languageTemplate: E ?? c,
|
|
180
|
-
languageText: H
|
|
111
|
+
}, [K]), s(() => {
|
|
112
|
+
!E && f !== null && X(null);
|
|
113
|
+
}, [f, E]), s(() => {
|
|
114
|
+
f !== null && f < g && X(g);
|
|
115
|
+
}, [f, g]), s(() => {
|
|
116
|
+
const e = () => {
|
|
117
|
+
if (!$.current)
|
|
118
|
+
return;
|
|
119
|
+
$.current = !1;
|
|
120
|
+
const n = j.current;
|
|
121
|
+
j.current = null;
|
|
122
|
+
const M = de.current?.offsetHeight;
|
|
123
|
+
n === null || M === void 0 || M === n || X(
|
|
124
|
+
Math.max(Math.round(M), g)
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
return window.addEventListener("pointerup", e), window.addEventListener("pointercancel", e), () => {
|
|
128
|
+
window.removeEventListener("pointerup", e), window.removeEventListener("pointercancel", e);
|
|
129
|
+
};
|
|
130
|
+
}, [g]);
|
|
131
|
+
const Le = I(
|
|
132
|
+
() => ne ?? _t(q),
|
|
133
|
+
[q, ne]
|
|
134
|
+
), p = I(
|
|
135
|
+
() => St(u),
|
|
136
|
+
[u, Y]
|
|
137
|
+
), S = ze ?? p?.languageText ?? ht, Ce = Be ?? p?.languageLabel, Te = !!Ce, Je = Ct(
|
|
138
|
+
Ae ?? p?.languageIcon
|
|
139
|
+
), W = C ? se(w.readOnly) : void 0, Qe = ke ?? (W && W !== w.readOnly ? W : pt), ye = xe || Te || C, ee = ye ? se(w.toggleLineNumbers) : void 0, _e = ee && ee !== w.toggleLineNumbers ? ee : ft, b = I(() => {
|
|
140
|
+
if (G)
|
|
141
|
+
return G({
|
|
142
|
+
code: c,
|
|
143
|
+
languageTemplate: p ?? u,
|
|
144
|
+
languageText: S
|
|
181
145
|
});
|
|
182
|
-
if (
|
|
183
|
-
return
|
|
184
|
-
code:
|
|
185
|
-
languageTemplate:
|
|
186
|
-
languageText:
|
|
146
|
+
if (ae)
|
|
147
|
+
return bt({
|
|
148
|
+
code: c,
|
|
149
|
+
languageTemplate: p ?? u,
|
|
150
|
+
languageText: S
|
|
187
151
|
});
|
|
188
152
|
}, [
|
|
189
|
-
c,
|
|
190
|
-
E,
|
|
191
|
-
H,
|
|
192
153
|
u,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
154
|
+
p,
|
|
155
|
+
S,
|
|
156
|
+
c,
|
|
157
|
+
Y,
|
|
158
|
+
G,
|
|
159
|
+
ae
|
|
160
|
+
]), Se = Oe || !!b && !b.isValid, L = b && !b.isValid ? b.errorRange : void 0, We = I(() => {
|
|
161
|
+
if (!L)
|
|
198
162
|
return /* @__PURE__ */ new Set();
|
|
199
|
-
const e =
|
|
163
|
+
const e = L.start.line, n = L.end?.line ?? e;
|
|
200
164
|
return new Set(
|
|
201
165
|
Array.from(
|
|
202
|
-
{ length: Math.max(
|
|
203
|
-
(
|
|
166
|
+
{ length: Math.max(n - e + 1, 1) },
|
|
167
|
+
(M, at) => e + at
|
|
204
168
|
)
|
|
205
169
|
);
|
|
206
|
-
}, [
|
|
207
|
-
colorMode:
|
|
208
|
-
disabled:
|
|
209
|
-
error:
|
|
210
|
-
isLineCapped:
|
|
211
|
-
isEmpty:
|
|
212
|
-
isPlaceholderVisible:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
(e) => Nt({
|
|
170
|
+
}, [L]), t = {
|
|
171
|
+
colorMode: q,
|
|
172
|
+
disabled: d,
|
|
173
|
+
error: Se,
|
|
174
|
+
isLineCapped: Q,
|
|
175
|
+
isEmpty: c.length === 0,
|
|
176
|
+
isPlaceholderVisible: Ke,
|
|
177
|
+
lineHeight: Z,
|
|
178
|
+
maxLines: J,
|
|
179
|
+
minLines: O,
|
|
180
|
+
readOnly: C,
|
|
181
|
+
resizable: E,
|
|
182
|
+
showLineNumbers: H,
|
|
183
|
+
size: oe,
|
|
184
|
+
variant: Ye,
|
|
185
|
+
visibleLineCount: fe
|
|
186
|
+
}, et = v(
|
|
187
|
+
(e) => Dt({
|
|
225
188
|
code: e,
|
|
226
|
-
customLanguages:
|
|
227
|
-
languageTemplate:
|
|
228
|
-
languageText:
|
|
229
|
-
prismTheme:
|
|
230
|
-
syntaxErrorRange:
|
|
189
|
+
customLanguages: l,
|
|
190
|
+
languageTemplate: u,
|
|
191
|
+
languageText: S,
|
|
192
|
+
prismTheme: Le,
|
|
193
|
+
syntaxErrorRange: L
|
|
231
194
|
}),
|
|
232
195
|
[
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
196
|
+
l,
|
|
197
|
+
u,
|
|
198
|
+
Le,
|
|
199
|
+
S,
|
|
200
|
+
Y,
|
|
201
|
+
L
|
|
239
202
|
]
|
|
240
|
-
),
|
|
203
|
+
), tt = v(
|
|
241
204
|
(e) => {
|
|
242
|
-
|
|
205
|
+
_ && ce(e), V?.(e);
|
|
243
206
|
},
|
|
244
|
-
[
|
|
245
|
-
),
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
O(!1), ce(
|
|
252
|
-
Wt(
|
|
253
|
-
Se.offsetHeight,
|
|
254
|
-
h ? z : 0,
|
|
255
|
-
N
|
|
256
|
-
)
|
|
257
|
-
);
|
|
207
|
+
[V, _]
|
|
208
|
+
), nt = v(
|
|
209
|
+
(e) => {
|
|
210
|
+
if (!E || d)
|
|
211
|
+
return;
|
|
212
|
+
const { bottom: n } = e.currentTarget.getBoundingClientRect();
|
|
213
|
+
n - e.clientY > 16 || ($.current = !0, j.current = e.currentTarget.offsetHeight);
|
|
258
214
|
},
|
|
259
|
-
[
|
|
260
|
-
),
|
|
215
|
+
[d, E]
|
|
216
|
+
), rt = v(
|
|
261
217
|
(e) => {
|
|
262
|
-
if (
|
|
218
|
+
if (d || e.target instanceof Element && e.target.closest("textarea"))
|
|
263
219
|
return;
|
|
264
220
|
e.currentTarget.querySelector("textarea")?.focus();
|
|
265
221
|
},
|
|
266
|
-
[
|
|
267
|
-
)
|
|
268
|
-
|
|
269
|
-
|
|
222
|
+
[d]
|
|
223
|
+
), ot = v(() => {
|
|
224
|
+
ge((e) => !e);
|
|
225
|
+
}, []);
|
|
226
|
+
return je ? /* @__PURE__ */ r(It, { ownerState: t }) : /* @__PURE__ */ A(
|
|
227
|
+
vt,
|
|
270
228
|
{
|
|
271
|
-
ownerState:
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
onResizeStop: ut,
|
|
279
|
-
resizeHandleClasses: Qe,
|
|
280
|
-
resizeHandleStyles: We,
|
|
281
|
-
size: { width: "100%", height: at },
|
|
282
|
-
style: et,
|
|
283
|
-
...I(
|
|
284
|
-
S,
|
|
285
|
-
R.bodyResizeShell,
|
|
286
|
-
s
|
|
229
|
+
ownerState: t,
|
|
230
|
+
"aria-disabled": t.disabled || void 0,
|
|
231
|
+
className: B(R.root, i),
|
|
232
|
+
...N(
|
|
233
|
+
m,
|
|
234
|
+
h.root,
|
|
235
|
+
a
|
|
287
236
|
),
|
|
288
|
-
children:
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
Pt,
|
|
305
|
-
{
|
|
306
|
-
label: K,
|
|
307
|
-
size: "small",
|
|
308
|
-
variant: "outlined",
|
|
309
|
-
color: "default",
|
|
310
|
-
startIcon: /* @__PURE__ */ r(
|
|
311
|
-
kt,
|
|
312
|
-
{
|
|
313
|
-
...I(
|
|
314
|
-
S,
|
|
315
|
-
R.languageChipIcon,
|
|
316
|
-
vt
|
|
317
|
-
),
|
|
318
|
-
children: /* @__PURE__ */ r(tt, { fontSize: "small" })
|
|
319
|
-
}
|
|
320
|
-
)
|
|
321
|
-
}
|
|
322
|
-
) : null,
|
|
323
|
-
/* @__PURE__ */ r(Gt, { ownerState: o, children: m ? /* @__PURE__ */ r(
|
|
324
|
-
wt,
|
|
237
|
+
children: [
|
|
238
|
+
ye ? /* @__PURE__ */ A(
|
|
239
|
+
Nt,
|
|
240
|
+
{
|
|
241
|
+
ownerState: t,
|
|
242
|
+
className: R.header,
|
|
243
|
+
children: [
|
|
244
|
+
Te ? /* @__PURE__ */ r(
|
|
245
|
+
Rt,
|
|
246
|
+
{
|
|
247
|
+
label: Ce,
|
|
248
|
+
size: "small",
|
|
249
|
+
variant: "outlined",
|
|
250
|
+
color: "default",
|
|
251
|
+
startIcon: /* @__PURE__ */ r(
|
|
252
|
+
Ot,
|
|
325
253
|
{
|
|
326
|
-
|
|
327
|
-
|
|
254
|
+
...N(
|
|
255
|
+
m,
|
|
256
|
+
h.languageChipIcon,
|
|
257
|
+
Lt
|
|
258
|
+
),
|
|
259
|
+
children: /* @__PURE__ */ r(Je, { fontSize: "small" })
|
|
328
260
|
}
|
|
329
|
-
)
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
) : null,
|
|
264
|
+
/* @__PURE__ */ r(
|
|
265
|
+
xt,
|
|
266
|
+
{
|
|
267
|
+
"aria-label": _e,
|
|
268
|
+
"aria-pressed": H,
|
|
269
|
+
dataTestId: De(
|
|
270
|
+
m,
|
|
271
|
+
h.lineNumbersToggle,
|
|
272
|
+
a
|
|
273
|
+
),
|
|
274
|
+
disabled: d,
|
|
275
|
+
icon: /* @__PURE__ */ r(dt, {}),
|
|
276
|
+
onClick: ot,
|
|
277
|
+
selected: H,
|
|
278
|
+
size: "small",
|
|
279
|
+
tooltip: _e,
|
|
280
|
+
variant: "text"
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
/* @__PURE__ */ r(Ht, { ownerState: t, children: C ? /* @__PURE__ */ r(
|
|
284
|
+
Mt,
|
|
285
|
+
{
|
|
286
|
+
label: Qe,
|
|
287
|
+
size: "small"
|
|
288
|
+
}
|
|
289
|
+
) : null })
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
) : null,
|
|
293
|
+
/* @__PURE__ */ r(
|
|
294
|
+
At,
|
|
295
|
+
{
|
|
296
|
+
ref: de,
|
|
297
|
+
ownerState: t,
|
|
298
|
+
onPointerDown: nt,
|
|
299
|
+
style: {
|
|
300
|
+
height: `${Ze}px`,
|
|
301
|
+
minHeight: `${g}px`
|
|
302
|
+
},
|
|
303
|
+
...N(
|
|
304
|
+
m,
|
|
305
|
+
h.bodyResizeShell,
|
|
306
|
+
a
|
|
307
|
+
),
|
|
308
|
+
children: /* @__PURE__ */ A(
|
|
309
|
+
Bt,
|
|
335
310
|
{
|
|
336
|
-
ownerState:
|
|
337
|
-
onClick:
|
|
338
|
-
...
|
|
311
|
+
ownerState: t,
|
|
312
|
+
onClick: rt,
|
|
313
|
+
...N(m, h.body, a),
|
|
339
314
|
children: [
|
|
340
|
-
|
|
315
|
+
H ? /* @__PURE__ */ r(zt, { ownerState: t, "aria-hidden": "true", children: Array.from({ length: Ee }, (e, n) => n + 1).map(
|
|
341
316
|
(e) => /* @__PURE__ */ r(
|
|
342
|
-
|
|
317
|
+
wt,
|
|
343
318
|
{
|
|
344
|
-
ownerState:
|
|
345
|
-
"data-code-editor-error-line":
|
|
319
|
+
ownerState: t,
|
|
320
|
+
"data-code-editor-error-line": We.has(e) || void 0,
|
|
346
321
|
children: e
|
|
347
322
|
},
|
|
348
323
|
`code-editor-line-${e}`
|
|
349
324
|
)
|
|
350
325
|
) }) : null,
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
|
|
353
|
-
|
|
326
|
+
/* @__PURE__ */ A(Vt, { ownerState: t, children: [
|
|
327
|
+
re && t.isEmpty && P ? /* @__PURE__ */ r(
|
|
328
|
+
Pt,
|
|
354
329
|
{
|
|
355
|
-
ownerState:
|
|
356
|
-
...
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
330
|
+
ownerState: t,
|
|
331
|
+
...N(
|
|
332
|
+
m,
|
|
333
|
+
h.placeholder,
|
|
334
|
+
a
|
|
360
335
|
),
|
|
361
|
-
children:
|
|
336
|
+
children: P
|
|
362
337
|
}
|
|
363
338
|
) : null,
|
|
364
339
|
/* @__PURE__ */ r(
|
|
365
|
-
|
|
340
|
+
kt,
|
|
366
341
|
{
|
|
367
342
|
...x,
|
|
368
|
-
ownerState:
|
|
343
|
+
ownerState: t,
|
|
369
344
|
"aria-label": x["aria-label"] ?? "Code editor",
|
|
370
|
-
"aria-invalid": x["aria-invalid"] ?? (
|
|
371
|
-
className:
|
|
372
|
-
"data-testid":
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
345
|
+
"aria-invalid": x["aria-invalid"] ?? (Se || void 0),
|
|
346
|
+
className: B(R.editor, Re),
|
|
347
|
+
"data-testid": De(
|
|
348
|
+
m,
|
|
349
|
+
h.textarea,
|
|
350
|
+
a
|
|
376
351
|
),
|
|
377
|
-
disabled:
|
|
378
|
-
highlight:
|
|
379
|
-
insertSpaces:
|
|
352
|
+
disabled: d,
|
|
353
|
+
highlight: et,
|
|
354
|
+
insertSpaces: Me,
|
|
380
355
|
onBlur: Ve,
|
|
381
|
-
onValueChange:
|
|
382
|
-
preClassName:
|
|
383
|
-
readOnly:
|
|
356
|
+
onValueChange: tt,
|
|
357
|
+
preClassName: B(R.pre, Pe),
|
|
358
|
+
readOnly: C,
|
|
384
359
|
tabSize: x.tabSize,
|
|
385
|
-
textareaClassName:
|
|
386
|
-
|
|
387
|
-
|
|
360
|
+
textareaClassName: B(
|
|
361
|
+
R.textarea,
|
|
362
|
+
Ue
|
|
388
363
|
),
|
|
389
|
-
textareaId:
|
|
390
|
-
value:
|
|
364
|
+
textareaId: $e,
|
|
365
|
+
value: c
|
|
391
366
|
}
|
|
392
367
|
)
|
|
393
368
|
] })
|
|
394
369
|
]
|
|
395
370
|
}
|
|
396
371
|
)
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
372
|
+
}
|
|
373
|
+
)
|
|
374
|
+
]
|
|
400
375
|
}
|
|
401
376
|
);
|
|
402
377
|
}
|
|
403
378
|
export {
|
|
404
|
-
|
|
379
|
+
nn as CodeEditor
|
|
405
380
|
};
|