@mks2508/mks-ui 0.3.1 → 0.4.0
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.
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts +146 -0
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.js +213 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts +55 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.js +68 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts +43 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.js +59 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts +63 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.js +109 -0
- package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts +351 -0
- package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts +60 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.js +183 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts +111 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.js +185 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.js +143 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts +87 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.js +135 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts +160 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.js +185 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts +48 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.js +139 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts +60 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.js +352 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts +36 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.js +52 -0
- package/dist/react-ui/blocks/Terminal/components/index.d.ts +10 -0
- package/dist/react-ui/blocks/Terminal/components/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/index.js +4 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.d.ts +11 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.js +2 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts +69 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.js +162 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts +104 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.js +180 -0
- package/dist/react-ui/blocks/Terminal/index.d.ts +39 -0
- package/dist/react-ui/blocks/Terminal/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/index.js +38 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.js +222 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts +74 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.js +168 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts +42 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.js +175 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts +43 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts +38 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.js +62 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts +67 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts +32 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.js +326 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts +36 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.js +371 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts +67 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.js +417 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts +197 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts +54 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.js +193 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts +57 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts +30 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.js +126 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts +31 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.js +149 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts +35 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts +63 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.js +245 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts +24 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.js +225 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts +35 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.js +187 -0
- package/dist/react-ui/blocks/Terminal/panel/index.d.ts +30 -0
- package/dist/react-ui/blocks/Terminal/panel/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module-Bovc57nm.css +60 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.js +5 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module-QyxHO7cN.css +60 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.js +5 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts +73 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.js +136 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts +117 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.js +174 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts +221 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts +184 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.js +478 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts +173 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.js +313 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts +181 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.js +221 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts +69 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.js +142 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts +125 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.js +245 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts +165 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.js +225 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts +164 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.js +285 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts +188 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.js +178 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts +12 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/index.d.ts +24 -0
- package/dist/react-ui/blocks/Terminal/parsing/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts +56 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts +140 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.js +325 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts +10 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/index.d.ts +11 -0
- package/dist/react-ui/blocks/index.d.ts.map +1 -0
- package/dist/react-ui/icons/lucide-animated/activity.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bell-electric.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bell.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bot.js +1 -1
- package/dist/react-ui/icons/lucide-animated/box.js +1 -1
- package/dist/react-ui/icons/lucide-animated/circle-check.js +1 -1
- package/dist/react-ui/icons/lucide-animated/delete.js +1 -1
- package/dist/react-ui/icons/lucide-animated/download.js +1 -1
- package/dist/react-ui/icons/lucide-animated/home.js +1 -1
- package/dist/react-ui/icons/lucide-animated/layout-panel-top.js +1 -1
- package/dist/react-ui/icons/lucide-animated/plus.js +1 -1
- package/dist/react-ui/icons/lucide-animated/search.js +1 -1
- package/dist/react-ui/icons/lucide-animated/settings.js +1 -1
- package/dist/react-ui/icons/lucide-animated/trending-down.js +1 -1
- package/dist/react-ui/icons/lucide-animated/trending-up.js +1 -1
- package/dist/react-ui/icons/lucide-animated/x.js +1 -1
- package/dist/react-ui/index.js +4 -1
- package/dist/react-ui/lib/icon-wrapper.d.ts +37 -0
- package/dist/react-ui/lib/icon-wrapper.d.ts.map +1 -0
- package/dist/react-ui/lib/icon-wrapper.js +55 -0
- package/dist/react-ui/lib/index.d.ts +1 -0
- package/dist/react-ui/lib/index.d.ts.map +1 -1
- package/dist/react-ui/lib/index.js +1 -0
- package/dist/react-ui/primitives/AutoHeight/index.d.ts +1 -1
- package/dist/react-ui/primitives/CountingNumber/index.d.ts +1 -1
- package/dist/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.d.ts +1 -1
- package/dist/react-ui/primitives/waapi/SlidingText/SlidingText.styles.d.ts +1 -1
- package/dist/react-ui/ui/Accordion/Accordion.styles.d.ts +1 -1
- package/dist/react-ui/ui/Accordion/Accordion.types.d.ts +1 -1
- package/dist/react-ui/ui/AlertDialog/AlertDialog.styles.d.ts +1 -1
- package/dist/react-ui/ui/AlertDialog/AlertDialog.types.d.ts +1 -1
- package/dist/react-ui/ui/Badge/Badge.styles.d.ts +1 -1
- package/dist/react-ui/ui/Badge/Badge.types.d.ts +1 -1
- package/dist/react-ui/ui/Button/Button.styles.d.ts +2 -2
- package/dist/react-ui/ui/Button/Button.types.d.ts +1 -1
- package/dist/react-ui/ui/Card/Card.styles.d.ts +1 -1
- package/dist/react-ui/ui/Card/Card.types.d.ts +1 -1
- package/dist/react-ui/ui/Checkbox/Checkbox.styles.d.ts +1 -1
- package/dist/react-ui/ui/Checkbox/Checkbox.types.d.ts +1 -1
- package/dist/react-ui/ui/Combobox/Combobox.styles.d.ts +1 -1
- package/dist/react-ui/ui/Combobox/Combobox.types.d.ts +1 -1
- package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.d.ts +2 -2
- package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.js +1 -1
- package/dist/react-ui/ui/CornerBracket/CornerBracket.types.d.ts +1 -1
- package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts +1 -1
- package/dist/react-ui/ui/DataCard/DataCard.types.d.ts +1 -1
- package/dist/react-ui/ui/DataCard/index.d.ts +1 -1
- package/dist/react-ui/ui/Dialog/Dialog.styles.d.ts +1 -1
- package/dist/react-ui/ui/Dialog/Dialog.types.d.ts +1 -1
- package/dist/react-ui/ui/DropdownMenu/DropdownMenu.styles.d.ts +1 -1
- package/dist/react-ui/ui/DropdownMenu/DropdownMenu.types.d.ts +1 -1
- package/dist/react-ui/ui/Field/Field.styles.d.ts +1 -1
- package/dist/react-ui/ui/Field/Field.types.d.ts +1 -1
- package/dist/react-ui/ui/Input/Input.styles.d.ts +1 -1
- package/dist/react-ui/ui/Input/Input.types.d.ts +1 -1
- package/dist/react-ui/ui/InputGroup/InputGroup.styles.d.ts +1 -1
- package/dist/react-ui/ui/InputGroup/InputGroup.types.d.ts +1 -1
- package/dist/react-ui/ui/Label/Label.styles.d.ts +1 -1
- package/dist/react-ui/ui/Label/Label.types.d.ts +1 -1
- package/dist/react-ui/ui/Menu/Menu.styles.d.ts +1 -1
- package/dist/react-ui/ui/Menu/Menu.types.d.ts +2 -2
- package/dist/react-ui/ui/Popover/Popover.styles.d.ts +1 -1
- package/dist/react-ui/ui/Popover/Popover.types.d.ts +1 -1
- package/dist/react-ui/ui/Progress/Progress.styles.d.ts +1 -1
- package/dist/react-ui/ui/Progress/Progress.types.d.ts +2 -2
- package/dist/react-ui/ui/Select/Select.styles.d.ts +1 -1
- package/dist/react-ui/ui/Select/Select.types.d.ts +1 -1
- package/dist/react-ui/ui/Separator/Separator.styles.d.ts +1 -1
- package/dist/react-ui/ui/Separator/Separator.types.d.ts +1 -1
- package/dist/react-ui/ui/Switch/Switch.styles.d.ts +1 -1
- package/dist/react-ui/ui/Switch/Switch.types.d.ts +1 -1
- package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts +43 -25
- package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/Tabs.styles.js +105 -13
- package/dist/react-ui/ui/Tabs/Tabs.types.d.ts +9 -6
- package/dist/react-ui/ui/Tabs/Tabs.types.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/index.d.ts +18 -9
- package/dist/react-ui/ui/Tabs/index.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/index.js +99 -27
- package/dist/react-ui/ui/TextFlow/TextFlow.styles.d.ts +1 -1
- package/dist/react-ui/ui/Textarea/Textarea.styles.d.ts +1 -1
- package/dist/react-ui/ui/Textarea/Textarea.types.d.ts +1 -1
- package/dist/react-ui/ui/Tooltip/Tooltip.styles.d.ts +1 -1
- package/dist/react-ui/ui/Tooltip/Tooltip.types.d.ts +1 -1
- package/dist/react-ui/ui/index.d.ts +1 -0
- package/dist/react-ui/ui/index.d.ts.map +1 -1
- package/dist/react-ui/ui/index.js +2 -0
- package/package.json +54 -6
- package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +278 -0
- package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +97 -0
- package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +155 -0
- package/src/react-ui/blocks/Terminal/Terminal.theme.ts +80 -0
- package/src/react-ui/blocks/Terminal/Terminal.types.ts +438 -0
- package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +269 -0
- package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +326 -0
- package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +230 -0
- package/src/react-ui/blocks/Terminal/XTermAdapter.ts +163 -0
- package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +316 -0
- package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +218 -0
- package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +386 -0
- package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +67 -0
- package/src/react-ui/blocks/Terminal/components/index.ts +10 -0
- package/src/react-ui/blocks/Terminal/hooks/index.ts +22 -0
- package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +229 -0
- package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +292 -0
- package/src/react-ui/blocks/Terminal/index.ts +103 -0
- package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +330 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +242 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +202 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +140 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +68 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +85 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +383 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +439 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +550 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +259 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +237 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +76 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +112 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +178 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +203 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +252 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +334 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +261 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +248 -0
- package/src/react-ui/blocks/Terminal/panel/index.ts +72 -0
- package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +59 -0
- package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +59 -0
- package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +180 -0
- package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +248 -0
- package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +283 -0
- package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +686 -0
- package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +466 -0
- package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +343 -0
- package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +167 -0
- package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +348 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +251 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +390 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +320 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +20 -0
- package/src/react-ui/blocks/Terminal/parsing/index.ts +69 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +68 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +436 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +14 -0
- package/src/react-ui/blocks/index.ts +11 -0
- package/src/react-ui/icons/lucide-animated/activity.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/bell-electric.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/bell.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/bot.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/box.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/circle-check.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/delete.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/download.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/home.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/plus.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/search.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/settings.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/trending-down.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/trending-up.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/x.tsx +2 -2
- package/src/react-ui/lib/icon-wrapper.tsx +70 -0
- package/src/react-ui/lib/index.ts +1 -0
- package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +1 -1
- package/src/react-ui/ui/Tabs/Tabs.css +39 -0
- package/src/react-ui/ui/Tabs/Tabs.styles.ts +119 -31
- package/src/react-ui/ui/Tabs/Tabs.types.ts +8 -3
- package/src/react-ui/ui/Tabs/index.tsx +135 -27
- package/src/react-ui/ui/index.ts +1 -0
- package/dist/index.css +0 -129
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TerminalPanelHeader Component.
|
|
3
|
+
*
|
|
4
|
+
* Enhanced macOS-style header with glassmorphism, dynamic session name,
|
|
5
|
+
* gradient mesh overlay, and premium glass effects.
|
|
6
|
+
*
|
|
7
|
+
* @module components/devenv/terminal/panel/header
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use client';
|
|
11
|
+
|
|
12
|
+
import { motion } from 'motion/react';
|
|
13
|
+
import type { ITerminalPanelHeaderProps } from './TerminalLogsPanel.types';
|
|
14
|
+
import { TerminalIcon, ListIcon } from '@/react-ui/icons/lucide-animated';
|
|
15
|
+
import { cn } from '@/react-ui/lib/utils';
|
|
16
|
+
import { IconWrapper } from '@/react-ui/lib/icon-wrapper';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Traffic light button styles with macOS group hover behavior.
|
|
20
|
+
* Dots are desaturated until the group is hovered.
|
|
21
|
+
*/
|
|
22
|
+
const trafficLightStyles = {
|
|
23
|
+
close: 'w-3 h-3 rounded-full transition-all duration-200 bg-muted-foreground/30 group-hover/traffic:bg-red-500/90 group-hover/traffic:shadow-[0_0_6px_rgba(239,68,68,0.4)] hover:!bg-red-500 hover:!shadow-[0_0_12px_rgba(239,68,68,0.6)] hover:!scale-110',
|
|
24
|
+
minimize: 'w-3 h-3 rounded-full transition-all duration-200 bg-muted-foreground/30 group-hover/traffic:bg-yellow-500/90 group-hover/traffic:shadow-[0_0_6px_rgba(234,179,8,0.4)] hover:!bg-yellow-500 hover:!shadow-[0_0_12px_rgba(234,179,8,0.6)] hover:!scale-110',
|
|
25
|
+
maximize: 'w-3 h-3 rounded-full transition-all duration-200 bg-muted-foreground/30 group-hover/traffic:bg-green-500/90 group-hover/traffic:shadow-[0_0_6px_rgba(34,197,94,0.4)] hover:!bg-green-500 hover:!shadow-[0_0_12px_rgba(34,197,94,0.6)] hover:!scale-110',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Segmented control button styles (macOS-style).
|
|
30
|
+
*/
|
|
31
|
+
const segmentedButtonStyles = {
|
|
32
|
+
base: 'flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-all',
|
|
33
|
+
inactive: 'text-muted-foreground hover:text-foreground hover:bg-white/5 hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.1)]',
|
|
34
|
+
active: 'bg-primary/20 text-primary border border-primary/30 shadow-[0_0_8px_hsla(330,85%,43%,0.15)] hover:shadow-[0_0_12px_hsla(330,85%,43%,0.25)]',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Connection status color classes with glow effects.
|
|
39
|
+
*/
|
|
40
|
+
function getStatusColor(isConnected: boolean): string {
|
|
41
|
+
if (isConnected) {
|
|
42
|
+
return 'bg-success/80 shadow-[0_0_8px_hsla(142,100%,62%,0.5)] animate-pulse';
|
|
43
|
+
}
|
|
44
|
+
return 'bg-muted-foreground/60';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* TerminalPanelHeader Component.
|
|
49
|
+
*
|
|
50
|
+
* Displays enhanced macOS-style header with:
|
|
51
|
+
* - Traffic light buttons (close, minimize, maximize) with glow effects
|
|
52
|
+
* - Dynamic session/container name display
|
|
53
|
+
* - Connection status badge with pulse animation
|
|
54
|
+
* - Gradient mesh overlay for depth
|
|
55
|
+
* - Multi-layer glassmorphism effect
|
|
56
|
+
* - Animated top accent line
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <TerminalPanelHeader
|
|
61
|
+
* containerName="devenv-agent-backend"
|
|
62
|
+
* isConnected={true}
|
|
63
|
+
* onClose={() => console.log('close')}
|
|
64
|
+
* />
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export function TerminalPanelHeader({
|
|
68
|
+
containerName,
|
|
69
|
+
isConnected,
|
|
70
|
+
viewMode = 'terminal',
|
|
71
|
+
onViewModeChange,
|
|
72
|
+
onClose,
|
|
73
|
+
onMinimize,
|
|
74
|
+
onMaximize,
|
|
75
|
+
}: ITerminalPanelHeaderProps) {
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
className={cn(
|
|
79
|
+
'relative overflow-hidden',
|
|
80
|
+
'flex items-center justify-between px-4 h-12',
|
|
81
|
+
'bg-background/60',
|
|
82
|
+
'border-b border-border/30'
|
|
83
|
+
)}
|
|
84
|
+
>
|
|
85
|
+
{/* Content Layer */}
|
|
86
|
+
<div className="flex items-center justify-between w-full">
|
|
87
|
+
{/* Traffic Lights (macOS-style group hover) */}
|
|
88
|
+
<div className="group/traffic flex items-center gap-2 px-1 py-1 -mx-1 rounded-md">
|
|
89
|
+
<button
|
|
90
|
+
type="button"
|
|
91
|
+
onClick={onClose}
|
|
92
|
+
className={trafficLightStyles.close}
|
|
93
|
+
aria-label="Close"
|
|
94
|
+
title="Close"
|
|
95
|
+
/>
|
|
96
|
+
<button
|
|
97
|
+
type="button"
|
|
98
|
+
onClick={onMinimize}
|
|
99
|
+
className={trafficLightStyles.minimize}
|
|
100
|
+
aria-label="Minimize"
|
|
101
|
+
title="Minimize"
|
|
102
|
+
/>
|
|
103
|
+
<button
|
|
104
|
+
type="button"
|
|
105
|
+
onClick={onMaximize}
|
|
106
|
+
className={trafficLightStyles.maximize}
|
|
107
|
+
aria-label="Maximize"
|
|
108
|
+
title="Maximize"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
{/* Container/Session Name with Icon */}
|
|
113
|
+
<div className="flex-1 flex items-center justify-center gap-2">
|
|
114
|
+
<IconWrapper
|
|
115
|
+
icon={TerminalIcon}
|
|
116
|
+
size={14}
|
|
117
|
+
className={cn(
|
|
118
|
+
'transition-all duration-500 flex-shrink-0',
|
|
119
|
+
isConnected ? 'text-primary/80' : 'text-muted-foreground/40'
|
|
120
|
+
)}
|
|
121
|
+
/>
|
|
122
|
+
<h3
|
|
123
|
+
className={cn(
|
|
124
|
+
'text-sm font-mono font-medium truncate transition-all duration-500',
|
|
125
|
+
isConnected
|
|
126
|
+
? 'text-foreground/95 drop-shadow-[0_0_8px_hsla(330,85%,43%,0.3)]'
|
|
127
|
+
: 'text-foreground/60'
|
|
128
|
+
)}
|
|
129
|
+
>
|
|
130
|
+
{containerName}
|
|
131
|
+
</h3>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
{/* Right Side: View Mode Toggle + Connection Status */}
|
|
135
|
+
<div className="flex items-center gap-3">
|
|
136
|
+
{/* View Mode Segmented Control */}
|
|
137
|
+
<div className="flex items-center bg-background/80 rounded-lg p-0.5 border-t border-white/10 border-b border-border/50 border-x border-border/40 shadow-[inset_0_0.5px_0_rgba(255,255,255,0.15),0_0_0_1px_rgba(0,0,0,0.1)]">
|
|
138
|
+
<button
|
|
139
|
+
type="button"
|
|
140
|
+
onClick={() => onViewModeChange?.('terminal')}
|
|
141
|
+
className={cn(
|
|
142
|
+
segmentedButtonStyles.base,
|
|
143
|
+
!onViewModeChange && 'opacity-70 cursor-not-allowed',
|
|
144
|
+
viewMode === 'terminal' ? segmentedButtonStyles.active : segmentedButtonStyles.inactive
|
|
145
|
+
)}
|
|
146
|
+
title="Terminal mode - Raw logs with original ANSI colors"
|
|
147
|
+
>
|
|
148
|
+
<IconWrapper icon={TerminalIcon} size={14} />
|
|
149
|
+
<span className="hidden xs:inline">Terminal</span>
|
|
150
|
+
</button>
|
|
151
|
+
<button
|
|
152
|
+
type="button"
|
|
153
|
+
onClick={() => onViewModeChange?.('react')}
|
|
154
|
+
className={cn(
|
|
155
|
+
segmentedButtonStyles.base,
|
|
156
|
+
!onViewModeChange && 'opacity-70 cursor-not-allowed',
|
|
157
|
+
viewMode === 'react' ? segmentedButtonStyles.active : segmentedButtonStyles.inactive
|
|
158
|
+
)}
|
|
159
|
+
title="React mode - Logs with badges and syntax highlighting"
|
|
160
|
+
>
|
|
161
|
+
<IconWrapper icon={ListIcon} size={14} />
|
|
162
|
+
<span className="hidden xs:inline">List</span>
|
|
163
|
+
</button>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
{/* Connection Status */}
|
|
167
|
+
<div className="flex items-center gap-2">
|
|
168
|
+
<div className={cn('w-2 h-2 rounded-full transition-all duration-300', getStatusColor(isConnected))} />
|
|
169
|
+
<span className="text-xs text-muted-foreground font-medium hidden sm:inline">
|
|
170
|
+
{isConnected ? 'Connected' : 'Disconnected'}
|
|
171
|
+
</span>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
</div>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TerminalPanelToolbar Component.
|
|
3
|
+
*
|
|
4
|
+
* Filter toolbar with log level buttons, toggles, and action buttons.
|
|
5
|
+
*
|
|
6
|
+
* @module components/devenv/terminal/panel/toolbar
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use client';
|
|
10
|
+
|
|
11
|
+
import { ArrowDownToLineIcon, ArrowUpIcon, ListIcon, SearchIcon, DeleteIcon, DownloadIcon } from '@/react-ui/icons/lucide-animated';
|
|
12
|
+
import type {
|
|
13
|
+
ITerminalPanelToolbarProps,
|
|
14
|
+
ILevelFilterButton,
|
|
15
|
+
TLogLevelFilter,
|
|
16
|
+
TLogLevel,
|
|
17
|
+
} from './TerminalLogsPanel.types';
|
|
18
|
+
import { TerminalLogBadge } from '../components/TerminalLogBadge';
|
|
19
|
+
import { IconWrapper } from '@/react-ui/lib/icon-wrapper';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Log level filter button configurations.
|
|
23
|
+
*/
|
|
24
|
+
const LEVEL_FILTERS: ILevelFilterButton[] = [
|
|
25
|
+
{ value: 'all', label: 'ALL' },
|
|
26
|
+
{ value: 'trace', label: 'TRACE' },
|
|
27
|
+
{ value: 'debug', label: 'DEBUG' },
|
|
28
|
+
{ value: 'info', label: 'INFO' },
|
|
29
|
+
{ value: 'warn', label: 'WARN' },
|
|
30
|
+
{ value: 'error', label: 'ERROR' },
|
|
31
|
+
{ value: 'fatal', label: 'FATAL' },
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Button variant styles for active and inactive states.
|
|
36
|
+
*/
|
|
37
|
+
const buttonVariantStyles = {
|
|
38
|
+
base: 'px-3 py-1.5 rounded-md font-mono text-xs font-bold uppercase tracking-wider transition-all',
|
|
39
|
+
inactive:
|
|
40
|
+
'bg-muted/40 text-muted-foreground hover:bg-muted/60 hover:scale-105 active:scale-95 border border-border/20',
|
|
41
|
+
active: 'bg-primary/20 text-primary border border-primary/40 shadow-[0_0_10px_hsla(330,85%,43%,0.2)] hover:scale-105 active:scale-95',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Toggle button styles.
|
|
46
|
+
*/
|
|
47
|
+
const toggleStyles = {
|
|
48
|
+
base: 'p-2 rounded-md transition-all hover:scale-105 active:scale-95',
|
|
49
|
+
inactive: 'bg-muted/40 text-muted-foreground hover:bg-muted/60',
|
|
50
|
+
active: 'bg-primary/20 text-primary border border-primary/40 shadow-[0_0_10px_hsla(330,85%,43%,0.2)]',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Action button styles.
|
|
55
|
+
*/
|
|
56
|
+
const actionButtonStyles = {
|
|
57
|
+
base: 'p-2 rounded-md transition-all hover:scale-105 active:scale-95',
|
|
58
|
+
default: 'bg-muted/40 text-muted-foreground hover:bg-muted/60 hover:text-foreground',
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* TerminalPanelToolbar Component.
|
|
63
|
+
*
|
|
64
|
+
* Displays filter toolbar with:
|
|
65
|
+
* - Log level filter buttons with badges
|
|
66
|
+
* - Follow cursor toggle
|
|
67
|
+
* - Line numbers toggle
|
|
68
|
+
* - Action buttons (Search, Clear, Download)
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* <TerminalPanelToolbar
|
|
73
|
+
* filterLevel="all"
|
|
74
|
+
* followCursor={true}
|
|
75
|
+
* showLineNumbers={false}
|
|
76
|
+
* levelCounts={{ info: 42, warn: 3, error: 1 }}
|
|
77
|
+
* onFilterChange={(level) => setFilterLevel(level)}
|
|
78
|
+
* onFollowCursorChange={(enabled) => setFollowCursor(enabled)}
|
|
79
|
+
* onShowLineNumbersChange={(enabled) => setShowLineNumbers(enabled)}
|
|
80
|
+
* onClear={() => clearLogs()}
|
|
81
|
+
* onDownload={() => downloadLogs()}
|
|
82
|
+
* onSearch={() => openSearch()}
|
|
83
|
+
* />
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export function TerminalPanelToolbar({
|
|
87
|
+
filterLevel,
|
|
88
|
+
followCursor,
|
|
89
|
+
showLineNumbers,
|
|
90
|
+
levelCounts,
|
|
91
|
+
onFilterChange,
|
|
92
|
+
onFollowCursorChange,
|
|
93
|
+
onShowLineNumbersChange,
|
|
94
|
+
onClear,
|
|
95
|
+
onDownload,
|
|
96
|
+
onSearch,
|
|
97
|
+
}: ITerminalPanelToolbarProps) {
|
|
98
|
+
/**
|
|
99
|
+
* Get count for a specific log level.
|
|
100
|
+
*/
|
|
101
|
+
const getCount = (level: TLogLevelFilter): number | undefined => {
|
|
102
|
+
if (level === 'all') {
|
|
103
|
+
return Object.values(levelCounts).reduce((sum, count) => (sum ?? 0) + (count ?? 0), 0);
|
|
104
|
+
}
|
|
105
|
+
return levelCounts[level];
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<div className="flex items-center gap-2 px-3 py-2 bg-muted/20 border-b border-border/20 flex-wrap">
|
|
110
|
+
{/* Log Level Filters */}
|
|
111
|
+
<div className="flex items-center gap-1">
|
|
112
|
+
{LEVEL_FILTERS.map((filter) => {
|
|
113
|
+
const count = getCount(filter.value);
|
|
114
|
+
const isActive = filterLevel === filter.value;
|
|
115
|
+
const showBadge = count !== undefined && count > 0;
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<button
|
|
119
|
+
key={filter.value}
|
|
120
|
+
type="button"
|
|
121
|
+
onClick={() => onFilterChange(filter.value)}
|
|
122
|
+
className={`${buttonVariantStyles.base} ${isActive ? buttonVariantStyles.active : buttonVariantStyles.inactive}`}
|
|
123
|
+
title={`Show ${filter.label.toLowerCase()} logs${count !== undefined ? ` (${count})` : ''}`}
|
|
124
|
+
>
|
|
125
|
+
{filter.label}
|
|
126
|
+
{showBadge && (
|
|
127
|
+
<TerminalLogBadge level={filter.value} className="ml-1 px-1 min-w-[1.25rem]">
|
|
128
|
+
{count}
|
|
129
|
+
</TerminalLogBadge>
|
|
130
|
+
)}
|
|
131
|
+
</button>
|
|
132
|
+
);
|
|
133
|
+
})}
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
{/* Separator */}
|
|
137
|
+
<div className="w-px h-6 bg-border/30" />
|
|
138
|
+
|
|
139
|
+
{/* Toggles */}
|
|
140
|
+
<div className="flex items-center gap-1">
|
|
141
|
+
{/* Follow Cursor Toggle */}
|
|
142
|
+
<button
|
|
143
|
+
type="button"
|
|
144
|
+
onClick={() => onFollowCursorChange(!followCursor)}
|
|
145
|
+
className={`${toggleStyles.base} ${followCursor ? toggleStyles.active : toggleStyles.inactive}`}
|
|
146
|
+
title={followCursor ? 'Disable auto-scroll' : 'Enable auto-scroll'}
|
|
147
|
+
>
|
|
148
|
+
{followCursor ? (
|
|
149
|
+
<ArrowDownToLineIcon className="w-4 h-4" />
|
|
150
|
+
) : (
|
|
151
|
+
<ArrowUpIcon className="w-4 h-4" />
|
|
152
|
+
)}
|
|
153
|
+
</button>
|
|
154
|
+
|
|
155
|
+
{/* Line Numbers Toggle */}
|
|
156
|
+
<button
|
|
157
|
+
type="button"
|
|
158
|
+
onClick={() => onShowLineNumbersChange(!showLineNumbers)}
|
|
159
|
+
className={`${toggleStyles.base} ${showLineNumbers ? toggleStyles.active : toggleStyles.inactive}`}
|
|
160
|
+
title={showLineNumbers ? 'Hide line numbers' : 'Show line numbers'}
|
|
161
|
+
>
|
|
162
|
+
<ListIcon className="w-4 h-4" />
|
|
163
|
+
</button>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
{/* Spacer */}
|
|
167
|
+
<div className="flex-1" />
|
|
168
|
+
|
|
169
|
+
{/* Action Buttons */}
|
|
170
|
+
<div className="flex items-center gap-1">
|
|
171
|
+
{/* Search */}
|
|
172
|
+
<button
|
|
173
|
+
type="button"
|
|
174
|
+
onClick={onSearch}
|
|
175
|
+
className={`${actionButtonStyles.base} ${actionButtonStyles.default}`}
|
|
176
|
+
title="Search in logs (Ctrl+Shift+F)"
|
|
177
|
+
>
|
|
178
|
+
<IconWrapper icon={SearchIcon} size={16} />
|
|
179
|
+
</button>
|
|
180
|
+
|
|
181
|
+
{/* Clear */}
|
|
182
|
+
<button
|
|
183
|
+
type="button"
|
|
184
|
+
onClick={onClear}
|
|
185
|
+
className={`${actionButtonStyles.base} ${actionButtonStyles.default}`}
|
|
186
|
+
title="Clear logs"
|
|
187
|
+
>
|
|
188
|
+
<IconWrapper icon={DeleteIcon} size={16} />
|
|
189
|
+
</button>
|
|
190
|
+
|
|
191
|
+
{/* Download */}
|
|
192
|
+
<button
|
|
193
|
+
type="button"
|
|
194
|
+
onClick={onDownload}
|
|
195
|
+
className={`${actionButtonStyles.base} ${actionButtonStyles.default}`}
|
|
196
|
+
title="Download logs"
|
|
197
|
+
>
|
|
198
|
+
<IconWrapper icon={DownloadIcon} size={16} />
|
|
199
|
+
</button>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TerminalSessionControl Component.
|
|
3
|
+
*
|
|
4
|
+
* Ghostty-inspired session control with current session display,
|
|
5
|
+
* dropdown selector for containers, and close button.
|
|
6
|
+
*
|
|
7
|
+
* @module components/devenv/terminal/panel/session-control
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use client';
|
|
11
|
+
|
|
12
|
+
import { useState, useRef, useEffect } from 'react';
|
|
13
|
+
import { PlusIcon, XIcon } from '@/react-ui/icons/lucide-animated';
|
|
14
|
+
import { cn } from '@/react-ui/lib/utils';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Container information for dropdown display.
|
|
18
|
+
*/
|
|
19
|
+
export interface IContainerOption {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
state: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Props for TerminalSessionControl component.
|
|
27
|
+
*/
|
|
28
|
+
export interface ITerminalSessionControlProps {
|
|
29
|
+
/** Current container name */
|
|
30
|
+
currentContainer?: string | null;
|
|
31
|
+
|
|
32
|
+
/** Available containers to select from */
|
|
33
|
+
containers: IContainerOption[];
|
|
34
|
+
|
|
35
|
+
/** Whether currently connected/streaming */
|
|
36
|
+
isConnected: boolean;
|
|
37
|
+
|
|
38
|
+
/** Callback when container is selected */
|
|
39
|
+
onContainerSelect: (containerName: string) => void;
|
|
40
|
+
|
|
41
|
+
/** Callback when close button is clicked (stop streaming) */
|
|
42
|
+
onClose: () => void;
|
|
43
|
+
|
|
44
|
+
/** Callback when refresh is clicked */
|
|
45
|
+
onRefresh?: () => void;
|
|
46
|
+
|
|
47
|
+
/** Custom class name */
|
|
48
|
+
className?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* TerminalSessionControl Component.
|
|
53
|
+
*
|
|
54
|
+
* Displays compact session control with:
|
|
55
|
+
* - Current container name with status indicator
|
|
56
|
+
* - Dropdown button (+) to select from available containers
|
|
57
|
+
* - Close button (X) to stop streaming and deselect
|
|
58
|
+
* - Refresh button (optional)
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <TerminalSessionControl
|
|
63
|
+
* currentContainer="devenv-agent-backend"
|
|
64
|
+
* containers={containers}
|
|
65
|
+
* isConnected={true}
|
|
66
|
+
* onContainerSelect={(name) => selectContainer(name)}
|
|
67
|
+
* onClose={() => stopStreaming()}
|
|
68
|
+
* onRefresh={() => loadContainers()}
|
|
69
|
+
* />
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export function TerminalSessionControl({
|
|
73
|
+
currentContainer,
|
|
74
|
+
containers,
|
|
75
|
+
isConnected,
|
|
76
|
+
onContainerSelect,
|
|
77
|
+
onClose,
|
|
78
|
+
onRefresh,
|
|
79
|
+
className,
|
|
80
|
+
}: ITerminalSessionControlProps) {
|
|
81
|
+
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
82
|
+
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
83
|
+
|
|
84
|
+
// Close dropdown when clicking outside
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
87
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
|
|
88
|
+
setIsDropdownOpen(false);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
93
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
94
|
+
}, []);
|
|
95
|
+
|
|
96
|
+
// Get display name for current container
|
|
97
|
+
const displayName = currentContainer || 'No container selected';
|
|
98
|
+
|
|
99
|
+
// Get available containers (excluding current)
|
|
100
|
+
const availableContainers = currentContainer
|
|
101
|
+
? containers.filter((c) => c.name !== currentContainer)
|
|
102
|
+
: containers;
|
|
103
|
+
|
|
104
|
+
const handleContainerClick = (containerName: string) => {
|
|
105
|
+
onContainerSelect(containerName);
|
|
106
|
+
setIsDropdownOpen(false);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<div
|
|
111
|
+
className={cn(
|
|
112
|
+
'flex items-center gap-2 px-4 h-12',
|
|
113
|
+
'bg-background/60 border-b border-border/30',
|
|
114
|
+
className
|
|
115
|
+
)}
|
|
116
|
+
>
|
|
117
|
+
{/* Current Session Info */}
|
|
118
|
+
<div className="flex items-center gap-3 flex-1 min-w-0">
|
|
119
|
+
{/* Status Indicator */}
|
|
120
|
+
<div
|
|
121
|
+
className={cn(
|
|
122
|
+
'w-2 h-2 rounded-full flex-shrink-0 transition-all duration-300',
|
|
123
|
+
isConnected
|
|
124
|
+
? 'bg-success/80 shadow-[0_0_8px_hsla(142,100%,62%,0.5)] animate-pulse'
|
|
125
|
+
: 'bg-muted-foreground/60'
|
|
126
|
+
)}
|
|
127
|
+
/>
|
|
128
|
+
|
|
129
|
+
{/* Container Name */}
|
|
130
|
+
<div className="flex-1 min-w-0">
|
|
131
|
+
<h3 className="text-sm font-mono font-medium text-foreground/90 truncate">
|
|
132
|
+
{displayName}
|
|
133
|
+
</h3>
|
|
134
|
+
{currentContainer && (
|
|
135
|
+
<span className="text-[10px] font-mono text-muted-foreground/70 ml-2">
|
|
136
|
+
{isConnected ? '● Live' : '○ Connecting'}
|
|
137
|
+
</span>
|
|
138
|
+
)}
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
{/* Action Buttons */}
|
|
143
|
+
<div className="flex items-center gap-1">
|
|
144
|
+
{/* Dropdown Selector Button */}
|
|
145
|
+
{availableContainers.length > 0 && (
|
|
146
|
+
<div className="relative" ref={dropdownRef}>
|
|
147
|
+
<button
|
|
148
|
+
type="button"
|
|
149
|
+
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
|
|
150
|
+
className={cn(
|
|
151
|
+
'flex items-center justify-center h-8 px-2 rounded-md',
|
|
152
|
+
'transition-colors duration-200 flex-shrink-0',
|
|
153
|
+
'bg-muted/30 text-muted-foreground hover:bg-primary/20 hover:text-primary',
|
|
154
|
+
'hover:shadow-[0_0_10px_hsla(330,85%,43%,0.2)]'
|
|
155
|
+
)}
|
|
156
|
+
aria-label="Select container"
|
|
157
|
+
title="Select container (Ctrl+Tab)"
|
|
158
|
+
>
|
|
159
|
+
<PlusIcon className="w-4 h-4 flex-shrink-0" />
|
|
160
|
+
</button>
|
|
161
|
+
|
|
162
|
+
{/* Dropdown Menu */}
|
|
163
|
+
{isDropdownOpen && (
|
|
164
|
+
<div className="absolute right-0 top-full mt-1 z-50 min-w-[200px]">
|
|
165
|
+
<div className="glass-subtle rounded-lg py-1">
|
|
166
|
+
<div className="px-3 py-2 text-xs font-mono text-muted-foreground border-b border-white/10">
|
|
167
|
+
Select Container
|
|
168
|
+
</div>
|
|
169
|
+
{availableContainers.map((container) => (
|
|
170
|
+
<button
|
|
171
|
+
key={container.id}
|
|
172
|
+
type="button"
|
|
173
|
+
onClick={() => handleContainerClick(container.name)}
|
|
174
|
+
className={cn(
|
|
175
|
+
'w-full px-3 py-2 text-left flex items-center gap-2',
|
|
176
|
+
'transition-colors duration-150',
|
|
177
|
+
'hover:bg-primary/10 hover:text-primary',
|
|
178
|
+
container.state === 'running' && 'text-success'
|
|
179
|
+
)}
|
|
180
|
+
>
|
|
181
|
+
{/* Container status dot */}
|
|
182
|
+
<div
|
|
183
|
+
className={cn(
|
|
184
|
+
'w-1.5 h-1.5 rounded-full flex-shrink-0',
|
|
185
|
+
container.state === 'running'
|
|
186
|
+
? 'bg-success shadow-[0_0_4px_hsla(142,100%,62%,0.4)]'
|
|
187
|
+
: 'bg-muted-foreground'
|
|
188
|
+
)}
|
|
189
|
+
/>
|
|
190
|
+
<div className="flex-1 min-w-0">
|
|
191
|
+
<div className="text-sm font-mono truncate">{container.name}</div>
|
|
192
|
+
<div className="text-[10px] text-muted-foreground truncate">
|
|
193
|
+
{container.state}
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</button>
|
|
197
|
+
))}
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
)}
|
|
201
|
+
</div>
|
|
202
|
+
)}
|
|
203
|
+
|
|
204
|
+
{/* Refresh Button (optional) */}
|
|
205
|
+
{onRefresh && (
|
|
206
|
+
<button
|
|
207
|
+
type="button"
|
|
208
|
+
onClick={onRefresh}
|
|
209
|
+
className={cn(
|
|
210
|
+
'flex items-center justify-center h-8 w-8 rounded-md',
|
|
211
|
+
'transition-colors duration-200 flex-shrink-0',
|
|
212
|
+
'bg-muted/30 text-muted-foreground hover:bg-muted/50'
|
|
213
|
+
)}
|
|
214
|
+
aria-label="Refresh containers"
|
|
215
|
+
title="Refresh containers"
|
|
216
|
+
>
|
|
217
|
+
<svg
|
|
218
|
+
className="w-4 h-4 flex-shrink-0"
|
|
219
|
+
fill="none"
|
|
220
|
+
stroke="currentColor"
|
|
221
|
+
viewBox="0 0 24 24"
|
|
222
|
+
strokeWidth={2}
|
|
223
|
+
>
|
|
224
|
+
<path d="M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
|
|
225
|
+
<path d="M3 3v5h5" />
|
|
226
|
+
<path d="M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16" />
|
|
227
|
+
<path d="M16 16h5v5" />
|
|
228
|
+
</svg>
|
|
229
|
+
</button>
|
|
230
|
+
)}
|
|
231
|
+
|
|
232
|
+
{/* Close Session Button */}
|
|
233
|
+
{currentContainer && (
|
|
234
|
+
<button
|
|
235
|
+
type="button"
|
|
236
|
+
onClick={onClose}
|
|
237
|
+
className={cn(
|
|
238
|
+
'flex items-center justify-center h-8 w-8 rounded-md',
|
|
239
|
+
'transition-colors duration-200 flex-shrink-0',
|
|
240
|
+
'bg-muted/30 text-muted-foreground hover:bg-destructive/20 hover:text-destructive',
|
|
241
|
+
'hover:shadow-[0_0_10px_hsla(0,84%,60%,0.2)]'
|
|
242
|
+
)}
|
|
243
|
+
aria-label="Close session"
|
|
244
|
+
title="Close session and stop streaming"
|
|
245
|
+
>
|
|
246
|
+
<XIcon className="w-4 h-4 flex-shrink-0" />
|
|
247
|
+
</button>
|
|
248
|
+
)}
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
);
|
|
252
|
+
}
|