From b6203aea86aaddcd279d693290d17f8bd06c9188 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 21 Feb 2024 17:18:08 +0100 Subject: [PATCH] first v --- .../lib/components/remix-ui-terminal-bar.tsx | 14 ++-- .../remix-ui-terminal-menu-buttons.tsx | 10 ++- .../lib/components/remix-ui-terminal-menu.tsx | 14 ++-- .../src/lib/remix-ui-terminal-wrapper.tsx | 8 +-- .../terminal/src/lib/remix-ui-terminal.tsx | 5 +- .../terminal/src/lib/types/terminalTypes.ts | 6 +- .../remix-ui-terminal-menu-xterm.tsx | 45 ++++++------ .../lib/components/remix-ui-xterminals.tsx | 20 +++--- libs/remix-ui/xterm/src/lib/css/index.css | 71 +------------------ 9 files changed, 71 insertions(+), 122 deletions(-) diff --git a/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-bar.tsx b/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-bar.tsx index 0321ec7ffe..f88efce844 100644 --- a/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-bar.tsx +++ b/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-bar.tsx @@ -22,16 +22,20 @@ export const RemixUITerminalBar = (props: RemixUiTerminalProps) => { return (<>
-
+
{platform === appPlatformTypes.desktop ? - <> +
{xtermState.showOutput? : } - : +
: } -
-
) +
+ ) } \ No newline at end of file diff --git a/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-menu-buttons.tsx b/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-menu-buttons.tsx index 4201e74d13..1ae7a63f1f 100644 --- a/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-menu-buttons.tsx +++ b/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-menu-buttons.tsx @@ -17,9 +17,13 @@ export const RemixUITerminalMenuButtons = (props: RemixUiTerminalProps) => { } return ( -
- - +
+ +
) } \ No newline at end of file diff --git a/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-menu.tsx b/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-menu.tsx index 0bd6eae755..f24695079d 100644 --- a/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-menu.tsx +++ b/libs/remix-ui/terminal/src/lib/components/remix-ui-terminal-menu.tsx @@ -26,12 +26,7 @@ export const RemixUITerminalMenu = (props: RemixUiTerminalProps) => { dispatch({ type: 'search', payload: arg0 }) } - return (<> -
- }> - - -
+ return (
}>
0
@@ -72,5 +67,10 @@ export const RemixUITerminalMenu = (props: RemixUiTerminalProps) => { data-id="terminalInputSearch" />
- ) +
+ }> + + +
+
) } \ No newline at end of file diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal-wrapper.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal-wrapper.tsx index 4c0f439ebc..d21123eaef 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal-wrapper.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal-wrapper.tsx @@ -23,10 +23,10 @@ export const RemixUITerminalWrapper = (props: RemixUiTerminalProps) => { {platform !== appPlatformTypes.desktop && } {platform === appPlatformTypes.desktop && - <> - - - + <> + + + } ) diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index c48eff1d12..f3c6c983e8 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -579,9 +579,8 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { const classNameBlock = 'remix_ui_terminal_block px-4 py-1 text-break' return ( - ( !props.visible? <>: -
- + ( props.visible && +
{handleAutoComplete()}
diff --git a/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts b/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts index 5977707fcc..52e667badb 100644 --- a/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts +++ b/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts @@ -31,7 +31,7 @@ export const SEARCH = 'search' export const SET_ISVM = 'setIsVM' export interface RemixUiTerminalProps { - plugin: any, - onReady: (api: any) => void, - visible: boolean, + plugin: any, + onReady: (api: any) => void, + visible: boolean, } diff --git a/libs/remix-ui/xterm/src/lib/components/remix-ui-terminal-menu-xterm.tsx b/libs/remix-ui/xterm/src/lib/components/remix-ui-terminal-menu-xterm.tsx index 931265b40d..4da0a3a3bc 100644 --- a/libs/remix-ui/xterm/src/lib/components/remix-ui-terminal-menu-xterm.tsx +++ b/libs/remix-ui/xterm/src/lib/components/remix-ui-terminal-menu-xterm.tsx @@ -26,30 +26,35 @@ export const RemixUIXtermMenu = (props: RemixUiTerminalProps) => { } return (<> -
- - - - - - {xtermState.shells.map((shell, index) => { - return ( await onCreateTerminal(shell)}>{shell}) - })} - - -
+
}> - + + +
+
onClearTerminal()}> + }> + - +
) } \ No newline at end of file diff --git a/libs/remix-ui/xterm/src/lib/components/remix-ui-xterminals.tsx b/libs/remix-ui/xterm/src/lib/components/remix-ui-xterminals.tsx index 04760cff04..54ab6630a6 100644 --- a/libs/remix-ui/xterm/src/lib/components/remix-ui-xterminals.tsx +++ b/libs/remix-ui/xterm/src/lib/components/remix-ui-xterminals.tsx @@ -141,27 +141,31 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => { }, [xtermState.showOutput]) return (<> -
+
<> - -
+ { xtermState.showOutput &&
{terminals.map((xtermState) => { return ( -
+
) })} -
+
{terminals.map((xtermState, index) => { - return () + return () })}
+ }
- - ) } diff --git a/libs/remix-ui/xterm/src/lib/css/index.css b/libs/remix-ui/xterm/src/lib/css/index.css index d7a13a031f..23098fd6ba 100644 --- a/libs/remix-ui/xterm/src/lib/css/index.css +++ b/libs/remix-ui/xterm/src/lib/css/index.css @@ -1,70 +1,3 @@ -.remix-ui-xterminals-container { - display: flex; - flex-direction: row; - flex: 1; -} -.xterm-panel { - display: flex; - flex-direction: column; - flex: 1; -} - -.remix-ui-xterminals-buttons { - display: flex; - flex-direction: column; -} - -.hide-xterm{ - display: none; -} - -.show-xterm{ - display: block; -} - -.xterm-btn-active { - background-color: var(--primary); -} -.xterm-btn-none { - background-color: var(--secondary); -} - -.xterm-terminal { - flex-grow: 1; - height: 100%; - width: 100%; -} - -.xterm-panel-header-right { - display: flex; - flex-direction: row; - justify-content: flex-end; - align-self: flex-end; -} - -.xterm-panel-header { - display: flex; - flex-direction: row; - -} - -.xterm-panel-header-left { - display: flex; - flex-direction: row; - flex-grow: 1; -} - -.remix-ui-xterminals-section { - display: flex; - flex-direction: row; - width: 100%; - z-index: 3; -} - -.hide-terminals { - width: 0; -} - -.show-terminals { - width: 100%; +.xterm-panel-left { + overflow: scroll; }