@mks2508/mks-ui 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts +146 -0
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.js +213 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts +55 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.js +68 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts +43 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.js +59 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts +63 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.js +109 -0
- package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts +351 -0
- package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts +60 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.js +183 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts +111 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.js +185 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.js +143 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts +87 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.js +135 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts +160 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.js +185 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts +48 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.js +139 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts +60 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.js +352 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts +36 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.js +52 -0
- package/dist/react-ui/blocks/Terminal/components/index.d.ts +10 -0
- package/dist/react-ui/blocks/Terminal/components/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/index.js +4 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.d.ts +11 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.js +2 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts +69 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.js +162 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts +104 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.js +180 -0
- package/dist/react-ui/blocks/Terminal/index.d.ts +39 -0
- package/dist/react-ui/blocks/Terminal/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/index.js +38 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.js +222 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts +74 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.js +168 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts +42 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.js +175 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts +43 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts +38 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.js +62 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts +67 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts +32 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.js +326 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts +36 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.js +371 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts +67 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.js +417 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts +197 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts +54 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.js +193 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts +57 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts +30 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.js +126 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts +31 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.js +149 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts +35 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts +63 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.js +245 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts +24 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.js +225 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts +35 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.js +187 -0
- package/dist/react-ui/blocks/Terminal/panel/index.d.ts +30 -0
- package/dist/react-ui/blocks/Terminal/panel/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module-Bovc57nm.css +60 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.js +5 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module-QyxHO7cN.css +60 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.js +5 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts +73 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.js +136 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts +117 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.js +174 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts +221 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts +184 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.js +478 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts +173 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.js +313 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts +181 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.js +221 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts +69 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.js +142 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts +125 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.js +245 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts +165 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.js +225 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts +164 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.js +285 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts +188 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.js +178 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts +12 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/index.d.ts +24 -0
- package/dist/react-ui/blocks/Terminal/parsing/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts +56 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts +140 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.js +325 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts +10 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/index.d.ts +11 -0
- package/dist/react-ui/blocks/index.d.ts.map +1 -0
- package/dist/react-ui/icons/lucide-animated/activity.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bell-electric.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bell.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bot.js +1 -1
- package/dist/react-ui/icons/lucide-animated/box.js +1 -1
- package/dist/react-ui/icons/lucide-animated/circle-check.js +1 -1
- package/dist/react-ui/icons/lucide-animated/delete.js +1 -1
- package/dist/react-ui/icons/lucide-animated/download.js +1 -1
- package/dist/react-ui/icons/lucide-animated/home.js +1 -1
- package/dist/react-ui/icons/lucide-animated/layout-panel-top.js +1 -1
- package/dist/react-ui/icons/lucide-animated/plus.js +1 -1
- package/dist/react-ui/icons/lucide-animated/search.js +1 -1
- package/dist/react-ui/icons/lucide-animated/settings.js +1 -1
- package/dist/react-ui/icons/lucide-animated/trending-down.js +1 -1
- package/dist/react-ui/icons/lucide-animated/trending-up.js +1 -1
- package/dist/react-ui/icons/lucide-animated/x.js +1 -1
- package/dist/react-ui/index.js +4 -1
- package/dist/react-ui/lib/icon-wrapper.d.ts +37 -0
- package/dist/react-ui/lib/icon-wrapper.d.ts.map +1 -0
- package/dist/react-ui/lib/icon-wrapper.js +55 -0
- package/dist/react-ui/lib/index.d.ts +1 -0
- package/dist/react-ui/lib/index.d.ts.map +1 -1
- package/dist/react-ui/lib/index.js +1 -0
- package/dist/react-ui/primitives/AutoHeight/index.d.ts +1 -1
- package/dist/react-ui/primitives/CountingNumber/index.d.ts +1 -1
- package/dist/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.d.ts +1 -1
- package/dist/react-ui/primitives/waapi/SlidingText/SlidingText.styles.d.ts +1 -1
- package/dist/react-ui/ui/Accordion/Accordion.styles.d.ts +1 -1
- package/dist/react-ui/ui/Accordion/Accordion.types.d.ts +1 -1
- package/dist/react-ui/ui/AlertDialog/AlertDialog.styles.d.ts +1 -1
- package/dist/react-ui/ui/AlertDialog/AlertDialog.types.d.ts +1 -1
- package/dist/react-ui/ui/Badge/Badge.styles.d.ts +1 -1
- package/dist/react-ui/ui/Badge/Badge.types.d.ts +1 -1
- package/dist/react-ui/ui/Button/Button.styles.d.ts +2 -2
- package/dist/react-ui/ui/Button/Button.types.d.ts +1 -1
- package/dist/react-ui/ui/Card/Card.styles.d.ts +1 -1
- package/dist/react-ui/ui/Card/Card.types.d.ts +1 -1
- package/dist/react-ui/ui/Checkbox/Checkbox.styles.d.ts +1 -1
- package/dist/react-ui/ui/Checkbox/Checkbox.types.d.ts +1 -1
- package/dist/react-ui/ui/Combobox/Combobox.styles.d.ts +1 -1
- package/dist/react-ui/ui/Combobox/Combobox.types.d.ts +1 -1
- package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.d.ts +2 -2
- package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.js +1 -1
- package/dist/react-ui/ui/CornerBracket/CornerBracket.types.d.ts +1 -1
- package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts +1 -1
- package/dist/react-ui/ui/DataCard/DataCard.types.d.ts +1 -1
- package/dist/react-ui/ui/DataCard/index.d.ts +1 -1
- package/dist/react-ui/ui/Dialog/Dialog.styles.d.ts +1 -1
- package/dist/react-ui/ui/Dialog/Dialog.types.d.ts +1 -1
- package/dist/react-ui/ui/DropdownMenu/DropdownMenu.styles.d.ts +1 -1
- package/dist/react-ui/ui/DropdownMenu/DropdownMenu.types.d.ts +1 -1
- package/dist/react-ui/ui/Field/Field.styles.d.ts +1 -1
- package/dist/react-ui/ui/Field/Field.types.d.ts +1 -1
- package/dist/react-ui/ui/Input/Input.styles.d.ts +1 -1
- package/dist/react-ui/ui/Input/Input.types.d.ts +1 -1
- package/dist/react-ui/ui/InputGroup/InputGroup.styles.d.ts +1 -1
- package/dist/react-ui/ui/InputGroup/InputGroup.types.d.ts +1 -1
- package/dist/react-ui/ui/Label/Label.styles.d.ts +1 -1
- package/dist/react-ui/ui/Label/Label.types.d.ts +1 -1
- package/dist/react-ui/ui/Menu/Menu.styles.d.ts +1 -1
- package/dist/react-ui/ui/Menu/Menu.types.d.ts +2 -2
- package/dist/react-ui/ui/Popover/Popover.styles.d.ts +1 -1
- package/dist/react-ui/ui/Popover/Popover.types.d.ts +1 -1
- package/dist/react-ui/ui/Progress/Progress.styles.d.ts +1 -1
- package/dist/react-ui/ui/Progress/Progress.types.d.ts +2 -2
- package/dist/react-ui/ui/Select/Select.styles.d.ts +1 -1
- package/dist/react-ui/ui/Select/Select.types.d.ts +1 -1
- package/dist/react-ui/ui/Separator/Separator.styles.d.ts +1 -1
- package/dist/react-ui/ui/Separator/Separator.types.d.ts +1 -1
- package/dist/react-ui/ui/Switch/Switch.styles.d.ts +1 -1
- package/dist/react-ui/ui/Switch/Switch.types.d.ts +1 -1
- package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts +43 -25
- package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/Tabs.styles.js +105 -13
- package/dist/react-ui/ui/Tabs/Tabs.types.d.ts +9 -6
- package/dist/react-ui/ui/Tabs/Tabs.types.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/index.d.ts +18 -9
- package/dist/react-ui/ui/Tabs/index.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/index.js +99 -27
- package/dist/react-ui/ui/TextFlow/TextFlow.styles.d.ts +1 -1
- package/dist/react-ui/ui/Textarea/Textarea.styles.d.ts +1 -1
- package/dist/react-ui/ui/Textarea/Textarea.types.d.ts +1 -1
- package/dist/react-ui/ui/Tooltip/Tooltip.styles.d.ts +1 -1
- package/dist/react-ui/ui/Tooltip/Tooltip.types.d.ts +1 -1
- package/dist/react-ui/ui/index.d.ts +1 -0
- package/dist/react-ui/ui/index.d.ts.map +1 -1
- package/dist/react-ui/ui/index.js +2 -0
- package/package.json +54 -6
- package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +278 -0
- package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +97 -0
- package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +155 -0
- package/src/react-ui/blocks/Terminal/Terminal.theme.ts +80 -0
- package/src/react-ui/blocks/Terminal/Terminal.types.ts +438 -0
- package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +269 -0
- package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +326 -0
- package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +230 -0
- package/src/react-ui/blocks/Terminal/XTermAdapter.ts +163 -0
- package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +316 -0
- package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +218 -0
- package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +386 -0
- package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +67 -0
- package/src/react-ui/blocks/Terminal/components/index.ts +10 -0
- package/src/react-ui/blocks/Terminal/hooks/index.ts +22 -0
- package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +229 -0
- package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +292 -0
- package/src/react-ui/blocks/Terminal/index.ts +103 -0
- package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +330 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +242 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +202 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +140 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +68 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +85 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +383 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +439 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +550 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +259 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +237 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +76 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +112 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +178 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +203 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +252 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +334 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +261 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +248 -0
- package/src/react-ui/blocks/Terminal/panel/index.ts +72 -0
- package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +59 -0
- package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +59 -0
- package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +180 -0
- package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +248 -0
- package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +283 -0
- package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +686 -0
- package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +466 -0
- package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +343 -0
- package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +167 -0
- package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +348 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +251 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +390 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +320 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +20 -0
- package/src/react-ui/blocks/Terminal/parsing/index.ts +69 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +68 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +436 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +14 -0
- package/src/react-ui/blocks/index.ts +11 -0
- package/src/react-ui/icons/lucide-animated/activity.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/bell-electric.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/bell.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/bot.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/box.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/circle-check.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/delete.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/download.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/home.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/plus.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/search.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/settings.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/trending-down.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/trending-up.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/x.tsx +2 -2
- package/src/react-ui/lib/icon-wrapper.tsx +70 -0
- package/src/react-ui/lib/index.ts +1 -0
- package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +1 -1
- package/src/react-ui/ui/Tabs/Tabs.css +39 -0
- package/src/react-ui/ui/Tabs/Tabs.styles.ts +119 -31
- package/src/react-ui/ui/Tabs/Tabs.types.ts +8 -3
- package/src/react-ui/ui/Tabs/index.tsx +135 -27
- package/src/react-ui/ui/index.ts +1 -0
- package/dist/index.css +0 -129
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
//#region src/react-ui/blocks/Terminal/parsing/TableParser.ts
|
|
2
|
+
/**
|
|
3
|
+
* Box-drawing characters used for table borders.
|
|
4
|
+
* Unicode range: U+2500-U+257F
|
|
5
|
+
*/
|
|
6
|
+
const TABLE_CHARS = [
|
|
7
|
+
"─",
|
|
8
|
+
"│",
|
|
9
|
+
"┌",
|
|
10
|
+
"┐",
|
|
11
|
+
"└",
|
|
12
|
+
"┘",
|
|
13
|
+
"├",
|
|
14
|
+
"┤",
|
|
15
|
+
"┬",
|
|
16
|
+
"┴",
|
|
17
|
+
"┼",
|
|
18
|
+
"═",
|
|
19
|
+
"║",
|
|
20
|
+
"╔",
|
|
21
|
+
"╗",
|
|
22
|
+
"╚",
|
|
23
|
+
"╝",
|
|
24
|
+
"╠",
|
|
25
|
+
"╣",
|
|
26
|
+
"╦",
|
|
27
|
+
"╩",
|
|
28
|
+
"╬",
|
|
29
|
+
"╒",
|
|
30
|
+
"╓",
|
|
31
|
+
"╕",
|
|
32
|
+
"╖",
|
|
33
|
+
"╘",
|
|
34
|
+
"╙",
|
|
35
|
+
"╛",
|
|
36
|
+
"╜",
|
|
37
|
+
"╢",
|
|
38
|
+
"╡",
|
|
39
|
+
"╤",
|
|
40
|
+
"╧",
|
|
41
|
+
"╟",
|
|
42
|
+
"╞",
|
|
43
|
+
"╡",
|
|
44
|
+
"╢",
|
|
45
|
+
"╪",
|
|
46
|
+
"╫"
|
|
47
|
+
];
|
|
48
|
+
/**
|
|
49
|
+
* Table parser class.
|
|
50
|
+
*
|
|
51
|
+
* Detects and parses tables created with box-drawing characters.
|
|
52
|
+
* Groups consecutive table lines and extracts cell data.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const parser = new TableParser();
|
|
57
|
+
* const isTable = parser.isTableLine('├──────────┼──────────┤');
|
|
58
|
+
* const table = parser.parseTable(lines);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
var TableParser = class {
|
|
62
|
+
/** Minimum box-drawing characters to consider a line a table */
|
|
63
|
+
MIN_TABLE_CHARS = 2;
|
|
64
|
+
/**
|
|
65
|
+
* Check if a line is a table line.
|
|
66
|
+
*
|
|
67
|
+
* A line is considered a table line if it contains multiple
|
|
68
|
+
* box-drawing characters.
|
|
69
|
+
*
|
|
70
|
+
* @param line - Line to check
|
|
71
|
+
* @returns true if line is part of a table
|
|
72
|
+
*/
|
|
73
|
+
isTableLine(line) {
|
|
74
|
+
let count = 0;
|
|
75
|
+
for (const char of TABLE_CHARS) if (line.includes(char)) {
|
|
76
|
+
count++;
|
|
77
|
+
if (count >= this.MIN_TABLE_CHARS) return true;
|
|
78
|
+
}
|
|
79
|
+
return count >= this.MIN_TABLE_CHARS;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Determine the type of a table row.
|
|
83
|
+
*
|
|
84
|
+
* @param line - Table row line
|
|
85
|
+
* @returns Row type
|
|
86
|
+
*/
|
|
87
|
+
getRowType(line) {
|
|
88
|
+
const trimmed = line.trim();
|
|
89
|
+
if (/^[┌╒]/.test(trimmed)) return "top";
|
|
90
|
+
if (/^[└╘]/.test(trimmed)) return "bottom";
|
|
91
|
+
if (/[├┼┬┴╪╤╧╠╦╩╬]/.test(trimmed)) return "separator";
|
|
92
|
+
if (/[═]/.test(trimmed) && /[│║]/.test(trimmed)) return "separator";
|
|
93
|
+
if (/[│║]/.test(trimmed) && /[a-zA-Z0-9]/.test(trimmed)) {
|
|
94
|
+
const content = trimmed.replace(/[│║═─┼┬┴├╪╤╧]/g, " ").trim();
|
|
95
|
+
if (content.length > 0 && content === content.toUpperCase() && content.length < 50) return "header";
|
|
96
|
+
return "data";
|
|
97
|
+
}
|
|
98
|
+
return "unknown";
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Extract cells from a table row.
|
|
102
|
+
*
|
|
103
|
+
* Splits the row by │ characters and trims each cell.
|
|
104
|
+
*
|
|
105
|
+
* @param line - Table row line
|
|
106
|
+
* @returns Array of cell contents
|
|
107
|
+
*/
|
|
108
|
+
extractCells(line) {
|
|
109
|
+
return line.replace(/^[│║]|[│║]$/g, "").split(/[│║]/).map((cell) => cell.trim()).filter((cell) => cell.length > 0);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Parse a complete table from an array of lines.
|
|
113
|
+
*
|
|
114
|
+
* Groups consecutive table lines and extracts structured data.
|
|
115
|
+
*
|
|
116
|
+
* @param lines - Array of table lines
|
|
117
|
+
* @param startLine - Starting line number
|
|
118
|
+
* @returns Parsed table data
|
|
119
|
+
*/
|
|
120
|
+
parseTable(lines, startLine) {
|
|
121
|
+
const rows = [];
|
|
122
|
+
const dataRows = [];
|
|
123
|
+
for (let i = 0; i < lines.length; i++) {
|
|
124
|
+
const line = lines[i];
|
|
125
|
+
const type = this.getRowType(line);
|
|
126
|
+
const cells = type === "data" || type === "header" ? this.extractCells(line) : void 0;
|
|
127
|
+
const row = {
|
|
128
|
+
raw: line,
|
|
129
|
+
type,
|
|
130
|
+
cells,
|
|
131
|
+
lineNumber: startLine + i
|
|
132
|
+
};
|
|
133
|
+
rows.push(row);
|
|
134
|
+
if (cells) dataRows.push(cells);
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
rows,
|
|
138
|
+
columnCount: Math.max(...dataRows.map((r) => r.length), 1),
|
|
139
|
+
headers: rows.find((r) => r.type === "header")?.cells,
|
|
140
|
+
dataRows,
|
|
141
|
+
startLine,
|
|
142
|
+
endLine: startLine + lines.length - 1
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Parse table entries from a log stream.
|
|
147
|
+
*
|
|
148
|
+
* Scans through lines, grouping table lines into entries.
|
|
149
|
+
*
|
|
150
|
+
* @param lines - Array of log lines
|
|
151
|
+
* @param startLine - Starting line number
|
|
152
|
+
* @returns Array of parsed log entries
|
|
153
|
+
*/
|
|
154
|
+
parseTableEntries(lines, startLine) {
|
|
155
|
+
const entries = [];
|
|
156
|
+
let inTable = false;
|
|
157
|
+
let tableStartLine = 0;
|
|
158
|
+
const tableLines = [];
|
|
159
|
+
for (let i = 0; i < lines.length; i++) {
|
|
160
|
+
const line = lines[i];
|
|
161
|
+
const isTable = this.isTableLine(line);
|
|
162
|
+
if (isTable && !inTable) {
|
|
163
|
+
inTable = true;
|
|
164
|
+
tableStartLine = startLine + i;
|
|
165
|
+
tableLines.push(line);
|
|
166
|
+
} else if (isTable && inTable) tableLines.push(line);
|
|
167
|
+
else if (!isTable && inTable) {
|
|
168
|
+
const tableData = this.parseTable(tableLines, tableStartLine);
|
|
169
|
+
entries.push({
|
|
170
|
+
raw: tableLines.join("\n"),
|
|
171
|
+
formatted: tableLines.join("\n"),
|
|
172
|
+
level: "info",
|
|
173
|
+
line_number: tableStartLine,
|
|
174
|
+
is_stderr: false,
|
|
175
|
+
content_type: "table",
|
|
176
|
+
table_data: tableData,
|
|
177
|
+
is_continuation: false
|
|
178
|
+
});
|
|
179
|
+
for (let j = 1; j < tableLines.length; j++) entries.push({
|
|
180
|
+
raw: tableLines[j],
|
|
181
|
+
formatted: tableLines[j],
|
|
182
|
+
level: "info",
|
|
183
|
+
line_number: tableStartLine + j,
|
|
184
|
+
is_stderr: false,
|
|
185
|
+
content_type: "table",
|
|
186
|
+
is_continuation: true,
|
|
187
|
+
parent_line_number: tableStartLine
|
|
188
|
+
});
|
|
189
|
+
inTable = false;
|
|
190
|
+
tableLines.length = 0;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (tableLines.length > 0) {
|
|
194
|
+
const tableData = this.parseTable(tableLines, tableStartLine);
|
|
195
|
+
entries.push({
|
|
196
|
+
raw: tableLines.join("\n"),
|
|
197
|
+
formatted: tableLines.join("\n"),
|
|
198
|
+
level: "info",
|
|
199
|
+
line_number: tableStartLine,
|
|
200
|
+
is_stderr: false,
|
|
201
|
+
content_type: "table",
|
|
202
|
+
table_data: tableData,
|
|
203
|
+
is_continuation: false
|
|
204
|
+
});
|
|
205
|
+
for (let j = 1; j < tableLines.length; j++) entries.push({
|
|
206
|
+
raw: tableLines[j],
|
|
207
|
+
formatted: tableLines[j],
|
|
208
|
+
level: "info",
|
|
209
|
+
line_number: tableStartLine + j,
|
|
210
|
+
is_stderr: false,
|
|
211
|
+
content_type: "table",
|
|
212
|
+
is_continuation: true,
|
|
213
|
+
parent_line_number: tableStartLine
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
return entries;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Get CSS class for a table row type.
|
|
220
|
+
*
|
|
221
|
+
* @param type - Row type
|
|
222
|
+
* @returns CSS class string
|
|
223
|
+
*/
|
|
224
|
+
getRowClass(type) {
|
|
225
|
+
switch (type) {
|
|
226
|
+
case "top":
|
|
227
|
+
case "bottom": return "text-gray-500";
|
|
228
|
+
case "separator": return "text-gray-600";
|
|
229
|
+
case "header": return "font-semibold text-foreground";
|
|
230
|
+
case "data": return "text-foreground";
|
|
231
|
+
default: return "text-foreground";
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* Create a new table parser instance.
|
|
237
|
+
*
|
|
238
|
+
* @returns New TableParser instance
|
|
239
|
+
*/
|
|
240
|
+
function createTableParser() {
|
|
241
|
+
return new TableParser();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
//#endregion
|
|
245
|
+
export { TABLE_CHARS, TableParser, createTableParser };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI color mapper for Synthwave theme integration.
|
|
3
|
+
*
|
|
4
|
+
* Maps ANSI color codes to Synthwave Industrial Dark theme colors
|
|
5
|
+
* from Terminal.theme.ts. Provides utilities for converting between
|
|
6
|
+
* different color representations and applying theme-aware coloring.
|
|
7
|
+
*
|
|
8
|
+
* @module components/devenv/terminal/parsing/ansi/mapper
|
|
9
|
+
*/
|
|
10
|
+
import type { IAnsiStyle } from '../LogParser.types';
|
|
11
|
+
/**
|
|
12
|
+
* ANSI color mapper class.
|
|
13
|
+
*
|
|
14
|
+
* Provides static methods for mapping ANSI color codes to
|
|
15
|
+
* Synthwave theme colors and converting between color formats.
|
|
16
|
+
*/
|
|
17
|
+
export declare class AnsiColorMapper {
|
|
18
|
+
/**
|
|
19
|
+
* Get hex color for ANSI foreground color code.
|
|
20
|
+
*
|
|
21
|
+
* Converts ANSI SGR foreground color codes (30-37, 90-97) to
|
|
22
|
+
* their corresponding hex colors in the Synthwave theme.
|
|
23
|
+
*
|
|
24
|
+
* @param code - ANSI color code (e.g., 31 for red, 32 for green)
|
|
25
|
+
* @returns Hex color string (e.g., '#ff4466') or undefined if unknown
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const red = AnsiColorMapper.fgColor(31); // '#ff4466'
|
|
30
|
+
* const green = AnsiColorMapper.fgColor(32); // '#44ffaa'
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
static fgColor(code: number): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Get hex color for ANSI background color code.
|
|
36
|
+
*
|
|
37
|
+
* Converts ANSI SGR background color codes (40-47, 100-107) to
|
|
38
|
+
* their corresponding hex colors by converting to foreground
|
|
39
|
+
* code and looking up in theme.
|
|
40
|
+
*
|
|
41
|
+
* @param code - ANSI background color code (e.g., 41 for red bg)
|
|
42
|
+
* @returns Hex color string or undefined if unknown
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const redBg = AnsiColorMapper.bgColor(41); // '#ff4466'
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
static bgColor(code: number): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Check if color code is bright variant.
|
|
52
|
+
*
|
|
53
|
+
* @param code - ANSI color code
|
|
54
|
+
* @returns true if code is bright (90-97 or 100-107)
|
|
55
|
+
*/
|
|
56
|
+
static isBright(code: number): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Check if color code is background color.
|
|
59
|
+
*
|
|
60
|
+
* @param code - ANSI color code
|
|
61
|
+
* @returns true if code is background (40-47 or 100-107)
|
|
62
|
+
*/
|
|
63
|
+
static isBackground(code: number): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Convert ANSI style to hex color pair.
|
|
66
|
+
*
|
|
67
|
+
* Takes a parsed ANSI style and returns foreground and background
|
|
68
|
+
* hex colors for use in xterm.js or CSS styling.
|
|
69
|
+
*
|
|
70
|
+
* @param style - Parsed ANSI style
|
|
71
|
+
* @returns Object with fg and bg hex colors (undefined if not set)
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const colors = AnsiColorMapper.styleToHex({
|
|
76
|
+
* fg_color: 31,
|
|
77
|
+
* bg_color: 44,
|
|
78
|
+
* modifiers: ['bold']
|
|
79
|
+
* });
|
|
80
|
+
* // { fg: '#ff4466', bg: '#00d9ff' }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
static styleToHex(style: IAnsiStyle): {
|
|
84
|
+
fg?: string;
|
|
85
|
+
bg?: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Convert hex color to xterm.js color index.
|
|
89
|
+
*
|
|
90
|
+
* xterm.js uses a 256-color palette. This method maps Synthwave
|
|
91
|
+
* hex colors to the closest xterm.js color index.
|
|
92
|
+
*
|
|
93
|
+
* @param hex - Hex color string (e.g., '#ff4466')
|
|
94
|
+
* @returns xterm.js color index (0-255) or closest match
|
|
95
|
+
*/
|
|
96
|
+
static hexToXtermColor(hex: string): number;
|
|
97
|
+
/**
|
|
98
|
+
* Get log level color as hex.
|
|
99
|
+
*
|
|
100
|
+
* Returns the Synthwave theme color for a given log level.
|
|
101
|
+
*
|
|
102
|
+
* @param level - Log level
|
|
103
|
+
* @returns Hex color string for the log level
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* const errorColor = AnsiColorMapper.logLevelColor('error'); // '#ff4466'
|
|
108
|
+
* const infoColor = AnsiColorMapper.logLevelColor('info'); // '#00d9ff'
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
static logLevelColor(level: string): string;
|
|
112
|
+
/**
|
|
113
|
+
* Get log level background color (semi-transparent).
|
|
114
|
+
*
|
|
115
|
+
* Returns the background color for log level badges with
|
|
116
|
+
* transparency for overlay effects.
|
|
117
|
+
*
|
|
118
|
+
* @param level - Log level
|
|
119
|
+
* @returns RGBA color string for background
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const errorBg = AnsiColorMapper.logLevelBgColor('error'); // 'rgba(255, 68, 102, 0.1)'
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
static logLevelBgColor(level: string): string;
|
|
127
|
+
/**
|
|
128
|
+
* Create xterm.js color sequence from hex.
|
|
129
|
+
*
|
|
130
|
+
* Generates xterm.js escape sequence for setting text color
|
|
131
|
+
* from a hex color value.
|
|
132
|
+
*
|
|
133
|
+
* @param hex - Hex color string
|
|
134
|
+
* @param isBackground - true for background color, false for foreground
|
|
135
|
+
* @returns xterm.js escape sequence
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* const seq = AnsiColorMapper.xtermColorSequence('#ff4466', false);
|
|
140
|
+
* // '\x1b]4;196;#ff4466\x07' (OSC 4 sequence for true color)
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
static xtermColorSequence(hex: string, isBackground?: boolean): string;
|
|
144
|
+
/**
|
|
145
|
+
* Convert RGB values to hex color.
|
|
146
|
+
*
|
|
147
|
+
* @param r - Red value (0-255)
|
|
148
|
+
* @param g - Green value (0-255)
|
|
149
|
+
* @param b - Blue value (0-255)
|
|
150
|
+
* @returns Hex color string (e.g., '#ff4466')
|
|
151
|
+
*/
|
|
152
|
+
static rgbToHex(r: number, g: number, b: number): string;
|
|
153
|
+
/**
|
|
154
|
+
* Convert hex color to RGB values.
|
|
155
|
+
*
|
|
156
|
+
* @param hex - Hex color string
|
|
157
|
+
* @returns Object with r, g, b values (0-255)
|
|
158
|
+
*/
|
|
159
|
+
static hexToRgb(hex: string): {
|
|
160
|
+
r: number;
|
|
161
|
+
g: number;
|
|
162
|
+
b: number;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=AnsiColorMapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnsiColorMapper.d.ts","sourceRoot":"","sources":["../../../../../../src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;GAKG;AACH,qBAAa,eAAe;IAC1B;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIhD;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAMhD;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAItC;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1C;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE;IAclE;;;;;;;;OAQG;IACH,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAwB3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAc3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAS7C;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,UAAQ,GAAG,MAAM;IAKpE;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAQxD;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;CAUlE"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { SYNTHWAVE_ANSI_COLORS } from "./ansi.constants.js";
|
|
2
|
+
|
|
3
|
+
//#region src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts
|
|
4
|
+
/**
|
|
5
|
+
* ANSI color mapper for Synthwave theme integration.
|
|
6
|
+
*
|
|
7
|
+
* Maps ANSI color codes to Synthwave Industrial Dark theme colors
|
|
8
|
+
* from Terminal.theme.ts. Provides utilities for converting between
|
|
9
|
+
* different color representations and applying theme-aware coloring.
|
|
10
|
+
*
|
|
11
|
+
* @module components/devenv/terminal/parsing/ansi/mapper
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* ANSI color mapper class.
|
|
15
|
+
*
|
|
16
|
+
* Provides static methods for mapping ANSI color codes to
|
|
17
|
+
* Synthwave theme colors and converting between color formats.
|
|
18
|
+
*/
|
|
19
|
+
var AnsiColorMapper = class {
|
|
20
|
+
/**
|
|
21
|
+
* Get hex color for ANSI foreground color code.
|
|
22
|
+
*
|
|
23
|
+
* Converts ANSI SGR foreground color codes (30-37, 90-97) to
|
|
24
|
+
* their corresponding hex colors in the Synthwave theme.
|
|
25
|
+
*
|
|
26
|
+
* @param code - ANSI color code (e.g., 31 for red, 32 for green)
|
|
27
|
+
* @returns Hex color string (e.g., '#ff4466') or undefined if unknown
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const red = AnsiColorMapper.fgColor(31); // '#ff4466'
|
|
32
|
+
* const green = AnsiColorMapper.fgColor(32); // '#44ffaa'
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
static fgColor(code) {
|
|
36
|
+
return SYNTHWAVE_ANSI_COLORS[code];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get hex color for ANSI background color code.
|
|
40
|
+
*
|
|
41
|
+
* Converts ANSI SGR background color codes (40-47, 100-107) to
|
|
42
|
+
* their corresponding hex colors by converting to foreground
|
|
43
|
+
* code and looking up in theme.
|
|
44
|
+
*
|
|
45
|
+
* @param code - ANSI background color code (e.g., 41 for red bg)
|
|
46
|
+
* @returns Hex color string or undefined if unknown
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const redBg = AnsiColorMapper.bgColor(41); // '#ff4466'
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
static bgColor(code) {
|
|
54
|
+
return SYNTHWAVE_ANSI_COLORS[code >= 100 ? code - 10 : code - 10];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Check if color code is bright variant.
|
|
58
|
+
*
|
|
59
|
+
* @param code - ANSI color code
|
|
60
|
+
* @returns true if code is bright (90-97 or 100-107)
|
|
61
|
+
*/
|
|
62
|
+
static isBright(code) {
|
|
63
|
+
return code >= 90 && code <= 97 || code >= 100 && code <= 107;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Check if color code is background color.
|
|
67
|
+
*
|
|
68
|
+
* @param code - ANSI color code
|
|
69
|
+
* @returns true if code is background (40-47 or 100-107)
|
|
70
|
+
*/
|
|
71
|
+
static isBackground(code) {
|
|
72
|
+
return code >= 40 && code <= 47 || code >= 100 && code <= 107;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Convert ANSI style to hex color pair.
|
|
76
|
+
*
|
|
77
|
+
* Takes a parsed ANSI style and returns foreground and background
|
|
78
|
+
* hex colors for use in xterm.js or CSS styling.
|
|
79
|
+
*
|
|
80
|
+
* @param style - Parsed ANSI style
|
|
81
|
+
* @returns Object with fg and bg hex colors (undefined if not set)
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const colors = AnsiColorMapper.styleToHex({
|
|
86
|
+
* fg_color: 31,
|
|
87
|
+
* bg_color: 44,
|
|
88
|
+
* modifiers: ['bold']
|
|
89
|
+
* });
|
|
90
|
+
* // { fg: '#ff4466', bg: '#00d9ff' }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
static styleToHex(style) {
|
|
94
|
+
const result = {};
|
|
95
|
+
if (style.fg_color !== void 0) result.fg = this.fgColor(style.fg_color);
|
|
96
|
+
if (style.bg_color !== void 0) result.bg = this.bgColor(style.bg_color);
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Convert hex color to xterm.js color index.
|
|
101
|
+
*
|
|
102
|
+
* xterm.js uses a 256-color palette. This method maps Synthwave
|
|
103
|
+
* hex colors to the closest xterm.js color index.
|
|
104
|
+
*
|
|
105
|
+
* @param hex - Hex color string (e.g., '#ff4466')
|
|
106
|
+
* @returns xterm.js color index (0-255) or closest match
|
|
107
|
+
*/
|
|
108
|
+
static hexToXtermColor(hex) {
|
|
109
|
+
return {
|
|
110
|
+
"#1a1a2e": 0,
|
|
111
|
+
"#ff4466": 197,
|
|
112
|
+
"#44ffaa": 84,
|
|
113
|
+
"#ffcc00": 226,
|
|
114
|
+
"#00d9ff": 87,
|
|
115
|
+
"#D40C67": 198,
|
|
116
|
+
"#e8e8ec": 255,
|
|
117
|
+
"#2d2d44": 8,
|
|
118
|
+
"#ff6b6b": 203,
|
|
119
|
+
"#66ffcc": 86,
|
|
120
|
+
"#ffdd33": 227,
|
|
121
|
+
"#33e0ff": 117,
|
|
122
|
+
"#ff3399": 205,
|
|
123
|
+
"#ffffff": 15
|
|
124
|
+
}[hex.toLowerCase()] ?? 7;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Get log level color as hex.
|
|
128
|
+
*
|
|
129
|
+
* Returns the Synthwave theme color for a given log level.
|
|
130
|
+
*
|
|
131
|
+
* @param level - Log level
|
|
132
|
+
* @returns Hex color string for the log level
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* const errorColor = AnsiColorMapper.logLevelColor('error'); // '#ff4466'
|
|
137
|
+
* const infoColor = AnsiColorMapper.logLevelColor('info'); // '#00d9ff'
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
static logLevelColor(level) {
|
|
141
|
+
const levelColors = {
|
|
142
|
+
trace: "#8b9bb4",
|
|
143
|
+
debug: "#00d9ff",
|
|
144
|
+
info: "#4db8ff",
|
|
145
|
+
warn: "#ffcc00",
|
|
146
|
+
error: "#ff4466",
|
|
147
|
+
fatal: "#D40C67",
|
|
148
|
+
unknown: "#e8e8ec"
|
|
149
|
+
};
|
|
150
|
+
return levelColors[level] ?? levelColors.unknown;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get log level background color (semi-transparent).
|
|
154
|
+
*
|
|
155
|
+
* Returns the background color for log level badges with
|
|
156
|
+
* transparency for overlay effects.
|
|
157
|
+
*
|
|
158
|
+
* @param level - Log level
|
|
159
|
+
* @returns RGBA color string for background
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```ts
|
|
163
|
+
* const errorBg = AnsiColorMapper.logLevelBgColor('error'); // 'rgba(255, 68, 102, 0.1)'
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
static logLevelBgColor(level) {
|
|
167
|
+
const hex = this.logLevelColor(level);
|
|
168
|
+
return `rgba(${parseInt(hex.slice(1, 3), 16)}, ${parseInt(hex.slice(3, 5), 16)}, ${parseInt(hex.slice(5, 7), 16)}, 0.1)`;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Create xterm.js color sequence from hex.
|
|
172
|
+
*
|
|
173
|
+
* Generates xterm.js escape sequence for setting text color
|
|
174
|
+
* from a hex color value.
|
|
175
|
+
*
|
|
176
|
+
* @param hex - Hex color string
|
|
177
|
+
* @param isBackground - true for background color, false for foreground
|
|
178
|
+
* @returns xterm.js escape sequence
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```ts
|
|
182
|
+
* const seq = AnsiColorMapper.xtermColorSequence('#ff4466', false);
|
|
183
|
+
* // '\x1b]4;196;#ff4466\x07' (OSC 4 sequence for true color)
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
static xtermColorSequence(hex, isBackground = false) {
|
|
187
|
+
return `\x1b]${isBackground ? "4" : "10"};#${hex.slice(1)}\x07`;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Convert RGB values to hex color.
|
|
191
|
+
*
|
|
192
|
+
* @param r - Red value (0-255)
|
|
193
|
+
* @param g - Green value (0-255)
|
|
194
|
+
* @param b - Blue value (0-255)
|
|
195
|
+
* @returns Hex color string (e.g., '#ff4466')
|
|
196
|
+
*/
|
|
197
|
+
static rgbToHex(r, g, b) {
|
|
198
|
+
const toHex = (n) => {
|
|
199
|
+
const hex = Math.round(Math.min(255, Math.max(0, n))).toString(16);
|
|
200
|
+
return hex.length === 1 ? "0" + hex : hex;
|
|
201
|
+
};
|
|
202
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Convert hex color to RGB values.
|
|
206
|
+
*
|
|
207
|
+
* @param hex - Hex color string
|
|
208
|
+
* @returns Object with r, g, b values (0-255)
|
|
209
|
+
*/
|
|
210
|
+
static hexToRgb(hex) {
|
|
211
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
212
|
+
return result ? {
|
|
213
|
+
r: parseInt(result[1], 16),
|
|
214
|
+
g: parseInt(result[2], 16),
|
|
215
|
+
b: parseInt(result[3], 16)
|
|
216
|
+
} : {
|
|
217
|
+
r: 255,
|
|
218
|
+
g: 255,
|
|
219
|
+
b: 255
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
//#endregion
|
|
225
|
+
export { AnsiColorMapper };
|