@m4l/components 9.25.1-beta-feature-731-code-editor.1 → 9.25.1

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 (54) hide show
  1. package/@types/types.d.ts +0 -11
  2. package/components/MFIsolationApp/MFIsolationApp.d.ts.map +1 -1
  3. package/components/MFIsolationApp/MFIsolationApp.js +76 -80
  4. package/components/extended/index.d.ts +0 -1
  5. package/components/extended/index.d.ts.map +1 -1
  6. package/components/hook-form/index.d.ts +0 -1
  7. package/components/hook-form/index.d.ts.map +1 -1
  8. package/index.d.ts +1 -1
  9. package/index.d.ts.map +1 -1
  10. package/index.js +559 -572
  11. package/package.json +6 -9
  12. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts +0 -5
  13. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts.map +0 -1
  14. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.js +0 -14
  15. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts +0 -2
  16. package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts.map +0 -1
  17. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts +0 -6
  18. package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +0 -1
  19. package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +0 -380
  20. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts +0 -3
  21. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +0 -1
  22. package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +0 -344
  23. package/components/extended/ReactSimpleCodeEditor/constants.d.ts +0 -83
  24. package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +0 -1
  25. package/components/extended/ReactSimpleCodeEditor/constants.js +0 -149
  26. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +0 -12
  27. package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +0 -1
  28. package/components/extended/ReactSimpleCodeEditor/dictionary.js +0 -8
  29. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts +0 -58
  30. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts.map +0 -1
  31. package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.js +0 -1063
  32. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts +0 -6
  33. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts.map +0 -1
  34. package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.js +0 -7
  35. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts +0 -6
  36. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts.map +0 -1
  37. package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.js +0 -9
  38. package/components/extended/ReactSimpleCodeEditor/index.d.ts +0 -4
  39. package/components/extended/ReactSimpleCodeEditor/index.d.ts.map +0 -1
  40. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +0 -20
  41. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +0 -1
  42. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +0 -4
  43. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +0 -90
  44. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +0 -1
  45. package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +0 -73
  46. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts +0 -3
  47. package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts.map +0 -1
  48. package/components/extended/ReactSimpleCodeEditor/types.d.ts +0 -460
  49. package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +0 -1
  50. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts +0 -7
  51. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts.map +0 -1
  52. package/components/hook-form/RHFCodeEditor/RHFCodeEditor.js +0 -6
  53. package/components/hook-form/RHFCodeEditor/index.d.ts +0 -3
  54. package/components/hook-form/RHFCodeEditor/index.d.ts.map +0 -1
