@m4l/components 9.24.0-beta-feature-731-m4l-components-code-editor.5 → 9.24.0-beta-feature-731-m4l-components-code-editor.6

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.
@@ -3,52 +3,52 @@ import { getCodeEditorVSCodeModernPalette as l, CODE_EDITOR_LINE_HEIGHT_BY_SIZE
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. */
6
- root: ({ theme: r, ownerState: e }) => {
7
- const o = !e?.disabled && !e?.readOnly, a = e?.disabled ? r.vars.palette.border.disabled : r.vars.palette.border.secondary;
6
+ root: ({ theme: e, ownerState: r }) => {
7
+ const o = !r?.disabled && !r?.readOnly, a = r?.disabled ? e.vars.palette.border.disabled : e.vars.palette.border.secondary;
8
8
  return {
9
9
  width: "100%",
10
10
  display: "flex",
11
11
  flexDirection: "column",
12
12
  minHeight: 0,
13
13
  gap: 0,
14
- border: r.vars.size.borderStroke.container,
15
- borderColor: e?.variant === "outlined" || e?.error ? a : "transparent",
16
- borderRadius: r.vars.size.borderRadius["r1-5"],
17
- ...e?.error && {
18
- borderColor: r.vars.palette.error.focus
14
+ border: e.vars.size.borderStroke.container,
15
+ borderColor: r?.variant === "outlined" || r?.error ? a : "transparent",
16
+ borderRadius: e.vars.size.borderRadius["r1-5"],
17
+ ...r?.error && {
18
+ borderColor: e.vars.palette.error.focus
19
19
  },
20
- ...e?.variant === "contained" && {
21
- backgroundColor: r.vars.palette.default.enabledOpacity
20
+ ...r?.variant === "contained" && {
21
+ backgroundColor: e.vars.palette.default.enabledOpacity
22
22
  },
23
- ...e?.variant === "outlined" && {
24
- backgroundColor: r.vars.palette.background.default
23
+ ...r?.variant === "outlined" && {
24
+ backgroundColor: e.vars.palette.background.default
25
25
  },
26
- ...e?.readOnly && {
27
- backgroundColor: `${r.vars.palette.default.enabledOpacity}!important`
26
+ ...r?.readOnly && {
27
+ backgroundColor: `${e.vars.palette.default.enabledOpacity}!important`
28
28
  },
29
29
  overflow: "hidden",
30
- opacity: e?.disabled ? 0.72 : 1,
30
+ opacity: r?.disabled ? 0.72 : 1,
31
31
  outline: "3px solid",
32
32
  outlineColor: "transparent",
33
33
  transition: "border-color 120ms ease, outline 120ms ease, opacity 120ms ease, background-color 120ms ease",
34
34
  ...o && {
35
35
  "&:hover": {
36
- backgroundColor: r.vars.palette.default.hoverOpacity,
37
- ...e?.error && {
38
- borderColor: r.vars.palette.error.active
36
+ backgroundColor: e.vars.palette.default.hoverOpacity,
37
+ ...r?.error && {
38
+ borderColor: e.vars.palette.error.active
39
39
  }
40
40
  },
41
41
  "&:focus-within": {
42
- borderColor: r.vars.palette.primary.enabled,
42
+ borderColor: e.vars.palette.primary.enabled,
43
43
  outline: "3px solid",
44
- outlineColor: e?.error ? r.vars.palette.error.focusOpacity : r.vars.palette.primary.hoverOpacity,
45
- ...e?.error && {
46
- borderColor: r.vars.palette.error.enabled
44
+ outlineColor: r?.error ? e.vars.palette.error.focusOpacity : e.vars.palette.primary.hoverOpacity,
45
+ ...r?.error && {
46
+ borderColor: e.vars.palette.error.enabled
47
47
  },
48
- ...e?.variant === "contained" && {
49
- backgroundColor: r.vars.palette.background.default,
48
+ ...r?.variant === "contained" && {
49
+ backgroundColor: e.vars.palette.background.default,
50
50
  "&&& .M4LCodeEditor-header": {
51
- backgroundColor: r.vars.palette.default.enabledOpacity
51
+ backgroundColor: e.vars.palette.default.enabledOpacity
52
52
  }
53
53
  }
54
54
  }
@@ -56,46 +56,50 @@ const b = {
56
56
  };
57
57
  },
58
58
  /** Layout the language badge row above the editing surface. */
59
- header: ({ theme: r, ownerState: e }) => {
60
- const o = l(r, e?.colorMode);
59
+ header: ({ theme: e, ownerState: r }) => {
60
+ const o = l(
61
+ r?.colorMode
62
+ );
61
63
  return {
62
64
  display: "flex",
63
65
  alignItems: "center",
64
66
  justifyContent: "space-between",
65
- padding: r.vars.size.baseSpacings.sp2,
66
- gap: r.vars.size.baseSpacings.sp2,
67
- borderBottom: r.vars.size.borderStroke.container,
68
- borderColor: r.vars.palette.border.secondary,
69
- ...e?.variant === "contained" && {
67
+ padding: e.vars.size.baseSpacings.sp2,
68
+ gap: e.vars.size.baseSpacings.sp2,
69
+ borderBottom: e.vars.size.borderStroke.container,
70
+ borderColor: e.vars.palette.border.secondary,
71
+ ...r?.variant === "contained" && {
70
72
  backgroundColor: "transparent"
71
73
  },
72
- ...e?.variant === "outlined" && {
73
- backgroundColor: r.vars.palette.background.default
74
+ ...r?.variant === "outlined" && {
75
+ backgroundColor: e.vars.palette.background.default
74
76
  },
75
- ...e?.readOnly && {
76
- backgroundColor: `${r.vars.palette.background.default}!important`
77
+ ...r?.readOnly && {
78
+ backgroundColor: `${e.vars.palette.background.default}!important`
77
79
  },
78
80
  color: o.surface.headerForeground,
79
- borderTopLeftRadius: r.vars.size.borderRadius.r2,
80
- borderTopRightRadius: r.vars.size.borderRadius.r2,
81
+ borderTopLeftRadius: e.vars.size.borderRadius.r2,
82
+ borderTopRightRadius: e.vars.size.borderRadius.r2,
81
83
  overflow: "hidden",
82
84
  minHeight: "33px"
83
85
  };
84
86
  },
85
87
  /** Align any trailing badges rendered in the header row. */
86
- headerBadges: ({ theme: r }) => ({
88
+ headerBadges: ({ theme: e }) => ({
87
89
  display: "flex",
88
90
  alignItems: "center",
89
91
  justifyContent: "flex-end",
90
- gap: r.vars.size.baseSpacings.sp1,
92
+ gap: e.vars.size.baseSpacings.sp1,
91
93
  minWidth: 0,
92
94
  // Keep badges right-aligned even when the language chip is absent and the
93
95
  // badges container is the only child of the header row.
94
96
  marginLeft: "auto"
95
97
  }),
96
98
  /** Keep the leading language chip aligned with the editor header layout. */
97
- languageChip: ({ theme: r, ownerState: e }) => {
98
- const o = l(r, e?.colorMode);
99
+ languageChip: ({ theme: e, ownerState: r }) => {
100
+ const o = l(
101
+ r?.colorMode
102
+ );
99
103
  return {
100
104
  flexShrink: 0,
101
105
  minWidth: 0,
@@ -104,16 +108,16 @@ const b = {
104
108
  paddingTop: 0,
105
109
  paddingBottom: 0,
106
110
  backgroundColor: "transparent",
107
- borderColor: r.vars.palette.chips.default.outlined.backgroundActive,
111
+ borderColor: e.vars.palette.chips.default.outlined.backgroundActive,
108
112
  color: o.surface.languageChipForeground,
109
113
  ...p(
110
- r,
111
- e?.size || "medium",
114
+ e,
115
+ r?.size || "medium",
112
116
  "base",
113
117
  (a) => ({ height: a })
114
118
  ),
115
119
  "&&& .M4LTypography-root": {
116
- ...d(r.generalSettings.isMobile, e?.size || "medium", "microSlim"),
120
+ ...d(e.generalSettings.isMobile, r?.size || "medium", "microSlim"),
117
121
  color: o.surface.languageChipForeground,
118
122
  lineHeight: "normal",
119
123
  textTransform: "uppercase"
@@ -135,66 +139,70 @@ const b = {
135
139
  }
136
140
  }),
137
141
  /** Keep the read-only chip aligned with the trailing header actions. */
138
- readOnlyChip: ({ theme: r, ownerState: e }) => ({
142
+ readOnlyChip: ({ theme: e, ownerState: r }) => ({
139
143
  "&&&": {
140
144
  flexShrink: 0,
141
145
  minWidth: 0,
142
146
  whiteSpace: "nowrap",
143
147
  ...p(
144
- r,
145
- e?.size || "medium",
148
+ e,
149
+ r?.size || "medium",
146
150
  "base",
147
151
  (o) => ({ height: o })
148
152
  ),
149
153
  "&&& .M4LTypography-root": {
150
- ...d(r.generalSettings.isMobile, e?.size || "medium", "microSlim"),
151
- color: r.vars.palette.chips.info.contained.color
154
+ ...d(e.generalSettings.isMobile, r?.size || "medium", "microSlim"),
155
+ color: e.vars.palette.chips.info.contained.color
152
156
  },
153
- backgroundColor: r.vars.palette.chips.info.contained.backgroundColor,
157
+ backgroundColor: e.vars.palette.chips.info.contained.backgroundColor,
154
158
  borderColor: "transparent"
155
159
  }
156
160
  }),
157
161
  /** Build the two-column layout used by the gutter and editor scroller. */
158
- body: ({ theme: r, ownerState: e }) => {
159
- const o = e?.visibleLineCount || e?.minLines || 1, a = e?.lineHeight || n.medium, t = e?.isLineCapped ? i : i * 2;
162
+ body: ({ theme: e, ownerState: r }) => {
163
+ const o = r?.visibleLineCount || r?.minLines || 1, a = r?.lineHeight || n.medium, t = r?.isLineCapped ? i : i * 2;
160
164
  return {
161
165
  display: "grid",
162
- gridTemplateColumns: e?.showLineNumbers ? "auto minmax(0, 1fr)" : "minmax(0, 1fr)",
166
+ gridTemplateColumns: r?.showLineNumbers ? "auto minmax(0, 1fr)" : "minmax(0, 1fr)",
163
167
  width: "100%",
164
168
  alignItems: "start",
165
169
  columnGap: 0,
166
170
  maxHeight: `${o * a + t}px`,
167
171
  minHeight: 0,
168
172
  overflow: "auto",
169
- pointerEvents: e?.disabled ? "none" : "auto",
170
- userSelect: e?.disabled ? "none" : "auto",
171
- gap: r.vars.size.baseSpacings.sp2
173
+ pointerEvents: r?.disabled ? "none" : "auto",
174
+ userSelect: r?.disabled ? "none" : "auto",
175
+ gap: e.vars.size.baseSpacings.sp2
172
176
  };
173
177
  },
174
178
  /** Style the optional line-number gutter. */
175
- lineNumbers: ({ theme: r, ownerState: e }) => {
176
- const o = l(r, e?.colorMode);
179
+ lineNumbers: ({ theme: e, ownerState: r }) => {
180
+ const o = l(
181
+ r?.colorMode
182
+ );
177
183
  return {
178
184
  display: "flex",
179
185
  flexDirection: "column",
180
186
  alignItems: "flex-end",
181
- padding: `${i}px ${r.vars.size.baseSpacings.sp1} ${e?.isLineCapped ? 0 : i}px ${r.vars.size.baseSpacings.sp2}`,
187
+ padding: `${i}px ${e.vars.size.baseSpacings.sp1} ${r?.isLineCapped ? 0 : i}px ${e.vars.size.baseSpacings.sp2}`,
182
188
  backgroundColor: "transparent",
183
- color: e?.disabled ? o.surface.placeholderForeground : o.surface.lineNumberForeground,
189
+ color: r?.disabled ? o.surface.placeholderForeground : o.surface.lineNumberForeground,
184
190
  userSelect: "none",
185
- ...d(r.generalSettings.isMobile, e?.size || "medium", "bodyStandard"),
191
+ ...d(e.generalSettings.isMobile, r?.size || "medium", "bodyStandard"),
186
192
  fontFamily: s,
187
- lineHeight: `${n[e?.size || "medium"]}px`
193
+ lineHeight: `${n[r?.size || "medium"]}px`
188
194
  };
189
195
  },
190
196
  /** Keep each rendered line number aligned with the code line height. */
191
- lineNumber: ({ theme: r, ownerState: e }) => {
192
- const o = l(r, e?.colorMode);
197
+ lineNumber: ({ theme: e, ownerState: r }) => {
198
+ const o = l(
199
+ r?.colorMode
200
+ );
193
201
  return {
194
202
  display: "block",
195
203
  minWidth: "2ch",
196
- height: `${e?.lineHeight || n.medium}px`,
197
- lineHeight: `${e?.lineHeight || n.medium}px`,
204
+ height: `${r?.lineHeight || n.medium}px`,
205
+ lineHeight: `${r?.lineHeight || n.medium}px`,
198
206
  textAlign: "right",
199
207
  '&[data-code-editor-error-line="true"]': {
200
208
  color: o.surface.errorBorderColor,
@@ -203,34 +211,36 @@ const b = {
203
211
  };
204
212
  },
205
213
  /** Provide horizontal overflow for long code lines without wrapping them. */
206
- editorScroller: ({ theme: r }) => ({
214
+ editorScroller: ({ theme: e }) => ({
207
215
  position: "relative",
208
216
  width: "fit-content",
209
217
  minWidth: "100%",
210
- paddingTop: r.vars.size.baseSpacings.sp3,
211
- paddingBottom: r.vars.size.baseSpacings.sp3,
212
- paddingRight: r.vars.size.baseSpacings.sp2,
213
- paddingLeft: r.vars.size.baseSpacings.sp2,
218
+ paddingTop: e.vars.size.baseSpacings.sp3,
219
+ paddingBottom: e.vars.size.baseSpacings.sp3,
220
+ paddingRight: e.vars.size.baseSpacings.sp2,
221
+ paddingLeft: e.vars.size.baseSpacings.sp2,
214
222
  backgroundColor: "transparent"
215
223
  }),
216
224
  /** Style the underlying react-simple-code-editor surface and its inner elements. */
217
- editor: ({ theme: r, ownerState: e }) => {
218
- const o = l(r, e?.colorMode), a = e?.isLineCapped ? 0 : i, t = i + a;
225
+ editor: ({ theme: e, ownerState: r }) => {
226
+ const o = l(
227
+ r?.colorMode
228
+ ), a = r?.isLineCapped ? 0 : i, t = i + a;
219
229
  return {
220
230
  position: "relative",
221
231
  zIndex: 0,
222
232
  width: "max-content",
223
233
  minWidth: "100%",
224
- minHeight: `calc(${e?.minLines || 1} * ${e?.lineHeight || n.medium}px + ${t}px)`,
234
+ minHeight: `calc(${r?.minLines || 1} * ${r?.lineHeight || n.medium}px + ${t}px)`,
225
235
  backgroundColor: "transparent",
226
236
  fontFamily: s,
227
237
  fontSize: "11px",
228
- lineHeight: `${e?.lineHeight || n.medium}px`,
238
+ lineHeight: `${r?.lineHeight || n.medium}px`,
229
239
  fontWeight: 400,
230
240
  "& textarea, & pre": {
231
- ...d(r.generalSettings.isMobile, e?.size || "medium", "bodyStandard"),
241
+ ...d(e.generalSettings.isMobile, r?.size || "medium", "bodyStandard"),
232
242
  fontFamily: s,
233
- lineHeight: `${e?.lineHeight || n.medium}px`,
243
+ lineHeight: `${r?.lineHeight || n.medium}px`,
234
244
  whiteSpace: "pre !important",
235
245
  wordBreak: "normal",
236
246
  overflowWrap: "normal",
@@ -244,17 +254,17 @@ const b = {
244
254
  backgroundColor: "transparent"
245
255
  },
246
256
  "&&& textarea": {
247
- ...d(r.generalSettings.isMobile, e?.size || "medium", "microSlim"),
257
+ ...d(e.generalSettings.isMobile, r?.size || "medium", "microSlim"),
248
258
  outline: "none",
249
259
  backgroundColor: "transparent",
250
- caretColor: e?.disabled ? "transparent" : o.surface.caretForeground,
251
- cursor: e?.disabled ? "not-allowed" : e?.readOnly ? "default" : "text",
260
+ caretColor: r?.disabled ? "transparent" : o.surface.caretForeground,
261
+ cursor: r?.disabled ? "not-allowed" : r?.readOnly ? "default" : "text",
252
262
  "&::selection": {
253
263
  backgroundColor: o.surface.selectionBackground
254
264
  }
255
265
  },
256
266
  "& pre": {
257
- color: e?.disabled ? o.surface.placeholderForeground : o.surface.editorForeground
267
+ color: r?.disabled ? o.surface.placeholderForeground : o.surface.editorForeground
258
268
  },
259
269
  "& .token-line": {
260
270
  display: "block",
@@ -270,8 +280,10 @@ const b = {
270
280
  };
271
281
  },
272
282
  /** Position the empty-state placeholder above the editor surface. */
273
- placeholder: ({ theme: r, ownerState: e }) => {
274
- const o = l(r, e?.colorMode);
283
+ placeholder: ({ theme: e, ownerState: r }) => {
284
+ const o = l(
285
+ r?.colorMode
286
+ );
275
287
  return {
276
288
  position: "absolute",
277
289
  zIndex: 1,
@@ -279,16 +291,16 @@ const b = {
279
291
  left: `${i}px`,
280
292
  pointerEvents: "none",
281
293
  color: o.surface.placeholderForeground,
282
- ...d(r.generalSettings.isMobile, e?.size || "medium", "bodyStandard"),
294
+ ...d(e.generalSettings.isMobile, r?.size || "medium", "bodyStandard"),
283
295
  fontFamily: s,
284
- lineHeight: `${e?.lineHeight || n.medium}px`,
296
+ lineHeight: `${r?.lineHeight || n.medium}px`,
285
297
  whiteSpace: "pre-wrap"
286
298
  };
287
299
  },
288
300
  /** Size the skeleton block to the same footprint as the live editor. */
289
- skeleton: ({ theme: r }) => ({
301
+ skeleton: ({ theme: e }) => ({
290
302
  "&&&": {
291
- borderRadius: r.vars.size.borderRadius.r1,
303
+ borderRadius: e.vars.size.borderRadius.r1,
292
304
  width: "100%",
293
305
  height: "100px"
294
306
  }
@@ -1,4 +1,4 @@
1
- import { Theme } from '@mui/material';
1
+ type CodeEditorVSCodeModernMode = 'dark' | 'light';
2
2
  type CodeEditorVSCodeModernSurfacePalette = {
3
3
  activeIndentGuideForeground: string;
4
4
  borderColor: string;
@@ -76,7 +76,7 @@ export declare const CODE_EDITOR_FALLBACK_LANGUAGE_ICON: import('@mui/material/O
76
76
  muiName: string;
77
77
  };
78
78
  /** Resolve the exact VS Code Modern palette for the current light or dark theme mode. */
79
- export declare function getCodeEditorVSCodeModernPalette(theme: Theme, modeOverride?: Theme['palette']['mode']): CodeEditorVSCodeModernPalette;
79
+ export declare function getCodeEditorVSCodeModernPalette(mode?: CodeEditorVSCodeModernMode): CodeEditorVSCodeModernPalette;
80
80
  export declare const CODE_EDITOR_CLASSES: Record<"root" | "skeleton" | "body" | "header" | "pre" | "textarea" | "placeholder" | "headerBadges" | "languageChip" | "languageChipIcon" | "readOnlyChip" | "lineNumbers" | "lineNumber" | "editorScroller" | "editor", string>;
81
81
  export {};
82
82
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAS3C,KAAK,oCAAoC,GAAG;IAC1C,2BAA2B,EAAE,MAAM,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,2BAA2B,EAAE,MAAM,CAAC;IACpC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0BAA0B,EAAE,MAAM,CAAC;IACnC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAg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M,CAW/D,CAAC;AAEF,eAAO,MAAM,kCAAkC;;CAAyB,CAAC;AAEzE,yFAAyF;AACzF,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,KAAK,EACZ,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GACtC,6BAA6B,CAM/B;AAED,eAAO,MAAM,mBAAmB,mOAG/B,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/constants.ts"],"names":[],"mappings":"AAMA,KAAK,0BAA0B,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD,KAAK,oCAAoC,GAAG;IAC1C,2BAA2B,EAAE,MAAM,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,2BAA2B,EAAE,MAAM,CAAC;IACpC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0BAA0B,EAAE,MAAM,CAAC;IACnC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAs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eAAO,MAAM,8BAA8B;;;;;CAKjC,CAAC;AACX,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAW/D,CAAC;AAEF,eAAO,MAAM,kCAAkC;;CAAyB,CAAC;AAEzE,yFAAyF;AACzF,wBAAgB,gCAAgC,CAC9C,IAAI,GAAE,0BAAoC,GACzC,6BAA6B,CAE/B;AAED,eAAO,MAAM,mBAAmB,mOAG/B,CAAC"}
@@ -1,7 +1,7 @@
1
- import { FileFolderFileOutlined as a } from "@m4l/icons";
2
- import { getComponentClasses as t } from "../../../utils/getComponentSlotRoot.js";
3
- import { CodeEditorSlots as C } from "./slots/CodeEditorEnum.js";
4
- const d = {
1
+ import { FileFolderFileOutlined as e } from "@m4l/icons";
2
+ import { getComponentClasses as n } from "../../../utils/getComponentSlotRoot.js";
3
+ import { CodeEditorSlots as a } from "./slots/CodeEditorEnum.js";
4
+ const t = {
5
5
  dark: {
6
6
  bracketPalette: ["#FFD700", "#DA70D6", "#179FFF"],
7
7
  surface: {
@@ -100,15 +100,15 @@ const d = {
100
100
  variable: "#001080"
101
101
  }
102
102
  }
103
- }, E = "M4LCodeEditor", g = "text", u = 4, D = 10, _ = 12, B = {
103
+ }, C = "M4LCodeEditor", c = "text", i = 4, g = 10, u = 12, D = {
104
104
  small: 18,
105
105
  medium: 20
106
- }, s = '"Geist Mono", "JetBrains Mono", "Cascadia Code", "Liberation Mono", monospace', l = "Read Only", r = "at-commands", A = "at-basic", O = "AT Commands", T = "CodeEditorLanguageChipIcon", m = {
106
+ }, _ = '"Geist Mono", "JetBrains Mono", "Cascadia Code", "Liberation Mono", monospace', B = "Read Only", r = "at-commands", s = "at-basic", l = "AT Commands", A = "CodeEditorLanguageChipIcon", O = {
107
107
  commandPrefixes: ["AT+", "+"],
108
108
  concatenationSeparators: [";"],
109
109
  argumentSeparators: [","],
110
110
  reservedWords: ["SET", "INFO", "SAVE", "CLEAR"]
111
- }, p = {
111
+ }, T = {
112
112
  js: "javascript",
113
113
  jsx: "jsx",
114
114
  ts: "typescript",
@@ -119,31 +119,30 @@ const d = {
119
119
  yml: "yaml",
120
120
  at: r,
121
121
  "telemetry-at": r
122
- }, I = a;
123
- function L(o, e) {
124
- const n = (e ?? o.palette.mode) === "dark" ? "dark" : "light";
125
- return d[n];
122
+ }, I = e;
123
+ function p(o = "light") {
124
+ return t[o];
126
125
  }
127
- const h = t(
128
- E,
129
- C
126
+ const m = n(
127
+ C,
128
+ a
130
129
  );
131
130
  export {
132
131
  r as CODE_EDITOR_AT_LANGUAGE,
133
- O as CODE_EDITOR_AT_TEMPLATE_LANGUAGE_LABEL,
134
- A as CODE_EDITOR_AT_TEMPLATE_NAME,
135
- m as CODE_EDITOR_AT_TEMPLATE_TOKENS,
136
- h as CODE_EDITOR_CLASSES,
137
- g as CODE_EDITOR_DEFAULT_LANGUAGE,
138
- D as CODE_EDITOR_DEFAULT_MAX_LINES,
139
- u as CODE_EDITOR_DEFAULT_MIN_LINES,
132
+ l as CODE_EDITOR_AT_TEMPLATE_LANGUAGE_LABEL,
133
+ s as CODE_EDITOR_AT_TEMPLATE_NAME,
134
+ O as CODE_EDITOR_AT_TEMPLATE_TOKENS,
135
+ m as CODE_EDITOR_CLASSES,
136
+ c as CODE_EDITOR_DEFAULT_LANGUAGE,
137
+ g as CODE_EDITOR_DEFAULT_MAX_LINES,
138
+ i as CODE_EDITOR_DEFAULT_MIN_LINES,
140
139
  I as CODE_EDITOR_FALLBACK_LANGUAGE_ICON,
141
- E as CODE_EDITOR_KEY_COMPONENT,
142
- p as CODE_EDITOR_LANGUAGE_ALIASES,
143
- T as CODE_EDITOR_LANGUAGE_CHIP_ICON_INSTANCE_ID,
144
- B as CODE_EDITOR_LINE_HEIGHT_BY_SIZE,
145
- s as CODE_EDITOR_MONO_FONT_FAMILY,
146
- _ as CODE_EDITOR_PADDING_PX,
147
- l as CODE_EDITOR_READ_ONLY_LABEL,
148
- L as getCodeEditorVSCodeModernPalette
140
+ C as CODE_EDITOR_KEY_COMPONENT,
141
+ T as CODE_EDITOR_LANGUAGE_ALIASES,
142
+ A as CODE_EDITOR_LANGUAGE_CHIP_ICON_INSTANCE_ID,
143
+ D as CODE_EDITOR_LINE_HEIGHT_BY_SIZE,
144
+ _ as CODE_EDITOR_MONO_FONT_FAMILY,
145
+ u as CODE_EDITOR_PADDING_PX,
146
+ B as CODE_EDITOR_READ_ONLY_LABEL,
147
+ p as getCodeEditorVSCodeModernPalette
149
148
  };
@@ -1,5 +1,4 @@
1
1
  import { ReactElement } from 'react';
2
- import { Theme } from '@mui/material';
3
2
  import { default as Prism } from 'prismjs';
4
3
  import { PrismTheme } from 'prism-react-renderer';
5
4
  import { CodeEditorCustomLanguages, CodeEditorLezerSyntaxValidatorOptions, CodeEditorLanguageTemplate, CodeEditorLanguageTemplateInput, CodeEditorRuntimeDependency, HighlightCodeOptions, CodeEditorSyntaxValidationContext, CodeEditorSyntaxValidator, CodeEditorSyntaxValidationResult } from '../types';
@@ -51,7 +50,7 @@ export declare function getCodeEditorLineCount(value: string): number;
51
50
  /**
52
51
  * Build the Prism theme used by CodeEditor from the exact VS Code Modern palettes.
53
52
  */
54
- export declare function createCodeEditorPrismTheme(theme: Theme, modeOverride?: Theme['palette']['mode']): PrismTheme;
53
+ export declare function createCodeEditorPrismTheme(colorMode?: 'dark' | 'light'): PrismTheme;
55
54
  /**
56
55
  * Render the highlighted code tree consumed by react-simple-code-editor.
57
56
  */
@@ -1 +1 @@
1
- {"version":3,"file":"highlighting.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/helpers/highlighting.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;A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,mBAAmB,CAAC,EAAE,2BAA2B,GAAG,2BAA2B,EAAE,GAChF,OAAO,CAAC,IAAI,CAAC,CAsBf;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,CAAC,EAAE,yBAAyB,GAC1C,IAAI,CAQN;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAKR;AAmqBD,qGAAqG;AACrG,wBAAgB,wBAAwB,CAAC,EACvC,IAAI,EACJ,gBAAgB,EAChB,YAAY,GACb,EAAE,iCAAiC,GAAG,gCAAgC,CAkBtE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5D;AA+HD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,KAAK,EACZ,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GACtC,UAAU,CAiIZ;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,gBAAgB,GACjB,EAAE,oBAAoB,GAAG,YAAY,CA6QrC"}
1
+ {"version":3,"file":"highlighting.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/helpers/highlighting.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAUjF,OAAO,KAAK,EACV,yBAAyB,EAEzB,qCAAqC,EACrC,0BAA0B,EAC1B,+BAA+B,EAC/B,2BAA2B,EAC3B,oBAAoB,EAGpB,iCAAiC,EACjC,yBAAyB,EACzB,gCAAgC,EACjC,MAAM,UAAU,CAAC;AA2GlB,eAAO,MAAM,wCAAw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