@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,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI escape code parser for terminal colorization.
|
|
3
|
+
*
|
|
4
|
+
* Handles standard ANSI/VT100 escape sequences including:
|
|
5
|
+
* - CSI (Control Sequence Introducer): \x1b[...
|
|
6
|
+
* - SGR (Select Graphic Rendition): colors, styles
|
|
7
|
+
* - OSC (Operating System Command): window title, etc.
|
|
8
|
+
*
|
|
9
|
+
* Converts ANSI codes to xterm.js compatible format with proper
|
|
10
|
+
* Synthwave theme color mapping.
|
|
11
|
+
*
|
|
12
|
+
* @module components/devenv/terminal/parsing/ansi/parser
|
|
13
|
+
*/
|
|
14
|
+
import type { IAnsiParseResult } from '../LogParser.types';
|
|
15
|
+
/**
|
|
16
|
+
* ANSI escape code parser class.
|
|
17
|
+
*
|
|
18
|
+
* Parses ANSI escape sequences from text and converts them to
|
|
19
|
+
* xterm.js compatible format with proper Synthwave theme colors.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const parser = new AnsiParser();
|
|
24
|
+
* const result = parser.parse('\x1b[31mError\x1b[0m message');
|
|
25
|
+
* // result.text: '\\x1b]4;197;#ff4466\\x07Error\\x1b[0m message'
|
|
26
|
+
* // result.styles: [{ fg_color: 31, modifiers: [] }]
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class AnsiParser {
|
|
30
|
+
/** Current parser state */
|
|
31
|
+
private state;
|
|
32
|
+
/**
|
|
33
|
+
* Create a new ANSI parser.
|
|
34
|
+
*
|
|
35
|
+
* Initializes with default state (no colors, no modifiers).
|
|
36
|
+
*/
|
|
37
|
+
constructor();
|
|
38
|
+
/**
|
|
39
|
+
* Check if a string contains ANSI escape codes.
|
|
40
|
+
*
|
|
41
|
+
* @param text - Text to check
|
|
42
|
+
* @returns true if text contains ANSI escape sequences
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* AnsiParser.hasAnsi('\x1b[31mError'); // true
|
|
47
|
+
* AnsiParser.hasAnsi('Plain text'); // false
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
static hasAnsi(text: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Strip all ANSI escape codes from text.
|
|
53
|
+
*
|
|
54
|
+
* Removes ANSI sequences while preserving the actual text content.
|
|
55
|
+
* Useful for plain text display or searching.
|
|
56
|
+
*
|
|
57
|
+
* @param text - Text with ANSI codes
|
|
58
|
+
* @returns Plain text without ANSI codes
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const plain = AnsiParser.stripAnsi('\x1b[31mError\x1b[0m');
|
|
63
|
+
* // 'Error'
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
static stripAnsi(text: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Parse ANSI codes and convert to xterm.js format.
|
|
69
|
+
*
|
|
70
|
+
* Converts ANSI CSI sequences to xterm.js OSC sequences for
|
|
71
|
+
* true-color support and applies Synthwave theme colors.
|
|
72
|
+
*
|
|
73
|
+
* @param text - Text with ANSI escape codes
|
|
74
|
+
* @returns Parse result with converted text and extracted styles
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const result = parser.parse('\x1b[31;1mError\x1b[0m');
|
|
79
|
+
* // result.text: xterm.js formatted string
|
|
80
|
+
* // result.styles: [{ fg_color: 31, modifiers: ['bold'] }]
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
parse(text: string): IAnsiParseResult;
|
|
84
|
+
/**
|
|
85
|
+
* Get ANSI color code as hex from theme.
|
|
86
|
+
*
|
|
87
|
+
* Converts an ANSI color code to its hex color value in the
|
|
88
|
+
* Synthwave theme.
|
|
89
|
+
*
|
|
90
|
+
* @param code - ANSI color code (e.g., 31 for red)
|
|
91
|
+
* @returns Hex color string (e.g., '#ff4466') or undefined
|
|
92
|
+
*/
|
|
93
|
+
colorFromAnsi(code: number): string | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Reset parser state to defaults.
|
|
96
|
+
*/
|
|
97
|
+
reset(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Parse SGR (Select Graphic Rendition) parameters from CSI sequence.
|
|
100
|
+
*
|
|
101
|
+
* @param sequence - CSI sequence (e.g., '\x1b[31;1m')
|
|
102
|
+
* @returns Array of parameter numbers
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
105
|
+
private parseSgrParams;
|
|
106
|
+
/**
|
|
107
|
+
* Apply SGR parameters to parser state.
|
|
108
|
+
*
|
|
109
|
+
* Updates internal state based on SGR parameters and returns
|
|
110
|
+
* the current style after applying changes.
|
|
111
|
+
*
|
|
112
|
+
* @param params - Array of SGR parameter numbers
|
|
113
|
+
* @returns Current style after applying parameters
|
|
114
|
+
* @private
|
|
115
|
+
*/
|
|
116
|
+
private applySgrParams;
|
|
117
|
+
/**
|
|
118
|
+
* Convert ANSI CSI sequence to xterm.js OSC format.
|
|
119
|
+
*
|
|
120
|
+
* xterm.js supports OSC sequences for true-color (24-bit) colors.
|
|
121
|
+
* This converts ANSI 4-bit/8-bit colors to OSC 4/10/11 sequences.
|
|
122
|
+
*
|
|
123
|
+
* @param sequence - Original ANSI CSI sequence
|
|
124
|
+
* @param params - Parsed SGR parameters
|
|
125
|
+
* @returns xterm.js compatible escape sequence
|
|
126
|
+
* @private
|
|
127
|
+
*/
|
|
128
|
+
private convertToXterm;
|
|
129
|
+
/**
|
|
130
|
+
* Extract all ANSI escape codes from text.
|
|
131
|
+
*
|
|
132
|
+
* Returns an array of all ANSI sequences found in the text.
|
|
133
|
+
*
|
|
134
|
+
* @param text - Text to extract from
|
|
135
|
+
* @returns Array of ANSI escape sequences
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* const codes = AnsiParser.extractCodes('\x1b[31mError\x1b[0m');
|
|
140
|
+
* // ['\x1b[31m', '\x1b[0m']
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
static extractCodes(text: string): string[];
|
|
144
|
+
/**
|
|
145
|
+
* Count ANSI escape codes in text.
|
|
146
|
+
*
|
|
147
|
+
* @param text - Text to count codes in
|
|
148
|
+
* @returns Number of ANSI escape sequences
|
|
149
|
+
*/
|
|
150
|
+
static countCodes(text: string): number;
|
|
151
|
+
/**
|
|
152
|
+
* Get visible text length (excluding ANSI codes).
|
|
153
|
+
*
|
|
154
|
+
* @param text - Text with potential ANSI codes
|
|
155
|
+
* @returns Length of visible text only
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* AnsiParser.visibleLength('\x1b[31mError\x1b[0m'); // 5
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
static visibleLength(text: string): number;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=AnsiParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnsiParser.d.ts","sourceRoot":"","sources":["../../../../../../src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,oBAAoB,CAAC;AAkBvE;;;;;;;;;;;;;GAaG;AACH,qBAAa,UAAU;IACrB,2BAA2B;IAC3B,OAAO,CAAC,KAAK,CAAmB;IAEhC;;;;OAIG;;IAOH;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIrC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAItC;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;IAmCrC;;;;;;;;OAQG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAU/C;;OAEG;IACH,KAAK,IAAI,IAAI;IAMb;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAWtB;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IAmFtB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,cAAc;IA+CtB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAK3C;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIvC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAG3C"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { ANSI_PATTERNS, SGR_CODES } from "./ansi.constants.js";
|
|
2
|
+
import { AnsiColorMapper } from "./AnsiColorMapper.js";
|
|
3
|
+
|
|
4
|
+
//#region src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts
|
|
5
|
+
/**
|
|
6
|
+
* ANSI escape code parser for terminal colorization.
|
|
7
|
+
*
|
|
8
|
+
* Handles standard ANSI/VT100 escape sequences including:
|
|
9
|
+
* - CSI (Control Sequence Introducer): \x1b[...
|
|
10
|
+
* - SGR (Select Graphic Rendition): colors, styles
|
|
11
|
+
* - OSC (Operating System Command): window title, etc.
|
|
12
|
+
*
|
|
13
|
+
* Converts ANSI codes to xterm.js compatible format with proper
|
|
14
|
+
* Synthwave theme color mapping.
|
|
15
|
+
*
|
|
16
|
+
* @module components/devenv/terminal/parsing/ansi/parser
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* ANSI escape code parser class.
|
|
20
|
+
*
|
|
21
|
+
* Parses ANSI escape sequences from text and converts them to
|
|
22
|
+
* xterm.js compatible format with proper Synthwave theme colors.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const parser = new AnsiParser();
|
|
27
|
+
* const result = parser.parse('\x1b[31mError\x1b[0m message');
|
|
28
|
+
* // result.text: '\\x1b]4;197;#ff4466\\x07Error\\x1b[0m message'
|
|
29
|
+
* // result.styles: [{ fg_color: 31, modifiers: [] }]
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
var AnsiParser = class {
|
|
33
|
+
/** Current parser state */
|
|
34
|
+
state;
|
|
35
|
+
/**
|
|
36
|
+
* Create a new ANSI parser.
|
|
37
|
+
*
|
|
38
|
+
* Initializes with default state (no colors, no modifiers).
|
|
39
|
+
*/
|
|
40
|
+
constructor() {
|
|
41
|
+
this.state = { modifiers: /* @__PURE__ */ new Set() };
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if a string contains ANSI escape codes.
|
|
45
|
+
*
|
|
46
|
+
* @param text - Text to check
|
|
47
|
+
* @returns true if text contains ANSI escape sequences
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* AnsiParser.hasAnsi('\x1b[31mError'); // true
|
|
52
|
+
* AnsiParser.hasAnsi('Plain text'); // false
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
static hasAnsi(text) {
|
|
56
|
+
return ANSI_PATTERNS.CSI_SEQUENCE.test(text);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Strip all ANSI escape codes from text.
|
|
60
|
+
*
|
|
61
|
+
* Removes ANSI sequences while preserving the actual text content.
|
|
62
|
+
* Useful for plain text display or searching.
|
|
63
|
+
*
|
|
64
|
+
* @param text - Text with ANSI codes
|
|
65
|
+
* @returns Plain text without ANSI codes
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const plain = AnsiParser.stripAnsi('\x1b[31mError\x1b[0m');
|
|
70
|
+
* // 'Error'
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
static stripAnsi(text) {
|
|
74
|
+
return text.replace(ANSI_PATTERNS.CSI_SEQUENCE, "").replace(ANSI_PATTERNS.OSC_SEQUENCE, "");
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Parse ANSI codes and convert to xterm.js format.
|
|
78
|
+
*
|
|
79
|
+
* Converts ANSI CSI sequences to xterm.js OSC sequences for
|
|
80
|
+
* true-color support and applies Synthwave theme colors.
|
|
81
|
+
*
|
|
82
|
+
* @param text - Text with ANSI escape codes
|
|
83
|
+
* @returns Parse result with converted text and extracted styles
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* const result = parser.parse('\x1b[31;1mError\x1b[0m');
|
|
88
|
+
* // result.text: xterm.js formatted string
|
|
89
|
+
* // result.styles: [{ fg_color: 31, modifiers: ['bold'] }]
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
parse(text) {
|
|
93
|
+
const styles = [];
|
|
94
|
+
let converted = text;
|
|
95
|
+
let styleIndex = 0;
|
|
96
|
+
this.reset();
|
|
97
|
+
const matches = text.matchAll(ANSI_PATTERNS.CSI_SEQUENCE);
|
|
98
|
+
for (const match of matches) {
|
|
99
|
+
const sequence = match[0];
|
|
100
|
+
const params = this.parseSgrParams(sequence);
|
|
101
|
+
const style = this.applySgrParams(params);
|
|
102
|
+
if (style) styles.push({
|
|
103
|
+
...style,
|
|
104
|
+
index: styleIndex++
|
|
105
|
+
});
|
|
106
|
+
const xtermSequence = this.convertToXterm(sequence, params);
|
|
107
|
+
converted = converted.replace(sequence, xtermSequence);
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
text: converted,
|
|
111
|
+
styles
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get ANSI color code as hex from theme.
|
|
116
|
+
*
|
|
117
|
+
* Converts an ANSI color code to its hex color value in the
|
|
118
|
+
* Synthwave theme.
|
|
119
|
+
*
|
|
120
|
+
* @param code - ANSI color code (e.g., 31 for red)
|
|
121
|
+
* @returns Hex color string (e.g., '#ff4466') or undefined
|
|
122
|
+
*/
|
|
123
|
+
colorFromAnsi(code) {
|
|
124
|
+
if (code >= 40 && code <= 47) return AnsiColorMapper.bgColor(code);
|
|
125
|
+
else if (code >= 100 && code <= 107) return AnsiColorMapper.bgColor(code);
|
|
126
|
+
else return AnsiColorMapper.fgColor(code);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Reset parser state to defaults.
|
|
130
|
+
*/
|
|
131
|
+
reset() {
|
|
132
|
+
this.state = { modifiers: /* @__PURE__ */ new Set() };
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Parse SGR (Select Graphic Rendition) parameters from CSI sequence.
|
|
136
|
+
*
|
|
137
|
+
* @param sequence - CSI sequence (e.g., '\x1b[31;1m')
|
|
138
|
+
* @returns Array of parameter numbers
|
|
139
|
+
* @private
|
|
140
|
+
*/
|
|
141
|
+
parseSgrParams(sequence) {
|
|
142
|
+
const paramMatch = sequence.match(/\[([0-9;]*)[mM]/);
|
|
143
|
+
if (!paramMatch) return [];
|
|
144
|
+
const paramString = paramMatch[1];
|
|
145
|
+
if (!paramString) return [0];
|
|
146
|
+
return paramString.split(";").map((p) => parseInt(p, 10));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Apply SGR parameters to parser state.
|
|
150
|
+
*
|
|
151
|
+
* Updates internal state based on SGR parameters and returns
|
|
152
|
+
* the current style after applying changes.
|
|
153
|
+
*
|
|
154
|
+
* @param params - Array of SGR parameter numbers
|
|
155
|
+
* @returns Current style after applying parameters
|
|
156
|
+
* @private
|
|
157
|
+
*/
|
|
158
|
+
applySgrParams(params) {
|
|
159
|
+
if (params.length === 0 || params.length === 1 && params[0] === 0) {
|
|
160
|
+
this.reset();
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
for (const param of params) switch (param) {
|
|
164
|
+
case SGR_CODES.RESET:
|
|
165
|
+
case SGR_CODES.BOLD_OFF:
|
|
166
|
+
case SGR_CODES.DIM_OFF:
|
|
167
|
+
case SGR_CODES.ITALIC_OFF:
|
|
168
|
+
case SGR_CODES.UNDERLINE_OFF:
|
|
169
|
+
case SGR_CODES.BLINK_OFF:
|
|
170
|
+
case SGR_CODES.INVERSE_OFF:
|
|
171
|
+
case SGR_CODES.STRIKETHROUGH_OFF:
|
|
172
|
+
this.reset();
|
|
173
|
+
break;
|
|
174
|
+
case SGR_CODES.BOLD:
|
|
175
|
+
this.state.modifiers.add("bold");
|
|
176
|
+
break;
|
|
177
|
+
case SGR_CODES.DIM:
|
|
178
|
+
this.state.modifiers.add("dim");
|
|
179
|
+
break;
|
|
180
|
+
case SGR_CODES.ITALIC:
|
|
181
|
+
this.state.modifiers.add("italic");
|
|
182
|
+
break;
|
|
183
|
+
case SGR_CODES.UNDERLINE:
|
|
184
|
+
this.state.modifiers.add("underline");
|
|
185
|
+
break;
|
|
186
|
+
case SGR_CODES.BLINK_SLOW:
|
|
187
|
+
case SGR_CODES.BLINK_FAST:
|
|
188
|
+
this.state.modifiers.add("blink");
|
|
189
|
+
break;
|
|
190
|
+
case SGR_CODES.INVERSE:
|
|
191
|
+
this.state.modifiers.add("inverse");
|
|
192
|
+
break;
|
|
193
|
+
case SGR_CODES.HIDDEN:
|
|
194
|
+
this.state.modifiers.add("hidden");
|
|
195
|
+
break;
|
|
196
|
+
case SGR_CODES.STRIKETHROUGH:
|
|
197
|
+
this.state.modifiers.add("strikethrough");
|
|
198
|
+
break;
|
|
199
|
+
case SGR_CODES.FG_DEFAULT:
|
|
200
|
+
this.state.fg_color = void 0;
|
|
201
|
+
break;
|
|
202
|
+
case SGR_CODES.BG_DEFAULT:
|
|
203
|
+
this.state.bg_color = void 0;
|
|
204
|
+
break;
|
|
205
|
+
default:
|
|
206
|
+
if (param >= 30 && param <= 37 || param >= 40 && param <= 47 || param >= 90 && param <= 97 || param >= 100 && param <= 107) if (param >= 40) this.state.bg_color = param;
|
|
207
|
+
else this.state.fg_color = param;
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
fg_color: this.state.fg_color,
|
|
212
|
+
bg_color: this.state.bg_color,
|
|
213
|
+
modifiers: Array.from(this.state.modifiers)
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Convert ANSI CSI sequence to xterm.js OSC format.
|
|
218
|
+
*
|
|
219
|
+
* xterm.js supports OSC sequences for true-color (24-bit) colors.
|
|
220
|
+
* This converts ANSI 4-bit/8-bit colors to OSC 4/10/11 sequences.
|
|
221
|
+
*
|
|
222
|
+
* @param sequence - Original ANSI CSI sequence
|
|
223
|
+
* @param params - Parsed SGR parameters
|
|
224
|
+
* @returns xterm.js compatible escape sequence
|
|
225
|
+
* @private
|
|
226
|
+
*/
|
|
227
|
+
convertToXterm(sequence, params) {
|
|
228
|
+
if (!params.some((p) => p >= 30 && p <= 47) && !params.some((p) => p >= 90 && p <= 107)) return sequence;
|
|
229
|
+
let result = "";
|
|
230
|
+
for (const param of params) if (param >= 30 && param <= 37 || param >= 90 && param <= 97) {
|
|
231
|
+
const hex = AnsiColorMapper.fgColor(param);
|
|
232
|
+
if (hex) result += `\x1b]10;#${hex.slice(1)}\x07`;
|
|
233
|
+
} else if (param >= 40 && param <= 47 || param >= 100 && param <= 107) {
|
|
234
|
+
const fgCode = param >= 100 ? param - 10 : param - 10;
|
|
235
|
+
const hex = AnsiColorMapper.fgColor(fgCode);
|
|
236
|
+
if (hex) result += `\x1b]11;#${hex.slice(1)}\x07`;
|
|
237
|
+
}
|
|
238
|
+
const modifiers = params.filter((p) => p === SGR_CODES.BOLD || p === SGR_CODES.DIM || p === SGR_CODES.ITALIC || p === SGR_CODES.UNDERLINE || p === SGR_CODES.BLINK_SLOW || p === SGR_CODES.BLINK_FAST || p === SGR_CODES.INVERSE || p === SGR_CODES.HIDDEN || p === SGR_CODES.STRIKETHROUGH);
|
|
239
|
+
if (modifiers.length > 0) result += `\x1b[${modifiers.join(";")}m`;
|
|
240
|
+
return result || sequence;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Extract all ANSI escape codes from text.
|
|
244
|
+
*
|
|
245
|
+
* Returns an array of all ANSI sequences found in the text.
|
|
246
|
+
*
|
|
247
|
+
* @param text - Text to extract from
|
|
248
|
+
* @returns Array of ANSI escape sequences
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```ts
|
|
252
|
+
* const codes = AnsiParser.extractCodes('\x1b[31mError\x1b[0m');
|
|
253
|
+
* // ['\x1b[31m', '\x1b[0m']
|
|
254
|
+
* ```
|
|
255
|
+
*/
|
|
256
|
+
static extractCodes(text) {
|
|
257
|
+
return text.match(ANSI_PATTERNS.CSI_SEQUENCE) ?? [];
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Count ANSI escape codes in text.
|
|
261
|
+
*
|
|
262
|
+
* @param text - Text to count codes in
|
|
263
|
+
* @returns Number of ANSI escape sequences
|
|
264
|
+
*/
|
|
265
|
+
static countCodes(text) {
|
|
266
|
+
return (text.match(ANSI_PATTERNS.CSI_SEQUENCE) ?? []).length;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Get visible text length (excluding ANSI codes).
|
|
270
|
+
*
|
|
271
|
+
* @param text - Text with potential ANSI codes
|
|
272
|
+
* @returns Length of visible text only
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```ts
|
|
276
|
+
* AnsiParser.visibleLength('\x1b[31mError\x1b[0m'); // 5
|
|
277
|
+
* ```
|
|
278
|
+
*/
|
|
279
|
+
static visibleLength(text) {
|
|
280
|
+
return this.stripAnsi(text).length;
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
//#endregion
|
|
285
|
+
export { AnsiParser };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI escape code constants for terminal parsing.
|
|
3
|
+
*
|
|
4
|
+
* Contains standard ANSI/VT100 escape sequences for color, styling,
|
|
5
|
+
* and cursor control. Used by AnsiParser to detect and convert
|
|
6
|
+
* ANSI codes to xterm.js compatible format.
|
|
7
|
+
*
|
|
8
|
+
* References:
|
|
9
|
+
* - ANSI/VT100 Control Sequences: https://vt100.net/docs/vt100-ug/chapter3.html
|
|
10
|
+
* - SGR (Select Graphic Rendition): https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters
|
|
11
|
+
*
|
|
12
|
+
* @module components/devenv/terminal/parsing/ansi/constants
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* ANSI escape sequence introducers.
|
|
16
|
+
*
|
|
17
|
+
* Control sequences that introduce ANSI escape codes.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ANSI_INTRODUCERS: {
|
|
20
|
+
/** CSI (Control Sequence Introducer) - \x1b[ */
|
|
21
|
+
readonly CSI: "\u001B[";
|
|
22
|
+
/** OSC (Operating System Command) - \x1b] */
|
|
23
|
+
readonly OSC: "\u001B]";
|
|
24
|
+
/** DCS (Device Control String) - \x1bP */
|
|
25
|
+
readonly DCS: "\u001BP";
|
|
26
|
+
/** ST (String Terminator) - \x1b\\ */
|
|
27
|
+
readonly ST: "\u001B\\";
|
|
28
|
+
/** ESC prefix */
|
|
29
|
+
readonly ESC: "\u001B";
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* ANSI SGR (Select Graphic Rendition) parameter codes.
|
|
33
|
+
*
|
|
34
|
+
* Text styling and color codes following CSI.
|
|
35
|
+
*/
|
|
36
|
+
export declare const SGR_CODES: {
|
|
37
|
+
/** Reset all attributes */
|
|
38
|
+
readonly RESET: 0;
|
|
39
|
+
/** Bold/intense */
|
|
40
|
+
readonly BOLD: 1;
|
|
41
|
+
/** Faint/dim */
|
|
42
|
+
readonly DIM: 2;
|
|
43
|
+
/** Italic */
|
|
44
|
+
readonly ITALIC: 3;
|
|
45
|
+
/** Underline */
|
|
46
|
+
readonly UNDERLINE: 4;
|
|
47
|
+
/** Blink slowly */
|
|
48
|
+
readonly BLINK_SLOW: 5;
|
|
49
|
+
/** Blink rapidly */
|
|
50
|
+
readonly BLINK_FAST: 6;
|
|
51
|
+
/** Inverse/reverse video */
|
|
52
|
+
readonly INVERSE: 7;
|
|
53
|
+
/** Hide/conceal */
|
|
54
|
+
readonly HIDDEN: 8;
|
|
55
|
+
/** Strikethrough */
|
|
56
|
+
readonly STRIKETHROUGH: 9;
|
|
57
|
+
/** Default font */
|
|
58
|
+
readonly FONT_DEFAULT: 10;
|
|
59
|
+
/** Bold off (not widely supported) */
|
|
60
|
+
readonly BOLD_OFF: 21;
|
|
61
|
+
/** Dim off (not widely supported) */
|
|
62
|
+
readonly DIM_OFF: 22;
|
|
63
|
+
/** Italic off */
|
|
64
|
+
readonly ITALIC_OFF: 23;
|
|
65
|
+
/** Underline off */
|
|
66
|
+
readonly UNDERLINE_OFF: 24;
|
|
67
|
+
/** Blink off */
|
|
68
|
+
readonly BLINK_OFF: 25;
|
|
69
|
+
/** Inverse off */
|
|
70
|
+
readonly INVERSE_OFF: 27;
|
|
71
|
+
/** Reveal */
|
|
72
|
+
readonly REVEAL: 28;
|
|
73
|
+
/** Strikethrough off */
|
|
74
|
+
readonly STRIKETHROUGH_OFF: 29;
|
|
75
|
+
/** Black foreground */
|
|
76
|
+
readonly FG_BLACK: 30;
|
|
77
|
+
/** Red foreground */
|
|
78
|
+
readonly FG_RED: 31;
|
|
79
|
+
/** Green foreground */
|
|
80
|
+
readonly FG_GREEN: 32;
|
|
81
|
+
/** Yellow foreground */
|
|
82
|
+
readonly FG_YELLOW: 33;
|
|
83
|
+
/** Blue foreground */
|
|
84
|
+
readonly FG_BLUE: 34;
|
|
85
|
+
/** Magenta foreground */
|
|
86
|
+
readonly FG_MAGENTA: 35;
|
|
87
|
+
/** Cyan foreground */
|
|
88
|
+
readonly FG_CYAN: 36;
|
|
89
|
+
/** White foreground */
|
|
90
|
+
readonly FG_WHITE: 37;
|
|
91
|
+
/** Default foreground color */
|
|
92
|
+
readonly FG_DEFAULT: 39;
|
|
93
|
+
/** Black background */
|
|
94
|
+
readonly BG_BLACK: 40;
|
|
95
|
+
/** Red background */
|
|
96
|
+
readonly BG_RED: 41;
|
|
97
|
+
/** Green background */
|
|
98
|
+
readonly BG_GREEN: 42;
|
|
99
|
+
/** Yellow background */
|
|
100
|
+
readonly BG_YELLOW: 43;
|
|
101
|
+
/** Blue background */
|
|
102
|
+
readonly BG_BLUE: 44;
|
|
103
|
+
/** Magenta background */
|
|
104
|
+
readonly BG_MAGENTA: 45;
|
|
105
|
+
/** Cyan background */
|
|
106
|
+
readonly BG_CYAN: 46;
|
|
107
|
+
/** White background */
|
|
108
|
+
readonly BG_WHITE: 47;
|
|
109
|
+
/** Default background color */
|
|
110
|
+
readonly BG_DEFAULT: 49;
|
|
111
|
+
/** Bright black (gray) foreground */
|
|
112
|
+
readonly FG_BRIGHT_BLACK: 90;
|
|
113
|
+
/** Bright red foreground */
|
|
114
|
+
readonly FG_BRIGHT_RED: 91;
|
|
115
|
+
/** Bright green foreground */
|
|
116
|
+
readonly FG_BRIGHT_GREEN: 92;
|
|
117
|
+
/** Bright yellow foreground */
|
|
118
|
+
readonly FG_BRIGHT_YELLOW: 93;
|
|
119
|
+
/** Bright blue foreground */
|
|
120
|
+
readonly FG_BRIGHT_BLUE: 94;
|
|
121
|
+
/** Bright magenta foreground */
|
|
122
|
+
readonly FG_BRIGHT_MAGENTA: 95;
|
|
123
|
+
/** Bright cyan foreground */
|
|
124
|
+
readonly FG_BRIGHT_CYAN: 96;
|
|
125
|
+
/** Bright white foreground */
|
|
126
|
+
readonly FG_BRIGHT_WHITE: 97;
|
|
127
|
+
/** Bright black (gray) background */
|
|
128
|
+
readonly BG_BRIGHT_BLACK: 100;
|
|
129
|
+
/** Bright red background */
|
|
130
|
+
readonly BG_BRIGHT_RED: 101;
|
|
131
|
+
/** Bright green background */
|
|
132
|
+
readonly BG_BRIGHT_GREEN: 102;
|
|
133
|
+
/** Bright yellow background */
|
|
134
|
+
readonly BG_BRIGHT_YELLOW: 103;
|
|
135
|
+
/** Bright blue background */
|
|
136
|
+
readonly BG_BRIGHT_BLUE: 104;
|
|
137
|
+
/** Bright magenta background */
|
|
138
|
+
readonly BG_BRIGHT_MAGENTA: 105;
|
|
139
|
+
/** Bright cyan background */
|
|
140
|
+
readonly BG_BRIGHT_CYAN: 106;
|
|
141
|
+
/** Bright white background */
|
|
142
|
+
readonly BG_BRIGHT_WHITE: 107;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* ANSI regex patterns for detection and parsing.
|
|
146
|
+
*/
|
|
147
|
+
export declare const ANSI_PATTERNS: {
|
|
148
|
+
/** CSI sequence: \x1b[ followed by parameters and final character */
|
|
149
|
+
readonly CSI_SEQUENCE: RegExp;
|
|
150
|
+
/** OSC sequence: \x1b] followed by content and ST */
|
|
151
|
+
readonly OSC_SEQUENCE: RegExp;
|
|
152
|
+
/** SGR parameters (numeric codes within CSI) */
|
|
153
|
+
readonly SGR_PARAMS: RegExp;
|
|
154
|
+
/** Complete ANSI escape sequence */
|
|
155
|
+
readonly ANSI_ESCAPE: RegExp;
|
|
156
|
+
/** Text attributes (bold, dim, italic, underline) */
|
|
157
|
+
readonly TEXT_ATTRIBUTES: RegExp;
|
|
158
|
+
/** Color codes (30-37, 40-47, 90-97, 100-107) */
|
|
159
|
+
readonly COLOR_CODES: RegExp;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* ANSI to xterm.js color mapping.
|
|
163
|
+
*
|
|
164
|
+
* Maps standard ANSI color codes (0-15) to xterm.js color indices.
|
|
165
|
+
*/
|
|
166
|
+
export declare const ANSI_COLOR_MAP: Record<number, number>;
|
|
167
|
+
/**
|
|
168
|
+
* ANSI text modifier names.
|
|
169
|
+
*
|
|
170
|
+
* Maps SGR modifier codes to human-readable names.
|
|
171
|
+
*/
|
|
172
|
+
export declare const ANSI_MODIFIERS: Record<number, string>;
|
|
173
|
+
/**
|
|
174
|
+
* Synthwave theme ANSI to hex color mapping.
|
|
175
|
+
*
|
|
176
|
+
* Maps ANSI color codes to Synthwave Industrial Dark theme colors
|
|
177
|
+
* from Terminal.theme.ts. Used for colorizing logs with proper
|
|
178
|
+
* design system colors.
|
|
179
|
+
*/
|
|
180
|
+
export declare const SYNTHWAVE_ANSI_COLORS: Record<number, string>;
|
|
181
|
+
/**
|
|
182
|
+
* Log level to ANSI color mapping.
|
|
183
|
+
*
|
|
184
|
+
* Maps log levels to their corresponding ANSI color codes for
|
|
185
|
+
* terminal display with proper colorization.
|
|
186
|
+
*/
|
|
187
|
+
export declare const LOG_LEVEL_ANSI_COLORS: Record<string, number>;
|
|
188
|
+
//# sourceMappingURL=ansi.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ansi.constants.d.ts","sourceRoot":"","sources":["../../../../../../src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;IAC3B,gDAAgD;;IAGhD,6CAA6C;;IAG7C,0CAA0C;;IAG1C,sCAAsC;;IAGtC,iBAAiB;;CAET,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,SAAS;IACpB,2BAA2B;;IAG3B,mBAAmB;;IAGnB,gBAAgB;;IAGhB,aAAa;;IAGb,gBAAgB;;IAGhB,mBAAmB;;IAGnB,oBAAoB;;IAGpB,4BAA4B;;IAG5B,mBAAmB;;IAGnB,oBAAoB;;IAGpB,mBAAmB;;IAGnB,sCAAsC;;IAGtC,qCAAqC;;IAGrC,iBAAiB;;IAGjB,oBAAoB;;IAGpB,gBAAgB;;IAGhB,kBAAkB;;IAGlB,aAAa;;IAGb,wBAAwB;;IAKxB,uBAAuB;;IAGvB,qBAAqB;;IAGrB,uBAAuB;;IAGvB,wBAAwB;;IAGxB,sBAAsB;;IAGtB,yBAAyB;;IAGzB,sBAAsB;;IAGtB,uBAAuB;;IAGvB,+BAA+B;;IAK/B,uBAAuB;;IAGvB,qBAAqB;;IAGrB,uBAAuB;;IAGvB,wBAAwB;;IAGxB,sBAAsB;;IAGtB,yBAAyB;;IAGzB,sBAAsB;;IAGtB,uBAAuB;;IAGvB,+BAA+B;;IAK/B,qCAAqC;;IAGrC,4BAA4B;;IAG5B,8BAA8B;;IAG9B,+BAA+B;;IAG/B,6BAA6B;;IAG7B,gCAAgC;;IAGhC,6BAA6B;;IAG7B,8BAA8B;;IAK9B,qCAAqC;;IAGrC,4BAA4B;;IAG5B,8BAA8B;;IAG9B,+BAA+B;;IAG/B,6BAA6B;;IAG7B,gCAAgC;;IAGhC,6BAA6B;;IAG7B,8BAA8B;;CAEtB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB,qEAAqE;;IAGrE,qDAAqD;;IAGrD,gDAAgD;;IAGhD,oCAAoC;;IAGpC,qDAAqD;;IAGrD,iDAAiD;;CAEzC,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoBxC,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASxC,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoB/C,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQ/C,CAAC"}
|