@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.
@@ -1,405 +1,380 @@
1
- import { jsx as r, jsxs as M } from "@emotion/react/jsx-runtime";
2
- import { useHostTools as mt, useModuleDictionary as Et, useModuleSkeleton as ft, EmitEvents as Re } from "@m4l/core";
3
- import A from "clsx";
4
- import { useId as Ct, useState as C, useRef as _e, useMemo as d, useEffect as y, useLayoutEffect as yt, useCallback as p } from "react";
5
- import { useTheme as pt } from "@mui/material/styles";
6
- import { getPropDataTestId as I, getNameDataTestId as St } from "../../../test/getNameDataTestId.js";
7
- import { CODE_EDITOR_DEFAULT_MAX_LINES as Rt, CODE_EDITOR_DEFAULT_MIN_LINES as _t, CODE_EDITOR_RESIZE_HANDLE_SIZE_PX as W, CODE_EDITOR_DEFAULT_LANGUAGE as Tt, CODE_EDITOR_READ_ONLY_LABEL as Dt, CODE_EDITOR_LINE_HEIGHT_BY_SIZE as Ht, CODE_EDITOR_CLASSES as L, CODE_EDITOR_KEY_COMPONENT as S, CODE_EDITOR_PADDING_PX as Te, CODE_EDITOR_LANGUAGE_CHIP_ICON_INSTANCE_ID as vt } from "./constants.js";
8
- import { CODE_EDITOR_DICTIONARY as De } from "./dictionary.js";
9
- import { resolveCodeEditorLanguageIcon as It } from "./helpers/languageIcon.js";
10
- import { getCodeEditorLineCount as Lt, ensureCodeEditorRuntimeDependencies as bt, createCodeEditorPrismTheme as xt, resolveCodeEditorLanguageTemplate as zt, validateCodeEditorSyntax as Ot, highlightCode as Nt } from "./helpers/highlighting.js";
11
- import { SkeletonStyled as Mt, BodyResizeShellStyled as At, RootStyled as Bt, HeaderStyled as Vt, LanguageChipStyled as Pt, LanguageChipIconStyled as kt, HeaderBadgesStyled as Gt, ReadOnlyChipStyled as wt, BodyStyled as Ut, LineNumbersStyled as Ft, LineNumberStyled as Yt, EditorScrollerStyled as Xt, PlaceholderStyled as Zt, EditorStyled as jt } from "./slots/CodeEditorSlots.js";
12
- import { CodeEditorSlots as R } from "./slots/CodeEditorEnum.js";
13
- import { buildEnableResizing as qt, buildDefaultResizeHandleClasses as $t, buildDefaultResizeHandleStyles as Kt } from "../../DragResizeWindowRND/helpers/resizeHandles.js";
14
- function Q(t) {
15
- return t === "dark" ? "dark" : "light";
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 Jt(t, n) {
18
- return t.length !== n.length ? !1 : t.every((i, s) => i === n[s]);
17
+ function Gt(o, i) {
18
+ return o.length !== i.length ? !1 : o.every((l, a) => l === i[a]);
19
19
  }
20
- function Ie(t, n, i) {
21
- const s = i ? Te : Te * 2;
22
- return t * n + s;
20
+ function ve(o, i, l) {
21
+ const a = l ? Ie : Ie * 2;
22
+ return o * i + a;
23
23
  }
24
- function Qt(t, n, i) {
25
- return Ie(t, n, i);
24
+ function Ut(o, i, l) {
25
+ return ve(o, i, l);
26
26
  }
27
- function He(t, n) {
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: n,
42
- customLanguages: i,
43
- dataTestId: s,
44
- defaultValue: Le,
45
- disabled: g = !1,
46
- editorClassName: be,
47
- error: xe = !1,
48
- highlightTheme: ee,
49
- id: ze,
50
- insertSpaces: Oe,
51
- languageIcon: Ne,
52
- languageLabel: Me,
53
- languageTemplate: c,
54
- languageText: Ae,
55
- maxLines: Be = Rt,
56
- minLines: b = _t,
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: B,
59
- placeholder: V,
47
+ onChange: V,
48
+ placeholder: P,
60
49
  preClassName: Pe,
61
- readOnly: m = !1,
50
+ readOnly: C = !1,
62
51
  readOnlyLabel: ke,
63
- resizable: l = !0,
64
- runtimeDependencies: _,
65
- showLineNumbers: te = !1,
66
- showPlaceholder: ne = !0,
67
- size: P = "medium",
68
- syntaxValidator: k,
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: we,
71
- validateSyntax: oe = !1,
72
- value: T,
73
- variant: Ue = "outlined",
59
+ textareaClassName: Ue,
60
+ validateSyntax: ae = !1,
61
+ value: y,
62
+ variant: Ye = "outlined",
74
63
  ...x
75
- } = t, Fe = Ct(), Ye = ze || Fe, G = pt(), { events_add_listener: ae, events_remove_listener: re } = mt(), { getLabel: Xe } = Et(), Ze = ft() || Ge, D = B === void 0, [w, je] = C(0), U = _e([]), ie = _e(null), [F, le] = C(
76
- () => Q(G.palette.mode)
77
- ), [qe, se] = C(
78
- T ?? Le ?? ""
79
- ), [z, de] = C(0), [Y, O] = C(!1), [X, ce] = C(null), ue = d(() => _ ? Array.isArray(_) ? _ : [_] : [], [_]);
80
- Jt(
81
- U.current,
82
- ue
83
- ) || (U.current = ue);
84
- const Z = U.current, u = D ? qe : T ?? "", $e = ne && u.length === 0 && !!V, j = Ht[P], he = Lt(u), ge = Math.max(he, b), q = Math.max(b, Be), me = Math.min(ge, q), $ = he >= q, Ee = Ie(
85
- me,
86
- j,
87
- $
88
- ), N = Qt(
89
- b,
90
- j,
91
- $
92
- ), Ke = l ? Math.max(X ?? Ee, N) : Ee, Je = d(
93
- () => qt(l, ["s"]),
94
- [l]
95
- ), Qe = d(
96
- () => $t(),
97
- []
98
- ), We = d(() => {
99
- const e = Kt();
100
- return {
101
- ...e,
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
- }, []), et = d(() => ({
111
- display: "block",
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
- re(
127
- Re.EMMIT_EVENT_HOST_THEME_CHANGE,
96
+ le(
97
+ be.EMMIT_EVENT_HOST_THEME_CHANGE,
128
98
  e
129
99
  );
130
100
  };
131
- }, [ae, re]), y(() => {
132
- if (!Z.length)
101
+ }, [ie, le]), s(() => {
102
+ if (!K.length)
133
103
  return;
134
104
  let e = !0;
135
- return bt(Z).catch(() => {
105
+ return yt(K).catch(() => {
136
106
  }).then(() => {
137
- e && je((a) => a + 1);
107
+ e && qe((n) => n + 1);
138
108
  }), () => {
139
109
  e = !1;
140
110
  };
141
- }, [Z]), y(() => {
142
- !l && X !== null && ce(null);
143
- }, [X, l]), y(() => {
144
- (!l || g) && Y && O(!1);
145
- }, [g, Y, l]);
146
- const fe = d(
147
- () => ee ?? xt(F),
148
- [F, ee]
149
- ), E = d(
150
- () => zt(c),
151
- [c, w]
152
- ), H = Ae ?? E?.languageText ?? Tt, K = Me ?? E?.languageLabel, Ce = !!K, tt = It(
153
- Ne ?? E?.languageIcon
154
- ), J = m ? Xe(De.readOnly) : void 0, ye = ke ?? (J && J !== De.readOnly ? J : Dt), h = Ce || m;
155
- yt(() => {
156
- if (!h) {
157
- de(0);
158
- return;
159
- }
160
- const e = Math.round(ie.current?.offsetHeight ?? 0);
161
- de((a) => a === e ? a : e);
162
- }, [h, K, m, ye, P]);
163
- const nt = He(
164
- Ke,
165
- h ? z : 0
166
- ), ot = He(
167
- N,
168
- h ? z : 0
169
- ), at = ve(
170
- nt,
171
- l
172
- ), rt = ve(
173
- ot,
174
- l
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 (oe)
183
- return Ot({
184
- code: u,
185
- languageTemplate: E ?? c,
186
- languageText: H
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
- w,
194
- k,
195
- oe
196
- ]), pe = xe || !!v && !v.isValid, f = v && !v.isValid ? v.errorRange : void 0, it = d(() => {
197
- if (!f)
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 = f.start.line, a = f.end?.line ?? 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(a - e + 1, 1) },
203
- (Se, gt) => e + gt
166
+ { length: Math.max(n - e + 1, 1) },
167
+ (M, at) => e + at
204
168
  )
205
169
  );
206
- }, [f]), o = {
207
- colorMode: F,
208
- disabled: g,
209
- error: pe,
210
- isLineCapped: $,
211
- isEmpty: u.length === 0,
212
- isPlaceholderVisible: $e,
213
- isResizeHandleActive: Y,
214
- lineHeight: j,
215
- maxLines: q,
216
- minLines: b,
217
- readOnly: m,
218
- resizable: l,
219
- showLineNumbers: te,
220
- size: P,
221
- variant: Ue,
222
- visibleLineCount: me
223
- }, lt = p(
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: i,
227
- languageTemplate: c,
228
- languageText: H,
229
- prismTheme: fe,
230
- syntaxErrorRange: f
189
+ customLanguages: l,
190
+ languageTemplate: u,
191
+ languageText: S,
192
+ prismTheme: Le,
193
+ syntaxErrorRange: L
231
194
  }),
232
195
  [
233
- i,
234
- c,
235
- fe,
236
- H,
237
- w,
238
- f
196
+ l,
197
+ u,
198
+ Le,
199
+ S,
200
+ Y,
201
+ L
239
202
  ]
240
- ), st = p(
203
+ ), tt = v(
241
204
  (e) => {
242
- D && se(e), B?.(e);
205
+ _ && ce(e), V?.(e);
243
206
  },
244
- [B, D]
245
- ), dt = p(() => {
246
- O(!0);
247
- }, []), ct = p(() => {
248
- O(!0);
249
- }, []), ut = p(
250
- (e, a, Se) => {
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
- [h, z, N]
260
- ), ht = p(
215
+ [d, E]
216
+ ), rt = v(
261
217
  (e) => {
262
- if (g || e.target instanceof Element && e.target.closest("textarea"))
218
+ if (d || e.target instanceof Element && e.target.closest("textarea"))
263
219
  return;
264
220
  e.currentTarget.querySelector("textarea")?.focus();
265
221
  },
266
- [g]
267
- );
268
- return Ze ? /* @__PURE__ */ r(Mt, { ownerState: o }) : /* @__PURE__ */ r(
269
- At,
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: o,
272
- disableDragging: !0,
273
- dragAxis: "none",
274
- enableResizing: Je,
275
- minHeight: rt,
276
- onResize: ct,
277
- onResizeStart: dt,
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: /* @__PURE__ */ M(
289
- Bt,
290
- {
291
- ownerState: o,
292
- "aria-disabled": o.disabled || void 0,
293
- className: A(L.root, n),
294
- ...I(S, R.root, s),
295
- children: [
296
- h ? /* @__PURE__ */ M(
297
- Vt,
298
- {
299
- ref: ie,
300
- ownerState: o,
301
- className: L.header,
302
- children: [
303
- Ce ? /* @__PURE__ */ r(
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
- label: ye,
327
- size: "small"
254
+ ...N(
255
+ m,
256
+ h.languageChipIcon,
257
+ Lt
258
+ ),
259
+ children: /* @__PURE__ */ r(Je, { fontSize: "small" })
328
260
  }
329
- ) : null })
330
- ]
331
- }
332
- ) : null,
333
- /* @__PURE__ */ M(
334
- Ut,
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: o,
337
- onClick: ht,
338
- ...I(S, R.body, s),
311
+ ownerState: t,
312
+ onClick: rt,
313
+ ...N(m, h.body, a),
339
314
  children: [
340
- te ? /* @__PURE__ */ r(Ft, { ownerState: o, "aria-hidden": "true", children: Array.from({ length: ge }, (e, a) => a + 1).map(
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
- Yt,
317
+ wt,
343
318
  {
344
- ownerState: o,
345
- "data-code-editor-error-line": it.has(e) || void 0,
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__ */ M(Xt, { ownerState: o, children: [
352
- ne && o.isEmpty && V ? /* @__PURE__ */ r(
353
- Zt,
326
+ /* @__PURE__ */ A(Vt, { ownerState: t, children: [
327
+ re && t.isEmpty && P ? /* @__PURE__ */ r(
328
+ Pt,
354
329
  {
355
- ownerState: o,
356
- ...I(
357
- S,
358
- R.placeholder,
359
- s
330
+ ownerState: t,
331
+ ...N(
332
+ m,
333
+ h.placeholder,
334
+ a
360
335
  ),
361
- children: V
336
+ children: P
362
337
  }
363
338
  ) : null,
364
339
  /* @__PURE__ */ r(
365
- jt,
340
+ kt,
366
341
  {
367
342
  ...x,
368
- ownerState: o,
343
+ ownerState: t,
369
344
  "aria-label": x["aria-label"] ?? "Code editor",
370
- "aria-invalid": x["aria-invalid"] ?? (pe || void 0),
371
- className: A(L.editor, be),
372
- "data-testid": St(
373
- S,
374
- R.textarea,
375
- s
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: g,
378
- highlight: lt,
379
- insertSpaces: Oe,
352
+ disabled: d,
353
+ highlight: et,
354
+ insertSpaces: Me,
380
355
  onBlur: Ve,
381
- onValueChange: st,
382
- preClassName: A(L.pre, Pe),
383
- readOnly: m,
356
+ onValueChange: tt,
357
+ preClassName: B(R.pre, Pe),
358
+ readOnly: C,
384
359
  tabSize: x.tabSize,
385
- textareaClassName: A(
386
- L.textarea,
387
- we
360
+ textareaClassName: B(
361
+ R.textarea,
362
+ Ue
388
363
  ),
389
- textareaId: Ye,
390
- value: u
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
- mn as CodeEditor
379
+ nn as CodeEditor
405
380
  };