@m4l/components 9.24.0-beta-feature-731-m4l-components-code-editor.8 → 9.24.1-beta-feature-731-code-editor.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/components/AppBar/AppBar.d.ts.map +1 -1
  2. package/components/AppBar/AppBar.js +36 -29
  3. package/components/AppBar/types.d.ts +2 -2
  4. package/components/AppBar/types.d.ts.map +1 -1
  5. package/components/GridLayout/subcomponents/GridItem/index.d.ts.map +1 -1
  6. package/components/GridLayout/subcomponents/GridItem/index.js +21 -20
  7. package/components/MFIsolationApp/MFIsolationApp.d.ts.map +1 -1
  8. package/components/MFIsolationApp/MFIsolationApp.js +91 -88
  9. package/components/MFIsolationApp/subcomponents/MFAuthApp/MFAuthApp.d.ts.map +1 -1
  10. package/components/MFIsolationApp/subcomponents/MFAuthApp/MFAuthApp.js +35 -24
  11. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts +5 -0
  12. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts.map +1 -0
  13. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.js +14 -0
  14. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts +2 -0
  15. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts.map +1 -0
  16. package/components/MFLoader/MFLoader.d.ts.map +1 -1
  17. package/components/MFLoader/MFLoader.js +39 -39
  18. package/components/MFLoader/types.d.ts +16 -0
  19. package/components/MFLoader/types.d.ts.map +1 -1
  20. package/components/SideBar/context/sideBarContext/index.d.ts.map +1 -1
  21. package/components/SideBar/context/sideBarContext/index.js +15 -14
  22. package/components/SideBar/hooks/useCollapse/useCollapse.d.ts +2 -1
  23. package/components/SideBar/hooks/useCollapse/useCollapse.d.ts.map +1 -1
  24. package/components/SideBar/hooks/useCollapse/useCollapse.js +9 -9
  25. package/components/SideBar/index.d.ts +1 -1
  26. package/components/SideBar/index.d.ts.map +1 -1
  27. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +1 -1
  28. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +1 -1
  29. package/components/SideBar/types.d.ts +8 -1
  30. package/components/SideBar/types.d.ts.map +1 -1
  31. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.d.ts.map +1 -1
  32. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +66 -52
  33. package/components/areas/contexts/AreasContext/store.d.ts.map +1 -1
  34. package/components/areas/contexts/AreasContext/store.js +142 -141
  35. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +1 -1
  36. package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +372 -230
  37. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +1 -1
  38. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +175 -116
  39. package/components/extended/ReactSimpleCodeEditor/constants.d.ts +2 -1
  40. package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +1 -1
  41. package/components/extended/ReactSimpleCodeEditor/constants.js +18 -17
  42. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +1 -0
  43. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +1 -1
  44. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +1 -1
  45. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +4 -0
  46. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +1 -1
  47. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +33 -27
  48. package/components/extended/ReactSimpleCodeEditor/types.d.ts +13 -0
  49. package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +1 -1
  50. package/package.json +9 -9
  51. package/components/MFIsolationApp/subcomponents/MFIsolationThemeBridge/MFIsolationThemeBridge.d.ts +0 -10
  52. package/components/MFIsolationApp/subcomponents/MFIsolationThemeBridge/MFIsolationThemeBridge.d.ts.map +0 -1
  53. package/components/MFIsolationApp/subcomponents/MFIsolationThemeBridge/MFIsolationThemeBridge.js +0 -19
  54. package/components/MFIsolationApp/subcomponents/MFIsolationThemeBridge/index.d.ts +0 -2
  55. package/components/MFIsolationApp/subcomponents/MFIsolationThemeBridge/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,SAAS,CAAC;AAgBjB;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,oDAuXhD"}
