@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,438 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal component types.
|
|
3
|
+
*
|
|
4
|
+
* Provides interfaces for the terminal component system supporting
|
|
5
|
+
* multiple renderers (xterm.js, restty) and PTY backends (node-pty,
|
|
6
|
+
* WebContainer) with configurable modes (interactive, read-only)
|
|
7
|
+
* and connection statuses.
|
|
8
|
+
*
|
|
9
|
+
* @module components/devenv/terminal/types
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Terminal renderer type - determines the rendering engine.
|
|
14
|
+
*
|
|
15
|
+
* - `xterm`: xterm.js DOM/canvas renderer (default, recommended for compatibility)
|
|
16
|
+
* - `restty`: GPU-accelerated WebGPU/WebGL2 renderer via restty with libghostty-vt WASM core
|
|
17
|
+
*/
|
|
18
|
+
export type ITerminalRendererType = 'xterm' | 'restty';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Terminal PTY backend type - determines what drives the terminal server-side.
|
|
22
|
+
*
|
|
23
|
+
* - `nodepty`: node-pty via WebSocket (default, used by mks-devenv agent-backend)
|
|
24
|
+
* - `webcontainer`: @webcontainer/api for in-browser Node.js runtime
|
|
25
|
+
*/
|
|
26
|
+
export type ITerminalPtyBackendType = 'nodepty' | 'webcontainer';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Terminal backend type - determines the rendering engine.
|
|
30
|
+
*
|
|
31
|
+
* @deprecated Use {@link ITerminalRendererType} for renderer selection
|
|
32
|
+
* and {@link ITerminalPtyBackendType} for backend selection instead.
|
|
33
|
+
*
|
|
34
|
+
* - `xterm`: xterm.js with WebSocket/SSE support (recommended)
|
|
35
|
+
* - `webcontainer`: @webcontainer/api for full Node.js in browser
|
|
36
|
+
* - `monaco`: Monaco Editor for Code-Server/Claude Code integration
|
|
37
|
+
*/
|
|
38
|
+
export type ITerminalBackendType = 'xterm' | 'webcontainer' | 'monaco';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Terminal mode - determines user interaction capabilities.
|
|
42
|
+
*
|
|
43
|
+
* - `interactive`: Full terminal with input/output via WebSocket
|
|
44
|
+
* - `readonly`: Output-only mode via SSE for logs viewing
|
|
45
|
+
*/
|
|
46
|
+
export type ITerminalMode = 'interactive' | 'readonly';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Connection status for WebSocket/SSE connections.
|
|
50
|
+
*
|
|
51
|
+
* Connection lifecycle states for terminal session management.
|
|
52
|
+
*/
|
|
53
|
+
export type ITerminalConnectionStatus =
|
|
54
|
+
| 'disconnected'
|
|
55
|
+
| 'connecting'
|
|
56
|
+
| 'connected'
|
|
57
|
+
| 'error';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Terminal session information.
|
|
61
|
+
*
|
|
62
|
+
* Represents an active terminal session with metadata for
|
|
63
|
+
* multi-session management in the UI.
|
|
64
|
+
*/
|
|
65
|
+
export interface ITerminalSession {
|
|
66
|
+
/** Unique session identifier */
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
69
|
+
/** Display name for the session (e.g., container name, workspace path) */
|
|
70
|
+
name: string;
|
|
71
|
+
|
|
72
|
+
/** Backend type rendering this session */
|
|
73
|
+
backend: ITerminalBackendType;
|
|
74
|
+
|
|
75
|
+
/** Renderer type for this session (default: 'xterm') */
|
|
76
|
+
renderer?: ITerminalRendererType;
|
|
77
|
+
|
|
78
|
+
/** Interaction mode for this session */
|
|
79
|
+
mode: ITerminalMode;
|
|
80
|
+
|
|
81
|
+
/** Current connection status */
|
|
82
|
+
status: ITerminalConnectionStatus;
|
|
83
|
+
|
|
84
|
+
/** Session creation timestamp */
|
|
85
|
+
createdAt: Date;
|
|
86
|
+
|
|
87
|
+
/** WebSocket URL for interactive mode (optional) */
|
|
88
|
+
wsUrl?: string;
|
|
89
|
+
|
|
90
|
+
/** SSE URL for readonly mode (optional) */
|
|
91
|
+
sseUrl?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Terminal options for initialization.
|
|
96
|
+
*
|
|
97
|
+
* Configuration options passed to terminal backends during
|
|
98
|
+
* initialization. Includes xterm.js-specific options,
|
|
99
|
+
* WebSocket/SSE URLs, and lifecycle callbacks.
|
|
100
|
+
*/
|
|
101
|
+
export interface ITerminalOptions {
|
|
102
|
+
// Renderer & backend selection
|
|
103
|
+
|
|
104
|
+
/** Renderer type to use (default: 'xterm') */
|
|
105
|
+
renderer?: ITerminalRendererType;
|
|
106
|
+
|
|
107
|
+
/** PTY backend type (default: 'nodepty') */
|
|
108
|
+
ptyBackend?: ITerminalPtyBackendType;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Backend type to use (default: 'xterm').
|
|
112
|
+
* @deprecated Use {@link renderer} instead.
|
|
113
|
+
*/
|
|
114
|
+
backend?: ITerminalBackendType;
|
|
115
|
+
|
|
116
|
+
/** Terminal mode (default: 'interactive') */
|
|
117
|
+
mode?: ITerminalMode;
|
|
118
|
+
|
|
119
|
+
// xterm.js options
|
|
120
|
+
|
|
121
|
+
/** Enable cursor blink animation (default: true) */
|
|
122
|
+
cursorBlink?: boolean;
|
|
123
|
+
|
|
124
|
+
/** Scrollback buffer size in lines (default: 1000) */
|
|
125
|
+
scrollback?: number;
|
|
126
|
+
|
|
127
|
+
/** Font size in pixels (default: 14) */
|
|
128
|
+
fontSize?: number;
|
|
129
|
+
|
|
130
|
+
/** Font family string (default: 'JetBrains Mono') */
|
|
131
|
+
fontFamily?: string;
|
|
132
|
+
|
|
133
|
+
/** Terminal theme colors */
|
|
134
|
+
theme?: ITerminalTheme;
|
|
135
|
+
|
|
136
|
+
// WebSocket/SSE configuration
|
|
137
|
+
|
|
138
|
+
/** WebSocket URL for interactive mode (ws:// or wss://) */
|
|
139
|
+
wsUrl?: string;
|
|
140
|
+
|
|
141
|
+
/** SSE URL for readonly mode (http:// or https://) */
|
|
142
|
+
sseUrl?: string;
|
|
143
|
+
|
|
144
|
+
// Callbacks
|
|
145
|
+
|
|
146
|
+
/** Called when user types input in interactive mode */
|
|
147
|
+
onData?: (data: string) => void;
|
|
148
|
+
|
|
149
|
+
/** Called on connection errors */
|
|
150
|
+
onError?: (error: Error) => void;
|
|
151
|
+
|
|
152
|
+
/** Called when connection closes */
|
|
153
|
+
onClose?: () => void;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Terminal theme matching Synthwave design system.
|
|
158
|
+
*
|
|
159
|
+
* Color palette for xterm.js rendering. Matches the mks-dev-environment
|
|
160
|
+
* design system from globals.css with background #241B2F, primary #D40C67,
|
|
161
|
+
* and success #44ffaa.
|
|
162
|
+
*/
|
|
163
|
+
export interface ITerminalTheme {
|
|
164
|
+
/** Background color (default: #241B2F - synthwave dark) */
|
|
165
|
+
background: string;
|
|
166
|
+
|
|
167
|
+
/** Default text color (default: #e8e8ec) */
|
|
168
|
+
foreground: string;
|
|
169
|
+
|
|
170
|
+
/** Cursor color (default: #D40C67 - primary magenta) */
|
|
171
|
+
cursor: string;
|
|
172
|
+
|
|
173
|
+
/** Cursor accent color for block cursor (optional) */
|
|
174
|
+
cursorAccent?: string;
|
|
175
|
+
|
|
176
|
+
/** Selection background color (optional) */
|
|
177
|
+
selectionBackground?: string;
|
|
178
|
+
|
|
179
|
+
/** Selection foreground color (optional, restty v0.1.24+) */
|
|
180
|
+
selectionForeground?: string;
|
|
181
|
+
|
|
182
|
+
/** ANSI color: black */
|
|
183
|
+
black: string;
|
|
184
|
+
|
|
185
|
+
/** ANSI color: red */
|
|
186
|
+
red: string;
|
|
187
|
+
|
|
188
|
+
/** ANSI color: green */
|
|
189
|
+
green: string;
|
|
190
|
+
|
|
191
|
+
/** ANSI color: yellow */
|
|
192
|
+
yellow: string;
|
|
193
|
+
|
|
194
|
+
/** ANSI color: blue */
|
|
195
|
+
blue: string;
|
|
196
|
+
|
|
197
|
+
/** ANSI color: magenta */
|
|
198
|
+
magenta: string;
|
|
199
|
+
|
|
200
|
+
/** ANSI color: cyan */
|
|
201
|
+
cyan: string;
|
|
202
|
+
|
|
203
|
+
/** ANSI color: white */
|
|
204
|
+
white: string;
|
|
205
|
+
|
|
206
|
+
/** ANSI bright color: bright black */
|
|
207
|
+
brightBlack: string;
|
|
208
|
+
|
|
209
|
+
/** ANSI bright color: bright red */
|
|
210
|
+
brightRed: string;
|
|
211
|
+
|
|
212
|
+
/** ANSI bright color: bright green */
|
|
213
|
+
brightGreen: string;
|
|
214
|
+
|
|
215
|
+
/** ANSI bright color: bright yellow */
|
|
216
|
+
brightYellow: string;
|
|
217
|
+
|
|
218
|
+
/** ANSI bright color: bright blue */
|
|
219
|
+
brightBlue: string;
|
|
220
|
+
|
|
221
|
+
/** ANSI bright color: bright magenta */
|
|
222
|
+
brightMagenta: string;
|
|
223
|
+
|
|
224
|
+
/** ANSI bright color: bright cyan */
|
|
225
|
+
brightCyan: string;
|
|
226
|
+
|
|
227
|
+
/** ANSI bright color: bright white */
|
|
228
|
+
brightWhite: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Capabilities that a terminal adapter supports.
|
|
233
|
+
*
|
|
234
|
+
* Used for runtime feature detection to adapt UI behavior
|
|
235
|
+
* based on the underlying renderer's capabilities.
|
|
236
|
+
*/
|
|
237
|
+
export interface ITerminalAdapterCapabilities {
|
|
238
|
+
/** Whether the adapter manages its own PTY WebSocket connection */
|
|
239
|
+
managesOwnConnection: boolean;
|
|
240
|
+
|
|
241
|
+
/** Whether the adapter supports GPU-accelerated rendering */
|
|
242
|
+
gpuRendering: boolean;
|
|
243
|
+
|
|
244
|
+
/** Whether the adapter supports built-in multi-pane splits */
|
|
245
|
+
multiPane: boolean;
|
|
246
|
+
|
|
247
|
+
/** Whether the adapter has a built-in theme catalog */
|
|
248
|
+
builtinThemes: boolean;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Terminal adapter interface - allows pluggable renderers.
|
|
253
|
+
*
|
|
254
|
+
* Abstraction layer for different terminal renderers (xterm.js, restty).
|
|
255
|
+
* All renderers must implement the core methods. Optional methods provide
|
|
256
|
+
* access to renderer-specific features when available (check `capabilities`).
|
|
257
|
+
*/
|
|
258
|
+
export interface ITerminalAdapter {
|
|
259
|
+
/** Backend type identifier */
|
|
260
|
+
type: ITerminalBackendType;
|
|
261
|
+
|
|
262
|
+
/** Adapter capabilities for runtime feature detection */
|
|
263
|
+
readonly capabilities: ITerminalAdapterCapabilities;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Initialize the terminal in the given container element.
|
|
267
|
+
*
|
|
268
|
+
* @param container - DOM element to render terminal into
|
|
269
|
+
* @param options - Terminal initialization options
|
|
270
|
+
* @returns Promise that resolves when terminal is ready
|
|
271
|
+
*/
|
|
272
|
+
initialize(container: HTMLElement, options: ITerminalOptions): Promise<void>;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Write data to the terminal without newline.
|
|
276
|
+
* No-op for adapters that manage their own PTY connection (e.g. restty).
|
|
277
|
+
*
|
|
278
|
+
* @param data - String data to write
|
|
279
|
+
*/
|
|
280
|
+
write(data: string): void;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Write data to the terminal with newline.
|
|
284
|
+
* No-op for adapters that manage their own PTY connection (e.g. restty).
|
|
285
|
+
*
|
|
286
|
+
* @param data - String data to write
|
|
287
|
+
*/
|
|
288
|
+
writeln(data: string): void;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Clear the terminal buffer.
|
|
292
|
+
*/
|
|
293
|
+
clear(): void;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Resize the terminal to the given dimensions.
|
|
297
|
+
*
|
|
298
|
+
* @param cols - Number of columns
|
|
299
|
+
* @param rows - Number of rows
|
|
300
|
+
*/
|
|
301
|
+
resize(cols: number, rows: number): void;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Dispose of the terminal and release resources.
|
|
305
|
+
*/
|
|
306
|
+
dispose(): void;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Switch between interactive and readonly modes.
|
|
310
|
+
*
|
|
311
|
+
* @param mode - Target mode
|
|
312
|
+
*/
|
|
313
|
+
setMode(mode: ITerminalMode): void;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Focus the terminal for input.
|
|
317
|
+
*/
|
|
318
|
+
focus(): void;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Remove focus from the terminal.
|
|
322
|
+
*/
|
|
323
|
+
blur(): void;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Connect to a PTY backend via WebSocket URL.
|
|
327
|
+
* Only applicable when capabilities.managesOwnConnection is true.
|
|
328
|
+
*
|
|
329
|
+
* @param url - WebSocket URL for PTY connection
|
|
330
|
+
*/
|
|
331
|
+
connectPty?(url: string): void;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Disconnect from the PTY backend.
|
|
335
|
+
* Only applicable when capabilities.managesOwnConnection is true.
|
|
336
|
+
*/
|
|
337
|
+
disconnectPty?(): void;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Check if PTY WebSocket is connected.
|
|
341
|
+
* Only applicable when capabilities.managesOwnConnection is true.
|
|
342
|
+
*/
|
|
343
|
+
isPtyConnected?(): boolean;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Update font size at runtime.
|
|
347
|
+
*
|
|
348
|
+
* @param size - Font size in pixels
|
|
349
|
+
*/
|
|
350
|
+
setFontSize?(size: number): void;
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Send raw input data to the terminal PTY.
|
|
354
|
+
* For adapters that manage their own connection.
|
|
355
|
+
*
|
|
356
|
+
* @param data - Input data string
|
|
357
|
+
*/
|
|
358
|
+
sendInput?(data: string): void;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Copy the current text selection to the clipboard.
|
|
362
|
+
*
|
|
363
|
+
* @returns Whether the copy succeeded
|
|
364
|
+
*/
|
|
365
|
+
copySelection?(): Promise<boolean>;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Paste clipboard contents into the terminal.
|
|
369
|
+
*
|
|
370
|
+
* @returns Whether the paste succeeded
|
|
371
|
+
*/
|
|
372
|
+
pasteClipboard?(): Promise<boolean>;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* PTY transport callbacks matching restty's PtyCallbacks contract.
|
|
377
|
+
* Consumers implement these to receive terminal events.
|
|
378
|
+
*/
|
|
379
|
+
export interface IPtyTransportCallbacks {
|
|
380
|
+
/** Called when WebSocket connection opens */
|
|
381
|
+
onConnect?: () => void;
|
|
382
|
+
/** Called when WebSocket connection closes */
|
|
383
|
+
onDisconnect?: () => void;
|
|
384
|
+
/** Called with terminal output data */
|
|
385
|
+
onData?: (data: string) => void;
|
|
386
|
+
/** Called when the server reports PTY status (shell name) */
|
|
387
|
+
onStatus?: (shell: string) => void;
|
|
388
|
+
/** Called when the server reports an error */
|
|
389
|
+
onError?: (message: string, errors?: string[]) => void;
|
|
390
|
+
/** Called when the PTY process exits */
|
|
391
|
+
onExit?: (code: number) => void;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* PTY transport connect options matching restty's PtyConnectOptions.
|
|
396
|
+
*/
|
|
397
|
+
export interface IPtyTransportConnectOptions {
|
|
398
|
+
/** WebSocket URL (ws:// or wss://) */
|
|
399
|
+
url: string;
|
|
400
|
+
/** Initial terminal width in columns */
|
|
401
|
+
cols?: number;
|
|
402
|
+
/** Initial terminal height in rows */
|
|
403
|
+
rows?: number;
|
|
404
|
+
/** Event callbacks for connection lifecycle and data */
|
|
405
|
+
callbacks: IPtyTransportCallbacks;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* PTY transport interface matching restty's expected contract.
|
|
410
|
+
* Consumers provide a custom implementation to bridge their WebSocket protocol.
|
|
411
|
+
*/
|
|
412
|
+
export interface IPtyTransport {
|
|
413
|
+
/** Open a connection to the PTY server */
|
|
414
|
+
connect: (options: IPtyTransportConnectOptions) => void;
|
|
415
|
+
/** Close the current connection */
|
|
416
|
+
disconnect: () => void;
|
|
417
|
+
/** Send terminal input data to the server */
|
|
418
|
+
sendInput: (data: string) => boolean;
|
|
419
|
+
/** Send terminal resize notification to the server */
|
|
420
|
+
resize: (cols: number, rows: number) => boolean;
|
|
421
|
+
/** Check if the transport is currently connected */
|
|
422
|
+
isConnected: () => boolean;
|
|
423
|
+
/** Release all resources held by the transport */
|
|
424
|
+
destroy: () => void;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Factory function that creates a PTY transport instance.
|
|
429
|
+
* Consumers inject this to provide custom WebSocket protocol bridging.
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```ts
|
|
433
|
+
* // In mks-devenv consumer:
|
|
434
|
+
* const factory: IPtyTransportFactory = () => createDevenvPtyTransport();
|
|
435
|
+
* <TerminalRestty createPtyTransport={factory} wsUrl={wsUrl} />
|
|
436
|
+
* ```
|
|
437
|
+
*/
|
|
438
|
+
export type IPtyTransportFactory = () => IPtyTransport;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TerminalDisplay style definitions.
|
|
3
|
+
*
|
|
4
|
+
* @module components/devenv/terminal/TerminalDisplay.styles
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
8
|
+
import type { StyleSlots } from '@/core/types';
|
|
9
|
+
import type { TerminalDisplaySlot } from './TerminalDisplay.types';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Default style slots for TerminalDisplay regions.
|
|
13
|
+
*/
|
|
14
|
+
export const terminalDisplayStyles: StyleSlots<TerminalDisplaySlot> = {
|
|
15
|
+
root: 'relative overflow-hidden',
|
|
16
|
+
chrome: '',
|
|
17
|
+
terminal: 'w-full h-full pointer-events-none',
|
|
18
|
+
emptyState: 'flex items-center justify-center text-sm text-muted-foreground/50 font-mono',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* CVA variants for the display root.
|
|
23
|
+
*/
|
|
24
|
+
export const terminalDisplayVariants = cva(terminalDisplayStyles.root, {
|
|
25
|
+
variants: {
|
|
26
|
+
variant: {
|
|
27
|
+
default: '',
|
|
28
|
+
compact: '',
|
|
29
|
+
error: '',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: 'default',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/** Extracted variant props type */
|
|
38
|
+
export type TerminalDisplayVariantProps = VariantProps<typeof terminalDisplayVariants>;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TerminalDisplay — Readonly GPU-rendered terminal for ANSI content.
|
|
3
|
+
*
|
|
4
|
+
* Uses restty directly (not xterm) for GPU-accelerated rendering of
|
|
5
|
+
* ANSI-formatted text without PTY connection. Content is written via
|
|
6
|
+
* `restty.sendInput(data, "pty")` which feeds text to the WASM terminal
|
|
7
|
+
* engine for parsing and rendering.
|
|
8
|
+
*
|
|
9
|
+
* Optionally wrapped in TerminalPanelChrome glassmorphism shell.
|
|
10
|
+
*
|
|
11
|
+
* @module components/devenv/terminal/TerminalDisplay
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
'use client';
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
useRef,
|
|
18
|
+
useEffect,
|
|
19
|
+
useCallback,
|
|
20
|
+
forwardRef,
|
|
21
|
+
useImperativeHandle,
|
|
22
|
+
useState,
|
|
23
|
+
} from 'react';
|
|
24
|
+
import type { Restty } from 'restty';
|
|
25
|
+
import type { ITerminalDisplayProps, ITerminalDisplayRef } from './TerminalDisplay.types';
|
|
26
|
+
import { terminalDisplayStyles, terminalDisplayVariants } from './TerminalDisplay.styles';
|
|
27
|
+
import { TerminalPanelChrome } from './panel/TerminalPanelChrome';
|
|
28
|
+
import { getSynthwaveGhosttyTheme, xtermThemeToGhostty } from './Terminal.theme.restty';
|
|
29
|
+
import { cn } from '@/react-ui/lib/utils';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* TerminalDisplay — Readonly restty terminal for displaying ANSI content.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <TerminalDisplay
|
|
37
|
+
* content={"\x1b[31mError:\x1b[0m Something failed"}
|
|
38
|
+
* title="Error Output"
|
|
39
|
+
* variant="error"
|
|
40
|
+
* fontSize={12}
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Without chrome shell
|
|
47
|
+
* <TerminalDisplay
|
|
48
|
+
* content={ansiOutput}
|
|
49
|
+
* chrome={false}
|
|
50
|
+
* minHeight={100}
|
|
51
|
+
* />
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* // With imperative handle
|
|
57
|
+
* const ref = useRef<ITerminalDisplayRef>(null);
|
|
58
|
+
* ref.current?.write("Additional output\r\n");
|
|
59
|
+
* ref.current?.clear();
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export const TerminalDisplay = forwardRef<ITerminalDisplayRef, ITerminalDisplayProps>(
|
|
63
|
+
(
|
|
64
|
+
{
|
|
65
|
+
content,
|
|
66
|
+
title = 'Output',
|
|
67
|
+
variant = 'default',
|
|
68
|
+
chrome = true,
|
|
69
|
+
fontSize = 13,
|
|
70
|
+
minHeight = 200,
|
|
71
|
+
theme,
|
|
72
|
+
resttyThemeName,
|
|
73
|
+
gpuRenderer = 'auto',
|
|
74
|
+
slots,
|
|
75
|
+
className,
|
|
76
|
+
emptyText,
|
|
77
|
+
onReady,
|
|
78
|
+
},
|
|
79
|
+
ref,
|
|
80
|
+
) => {
|
|
81
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
82
|
+
const resttyRef = useRef<Restty | null>(null);
|
|
83
|
+
const [isReady, setIsReady] = useState(false);
|
|
84
|
+
|
|
85
|
+
// Store callbacks in refs
|
|
86
|
+
const callbacksRef = useRef({ onReady });
|
|
87
|
+
callbacksRef.current = { onReady };
|
|
88
|
+
|
|
89
|
+
// Store content in ref to avoid re-creating restty on content change
|
|
90
|
+
const contentRef = useRef(content);
|
|
91
|
+
contentRef.current = content;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Initialize restty on mount.
|
|
95
|
+
* Dynamic import for SSR safety and code-splitting.
|
|
96
|
+
*/
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!containerRef.current) return;
|
|
99
|
+
let destroyed = false;
|
|
100
|
+
|
|
101
|
+
const init = async () => {
|
|
102
|
+
const { Restty: ResttyClass, getBuiltinTheme } = await import('restty');
|
|
103
|
+
if (destroyed || !containerRef.current) return;
|
|
104
|
+
|
|
105
|
+
const restty = new ResttyClass({
|
|
106
|
+
root: containerRef.current,
|
|
107
|
+
appOptions: {
|
|
108
|
+
renderer: gpuRenderer,
|
|
109
|
+
fontSize,
|
|
110
|
+
autoResize: true,
|
|
111
|
+
},
|
|
112
|
+
fontSources: [
|
|
113
|
+
{
|
|
114
|
+
type: 'local',
|
|
115
|
+
matchers: [
|
|
116
|
+
'jetbrains mono',
|
|
117
|
+
'fira code',
|
|
118
|
+
'sf mono',
|
|
119
|
+
'cascadia code',
|
|
120
|
+
'meslo',
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
createInitialPane: true,
|
|
125
|
+
shortcuts: false,
|
|
126
|
+
defaultContextMenu: false,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
resttyRef.current = restty;
|
|
130
|
+
|
|
131
|
+
// Apply theme
|
|
132
|
+
if (resttyThemeName) {
|
|
133
|
+
const builtinTheme = getBuiltinTheme(resttyThemeName);
|
|
134
|
+
if (builtinTheme) restty.applyTheme(builtinTheme);
|
|
135
|
+
} else if (theme) {
|
|
136
|
+
restty.applyTheme(xtermThemeToGhostty(theme));
|
|
137
|
+
} else {
|
|
138
|
+
restty.applyTheme(getSynthwaveGhosttyTheme());
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Write initial content
|
|
142
|
+
if (contentRef.current) {
|
|
143
|
+
restty.sendInput(contentRef.current, 'pty');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
setIsReady(true);
|
|
147
|
+
callbacksRef.current.onReady?.(restty);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
init().catch(() => {
|
|
151
|
+
// Silently fail — container will show empty
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
return () => {
|
|
155
|
+
destroyed = true;
|
|
156
|
+
resttyRef.current?.destroy();
|
|
157
|
+
resttyRef.current = null;
|
|
158
|
+
setIsReady(false);
|
|
159
|
+
};
|
|
160
|
+
}, []); // Mount once
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Re-write content when it changes after initialization.
|
|
164
|
+
*/
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (!isReady || !resttyRef.current) return;
|
|
167
|
+
resttyRef.current.clearScreen();
|
|
168
|
+
if (content) {
|
|
169
|
+
resttyRef.current.sendInput(content, 'pty');
|
|
170
|
+
}
|
|
171
|
+
}, [content, isReady]);
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Handle fontSize changes after initialization.
|
|
175
|
+
*/
|
|
176
|
+
useEffect(() => {
|
|
177
|
+
if (!isReady || !resttyRef.current) return;
|
|
178
|
+
resttyRef.current.setFontSize(fontSize);
|
|
179
|
+
}, [fontSize, isReady]);
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Expose imperative handle.
|
|
183
|
+
*/
|
|
184
|
+
useImperativeHandle(ref, () => ({
|
|
185
|
+
getRestty: () => resttyRef.current,
|
|
186
|
+
clear: () => resttyRef.current?.clearScreen(),
|
|
187
|
+
write: (data: string) => resttyRef.current?.sendInput(data, 'pty'),
|
|
188
|
+
}));
|
|
189
|
+
|
|
190
|
+
/** Map variant to chrome variant */
|
|
191
|
+
const chromeVariant = variant === 'error' ? 'error' : 'default';
|
|
192
|
+
const chromeSize = variant === 'compact' ? 'compact' : 'default';
|
|
193
|
+
|
|
194
|
+
/** The terminal content area */
|
|
195
|
+
const terminalElement = (
|
|
196
|
+
<div
|
|
197
|
+
className={cn(
|
|
198
|
+
terminalDisplayVariants({ variant }),
|
|
199
|
+
slots?.root,
|
|
200
|
+
className,
|
|
201
|
+
)}
|
|
202
|
+
style={{ minHeight: `${minHeight}px` }}
|
|
203
|
+
>
|
|
204
|
+
{/* Empty state */}
|
|
205
|
+
{!content && emptyText && (
|
|
206
|
+
<div
|
|
207
|
+
className={cn(terminalDisplayStyles.emptyState, slots?.emptyState)}
|
|
208
|
+
style={{ minHeight: `${minHeight}px` }}
|
|
209
|
+
>
|
|
210
|
+
{emptyText}
|
|
211
|
+
</div>
|
|
212
|
+
)}
|
|
213
|
+
|
|
214
|
+
{/* Restty container */}
|
|
215
|
+
<div
|
|
216
|
+
ref={containerRef}
|
|
217
|
+
className={cn(terminalDisplayStyles.terminal, slots?.terminal)}
|
|
218
|
+
style={{
|
|
219
|
+
minHeight: `${minHeight}px`,
|
|
220
|
+
display: !content && emptyText ? 'none' : undefined,
|
|
221
|
+
}}
|
|
222
|
+
/>
|
|
223
|
+
</div>
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
if (!chrome) return terminalElement;
|
|
227
|
+
|
|
228
|
+
return (
|
|
229
|
+
<TerminalPanelChrome
|
|
230
|
+
containerName={title}
|
|
231
|
+
isConnected={isReady}
|
|
232
|
+
variant={chromeVariant}
|
|
233
|
+
size={chromeSize}
|
|
234
|
+
slots={{ root: slots?.chrome }}
|
|
235
|
+
className={className}
|
|
236
|
+
>
|
|
237
|
+
{terminalElement}
|
|
238
|
+
</TerminalPanelChrome>
|
|
239
|
+
);
|
|
240
|
+
},
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
TerminalDisplay.displayName = 'TerminalDisplay';
|