@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.
- package/components/AppBar/AppBar.d.ts.map +1 -1
- package/components/AppBar/AppBar.js +36 -29
- package/components/AppBar/types.d.ts +2 -2
- package/components/AppBar/types.d.ts.map +1 -1
- package/components/GridLayout/subcomponents/GridItem/index.d.ts.map +1 -1
- package/components/GridLayout/subcomponents/GridItem/index.js +21 -20
- package/components/MFIsolationApp/MFIsolationApp.d.ts.map +1 -1
- package/components/MFIsolationApp/MFIsolationApp.js +91 -88
- package/components/MFIsolationApp/subcomponents/MFAuthApp/MFAuthApp.d.ts.map +1 -1
- package/components/MFIsolationApp/subcomponents/MFAuthApp/MFAuthApp.js +35 -24
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts +5 -0
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts.map +1 -0
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.js +14 -0
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts +2 -0
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts.map +1 -0
- package/components/MFLoader/MFLoader.d.ts.map +1 -1
- package/components/MFLoader/MFLoader.js +39 -39
- package/components/MFLoader/types.d.ts +16 -0
- package/components/MFLoader/types.d.ts.map +1 -1
- package/components/SideBar/context/sideBarContext/index.d.ts.map +1 -1
- package/components/SideBar/context/sideBarContext/index.js +15 -14
- package/components/SideBar/hooks/useCollapse/useCollapse.d.ts +2 -1
- package/components/SideBar/hooks/useCollapse/useCollapse.d.ts.map +1 -1
- package/components/SideBar/hooks/useCollapse/useCollapse.js +9 -9
- package/components/SideBar/index.d.ts +1 -1
- package/components/SideBar/index.d.ts.map +1 -1
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +1 -1
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +1 -1
- package/components/SideBar/types.d.ts +8 -1
- package/components/SideBar/types.d.ts.map +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.d.ts.map +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +66 -52
- package/components/areas/contexts/AreasContext/store.d.ts.map +1 -1
- package/components/areas/contexts/AreasContext/store.js +142 -141
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +372 -230
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +175 -116
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts +2 -1
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/constants.js +18 -17
- 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 +4 -0
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +33 -27
- package/components/extended/ReactSimpleCodeEditor/types.d.ts +13 -0
- package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/components/MFIsolationApp/subcomponents/MFIsolationThemeBridge/MFIsolationThemeBridge.d.ts +0 -10
- package/components/MFIsolationApp/subcomponents/MFIsolationThemeBridge/MFIsolationThemeBridge.d.ts.map +0 -1
- package/components/MFIsolationApp/subcomponents/MFIsolationThemeBridge/MFIsolationThemeBridge.js +0 -19
- package/components/MFIsolationApp/subcomponents/MFIsolationThemeBridge/index.d.ts +0 -2
- 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":"
|
|
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
|
|
2
|
-
import { useModuleDictionary as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { getPropDataTestId as
|
|
7
|
-
import { CODE_EDITOR_DEFAULT_MAX_LINES as
|
|
8
|
-
import { CODE_EDITOR_DICTIONARY as
|
|
9
|
-
import { resolveCodeEditorLanguageIcon as
|
|
10
|
-
import {
|
|
11
|
-
import { SkeletonStyled as
|
|
12
|
-
import { CodeEditorSlots as
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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:
|
|
19
|
-
customLanguages:
|
|
20
|
-
dataTestId:
|
|
21
|
-
defaultValue:
|
|
22
|
-
disabled:
|
|
23
|
-
editorClassName:
|
|
24
|
-
error:
|
|
25
|
-
highlightTheme:
|
|
26
|
-
id:
|
|
27
|
-
insertSpaces:
|
|
28
|
-
languageIcon:
|
|
29
|
-
languageLabel:
|
|
30
|
-
languageTemplate:
|
|
31
|
-
languageText:
|
|
32
|
-
maxLines:
|
|
33
|
-
minLines:
|
|
34
|
-
onBlur:
|
|
35
|
-
onChange:
|
|
36
|
-
placeholder:
|
|
37
|
-
preClassName:
|
|
38
|
-
readOnly:
|
|
39
|
-
readOnlyLabel:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
|
135
|
+
return bt(Z).catch(() => {
|
|
66
136
|
}).then(() => {
|
|
67
|
-
e &&
|
|
137
|
+
e && je((a) => a + 1);
|
|
68
138
|
}), () => {
|
|
69
139
|
e = !1;
|
|
70
140
|
};
|
|
71
|
-
}, [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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 (
|
|
88
|
-
return
|
|
89
|
-
code:
|
|
90
|
-
languageTemplate:
|
|
91
|
-
languageText:
|
|
182
|
+
if (oe)
|
|
183
|
+
return Ot({
|
|
184
|
+
code: u,
|
|
185
|
+
languageTemplate: E ?? c,
|
|
186
|
+
languageText: H
|
|
92
187
|
});
|
|
93
188
|
}, [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
]),
|
|
102
|
-
if (!
|
|
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 =
|
|
199
|
+
const e = f.start.line, a = f.end?.line ?? e;
|
|
105
200
|
return new Set(
|
|
106
201
|
Array.from(
|
|
107
|
-
{ length: Math.max(
|
|
108
|
-
(
|
|
202
|
+
{ length: Math.max(a - e + 1, 1) },
|
|
203
|
+
(Se, gt) => e + gt
|
|
109
204
|
)
|
|
110
205
|
);
|
|
111
|
-
}, [
|
|
112
|
-
colorMode:
|
|
113
|
-
disabled:
|
|
114
|
-
error:
|
|
115
|
-
isLineCapped:
|
|
116
|
-
isEmpty:
|
|
117
|
-
isPlaceholderVisible:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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:
|
|
130
|
-
languageTemplate:
|
|
131
|
-
languageText:
|
|
132
|
-
prismTheme:
|
|
133
|
-
syntaxErrorRange:
|
|
226
|
+
customLanguages: i,
|
|
227
|
+
languageTemplate: c,
|
|
228
|
+
languageText: H,
|
|
229
|
+
prismTheme: fe,
|
|
230
|
+
syntaxErrorRange: f
|
|
134
231
|
}),
|
|
135
232
|
[
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
233
|
+
i,
|
|
234
|
+
c,
|
|
235
|
+
fe,
|
|
236
|
+
H,
|
|
237
|
+
w,
|
|
238
|
+
f
|
|
142
239
|
]
|
|
143
|
-
),
|
|
240
|
+
), st = p(
|
|
144
241
|
(e) => {
|
|
145
|
-
|
|
242
|
+
D && se(e), B?.(e);
|
|
146
243
|
},
|
|
147
|
-
[
|
|
148
|
-
),
|
|
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 (
|
|
262
|
+
if (g || e.target instanceof Element && e.target.closest("textarea"))
|
|
151
263
|
return;
|
|
152
264
|
e.currentTarget.querySelector("textarea")?.focus();
|
|
153
265
|
},
|
|
154
|
-
[
|
|
266
|
+
[g]
|
|
155
267
|
);
|
|
156
|
-
return
|
|
157
|
-
|
|
268
|
+
return Ze ? /* @__PURE__ */ r(Mt, { ownerState: o }) : /* @__PURE__ */ r(
|
|
269
|
+
At,
|
|
158
270
|
{
|
|
159
|
-
ownerState:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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
|
-
|
|
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":"
|
|
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"}
|