@@ -8,12 +8,12 @@ const Terminal = lazy(() => import('../Terminal/index.js'));
8
8
9
9
interface TerminalPanelProps {
10
10
theme : 'dark' | 'light' ;
11
- tutorialRunner : TutorialRunner
11
+ tutorialRunner : TutorialRunner ;
12
12
}
13
13
14
14
const ICON_MAP = new Map < TerminalPanelType , string > ( [
15
15
[ 'output' , 'i-ph-newspaper-duotone' ] ,
16
- [ 'terminal' , 'i-ph-terminal-window-duotone' ]
16
+ [ 'terminal' , 'i-ph-terminal-window-duotone' ] ,
17
17
] ) ;
18
18
19
19
export function TerminalPanel ( { theme, tutorialRunner } : TerminalPanelProps ) {
@@ -36,59 +36,65 @@ export function TerminalPanel({ theme, tutorialRunner }: TerminalPanelProps) {
36
36
< div className = "panel-container bg-tk-elements-app-backgroundColor" >
37
37
< div className = "panel-tabs-header overflow-x-hidden" >
38
38
< div className = "panel-title w-full" >
39
- < ul className = "flex h-full border-b border-tk-elements-app-borderColor w-full" role = "tablist" aria-orientation = "horizontal" >
40
- {
41
- terminalConfig . panels . map ( ( { type, name } , index ) => {
42
- const selected = tabIndex === index ;
39
+ < ul
40
+ className = "flex h-full border-b border-tk-elements-app-borderColor w-full"
41
+ role = "tablist"
42
+ aria-orientation = "horizontal"
43
+ >
44
+ { terminalConfig . panels . map ( ( { type, name } , index ) => {
45
+ const selected = tabIndex === index ;
43
46
44
- return (
45
- < li key = { index } >
46
- < button
47
- className = { classNames ( 'group h-full px-4 flex items-center gap-1.5 whitespace-nowrap text-sm position-relative border-r border-tk-elements-panel-headerTab-borderColor' , {
48
- 'bg-tk-elements-panel-headerTab-backgroundColor text-tk-elements-panel-headerTab-textColor hover:bg-tk-elements-panel-headerTab-backgroundColorHover hover:text-tk-elements-panel-headerTab-textColorHover hover:border-tk-elements-panel-headerTab-borderColorHover' : ! selected ,
49
- 'bg-tk-elements-panel-headerTab-backgroundColorActive text-tk-elements-panel-headerTab-textColorActive border-tk-elements-panel-headerTab-borderColorActive' : selected ,
47
+ return (
48
+ < li key = { index } >
49
+ < button
50
+ className = { classNames (
51
+ 'group h-full px-4 flex items-center gap-1.5 whitespace-nowrap text-sm position-relative border-r border-tk-elements-panel-headerTab-borderColor' ,
52
+ {
53
+ 'bg-tk-elements-panel-headerTab-backgroundColor text-tk-elements-panel-headerTab-textColor hover:bg-tk-elements-panel-headerTab-backgroundColorHover hover:text-tk-elements-panel-headerTab-textColorHover hover:border-tk-elements-panel-headerTab-borderColorHover' :
54
+ ! selected ,
55
+ 'bg-tk-elements-panel-headerTab-backgroundColorActive text-tk-elements-panel-headerTab-textColorActive border-tk-elements-panel-headerTab-borderColorActive' :
56
+ selected ,
50
57
'shadow-[0px_1px_0px_0px] shadow-tk-elements-panel-headerTab-backgroundColorActive' : selected ,
51
- 'border-l' : index > 0
52
- } ) }
53
- title = { name }
54
- aria-selected = { selected }
55
- onClick = { ( ) => setTabIndex ( index ) }
56
- >
57
- < span className = { classNames ( `text-tk-elements-panel-headerTab-iconColor ${ ICON_MAP . get ( type ) ?? '' } ` , {
58
+ 'border-l' : index > 0 ,
59
+ } ,
60
+ ) }
61
+ title = { name }
62
+ aria-selected = { selected }
63
+ onClick = { ( ) => setTabIndex ( index ) }
64
+ >
65
+ < span
66
+ className = { classNames ( `text-tk-elements-panel-headerTab-iconColor ${ ICON_MAP . get ( type ) ?? '' } ` , {
58
67
'group-hover:text-tk-elements-panel-headerTab-iconColorHover' : ! selected ,
59
- 'text-tk-elements-panel-headerTab-iconColorActive' : selected
60
- } ) } > </ span >
61
- { name }
62
- </ button >
63
- </ li >
64
- )
65
- } )
66
- }
68
+ 'text-tk-elements-panel-headerTab-iconColorActive' : selected ,
69
+ } ) }
70
+ > </ span >
71
+ { name }
72
+ </ button >
73
+ </ li >
74
+ ) ;
75
+ } ) }
67
76
</ ul >
68
77
</ div >
69
78
</ div >
70
79
< div className = "h-full overflow-hidden" >
71
- {
72
- domLoaded &&
73
- < Suspense >
74
- {
75
- terminalConfig . panels . map ( ( { id, type } , index ) => (
76
- < Terminal
77
- key = { id }
78
- className = { tabIndex !== index ? 'hidden' : '' }
79
- theme = { theme }
80
- readonly = { type === 'output' }
81
- onTerminalReady = { ( terminal ) => {
82
- tutorialRunner . attachTerminal ( id , terminal ) ;
83
- } }
84
- onTerminalResize = { ( cols , rows ) => {
85
- tutorialRunner . onTerminalResize ( cols , rows ) ;
86
- } }
87
- />
88
- ) )
89
- }
90
- </ Suspense >
91
- }
80
+ { domLoaded && (
81
+ < Suspense >
82
+ { terminalConfig . panels . map ( ( { id, type } , index ) => (
83
+ < Terminal
84
+ key = { id }
85
+ className = { tabIndex !== index ? 'hidden' : '' }
86
+ theme = { theme }
87
+ readonly = { type === 'output' }
88
+ onTerminalReady = { ( terminal ) => {
89
+ tutorialRunner . attachTerminal ( id , terminal ) ;
90
+ } }
91
+ onTerminalResize = { ( cols , rows ) => {
92
+ tutorialRunner . onTerminalResize ( cols , rows ) ;
93
+ } }
94
+ />
95
+ ) ) }
96
+ </ Suspense >
97
+ ) }
92
98
</ div >
93
99
</ div >
94
100
) ;
0 commit comments