-
Notifications
You must be signed in to change notification settings - Fork 738
/
Copy pathGraphQLEditor.tsx
796 lines (716 loc) · 22.5 KB
/
GraphQLEditor.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import { isNamedType, GraphQLSchema } from 'graphql'
import { List } from 'immutable'
// Query & Response Components
import ExecuteButton from './ExecuteButton'
import QueryEditor from './QueryEditor'
import EditorWrapper, { Container } from './EditorWrapper'
import CodeMirrorSizer from 'graphiql/dist/utility/CodeMirrorSizer'
import TopBar from './TopBar/TopBar'
import {
VariableEditorComponent,
HeadersEditorComponent,
} from './VariableEditor'
import Spinner from '../Spinner'
import Results from './Results'
import ResponseTracing from './ResponseTracing'
import { fillLeafs } from 'graphiql/dist/utility/fillLeafs'
import { getLeft, getTop } from 'graphiql/dist/utility/elementPosition'
// Explorer Components
import SideTab from './ExplorerTabs/SideTab'
import SideTabs from './ExplorerTabs/SideTabs'
import SDLView from './SchemaExplorer/SDLView'
import GraphDocs from './DocExplorer/GraphDocs'
import { styled } from '../../styled/index'
// Redux Dependencies
import { connect } from 'react-redux'
import { createStructuredSelector } from 'reselect'
import {
getQueryRunning,
getResponses,
getSubscriptionActive,
getVariableEditorOpen,
getVariableEditorHeight,
getResponseTracingOpen,
getResponseTracingHeight,
getResponseExtensions,
getCurrentQueryStartTime,
getCurrentQueryEndTime,
getTracingSupported,
getEditorFlex,
getQueryVariablesActive,
getHeaders,
getOperations,
getOperationName,
getHeadersCount,
getSelectedSessionIdFromRoot,
} from '../../state/sessions/selectors'
import {
updateQueryFacts,
stopQuery,
runQueryAtPosition,
closeQueryVariables,
openQueryVariables,
openVariables,
closeVariables,
openTracing,
closeTracing,
toggleTracing,
setEditorFlex,
toggleVariables,
fetchSchema,
} from '../../state/sessions/actions'
import { ResponseRecord } from '../../state/sessions/reducers'
import { getDocsOpen } from '../../state/docs/selectors'
import { changeWidthDocs } from '../../state/docs/actions'
/**
* The top-level React component for GraphQLEditor, intended to encompass the entire
* browser viewport.
*/
export interface Props {
onRef?: any
shareEnabled?: boolean
fixedEndpoint?: boolean
schema?: GraphQLSchema
}
export interface ReduxProps {
setStacks: (sessionId: string, stack: any[]) => void
updateQueryFacts: () => void
runQueryAtPosition: (position: number) => void
fetchSchema: () => void
openQueryVariables: () => void
closeQueryVariables: () => void
openVariables: (height: number) => void
closeVariables: (height: number) => void
openTracing: (height: number) => void
closeTracing: (height: number) => void
toggleTracing: () => void
toggleVariables: () => void
setEditorFlex: (flex: number) => void
stopQuery: (sessionId: string) => void
changeWidthDocs: (sessionId: string, width: number) => void
navStack: any[]
docsOpen: boolean
// sesion props
queryRunning: boolean
responses: List<ResponseRecord>
subscriptionActive: boolean
variableEditorOpen: boolean
variableEditorHeight: number
currentQueryStartTime?: Date
currentQueryEndTime?: Date
responseTracingOpen: boolean
responseTracingHeight: number
responseExtensions: any
tracingSupported?: boolean
editorFlex: number
headers: string
headersCount: number
queryVariablesActive: boolean
operationName: string
query: string
sessionId: string
}
export interface SimpleProps {
children?: any
}
export interface ToolbarButtonProps extends SimpleProps {
onClick: (e: any) => void
title: string
label: string
}
class GraphQLEditor extends React.PureComponent<Props & ReduxProps> {
public codeMirrorSizer
public queryEditorComponent
public variableEditorComponent
public resultComponent
public editorBarComponent
public docExplorerComponent: any // later React.Component<...>
public graphExplorerComponent: any
public schemaExplorerComponent: any
private queryResizer: any
private responseResizer: any
private queryVariablesRef
private httpHeadersRef
private containerComponent
private activeSideTabContent
componentDidMount() {
// Ensure a form of a schema exists (including `null`) and
// if not, fetch one using an introspection query.
// this.props.fetchSchema()
// Utility for keeping CodeMirror correctly sized.
this.codeMirrorSizer = new CodeMirrorSizer()
;(global as any).g = this
}
componentDidUpdate() {
// If this update caused DOM nodes to have changed sizes, update the
// corresponding CodeMirror instance sizes to match.
// const components = [
// this.queryEditorComponent,
// this.variableEditorComponent,
// this.resultComponent,
// ]
// this.codeMirrorSizer.updateSizes(components)
if (this.resultComponent && Boolean(this.props.subscriptionActive)) {
this.resultComponent.scrollTop = this.resultComponent.scrollHeight
}
}
render() {
return (
<Container ref={this.setContainerComponent}>
<EditorWrapper>
<TopBar
shareEnabled={this.props.shareEnabled}
/>
<EditorBar
ref={this.setEditorBarComponent}
onMouseDown={this.handleResizeStart}
>
<QueryWrap flex={this.props.editorFlex}>
<QueryEditor
getRef={this.setQueryEditorComponent}
schema={this.props.schema}
onHintInformationRender={this.handleHintInformationRender}
onRunQuery={this.runQueryAtCursor}
onClickReference={this.handleClickReference}
/>
<VariableEditor
isOpen={this.props.variableEditorOpen}
height={this.props.variableEditorHeight}
>
<VariableEditorTitle
isOpen={this.props.variableEditorOpen}
onMouseDown={this.handleVariableResizeStart}
>
<VariableEditorSubtitle
isOpen={this.props.queryVariablesActive}
ref={this.setQueryVariablesRef}
onClick={this.props.openQueryVariables}
>
Query Variables
</VariableEditorSubtitle>
<VariableEditorSubtitle
isOpen={!this.props.queryVariablesActive}
ref={this.setHttpHeadersRef}
onClick={this.props.closeQueryVariables}
>
{'HTTP Headers ' +
(this.props.headersCount && this.props.headersCount > 0
? `(${this.props.headersCount})`
: '')}
</VariableEditorSubtitle>
</VariableEditorTitle>
{this.props.queryVariablesActive ? (
<VariableEditorComponent
getRef={this.setVariableEditorComponent}
onHintInformationRender={
this.props.queryVariablesActive
? this.handleHintInformationRender
: undefined
}
onRunQuery={this.runQueryAtCursor}
/>
) : (
<HeadersEditorComponent
getRef={this.setVariableEditorComponent}
onHintInformationRender={
this.props.queryVariablesActive
? this.handleHintInformationRender
: undefined
}
onRunQuery={this.runQueryAtCursor}
/>
)}
</VariableEditor>
<QueryDragBar ref={this.setQueryResizer} />
</QueryWrap>
<ResultWrap>
<ResultDragBar ref={this.setResponseResizer} />
<ExecuteButton />
{this.props.queryRunning &&
this.props.responses.size === 0 && <Spinner />}
<Results setRef={this.setResultComponent} />
{!this.props.queryRunning &&
(!this.props.responses || this.props.responses.size === 0) && (
<Intro>Press the Play Button to get a response here</Intro>
)}
{this.props.subscriptionActive && (
<Listening>Listening …</Listening>
)}
<ResponseTracking
isOpen={this.props.responseTracingOpen}
height={this.props.responseTracingHeight}
>
<ResponseTrackingTitle
isOpen={this.props.responseTracingOpen}
onMouseDown={this.handleTracingResizeStart}
>
<VariableEditorSubtitle isOpen={false}>
Tracing
</VariableEditorSubtitle>
</ResponseTrackingTitle>
<ResponseTracing open={this.props.responseTracingOpen} />
</ResponseTracking>
</ResultWrap>
</EditorBar>
</EditorWrapper>
<SideTabs
sessionId={this.props.sessionId}
schema={this.props.schema}
setActiveContentRef={this.setSideTabActiveContentRef}
setWidth={this.setDocsWidth}
maxWidth={10000}
>
<SideTab label="Docs" activeColor="green" tabWidth="49px">
<GraphDocs
schema={this.props.schema}
ref={this.setDocExplorerRef}
/>
</SideTab>
<SideTab label="Schema" activeColor="blue" tabWidth="65px">
<SDLView
schema={this.props.schema}
ref={this.setSchemaExplorerRef}
sessionId={this.props.sessionId}
setWidth={this.setDocsWidth}
/>
</SideTab>
</SideTabs>
</Container>
)
}
setQueryVariablesRef = ref => {
this.queryVariablesRef = ref
}
setHttpHeadersRef = ref => {
this.httpHeadersRef = ref
}
setQueryResizer = ref => {
this.queryResizer = ReactDOM.findDOMNode(ref)
}
setResponseResizer = ref => {
this.responseResizer = ReactDOM.findDOMNode(ref)
}
setEditorBarComponent = ref => {
this.editorBarComponent = ref
}
setQueryEditorComponent = ref => {
this.queryEditorComponent = ref
}
setVariableEditorComponent = ref => {
this.variableEditorComponent = ref
}
setResultComponent = ref => {
this.resultComponent = ref
}
setDocExplorerRef = ref => {
if (ref) {
this.docExplorerComponent = ref.getWrappedInstance()
}
}
setGraphExplorerRef = ref => {
if (ref) {
this.graphExplorerComponent = ref.getWrappedInstance()
}
}
setSchemaExplorerRef = ref => {
if (ref) {
this.schemaExplorerComponent = ref
}
}
setContainerComponent = ref => {
this.containerComponent = ref
}
handleClickReference = reference => {
if (this.docExplorerComponent) {
this.docExplorerComponent.showDocFromType(reference.field || reference)
}
}
setSideTabActiveContentRef = ref => {
if (ref) {
this.activeSideTabContent = ref
}
}
/**
* Inspect the query, automatically filling in selection sets for non-leaf
* fields which do not yet have them.
*
* @public
*/
autoCompleteLeafs() {
const { insertions, result } = fillLeafs(
this.props.schema,
this.props.query,
) as {
insertions: Array<{ index: number; string: string }>
result: string
}
if (insertions && insertions.length > 0) {
const editor = this.queryEditorComponent.getCodeMirror()
editor.operation(() => {
const cursor = editor.getCursor()
const cursorIndex = editor.indexFromPos(cursor)
editor.setValue(result)
let added = 0
try {
/* tslint:disable-next-line */
const markers = insertions.map(({ index, string }) =>
editor.markText(
editor.posFromIndex(index + added),
editor.posFromIndex(index + (added += string.length)),
{
className: 'autoInsertedLeaf',
clearOnEnter: true,
title: 'Automatically added leaf fields',
},
),
)
setTimeout(() => markers.forEach(marker => marker.clear()), 7000)
} catch (e) {
//
}
let newCursorIndex = cursorIndex
/* tslint:disable-next-line */
insertions.forEach(({ index, string }) => {
if (index < cursorIndex && string) {
newCursorIndex += string.length
}
})
editor.setCursor(editor.posFromIndex(newCursorIndex))
})
}
return result
}
private runQueryAtCursor = () => {
if (this.props.queryRunning) {
this.props.stopQuery(this.props.sessionId)
return
}
const editor = this.queryEditorComponent.getCodeMirror()
const cursor = editor.getCursor()
const cursorIndex = editor.indexFromPos(cursor)
this.props.runQueryAtPosition(cursorIndex)
}
private handleHintInformationRender = elem => {
elem.addEventListener('click', this.onClickHintInformation)
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
mutation.removedNodes.forEach((removedNode) => {
if (removedNode === elem) {
elem.removeEventListener('click', this.onClickHintInformation);
observer.disconnect();
}
});
});
});
observer.observe(elem, { childList: true });
}
private handleResizeStart = downEvent => {
if (!this.didClickDragBar(downEvent)) {
return
}
downEvent.preventDefault()
const offset = downEvent.clientX - getLeft(downEvent.target)
let onMouseMove: any = moveEvent => {
if (moveEvent.buttons === 0) {
return onMouseUp()
}
const editorBar = ReactDOM.findDOMNode(this.editorBarComponent) as Element
const leftSize = moveEvent.clientX - getLeft(editorBar) - offset
const rightSize = editorBar.clientWidth - leftSize
this.props.setEditorFlex(leftSize / rightSize)
}
let onMouseUp: any = () => {
document.removeEventListener('mousemove', onMouseMove)
document.removeEventListener('mouseup', onMouseUp)
onMouseMove = null
onMouseUp = null
}
document.addEventListener('mousemove', onMouseMove)
document.addEventListener('mouseup', onMouseUp)
}
private didClickDragBar(event) {
// Only for primary unmodified clicks
return (
event.target === this.queryResizer ||
event.target === this.responseResizer
)
}
private handleTracingResizeStart = downEvent => {
downEvent.preventDefault()
let didMove = false
const hadHeight = this.props.responseTracingHeight
const offset = downEvent.clientY - getTop(downEvent.target)
let onMouseMove: any = moveEvent => {
if (moveEvent.buttons === 0) {
return onMouseUp()
}
didMove = true
const editorBar = ReactDOM.findDOMNode(this.editorBarComponent) as Element
const topSize = moveEvent.clientY - getTop(editorBar) - offset
const bottomSize = editorBar.clientHeight - topSize
if (bottomSize < 60) {
this.props.closeTracing(hadHeight)
} else {
this.props.openTracing(hadHeight)
}
}
let onMouseUp: any = () => {
if (!didMove) {
this.props.toggleTracing()
}
document.removeEventListener('mousemove', onMouseMove)
document.removeEventListener('mouseup', onMouseUp)
onMouseMove = null
onMouseUp = null
}
document.addEventListener('mousemove', onMouseMove)
document.addEventListener('mouseup', onMouseUp)
}
private handleVariableResizeStart = downEvent => {
downEvent.preventDefault()
let didMove = false
const wasOpen = this.props.variableEditorOpen
const hadHeight = this.props.variableEditorHeight
const offset = downEvent.clientY - getTop(downEvent.target)
if (
wasOpen &&
(downEvent.target === this.queryVariablesRef ||
downEvent.target === this.httpHeadersRef)
) {
return
}
let onMouseMove: any = moveEvent => {
if (moveEvent.buttons === 0) {
return onMouseUp()
}
didMove = true
const editorBar = ReactDOM.findDOMNode(this.editorBarComponent) as Element
const topSize = moveEvent.clientY - getTop(editorBar) - offset
const bottomSize = editorBar.clientHeight - topSize
if (bottomSize < 60) {
this.props.closeVariables(hadHeight)
} else {
this.props.openVariables(bottomSize)
}
}
let onMouseUp: any = () => {
if (!didMove) {
this.props.toggleVariables()
}
document.removeEventListener('mousemove', onMouseMove)
document.removeEventListener('mouseup', onMouseUp)
onMouseMove = null
onMouseUp = null
}
document.addEventListener('mousemove', onMouseMove)
document.addEventListener('mouseup', onMouseUp)
}
private onClickHintInformation = event => {
if (event.target.className === 'typeName') {
const typeName = event.target.innerHTML
const schema = this.props.schema
if (schema) {
// TODO: There is no way as of now to retrieve the NAMED_TYPE of a GraphQLList(Type).
// We're therefore removing any '[' or '!' characters, to properly find its NAMED_TYPE. (eg. [Type!]! => Type)
// This should be removed as soon as there's a safer way to do that.
const namedTypeName = typeName.replace(/[\]\[!]/g, '')
const type = schema.getType(namedTypeName)
if (isNamedType(type)) {
this.docExplorerComponent.showDocFromType(type)
}
}
}
}
private setDocsWidth = (props: any = this.props) => {
if (!this.activeSideTabContent) {
return
}
if (!this.props.docsOpen) {
return
}
requestAnimationFrame(() => {
const width = this.activeSideTabContent.getWidth()
const maxWidth = this.containerComponent.getWidth() - 86
this.props.changeWidthDocs(props.sessionId, Math.min(width, maxWidth))
})
}
}
const mapStateToProps = createStructuredSelector({
queryRunning: getQueryRunning,
responses: getResponses,
subscriptionActive: getSubscriptionActive,
variableEditorOpen: getVariableEditorOpen,
variableEditorHeight: getVariableEditorHeight,
responseTracingOpen: getResponseTracingOpen,
responseTracingHeight: getResponseTracingHeight,
responseExtensions: getResponseExtensions,
currentQueryStartTime: getCurrentQueryStartTime,
currentQueryEndTime: getCurrentQueryEndTime,
tracingSupported: getTracingSupported,
editorFlex: getEditorFlex,
queryVariablesActive: getQueryVariablesActive,
headers: getHeaders,
operations: getOperations,
operationName: getOperationName,
headersCount: getHeadersCount,
sessionId: getSelectedSessionIdFromRoot,
docsOpen: getDocsOpen,
})
export default // TODO fix redux types
connect<any, any, any>(
mapStateToProps,
{
updateQueryFacts,
stopQuery,
runQueryAtPosition,
openQueryVariables,
closeQueryVariables,
openVariables,
closeVariables,
openTracing,
closeTracing,
toggleTracing,
setEditorFlex,
toggleVariables,
fetchSchema,
changeWidthDocs,
},
null,
{
forwardRef: true,
},
)(GraphQLEditor)
const EditorBar = styled.div`
display: flex;
flex-direction: row;
flex: 1;
height: 100%;
`
const ResultWrap = styled.div`
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
position: relative;
border-left: none;
background: ${p => p.theme.editorColours.resultBackground};
overflow-anchor: auto;
`
const DragBar = styled.div`
width: 15px;
position: absolute;
top: 0;
bottom: 0;
cursor: col-resize;
`
const QueryDragBar = styled(DragBar)`
right: 0px;
`
const ResultDragBar = styled(DragBar)`
left: 0px;
z-index: 1;
`
interface DrawerProps {
isOpen: boolean
height: number
}
const BottomDrawer = styled<DrawerProps, 'div'>('div')`
display: flex;
background: #0b1924;
flex-direction: column;
position: relative;
height: ${props => (props.isOpen ? `${props.height}px` : '43px')};
`
interface TitleProps {
isOpen: boolean
onMouseDown?: any
onClick?: any
ref?: any
}
const BottomDrawerTitle = styled.div`
background: #0b1924;
text-transform: uppercase;
font-weight: 600;
letter-spacing: 0.53px;
line-height: 14px;
font-size: 14px;
padding: 14px 14px 15px 21px;
user-select: none;
`
const VariableEditor = styled(BottomDrawer)`
.CodeMirror {
padding-left: 4px;
width: calc(100% - 4px);
background: ${p => p.theme.editorColours.leftDrawerBackground};
}
.CodeMirror-lines {
padding: 10px 0 20px 0;
}
.CodeMirror-linenumbers {
background: ${p => p.theme.editorColours.leftDrawerBackground};
}
`
const VariableEditorTitle = styled<TitleProps>(({ isOpen, ...rest }) => (
<BottomDrawerTitle {...rest} />
))`
cursor: ${p => (p.isOpen ? 'row-resize' : 'n-resize')};
background: ${p => p.theme.editorColours.leftDrawerBackground};
`
const VariableEditorSubtitle = styled<TitleProps, 'span'>('span')`
margin-right: 10px;
cursor: pointer;
color: ${p =>
p.isOpen
? p.theme.editorColours.drawerText
: p.theme.editorColours.drawerTextInactive};
&:last-child {
margin-right: 0;
}
`
const ResponseTracking = styled(BottomDrawer)`
background: ${p => p.theme.editorColours.rightDrawerBackground};
`
const ResponseTrackingTitle = styled<TitleProps>(({ isOpen, ...rest }) => (
<BottomDrawerTitle {...rest} />
))`
text-align: right;
background: ${p => p.theme.editorColours.rightDrawerBackground};
cursor: ${props => (props.isOpen ? 's-resize' : 'n-resize')};
color: ${p => p.theme.editorColours.drawerTextInactive};
`
interface QueryProps {
flex: number
}
const QueryWrap = styled<QueryProps, 'div'>('div')`
position: relative;
display: flex;
flex-direction: column;
flex: ${props => props.flex} 1 0%;
border-top: 8px solid ${props => props.theme.editorColours.resultBackground};
`
const Intro = styled.div`
width: 235px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: ${p => p.theme.colours.textInactive};
font-size: ${p => p.theme.sizes.small16};
font-family: 'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono',
'Monaco', monospace;
text-align: center;
letter-spacing: 0.6px;
`
const Listening = styled.div`
position: absolute;
bottom: 0;
color: ${p => p.theme.editorColours.text};
background: ${p => p.theme.editorColours.resultBackground};
font-size: ${p => p.theme.sizes.small16};
font-family: ${p => p.theme.settings['editor.fontFamily']};
letter-spacing: 0.6px;
padding-left: 24px;
padding-bottom: 60px;
`