@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.
- package/@types/types.d.ts +0 -11
- package/components/MFIsolationApp/MFIsolationApp.d.ts.map +1 -1
- package/components/MFIsolationApp/MFIsolationApp.js +76 -80
- package/components/extended/index.d.ts +0 -1
- package/components/extended/index.d.ts.map +1 -1
- package/components/hook-form/index.d.ts +0 -1
- package/components/hook-form/index.d.ts.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +559 -572
- package/package.json +6 -9
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts +0 -5
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.d.ts.map +0 -1
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/ThemeSettingsHostToolsBridge.js +0 -14
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts +0 -2
- package/components/MFIsolationApp/subcomponents/ThemeSettingsHostToolsBridge/index.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts +0 -6
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.js +0 -380
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts +0 -3
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/CodeEditor.styles.js +0 -344
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts +0 -83
- package/components/extended/ReactSimpleCodeEditor/constants.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/constants.js +0 -149
- package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts +0 -12
- package/components/extended/ReactSimpleCodeEditor/dictionary.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/dictionary.js +0 -8
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts +0 -58
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/helpers/highlighting.js +0 -1063
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts +0 -6
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/helpers/languageIcon.js +0 -7
- package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts +0 -6
- package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/helpers/resolveEditorComponent.js +0 -9
- package/components/extended/ReactSimpleCodeEditor/index.d.ts +0 -4
- package/components/extended/ReactSimpleCodeEditor/index.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts +0 -20
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorEnum.js +0 -4
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts +0 -90
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/slots/CodeEditorSlots.js +0 -73
- package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts +0 -3
- package/components/extended/ReactSimpleCodeEditor/slots/index.d.ts.map +0 -1
- package/components/extended/ReactSimpleCodeEditor/types.d.ts +0 -460
- package/components/extended/ReactSimpleCodeEditor/types.d.ts.map +0 -1
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts +0 -7
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.d.ts.map +0 -1
- package/components/hook-form/RHFCodeEditor/RHFCodeEditor.js +0 -6
- package/components/hook-form/RHFCodeEditor/index.d.ts +0 -3
- package/components/hook-form/RHFCodeEditor/index.d.ts.map +0 -1
|
@@ -1,460 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, ElementType } from 'react';
|
|
2
|
-
import { default as Editor } from 'react-simple-code-editor';
|
|
3
|
-
import { Theme } from '@mui/material';
|
|
4
|
-
import { PrismTheme } from 'prism-react-renderer';
|
|
5
|
-
import { Sizes } from '@m4l/styles';
|
|
6
|
-
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
7
|
-
import { CODE_EDITOR_KEY_COMPONENT } from './constants';
|
|
8
|
-
import { CodeEditorSlots } from './slots/CodeEditorEnum';
|
|
9
|
-
type BaseEditorProps = ComponentProps<typeof Editor>;
|
|
10
|
-
/**
|
|
11
|
-
* Visual variant of the editor shell.
|
|
12
|
-
*/
|
|
13
|
-
export type CodeEditorVariant = 'outlined' | 'contained';
|
|
14
|
-
/**
|
|
15
|
-
* Language key used for syntax highlighting and the language chip label.
|
|
16
|
-
*/
|
|
17
|
-
export type CodeEditorLanguage = string;
|
|
18
|
-
/**
|
|
19
|
-
* Icon shown in the language chip.
|
|
20
|
-
*/
|
|
21
|
-
export type CodeEditorLanguageIcon = ElementType;
|
|
22
|
-
/**
|
|
23
|
-
* Per-instance Prism grammars used locally without mutating the shared registry.
|
|
24
|
-
*/
|
|
25
|
-
export type CodeEditorCustomLanguages = Record<string, Prism.Grammar>;
|
|
26
|
-
/**
|
|
27
|
-
* Name of a registered language template.
|
|
28
|
-
*/
|
|
29
|
-
export type CodeEditorLanguageTemplateName = string;
|
|
30
|
-
/**
|
|
31
|
-
* Supported language template type.
|
|
32
|
-
*/
|
|
33
|
-
export type CodeEditorLanguageTemplateType = 'at-commands';
|
|
34
|
-
/**
|
|
35
|
-
* Lazy setup callback executed before the editor re-renders.
|
|
36
|
-
*/
|
|
37
|
-
export type CodeEditorRuntimeDependency = () => void | Promise<unknown>;
|
|
38
|
-
/**
|
|
39
|
-
* Starter token groups that define the syntax of a language template.
|
|
40
|
-
*/
|
|
41
|
-
export interface CodeEditorLanguageTemplateTokens {
|
|
42
|
-
/**
|
|
43
|
-
* Argument separators within a command.
|
|
44
|
-
*/
|
|
45
|
-
argumentSeparators?: string[];
|
|
46
|
-
/**
|
|
47
|
-
* Prefixes that start a command.
|
|
48
|
-
*/
|
|
49
|
-
commandPrefixes?: string[];
|
|
50
|
-
/**
|
|
51
|
-
* Concatenation separators between commands.
|
|
52
|
-
*/
|
|
53
|
-
concatenationSeparators?: string[];
|
|
54
|
-
/**
|
|
55
|
-
* Reserved words of the language.
|
|
56
|
-
*/
|
|
57
|
-
reservedWords?: string[];
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Language template that resolves metadata such as label, icon, and token groups.
|
|
61
|
-
*/
|
|
62
|
-
export interface CodeEditorLanguageTemplate {
|
|
63
|
-
/**
|
|
64
|
-
* Optional icon shown in the language chip.
|
|
65
|
-
*/
|
|
66
|
-
languageIcon?: CodeEditorLanguageIcon;
|
|
67
|
-
/**
|
|
68
|
-
* Optional label shown in the language chip.
|
|
69
|
-
*/
|
|
70
|
-
languageLabel?: string;
|
|
71
|
-
/**
|
|
72
|
-
* Language key resolved by the template.
|
|
73
|
-
*/
|
|
74
|
-
languageText: CodeEditorLanguage;
|
|
75
|
-
/**
|
|
76
|
-
* Unique name of the template.
|
|
77
|
-
*/
|
|
78
|
-
templateName: CodeEditorLanguageTemplateName;
|
|
79
|
-
/**
|
|
80
|
-
* Supported template type.
|
|
81
|
-
*/
|
|
82
|
-
templateType: CodeEditorLanguageTemplateType;
|
|
83
|
-
/**
|
|
84
|
-
* Starter token groups of the template.
|
|
85
|
-
*/
|
|
86
|
-
tokens?: CodeEditorLanguageTemplateTokens;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Template input: a registered name or an inline template.
|
|
90
|
-
*/
|
|
91
|
-
export type CodeEditorLanguageTemplateInput = CodeEditorLanguageTemplateName | CodeEditorLanguageTemplate;
|
|
92
|
-
/**
|
|
93
|
-
* Context passed to the syntax validator with the code and language metadata.
|
|
94
|
-
*/
|
|
95
|
-
export interface CodeEditorSyntaxValidationContext {
|
|
96
|
-
/**
|
|
97
|
-
* Current code to validate.
|
|
98
|
-
*/
|
|
99
|
-
code: string;
|
|
100
|
-
/**
|
|
101
|
-
* Active language template, when applicable.
|
|
102
|
-
*/
|
|
103
|
-
languageTemplate?: CodeEditorLanguageTemplateInput;
|
|
104
|
-
/**
|
|
105
|
-
* Active language key, when applicable.
|
|
106
|
-
*/
|
|
107
|
-
languageText?: CodeEditorLanguage;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Location of a syntax error within the code (1-based coordinates).
|
|
111
|
-
*/
|
|
112
|
-
export interface CodeEditorSyntaxErrorLocation {
|
|
113
|
-
/**
|
|
114
|
-
* Error column (1-based).
|
|
115
|
-
*/
|
|
116
|
-
column: number;
|
|
117
|
-
/**
|
|
118
|
-
* Error line (1-based).
|
|
119
|
-
*/
|
|
120
|
-
line: number;
|
|
121
|
-
/**
|
|
122
|
-
* Optional absolute offset within the code.
|
|
123
|
-
*/
|
|
124
|
-
offset?: number;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Range that spans the invalid portion of the code.
|
|
128
|
-
*/
|
|
129
|
-
export interface CodeEditorSyntaxErrorRange {
|
|
130
|
-
/**
|
|
131
|
-
* End location of the invalid range.
|
|
132
|
-
*/
|
|
133
|
-
end?: CodeEditorSyntaxErrorLocation;
|
|
134
|
-
/**
|
|
135
|
-
* Start location of the invalid range.
|
|
136
|
-
*/
|
|
137
|
-
start: CodeEditorSyntaxErrorLocation;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Result of a syntax validation.
|
|
141
|
-
*/
|
|
142
|
-
export interface CodeEditorSyntaxValidationResult {
|
|
143
|
-
/**
|
|
144
|
-
* Invalid range to highlight within the code block.
|
|
145
|
-
*/
|
|
146
|
-
errorRange?: CodeEditorSyntaxErrorRange;
|
|
147
|
-
/**
|
|
148
|
-
* Whether the code is valid.
|
|
149
|
-
*/
|
|
150
|
-
isValid: boolean;
|
|
151
|
-
/**
|
|
152
|
-
* Optional error message associated with the validation.
|
|
153
|
-
*/
|
|
154
|
-
message?: string;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Syntax validation function for unsupported languages or domain-specific rules.
|
|
158
|
-
*/
|
|
159
|
-
export type CodeEditorSyntaxValidator = (context: CodeEditorSyntaxValidationContext) => CodeEditorSyntaxValidationResult;
|
|
160
|
-
/**
|
|
161
|
-
* Lezer tree cursor used to walk the parser nodes.
|
|
162
|
-
*/
|
|
163
|
-
export interface CodeEditorLezerTreeCursor {
|
|
164
|
-
/**
|
|
165
|
-
* Moves to the first child of the current node.
|
|
166
|
-
*/
|
|
167
|
-
firstChild: () => boolean;
|
|
168
|
-
/**
|
|
169
|
-
* Start position of the current node.
|
|
170
|
-
*/
|
|
171
|
-
from: number;
|
|
172
|
-
/**
|
|
173
|
-
* Moves to the next sibling of the current node.
|
|
174
|
-
*/
|
|
175
|
-
nextSibling: () => boolean;
|
|
176
|
-
/**
|
|
177
|
-
* Moves up to the parent of the current node.
|
|
178
|
-
*/
|
|
179
|
-
parent: () => boolean;
|
|
180
|
-
/**
|
|
181
|
-
* End position of the current node.
|
|
182
|
-
*/
|
|
183
|
-
to: number;
|
|
184
|
-
/**
|
|
185
|
-
* Metadata of the node type.
|
|
186
|
-
*/
|
|
187
|
-
type: {
|
|
188
|
-
/**
|
|
189
|
-
* Whether the node represents a parse error.
|
|
190
|
-
*/
|
|
191
|
-
isError: boolean;
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Lezer parser able to parse code and expose a cursor over the resulting tree.
|
|
196
|
-
*/
|
|
197
|
-
export interface CodeEditorLezerParser {
|
|
198
|
-
/**
|
|
199
|
-
* Parses the code and returns a cursor over the generated tree.
|
|
200
|
-
*/
|
|
201
|
-
parse: (code: string) => {
|
|
202
|
-
cursor: () => CodeEditorLezerTreeCursor;
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Options to create a syntax validator backed by a Lezer parser.
|
|
207
|
-
*/
|
|
208
|
-
export interface CodeEditorLezerSyntaxValidatorOptions {
|
|
209
|
-
/**
|
|
210
|
-
* Human-readable label of the validated language.
|
|
211
|
-
*/
|
|
212
|
-
label: string;
|
|
213
|
-
/**
|
|
214
|
-
* Lezer parser used to validate the code.
|
|
215
|
-
*/
|
|
216
|
-
parser: CodeEditorLezerParser;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Props for the `CodeEditor` component.
|
|
220
|
-
*/
|
|
221
|
-
export interface CodeEditorProps extends Omit<BaseEditorProps, 'className' | 'defaultValue' | 'highlight' | 'onChange' | 'onValueChange' | 'placeholder' | 'preClassName' | 'textareaClassName' | 'textareaId' | 'value'> {
|
|
222
|
-
/**
|
|
223
|
-
* Custom CSS class for the component.
|
|
224
|
-
*/
|
|
225
|
-
className?: string;
|
|
226
|
-
/**
|
|
227
|
-
* Test identifier used for automated testing.
|
|
228
|
-
*/
|
|
229
|
-
dataTestId?: string;
|
|
230
|
-
/**
|
|
231
|
-
* Initial value used by the internal fallback state.
|
|
232
|
-
* @default ''
|
|
233
|
-
*/
|
|
234
|
-
defaultValue?: string;
|
|
235
|
-
/**
|
|
236
|
-
* Custom CSS class applied to the editor node.
|
|
237
|
-
*/
|
|
238
|
-
editorClassName?: string;
|
|
239
|
-
/**
|
|
240
|
-
* Applies the error visual state.
|
|
241
|
-
* @default false
|
|
242
|
-
*/
|
|
243
|
-
error?: boolean;
|
|
244
|
-
/**
|
|
245
|
-
* Prism theme used for syntax highlighting.
|
|
246
|
-
*/
|
|
247
|
-
highlightTheme?: PrismTheme;
|
|
248
|
-
/**
|
|
249
|
-
* Optional icon shown in the language chip. When omitted, the chip falls back to the generic file icon.
|
|
250
|
-
*/
|
|
251
|
-
languageIcon?: CodeEditorLanguageIcon;
|
|
252
|
-
/**
|
|
253
|
-
* Custom label shown in the language chip. Without this prop or a template label, the language header is not rendered unless another header state still requires it.
|
|
254
|
-
*/
|
|
255
|
-
languageLabel?: string;
|
|
256
|
-
/**
|
|
257
|
-
* Forces the header row to render even when no language label or read-only badge is present.
|
|
258
|
-
* @default false
|
|
259
|
-
*/
|
|
260
|
-
forceHeader?: boolean;
|
|
261
|
-
/**
|
|
262
|
-
* Named or inline template that resolves language metadata such as label, icon, and starter token groups.
|
|
263
|
-
*/
|
|
264
|
-
languageTemplate?: CodeEditorLanguageTemplateInput;
|
|
265
|
-
/**
|
|
266
|
-
* Language key used for syntax highlighting and the default chip label.
|
|
267
|
-
* @default 'text'
|
|
268
|
-
*/
|
|
269
|
-
languageText?: CodeEditorLanguage;
|
|
270
|
-
/**
|
|
271
|
-
* Maximum visible line count before the editor body becomes vertically scrollable.
|
|
272
|
-
* @default 10
|
|
273
|
-
*/
|
|
274
|
-
maxLines?: number;
|
|
275
|
-
/**
|
|
276
|
-
* Minimum rendered line count used for height and optional line numbers.
|
|
277
|
-
* @default 4
|
|
278
|
-
*/
|
|
279
|
-
minLines?: number;
|
|
280
|
-
/**
|
|
281
|
-
* Controlled change callback. When omitted, the component keeps its own local state.
|
|
282
|
-
*/
|
|
283
|
-
onChange?: (nextValue: string) => void;
|
|
284
|
-
/**
|
|
285
|
-
* Placeholder text shown while the editor is empty.
|
|
286
|
-
*/
|
|
287
|
-
placeholder?: string;
|
|
288
|
-
/**
|
|
289
|
-
* Custom CSS class applied to the `pre` element.
|
|
290
|
-
*/
|
|
291
|
-
preClassName?: string;
|
|
292
|
-
/**
|
|
293
|
-
* Locks editing and shows the read-only chip.
|
|
294
|
-
* @default false
|
|
295
|
-
*/
|
|
296
|
-
readOnly?: boolean;
|
|
297
|
-
/**
|
|
298
|
-
* Custom text for the read-only chip. When omitted, it is resolved from the module dictionary.
|
|
299
|
-
*/
|
|
300
|
-
readOnlyLabel?: string;
|
|
301
|
-
/**
|
|
302
|
-
* Enables native CSS vertical resize on the editor body shell.
|
|
303
|
-
* @default true
|
|
304
|
-
*/
|
|
305
|
-
resizable?: boolean;
|
|
306
|
-
/**
|
|
307
|
-
* Controls the initial visibility of the line-number gutter.
|
|
308
|
-
* @default false
|
|
309
|
-
*/
|
|
310
|
-
showLineNumbers?: boolean;
|
|
311
|
-
/**
|
|
312
|
-
* Enables the placeholder overlay for empty content.
|
|
313
|
-
* @default true
|
|
314
|
-
*/
|
|
315
|
-
showPlaceholder?: boolean;
|
|
316
|
-
/**
|
|
317
|
-
* Controls typography and line height.
|
|
318
|
-
* @default 'medium'
|
|
319
|
-
*/
|
|
320
|
-
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
321
|
-
/**
|
|
322
|
-
* Custom validator for unsupported languages or domain-specific rules.
|
|
323
|
-
*/
|
|
324
|
-
syntaxValidator?: CodeEditorSyntaxValidator;
|
|
325
|
-
/**
|
|
326
|
-
* Lazy setup callbacks that can import Prism modules, register templates, or register validators before rendering.
|
|
327
|
-
*/
|
|
328
|
-
runtimeDependencies?: CodeEditorRuntimeDependency | CodeEditorRuntimeDependency[];
|
|
329
|
-
/**
|
|
330
|
-
* Forces the skeleton state regardless of `useModuleSkeleton()`.
|
|
331
|
-
* @default false
|
|
332
|
-
*/
|
|
333
|
-
skeleton?: boolean;
|
|
334
|
-
/**
|
|
335
|
-
* Custom CSS class applied to the internal `textarea`.
|
|
336
|
-
*/
|
|
337
|
-
textareaClassName?: string;
|
|
338
|
-
/**
|
|
339
|
-
* Enables JSON validation, AT template validation, and any validators registered for the active language.
|
|
340
|
-
* @default false
|
|
341
|
-
*/
|
|
342
|
-
validateSyntax?: boolean;
|
|
343
|
-
/**
|
|
344
|
-
* Controlled content value.
|
|
345
|
-
*/
|
|
346
|
-
value?: string;
|
|
347
|
-
/**
|
|
348
|
-
* Per-instance Prism grammars used locally without mutating the shared registry.
|
|
349
|
-
*/
|
|
350
|
-
customLanguages?: CodeEditorCustomLanguages;
|
|
351
|
-
/**
|
|
352
|
-
* Visual variant of the editor shell.
|
|
353
|
-
* @default 'outlined'
|
|
354
|
-
*/
|
|
355
|
-
variant?: CodeEditorVariant;
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Owner state for the `CodeEditor` component, used to customize styles and behaviors.
|
|
359
|
-
*/
|
|
360
|
-
export interface CodeEditorOwnerState extends Record<string, unknown> {
|
|
361
|
-
/**
|
|
362
|
-
* Active palette mode.
|
|
363
|
-
*/
|
|
364
|
-
colorMode: Theme['palette']['mode'];
|
|
365
|
-
/**
|
|
366
|
-
* Whether the editor is disabled.
|
|
367
|
-
*/
|
|
368
|
-
disabled: boolean;
|
|
369
|
-
/**
|
|
370
|
-
* Whether the editor is in the error state.
|
|
371
|
-
*/
|
|
372
|
-
error: boolean;
|
|
373
|
-
/**
|
|
374
|
-
* Whether the visible line cap has been reached.
|
|
375
|
-
*/
|
|
376
|
-
isLineCapped: boolean;
|
|
377
|
-
/**
|
|
378
|
-
* Whether the editor is empty.
|
|
379
|
-
*/
|
|
380
|
-
isEmpty: boolean;
|
|
381
|
-
/**
|
|
382
|
-
* Whether the placeholder is visible.
|
|
383
|
-
*/
|
|
384
|
-
isPlaceholderVisible: boolean;
|
|
385
|
-
/**
|
|
386
|
-
* Computed line height.
|
|
387
|
-
*/
|
|
388
|
-
lineHeight: number;
|
|
389
|
-
/**
|
|
390
|
-
* Maximum visible line count.
|
|
391
|
-
*/
|
|
392
|
-
maxLines: number;
|
|
393
|
-
/**
|
|
394
|
-
* Minimum rendered line count.
|
|
395
|
-
*/
|
|
396
|
-
minLines: number;
|
|
397
|
-
/**
|
|
398
|
-
* Whether the editor is read-only.
|
|
399
|
-
*/
|
|
400
|
-
readOnly: boolean;
|
|
401
|
-
/**
|
|
402
|
-
* Whether the editor body exposes native CSS vertical resize.
|
|
403
|
-
*/
|
|
404
|
-
resizable: boolean;
|
|
405
|
-
/**
|
|
406
|
-
* Whether line numbers are shown.
|
|
407
|
-
*/
|
|
408
|
-
showLineNumbers: boolean;
|
|
409
|
-
/**
|
|
410
|
-
* Editor size.
|
|
411
|
-
*/
|
|
412
|
-
size: Extract<Sizes, 'small' | 'medium'>;
|
|
413
|
-
/**
|
|
414
|
-
* Visual variant of the editor.
|
|
415
|
-
*/
|
|
416
|
-
variant: CodeEditorVariant;
|
|
417
|
-
/**
|
|
418
|
-
* Number of code lines currently visible.
|
|
419
|
-
*/
|
|
420
|
-
visibleLineCount: number;
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Possible slot types for the `CodeEditor` component.
|
|
424
|
-
*/
|
|
425
|
-
export type CodeEditorSlotsType = keyof typeof CodeEditorSlots;
|
|
426
|
-
/**
|
|
427
|
-
* Style definition for the `CodeEditor` component.
|
|
428
|
-
*/
|
|
429
|
-
export type CodeEditorStyles = M4LOverridesStyleRules<CodeEditorSlotsType, typeof CODE_EDITOR_KEY_COMPONENT, Theme>;
|
|
430
|
-
/**
|
|
431
|
-
* Options to highlight the code through the Prism engine.
|
|
432
|
-
*/
|
|
433
|
-
export interface HighlightCodeOptions {
|
|
434
|
-
/**
|
|
435
|
-
* Code to highlight.
|
|
436
|
-
*/
|
|
437
|
-
code: string;
|
|
438
|
-
/**
|
|
439
|
-
* Per-instance Prism grammars used during highlighting.
|
|
440
|
-
*/
|
|
441
|
-
customLanguages?: CodeEditorCustomLanguages;
|
|
442
|
-
/**
|
|
443
|
-
* Active language template, when applicable.
|
|
444
|
-
*/
|
|
445
|
-
languageTemplate?: CodeEditorLanguageTemplateInput;
|
|
446
|
-
/**
|
|
447
|
-
* Active language key, when applicable.
|
|
448
|
-
*/
|
|
449
|
-
languageText?: CodeEditorLanguage;
|
|
450
|
-
/**
|
|
451
|
-
* Prism theme used for highlighting.
|
|
452
|
-
*/
|
|
453
|
-
prismTheme: PrismTheme;
|
|
454
|
-
/**
|
|
455
|
-
* Syntax error range to highlight within the code block.
|
|
456
|
-
*/
|
|
457
|
-
syntaxErrorRange?: CodeEditorSyntaxErrorRange;
|
|
458
|
-
}
|
|
459
|
-
export {};
|
|
460
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/extended/ReactSimpleCodeEditor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,KAAK,eAAe,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,WAAW,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAExE;;GA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IACb;;OAEG;IACH,eAAe,CAAC,EAAE,yBAAyB,CAAC;IAC5C;;OAEG;IACH,gBAAgB,CAAC,EAAE,+BAA+B,CAAC;IACnD;;OAEG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;CAC/C"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Connect CodeEditor to react-hook-form through the shared controller wrapper.
|
|
4
|
-
*/
|
|
5
|
-
export declare const RHFCodeEditor: import('react').ForwardRefExoticComponent<Omit<import('../..').CodeEditorProps & import('../../..').BaseRHFProps<import('react-hook-form').FieldValues>, "ref"> & import('react').RefAttributes<any>>;
|
|
6
|
-
export type RHFCodeEditorProps = ComponentProps<typeof RHFCodeEditor>;
|
|
7
|
-
//# sourceMappingURL=RHFCodeEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RHFCodeEditor.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFCodeEditor/RHFCodeEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C;;GAEG;AACH,eAAO,MAAM,aAAa,uMAAgC,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFCodeEditor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|