@instructure/ui-source-code-editor 8.25.1-snapshot-19

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 (43) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +48 -0
  3. package/es/SourceCodeEditor/SourceCodeEditorLocator.js +81 -0
  4. package/es/SourceCodeEditor/customKeybinding.js +96 -0
  5. package/es/SourceCodeEditor/index.js +587 -0
  6. package/es/SourceCodeEditor/props.js +55 -0
  7. package/es/SourceCodeEditor/styles.js +204 -0
  8. package/es/SourceCodeEditor/theme.js +52 -0
  9. package/es/index.js +24 -0
  10. package/lib/SourceCodeEditor/SourceCodeEditorLocator.js +92 -0
  11. package/lib/SourceCodeEditor/customKeybinding.js +104 -0
  12. package/lib/SourceCodeEditor/index.js +601 -0
  13. package/lib/SourceCodeEditor/props.js +67 -0
  14. package/lib/SourceCodeEditor/styles.js +213 -0
  15. package/lib/SourceCodeEditor/theme.js +60 -0
  16. package/lib/index.js +13 -0
  17. package/lib/package.json +1 -0
  18. package/package.json +68 -0
  19. package/src/SourceCodeEditor/README.md +794 -0
  20. package/src/SourceCodeEditor/SourceCodeEditorLocator.ts +56 -0
  21. package/src/SourceCodeEditor/customKeybinding.ts +121 -0
  22. package/src/SourceCodeEditor/index.tsx +659 -0
  23. package/src/SourceCodeEditor/props.ts +291 -0
  24. package/src/SourceCodeEditor/styles.ts +200 -0
  25. package/src/SourceCodeEditor/theme.ts +55 -0
  26. package/src/index.ts +25 -0
  27. package/tsconfig.build.json +25 -0
  28. package/tsconfig.build.tsbuildinfo +1 -0
  29. package/tsconfig.json +4 -0
  30. package/types/SourceCodeEditor/SourceCodeEditorLocator.d.ts +607 -0
  31. package/types/SourceCodeEditor/SourceCodeEditorLocator.d.ts.map +1 -0
  32. package/types/SourceCodeEditor/customKeybinding.d.ts +4 -0
  33. package/types/SourceCodeEditor/customKeybinding.d.ts.map +1 -0
  34. package/types/SourceCodeEditor/index.d.ts +126 -0
  35. package/types/SourceCodeEditor/index.d.ts.map +1 -0
  36. package/types/SourceCodeEditor/props.d.ts +130 -0
  37. package/types/SourceCodeEditor/props.d.ts.map +1 -0
  38. package/types/SourceCodeEditor/styles.d.ts +14 -0
  39. package/types/SourceCodeEditor/styles.d.ts.map +1 -0
  40. package/types/SourceCodeEditor/theme.d.ts +10 -0
  41. package/types/SourceCodeEditor/theme.d.ts.map +1 -0
  42. package/types/index.d.ts +3 -0
  43. package/types/index.d.ts.map +1 -0