1
+ {"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AAuEA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,SAAS,CAAC;AAqFjB;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,oDAqiBhD"}
@@ -1,263 +1,405 @@
1
- import { jsx as a, jsxs as D } from "@emotion/react/jsx-runtime";
2
- import { useModuleDictionary as Ae, useModuleSkeleton as Me } from "@m4l/core";
3
- import { useThemeMode as Ve } from "@m4l/graphics";
4
- import _ from "clsx";
5
- import { useId as Pe, useState as J, useRef as ke, useMemo as E, useEffect as Q, useCallback as z } from "react";
6
- import { getPropDataTestId as x, getNameDataTestId as ze } from "../../../test/getNameDataTestId.js";
7
- import { CODE_EDITOR_DEFAULT_MAX_LINES as Be, CODE_EDITOR_DEFAULT_MIN_LINES as He, CODE_EDITOR_DEFAULT_LANGUAGE as we, CODE_EDITOR_LINE_HEIGHT_BY_SIZE as Ge, CODE_EDITOR_CLASSES as C, CODE_EDITOR_KEY_COMPONENT as p, CODE_EDITOR_READ_ONLY_LABEL as Ue, CODE_EDITOR_LANGUAGE_CHIP_ICON_INSTANCE_ID as Ye } from "./constants.js";
8
- import { CODE_EDITOR_DICTIONARY as W } from "./dictionary.js";
9
- import { resolveCodeEditorLanguageIcon as Fe } from "./helpers/languageIcon.js";
10
- import { ensureCodeEditorRuntimeDependencies as je, getCodeEditorLineCount as qe, createCodeEditorPrismTheme as Ke, resolveCodeEditorLanguageTemplate as Xe, validateCodeEditorSyntax as Ze, highlightCode as $e } from "./helpers/highlighting.js";
11
- import { SkeletonStyled as Je, RootStyled as Qe, HeaderStyled as We, LanguageChipStyled as et, LanguageChipIconStyled as tt, HeaderBadgesStyled as at, ReadOnlyChipStyled as nt, BodyStyled as rt, LineNumbersStyled as ot, LineNumberStyled as lt, EditorScrollerStyled as it, PlaceholderStyled as st, EditorStyled as dt } from "./slots/CodeEditorSlots.js";
12
- import { CodeEditorSlots as f } from "./slots/CodeEditorEnum.js";
13
- function ct(L, y) {
14
- return L.length !== y.length ? !1 : L.every((S, o) => S === y[o]);
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";
15
16
  }
