@mks2508/mks-ui 0.3.2 → 0.5.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/TerminalDisplay.d.ts +46 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.js +168 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.styles.d.ts +21 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.styles.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.styles.js +31 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.types.d.ts +56 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.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/chrome.d.ts +14 -0
- package/dist/react-ui/blocks/Terminal/chrome.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/chrome.js +6 -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/display.d.ts +20 -0
- package/dist/react-ui/blocks/Terminal/display.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/display.js +9 -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 +43 -0
- package/dist/react-ui/blocks/Terminal/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/index.js +41 -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 +55 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.js +214 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.d.ts +35 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.js +57 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts +62 -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-CNVWCefU.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-cmyJ11jP.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 +3 -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/waapi/Morph/techniques/useCSSGridMorph.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Morph/techniques/useCSSGridMorph.js +2 -0
- package/dist/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.js +2 -0
- package/dist/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.js +2 -0
- package/dist/react-ui/primitives/waapi/Morph/useMorph.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Morph/useMorph.js +2 -0
- package/dist/react-ui/primitives/waapi/Reorder/useReorder.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Reorder/useReorder.js +2 -0
- package/dist/react-ui/primitives/waapi/Reorder/useReorderPresence.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Reorder/useReorderPresence.js +2 -0
- package/dist/react-ui/primitives/waapi/core/useAnimationOrchestrator.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/core/useAnimationOrchestrator.js +2 -0
- package/dist/react-ui/primitives/waapi/core/useElementRegistry.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/core/useElementRegistry.js +2 -0
- package/dist/react-ui/primitives/waapi/core/useFLIPAnimation.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/core/useFLIPAnimation.js +2 -0
- package/dist/react-ui/primitives/waapi/core/usePositionCapture.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/core/usePositionCapture.js +2 -0
- package/dist/react-ui/ui/Button/Button.styles.d.ts +1 -1
- package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.d.ts +1 -1
- package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.js +1 -1
- package/dist/react-ui/ui/InputGroup/index.d.ts.map +1 -1
- package/dist/react-ui/ui/InputGroup/index.js +2 -0
- 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 +6 -3
- 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/index.js +1 -0
- package/package.json +84 -29
- package/src/css.d.ts +6 -0
- 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/TerminalDisplay.styles.ts +38 -0
- package/src/react-ui/blocks/Terminal/TerminalDisplay.tsx +243 -0
- package/src/react-ui/blocks/Terminal/TerminalDisplay.types.ts +73 -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/chrome.ts +25 -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/display.ts +46 -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 +111 -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.styles.ts +75 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +266 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +82 -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/primitives/waapi/Morph/techniques/useCSSGridMorph.ts +1 -0
- package/src/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.ts +1 -0
- package/src/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.ts +1 -0
- package/src/react-ui/primitives/waapi/Morph/useMorph.ts +1 -0
- package/src/react-ui/primitives/waapi/Reorder/useReorder.ts +1 -0
- package/src/react-ui/primitives/waapi/Reorder/useReorderPresence.ts +1 -0
- package/src/react-ui/primitives/waapi/core/useAnimationOrchestrator.ts +1 -0
- package/src/react-ui/primitives/waapi/core/useElementRegistry.ts +1 -0
- package/src/react-ui/primitives/waapi/core/useFLIPAnimation.ts +1 -0
- package/src/react-ui/primitives/waapi/core/usePositionCapture.ts +1 -0
- package/src/react-ui/ui/Accordion/index.tsx +3 -3
- package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +1 -1
- package/src/react-ui/ui/InputGroup/index.tsx +2 -0
- 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
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log lines viewer component (React mode).
|
|
3
|
+
*
|
|
4
|
+
* Displays parsed log entries with React components for:
|
|
5
|
+
* - Level badges with CSS styling
|
|
6
|
+
* - Syntax highlighted spans
|
|
7
|
+
* - Timestamps right-aligned
|
|
8
|
+
* - Virtual scrolling with @tanstack/react-virtual
|
|
9
|
+
* - Auto-scroll to bottom when following logs
|
|
10
|
+
*
|
|
11
|
+
* @module components/devenv/terminal/panel/LogLinesViewer
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
'use client';
|
|
15
|
+
|
|
16
|
+
import { useMemo, useRef, useEffect, memo } from 'react';
|
|
17
|
+
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
18
|
+
import type { IParsedLogEntry, TLogLevel } from '../parsing';
|
|
19
|
+
import {
|
|
20
|
+
LevelBadge,
|
|
21
|
+
ContentTypeBadge,
|
|
22
|
+
TagBadges,
|
|
23
|
+
TimestampBadge,
|
|
24
|
+
} from '../components/LogLineBadges';
|
|
25
|
+
import { SyntaxHighlightedText } from '../components/SyntaxHighlight';
|
|
26
|
+
import { SpecializedSyntaxHighlighter } from '../components/SpecializedSyntaxHighlighter';
|
|
27
|
+
import { cn } from '@/react-ui/lib/utils';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Props for LogLinesViewer component.
|
|
31
|
+
*/
|
|
32
|
+
export interface ILogLinesViewerProps {
|
|
33
|
+
/** Parsed log entries to display */
|
|
34
|
+
entries: IParsedLogEntry[];
|
|
35
|
+
|
|
36
|
+
/** Current log level filter */
|
|
37
|
+
filterLevel: TLogLevel | 'all';
|
|
38
|
+
|
|
39
|
+
/** Level counts for badges */
|
|
40
|
+
levelCounts: Partial<Record<TLogLevel, number>>;
|
|
41
|
+
|
|
42
|
+
/** Optional custom class name */
|
|
43
|
+
className?: string;
|
|
44
|
+
|
|
45
|
+
/** Whether to show line numbers */
|
|
46
|
+
showLineNumbers?: boolean;
|
|
47
|
+
|
|
48
|
+
/** Whether to enable syntax highlighting */
|
|
49
|
+
enableSyntaxHighlight?: boolean;
|
|
50
|
+
|
|
51
|
+
/** Whether to auto-scroll to bottom when new entries arrive */
|
|
52
|
+
followCursor?: boolean;
|
|
53
|
+
|
|
54
|
+
/** Callback when scroll position changes (optional) */
|
|
55
|
+
onScrollToBottom?: () => void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get the severity value for a log level for filtering comparison.
|
|
60
|
+
*/
|
|
61
|
+
function getSeverity(level: TLogLevel | 'all'): number {
|
|
62
|
+
const severity: Record<TLogLevel, number> = {
|
|
63
|
+
trace: 0,
|
|
64
|
+
debug: 1,
|
|
65
|
+
info: 2,
|
|
66
|
+
warn: 3,
|
|
67
|
+
error: 4,
|
|
68
|
+
fatal: 5,
|
|
69
|
+
unknown: 1,
|
|
70
|
+
};
|
|
71
|
+
return level === 'all' ? 0 : severity[level] ?? 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Log lines viewer component.
|
|
76
|
+
*
|
|
77
|
+
* Displays parsed log entries with React components:
|
|
78
|
+
* - Level badges (colored based on log level)
|
|
79
|
+
* - Syntax highlighted message content
|
|
80
|
+
* - Timestamps right-aligned
|
|
81
|
+
* - Tag badges for component identification
|
|
82
|
+
* - Virtual scrolling for performance with large logs
|
|
83
|
+
* - Auto-scroll to bottom when following logs
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* <LogLinesViewer
|
|
88
|
+
* entries={parsedEntries}
|
|
89
|
+
* filterLevel="all"
|
|
90
|
+
* levelCounts={{ info: 42, warn: 3 }}
|
|
91
|
+
* showLineNumbers={true}
|
|
92
|
+
* followCursor={true}
|
|
93
|
+
* />
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export function LogLinesViewer({
|
|
97
|
+
entries,
|
|
98
|
+
filterLevel,
|
|
99
|
+
levelCounts,
|
|
100
|
+
className,
|
|
101
|
+
showLineNumbers = false,
|
|
102
|
+
enableSyntaxHighlight = true,
|
|
103
|
+
followCursor = false,
|
|
104
|
+
onScrollToBottom,
|
|
105
|
+
}: ILogLinesViewerProps): React.JSX.Element {
|
|
106
|
+
// Ref for the scroll container
|
|
107
|
+
const scrollContainerRef = useRef<HTMLDivElement>(null);
|
|
108
|
+
const prevEntriesLengthRef = useRef(entries.length);
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Filter entries based on current filter level.
|
|
112
|
+
* Memoized to avoid re-filtering on every render.
|
|
113
|
+
*/
|
|
114
|
+
const filteredEntries = useMemo(() => {
|
|
115
|
+
if (filterLevel === 'all') return entries;
|
|
116
|
+
|
|
117
|
+
const minSeverity = getSeverity(filterLevel);
|
|
118
|
+
return entries.filter((entry) => {
|
|
119
|
+
const entrySeverity = getSeverity(entry.level);
|
|
120
|
+
return entrySeverity >= minSeverity;
|
|
121
|
+
});
|
|
122
|
+
}, [entries, filterLevel]);
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Virtual scrolling with @tanstack/react-virtual.
|
|
126
|
+
* Only renders visible rows + overscan buffer for optimal performance.
|
|
127
|
+
* Uses dynamic size measurement for variable-height rows.
|
|
128
|
+
*/
|
|
129
|
+
const rowVirtualizer = useVirtualizer({
|
|
130
|
+
count: filteredEntries.length,
|
|
131
|
+
getScrollElement: () => scrollContainerRef.current,
|
|
132
|
+
estimateSize: () => 28,
|
|
133
|
+
overscan: 5, // Reduced for faster response
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Auto-scroll to bottom when new entries arrive and followCursor is enabled.
|
|
138
|
+
* Uses requestAnimationFrame for non-blocking scroll.
|
|
139
|
+
*/
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
if (followCursor && entries.length > prevEntriesLengthRef.current) {
|
|
142
|
+
// Use RAF to avoid blocking the render
|
|
143
|
+
requestAnimationFrame(() => {
|
|
144
|
+
if (scrollContainerRef.current) {
|
|
145
|
+
scrollContainerRef.current.scrollTop = scrollContainerRef.current.scrollHeight;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
onScrollToBottom?.();
|
|
149
|
+
}
|
|
150
|
+
prevEntriesLengthRef.current = entries.length;
|
|
151
|
+
}, [entries.length, followCursor, onScrollToBottom]);
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Calculate stats.
|
|
155
|
+
*/
|
|
156
|
+
const lineCount = filteredEntries.length;
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<div className={cn('flex flex-col h-full', className)}>
|
|
160
|
+
{/* Virtual scroll container */}
|
|
161
|
+
<div
|
|
162
|
+
ref={scrollContainerRef}
|
|
163
|
+
className="flex-1 overflow-auto font-mono text-[13px] leading-relaxed bg-[#241B2F]"
|
|
164
|
+
style={{ contain: 'layout style' }}
|
|
165
|
+
>
|
|
166
|
+
{filteredEntries.length === 0 ? (
|
|
167
|
+
<div className="flex flex-col items-center justify-center h-full gap-2 text-muted-foreground/50">
|
|
168
|
+
<svg className="w-8 h-8 opacity-30" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
169
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
|
|
170
|
+
</svg>
|
|
171
|
+
<span className="text-xs font-mono">No log entries to display</span>
|
|
172
|
+
</div>
|
|
173
|
+
) : (
|
|
174
|
+
<div
|
|
175
|
+
style={{
|
|
176
|
+
height: `${rowVirtualizer.getTotalSize()}px`,
|
|
177
|
+
width: '100%',
|
|
178
|
+
position: 'relative',
|
|
179
|
+
}}
|
|
180
|
+
>
|
|
181
|
+
{rowVirtualizer.getVirtualItems().map((virtualRow) => {
|
|
182
|
+
const entry = filteredEntries[virtualRow.index];
|
|
183
|
+
return (
|
|
184
|
+
<div
|
|
185
|
+
key={entry.line_number}
|
|
186
|
+
data-index={virtualRow.index}
|
|
187
|
+
ref={rowVirtualizer.measureElement}
|
|
188
|
+
style={{
|
|
189
|
+
position: 'absolute',
|
|
190
|
+
top: 0,
|
|
191
|
+
left: 0,
|
|
192
|
+
width: '100%',
|
|
193
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
194
|
+
}}
|
|
195
|
+
>
|
|
196
|
+
<LogLine
|
|
197
|
+
entry={entry}
|
|
198
|
+
index={virtualRow.index}
|
|
199
|
+
showLineNumbers={showLineNumbers}
|
|
200
|
+
enableSyntaxHighlight={enableSyntaxHighlight}
|
|
201
|
+
/>
|
|
202
|
+
</div>
|
|
203
|
+
);
|
|
204
|
+
})}
|
|
205
|
+
</div>
|
|
206
|
+
)}
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Props for LogLine component.
|
|
214
|
+
*/
|
|
215
|
+
interface ILogLineProps {
|
|
216
|
+
/** Parsed log entry */
|
|
217
|
+
entry: IParsedLogEntry;
|
|
218
|
+
|
|
219
|
+
/** Row index for alternating styling */
|
|
220
|
+
index: number;
|
|
221
|
+
|
|
222
|
+
/** Whether to show line numbers */
|
|
223
|
+
showLineNumbers?: boolean;
|
|
224
|
+
|
|
225
|
+
/** Whether to enable syntax highlighting */
|
|
226
|
+
enableSyntaxHighlight?: boolean;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Level-specific left border color for log lines.
|
|
231
|
+
*/
|
|
232
|
+
const LEVEL_BORDER_COLORS: Record<string, string> = {
|
|
233
|
+
error: 'border-l-red-500/60',
|
|
234
|
+
fatal: 'border-l-pink-500/60',
|
|
235
|
+
warn: 'border-l-yellow-500/50',
|
|
236
|
+
info: 'border-l-blue-500/30',
|
|
237
|
+
debug: 'border-l-cyan-500/20',
|
|
238
|
+
trace: 'border-l-gray-500/15',
|
|
239
|
+
unknown: 'border-l-transparent',
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Individual log line component (memoized).
|
|
244
|
+
*
|
|
245
|
+
* Renders a single log entry with badges and highlighted content.
|
|
246
|
+
* Memoized to prevent re-renders when entry hasn't changed.
|
|
247
|
+
*/
|
|
248
|
+
const LogLine = memo(function LogLine({ entry, index, showLineNumbers, enableSyntaxHighlight }: ILogLineProps): React.JSX.Element {
|
|
249
|
+
return (
|
|
250
|
+
<div
|
|
251
|
+
className={cn(
|
|
252
|
+
'flex items-start gap-2 px-3 py-1 border-l-2 transition-colors',
|
|
253
|
+
LEVEL_BORDER_COLORS[entry.level] || 'border-l-transparent',
|
|
254
|
+
index % 2 === 0 ? 'bg-white/[0.02]' : '',
|
|
255
|
+
'hover:bg-white/[0.06]'
|
|
256
|
+
)}
|
|
257
|
+
>
|
|
258
|
+
{/* Line number */}
|
|
259
|
+
{showLineNumbers && (
|
|
260
|
+
<span className="text-muted-foreground/50 text-xs w-12 flex-shrink-0 select-none">
|
|
261
|
+
{entry.line_number}
|
|
262
|
+
</span>
|
|
263
|
+
)}
|
|
264
|
+
|
|
265
|
+
{/* Level badge (skip for continuation lines) */}
|
|
266
|
+
{!entry.is_continuation && <LevelBadge level={entry.level} />}
|
|
267
|
+
|
|
268
|
+
{/* Content type badge (HTTP shows method like GET/POST, JSON shows JSON, etc.) */}
|
|
269
|
+
{!entry.is_continuation && entry.content_type && entry.content_type !== 'plain' && (
|
|
270
|
+
<ContentTypeBadge contentType={entry.content_type} httpMethod={entry.http_method} />
|
|
271
|
+
)}
|
|
272
|
+
|
|
273
|
+
{/* Tag badges */}
|
|
274
|
+
{!entry.is_continuation && entry.tags && entry.tags.length > 0 && (
|
|
275
|
+
<TagBadges tags={entry.tags} />
|
|
276
|
+
)}
|
|
277
|
+
|
|
278
|
+
{/* Message content with specialized highlighting */}
|
|
279
|
+
<div className="flex-1 min-w-0">
|
|
280
|
+
{enableSyntaxHighlight ? (
|
|
281
|
+
// Use specialized highlighter for HTTP and table content
|
|
282
|
+
(entry.content_type === 'http' || entry.content_type === 'table') ? (
|
|
283
|
+
<SpecializedSyntaxHighlighter
|
|
284
|
+
contentType={entry.content_type}
|
|
285
|
+
httpMethod={entry.http_method}
|
|
286
|
+
httpPath={entry.http_path}
|
|
287
|
+
tableData={entry.table_data}
|
|
288
|
+
text={entry.message ?? entry.raw}
|
|
289
|
+
/>
|
|
290
|
+
) : entry.content_type === 'json' && entry.structured ? (
|
|
291
|
+
<SpecializedSyntaxHighlighter
|
|
292
|
+
contentType="json"
|
|
293
|
+
jsonData={entry.structured}
|
|
294
|
+
text={entry.message ?? entry.raw}
|
|
295
|
+
/>
|
|
296
|
+
) : (
|
|
297
|
+
<SyntaxHighlightedText text={entry.message ?? entry.raw} />
|
|
298
|
+
)
|
|
299
|
+
) : (
|
|
300
|
+
<span className="text-foreground/90">{entry.message ?? entry.raw}</span>
|
|
301
|
+
)}
|
|
302
|
+
|
|
303
|
+
{/* Structured data display (if present and not already shown) */}
|
|
304
|
+
{entry.structured && entry.content_type !== 'json' && (
|
|
305
|
+
<details className="mt-1 ml-4">
|
|
306
|
+
<summary className="cursor-pointer text-xs text-muted-foreground hover:text-foreground">
|
|
307
|
+
JSON data
|
|
308
|
+
</summary>
|
|
309
|
+
<pre className="mt-1 text-xs bg-black/20 p-2 rounded overflow-x-auto">
|
|
310
|
+
{JSON.stringify(entry.structured, null, 2)}
|
|
311
|
+
</pre>
|
|
312
|
+
</details>
|
|
313
|
+
)}
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
{/* Timestamp (right-aligned) */}
|
|
317
|
+
{!entry.is_continuation && entry.timestamp_display && (
|
|
318
|
+
<TimestampBadge timestamp={entry.timestamp_display} />
|
|
319
|
+
)}
|
|
320
|
+
</div>
|
|
321
|
+
);
|
|
322
|
+
}, (prevProps, nextProps) => {
|
|
323
|
+
return (
|
|
324
|
+
prevProps.entry.line_number === nextProps.entry.line_number &&
|
|
325
|
+
prevProps.entry.raw === nextProps.entry.raw &&
|
|
326
|
+
prevProps.index === nextProps.index &&
|
|
327
|
+
prevProps.showLineNumbers === nextProps.showLineNumbers &&
|
|
328
|
+
prevProps.enableSyntaxHighlight === nextProps.enableSyntaxHighlight
|
|
329
|
+
);
|
|
330
|
+
});
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TerminalDebugPanel Component.
|
|
3
|
+
*
|
|
4
|
+
* Collapsible diagnostic panel below the terminal showing real-time
|
|
5
|
+
* GPU/renderer info, FPS, grid dimensions, PTY status, and connection details.
|
|
6
|
+
*
|
|
7
|
+
* @module components/devenv/terminal/panel/TerminalDebugPanel
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use client';
|
|
11
|
+
|
|
12
|
+
import { useState, useEffect, useRef } from 'react';
|
|
13
|
+
import { cn } from '@/react-ui/lib/utils';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Props for the TerminalDebugPanel component.
|
|
17
|
+
*/
|
|
18
|
+
export interface ITerminalDebugPanelProps {
|
|
19
|
+
/** Whether the panel is visible */
|
|
20
|
+
visible: boolean;
|
|
21
|
+
/** Renderer name (e.g. "WebGPU", "WebGL2", "xterm") */
|
|
22
|
+
renderer?: string;
|
|
23
|
+
/** Current FPS */
|
|
24
|
+
fps?: number;
|
|
25
|
+
/** GPU adapter name (e.g. "Apple M3 Pro") */
|
|
26
|
+
gpu?: string;
|
|
27
|
+
/** Canvas pixel dimensions */
|
|
28
|
+
canvasSize?: { width: number; height: number };
|
|
29
|
+
/** Grid dimensions in cols/rows */
|
|
30
|
+
gridSize?: { cols: number; rows: number };
|
|
31
|
+
/** Cell size in pixels */
|
|
32
|
+
cellSize?: { width: number; height: number };
|
|
33
|
+
/** Font description (e.g. "JetBrains Mono 14px") */
|
|
34
|
+
font?: string;
|
|
35
|
+
/** PTY connection status */
|
|
36
|
+
ptyStatus?: string;
|
|
37
|
+
/** PTY WebSocket URL */
|
|
38
|
+
ptyUrl?: string;
|
|
39
|
+
/** Active remote label */
|
|
40
|
+
remoteName?: string;
|
|
41
|
+
/** Theme name */
|
|
42
|
+
themeName?: string;
|
|
43
|
+
/** CRT effect enabled */
|
|
44
|
+
crtEffect?: boolean;
|
|
45
|
+
/** Connection uptime in seconds */
|
|
46
|
+
uptimeSeconds?: number;
|
|
47
|
+
/** Additional CSS classes */
|
|
48
|
+
className?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Format uptime from seconds to human-readable string.
|
|
53
|
+
*
|
|
54
|
+
* @param seconds - Total seconds of uptime
|
|
55
|
+
* @returns Formatted string (e.g. "5m 32s", "1h 23m")
|
|
56
|
+
*/
|
|
57
|
+
function formatUptime(seconds: number): string {
|
|
58
|
+
if (seconds < 60) return `${Math.floor(seconds)}s`;
|
|
59
|
+
const m = Math.floor(seconds / 60);
|
|
60
|
+
const s = Math.floor(seconds % 60);
|
|
61
|
+
if (m < 60) return `${m}m ${s}s`;
|
|
62
|
+
const h = Math.floor(m / 60);
|
|
63
|
+
const rm = m % 60;
|
|
64
|
+
return `${h}h ${rm}m`;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Single row in the debug panel table.
|
|
69
|
+
*/
|
|
70
|
+
function DebugRow({ label, value, valueColor }: { label: string; value: string; valueColor?: string }) {
|
|
71
|
+
return (
|
|
72
|
+
<div className="flex items-center gap-3 px-3 py-1 hover:bg-white/5 transition-colors">
|
|
73
|
+
<span className="text-[10px] font-mono text-muted-foreground/60 uppercase tracking-wider w-24 flex-shrink-0">
|
|
74
|
+
{label}
|
|
75
|
+
</span>
|
|
76
|
+
<span className={cn('text-xs font-mono', valueColor ?? 'text-foreground/80')}>
|
|
77
|
+
{value}
|
|
78
|
+
</span>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* TerminalDebugPanel Component.
|
|
85
|
+
*
|
|
86
|
+
* Renders a compact diagnostic panel with terminal runtime information.
|
|
87
|
+
* Toggled via the debug panel setting in TerminalSettingsPopover.
|
|
88
|
+
*
|
|
89
|
+
* @param props - Debug panel props with runtime telemetry
|
|
90
|
+
* @returns React element or null when hidden
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* <TerminalDebugPanel
|
|
95
|
+
* visible={settings.debugPanel}
|
|
96
|
+
* renderer="WebGPU"
|
|
97
|
+
* fps={60}
|
|
98
|
+
* gridSize={{ cols: 120, rows: 30 }}
|
|
99
|
+
* ptyStatus="connected"
|
|
100
|
+
* />
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export function TerminalDebugPanel({
|
|
104
|
+
visible,
|
|
105
|
+
renderer,
|
|
106
|
+
fps,
|
|
107
|
+
gpu,
|
|
108
|
+
canvasSize,
|
|
109
|
+
gridSize,
|
|
110
|
+
cellSize,
|
|
111
|
+
font,
|
|
112
|
+
ptyStatus,
|
|
113
|
+
ptyUrl,
|
|
114
|
+
remoteName,
|
|
115
|
+
themeName,
|
|
116
|
+
crtEffect,
|
|
117
|
+
uptimeSeconds,
|
|
118
|
+
className,
|
|
119
|
+
}: ITerminalDebugPanelProps) {
|
|
120
|
+
const [isExpanded, setIsExpanded] = useState(true);
|
|
121
|
+
const [liveUptime, setLiveUptime] = useState(uptimeSeconds ?? 0);
|
|
122
|
+
const uptimeRef = useRef(uptimeSeconds ?? 0);
|
|
123
|
+
|
|
124
|
+
// Live uptime counter
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
uptimeRef.current = uptimeSeconds ?? 0;
|
|
127
|
+
setLiveUptime(uptimeRef.current);
|
|
128
|
+
}, [uptimeSeconds]);
|
|
129
|
+
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
if (!visible || ptyStatus !== 'connected') return;
|
|
132
|
+
const interval = setInterval(() => {
|
|
133
|
+
uptimeRef.current += 1;
|
|
134
|
+
setLiveUptime(uptimeRef.current);
|
|
135
|
+
}, 1000);
|
|
136
|
+
return () => clearInterval(interval);
|
|
137
|
+
}, [visible, ptyStatus]);
|
|
138
|
+
|
|
139
|
+
if (!visible) return null;
|
|
140
|
+
|
|
141
|
+
const statusColor = ptyStatus === 'connected'
|
|
142
|
+
? 'text-green-400'
|
|
143
|
+
: ptyStatus === 'connecting'
|
|
144
|
+
? 'text-yellow-400'
|
|
145
|
+
: ptyStatus === 'error'
|
|
146
|
+
? 'text-red-400'
|
|
147
|
+
: 'text-muted-foreground/50';
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<div className={cn(
|
|
151
|
+
'border-t border-white/10 bg-black/20',
|
|
152
|
+
className,
|
|
153
|
+
)}>
|
|
154
|
+
{/* Toggle header */}
|
|
155
|
+
<button
|
|
156
|
+
type="button"
|
|
157
|
+
onClick={() => setIsExpanded(!isExpanded)}
|
|
158
|
+
className="w-full flex items-center gap-2 px-3 py-1.5 text-[10px] font-mono text-muted-foreground/60 uppercase tracking-wider hover:text-muted-foreground transition-colors"
|
|
159
|
+
>
|
|
160
|
+
<svg
|
|
161
|
+
className={cn('w-3 h-3 transition-transform', isExpanded && 'rotate-90')}
|
|
162
|
+
fill="none"
|
|
163
|
+
stroke="currentColor"
|
|
164
|
+
viewBox="0 0 24 24"
|
|
165
|
+
strokeWidth={2}
|
|
166
|
+
>
|
|
167
|
+
<polyline points="9 18 15 12 9 6" />
|
|
168
|
+
</svg>
|
|
169
|
+
Debug Panel
|
|
170
|
+
{fps != null && (
|
|
171
|
+
<span className="ml-auto text-foreground/40">{fps.toFixed(0)} FPS</span>
|
|
172
|
+
)}
|
|
173
|
+
</button>
|
|
174
|
+
|
|
175
|
+
{/* Expanded content */}
|
|
176
|
+
{isExpanded && (
|
|
177
|
+
<div className="pb-2">
|
|
178
|
+
{renderer && (
|
|
179
|
+
<DebugRow
|
|
180
|
+
label="Renderer"
|
|
181
|
+
value={renderer}
|
|
182
|
+
valueColor="text-primary/80"
|
|
183
|
+
/>
|
|
184
|
+
)}
|
|
185
|
+
{fps != null && (
|
|
186
|
+
<DebugRow label="FPS" value={fps.toFixed(1)} />
|
|
187
|
+
)}
|
|
188
|
+
{gpu && (
|
|
189
|
+
<DebugRow label="GPU" value={gpu} />
|
|
190
|
+
)}
|
|
191
|
+
{canvasSize && (
|
|
192
|
+
<DebugRow
|
|
193
|
+
label="Canvas"
|
|
194
|
+
value={`${canvasSize.width} \u00d7 ${canvasSize.height}`}
|
|
195
|
+
/>
|
|
196
|
+
)}
|
|
197
|
+
{gridSize && (
|
|
198
|
+
<DebugRow
|
|
199
|
+
label="Grid"
|
|
200
|
+
value={`${gridSize.cols} cols \u00d7 ${gridSize.rows} rows`}
|
|
201
|
+
/>
|
|
202
|
+
)}
|
|
203
|
+
{cellSize && (
|
|
204
|
+
<DebugRow
|
|
205
|
+
label="Cell"
|
|
206
|
+
value={`${cellSize.width.toFixed(1)} \u00d7 ${cellSize.height.toFixed(1)} px`}
|
|
207
|
+
/>
|
|
208
|
+
)}
|
|
209
|
+
{font && (
|
|
210
|
+
<DebugRow label="Font" value={font} />
|
|
211
|
+
)}
|
|
212
|
+
<DebugRow
|
|
213
|
+
label="PTY Status"
|
|
214
|
+
value={ptyStatus ?? 'unknown'}
|
|
215
|
+
valueColor={statusColor}
|
|
216
|
+
/>
|
|
217
|
+
{ptyUrl && (
|
|
218
|
+
<DebugRow
|
|
219
|
+
label="PTY URL"
|
|
220
|
+
value={ptyUrl}
|
|
221
|
+
valueColor="text-foreground/40"
|
|
222
|
+
/>
|
|
223
|
+
)}
|
|
224
|
+
{remoteName && (
|
|
225
|
+
<DebugRow label="Remote" value={remoteName} />
|
|
226
|
+
)}
|
|
227
|
+
{themeName && (
|
|
228
|
+
<DebugRow label="Theme" value={themeName} />
|
|
229
|
+
)}
|
|
230
|
+
<DebugRow
|
|
231
|
+
label="CRT Effect"
|
|
232
|
+
value={crtEffect ? 'ON' : 'OFF'}
|
|
233
|
+
valueColor={crtEffect ? 'text-primary/60' : 'text-muted-foreground/40'}
|
|
234
|
+
/>
|
|
235
|
+
{ptyStatus === 'connected' && (
|
|
236
|
+
<DebugRow label="Uptime" value={formatUptime(liveUptime)} />
|
|
237
|
+
)}
|
|
238
|
+
</div>
|
|
239
|
+
)}
|
|
240
|
+
</div>
|
|
241
|
+
);
|
|
242
|
+
}
|