@@ -0,0 +1,659 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ /** @jsx jsx */
26
+ import { Component } from 'react'
27
+ import { merge, cloneDeep, isEqual } from 'lodash'
28
+
29
+ import { EditorSelection, EditorState, StateEffect } from '@codemirror/state'
30
+ import type { Transaction, TransactionSpec } from '@codemirror/state'
31
+ import {
32
+ EditorView,
33
+ highlightSpecialChars,
34
+ highlightActiveLine,
35
+ drawSelection,
36
+ dropCursor,
37
+ rectangularSelection,
38
+ crosshairCursor,
39
+ lineNumbers,
40
+ highlightActiveLineGutter,
41
+ keymap
42
+ } from '@codemirror/view'
43
+ import type { KeyBinding } from '@codemirror/view'
44
+ import {
45
+ autocompletion,
46
+ completionKeymap,
47
+ closeBrackets,
48
+ closeBracketsKeymap
49
+ } from '@codemirror/autocomplete'
50
+ import {
51
+ highlightSelectionMatches
52
+ // Search feature is turned off for now, see note at keymaps
53
+ // searchKeymap
54
+ } from '@codemirror/search'
55
+ import {
56
+ indentSelection,
57
+ defaultKeymap,
58
+ indentWithTab,
59
+ history,
60
+ historyKeymap
61
+ } from '@codemirror/commands'
62
+ import { lintKeymap } from '@codemirror/lint'
63
+ import {
64
+ indentOnInput,
65
+ indentUnit,
66
+ StreamLanguage,
67
+ bracketMatching,
68
+ foldGutter,
69
+ foldKeymap,
70
+ defaultHighlightStyle,
71
+ syntaxHighlighting,
72
+ HighlightStyle
73
+ } from '@codemirror/language'
74
+ import { javascript } from '@codemirror/lang-javascript'
75
+ import { html } from '@codemirror/lang-html'
76
+ import { css } from '@codemirror/lang-css'
77
+ import { markdown } from '@codemirror/lang-markdown'
78
+ import { json } from '@codemirror/lang-json'
79
+ import { shell } from '@codemirror/legacy-modes/mode/shell'
80
+ import { yaml } from '@codemirror/legacy-modes/mode/yaml'
81
+ // import { oneDarkTheme, oneDarkHighlightStyle } from '@codemirror/theme-one-dark'
82
+
83
+ import { testable } from '@instructure/ui-testable'
84
+ import {
85
+ omitProps,
86
+ passthroughProps,
87
+ withDeterministicId
88
+ } from '@instructure/ui-react-utils'
89
+ import { requestAnimationFrame } from '@instructure/ui-dom-utils'
90
+ import type { RequestAnimationFrameType } from '@instructure/ui-dom-utils'
91
+
92
+ import { ScreenReaderContent } from '@instructure/ui-a11y-content'
93
+ import { textDirectionContextConsumer } from '@instructure/ui-i18n'
94
+
95
+ import { withStyle, jsx } from '@instructure/emotion'
96
+
97
+ import generateStyle from './styles'
98
+ import generateComponentTheme from './theme'
99
+
100
+ import { rtlHorizontalArrowKeymap } from './customKeybinding'
101
+
102
+ import { propTypes, allowedProps } from './props'
103
+ import type { SourceCodeEditorProps } from './props'
104
+
105
+ /**
106
+ ---
107
+ category: components
108
+ ---
109
+ @tsProps
110
+ **/
111
+ @withDeterministicId()
112
+ @withStyle(generateStyle, generateComponentTheme)
113
+ @textDirectionContextConsumer()
114
+ @testable()
115
+ class SourceCodeEditor extends Component<SourceCodeEditorProps> {
116
+ static readonly componentId = 'SourceCodeEditor'
117
+
118
+ static propTypes = propTypes
119
+ static allowedProps = allowedProps
120
+ static defaultProps = {
121
+ language: 'jsx',
122
+ readOnly: false,
123
+ editable: true,
124
+ lineNumbers: false,
125
+ foldGutter: false,
126
+ highlightActiveLine: false,
127
+ highlightActiveLineGutter: false,
128
+ lineWrapping: false,
129
+ autofocus: false,
130
+ spellcheck: false,
131
+ rtlMoveVisually: true,
132
+ indentOnLoad: false,
133
+ indentWithTab: false,
134
+ defaultValue: ''
135
+ }
136
+
137
+ private readonly _id: string
138
+
139
+ ref: HTMLDivElement | null = null
140
+
141
+ private _containerRef?: HTMLDivElement
142
+ private _editorView?: EditorView
143
+
144
+ private _raf: RequestAnimationFrameType[] = []
145
+
146
+ private _newSelectionAfterValueChange?: EditorSelection
147
+
148
+ handleRef = (el: HTMLDivElement | null) => {
149
+ const { elementRef } = this.props
150
+
151
+ this.ref = el
152
+
153
+ if (typeof elementRef === 'function') {
154
+ elementRef(el)
155
+ }
156
+ }
157
+
158
+ handleContainerRef = (el: HTMLDivElement | null) => {
159
+ const { containerRef } = this.props
160
+
161
+ this._containerRef = el || undefined
162
+
163
+ if (typeof containerRef === 'function') {
164
+ containerRef(el)
165
+ }
166
+ }
167
+
168
+ private addAnimationFrame(callback?: FrameRequestCallback) {
169
+ if (typeof callback === 'function') {
170
+ this._raf.push(requestAnimationFrame(callback))
171
+ }
172
+ }
173
+
174
+ private cancelAnimationFrames() {
175
+ this._raf.forEach((request) => request.cancel())
176
+ this._raf = []
177
+ }
178
+
179
+ public focus() {
180
+ this.addAnimationFrame(() => {
181
+ this._editorView?.focus()
182
+ })
183
+ }
184
+
185
+ public get hasFocus() {
186
+ return this._editorView?.hasFocus
187
+ }
188
+
189
+ public selectAll() {
190
+ if (this._editorView) {
191
+ this.addAnimationFrame(() => {
192
+ this.dispatchViewSelection({
193
+ anchor: 0,
194
+ head: this.currentDocValue?.length
195
+ })
196
+ })
197
+ }
198
+ }
199
+
200
+ public deselectAll() {
201
+ if (this._editorView) {
202
+ this.addAnimationFrame(() => {
203
+ this.dispatchViewSelection({
204
+ anchor: 0,
205
+ head: 0
206
+ })
207
+ })
208
+ }
209
+ }
210
+
211
+ public indentCurrentSelection() {
212
+ this.addAnimationFrame(() => {
213
+ if (this._editorView) {
214
+ indentSelection({
215
+ state: this._editorView.state,
216
+ dispatch: (transaction) => {
217
+ this._editorView?.update([transaction])
218
+ }
219
+ })
220
+ }
221
+ })
222
+ }
223
+
224
+ public indentAll() {
225
+ this.addAnimationFrame(() => {
226
+ this.selectAll()
227
+ this.indentCurrentSelection()
228
+ this.deselectAll()
229
+ })
230
+ }
231
+
232
+ // Attach state effects
233
+ private dispatchViewEffects(effects?: TransactionSpec['effects']) {
234
+ if (!this._editorView || !effects) return
235
+
236
+ this._editorView.dispatch({ effects })
237
+ }
238
+
239
+ // Dispatch changes to the document
240
+ private dispatchViewChanges({
241
+ changes,
242
+ selection,
243
+ userEvent
244
+ }: TransactionSpec) {
245
+ if (!this._editorView || !changes) return
246
+
247
+ this._editorView.dispatch({
248
+ changes,
249
+ ...(selection ? { selection } : undefined),
250
+ ...(userEvent ? { userEvent } : undefined)
251
+ })
252
+ }
253
+
254
+ // Select a portion of the document
255
+ private dispatchViewSelection(selection?: TransactionSpec['selection']) {
256
+ if (!this._editorView || !selection) return
257
+
258
+ this._editorView.dispatch({ selection })
259
+ }
260
+
261
+ get currentDocValue() {
262
+ return this._editorView?.state.doc
263
+ }
264
+
265
+ // when value is passed, the editor should be controlled
266
+ get isControlled() {
267
+ return typeof this.props.value === 'string'
268
+ }
269
+
270
+ constructor(props: SourceCodeEditorProps) {
271
+ super(props)
272
+ this._id = props.deterministicId!()
273
+ }
274
+
275
+ componentDidMount() {
276
+ const { value, defaultValue, autofocus, indentOnLoad } = this.props
277
+
278
+ this.props.makeStyles?.()
279
+
280
+ const state = EditorState.create({
281
+ doc: value || defaultValue,
282
+ extensions: this.extensions
283
+ })
284
+ this._editorView = new EditorView({
285
+ state,
286
+ parent: this._containerRef
287
+ })
288
+
289
+ if (autofocus) {
290
+ this.focus()
291
+ }
292
+
293
+ if (indentOnLoad) {
294
+ this.indentAll()
295
+ }
296
+ }
297
+
298
+ componentWillUnmount() {
299
+ this._editorView = undefined
300
+
301
+ this.cancelAnimationFrames()
302
+ }
303
+
304
+ componentDidUpdate(prevProps: SourceCodeEditorProps) {
305
+ this.props.makeStyles?.()
306
+
307
+ if (this._editorView) {
308
+ if (this.props.value !== prevProps.value) {
309
+ this.refreshEditorValue()
310
+ }
311
+
312
+ if (this.shouldUpdateExtensions(prevProps)) {
313
+ this.refreshExtensions()
314
+ }
315
+ }
316
+ }
317
+
318
+ private shouldUpdateExtensions(prevProps: SourceCodeEditorProps) {
319
+ const propsToObserve: (keyof SourceCodeEditorProps)[] = [
320
+ 'styles', // needed for theme update
321
+ 'themeOverride',
322
+ 'language',
323
+ 'readOnly',
324
+ 'editable',
325
+ 'lineNumbers',
326
+ 'highlightActiveLineGutter',
327
+ 'foldGutter',
328
+ 'lineWrapping',
329
+ 'autofocus',
330
+ 'spellcheck',
331
+ 'direction',
332
+ 'dir',
333
+ 'rtlMoveVisually',
334
+ 'indentOnLoad',
335
+ 'indentWithTab',
336
+ 'indentUnit',
337
+ 'highlightActiveLine',
338
+ 'attachment'
339
+ ]
340
+
341
+ for (const prop of propsToObserve) {
342
+ if (!isEqual(this.props[prop], prevProps[prop])) {
343
+ return true
344
+ }
345
+ }
346
+
347
+ return false
348
+ }
349
+
350
+ get direction() {
351
+ // comes from the `direction` prop and
352
+ // falls back to the `dir` prop coming from the bidirectional decorator
353
+ return this.props.direction || this.props.dir
354
+ }
355
+
356
+ get extensions() {
357
+ const extensions = [
358
+ ...this.baseExtensions,
359
+
360
+ // our custom extensions
361
+ this.languageExtension,
362
+ this.onChangeExtension,
363
+ this.focusListenerExtension,
364
+ this.announceLineNumberExtension
365
+ ]
366
+
367
+ if (this.themeExtension) {
368
+ extensions.push(this.themeExtension)
369
+ }
370
+ if (this.props.lineNumbers) {
371
+ extensions.push(lineNumbers())
372
+ }
373
+ if (this.props.highlightActiveLine) {
374
+ extensions.push(highlightActiveLine())
375
+ }
376
+ if (this.props.highlightActiveLineGutter) {
377
+ extensions.push(highlightActiveLineGutter())
378
+ }
379
+ if (this.props.foldGutter) {
380
+ extensions.push(foldGutter())
381
+ }
382
+ if (this.props.lineWrapping) {
383
+ extensions.push(EditorView.lineWrapping)
384
+ }
385
+ if (this.props.editable === false) {
386
+ extensions.push(EditorView.editable.of(false))
387
+ }
388
+ if (this.props.readOnly) {
389
+ extensions.push(EditorState.readOnly.of(true))
390
+ }
391
+ if (this.props.spellcheck) {
392
+ extensions.push(EditorView.contentAttributes.of({ spellcheck: 'true' }))
393
+ }
394
+ if (this.direction) {
395
+ extensions.push(
396
+ EditorView.contentAttributes.of({
397
+ dir: this.direction
398
+ })
399
+ )
400
+ }
401
+ if (this.props.indentUnit) {
402
+ extensions.push(indentUnit.of(this.props.indentUnit))
403
+ }
404
+
405
+ return extensions
406
+ }
407
+
408
+ get baseExtensions() {
409
+ return [
410
+ // The extensions are based on codemirrors basic setup from 'codemirror'.
411
+ // It is recommended by CodeMirror, that if we want to configure
412
+ // our editor more precisely, we have to copy the source
413
+ // and adjust it as desired.
414
+ highlightSpecialChars(),
415
+ history(),
416
+ drawSelection(),
417
+ dropCursor(),
418
+ EditorState.allowMultipleSelections.of(true),
419
+ syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
420
+ bracketMatching(),
421
+ closeBrackets(),
422
+ autocompletion(),
423
+ rectangularSelection(),
424
+ crosshairCursor(),
425
+ highlightSelectionMatches(),
426
+ indentOnInput(),
427
+
428
+ keymap.of(this.keymaps)
429
+ ]
430
+ }
431
+
432
+ get keymaps(): KeyBinding[] {
433
+ // TODO: if more keymaps are added, list them in the docs as well (#Command keybinding)
434
+ const keymaps: KeyBinding[] = [
435
+ ...closeBracketsKeymap,
436
+ ...this.commandKeybinding,
437
+ ...historyKeymap,
438
+ ...foldKeymap,
439
+ ...completionKeymap,
440
+ ...lintKeymap
441
+
442
+ // TODO: style and include search & replace toolbar feature
443
+ // Note: the search & replace toolbar is not styled.
444
+ // If this feature is needed in the future, we need a decision about the styling.
445
+ // For now we turned the feature off, since RCE doesn't need it.
446
+ // ...searchKeymap
447
+ ]
448
+
449
+ if (this.props.indentWithTab) {
450
+ keymaps.push(indentWithTab)
451
+ }
452
+
453
+ return keymaps
454
+ }
455
+
456
+ get commandKeybinding() {
457
+ const { rtlMoveVisually } = this.props
458
+
459
+ if (this.direction === 'rtl' && !rtlMoveVisually) {
460
+ // we need to clone the original so that it doesn't get overridden
461
+ return merge(
462
+ cloneDeep(defaultKeymap),
463
+ rtlHorizontalArrowKeymap
464
+ ) as KeyBinding[]
465
+ }
466
+
467
+ return defaultKeymap
468
+ }
469
+
470
+ get themeExtension() {
471
+ const { styles } = this.props
472
+
473
+ if (!styles?.theme || !styles.highlightStyle) {
474
+ return
475
+ }
476
+
477
+ const theme = EditorView.theme(styles?.theme)
478
+ const highlightStyle = syntaxHighlighting(
479
+ HighlightStyle.define(styles?.highlightStyle)
480
+ )
481
+
482
+ // see notes in props.ts
483
+ // if (darkTheme) {
484
+ // theme = oneDarkTheme
485
+ // highlightStyle = syntaxHighlighting(oneDarkHighlightStyle)
486
+ // }
487
+
488
+ return [theme, highlightStyle]
489
+ }
490
+
491
+ get languageExtension() {
492
+ const { language } = this.props
493
+
494
+ switch (language) {
495
+ case 'json':
496
+ return json()
497
+ case 'js':
498
+ case 'jsx':
499
+ case 'javascript':
500
+ return javascript({ jsx: true, typescript: true })
501
+ case 'html':
502
+ return html({ matchClosingTags: true, autoCloseTags: true })
503
+ case 'css':
504
+ return css()
505
+ case 'markdown':
506
+ return markdown()
507
+ case 'sh':
508
+ case 'shell':
509
+ case 'bash': // ????
510
+ return StreamLanguage.define(shell)
511
+ case 'yml':
512
+ case 'yaml':
513
+ return StreamLanguage.define(yaml)
514
+ default:
515
+ return javascript({ jsx: true, typescript: true })
516
+ }
517
+ }
518
+
519
+ callOnChangeHandler(newValue: string) {
520
+ const { onChange, value } = this.props
521
+
522
+ this.addAnimationFrame(() => {
523
+ if (typeof onChange === 'function' && newValue !== value) {
524
+ onChange(newValue)
525
+ }
526
+ })
527
+ }
528
+
529
+ get onChangeExtension() {
530
+ return EditorState.changeFilter.of((transaction: Transaction) => {
531
+ if (!this._editorView) {
532
+ return false
533
+ }
534
+
535
+ if (transaction.docChanged) {
536
+ const newDoc = transaction.newDoc.toString()
537
+
538
+ if (this.isControlled) {
539
+ // the value will be changed by the onChange handler,
540
+ // refreshEditorValue has to run first
541
+ if (newDoc !== this.props.value) {
542
+ this._newSelectionAfterValueChange = transaction.selection
543
+ this.cancelAnimationFrames()
544
+ this.callOnChangeHandler(newDoc)
545
+ return false
546
+ } else {
547
+ return true
548
+ }
549
+ } else {
550
+ this.callOnChangeHandler(newDoc)
551
+ }
552
+ }
553
+
554
+ return true
555
+ })
556
+ }
557
+
558
+ get focusListenerExtension() {
559
+ const { onFocus, onBlur } = this.props
560
+
561
+ return EditorView.updateListener.of((update) => {
562
+ if (update.focusChanged && this._editorView) {
563
+ if (this.hasFocus) {
564
+ if (typeof onFocus === 'function') {
565
+ onFocus()
566
+ }
567
+ } else {
568
+ if (typeof onBlur === 'function') {
569
+ onBlur()
570
+ }
571
+ }
572
+ }
573
+ })
574
+ }
575
+
576
+ get announceLineNumberExtension() {
577
+ return EditorState.transactionExtender.of((tr) => {
578
+ const selection = tr.selection
579
+ const oldSelection = tr.startState.selection.main
580
+
581
+ if (selection && selection.main.empty && oldSelection.empty) {
582
+ const oldLine = tr.startState.doc.lineAt(oldSelection.head)
583
+ const newLine = tr.newDoc.lineAt(selection.main.head)
584
+ if (oldLine.number != newLine.number)
585
+ return {
586
+ effects: EditorView.announce.of(
587
+ tr.startState.phrase('line ') + newLine.number + '.'
588
+ )
589
+ }
590
+ }
591
+ return null
592
+ })
593
+ }
594
+
595
+ refreshExtensions() {
596
+ this.dispatchViewEffects(StateEffect.reconfigure.of(this.extensions))
597
+ }
598
+
599
+ refreshEditorValue() {
600
+ if (!this._editorView) return
601
+
602
+ const { value } = this.props
603
+
604
+ const currentValue = this._editorView.state.doc!.toString()
605
+
606
+ if (value && currentValue !== value) {
607
+ let userEvent
608
+ const lengthDiff = value.length - currentValue.length
609
+
610
+ // setting user events are needed for the autocomplete to work
611
+ // (only these 2 events, autocomplete doesn't work on paste, etc.)
612
+ if (lengthDiff === 1) {
613
+ userEvent = 'input.type'
614
+ } else if (lengthDiff === -1) {
615
+ userEvent = 'delete.backward'
616
+ }
617
+
618
+ this.dispatchViewChanges({
619
+ changes: {
620
+ from: 0,
621
+ to: currentValue.length,
622
+ insert: value || ''
623
+ },
624
+ selection: this._newSelectionAfterValueChange,
625
+ userEvent: userEvent
626
+ })
627
+ this._newSelectionAfterValueChange = undefined
628
+ }
629
+
630
+ if (this.props.indentOnLoad) {
631
+ this.indentAll()
632
+ }
633
+ }
634
+
635
+ render() {
636
+ const { label, styles, ...restProps } = this.props
637
+
638
+ return (
639
+ <div
640
+ ref={this.handleRef}
641
+ css={styles?.codeEditor}
642
+ {...passthroughProps(
643
+ omitProps(restProps, SourceCodeEditor.allowedProps)
644
+ )}
645
+ >
646
+ <label htmlFor={this._id}>
647
+ <ScreenReaderContent>{label}</ScreenReaderContent>
648
+ <div
649
+ ref={this.handleContainerRef}
650
+ css={styles?.codeEditorContainer}
651
+ />
652
+ </label>
653
+ </div>
654
+ )
655
+ }
656
+ }
657
+
658
+ export default SourceCodeEditor
659
+ export { SourceCodeEditor }