@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,139 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { HttpLogParser } from "../parsing/HttpLogParser.js";
|
|
5
|
+
import { TABLE_CHARS, TableParser } from "../parsing/TableParser.js";
|
|
6
|
+
import { HighlightedJson } from "./SyntaxHighlight.js";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Specialized syntax highlighter for different log content types.
|
|
12
|
+
*
|
|
13
|
+
* Provides syntax highlighting for HTTP requests, tables, and JSON
|
|
14
|
+
* with appropriate styling for each type.
|
|
15
|
+
*
|
|
16
|
+
* @module components/devenv/terminal/SpecializedSyntaxHighlighter
|
|
17
|
+
*/
|
|
18
|
+
const httpParser = new HttpLogParser();
|
|
19
|
+
const tableParser = new TableParser();
|
|
20
|
+
/**
|
|
21
|
+
* Specialized syntax highlighter component.
|
|
22
|
+
*
|
|
23
|
+
* Applies appropriate highlighting based on content type:
|
|
24
|
+
* - HTTP: pink method, cyan path
|
|
25
|
+
* - JSON: structured syntax highlighting
|
|
26
|
+
* - Table: borders in gray, content in colors
|
|
27
|
+
* - Plain: default highlighting
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <SpecializedSyntaxHighlighter
|
|
32
|
+
* contentType="http"
|
|
33
|
+
* httpMethod="GET"
|
|
34
|
+
* httpPath="/api/endpoint"
|
|
35
|
+
* text="GET /api/endpoint {"
|
|
36
|
+
* />
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
function SpecializedSyntaxHighlighter({ contentType = "plain", httpMethod: _httpMethod, httpPath: _httpPath, tableData: _tableData, jsonData, text, className }) {
|
|
40
|
+
if (contentType === "http") return /* @__PURE__ */ jsx(HttpHighlighter, {
|
|
41
|
+
text,
|
|
42
|
+
className
|
|
43
|
+
});
|
|
44
|
+
if (contentType === "json" && jsonData) return /* @__PURE__ */ jsx("div", {
|
|
45
|
+
className: cn("font-mono text-xs", className),
|
|
46
|
+
children: /* @__PURE__ */ jsx(HighlightedJson, { json: jsonData })
|
|
47
|
+
});
|
|
48
|
+
if (contentType === "table") return /* @__PURE__ */ jsx(TableHighlighter, {
|
|
49
|
+
text,
|
|
50
|
+
className
|
|
51
|
+
});
|
|
52
|
+
return /* @__PURE__ */ jsx("span", {
|
|
53
|
+
className: cn("font-mono text-sm", className),
|
|
54
|
+
children: text
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* HTTP request syntax highlighter.
|
|
59
|
+
*
|
|
60
|
+
* Highlights HTTP method (pink) and path (cyan).
|
|
61
|
+
*/
|
|
62
|
+
function HttpHighlighter({ text, className }) {
|
|
63
|
+
const parts = httpParser.highlightLine(text);
|
|
64
|
+
return /* @__PURE__ */ jsx("span", {
|
|
65
|
+
className: cn("font-mono text-sm", className),
|
|
66
|
+
children: parts.map((part, i) => /* @__PURE__ */ jsx("span", {
|
|
67
|
+
className: part.className,
|
|
68
|
+
children: part.text
|
|
69
|
+
}, i))
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Table syntax highlighter.
|
|
74
|
+
*
|
|
75
|
+
* Renders detected tables as actual styled HTML tables
|
|
76
|
+
* with header detection, alternating rows, and proper borders.
|
|
77
|
+
* Falls back to box-drawing character highlighting.
|
|
78
|
+
*/
|
|
79
|
+
function TableHighlighter({ text, className }) {
|
|
80
|
+
const lines = text.split("\n").filter((l) => l.trim().length > 0);
|
|
81
|
+
const { headers, dataRows } = tableParser.parseTable(lines, 0);
|
|
82
|
+
if (dataRows.length > 0 && (headers || dataRows.length > 1)) {
|
|
83
|
+
const displayHeaders = headers || (dataRows.length > 1 ? dataRows[0] : void 0);
|
|
84
|
+
const displayRows = headers ? dataRows.filter((r) => r !== headers) : dataRows.slice(displayHeaders ? 1 : 0);
|
|
85
|
+
return /* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: cn("my-1 overflow-x-auto rounded-md border border-border/20", className),
|
|
87
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
88
|
+
className: "w-full font-mono text-xs border-collapse",
|
|
89
|
+
children: [displayHeaders && /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", {
|
|
90
|
+
className: "bg-muted/30 border-b border-border/30",
|
|
91
|
+
children: displayHeaders.map((header, i) => /* @__PURE__ */ jsx("th", {
|
|
92
|
+
className: "px-3 py-1.5 text-left text-[10px] font-bold uppercase tracking-wider text-muted-foreground/80",
|
|
93
|
+
children: header
|
|
94
|
+
}, i))
|
|
95
|
+
}) }), /* @__PURE__ */ jsx("tbody", { children: displayRows.map((row, i) => /* @__PURE__ */ jsx("tr", {
|
|
96
|
+
className: cn("border-b border-border/10 transition-colors hover:bg-white/[0.04]", i % 2 === 0 ? "bg-transparent" : "bg-white/[0.02]"),
|
|
97
|
+
children: row.map((cell, j) => /* @__PURE__ */ jsx("td", {
|
|
98
|
+
className: "px-3 py-1 text-foreground/85 whitespace-nowrap",
|
|
99
|
+
children: cell
|
|
100
|
+
}, j))
|
|
101
|
+
}, i)) })]
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return /* @__PURE__ */ jsx("div", {
|
|
106
|
+
className: cn("font-mono text-xs", className),
|
|
107
|
+
children: lines.map((line, i) => {
|
|
108
|
+
const rowType = tableParser.getRowType(line);
|
|
109
|
+
return /* @__PURE__ */ jsx("div", {
|
|
110
|
+
className: tableParser.getRowClass(rowType),
|
|
111
|
+
children: /* @__PURE__ */ jsx(TableRowLine, { line })
|
|
112
|
+
}, i);
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Individual table row with box-drawing character highlighting.
|
|
118
|
+
*/
|
|
119
|
+
function TableRowLine({ line }) {
|
|
120
|
+
const parts = [];
|
|
121
|
+
let lastIndex = 0;
|
|
122
|
+
for (let i = 0; i < line.length; i++) {
|
|
123
|
+
const char = line[i];
|
|
124
|
+
if (TABLE_CHARS.includes(char)) {
|
|
125
|
+
if (i > lastIndex) parts.push(/* @__PURE__ */ jsx("span", { children: line.slice(lastIndex, i) }, lastIndex));
|
|
126
|
+
parts.push(/* @__PURE__ */ jsx("span", {
|
|
127
|
+
className: "text-border/40",
|
|
128
|
+
children: char
|
|
129
|
+
}, i));
|
|
130
|
+
lastIndex = i + 1;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (lastIndex < line.length) parts.push(/* @__PURE__ */ jsx("span", { children: line.slice(lastIndex) }, lastIndex));
|
|
134
|
+
if (parts.length === 0) return /* @__PURE__ */ jsx("span", { children: line });
|
|
135
|
+
return /* @__PURE__ */ jsx(Fragment, { children: parts });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
export { SpecializedSyntaxHighlighter };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syntax highlighting for log messages (React spans).
|
|
3
|
+
*
|
|
4
|
+
* Applies color highlighting to specific elements within log messages
|
|
5
|
+
* using React span elements with Tailwind CSS classes.
|
|
6
|
+
*
|
|
7
|
+
* IMPORTANT: Only highlights plain text - skips lines with existing ANSI codes
|
|
8
|
+
* to prevent mixing codes and creating visual artifacts.
|
|
9
|
+
*
|
|
10
|
+
* Features LRU cache to avoid re-parsing identical text.
|
|
11
|
+
*
|
|
12
|
+
* @module components/devenv/terminal/SyntaxHighlight
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Clear the highlight cache (useful for memory management).
|
|
16
|
+
*/
|
|
17
|
+
export declare function clearHighlightCache(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Props for SyntaxHighlightedText component.
|
|
20
|
+
*/
|
|
21
|
+
export interface ISyntaxHighlightedTextProps {
|
|
22
|
+
/** Text to highlight */
|
|
23
|
+
text: string;
|
|
24
|
+
/** Optional custom class name */
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Syntax highlighted text component.
|
|
29
|
+
*
|
|
30
|
+
* Applies syntax highlighting to plain text messages.
|
|
31
|
+
* Strips ANSI codes before highlighting to prevent visual artifacts
|
|
32
|
+
* from mixed escape sequences.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <SyntaxHighlightedText text="GET /api/workspaces { filter: {} }" />
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function SyntaxHighlightedText({ text, className }: ISyntaxHighlightedTextProps): React.JSX.Element;
|
|
40
|
+
/**
|
|
41
|
+
* Props for HighlightedJson component.
|
|
42
|
+
*/
|
|
43
|
+
export interface IHighlightedJsonProps {
|
|
44
|
+
/** JSON object to highlight */
|
|
45
|
+
json: Record<string, unknown>;
|
|
46
|
+
/** Optional custom class name */
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Highlighted JSON component.
|
|
51
|
+
*
|
|
52
|
+
* Displays JSON with syntax highlighting and proper indentation.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* <HighlightedJson json={{ filter: {}, name: "test" }} />
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function HighlightedJson({ json, className }: IHighlightedJsonProps): React.JSX.Element;
|
|
60
|
+
//# sourceMappingURL=SyntaxHighlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyntaxHighlight.d.ts","sourceRoot":"","sources":["../../../../../src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiDH;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAiBD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,2BAA2B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAezG;AA0ID;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAmB7F"}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Syntax highlighting for log messages (React spans).
|
|
9
|
+
*
|
|
10
|
+
* Applies color highlighting to specific elements within log messages
|
|
11
|
+
* using React span elements with Tailwind CSS classes.
|
|
12
|
+
*
|
|
13
|
+
* IMPORTANT: Only highlights plain text - skips lines with existing ANSI codes
|
|
14
|
+
* to prevent mixing codes and creating visual artifacts.
|
|
15
|
+
*
|
|
16
|
+
* Features LRU cache to avoid re-parsing identical text.
|
|
17
|
+
*
|
|
18
|
+
* @module components/devenv/terminal/SyntaxHighlight
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* LRU cache for syntax highlighting results.
|
|
22
|
+
* Avoids re-parsing identical text on every render.
|
|
23
|
+
*/
|
|
24
|
+
const highlightCache = /* @__PURE__ */ new Map();
|
|
25
|
+
const MAX_CACHE_SIZE = 1e3;
|
|
26
|
+
/**
|
|
27
|
+
* Strip ANSI escape codes from text.
|
|
28
|
+
*
|
|
29
|
+
* @param text - Text with ANSI codes
|
|
30
|
+
* @returns Text without ANSI codes
|
|
31
|
+
*/
|
|
32
|
+
function stripAnsiCodes(text) {
|
|
33
|
+
return text.replace(/\x1b\[[0-9;]*[mGKH]/g, "").replace(/\x1b\][^\x07\x1b\\]*[\x07\x1b\\]/g, "").replace(/\x1b\\/g, "");
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get cached highlighted text or compute and cache it.
|
|
37
|
+
*/
|
|
38
|
+
function getCachedHighlight(text) {
|
|
39
|
+
if (highlightCache.has(text)) return highlightCache.get(text);
|
|
40
|
+
const result = highlightText(text);
|
|
41
|
+
if (highlightCache.size >= MAX_CACHE_SIZE) {
|
|
42
|
+
const firstKey = highlightCache.keys().next().value;
|
|
43
|
+
if (firstKey) highlightCache.delete(firstKey);
|
|
44
|
+
}
|
|
45
|
+
highlightCache.set(text, result);
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Clear the highlight cache (useful for memory management).
|
|
50
|
+
*/
|
|
51
|
+
function clearHighlightCache() {
|
|
52
|
+
highlightCache.clear();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Check if text contains ANSI escape codes.
|
|
56
|
+
*
|
|
57
|
+
* Detects all types of ANSI escape sequences:
|
|
58
|
+
* - CSI (Control Sequence Introducer): \x1b[... (parameters)
|
|
59
|
+
* - OSC (Operating System Command): \x1b]...
|
|
60
|
+
* - General escape sequences: \x1b...
|
|
61
|
+
*/
|
|
62
|
+
function hasAnsiCodes(text) {
|
|
63
|
+
return /\x1b\[/.test(text) || /\x1b\]/.test(text) || /\x1b/.test(text);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Syntax highlighted text component.
|
|
67
|
+
*
|
|
68
|
+
* Applies syntax highlighting to plain text messages.
|
|
69
|
+
* Strips ANSI codes before highlighting to prevent visual artifacts
|
|
70
|
+
* from mixed escape sequences.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <SyntaxHighlightedText text="GET /api/workspaces { filter: {} }" />
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
function SyntaxHighlightedText({ text, className }) {
|
|
78
|
+
if (!text || text.length === 0) return /* @__PURE__ */ jsx("span", {
|
|
79
|
+
className,
|
|
80
|
+
children: text
|
|
81
|
+
});
|
|
82
|
+
const highlighted = getCachedHighlight(hasAnsiCodes(text) ? stripAnsiCodes(text) : text);
|
|
83
|
+
return /* @__PURE__ */ jsx("span", {
|
|
84
|
+
className: cn("font-mono text-sm", className),
|
|
85
|
+
children: highlighted
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Apply syntax highlighting to text.
|
|
90
|
+
*
|
|
91
|
+
* Returns an array of React nodes with appropriate styling.
|
|
92
|
+
* Patterns are applied in order (most specific first).
|
|
93
|
+
*/
|
|
94
|
+
function highlightText(text) {
|
|
95
|
+
let result = text;
|
|
96
|
+
const tokens = [];
|
|
97
|
+
result = extractTokens(result, tokens, [
|
|
98
|
+
{
|
|
99
|
+
pattern: /\b\d{1,2}:\d{2}:\d{2}(\.\d{1,3})?\b/g,
|
|
100
|
+
className: "text-cyan-400/70"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
pattern: /\[([A-Z][A-Z0-9_]*)\]/g,
|
|
104
|
+
className: "text-purple-400 bg-purple-500/10 px-1 rounded font-semibold"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
pattern: /\b([a-zA-Z0-9_-]+\.([a-zA-Z]{2,4}|[A-Z]{2})(?::\d+:\d+)?)\b/g,
|
|
108
|
+
className: "text-orange-400 bg-orange-500/10 px-1 rounded text-xs"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
pattern: /\(([a-zA-Z0-9_-]+\.[a-zA-Z]{2,4}:\d+:\d+)\)/g,
|
|
112
|
+
className: "text-orange-400/80"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
pattern: /\{([^}]+)\}/g,
|
|
116
|
+
className: "text-yellow-400 bg-yellow-500/5 px-0.5 rounded"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
pattern: /\(([^)]+)\)/g,
|
|
120
|
+
className: "text-purple-300/80"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
pattern: /\b<([^>]+)>/g,
|
|
124
|
+
className: "text-cyan-300/80"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
pattern: /\bv?\d+\.\d+\.\d+(-[a-z0-9.]+)?\b/gi,
|
|
128
|
+
className: "text-green-400 font-semibold"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
pattern: /\b([a-zA-Z_][a-zA-Z0-9_-]*)\s*:/g,
|
|
132
|
+
className: "text-green-500"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
pattern: /\b(success|error|failed|warning|warn|info|debug|trace|fatal):/gi,
|
|
136
|
+
className: "text-pink-400 font-semibold"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
pattern: /(['"])(.*?)\1/g,
|
|
140
|
+
className: "text-green-400"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
pattern: /(?<!\w)(-?\d+(?:\.\d+)?)(?!\w)/g,
|
|
144
|
+
className: "text-yellow-400"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
pattern: /\b(true|false)\b/gi,
|
|
148
|
+
className: "text-blue-400"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
pattern: /\b(null|undefined)\b/gi,
|
|
152
|
+
className: "text-gray-500"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
pattern: /\b(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS|CONNECT|TRACE)\b/g,
|
|
156
|
+
className: "text-pink-400 font-semibold"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
pattern: /(^|[\s(])\/[a-zA-Z0-9_/-]+/g,
|
|
160
|
+
className: "text-cyan-400"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
pattern: /\b\w+\.(js|ts|jsx|tsx|json|py|rs|go|java|c|cpp|h|cs|sh|bash|yml|yaml|toml|md|txt|log)\b/g,
|
|
164
|
+
className: "text-orange-400"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
pattern: /([{}[\]()])/g,
|
|
168
|
+
className: "text-yellow-500"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
pattern: /\s*=\s*/g,
|
|
172
|
+
className: "text-gray-400"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
pattern: /->|=>/g,
|
|
176
|
+
className: "text-purple-400 font-semibold"
|
|
177
|
+
}
|
|
178
|
+
]);
|
|
179
|
+
return tokens.map((token, index) => /* @__PURE__ */ jsx("span", {
|
|
180
|
+
className: token.className,
|
|
181
|
+
children: token.text
|
|
182
|
+
}, index));
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Extract tokens from text using patterns.
|
|
186
|
+
*
|
|
187
|
+
* Iteratively applies patterns and extracts matched tokens.
|
|
188
|
+
*/
|
|
189
|
+
function extractTokens(text, tokens, patterns) {
|
|
190
|
+
let result = text;
|
|
191
|
+
let hasMatches = true;
|
|
192
|
+
while (hasMatches) {
|
|
193
|
+
hasMatches = false;
|
|
194
|
+
for (const { pattern, className } of patterns) {
|
|
195
|
+
const match = pattern.exec(result);
|
|
196
|
+
if (match) {
|
|
197
|
+
hasMatches = true;
|
|
198
|
+
const matchedText = match[0];
|
|
199
|
+
const startIndex = match.index;
|
|
200
|
+
const endIndex = startIndex + matchedText.length;
|
|
201
|
+
if (startIndex > 0) {
|
|
202
|
+
const beforeText = result.slice(0, startIndex);
|
|
203
|
+
if (beforeText) tokens.push({ text: beforeText });
|
|
204
|
+
}
|
|
205
|
+
tokens.push({
|
|
206
|
+
text: matchedText,
|
|
207
|
+
className
|
|
208
|
+
});
|
|
209
|
+
result = result.slice(endIndex);
|
|
210
|
+
pattern.lastIndex = 0;
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (result) tokens.push({ text: result });
|
|
216
|
+
return result;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Highlighted JSON component.
|
|
220
|
+
*
|
|
221
|
+
* Displays JSON with syntax highlighting and proper indentation.
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```tsx
|
|
225
|
+
* <HighlightedJson json={{ filter: {}, name: "test" }} />
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
function HighlightedJson({ json, className }) {
|
|
229
|
+
const formatted = JSON.stringify(json, null, 2);
|
|
230
|
+
try {
|
|
231
|
+
const highlighted = highlightJson(JSON.parse(formatted));
|
|
232
|
+
return /* @__PURE__ */ jsx("pre", {
|
|
233
|
+
className: cn("font-mono text-xs", className),
|
|
234
|
+
children: highlighted
|
|
235
|
+
});
|
|
236
|
+
} catch {
|
|
237
|
+
return /* @__PURE__ */ jsx("pre", {
|
|
238
|
+
className: cn("font-mono text-xs text-gray-400", className),
|
|
239
|
+
children: formatted
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Recursively highlight JSON.
|
|
245
|
+
*/
|
|
246
|
+
function highlightJson(value, indent = 0) {
|
|
247
|
+
const indentStr = " ".repeat(indent);
|
|
248
|
+
if (value === null) return /* @__PURE__ */ jsx("span", {
|
|
249
|
+
className: "text-gray-500",
|
|
250
|
+
children: "null"
|
|
251
|
+
});
|
|
252
|
+
if (value === void 0) return /* @__PURE__ */ jsx("span", {
|
|
253
|
+
className: "text-gray-500",
|
|
254
|
+
children: "undefined"
|
|
255
|
+
});
|
|
256
|
+
if (typeof value === "boolean") return /* @__PURE__ */ jsx("span", {
|
|
257
|
+
className: "text-blue-400",
|
|
258
|
+
children: String(value)
|
|
259
|
+
});
|
|
260
|
+
if (typeof value === "number") return /* @__PURE__ */ jsx("span", {
|
|
261
|
+
className: "text-yellow-400",
|
|
262
|
+
children: String(value)
|
|
263
|
+
});
|
|
264
|
+
if (typeof value === "string") return /* @__PURE__ */ jsxs("span", {
|
|
265
|
+
className: "text-green-400",
|
|
266
|
+
children: [
|
|
267
|
+
"\"",
|
|
268
|
+
value,
|
|
269
|
+
"\""
|
|
270
|
+
]
|
|
271
|
+
});
|
|
272
|
+
if (Array.isArray(value)) {
|
|
273
|
+
if (value.length === 0) return /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
|
|
274
|
+
className: "text-yellow-500",
|
|
275
|
+
children: "["
|
|
276
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
277
|
+
className: "text-yellow-500",
|
|
278
|
+
children: "]"
|
|
279
|
+
})] });
|
|
280
|
+
return /* @__PURE__ */ jsxs("span", { children: [
|
|
281
|
+
/* @__PURE__ */ jsx("span", {
|
|
282
|
+
className: "text-yellow-500",
|
|
283
|
+
children: "["
|
|
284
|
+
}),
|
|
285
|
+
"\n",
|
|
286
|
+
value.map((item, index) => /* @__PURE__ */ jsxs("span", { children: [
|
|
287
|
+
indentStr + " ",
|
|
288
|
+
highlightJson(item, indent + 1),
|
|
289
|
+
index < value.length - 1 ? /* @__PURE__ */ jsx("span", {
|
|
290
|
+
className: "text-gray-500",
|
|
291
|
+
children: ","
|
|
292
|
+
}) : null,
|
|
293
|
+
"\n"
|
|
294
|
+
] }, index)),
|
|
295
|
+
indentStr,
|
|
296
|
+
/* @__PURE__ */ jsx("span", {
|
|
297
|
+
className: "text-yellow-500",
|
|
298
|
+
children: "]"
|
|
299
|
+
})
|
|
300
|
+
] });
|
|
301
|
+
}
|
|
302
|
+
if (typeof value === "object") {
|
|
303
|
+
const entries = Object.entries(value);
|
|
304
|
+
if (entries.length === 0) return /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
|
|
305
|
+
className: "text-yellow-500",
|
|
306
|
+
children: "{"
|
|
307
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
308
|
+
className: "text-yellow-500",
|
|
309
|
+
children: "}"
|
|
310
|
+
})] });
|
|
311
|
+
return /* @__PURE__ */ jsxs("span", { children: [
|
|
312
|
+
/* @__PURE__ */ jsx("span", {
|
|
313
|
+
className: "text-yellow-500",
|
|
314
|
+
children: "{"
|
|
315
|
+
}),
|
|
316
|
+
"\n",
|
|
317
|
+
entries.map(([key, val], index) => /* @__PURE__ */ jsxs("span", { children: [
|
|
318
|
+
indentStr + " ",
|
|
319
|
+
/* @__PURE__ */ jsxs("span", {
|
|
320
|
+
className: "text-green-500",
|
|
321
|
+
children: [
|
|
322
|
+
"\"",
|
|
323
|
+
key,
|
|
324
|
+
"\""
|
|
325
|
+
]
|
|
326
|
+
}),
|
|
327
|
+
/* @__PURE__ */ jsx("span", {
|
|
328
|
+
className: "text-gray-500",
|
|
329
|
+
children: ": "
|
|
330
|
+
}),
|
|
331
|
+
highlightJson(val, indent + 1),
|
|
332
|
+
index < entries.length - 1 ? /* @__PURE__ */ jsx("span", {
|
|
333
|
+
className: "text-gray-500",
|
|
334
|
+
children: ","
|
|
335
|
+
}) : null,
|
|
336
|
+
"\n"
|
|
337
|
+
] }, key)),
|
|
338
|
+
indentStr,
|
|
339
|
+
/* @__PURE__ */ jsx("span", {
|
|
340
|
+
className: "text-yellow-500",
|
|
341
|
+
children: "}"
|
|
342
|
+
})
|
|
343
|
+
] });
|
|
344
|
+
}
|
|
345
|
+
return /* @__PURE__ */ jsx("span", {
|
|
346
|
+
className: "text-gray-500",
|
|
347
|
+
children: String(value)
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
//#endregion
|
|
352
|
+
export { HighlightedJson, SyntaxHighlightedText, clearHighlightCache };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TerminalLogBadge Component.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the base Badge component with terminal log level color styling.
|
|
5
|
+
* Maps log levels to appropriate Tailwind color classes matching the
|
|
6
|
+
* Synthwave Dark design system.
|
|
7
|
+
*
|
|
8
|
+
* @module @mks2508/mks-ui/react/blocks/Terminal/components/TerminalLogBadge
|
|
9
|
+
*/
|
|
10
|
+
import type { ReactNode } from 'react';
|
|
11
|
+
import type { TLogLevelFilter } from '../parsing/LogParser.types';
|
|
12
|
+
/**
|
|
13
|
+
* Props for the TerminalLogBadge component.
|
|
14
|
+
*/
|
|
15
|
+
export interface ITerminalLogBadgeProps {
|
|
16
|
+
/** Log level to display */
|
|
17
|
+
level: TLogLevelFilter | string;
|
|
18
|
+
/** Badge content (typically a count) */
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/** Additional class name */
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* TerminalLogBadge Component.
|
|
25
|
+
*
|
|
26
|
+
* Renders a Badge styled for terminal log levels with appropriate
|
|
27
|
+
* color coding for each severity level.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <TerminalLogBadge level="error">3</TerminalLogBadge>
|
|
32
|
+
* <TerminalLogBadge level="info">42</TerminalLogBadge>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function TerminalLogBadge({ level, children, className }: ITerminalLogBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=TerminalLogBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalLogBadge.d.ts","sourceRoot":"","sources":["../../../../../src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAgBlE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,2BAA2B;IAC3B,KAAK,EAAE,eAAe,GAAG,MAAM,CAAC;IAChC,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,sBAAsB,2CAUtF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { Badge } from "../../../ui/Badge/index.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx
|
|
8
|
+
/**
|
|
9
|
+
* TerminalLogBadge Component.
|
|
10
|
+
*
|
|
11
|
+
* Wraps the base Badge component with terminal log level color styling.
|
|
12
|
+
* Maps log levels to appropriate Tailwind color classes matching the
|
|
13
|
+
* Synthwave Dark design system.
|
|
14
|
+
*
|
|
15
|
+
* @module @mks2508/mks-ui/react/blocks/Terminal/components/TerminalLogBadge
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Color classes for each log level.
|
|
19
|
+
*/
|
|
20
|
+
const LEVEL_COLORS = {
|
|
21
|
+
all: "bg-muted/40 text-muted-foreground border-muted/60",
|
|
22
|
+
trace: "bg-slate-500/20 text-slate-400 border-slate-500/30",
|
|
23
|
+
debug: "bg-blue-500/20 text-blue-400 border-blue-500/30",
|
|
24
|
+
info: "bg-green-500/20 text-green-400 border-green-500/30",
|
|
25
|
+
warn: "bg-yellow-500/20 text-yellow-400 border-yellow-500/30",
|
|
26
|
+
error: "bg-orange-500/20 text-orange-400 border-orange-500/30",
|
|
27
|
+
fatal: "bg-red-500/20 text-red-400 border-red-500/30",
|
|
28
|
+
unknown: "bg-muted/40 text-muted-foreground border-muted/60"
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* TerminalLogBadge Component.
|
|
32
|
+
*
|
|
33
|
+
* Renders a Badge styled for terminal log levels with appropriate
|
|
34
|
+
* color coding for each severity level.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <TerminalLogBadge level="error">3</TerminalLogBadge>
|
|
39
|
+
* <TerminalLogBadge level="info">42</TerminalLogBadge>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
function TerminalLogBadge({ level, children, className }) {
|
|
43
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
44
|
+
variant: "outline",
|
|
45
|
+
size: "sm",
|
|
46
|
+
className: cn(LEVEL_COLORS[level] ?? LEVEL_COLORS.unknown, className),
|
|
47
|
+
children
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { TerminalLogBadge };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal components barrel export.
|
|
3
|
+
*
|
|
4
|
+
* @module @mks2508/mks-ui/react/blocks/Terminal/components
|
|
5
|
+
*/
|
|
6
|
+
export * from './LogLineBadges';
|
|
7
|
+
export * from './SyntaxHighlight';
|
|
8
|
+
export * from './SpecializedSyntaxHighlighter';
|
|
9
|
+
export * from './TerminalLogBadge';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react-ui/blocks/Terminal/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ContentTypeBadge, LevelBadge, LogLineContainer, TagBadge, TagBadges, TimestampBadge } from "./LogLineBadges.js";
|
|
2
|
+
import { HighlightedJson, SyntaxHighlightedText, clearHighlightCache } from "./SyntaxHighlight.js";
|
|
3
|
+
import { SpecializedSyntaxHighlighter } from "./SpecializedSyntaxHighlighter.js";
|
|
4
|
+
import { TerminalLogBadge } from "./TerminalLogBadge.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal Hooks Module.
|
|
3
|
+
*
|
|
4
|
+
* Reusable hooks for terminal WebSocket connections
|
|
5
|
+
* and global settings management.
|
|
6
|
+
*
|
|
7
|
+
* @module @mks2508/mks-ui/react/blocks/Terminal/hooks
|
|
8
|
+
*/
|
|
9
|
+
export { useTerminalWebSocket, type IUseTerminalWebSocketOptions, type IUseTerminalWebSocketReturn, type ITerminalWsServerMessage, type TTerminalWsStatus, } from './useTerminalWebSocket';
|
|
10
|
+
export { useTerminalSettings, type ITerminalSettings, type IUseTerminalSettingsReturn, } from './useTerminalSettings';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react-ui/blocks/Terminal/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,oBAAoB,EACpB,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,GACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,GAChC,MAAM,uBAAuB,CAAC"}
|