@m4l/components 9.24.0-beta-feature-731-m4l-components-code-editor.1 → 9.24.0-beta-feature-731-m4l-components-code-editor.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/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +181 -166
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +1 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +12 -10
- package/package.json +5 -5
|
@@ -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,
|
|
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,oDAsXhD"}
|
|
@@ -1,243 +1,258 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useModuleDictionary as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import { getPropDataTestId as
|
|
7
|
-
import { CODE_EDITOR_DEFAULT_MAX_LINES as
|
|
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 _ from "clsx";
|
|
4
|
+
import { useId as Ve, useState as J, useRef as Pe, useMemo as E, useEffect as Q, useCallback as k } from "react";
|
|
5
|
+
import { useTheme as ke } from "@mui/material/styles";
|
|
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
8
|
import { CODE_EDITOR_DICTIONARY as W } from "./dictionary.js";
|
|
9
|
-
import { resolveCodeEditorLanguageIcon as
|
|
10
|
-
import { ensureCodeEditorRuntimeDependencies as
|
|
11
|
-
import { SkeletonStyled as
|
|
12
|
-
import { CodeEditorSlots as
|
|
13
|
-
function
|
|
14
|
-
return
|
|
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]);
|
|
15
15
|
}
|
|
16
|
-
function Dt(
|
|
16
|
+
function Dt(L) {
|
|
17
17
|
const {
|
|
18
|
-
className:
|
|
19
|
-
customLanguages:
|
|
20
|
-
dataTestId:
|
|
18
|
+
className: y,
|
|
19
|
+
customLanguages: S,
|
|
20
|
+
dataTestId: o,
|
|
21
21
|
defaultValue: ee,
|
|
22
|
-
disabled:
|
|
22
|
+
disabled: I = !1,
|
|
23
23
|
editorClassName: te,
|
|
24
24
|
error: ae = !1,
|
|
25
25
|
highlightTheme: z,
|
|
26
26
|
id: ne,
|
|
27
27
|
insertSpaces: re,
|
|
28
|
-
languageIcon:
|
|
29
|
-
languageLabel:
|
|
28
|
+
languageIcon: oe,
|
|
29
|
+
languageLabel: le,
|
|
30
30
|
languageTemplate: n,
|
|
31
31
|
languageText: ie,
|
|
32
|
-
maxLines: se =
|
|
33
|
-
minLines:
|
|
32
|
+
maxLines: se = Be,
|
|
33
|
+
minLines: O = He,
|
|
34
34
|
onBlur: de,
|
|
35
|
-
onChange:
|
|
36
|
-
placeholder:
|
|
37
|
-
preClassName:
|
|
38
|
-
readOnly:
|
|
39
|
-
readOnlyLabel:
|
|
40
|
-
runtimeDependencies:
|
|
41
|
-
showLineNumbers:
|
|
42
|
-
showPlaceholder:
|
|
35
|
+
onChange: v,
|
|
36
|
+
placeholder: R,
|
|
37
|
+
preClassName: ce,
|
|
38
|
+
readOnly: d = !1,
|
|
39
|
+
readOnlyLabel: ue,
|
|
40
|
+
runtimeDependencies: c,
|
|
41
|
+
showLineNumbers: B = !1,
|
|
42
|
+
showPlaceholder: H = !0,
|
|
43
43
|
size: w = "medium",
|
|
44
|
-
syntaxValidator:
|
|
44
|
+
syntaxValidator: N,
|
|
45
45
|
skeleton: me = !1,
|
|
46
46
|
textareaClassName: ge,
|
|
47
|
-
validateSyntax:
|
|
47
|
+
validateSyntax: G = !1,
|
|
48
48
|
value: u,
|
|
49
49
|
variant: he = "outlined",
|
|
50
|
-
...
|
|
51
|
-
} =
|
|
50
|
+
...T
|
|
51
|
+
} = L, Ee = Ve(), Ce = ne || Ee, U = ke(), { getLabel: pe } = Ae(), fe = Me() || me, m = v === void 0, [b, Le] = J(0), A = Pe([]), [ye, Y] = J(
|
|
52
52
|
u ?? ee ?? ""
|
|
53
|
-
),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
) || (
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, [
|
|
62
|
-
if (!
|
|
53
|
+
), F = E(() => c ? Array.isArray(c) ? c : [c] : [], [c]);
|
|
54
|
+
ct(
|
|
55
|
+
A.current,
|
|
56
|
+
F
|
|
57
|
+
) || (A.current = F);
|
|
58
|
+
const M = A.current;
|
|
59
|
+
Q(() => {
|
|
60
|
+
m && u !== void 0 && Y(u);
|
|
61
|
+
}, [m, u]), Q(() => {
|
|
62
|
+
if (!M.length)
|
|
63
63
|
return;
|
|
64
64
|
let e = !0;
|
|
65
|
-
return
|
|
65
|
+
return je(M).catch(() => {
|
|
66
66
|
}).then(() => {
|
|
67
|
-
e &&
|
|
67
|
+
e && Le((s) => s + 1);
|
|
68
68
|
}), () => {
|
|
69
69
|
e = !1;
|
|
70
70
|
};
|
|
71
|
-
}, [
|
|
72
|
-
const r =
|
|
73
|
-
() => z ??
|
|
74
|
-
[z,
|
|
71
|
+
}, [M]);
|
|
72
|
+
const r = m ? ye : u ?? "", Se = H && r.length === 0 && !!R, Ie = Ge[w], j = qe(r), q = Math.max(j, O), V = Math.max(O, se), Te = Math.min(q, V), De = j >= V, K = E(
|
|
73
|
+
() => z ?? Ke(U),
|
|
74
|
+
[z, U]
|
|
75
75
|
), l = E(
|
|
76
|
-
() =>
|
|
77
|
-
[n,
|
|
78
|
-
),
|
|
79
|
-
|
|
80
|
-
),
|
|
81
|
-
if (
|
|
82
|
-
return
|
|
76
|
+
() => Xe(n),
|
|
77
|
+
[n, b]
|
|
78
|
+
), g = ie ?? l?.languageText ?? we, X = le ?? l?.languageLabel, Z = !!X, _e = Fe(
|
|
79
|
+
oe ?? l?.languageIcon
|
|
80
|
+
), P = d ? pe(W.readOnly) : void 0, xe = ue ?? (P && P !== W.readOnly ? P : Ue), h = E(() => {
|
|
81
|
+
if (N)
|
|
82
|
+
return N({
|
|
83
83
|
code: r,
|
|
84
84
|
languageTemplate: l ?? n,
|
|
85
|
-
languageText:
|
|
85
|
+
languageText: g
|
|
86
86
|
});
|
|
87
|
-
if (
|
|
88
|
-
return
|
|
87
|
+
if (G)
|
|
88
|
+
return Ze({
|
|
89
89
|
code: r,
|
|
90
90
|
languageTemplate: l ?? n,
|
|
91
|
-
languageText:
|
|
91
|
+
languageText: g
|
|
92
92
|
});
|
|
93
93
|
}, [
|
|
94
94
|
n,
|
|
95
95
|
l,
|
|
96
|
-
|
|
96
|
+
g,
|
|
97
97
|
r,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
]),
|
|
102
|
-
if (!
|
|
98
|
+
b,
|
|
99
|
+
N,
|
|
100
|
+
G
|
|
101
|
+
]), $ = ae || !!h && !h.isValid, i = h && !h.isValid ? h.errorRange : void 0, Oe = E(() => {
|
|
102
|
+
if (!i)
|
|
103
103
|
return /* @__PURE__ */ new Set();
|
|
104
|
-
const e =
|
|
104
|
+
const e = i.start.line, s = i.end?.line ?? e;
|
|
105
105
|
return new Set(
|
|
106
106
|
Array.from(
|
|
107
|
-
{ length: Math.max(
|
|
108
|
-
(ut,
|
|
107
|
+
{ length: Math.max(s - e + 1, 1) },
|
|
108
|
+
(ut, be) => e + be
|
|
109
109
|
)
|
|
110
110
|
);
|
|
111
|
-
}, [
|
|
112
|
-
disabled:
|
|
113
|
-
error:
|
|
114
|
-
isLineCapped:
|
|
111
|
+
}, [i]), t = {
|
|
112
|
+
disabled: I,
|
|
113
|
+
error: $,
|
|
114
|
+
isLineCapped: De,
|
|
115
115
|
isEmpty: r.length === 0,
|
|
116
116
|
isPlaceholderVisible: Se,
|
|
117
|
-
lineHeight:
|
|
118
|
-
maxLines:
|
|
119
|
-
minLines:
|
|
120
|
-
readOnly:
|
|
121
|
-
showLineNumbers:
|
|
117
|
+
lineHeight: Ie,
|
|
118
|
+
maxLines: V,
|
|
119
|
+
minLines: O,
|
|
120
|
+
readOnly: d,
|
|
121
|
+
showLineNumbers: B,
|
|
122
122
|
size: w,
|
|
123
123
|
variant: he,
|
|
124
|
-
visibleLineCount:
|
|
125
|
-
},
|
|
126
|
-
(e) =>
|
|
124
|
+
visibleLineCount: Te
|
|
125
|
+
}, ve = k(
|
|
126
|
+
(e) => $e({
|
|
127
127
|
code: e,
|
|
128
|
-
customLanguages:
|
|
128
|
+
customLanguages: S,
|
|
129
129
|
languageTemplate: n,
|
|
130
|
-
languageText:
|
|
131
|
-
prismTheme:
|
|
132
|
-
syntaxErrorRange:
|
|
130
|
+
languageText: g,
|
|
131
|
+
prismTheme: K,
|
|
132
|
+
syntaxErrorRange: i
|
|
133
133
|
}),
|
|
134
134
|
[
|
|
135
|
-
|
|
135
|
+
S,
|
|
136
136
|
n,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
K,
|
|
138
|
+
g,
|
|
139
|
+
b,
|
|
140
|
+
i
|
|
141
141
|
]
|
|
142
|
-
), Re =
|
|
142
|
+
), Re = k(
|
|
143
143
|
(e) => {
|
|
144
|
-
|
|
144
|
+
m && Y(e), v?.(e);
|
|
145
145
|
},
|
|
146
|
-
[
|
|
146
|
+
[v, m]
|
|
147
|
+
), Ne = k(
|
|
148
|
+
(e) => {
|
|
149
|
+
if (I || e.target instanceof Element && e.target.closest("textarea"))
|
|
150
|
+
return;
|
|
151
|
+
e.currentTarget.querySelector("textarea")?.focus();
|
|
152
|
+
},
|
|
153
|
+
[I]
|
|
147
154
|
);
|
|
148
|
-
return
|
|
149
|
-
|
|
155
|
+
return fe ? /* @__PURE__ */ a(Je, { ownerState: t }) : /* @__PURE__ */ D(
|
|
156
|
+
Qe,
|
|
150
157
|
{
|
|
151
158
|
ownerState: t,
|
|
152
159
|
"aria-disabled": t.disabled || void 0,
|
|
153
|
-
className:
|
|
154
|
-
...
|
|
160
|
+
className: _(C.root, y),
|
|
161
|
+
...x(p, f.root, o),
|
|
155
162
|
children: [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
163
|
+
Z || d ? /* @__PURE__ */ D(We, { ownerState: t, className: C.header, children: [
|
|
164
|
+
Z ? /* @__PURE__ */ a(
|
|
165
|
+
et,
|
|
159
166
|
{
|
|
160
|
-
label:
|
|
167
|
+
label: X,
|
|
161
168
|
size: "small",
|
|
162
169
|
variant: "outlined",
|
|
163
170
|
color: "default",
|
|
164
171
|
startIcon: /* @__PURE__ */ a(
|
|
165
|
-
|
|
172
|
+
tt,
|
|
166
173
|
{
|
|
167
|
-
...
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
...x(
|
|
175
|
+
p,
|
|
176
|
+
f.languageChipIcon,
|
|
177
|
+
Ye
|
|
171
178
|
),
|
|
172
179
|
children: /* @__PURE__ */ a(_e, { fontSize: "small" })
|
|
173
180
|
}
|
|
174
181
|
)
|
|
175
182
|
}
|
|
176
183
|
) : null,
|
|
177
|
-
/* @__PURE__ */ a(
|
|
178
|
-
|
|
184
|
+
/* @__PURE__ */ a(at, { ownerState: t, children: d ? /* @__PURE__ */ a(
|
|
185
|
+
nt,
|
|
179
186
|
{
|
|
180
|
-
label:
|
|
187
|
+
label: xe,
|
|
181
188
|
size: "small"
|
|
182
189
|
}
|
|
183
190
|
) : null })
|
|
184
191
|
] }) : null,
|
|
185
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
192
|
+
/* @__PURE__ */ D(
|
|
193
|
+
rt,
|
|
194
|
+
{
|
|
195
|
+
ownerState: t,
|
|
196
|
+
onClick: Ne,
|
|
197
|
+
...x(p, f.body, o),
|
|
198
|
+
children: [
|
|
199
|
+
B ? /* @__PURE__ */ a(ot, { ownerState: t, "aria-hidden": "true", children: Array.from({ length: q }, (e, s) => s + 1).map(
|
|
200
|
+
(e) => /* @__PURE__ */ a(
|
|
201
|
+
lt,
|
|
202
|
+
{
|
|
203
|
+
ownerState: t,
|
|
204
|
+
"data-code-editor-error-line": Oe.has(e) || void 0,
|
|
205
|
+
children: e
|
|
206
|
+
},
|
|
207
|
+
`code-editor-line-${e}`
|
|
208
|
+
)
|
|
209
|
+
) }) : null,
|
|
210
|
+
/* @__PURE__ */ D(it, { ownerState: t, children: [
|
|
211
|
+
H && t.isEmpty && R ? /* @__PURE__ */ a(
|
|
212
|
+
st,
|
|
213
|
+
{
|
|
214
|
+
ownerState: t,
|
|
215
|
+
...x(
|
|
216
|
+
p,
|
|
217
|
+
f.placeholder,
|
|
218
|
+
o
|
|
219
|
+
),
|
|
220
|
+
children: R
|
|
221
|
+
}
|
|
222
|
+
) : null,
|
|
223
|
+
/* @__PURE__ */ a(
|
|
224
|
+
dt,
|
|
225
|
+
{
|
|
226
|
+
...T,
|
|
227
|
+
ownerState: t,
|
|
228
|
+
"aria-label": T["aria-label"] ?? "Code editor",
|
|
229
|
+
"aria-invalid": T["aria-invalid"] ?? ($ || void 0),
|
|
230
|
+
className: _(C.editor, te),
|
|
231
|
+
"data-testid": ze(
|
|
232
|
+
p,
|
|
233
|
+
f.textarea,
|
|
234
|
+
o
|
|
235
|
+
),
|
|
236
|
+
disabled: I,
|
|
237
|
+
highlight: ve,
|
|
238
|
+
insertSpaces: re,
|
|
239
|
+
onBlur: de,
|
|
240
|
+
onValueChange: Re,
|
|
241
|
+
preClassName: _(C.pre, ce),
|
|
242
|
+
readOnly: d,
|
|
243
|
+
tabSize: T.tabSize,
|
|
244
|
+
textareaClassName: _(
|
|
245
|
+
C.textarea,
|
|
246
|
+
ge
|
|
247
|
+
),
|
|
248
|
+
textareaId: Ce,
|
|
249
|
+
value: r
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
] })
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
)
|
|
241
256
|
]
|
|
242
257
|
}
|
|
243
258
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,eAAO,MAAM,gBAAgB,EAAE,gBA6U9B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getTypographyStyles as d } from "../../../utils/getTypographyStyles.js";
|
|
2
|
-
import { getCodeEditorVSCodeModernPalette as s, CODE_EDITOR_LINE_HEIGHT_BY_SIZE as n, CODE_EDITOR_MONO_FONT_FAMILY as
|
|
2
|
+
import { getCodeEditorVSCodeModernPalette as s, CODE_EDITOR_LINE_HEIGHT_BY_SIZE as n, CODE_EDITOR_MONO_FONT_FAMILY as t, CODE_EDITOR_PADDING_PX as i } from "./constants.js";
|
|
3
3
|
import { getSizeStyles as p } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
4
4
|
const b = {
|
|
5
5
|
/** Resolve the interactive shell colors and focus treatment for the editor root. */
|
|
@@ -115,6 +115,7 @@ const b = {
|
|
|
115
115
|
"&&& .M4LTypography-root": {
|
|
116
116
|
...d(r.generalSettings.isMobile, e?.size || "medium", "microSlim"),
|
|
117
117
|
color: o.surface.languageChipForeground,
|
|
118
|
+
lineHeight: "normal",
|
|
118
119
|
textTransform: "uppercase"
|
|
119
120
|
}
|
|
120
121
|
};
|
|
@@ -155,14 +156,14 @@ const b = {
|
|
|
155
156
|
}),
|
|
156
157
|
/** Build the two-column layout used by the gutter and editor scroller. */
|
|
157
158
|
body: ({ theme: r, ownerState: e }) => {
|
|
158
|
-
const o = e?.visibleLineCount || e?.minLines || 1, a = e?.lineHeight || n.medium,
|
|
159
|
+
const o = e?.visibleLineCount || e?.minLines || 1, a = e?.lineHeight || n.medium, l = e?.isLineCapped ? i : i * 2;
|
|
159
160
|
return {
|
|
160
161
|
display: "grid",
|
|
161
162
|
gridTemplateColumns: e?.showLineNumbers ? "auto minmax(0, 1fr)" : "minmax(0, 1fr)",
|
|
162
163
|
width: "100%",
|
|
163
164
|
alignItems: "start",
|
|
164
165
|
columnGap: 0,
|
|
165
|
-
maxHeight: `${o * a +
|
|
166
|
+
maxHeight: `${o * a + l}px`,
|
|
166
167
|
minHeight: 0,
|
|
167
168
|
overflow: "auto",
|
|
168
169
|
pointerEvents: e?.disabled ? "none" : "auto",
|
|
@@ -182,7 +183,7 @@ const b = {
|
|
|
182
183
|
color: e?.disabled ? o.surface.placeholderForeground : o.surface.lineNumberForeground,
|
|
183
184
|
userSelect: "none",
|
|
184
185
|
...d(r.generalSettings.isMobile, e?.size || "medium", "bodyStandard"),
|
|
185
|
-
fontFamily:
|
|
186
|
+
fontFamily: t,
|
|
186
187
|
lineHeight: `${n[e?.size || "medium"]}px`
|
|
187
188
|
};
|
|
188
189
|
},
|
|
@@ -204,7 +205,8 @@ const b = {
|
|
|
204
205
|
/** Provide horizontal overflow for long code lines without wrapping them. */
|
|
205
206
|
editorScroller: ({ theme: r, ownerState: e }) => ({
|
|
206
207
|
position: "relative",
|
|
207
|
-
width:
|
|
208
|
+
width: "fit-content",
|
|
209
|
+
minWidth: "100%",
|
|
208
210
|
paddingTop: r.vars.size.baseSpacings.sp3,
|
|
209
211
|
paddingBottom: r.vars.size.baseSpacings.sp3,
|
|
210
212
|
paddingRight: r.vars.size.baseSpacings.sp2,
|
|
@@ -213,21 +215,21 @@ const b = {
|
|
|
213
215
|
}),
|
|
214
216
|
/** Style the underlying react-simple-code-editor surface and its inner elements. */
|
|
215
217
|
editor: ({ theme: r, ownerState: e }) => {
|
|
216
|
-
const o = s(r), a = e?.isLineCapped ? 0 : i,
|
|
218
|
+
const o = s(r), a = e?.isLineCapped ? 0 : i, l = i + a;
|
|
217
219
|
return {
|
|
218
220
|
position: "relative",
|
|
219
221
|
zIndex: 0,
|
|
220
222
|
width: "max-content",
|
|
221
223
|
minWidth: "100%",
|
|
222
|
-
minHeight: `calc(${e?.minLines || 1} * ${e?.lineHeight || n.medium}px + ${
|
|
224
|
+
minHeight: `calc(${e?.minLines || 1} * ${e?.lineHeight || n.medium}px + ${l}px)`,
|
|
223
225
|
backgroundColor: "transparent",
|
|
224
|
-
fontFamily:
|
|
226
|
+
fontFamily: t,
|
|
225
227
|
fontSize: "11px",
|
|
226
228
|
lineHeight: `${e?.lineHeight || n.medium}px`,
|
|
227
229
|
fontWeight: 400,
|
|
228
230
|
"& textarea, & pre": {
|
|
229
231
|
...d(r.generalSettings.isMobile, e?.size || "medium", "bodyStandard"),
|
|
230
|
-
fontFamily:
|
|
232
|
+
fontFamily: t,
|
|
231
233
|
lineHeight: `${e?.lineHeight || n.medium}px`,
|
|
232
234
|
whiteSpace: "pre !important",
|
|
233
235
|
wordBreak: "normal",
|
|
@@ -278,7 +280,7 @@ const b = {
|
|
|
278
280
|
pointerEvents: "none",
|
|
279
281
|
color: o.surface.placeholderForeground,
|
|
280
282
|
...d(r.generalSettings.isMobile, e?.size || "medium", "bodyStandard"),
|
|
281
|
-
fontFamily:
|
|
283
|
+
fontFamily: t,
|
|
282
284
|
lineHeight: `${e?.lineHeight || n.medium}px`,
|
|
283
285
|
whiteSpace: "pre-wrap"
|
|
284
286
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.24.0-beta-feature-731-m4l-components-code-editor.
|
|
3
|
+
"version": "9.24.0-beta-feature-731-m4l-components-code-editor.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,19 +53,19 @@
|
|
|
53
53
|
"@hookform/resolvers": "2.9.11",
|
|
54
54
|
"nprogress": "0.2.0",
|
|
55
55
|
"react-transition-group": "4.4.5",
|
|
56
|
+
"react-dropzone": "14.4.1",
|
|
56
57
|
"react-color": "2.19.3",
|
|
57
|
-
"@mui/x-date-pickers": "6.20.2",
|
|
58
58
|
"react-rnd": "10.5.2",
|
|
59
|
+
"@mui/x-date-pickers": "6.20.2",
|
|
60
|
+
"react-draggable": "4.5.0",
|
|
59
61
|
"date-fns": "2.30.0",
|
|
60
|
-
"react-dropzone": "14.4.1",
|
|
61
62
|
"react-spinners": "0.13.8",
|
|
62
|
-
"react-draggable": "4.5.0",
|
|
63
63
|
"chart.js": "4.5.1",
|
|
64
64
|
"chartjs-chart-error-bars": "4.4.5",
|
|
65
65
|
"qrcode.react": "3.2.0",
|
|
66
|
-
"simplebar-react": "3.2.6",
|
|
67
66
|
"react-resizable-panels": "2.1.9",
|
|
68
67
|
"react-simple-code-editor": "0.14.1",
|
|
68
|
+
"simplebar-react": "3.2.6",
|
|
69
69
|
"react-data-grid": "7.0.0-beta.47",
|
|
70
70
|
"react-dnd": "16.0.1",
|
|
71
71
|
"react-dnd-html5-backend": "16.0.1",
|