16
- function Dt(L) {
17
+ function Jt(t, n) {
18
+ return t.length !== n.length ? !1 : t.every((i, s) => i === n[s]);
19
+ }
20
+ function Ie(t, n, i) {
21
+ const s = i ? Te : Te * 2;
22
+ return t * n + s;
23
+ }
24
+ function Qt(t, n, i) {
25
+ return Ie(t, n, i);
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) {
17
40
  const {
18
- className: y,
19
- customLanguages: S,
20
- dataTestId: o,
21
- defaultValue: ee,
22
- disabled: I = !1,
23
- editorClassName: te,
24
- error: ae = !1,
25
- highlightTheme: B,
26
- id: ne,
27
- insertSpaces: re,
28
- languageIcon: oe,
29
- languageLabel: le,
30
- languageTemplate: n,
31
- languageText: ie,
32
- maxLines: se = Be,
33
- minLines: O = He,
34
- onBlur: de,
35
- onChange: v,
36
- placeholder: R,
37
- preClassName: ce,
38
- readOnly: d = !1,
39
- readOnlyLabel: ue,
40
- runtimeDependencies: c,
41
- showLineNumbers: H = !1,
42
- showPlaceholder: w = !0,
43
- size: G = "medium",
44
- syntaxValidator: N,
45
- skeleton: me = !1,
46
- textareaClassName: ge,
47
- validateSyntax: U = !1,
48
- value: u,
49
- variant: he = "outlined",
50
- ...T
51
- } = L, Ee = Pe(), Ce = ne || Ee, { getLabel: pe } = Ae(), fe = Me() || me, b = Ve(), m = v === void 0, [A, Le] = J(0), M = ke([]), [ye, Y] = J(
52
- u ?? ee ?? ""
53
- ), F = E(() => c ? Array.isArray(c) ? c : [c] : [], [c]);
54
- ct(
55
- M.current,
56
- F
57
- ) || (M.current = F);
58
- const V = M.current;
59
- Q(() => {
60
- m && u !== void 0 && Y(u);
61
- }, [m, u]), Q(() => {
62
- if (!V.length)
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,
57
+ onBlur: Ve,
58
+ onChange: B,
59
+ placeholder: V,
60
+ preClassName: Pe,
61
+ readOnly: m = !1,
62
+ readOnlyLabel: ke,
63
+ resizable: l = !0,
64
+ runtimeDependencies: _,
65
+ showLineNumbers: te = !1,
66
+ showPlaceholder: ne = !0,
67
+ size: P = "medium",
68
+ syntaxValidator: k,
69
+ skeleton: Ge = !1,
70
+ textareaClassName: we,
71
+ validateSyntax: oe = !1,
72
+ value: T,
73
+ variant: Ue = "outlined",
74
+ ...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
+ }
109
+ };
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,
124
+ e
125
+ ), () => {
126
+ re(
127
+ Re.EMMIT_EVENT_HOST_THEME_CHANGE,
128
+ e
129
+ );
130
+ };
131
+ }, [ae, re]), y(() => {
132
+ if (!Z.length)
63
133
  return;
64
134
  let e = !0;
65
- return je(V).catch(() => {
135
+ return bt(Z).catch(() => {
66
136
  }).then(() => {
67
- e && Le((s) => s + 1);
137
+ e && je((a) => a + 1);
68
138
  }), () => {
69
139
  e = !1;
70
140
  };
71
- }, [V]);
72
- const r = m ? ye : u ?? "", Se = w && r.length === 0 && !!R, Ie = Ge[G], j = qe(r), q = Math.max(j, O), P = Math.max(O, se), Te = Math.min(q, P), De = j >= P, K = E(
73
- () => B ?? Ke(b),
74
- [b, B]
75
- ), l = E(
76
- () => Xe(n),
77
- [n, A]
78
- ), g = ie ?? l?.languageText ?? we, X = le ?? l?.languageLabel, Z = !!X, _e = Fe(
79
- oe ?? l?.languageIcon
80
- ), k = d ? pe(W.readOnly) : void 0, xe = ue ?? (k && k !== W.readOnly ? k : Ue), h = E(() => {
81
- if (N)
82
- return N({
83
- code: r,
84
- languageTemplate: l ?? n,
85
- languageText: g
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
86
181
  });
87
- if (U)
88
- return Ze({
89
- code: r,
90
- languageTemplate: l ?? n,
91
- languageText: g
182
+ if (oe)
183
+ return Ot({
184
+ code: u,
185
+ languageTemplate: E ?? c,
186
+ languageText: H
92
187
  });
93
188
  }, [
94
- n,
95
- l,
96
- g,
97
- r,
98
- A,
99
- N,
100
- U
101
- ]), $ = ae || !!h && !h.isValid, i = h && !h.isValid ? h.errorRange : void 0, Oe = E(() => {
102
- if (!i)
189
+ c,
190
+ E,
191
+ H,
192
+ 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)
103
198
  return /* @__PURE__ */ new Set();
104
- const e = i.start.line, s = i.end?.line ?? e;
199
+ const e = f.start.line, a = f.end?.line ?? e;
105
200
  return new Set(
106
201
  Array.from(
107
- { length: Math.max(s - e + 1, 1) },
108
- (ut, be) => e + be
202
+ { length: Math.max(a - e + 1, 1) },
203
+ (Se, gt) => e + gt
109
204
  )
110
205
  );
111
- }, [i]), t = {
112
- colorMode: b,
113
- disabled: I,
114
- error: $,
115
- isLineCapped: De,
116
- isEmpty: r.length === 0,
117
- isPlaceholderVisible: Se,
118
- lineHeight: Ie,
119
- maxLines: P,
120
- minLines: O,
121
- readOnly: d,
122
- showLineNumbers: H,
123
- size: G,
124
- variant: he,
125
- visibleLineCount: Te
126
- }, ve = z(
127
- (e) => $e({
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({
128
225
  code: e,
129
- customLanguages: S,
130
- languageTemplate: n,
131
- languageText: g,
132
- prismTheme: K,
133
- syntaxErrorRange: i
226
+ customLanguages: i,
227
+ languageTemplate: c,
228
+ languageText: H,
229
+ prismTheme: fe,
230
+ syntaxErrorRange: f
134
231
  }),
135
232
  [
136
- S,
137
- n,
138
- K,
139
- g,
140
- A,
141
- i
233
+ i,
234
+ c,
235
+ fe,
236
+ H,
237
+ w,
238
+ f
142
239
  ]
143
- ), Re = z(
240
+ ), st = p(
144
241
  (e) => {
145
- m && Y(e), v?.(e);
242
+ D && se(e), B?.(e);
146
243
  },
147
- [v, m]
148
- ), Ne = z(
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
+ );
258
+ },
259
+ [h, z, N]
260
+ ), ht = p(
149
261
  (e) => {
150
- if (I || e.target instanceof Element && e.target.closest("textarea"))
262
+ if (g || e.target instanceof Element && e.target.closest("textarea"))
151
263
  return;
152
264
  e.currentTarget.querySelector("textarea")?.focus();
153
265
  },
154
- [I]
266
+ [g]
155
267
  );
156
- return fe ? /* @__PURE__ */ a(Je, { ownerState: t }) : /* @__PURE__ */ D(
157
- Qe,
268
+ return Ze ? /* @__PURE__ */ r(Mt, { ownerState: o }) : /* @__PURE__ */ r(
269
+ At,
158
270
  {
159
- ownerState: t,
160
- "aria-disabled": t.disabled || void 0,
161
- className: _(C.root, y),
162
- ...x(p, f.root, o),
163
- children: [
164
- Z || d ? /* @__PURE__ */ D(We, { ownerState: t, className: C.header, children: [
165
- Z ? /* @__PURE__ */ a(
166
- et,
167
- {
168
- label: X,
169
- size: "small",
170
- variant: "outlined",
171
- color: "default",
172
- startIcon: /* @__PURE__ */ a(
173
- tt,
174
- {
175
- ...x(
176
- p,
177
- f.languageChipIcon,
178
- Ye
179
- ),
180
- children: /* @__PURE__ */ a(_e, { fontSize: "small" })
181
- }
182
- )
183
- }
184
- ) : null,
185
- /* @__PURE__ */ a(at, { ownerState: t, children: d ? /* @__PURE__ */ a(
186
- nt,
187
- {
188
- label: xe,
189
- size: "small"
190
- }
191
- ) : null })
192
- ] }) : null,
193
- /* @__PURE__ */ D(
194
- rt,
195
- {
196
- ownerState: t,
197
- onClick: Ne,
198
- ...x(p, f.body, o),
199
- children: [
200
- H ? /* @__PURE__ */ a(ot, { ownerState: t, "aria-hidden": "true", children: Array.from({ length: q }, (e, s) => s + 1).map(
201
- (e) => /* @__PURE__ */ a(
202
- lt,
203
- {
204
- ownerState: t,
205
- "data-code-editor-error-line": Oe.has(e) || void 0,
206
- children: e
207
- },
208
- `code-editor-line-${e}`
209
- )
210
- ) }) : null,
211
- /* @__PURE__ */ D(it, { ownerState: t, children: [
212
- w && t.isEmpty && R ? /* @__PURE__ */ a(
213
- st,
214
- {
215
- ownerState: t,
216
- ...x(
217
- p,
218
- f.placeholder,
219
- o
220
- ),
221
- children: R
222
- }
223
- ) : null,
224
- /* @__PURE__ */ a(
225
- dt,
226
- {
227
- ...T,
228
- ownerState: t,
229
- "aria-label": T["aria-label"] ?? "Code editor",
230
- "aria-invalid": T["aria-invalid"] ?? ($ || void 0),
231
- className: _(C.editor, te),
232
- "data-testid": ze(
233
- p,
234
- f.textarea,
235
- o
236
- ),
237
- disabled: I,
238
- highlight: ve,
239
- insertSpaces: re,
240
- onBlur: de,
241
- onValueChange: Re,
242
- preClassName: _(C.pre, ce),
243
- readOnly: d,
244
- tabSize: T.tabSize,
245
- textareaClassName: _(
246
- C.textarea,
247
- ge
248
- ),
249
- textareaId: Ce,
250
- value: r
251
- }
252
- )
253
- ] })
254
- ]
255
- }
256
- )
257
- ]
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
287
+ ),
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,
325
+ {
326
+ label: ye,
327
+ size: "small"
328
+ }
329
+ ) : null })
330
+ ]
331
+ }
332
+ ) : null,
333
+ /* @__PURE__ */ M(
334
+ Ut,
335
+ {
336
+ ownerState: o,
337
+ onClick: ht,
338
+ ...I(S, R.body, s),
339
+ children: [
340
+ te ? /* @__PURE__ */ r(Ft, { ownerState: o, "aria-hidden": "true", children: Array.from({ length: ge }, (e, a) => a + 1).map(
341
+ (e) => /* @__PURE__ */ r(
342
+ Yt,
343
+ {
344
+ ownerState: o,
345
+ "data-code-editor-error-line": it.has(e) || void 0,
346
+ children: e
347
+ },
348
+ `code-editor-line-${e}`
349
+ )
350
+ ) }) : null,
351
+ /* @__PURE__ */ M(Xt, { ownerState: o, children: [
352
+ ne && o.isEmpty && V ? /* @__PURE__ */ r(
353
+ Zt,
354
+ {
355
+ ownerState: o,
356
+ ...I(
357
+ S,
358
+ R.placeholder,
359
+ s
360
+ ),
361
+ children: V
362
+ }
363
+ ) : null,
364
+ /* @__PURE__ */ r(
365
+ jt,
366
+ {
367
+ ...x,
368
+ ownerState: o,
369
+ "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
376
+ ),
377
+ disabled: g,
378
+ highlight: lt,
379
+ insertSpaces: Oe,
380
+ onBlur: Ve,
381
+ onValueChange: st,
382
+ preClassName: A(L.pre, Pe),
383
+ readOnly: m,
384
+ tabSize: x.tabSize,
385
+ textareaClassName: A(
386
+ L.textarea,
387
+ we
388
+ ),
389
+ textareaId: Ye,
390
+ value: u
391
+ }
392
+ )
393
+ ] })
394
+ ]
395
+ }
396
+ )
397
+ ]
398
+ }
399
+ )
258
400
  }
259
401
  );
260
402
  }
261
403
  export {
262
- Dt as CodeEditor
404
+ mn as CodeEditor
263
405
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,eAAO,MAAM,gBAAgB,EAAE,gBAyV9B,CAAC"}
1
+ {"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,eAAO,MAAM,gBAAgB,EAAE,gBA0Z9B,CAAC"}