@@ -519,15 +519,14 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = props => {
519
519
< div className = "graphiql-main" >
520
520
< div
521
521
ref = { pluginResize . firstRef }
522
+ className = "graphiql-plugin"
522
523
style = { {
523
524
// Make sure the container shrinks when containing long
524
525
// non-breaking texts
525
526
minWidth : '200px' ,
526
527
} }
527
528
>
528
- < div className = "graphiql-plugin" >
529
- { PluginContent ? < PluginContent /> : null }
530
- </ div >
529
+ { PluginContent ? < PluginContent /> : null }
531
530
</ div >
532
531
{ pluginContext ?. visiblePlugin && (
533
532
< div
@@ -541,6 +540,7 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = props => {
541
540
values = { editorContext . tabs }
542
541
onReorder = { handleReorder }
543
542
aria-label = "Select active operation"
543
+ className = "no-scrollbar"
544
544
>
545
545
{ editorContext . tabs . map ( ( tab , index , tabs ) => (
546
546
< Tab
@@ -577,141 +577,136 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = props => {
577
577
id = "graphiql-session" // used by aria-controls="graphiql-session"
578
578
aria-labelledby = { `${ TAB_CLASS_PREFIX } ${ editorContext . activeTabIndex } ` }
579
579
>
580
- < div ref = { editorResize . firstRef } >
581
- < div className = "graphiql-editors" >
582
- < div ref = { editorToolsResize . firstRef } >
583
- < section
584
- className = "graphiql-query-editor"
585
- aria-label = "Query Editor"
586
- >
587
- < QueryEditor
588
- editorTheme = { props . editorTheme }
589
- keyMap = { props . keyMap }
590
- onClickReference = { onClickReference }
591
- onCopyQuery = { props . onCopyQuery }
592
- onPrettifyQuery = { props . onPrettifyQuery }
593
- onEdit = { props . onEditQuery }
594
- readOnly = { props . readOnly }
595
- />
596
- < div
597
- className = "graphiql-toolbar"
598
- role = "toolbar"
599
- aria-label = "Editor Commands"
600
- >
601
- < ExecuteButton />
602
- { toolbar }
603
- </ div >
604
- </ section >
580
+ < div className = "graphiql-editors" ref = { editorResize . firstRef } >
581
+ < section
582
+ className = "graphiql-query-editor"
583
+ aria-label = "Query Editor"
584
+ ref = { editorToolsResize . firstRef }
585
+ >
586
+ < QueryEditor
587
+ editorTheme = { props . editorTheme }
588
+ keyMap = { props . keyMap }
589
+ onClickReference = { onClickReference }
590
+ onCopyQuery = { props . onCopyQuery }
591
+ onPrettifyQuery = { props . onPrettifyQuery }
592
+ onEdit = { props . onEditQuery }
593
+ readOnly = { props . readOnly }
594
+ />
595
+ < div
596
+ className = "graphiql-toolbar"
597
+ role = "toolbar"
598
+ aria-label = "Editor Commands"
599
+ >
600
+ < ExecuteButton />
601
+ { toolbar }
605
602
</ div >
603
+ </ section >
606
604
607
- < div ref = { editorToolsResize . dragBarRef } >
608
- < div className = "graphiql-editor-tools" >
609
- < UnStyledButton
610
- type = "button"
611
- className = { cn (
612
- activeSecondaryEditor === 'variables' &&
613
- editorToolsResize . hiddenElement !== 'second' &&
614
- 'active' ,
615
- ) }
616
- onClick = { handleToolsTabClick }
617
- data-name = "variables"
618
- >
619
- Variables
620
- </ UnStyledButton >
621
- { isHeadersEditorEnabled && (
622
- < UnStyledButton
623
- type = "button"
624
- className = { cn (
625
- activeSecondaryEditor === 'headers' &&
626
- editorToolsResize . hiddenElement !== 'second' &&
627
- 'active' ,
628
- ) }
629
- onClick = { handleToolsTabClick }
630
- data-name = "headers"
631
- >
632
- Headers
633
- </ UnStyledButton >
605
+ < div
606
+ ref = { editorToolsResize . dragBarRef }
607
+ className = "graphiql-editor-tools"
608
+ >
609
+ < UnStyledButton
610
+ type = "button"
611
+ className = { cn (
612
+ activeSecondaryEditor === 'variables' &&
613
+ editorToolsResize . hiddenElement !== 'second' &&
614
+ 'active' ,
615
+ ) }
616
+ onClick = { handleToolsTabClick }
617
+ data-name = "variables"
618
+ >
619
+ Variables
620
+ </ UnStyledButton >
621
+ { isHeadersEditorEnabled && (
622
+ < UnStyledButton
623
+ type = "button"
624
+ className = { cn (
625
+ activeSecondaryEditor === 'headers' &&
626
+ editorToolsResize . hiddenElement !== 'second' &&
627
+ 'active' ,
634
628
) }
629
+ onClick = { handleToolsTabClick }
630
+ data-name = "headers"
631
+ >
632
+ Headers
633
+ </ UnStyledButton >
634
+ ) }
635
635
636
- < Tooltip
637
- label = {
638
- editorToolsResize . hiddenElement === 'second'
639
- ? 'Show editor tools'
640
- : 'Hide editor tools'
641
- }
642
- >
643
- < UnStyledButton
644
- type = "button"
645
- onClick = { toggleEditorTools }
646
- aria-label = {
647
- editorToolsResize . hiddenElement === 'second'
648
- ? 'Show editor tools'
649
- : 'Hide editor tools'
650
- }
651
- className = "graphiql-toggle-editor-tools"
652
- >
653
- { editorToolsResize . hiddenElement === 'second' ? (
654
- < ChevronUpIcon
655
- className = "graphiql-chevron-icon"
656
- aria-hidden = "true"
657
- />
658
- ) : (
659
- < ChevronDownIcon
660
- className = "graphiql-chevron-icon"
661
- aria-hidden = "true"
662
- />
663
- ) }
664
- </ UnStyledButton >
665
- </ Tooltip >
666
- </ div >
667
- </ div >
668
-
669
- < div ref = { editorToolsResize . secondRef } >
670
- < section
671
- className = "graphiql-editor-tool"
636
+ < Tooltip
637
+ label = {
638
+ editorToolsResize . hiddenElement === 'second'
639
+ ? 'Show editor tools'
640
+ : 'Hide editor tools'
641
+ }
642
+ >
643
+ < UnStyledButton
644
+ type = "button"
645
+ onClick = { toggleEditorTools }
672
646
aria-label = {
673
- activeSecondaryEditor === 'variables '
674
- ? 'Variables '
675
- : 'Headers '
647
+ editorToolsResize . hiddenElement === 'second '
648
+ ? 'Show editor tools '
649
+ : 'Hide editor tools '
676
650
}
651
+ className = "graphiql-toggle-editor-tools"
677
652
>
678
- < VariableEditor
679
- editorTheme = { props . editorTheme }
680
- isHidden = { activeSecondaryEditor !== 'variables' }
681
- keyMap = { props . keyMap }
682
- onEdit = { props . onEditVariables }
683
- onClickReference = { onClickReference }
684
- readOnly = { props . readOnly }
685
- />
686
- { isHeadersEditorEnabled && (
687
- < HeaderEditor
688
- editorTheme = { props . editorTheme }
689
- isHidden = { activeSecondaryEditor !== 'headers' }
690
- keyMap = { props . keyMap }
691
- onEdit = { props . onEditHeaders }
692
- readOnly = { props . readOnly }
653
+ { editorToolsResize . hiddenElement === 'second' ? (
654
+ < ChevronUpIcon
655
+ className = "graphiql-chevron-icon"
656
+ aria-hidden = "true"
657
+ />
658
+ ) : (
659
+ < ChevronDownIcon
660
+ className = "graphiql-chevron-icon"
661
+ aria-hidden = "true"
693
662
/>
694
663
) }
695
- </ section >
696
- </ div >
664
+ </ UnStyledButton >
665
+ </ Tooltip >
697
666
</ div >
667
+
668
+ < section
669
+ className = "graphiql-editor-tool"
670
+ aria-label = {
671
+ activeSecondaryEditor === 'variables'
672
+ ? 'Variables'
673
+ : 'Headers'
674
+ }
675
+ ref = { editorToolsResize . secondRef }
676
+ >
677
+ < VariableEditor
678
+ editorTheme = { props . editorTheme }
679
+ isHidden = { activeSecondaryEditor !== 'variables' }
680
+ keyMap = { props . keyMap }
681
+ onEdit = { props . onEditVariables }
682
+ onClickReference = { onClickReference }
683
+ readOnly = { props . readOnly }
684
+ />
685
+ { isHeadersEditorEnabled && (
686
+ < HeaderEditor
687
+ editorTheme = { props . editorTheme }
688
+ isHidden = { activeSecondaryEditor !== 'headers' }
689
+ keyMap = { props . keyMap }
690
+ onEdit = { props . onEditHeaders }
691
+ readOnly = { props . readOnly }
692
+ />
693
+ ) }
694
+ </ section >
698
695
</ div >
699
696
700
697
< div
701
698
className = "graphiql-horizontal-drag-bar"
702
699
ref = { editorResize . dragBarRef }
703
700
/>
704
701
705
- < div ref = { editorResize . secondRef } >
706
- < div className = "graphiql-response" >
707
- { executionContext . isFetching ? < Spinner /> : null }
708
- < ResponseEditor
709
- editorTheme = { props . editorTheme }
710
- responseTooltip = { props . responseTooltip }
711
- keyMap = { props . keyMap }
712
- />
713
- { footer }
714
- </ div >
702
+ < div className = "graphiql-response" ref = { editorResize . secondRef } >
703
+ { executionContext . isFetching ? < Spinner /> : null }
704
+ < ResponseEditor
705
+ editorTheme = { props . editorTheme }
706
+ responseTooltip = { props . responseTooltip }
707
+ keyMap = { props . keyMap }
708
+ />
709
+ { footer }
715
710
</ div >
716
711
</ div >
717
712
</ div >
@@ -727,7 +722,7 @@ export const GraphiQLInterface: FC<GraphiQLInterfaceProps> = props => {
727
722
< Dialog . Close />
728
723
</ div >
729
724
< div className = "graphiql-dialog-section" >
730
- < ShortKeys keyMap = { props . keyMap || 'sublime' } />
725
+ < ShortKeys keyMap = { props . keyMap } />
731
726
</ div >
732
727
</ Dialog >
733
728
< Dialog
@@ -856,7 +851,12 @@ const SHORT_KEYS = Object.entries({
856
851
'Re-fetch schema using introspection' : [ 'Ctrl' , 'Shift' , 'R' ] ,
857
852
} ) ;
858
853
859
- const ShortKeys : FC < { keyMap : string } > = ( { keyMap } ) => {
854
+ interface ShortKeysProps {
855
+ /** @default 'sublime' */
856
+ keyMap ?: string ;
857
+ }
858
+
859
+ const ShortKeys : FC < ShortKeysProps > = ( { keyMap = 'sublime' } ) => {
860
860
return (
861
861
< div >
862
862
< table className = "graphiql-table" >
0 commit comments