@@ -1,344 +0,0 @@
1
- import { getTypographyStyles as n } from "../../../utils/getTypographyStyles.js";
2
- import { getCodeEditorVSCodeModernPalette as l, CODE_EDITOR_LINE_HEIGHT_BY_SIZE as a, CODE_EDITOR_MONO_FONT_FAMILY as t, CODE_EDITOR_PADDING_PX as i } from "./constants.js";
3
- import { getSizeStyles as s } from "../../../utils/getSizeStyles/getSizeStyles.js";
4
- const b = {
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, d = e?.disabled ? r.vars.palette.border.disabled : r.vars.palette.border.secondary;
8
- return {
9
- boxSizing: "border-box",
10
- width: "100%",
11
- display: "flex",
12
- flexDirection: "column",
13
- minHeight: 0,
14
- gap: 0,
15
- border: r.vars.size.borderStroke.container,
16
- borderColor: e?.variant === "outlined" || e?.error ? d : "transparent",
17
- borderRadius: r.vars.size.borderRadius["r1-5"],
18
- ...e?.error && {
19
- borderColor: r.vars.palette.error.focus
20
- },
21
- ...e?.variant === "contained" && {
22
- backgroundColor: r.vars.palette.default.enabledOpacity
23
- },
24
- ...e?.variant === "outlined" && {
25
- backgroundColor: r.vars.palette.background.default
26
- },
27
- ...e?.readOnly && {
28
- backgroundColor: `${r.vars.palette.default.enabledOpacity}!important`
29
- },
30
- overflow: "hidden",
31
- opacity: e?.disabled ? 0.72 : 1,
32
- outline: "3px solid",
33
- outlineColor: "transparent",
34
- transition: "border-color 120ms ease, outline 120ms ease, opacity 120ms ease, background-color 120ms ease",
35
- ...o && {
36
- "&:hover": {
37
- backgroundColor: r.vars.palette.default.hoverOpacity,
38
- ...e?.error && {
39
- borderColor: r.vars.palette.error.active
40
- }
41
- },
42
- "&:focus-within": {
43
- borderColor: r.vars.palette.primary.enabled,
44
- outline: "3px solid",
45
- outlineColor: e?.error ? r.vars.palette.error.focusOpacity : r.vars.palette.primary.hoverOpacity,
46
- ...e?.error && {
47
- borderColor: r.vars.palette.error.enabled
48
- },
49
- ...e?.variant === "contained" && {
50
- backgroundColor: r.vars.palette.background.default,
51
- "&&& .M4LCodeEditor-header": {
52
- backgroundColor: r.vars.palette.default.enabledOpacity
53
- }
54
- }
55
- }
56
- }
57
- };
58
- },
59
- /** Layout the language badge row above the editing surface. */
60
- header: ({ theme: r, ownerState: e }) => {
61
- const o = l(
62
- e?.colorMode
63
- );
64
- return {
65
- display: "flex",
66
- alignItems: "center",
67
- justifyContent: "space-between",
68
- padding: r.vars.size.baseSpacings.sp2,
69
- gap: r.vars.size.baseSpacings.sp2,
70
- borderBottom: r.vars.size.borderStroke.container,
71
- borderColor: r.vars.palette.border.secondary,
72
- ...e?.variant === "contained" && {
73
- backgroundColor: "transparent"
74
- },
75
- ...e?.variant === "outlined" && {
76
- backgroundColor: r.vars.palette.background.default
77
- },
78
- ...e?.readOnly && {
79
- backgroundColor: `${r.vars.palette.background.default}!important`
80
- },
81
- color: o.surface.headerForeground,
82
- borderTopLeftRadius: r.vars.size.borderRadius.r2,
83
- borderTopRightRadius: r.vars.size.borderRadius.r2,
84
- minWidth: 0,
85
- overflow: "hidden",
86
- minHeight: "33px"
87
- };
88
- },
89
- /** Align any trailing badges rendered in the header row. */
90
- headerBadges: ({ theme: r }) => ({
91
- display: "flex",
92
- alignItems: "center",
93
- justifyContent: "flex-end",
94
- gap: r.vars.size.baseSpacings.sp1,
95
- minWidth: 0,
96
- maxWidth: "100%",
97
- overflow: "hidden",
98
- // Keep badges right-aligned even when the language chip is absent and the
99
- // badges container is the only child of the header row.
100
- marginLeft: "auto"
101
- }),
102
- /** Keep the leading language chip aligned with the editor header layout. */
103
- languageChip: ({ theme: r, ownerState: e }) => {
104
- const o = l(
105
- e?.colorMode
106
- );
107
- return {
108
- flex: "1 1 auto",
109
- minWidth: 0,
110
- maxWidth: "fit-content",
111
- overflow: "hidden",
112
- whiteSpace: "nowrap",
113
- textTransform: "lowercase",
114
- paddingTop: 0,
115
- paddingBottom: 0,
116
- backgroundColor: "transparent",
117
- borderColor: r.vars.palette.chips.default.outlined.backgroundActive,
118
- color: o.surface.languageChipForeground,
119
- ...s(
120
- r,
121
- e?.size || "medium",
122
- "base",
123
- (d) => ({ height: d })
124
- ),
125
- "&&& .M4LTypography-root": {
126
- ...n(r.generalSettings.isMobile, e?.size || "medium", "microSlim"),
127
- color: o.surface.languageChipForeground,
128
- lineHeight: "normal",
129
- overflow: "hidden",
130
- textOverflow: "ellipsis",
131
- whiteSpace: "nowrap",
132
- textTransform: "uppercase"
133
- }
134
- };
135
- },
136
- /** Keep the language icon aligned while preserving any intrinsic Seti fill colors. */
137
- languageChipIcon: () => ({
138
- display: "inline-flex",
139
- flexShrink: 0,
140
- width: "16px",
141
- height: "16px",
142
- lineHeight: 0,
143
- "& .MuiSvgIcon-root": {
144
- display: "block",
145
- width: "16px",
146
- height: "16px",
147
- fontSize: "16px"
148
- }
149
- }),
150
- /** Keep the read-only chip aligned with the trailing header actions. */
151
- readOnlyChip: ({ theme: r, ownerState: e }) => ({
152
- "&&&": {
153
- flexShrink: 0,
154
- minWidth: 0,
155
- maxWidth: "100%",
156
- overflow: "hidden",
157
- whiteSpace: "nowrap",
158
- ...s(
159
- r,
160
- e?.size || "medium",
161
- "base",
162
- (o) => ({ height: o })
163
- ),
164
- "&&& .M4LTypography-root": {
165
- ...n(r.generalSettings.isMobile, e?.size || "medium", "microSlim"),
166
- color: r.vars.palette.chips.info.contained.color,
167
- overflow: "hidden",
168
- textOverflow: "ellipsis",
169
- whiteSpace: "nowrap"
170
- },
171
- backgroundColor: r.vars.palette.chips.info.contained.backgroundColor,
172
- borderColor: "transparent"
173
- }
174
- }),
175
- /** Keep the line-number toggle aligned with the header title area. */
176
- lineNumbersToggle: () => ({
177
- flexShrink: 0
178
- }),
179
- /** Provide the native CSS resize shell that owns the editor body viewport. */
180
- bodyResizeShell: ({ ownerState: r }) => ({
181
- boxSizing: "border-box",
182
- width: "100%",
183
- minWidth: 0,
184
- maxWidth: "100%",
185
- overflow: "hidden",
186
- flexShrink: 0,
187
- display: "flex",
188
- flexDirection: "column",
189
- resize: r?.resizable && !r?.disabled ? "vertical" : "none",
190
- pointerEvents: r?.disabled ? "none" : "auto",
191
- userSelect: r?.disabled ? "none" : "auto"
192
- }),
193
- /** Build the two-column layout used by the gutter and editor scroller. */
194
- body: ({ theme: r, ownerState: e }) => ({
195
- boxSizing: "border-box",
196
- display: "grid",
197
- flex: "1 1 auto",
198
- height: "100%",
199
- gridTemplateColumns: e?.showLineNumbers ? "auto minmax(0, 1fr)" : "minmax(0, 1fr)",
200
- width: "100%",
201
- maxWidth: "100%",
202
- alignItems: "start",
203
- columnGap: 0,
204
- minHeight: 0,
205
- overflow: "auto",
206
- pointerEvents: e?.disabled ? "none" : "auto",
207
- userSelect: e?.disabled ? "none" : "auto",
208
- gap: r.vars.size.baseSpacings.sp2
209
- }),
210
- /** Style the optional line-number gutter. */
211
- lineNumbers: ({ theme: r, ownerState: e }) => {
212
- const o = l(
213
- e?.colorMode
214
- );
215
- return {
216
- display: "flex",
217
- flexDirection: "column",
218
- alignItems: "flex-end",
219
- padding: `${i}px ${r.vars.size.baseSpacings.sp1} ${e?.isLineCapped ? 0 : i}px ${r.vars.size.baseSpacings.sp2}`,
220
- backgroundColor: "transparent",
221
- color: e?.disabled ? o.surface.placeholderForeground : o.surface.lineNumberForeground,
222
- userSelect: "none",
223
- ...n(r.generalSettings.isMobile, e?.size || "medium", "bodyStandard"),
224
- fontFamily: t,
225
- lineHeight: `${a[e?.size || "medium"]}px`
226
- };
227
- },
228
- /** Keep each rendered line number aligned with the code line height. */
229
- lineNumber: ({ theme: r, ownerState: e }) => {
230
- const o = l(
231
- e?.colorMode
232
- );
233
- return {
234
- display: "block",
235
- minWidth: "2ch",
236
- height: `${e?.lineHeight || a.medium}px`,
237
- lineHeight: `${e?.lineHeight || a.medium}px`,
238
- textAlign: "right",
239
- color: r.vars.palette.text.disabled,
240
- '&[data-code-editor-error-line="true"]': {
241
- color: o.surface.errorBorderColor,
242
- borderLeft: `1px solid ${o.surface.errorBorderColor}`
243
- }
244
- };
245
- },
246
- /** Provide horizontal overflow for long code lines without wrapping them. */
247
- editorScroller: ({ theme: r }) => ({
248
- position: "relative",
249
- width: "fit-content",
250
- minWidth: "100%",
251
- paddingTop: r.vars.size.baseSpacings.sp3,
252
- paddingBottom: r.vars.size.baseSpacings.sp3,
253
- paddingRight: r.vars.size.baseSpacings.sp2,
254
- paddingLeft: r.vars.size.baseSpacings.sp2,
255
- backgroundColor: "transparent"
256
- }),
257
- /** Style the underlying react-simple-code-editor surface and its inner elements. */
258
- editor: ({ theme: r, ownerState: e }) => {
259
- const o = l(
260
- e?.colorMode
261
- ), d = e?.isLineCapped ? 0 : i, p = i + d;
262
- return {
263
- position: "relative",
264
- zIndex: 0,
265
- width: "max-content",
266
- minWidth: "100%",
267
- minHeight: `calc(${e?.minLines || 1} * ${e?.lineHeight || a.medium}px + ${p}px)`,
268
- backgroundColor: "transparent",
269
- fontFamily: t,
270
- fontSize: "11px",
271
- lineHeight: `${e?.lineHeight || a.medium}px`,
272
- fontWeight: 400,
273
- "& textarea, & pre": {
274
- ...n(r.generalSettings.isMobile, e?.size || "medium", "bodyStandard"),
275
- fontFamily: t,
276
- lineHeight: `${e?.lineHeight || a.medium}px`,
277
- whiteSpace: "pre !important",
278
- wordBreak: "normal",
279
- overflowWrap: "normal",
280
- margin: 0,
281
- paddingTop: `${i}px`,
282
- paddingRight: `${i}px`,
283
- paddingBottom: `${d}px`,
284
- paddingLeft: `${i}px`,
285
- tabSize: 2,
286
- fontVariantLigatures: "none",
287
- backgroundColor: "transparent"
288
- },
289
- "&&& textarea": {
290
- ...n(r.generalSettings.isMobile, e?.size || "medium", "microSlim"),
291
- outline: "none",
292
- backgroundColor: "transparent",
293
- caretColor: e?.disabled ? "transparent" : o.surface.caretForeground,
294
- cursor: e?.disabled ? "not-allowed" : e?.readOnly ? "default" : "text",
295
- "&::selection": {
296
- backgroundColor: o.surface.selectionBackground
297
- }
298
- },
299
- "& pre": {
300
- color: e?.disabled ? o.surface.placeholderForeground : o.surface.editorForeground
301
- },
302
- "& .token-line": {
303
- display: "block",
304
- width: "100%"
305
- },
306
- '& .token-line[data-code-editor-error-line="true"]': {
307
- backgroundColor: o.surface.errorLineBackground
308
- },
309
- '& [data-code-editor-error-token="true"]': {
310
- backgroundColor: o.surface.errorRangeBackground,
311
- boxShadow: `inset 0 -1px 0 ${o.surface.errorRangeShadowColor}`
312
- }
313
- };
314
- },
315
- /** Position the empty-state placeholder above the editor surface. */
316
- placeholder: ({ theme: r, ownerState: e }) => {
317
- const o = l(
318
- e?.colorMode
319
- );
320
- return {
321
- position: "absolute",
322
- zIndex: 1,
323
- top: `${i}px`,
324
- left: `${i}px`,
325
- pointerEvents: "none",
326
- color: o.surface.placeholderForeground,
327
- ...n(r.generalSettings.isMobile, e?.size || "medium", "bodyStandard"),
328
- fontFamily: t,
329
- lineHeight: `${e?.lineHeight || a.medium}px`,
330
- whiteSpace: "pre-wrap"
331
- };
332
- },
333
- /** Size the skeleton block to the same footprint as the live editor. */
334
- skeleton: ({ theme: r }) => ({
335
- "&&&": {
336
- borderRadius: r.vars.size.borderRadius.r1,
337
- width: "100%",
338
- height: "100px"
339
- }
340
- })
341
- };
342
- export {
343
- b as codeEditorStyles
344
- };
@@ -1,83 +0,0 @@
1
- type CodeEditorVSCodeModernMode = 'dark' | 'light';
2
- type CodeEditorVSCodeModernSurfacePalette = {
3
- activeIndentGuideForeground: string;
4
- borderColor: string;
5
- bracketMatchBorder: string;
6
- caretForeground: string;
7
- dividerColor: string;
8
- editorBackground: string;
9
- editorForeground: string;
10
- errorBorderColor: string;
11
- errorRangeBackground: string;
12
- errorRangeShadowColor: string;
13
- errorLineBackground: string;
14
- focusBorderColor: string;
15
- headerBackground: string;
16
- headerForeground: string;
17
- inactiveSelectionBackground: string;
18
- indentGuideForeground: string;
19
- languageChipBackground: string;
20
- languageChipBorder: string;
21
- languageChipForeground: string;
22
- lineNumberActiveForeground: string;
23
- lineNumberForeground: string;
24
- placeholderForeground: string;
25
- readOnlyChipBackground: string;
26
- readOnlyChipBorder: string;
27
- readOnlyChipForeground: string;
28
- rootBackground: string;
29
- selectionBackground: string;
30
- widgetBackground: string;
31
- };
32
- type CodeEditorVSCodeModernSyntaxPalette = {
33
- attributeName: string;
34
- boolean: string;
35
- comment: string;
36
- constant: string;
37
- escape: string;
38
- function: string;
39
- keyword: string;
40
- number: string;
41
- operator: string;
42
- regex: string;
43
- string: string;
44
- tag: string;
45
- type: string;
46
- variable: string;
47
- };
48
- export type CodeEditorVSCodeModernPalette = {
49
- bracketPalette: readonly string[];
50
- surface: CodeEditorVSCodeModernSurfacePalette;
51
- syntax: CodeEditorVSCodeModernSyntaxPalette;
52
- };
53
- export declare const CODE_EDITOR_KEY_COMPONENT = "M4LCodeEditor";
54
- export declare const CODE_EDITOR_DEFAULT_LANGUAGE = "text";
55
- export declare const CODE_EDITOR_DEFAULT_MIN_LINES = 4;
56
- export declare const CODE_EDITOR_DEFAULT_MAX_LINES = 10;
57
- export declare const CODE_EDITOR_PADDING_PX = 12;
58
- export declare const CODE_EDITOR_LINE_HEIGHT_BY_SIZE: {
59
- readonly small: 18;
60
- readonly medium: 20;
61
- };
62
- export declare const CODE_EDITOR_MONO_FONT_FAMILY = "\"Geist Mono\", \"JetBrains Mono\", \"Cascadia Code\", \"Liberation Mono\", monospace";
63
- export declare const CODE_EDITOR_READ_ONLY_LABEL = "Read Only";
64
- export declare const CODE_EDITOR_TOGGLE_LINE_NUMBERS_LABEL = "Show or hide line numbers";
65
- export declare const CODE_EDITOR_AT_LANGUAGE = "at-commands";
66
- export declare const CODE_EDITOR_AT_TEMPLATE_NAME = "at-basic";
67
- export declare const CODE_EDITOR_AT_TEMPLATE_LANGUAGE_LABEL = "AT Commands";
68
- export declare const CODE_EDITOR_LANGUAGE_CHIP_ICON_INSTANCE_ID = "CodeEditorLanguageChipIcon";
69
- export declare const CODE_EDITOR_AT_TEMPLATE_TOKENS: {
70
- readonly commandPrefixes: readonly ["AT+", "+"];
71
- readonly concatenationSeparators: readonly [";"];
72
- readonly argumentSeparators: readonly [","];
73
- readonly reservedWords: readonly ["SET", "INFO", "SAVE", "CLEAR"];
74
- };
75
- export declare const CODE_EDITOR_LANGUAGE_ALIASES: Record<string, string>;
76
- export declare const CODE_EDITOR_FALLBACK_LANGUAGE_ICON: import('@mui/material/OverridableComponent').OverridableComponent<import('@mui/material').SvgIconTypeMap<{}, "svg">> & {
77
- muiName: string;
78
- };
79
- /** Resolve the exact VS Code Modern palette for the current light or dark theme mode. */
80
- export declare function getCodeEditorVSCodeModernPalette(mode?: CodeEditorVSCodeModernMode): CodeEditorVSCodeModernPalette;
81
- export declare const CODE_EDITOR_CLASSES: Record<"root" | "skeleton" | "body" | "header" | "pre" | "textarea" | "placeholder" | "headerBadges" | "languageChip" | "languageChipIcon" | "readOnlyChip" | "lineNumbersToggle" | "bodyResizeShell" | "lineNumbers" | "lineNumber" | "editorScroller" | "editor", string>;
82
- export {};
83
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/constants.ts"],"names":[],"mappings":"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"}
@@ -1,149 +0,0 @@
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
- dark: {
6
- bracketPalette: ["#FFD700", "#DA70D6", "#179FFF"],
7
- surface: {
8
- activeIndentGuideForeground: "#707070",
9
- borderColor: "#3C3C3C",
10
- bracketMatchBorder: "#888888",
11
- caretForeground: "#AEAFAD",
12
- dividerColor: "#2B2B2B",
13
- editorBackground: "#1F1F1F",
14
- editorForeground: "#CCCCCC",
15
- errorBorderColor: "#F85149",
16
- errorRangeBackground: "#F8514926",
17
- errorRangeShadowColor: "#F85149",
18
- errorLineBackground: "#F8514914",
19
- focusBorderColor: "#0078D4",
20
- headerBackground: "#181818",
21
- headerForeground: "#CCCCCC",
22
- inactiveSelectionBackground: "#3A3D41",
23
- indentGuideForeground: "#404040",
24
- languageChipBackground: "#313131",
25
- languageChipBorder: "#3C3C3C",
26
- languageChipForeground: "#CCCCCC",
27
- lineNumberActiveForeground: "#CCCCCC",
28
- lineNumberForeground: "#6E7681",
29
- placeholderForeground: "#989898",
30
- readOnlyChipBackground: "#2489DB82",
31
- readOnlyChipBorder: "#2488DB",
32
- readOnlyChipForeground: "#FFFFFF",
33
- rootBackground: "#181818",
34
- selectionBackground: "#264F78",
35
- widgetBackground: "#202020"
36
- },
37
- syntax: {
38
- attributeName: "#9CDCFE",
39
- boolean: "#569CD6",
40
- comment: "#6A9955",
41
- constant: "#4FC1FF",
42
- escape: "#D7BA7D",
43
- function: "#DCDCAA",
44
- keyword: "#569CD6",
45
- number: "#B5CEA8",
46
- operator: "#CCCCCC",
47
- regex: "#646695",
48
- string: "#CE9178",
49
- tag: "#569CD6",
50
- type: "#4EC9B0",
51
- variable: "#9CDCFE"
52
- }
53
- },
54
- light: {
55
- bracketPalette: ["#0431FA", "#319331", "#7B3814"],
56
- surface: {
57
- activeIndentGuideForeground: "#939393",
58
- borderColor: "#CECECE",
59
- bracketMatchBorder: "#B9B9B9",
60
- caretForeground: "#000000",
61
- dividerColor: "#E5E5E5",
62
- editorBackground: "#FFFFFF",
63
- editorForeground: "#3B3B3B",
64
- errorBorderColor: "#F85149",
65
- errorRangeBackground: "#F8514920",
66
- errorRangeShadowColor: "#F85149",
67
- errorLineBackground: "#F8514912",
68
- focusBorderColor: "#005FB8",
69
- headerBackground: "#F8F8F8",
70
- headerForeground: "#3B3B3B",
71
- inactiveSelectionBackground: "#E5EBF1",
72
- indentGuideForeground: "#D3D3D3",
73
- languageChipBackground: "#FFFFFF",
74
- languageChipBorder: "#CECECE",
75
- languageChipForeground: "#3B3B3B",
76
- lineNumberActiveForeground: "#171184",
77
- lineNumberForeground: "#6E7681",
78
- placeholderForeground: "#767676",
79
- readOnlyChipBackground: "#BED6ED",
80
- readOnlyChipBorder: "#005FB8",
81
- readOnlyChipForeground: "#000000",
82
- rootBackground: "#F8F8F8",
83
- selectionBackground: "#ADD6FF",
84
- widgetBackground: "#F8F8F8"
85
- },
86
- syntax: {
87
- attributeName: "#E50000",
88
- boolean: "#0000FF",
89
- comment: "#008000",
90
- constant: "#0070C1",
91
- escape: "#EE0000",
92
- function: "#795E26",
93
- keyword: "#0000FF",
94
- number: "#098658",
95
- operator: "#3B3B3B",
96
- regex: "#811F3F",
97
- string: "#A31515",
98
- tag: "#800000",
99
- type: "#267F99",
100
- variable: "#001080"
101
- }
102
- }
103
- }, C = "M4LCodeEditor", c = "text", i = 4, g = 10, u = 12, _ = {
104
- small: 18,
105
- medium: 20
106
- }, D = '"Geist Mono", "JetBrains Mono", "Cascadia Code", "Liberation Mono", monospace', B = "Read Only", s = "Show or hide line numbers", r = "at-commands", l = "at-basic", O = "AT Commands", A = "CodeEditorLanguageChipIcon", T = {
107
- commandPrefixes: ["AT+", "+"],
108
- concatenationSeparators: [";"],
109
- argumentSeparators: [","],
110
- reservedWords: ["SET", "INFO", "SAVE", "CLEAR"]
111
- }, I = {
112
- js: "javascript",
113
- jsx: "jsx",
114
- ts: "typescript",
115
- tsx: "tsx",
116
- py: "python",
117
- sh: "bash",
118
- shell: "bash",
119
- yml: "yaml",
120
- at: r,
121
- "telemetry-at": r
122
- }, L = e;
123
- function m(o = "light") {
124
- return t[o];
125
- }
126
- const p = n(
127
- C,
128
- a
129
- );
130
- export {
131
- r as CODE_EDITOR_AT_LANGUAGE,
132
- O as CODE_EDITOR_AT_TEMPLATE_LANGUAGE_LABEL,
133
- l as CODE_EDITOR_AT_TEMPLATE_NAME,
134
- T as CODE_EDITOR_AT_TEMPLATE_TOKENS,
135
- p 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,
139
- L as CODE_EDITOR_FALLBACK_LANGUAGE_ICON,
140
- C as CODE_EDITOR_KEY_COMPONENT,
141
- I as CODE_EDITOR_LANGUAGE_ALIASES,
142
- A as CODE_EDITOR_LANGUAGE_CHIP_ICON_INSTANCE_ID,
143
- _ as CODE_EDITOR_LINE_HEIGHT_BY_SIZE,
144
- D as CODE_EDITOR_MONO_FONT_FAMILY,
145
- u as CODE_EDITOR_PADDING_PX,
146
- B as CODE_EDITOR_READ_ONLY_LABEL,
147
- s as CODE_EDITOR_TOGGLE_LINE_NUMBERS_LABEL,
148
- m as getCodeEditorVSCodeModernPalette
149
- };
@@ -1,12 +0,0 @@
1
- import { Dictionary } from '@m4l/core';
2
- export declare const CODE_EDITOR_DICTIONARY_KEY = "code_editor";
3
- /**
4
- * Return the dictionary namespaces required by the CodeEditor component.
5
- */
6
- export declare function getCodeEditorComponentsDictionary(): string[];
7
- export declare const defaultCodeEditorDictionary: Dictionary;
8
- export declare const CODE_EDITOR_DICTIONARY: {
9
- readonly readOnly: "code_editor.read_only";
10
- readonly toggleLineNumbers: "code_editor.toggle_line_numbers";
11
- };
12
- //# sourceMappingURL=dictionary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,eAAO,MAAM,0BAA0B,gBAAgB,CAAC;AAExD;;GAEG;AACH,wBAAgB,iCAAiC,aAEhD;AAED,eAAO,MAAM,2BAA2B,EAAE,UAKzC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;CAGzB,CAAC"}
@@ -1,8 +0,0 @@
1
- const e = "code_editor", _ = {
2
- readOnly: `${e}.read_only`,
3
- toggleLineNumbers: `${e}.toggle_line_numbers`
4
- };
5
- export {
6
- _ as CODE_EDITOR_DICTIONARY,
7
- e as CODE_EDITOR_DICTIONARY_KEY
8
- };
@@ -1,58 +0,0 @@
1
- import { ReactElement } from 'react';
2
- import { default as Prism } from 'prismjs';
3
- import { PrismTheme } from 'prism-react-renderer';
4
- import { CodeEditorCustomLanguages, CodeEditorLezerSyntaxValidatorOptions, CodeEditorLanguageTemplate, CodeEditorLanguageTemplateInput, CodeEditorRuntimeDependency, HighlightCodeOptions, CodeEditorSyntaxValidationContext, CodeEditorSyntaxValidator, CodeEditorSyntaxValidationResult } from '../types';
5
- export declare const DEFAULT_CODE_EDITOR_AT_LANGUAGE_TEMPLATE: CodeEditorLanguageTemplate;
6
- /** Escape a literal token so it can be embedded safely inside a RegExp. */
7
- export declare function escapeRegExpToken(token: string): string;
8
- /** Join user-defined token literals into a RegExp alternation pattern. */
9
- export declare function createTokenAlternation(tokens?: string[]): string | undefined;
10
- /** Build the Prism grammar for AT command templates from a token definition object. */
11
- export declare function buildAtCommandGrammar(template: CodeEditorLanguageTemplate): Prism.Grammar;
12
- /** Build the Prism grammar associated with the provided CodeEditor template. */
13
- export declare function createCodeEditorLanguageGrammar(template: CodeEditorLanguageTemplate): Prism.Grammar;
14
- /**
15
- * Register a Prism grammar so CodeEditor can highlight a custom language.
16
- */
17
- export declare function registerCodeEditorLanguage(languageName: string, grammar: Prism.Grammar): void;
18
- /** Register a reusable language template so callers can reference it by name later. */
19
- export declare function registerCodeEditorLanguageTemplate(template: CodeEditorLanguageTemplate): void;
20
- /** Resolve a named or inline template definition passed to the CodeEditor API. */
21
- export declare function resolveCodeEditorLanguageTemplate(template?: CodeEditorLanguageTemplateInput): CodeEditorLanguageTemplate | undefined;
22
- /** Resolve the active template without mutating the shared Prism language registry. */
23
- export declare function ensureCodeEditorLanguageTemplate(template?: CodeEditorLanguageTemplateInput): CodeEditorLanguageTemplate | undefined;
24
- /**
25
- * Register a global syntax validator that `validateSyntax` can reuse by language key.
26
- */
27
- export declare function registerCodeEditorSyntaxValidator(languageName: string, syntaxValidator: CodeEditorSyntaxValidator): void;
28
- /**
29
- * Build a CodeEditor syntax validator from an official Lezer-backed parser.
30
- */
31
- export declare function createCodeEditorLezerSyntaxValidator(options: CodeEditorLezerSyntaxValidatorOptions): CodeEditorSyntaxValidator;
32
- /**
33
- * Execute one or more runtime dependencies once so consumers can lazy-load Prism modules.
34
- */
35
- export declare function ensureCodeEditorRuntimeDependencies(runtimeDependencies?: CodeEditorRuntimeDependency | CodeEditorRuntimeDependency[]): Promise<void>;
36
- /**
37
- * Register the custom languages passed to the current CodeEditor instance globally.
38
- */
39
- export declare function ensureCodeEditorLanguages(customLanguages?: CodeEditorCustomLanguages): void;
40
- /**
41
- * Resolve aliases such as js/ts/sh to the Prism language key used for highlighting.
42
- */
43
- export declare function resolveCodeEditorLanguage(languageText?: string): string;
44
- /** Validate registered languages while treating unsupported languages as an explicit opt-in path. */
45
- export declare function validateCodeEditorSyntax({ code, languageTemplate, languageText, }: CodeEditorSyntaxValidationContext): CodeEditorSyntaxValidationResult;
46
- /**
47
- * Count the number of logical lines rendered by the editor, preserving trailing new lines.
48
- */
49
- export declare function getCodeEditorLineCount(value: string): number;
50
- /**
51
- * Build the Prism theme used by CodeEditor from the exact VS Code Modern palettes.
52
- */
53
- export declare function createCodeEditorPrismTheme(colorMode?: 'dark' | 'light'): PrismTheme;
54
- /**
55
- * Render the highlighted code tree consumed by react-simple-code-editor.
56
- */
57
- export declare function highlightCode({ code, customLanguages, languageTemplate, languageText, prismTheme, syntaxErrorRange, }: HighlightCodeOptions): ReactElement;
58
- //# sourceMappingURL=highlighting.d.ts.map
@@ -1 +0,0 @@
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,wCAAwC,EAAE,0BAWtD,CAAC;AA8RF,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,0EAA0E;AAC1E,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAU5E;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,0BAA0B,GACnC,KAAK,CAAC,OAAO,CAmDf;AAED,gFAAgF;AAChF,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,0BAA0B,GACnC,KAAK,CAAC,OAAO,CAOf;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,KAAK,CAAC,OAAO,GACrB,IAAI,CAMN;AAED,uFAAuF;AACvF,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,0BAA0B,GACnC,IAAI,CAQN;AAED,kFAAkF;AAClF,wBAAgB,iCAAiC,CAC/C,QAAQ,CAAC,EAAE,+BAA+B,GACzC,0BAA0B,GAAG,SAAS,CAUxC;AAED,uFAAuF;AACvF,wBAAgB,gCAAgC,CAC9C,QAAQ,CAAC,EAAE,+BAA+B,GACzC,0BAA0B,GAAG,SAAS,CAExC;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,yBAAyB,GACzC,IAAI,CAMN;AAED;;GAEG;AACH,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,qCAAqC,GAC7C,yBAAyB,CAG3B;AAeD;;GAEG;AACH,wBAAsB,mCAAmC,CACvD,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,SAAS,GAAE,MAAM,GAAG,OAAiB,GACpC,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"}