@mks2508/mks-ui 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts +146 -0
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/ResttyAdapter.js +213 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts +55 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.adapter.js +68 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts +43 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.js +59 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts +63 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.js +109 -0
- package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts +351 -0
- package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.d.ts +46 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.js +168 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.styles.d.ts +21 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.styles.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.styles.js +31 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.types.d.ts +56 -0
- package/dist/react-ui/blocks/Terminal/TerminalDisplay.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts +60 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalPanel.js +183 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts +111 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalRestty.js +185 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/TerminalXterm.js +143 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts +87 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/XTermAdapter.js +135 -0
- package/dist/react-ui/blocks/Terminal/chrome.d.ts +14 -0
- package/dist/react-ui/blocks/Terminal/chrome.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/chrome.js +6 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts +160 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/LogLineBadges.js +185 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts +48 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.js +139 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts +60 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.js +352 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts +36 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.js +52 -0
- package/dist/react-ui/blocks/Terminal/components/index.d.ts +10 -0
- package/dist/react-ui/blocks/Terminal/components/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/components/index.js +4 -0
- package/dist/react-ui/blocks/Terminal/display.d.ts +20 -0
- package/dist/react-ui/blocks/Terminal/display.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/display.js +9 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.d.ts +11 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/index.js +2 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts +69 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.js +162 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts +104 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.js +180 -0
- package/dist/react-ui/blocks/Terminal/index.d.ts +43 -0
- package/dist/react-ui/blocks/Terminal/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/index.js +41 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.js +222 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts +74 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.js +168 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts +42 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.js +175 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts +43 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts +38 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.js +62 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts +67 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts +32 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.js +326 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts +36 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.js +371 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts +67 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.js +417 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts +197 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts +55 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.js +214 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.d.ts +35 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.js +57 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts +62 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts +30 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.js +126 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts +31 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.js +149 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts +35 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts +58 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts +63 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.js +245 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts +24 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.js +225 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts +35 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.js +187 -0
- package/dist/react-ui/blocks/Terminal/panel/index.d.ts +30 -0
- package/dist/react-ui/blocks/Terminal/panel/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module-CNVWCefU.css +60 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.js +5 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module-cmyJ11jP.css +60 -0
- package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.js +5 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts +73 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.js +136 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts +117 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.js +174 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts +221 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts +184 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/LogParserService.js +478 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts +173 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.js +313 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts +181 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.js +221 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts +69 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.js +142 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts +125 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/TableParser.js +245 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts +165 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.js +225 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts +164 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.js +285 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts +188 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.js +178 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts +12 -0
- package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/index.d.ts +24 -0
- package/dist/react-ui/blocks/Terminal/parsing/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts +56 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts +140 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts.map +1 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.js +325 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts +10 -0
- package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts.map +1 -0
- package/dist/react-ui/blocks/index.d.ts +11 -0
- package/dist/react-ui/blocks/index.d.ts.map +1 -0
- package/dist/react-ui/icons/lucide-animated/activity.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bell-electric.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bell.js +1 -1
- package/dist/react-ui/icons/lucide-animated/bot.js +1 -1
- package/dist/react-ui/icons/lucide-animated/box.js +1 -1
- package/dist/react-ui/icons/lucide-animated/circle-check.js +1 -1
- package/dist/react-ui/icons/lucide-animated/delete.js +1 -1
- package/dist/react-ui/icons/lucide-animated/download.js +1 -1
- package/dist/react-ui/icons/lucide-animated/home.js +1 -1
- package/dist/react-ui/icons/lucide-animated/layout-panel-top.js +1 -1
- package/dist/react-ui/icons/lucide-animated/plus.js +1 -1
- package/dist/react-ui/icons/lucide-animated/search.js +1 -1
- package/dist/react-ui/icons/lucide-animated/settings.js +1 -1
- package/dist/react-ui/icons/lucide-animated/trending-down.js +1 -1
- package/dist/react-ui/icons/lucide-animated/trending-up.js +1 -1
- package/dist/react-ui/icons/lucide-animated/x.js +1 -1
- package/dist/react-ui/index.js +3 -1
- package/dist/react-ui/lib/icon-wrapper.d.ts +37 -0
- package/dist/react-ui/lib/icon-wrapper.d.ts.map +1 -0
- package/dist/react-ui/lib/icon-wrapper.js +55 -0
- package/dist/react-ui/lib/index.d.ts +1 -0
- package/dist/react-ui/lib/index.d.ts.map +1 -1
- package/dist/react-ui/lib/index.js +1 -0
- package/dist/react-ui/primitives/waapi/Morph/techniques/useCSSGridMorph.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Morph/techniques/useCSSGridMorph.js +2 -0
- package/dist/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.js +2 -0
- package/dist/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.js +2 -0
- package/dist/react-ui/primitives/waapi/Morph/useMorph.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Morph/useMorph.js +2 -0
- package/dist/react-ui/primitives/waapi/Reorder/useReorder.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Reorder/useReorder.js +2 -0
- package/dist/react-ui/primitives/waapi/Reorder/useReorderPresence.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Reorder/useReorderPresence.js +2 -0
- package/dist/react-ui/primitives/waapi/core/useAnimationOrchestrator.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/core/useAnimationOrchestrator.js +2 -0
- package/dist/react-ui/primitives/waapi/core/useElementRegistry.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/core/useElementRegistry.js +2 -0
- package/dist/react-ui/primitives/waapi/core/useFLIPAnimation.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/core/useFLIPAnimation.js +2 -0
- package/dist/react-ui/primitives/waapi/core/usePositionCapture.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/core/usePositionCapture.js +2 -0
- package/dist/react-ui/ui/Button/Button.styles.d.ts +1 -1
- package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.d.ts +1 -1
- package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.js +1 -1
- package/dist/react-ui/ui/InputGroup/index.d.ts.map +1 -1
- package/dist/react-ui/ui/InputGroup/index.js +2 -0
- package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts +43 -25
- package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/Tabs.styles.js +105 -13
- package/dist/react-ui/ui/Tabs/Tabs.types.d.ts +6 -3
- package/dist/react-ui/ui/Tabs/Tabs.types.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/index.d.ts +18 -9
- package/dist/react-ui/ui/Tabs/index.d.ts.map +1 -1
- package/dist/react-ui/ui/Tabs/index.js +99 -27
- package/dist/react-ui/ui/index.js +1 -0
- package/package.json +84 -29
- package/src/css.d.ts +6 -0
- package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +278 -0
- package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +97 -0
- package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +155 -0
- package/src/react-ui/blocks/Terminal/Terminal.theme.ts +80 -0
- package/src/react-ui/blocks/Terminal/Terminal.types.ts +438 -0
- package/src/react-ui/blocks/Terminal/TerminalDisplay.styles.ts +38 -0
- package/src/react-ui/blocks/Terminal/TerminalDisplay.tsx +243 -0
- package/src/react-ui/blocks/Terminal/TerminalDisplay.types.ts +73 -0
- package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +269 -0
- package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +326 -0
- package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +230 -0
- package/src/react-ui/blocks/Terminal/XTermAdapter.ts +163 -0
- package/src/react-ui/blocks/Terminal/chrome.ts +25 -0
- package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +316 -0
- package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +218 -0
- package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +386 -0
- package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +67 -0
- package/src/react-ui/blocks/Terminal/components/index.ts +10 -0
- package/src/react-ui/blocks/Terminal/display.ts +46 -0
- package/src/react-ui/blocks/Terminal/hooks/index.ts +22 -0
- package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +229 -0
- package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +292 -0
- package/src/react-ui/blocks/Terminal/index.ts +111 -0
- package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +330 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +242 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +202 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +140 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +68 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +85 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +383 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +439 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +550 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +259 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.ts +75 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +266 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +82 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +112 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +178 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +203 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +252 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +334 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +261 -0
- package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +248 -0
- package/src/react-ui/blocks/Terminal/panel/index.ts +72 -0
- package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +59 -0
- package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +59 -0
- package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +180 -0
- package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +248 -0
- package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +283 -0
- package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +686 -0
- package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +466 -0
- package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +343 -0
- package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +167 -0
- package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +348 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +251 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +390 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +320 -0
- package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +20 -0
- package/src/react-ui/blocks/Terminal/parsing/index.ts +69 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +68 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +436 -0
- package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +14 -0
- package/src/react-ui/blocks/index.ts +11 -0
- package/src/react-ui/icons/lucide-animated/activity.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/bell-electric.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/bell.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/bot.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/box.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/circle-check.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/delete.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/download.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/home.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/plus.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/search.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/settings.tsx +1 -1
- package/src/react-ui/icons/lucide-animated/trending-down.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/trending-up.tsx +2 -2
- package/src/react-ui/icons/lucide-animated/x.tsx +2 -2
- package/src/react-ui/lib/icon-wrapper.tsx +70 -0
- package/src/react-ui/lib/index.ts +1 -0
- package/src/react-ui/primitives/waapi/Morph/techniques/useCSSGridMorph.ts +1 -0
- package/src/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.ts +1 -0
- package/src/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.ts +1 -0
- package/src/react-ui/primitives/waapi/Morph/useMorph.ts +1 -0
- package/src/react-ui/primitives/waapi/Reorder/useReorder.ts +1 -0
- package/src/react-ui/primitives/waapi/Reorder/useReorderPresence.ts +1 -0
- package/src/react-ui/primitives/waapi/core/useAnimationOrchestrator.ts +1 -0
- package/src/react-ui/primitives/waapi/core/useElementRegistry.ts +1 -0
- package/src/react-ui/primitives/waapi/core/useFLIPAnimation.ts +1 -0
- package/src/react-ui/primitives/waapi/core/usePositionCapture.ts +1 -0
- package/src/react-ui/ui/Accordion/index.tsx +3 -3
- package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +1 -1
- package/src/react-ui/ui/InputGroup/index.tsx +2 -0
- package/src/react-ui/ui/Tabs/Tabs.css +39 -0
- package/src/react-ui/ui/Tabs/Tabs.styles.ts +119 -31
- package/src/react-ui/ui/Tabs/Tabs.types.ts +8 -3
- package/src/react-ui/ui/Tabs/index.tsx +135 -27
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Badge formatter for terminal logs.
|
|
3
|
+
*
|
|
4
|
+
* Creates stylized badges using standard ANSI escape codes
|
|
5
|
+
* compatible with xterm.js.
|
|
6
|
+
*
|
|
7
|
+
* @module components/devenv/terminal/parsing/badge
|
|
8
|
+
*/
|
|
9
|
+
import type { TLogLevel } from './LogParser.types';
|
|
10
|
+
/**
|
|
11
|
+
* Badge formatter class.
|
|
12
|
+
*
|
|
13
|
+
* Creates simple ANSI badges for log levels, tags, and timestamps.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const formatter = new BadgeFormatter();
|
|
18
|
+
* const infoBadge = formatter.createLevelBadge('info');
|
|
19
|
+
* // Returns: '\x1b[1m\x1b[44m\x1b[97m[ INFO ]\x1b[0m'
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare class BadgeFormatter {
|
|
23
|
+
/**
|
|
24
|
+
* Create a level badge.
|
|
25
|
+
*
|
|
26
|
+
* Badge format: [ INFO ] with background color
|
|
27
|
+
*
|
|
28
|
+
* @param level - Log level
|
|
29
|
+
* @returns ANSI-formatted level badge string
|
|
30
|
+
*/
|
|
31
|
+
createLevelBadge(level: TLogLevel): string;
|
|
32
|
+
/**
|
|
33
|
+
* Create a timestamp badge for end of line.
|
|
34
|
+
*
|
|
35
|
+
* Badge format: " 22:55:20" aligned to right
|
|
36
|
+
*
|
|
37
|
+
* @param timestamp - Display timestamp string
|
|
38
|
+
* @returns ANSI-formatted timestamp string
|
|
39
|
+
*/
|
|
40
|
+
createTimestampBadge(timestamp: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Create a tag badge.
|
|
43
|
+
*
|
|
44
|
+
* Badge format: [TAG] with subtle styling
|
|
45
|
+
*
|
|
46
|
+
* @param tag - Tag string
|
|
47
|
+
* @returns ANSI-formatted tag badge string
|
|
48
|
+
*/
|
|
49
|
+
createTagBadge(tag: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Create multiple tag badges joined with space.
|
|
52
|
+
*
|
|
53
|
+
* @param tags - Array of tag strings
|
|
54
|
+
* @returns ANSI-formatted tag badges string
|
|
55
|
+
*/
|
|
56
|
+
createTagBadges(tags: string[]): string;
|
|
57
|
+
/**
|
|
58
|
+
* Create a status indicator.
|
|
59
|
+
*
|
|
60
|
+
* @param status - Status type
|
|
61
|
+
* @returns ANSI-formatted status indicator
|
|
62
|
+
*/
|
|
63
|
+
createStatusIndicator(status: 'success' | 'warning' | 'error' | 'info'): string;
|
|
64
|
+
/**
|
|
65
|
+
* Create a box badge (multi-line).
|
|
66
|
+
*
|
|
67
|
+
* @param text - Text to display
|
|
68
|
+
* @param level - Log level for color
|
|
69
|
+
* @returns Multi-line ANSI box
|
|
70
|
+
*/
|
|
71
|
+
createBoxBadge(text: string, level?: TLogLevel): string;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=BadgeFormatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeFormatter.d.ts","sourceRoot":"","sources":["../../../../../src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAkDnD;;;;;;;;;;;GAWG;AACH,qBAAa,cAAc;IACzB;;;;;;;OAOG;IACH,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAS1C;;;;;;;OAOG;IACH,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAc/C;;;;;;;OAOG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAOnC;;;;;OAKG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM;IAKvC;;;;;OAKG;IACH,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM;IAkB/E;;;;;;OAMG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,SAAkB,GAAG,MAAM;CAWhE"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
//#region src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts
|
|
2
|
+
/**
|
|
3
|
+
* ANSI color combinations for badges.
|
|
4
|
+
*
|
|
5
|
+
* Uses standard 16-color palette for maximum compatibility.
|
|
6
|
+
*/
|
|
7
|
+
const BADGE_COLORS = {
|
|
8
|
+
info: "\x1B[44m\x1B[97m",
|
|
9
|
+
warn: "\x1B[43m\x1B[30m",
|
|
10
|
+
error: "\x1B[41m\x1B[97m",
|
|
11
|
+
debug: "\x1B[46m\x1B[30m",
|
|
12
|
+
fatal: "\x1B[45m\x1B[97m",
|
|
13
|
+
trace: "\x1B[47m\x1B[30m",
|
|
14
|
+
unknown: "\x1B[47m\x1B[30m"
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Tag badge colors (cyan on gray).
|
|
18
|
+
*/
|
|
19
|
+
const TAG_COLORS = "\x1B[90m\x1B[36m";
|
|
20
|
+
/**
|
|
21
|
+
* Timestamp colors (gray).
|
|
22
|
+
*/
|
|
23
|
+
const TIMESTAMP_COLORS = "\x1B[90m\x1B[37m";
|
|
24
|
+
/**
|
|
25
|
+
* Reset code.
|
|
26
|
+
*/
|
|
27
|
+
const RESET = "\x1B[0m";
|
|
28
|
+
/**
|
|
29
|
+
* Bold modifier.
|
|
30
|
+
*/
|
|
31
|
+
const BOLD = "\x1B[1m";
|
|
32
|
+
/**
|
|
33
|
+
* Level badge icons.
|
|
34
|
+
*/
|
|
35
|
+
const LEVEL_ICONS = {
|
|
36
|
+
info: "I",
|
|
37
|
+
warn: "W",
|
|
38
|
+
error: "E",
|
|
39
|
+
fatal: "F",
|
|
40
|
+
debug: "D",
|
|
41
|
+
trace: "T",
|
|
42
|
+
unknown: "?"
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Badge formatter class.
|
|
46
|
+
*
|
|
47
|
+
* Creates simple ANSI badges for log levels, tags, and timestamps.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const formatter = new BadgeFormatter();
|
|
52
|
+
* const infoBadge = formatter.createLevelBadge('info');
|
|
53
|
+
* // Returns: '\x1b[1m\x1b[44m\x1b[97m[ INFO ]\x1b[0m'
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
var BadgeFormatter = class {
|
|
57
|
+
/**
|
|
58
|
+
* Create a level badge.
|
|
59
|
+
*
|
|
60
|
+
* Badge format: [ INFO ] with background color
|
|
61
|
+
*
|
|
62
|
+
* @param level - Log level
|
|
63
|
+
* @returns ANSI-formatted level badge string
|
|
64
|
+
*/
|
|
65
|
+
createLevelBadge(level) {
|
|
66
|
+
return `${BOLD}${BADGE_COLORS[level] ?? BADGE_COLORS.unknown}[${LEVEL_ICONS[level] ?? LEVEL_ICONS.unknown}${level.toUpperCase().padEnd(4)}]${RESET}`;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a timestamp badge for end of line.
|
|
70
|
+
*
|
|
71
|
+
* Badge format: " 22:55:20" aligned to right
|
|
72
|
+
*
|
|
73
|
+
* @param timestamp - Display timestamp string
|
|
74
|
+
* @returns ANSI-formatted timestamp string
|
|
75
|
+
*/
|
|
76
|
+
createTimestampBadge(timestamp) {
|
|
77
|
+
if (!timestamp) return "";
|
|
78
|
+
return `${TIMESTAMP_COLORS}${(timestamp.includes(".") ? timestamp.split(".")[0] : timestamp).padStart(12)}${RESET}`;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Create a tag badge.
|
|
82
|
+
*
|
|
83
|
+
* Badge format: [TAG] with subtle styling
|
|
84
|
+
*
|
|
85
|
+
* @param tag - Tag string
|
|
86
|
+
* @returns ANSI-formatted tag badge string
|
|
87
|
+
*/
|
|
88
|
+
createTagBadge(tag) {
|
|
89
|
+
return `${TAG_COLORS}[${tag.length > 12 ? tag.slice(0, 9) + "..." : tag}]${RESET}`;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Create multiple tag badges joined with space.
|
|
93
|
+
*
|
|
94
|
+
* @param tags - Array of tag strings
|
|
95
|
+
* @returns ANSI-formatted tag badges string
|
|
96
|
+
*/
|
|
97
|
+
createTagBadges(tags) {
|
|
98
|
+
if (!tags || tags.length === 0) return "";
|
|
99
|
+
return tags.map((tag) => this.createTagBadge(tag)).join("");
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Create a status indicator.
|
|
103
|
+
*
|
|
104
|
+
* @param status - Status type
|
|
105
|
+
* @returns ANSI-formatted status indicator
|
|
106
|
+
*/
|
|
107
|
+
createStatusIndicator(status) {
|
|
108
|
+
return `${{
|
|
109
|
+
success: "\x1B[42m\x1B[97m",
|
|
110
|
+
warning: "\x1B[43m\x1B[30m",
|
|
111
|
+
error: "\x1B[41m\x1B[97m",
|
|
112
|
+
info: "\x1B[44m\x1B[97m"
|
|
113
|
+
}[status]} ${{
|
|
114
|
+
success: "✓",
|
|
115
|
+
warning: "⚠",
|
|
116
|
+
error: "✖",
|
|
117
|
+
info: "i"
|
|
118
|
+
}[status]} ${RESET}`;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Create a box badge (multi-line).
|
|
122
|
+
*
|
|
123
|
+
* @param text - Text to display
|
|
124
|
+
* @param level - Log level for color
|
|
125
|
+
* @returns Multi-line ANSI box
|
|
126
|
+
*/
|
|
127
|
+
createBoxBadge(text, level = "info") {
|
|
128
|
+
const colors = BADGE_COLORS[level] ?? BADGE_COLORS.unknown;
|
|
129
|
+
const padding = 2;
|
|
130
|
+
const width = text.length + padding * 2 + 2;
|
|
131
|
+
return `${`\x1b[90m┌${"─".repeat(width)}┐${RESET}`}\r\n${`${colors}│${" ".repeat(padding)}${text}${" ".repeat(padding)}│${RESET}`}\r\n${`\x1b[90m└${"─".repeat(width)}┘${RESET}`}`;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
136
|
+
export { BadgeFormatter };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP log parser for specialized HTTP request detection.
|
|
3
|
+
*
|
|
4
|
+
* Detects and parses HTTP request logs with syntax highlighting
|
|
5
|
+
* for methods (GET, POST, etc.), routes, and parameters.
|
|
6
|
+
*
|
|
7
|
+
* @module components/devenv/terminal/parsing/HttpLogParser
|
|
8
|
+
*/
|
|
9
|
+
import type { IParsedLogEntry } from './LogParser.types';
|
|
10
|
+
/**
|
|
11
|
+
* HTTP method enumeration.
|
|
12
|
+
*/
|
|
13
|
+
export type THttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE';
|
|
14
|
+
/**
|
|
15
|
+
* Parsed HTTP request data.
|
|
16
|
+
*/
|
|
17
|
+
export interface IHttpParsedData {
|
|
18
|
+
/** HTTP method */
|
|
19
|
+
method: THttpMethod;
|
|
20
|
+
/** Request path/route */
|
|
21
|
+
path: string;
|
|
22
|
+
/** Query parameters extracted from path */
|
|
23
|
+
params?: Record<string, string>;
|
|
24
|
+
/** Whether request opens a multiline block (has brace) */
|
|
25
|
+
opensMultiline: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* HTTP log parser class.
|
|
29
|
+
*
|
|
30
|
+
* Detects HTTP requests in log lines and extracts structured data.
|
|
31
|
+
* Supports various log formats:
|
|
32
|
+
*
|
|
33
|
+
* - `GET /api/endpoint`
|
|
34
|
+
* - `GET /api/endpoint/:param {`
|
|
35
|
+
* - `POST /api/users HTTP/1.1`
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const parser = new HttpLogParser();
|
|
40
|
+
* const parsed = parser.parseLine('GET /api/logs/containers/:name/stream {');
|
|
41
|
+
* // parsed.method = 'GET'
|
|
42
|
+
* // parsed.path = '/api/logs/containers/:name/stream'
|
|
43
|
+
* // parsed.opensMultiline = true
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare class HttpLogParser {
|
|
47
|
+
/** HTTP method pattern */
|
|
48
|
+
private readonly HTTP_PATTERN;
|
|
49
|
+
/** URL path with parameters pattern */
|
|
50
|
+
private readonly PATH_PARAM_PATTERN;
|
|
51
|
+
/**
|
|
52
|
+
* Parse a log line for HTTP request data.
|
|
53
|
+
*
|
|
54
|
+
* @param line - Log line to parse
|
|
55
|
+
* @returns Parsed HTTP data or null if not an HTTP line
|
|
56
|
+
*/
|
|
57
|
+
parseLine(line: string): IHttpParsedData | null;
|
|
58
|
+
/**
|
|
59
|
+
* Check if a line is an HTTP request line.
|
|
60
|
+
*
|
|
61
|
+
* @param line - Line to check
|
|
62
|
+
* @returns true if line is an HTTP request
|
|
63
|
+
*/
|
|
64
|
+
isHttpLine(line: string): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Extract path parameters from a route path.
|
|
67
|
+
*
|
|
68
|
+
* @param path - Route path (e.g., `/api/users/:id`)
|
|
69
|
+
* @returns Object with parameter names
|
|
70
|
+
*/
|
|
71
|
+
extractPathParams(path: string): Record<string, string> | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Format HTTP method with syntax highlighting class.
|
|
74
|
+
*
|
|
75
|
+
* @param _method - HTTP method
|
|
76
|
+
* @returns CSS class for highlighting
|
|
77
|
+
*/
|
|
78
|
+
getMethodClass(_method: THttpMethod): string;
|
|
79
|
+
/**
|
|
80
|
+
* Format path with syntax highlighting.
|
|
81
|
+
*
|
|
82
|
+
* @param path - Request path
|
|
83
|
+
* @returns CSS class for path highlighting
|
|
84
|
+
*/
|
|
85
|
+
getPathClass(): string;
|
|
86
|
+
/**
|
|
87
|
+
* Highlight an HTTP request line.
|
|
88
|
+
*
|
|
89
|
+
* Returns an array of parts with their associated CSS classes.
|
|
90
|
+
*
|
|
91
|
+
* @param line - HTTP request line
|
|
92
|
+
* @returns Array of {text, className} parts
|
|
93
|
+
*/
|
|
94
|
+
highlightLine(line: string): Array<{
|
|
95
|
+
text: string;
|
|
96
|
+
className?: string;
|
|
97
|
+
}>;
|
|
98
|
+
/**
|
|
99
|
+
* Highlight path segments (routes and parameters).
|
|
100
|
+
*
|
|
101
|
+
* @param path - Path string
|
|
102
|
+
* @returns Highlighted parts
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
105
|
+
private highlightPath;
|
|
106
|
+
/**
|
|
107
|
+
* Parse a multiline HTTP request block.
|
|
108
|
+
*
|
|
109
|
+
* Combines the initial request line with continuation lines
|
|
110
|
+
* that form JSON or structured data.
|
|
111
|
+
*
|
|
112
|
+
* @param lines - Array of log lines
|
|
113
|
+
* @returns Parsed entry with HTTP data
|
|
114
|
+
*/
|
|
115
|
+
parseHttpBlock(lines: string[]): IParsedLogEntry | null;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=HttpLogParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpLogParser.d.ts","sourceRoot":"","sources":["../../../../../src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kBAAkB;IAClB,MAAM,EAAE,WAAW,CAAC;IAEpB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IAEb,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC,0DAA0D;IAC1D,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,aAAa;IACxB,0BAA0B;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAmF;IAEhH,uCAAuC;IACvC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAgC;IAEnE;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI;IAc/C;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIjC;;;;;OAKG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;IAWnE;;;;;OAKG;IACH,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM;IAK5C;;;;;OAKG;IACH,YAAY,IAAI,MAAM;IAItB;;;;;;;OAOG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAwCxE;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAgCrB;;;;;;;;OAQG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,eAAe,GAAG,IAAI;CAwBxD"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
//#region src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts
|
|
2
|
+
/**
|
|
3
|
+
* HTTP log parser class.
|
|
4
|
+
*
|
|
5
|
+
* Detects HTTP requests in log lines and extracts structured data.
|
|
6
|
+
* Supports various log formats:
|
|
7
|
+
*
|
|
8
|
+
* - `GET /api/endpoint`
|
|
9
|
+
* - `GET /api/endpoint/:param {`
|
|
10
|
+
* - `POST /api/users HTTP/1.1`
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const parser = new HttpLogParser();
|
|
15
|
+
* const parsed = parser.parseLine('GET /api/logs/containers/:name/stream {');
|
|
16
|
+
* // parsed.method = 'GET'
|
|
17
|
+
* // parsed.path = '/api/logs/containers/:name/stream'
|
|
18
|
+
* // parsed.opensMultiline = true
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
var HttpLogParser = class {
|
|
22
|
+
/** HTTP method pattern */
|
|
23
|
+
HTTP_PATTERN = /^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS|CONNECT|TRACE)\s+(.+?)(?:\s+(\{))?$/i;
|
|
24
|
+
/** URL path with parameters pattern */
|
|
25
|
+
PATH_PARAM_PATTERN = /:([a-zA-Z_][a-zA-Z0-9_]*)/g;
|
|
26
|
+
/**
|
|
27
|
+
* Parse a log line for HTTP request data.
|
|
28
|
+
*
|
|
29
|
+
* @param line - Log line to parse
|
|
30
|
+
* @returns Parsed HTTP data or null if not an HTTP line
|
|
31
|
+
*/
|
|
32
|
+
parseLine(line) {
|
|
33
|
+
const match = line.match(this.HTTP_PATTERN);
|
|
34
|
+
if (!match) return null;
|
|
35
|
+
const [, method, path, hasBrace] = match;
|
|
36
|
+
return {
|
|
37
|
+
method: method.toUpperCase(),
|
|
38
|
+
path: path.trim(),
|
|
39
|
+
params: this.extractPathParams(path),
|
|
40
|
+
opensMultiline: hasBrace === "{"
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if a line is an HTTP request line.
|
|
45
|
+
*
|
|
46
|
+
* @param line - Line to check
|
|
47
|
+
* @returns true if line is an HTTP request
|
|
48
|
+
*/
|
|
49
|
+
isHttpLine(line) {
|
|
50
|
+
return this.HTTP_PATTERN.test(line);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Extract path parameters from a route path.
|
|
54
|
+
*
|
|
55
|
+
* @param path - Route path (e.g., `/api/users/:id`)
|
|
56
|
+
* @returns Object with parameter names
|
|
57
|
+
*/
|
|
58
|
+
extractPathParams(path) {
|
|
59
|
+
const matches = path.matchAll(this.PATH_PARAM_PATTERN);
|
|
60
|
+
const params = {};
|
|
61
|
+
for (const match of matches) params[match[1]] = `:${match[1]}`;
|
|
62
|
+
return Object.keys(params).length > 0 ? params : void 0;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Format HTTP method with syntax highlighting class.
|
|
66
|
+
*
|
|
67
|
+
* @param _method - HTTP method
|
|
68
|
+
* @returns CSS class for highlighting
|
|
69
|
+
*/
|
|
70
|
+
getMethodClass(_method) {
|
|
71
|
+
return "text-pink-400 font-semibold";
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Format path with syntax highlighting.
|
|
75
|
+
*
|
|
76
|
+
* @param path - Request path
|
|
77
|
+
* @returns CSS class for path highlighting
|
|
78
|
+
*/
|
|
79
|
+
getPathClass() {
|
|
80
|
+
return "text-cyan-400";
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Highlight an HTTP request line.
|
|
84
|
+
*
|
|
85
|
+
* Returns an array of parts with their associated CSS classes.
|
|
86
|
+
*
|
|
87
|
+
* @param line - HTTP request line
|
|
88
|
+
* @returns Array of {text, className} parts
|
|
89
|
+
*/
|
|
90
|
+
highlightLine(line) {
|
|
91
|
+
const parts = [];
|
|
92
|
+
const match = line.match(this.HTTP_PATTERN);
|
|
93
|
+
if (!match) return [{ text: line }];
|
|
94
|
+
const [fullMatch, method, path, hasBrace] = match;
|
|
95
|
+
const beforeMethod = line.indexOf(fullMatch);
|
|
96
|
+
if (beforeMethod > 0) parts.push({ text: line.slice(0, beforeMethod) });
|
|
97
|
+
parts.push({
|
|
98
|
+
text: method.toUpperCase(),
|
|
99
|
+
className: this.getMethodClass(method)
|
|
100
|
+
});
|
|
101
|
+
parts.push({ text: " " });
|
|
102
|
+
const pathParts = this.highlightPath(path.trim());
|
|
103
|
+
parts.push(...pathParts);
|
|
104
|
+
if (hasBrace) parts.push({
|
|
105
|
+
text: " {",
|
|
106
|
+
className: "text-yellow-500"
|
|
107
|
+
});
|
|
108
|
+
return parts;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Highlight path segments (routes and parameters).
|
|
112
|
+
*
|
|
113
|
+
* @param path - Path string
|
|
114
|
+
* @returns Highlighted parts
|
|
115
|
+
* @private
|
|
116
|
+
*/
|
|
117
|
+
highlightPath(path) {
|
|
118
|
+
const parts = [];
|
|
119
|
+
let remaining = path;
|
|
120
|
+
while (remaining.length > 0) {
|
|
121
|
+
const paramMatch = remaining.match(/^\/?:([a-zA-Z_][a-zA-Z0-9_]*)/);
|
|
122
|
+
if (paramMatch) {
|
|
123
|
+
const beforeParam = remaining.slice(0, paramMatch.index);
|
|
124
|
+
if (beforeParam.length > 0) parts.push({
|
|
125
|
+
text: beforeParam,
|
|
126
|
+
className: this.getPathClass()
|
|
127
|
+
});
|
|
128
|
+
parts.push({
|
|
129
|
+
text: paramMatch[0],
|
|
130
|
+
className: "text-purple-400 bg-purple-500/10 px-0.5 rounded"
|
|
131
|
+
});
|
|
132
|
+
remaining = remaining.slice(paramMatch[0].length);
|
|
133
|
+
} else {
|
|
134
|
+
parts.push({
|
|
135
|
+
text: remaining,
|
|
136
|
+
className: this.getPathClass()
|
|
137
|
+
});
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return parts;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Parse a multiline HTTP request block.
|
|
145
|
+
*
|
|
146
|
+
* Combines the initial request line with continuation lines
|
|
147
|
+
* that form JSON or structured data.
|
|
148
|
+
*
|
|
149
|
+
* @param lines - Array of log lines
|
|
150
|
+
* @returns Parsed entry with HTTP data
|
|
151
|
+
*/
|
|
152
|
+
parseHttpBlock(lines) {
|
|
153
|
+
if (lines.length === 0) return null;
|
|
154
|
+
const firstLine = lines[0];
|
|
155
|
+
const httpData = this.parseLine(firstLine);
|
|
156
|
+
if (!httpData) return null;
|
|
157
|
+
const raw = lines.join("\n");
|
|
158
|
+
return {
|
|
159
|
+
raw,
|
|
160
|
+
formatted: raw,
|
|
161
|
+
level: "info",
|
|
162
|
+
line_number: 0,
|
|
163
|
+
is_stderr: false,
|
|
164
|
+
message: firstLine,
|
|
165
|
+
content_type: "http",
|
|
166
|
+
http_method: httpData.method,
|
|
167
|
+
http_path: httpData.path,
|
|
168
|
+
is_continuation: false
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
//#endregion
|
|
174
|
+
export { HttpLogParser };
|