@mks2508/mks-ui 0.5.7 → 0.5.8

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.
Files changed (262) hide show
  1. package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts +2 -0
  2. package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts.map +1 -1
  3. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts +1 -1
  4. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts.map +1 -1
  5. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.js +173 -43
  6. package/dist/react-ui/ui/DynamicToggle/{DynamicToggle-DOR3Ld-k.css → DynamicToggle-DJLwEkHr.css} +12 -19
  7. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.css +12 -20
  8. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts +1 -0
  9. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts.map +1 -1
  10. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.js +7 -1
  11. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts +55 -31
  12. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts.map +1 -1
  13. package/dist/react-ui/ui/DynamicToggle/index.d.ts +9 -3
  14. package/dist/react-ui/ui/DynamicToggle/index.d.ts.map +1 -1
  15. package/dist/react-ui/ui/DynamicToggle/index.js +47 -34
  16. package/package.json +52 -13
  17. package/src/assets/react.svg +0 -1
  18. package/src/core/index.ts +0 -7
  19. package/src/core/types.ts +0 -82
  20. package/src/css.d.ts +0 -7
  21. package/src/index.css +0 -129
  22. package/src/index.ts +0 -29
  23. package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +0 -278
  24. package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +0 -97
  25. package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +0 -155
  26. package/src/react-ui/blocks/Terminal/Terminal.theme.ts +0 -80
  27. package/src/react-ui/blocks/Terminal/Terminal.types.ts +0 -438
  28. package/src/react-ui/blocks/Terminal/TerminalDisplay.styles.ts +0 -38
  29. package/src/react-ui/blocks/Terminal/TerminalDisplay.tsx +0 -254
  30. package/src/react-ui/blocks/Terminal/TerminalDisplay.types.ts +0 -73
  31. package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +0 -269
  32. package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +0 -326
  33. package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +0 -230
  34. package/src/react-ui/blocks/Terminal/XTermAdapter.ts +0 -163
  35. package/src/react-ui/blocks/Terminal/chrome.ts +0 -25
  36. package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +0 -316
  37. package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +0 -218
  38. package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +0 -386
  39. package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +0 -67
  40. package/src/react-ui/blocks/Terminal/components/index.ts +0 -10
  41. package/src/react-ui/blocks/Terminal/display.ts +0 -46
  42. package/src/react-ui/blocks/Terminal/hooks/index.ts +0 -22
  43. package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +0 -229
  44. package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +0 -292
  45. package/src/react-ui/blocks/Terminal/index.ts +0 -111
  46. package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +0 -330
  47. package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +0 -242
  48. package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +0 -202
  49. package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +0 -140
  50. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +0 -68
  51. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +0 -85
  52. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +0 -383
  53. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +0 -439
  54. package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +0 -550
  55. package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +0 -259
  56. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.ts +0 -75
  57. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +0 -266
  58. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +0 -82
  59. package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +0 -112
  60. package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +0 -178
  61. package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +0 -203
  62. package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +0 -252
  63. package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +0 -334
  64. package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +0 -261
  65. package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +0 -248
  66. package/src/react-ui/blocks/Terminal/panel/index.ts +0 -72
  67. package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +0 -59
  68. package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +0 -59
  69. package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +0 -180
  70. package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +0 -248
  71. package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +0 -283
  72. package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +0 -686
  73. package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +0 -466
  74. package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +0 -343
  75. package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +0 -167
  76. package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +0 -348
  77. package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +0 -251
  78. package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +0 -390
  79. package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +0 -320
  80. package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +0 -20
  81. package/src/react-ui/blocks/Terminal/parsing/index.ts +0 -69
  82. package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +0 -68
  83. package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +0 -436
  84. package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +0 -14
  85. package/src/react-ui/blocks/index.ts +0 -11
  86. package/src/react-ui/components/MorphingPopover/MorphingPopover.types.ts +0 -49
  87. package/src/react-ui/components/MorphingPopover/index.tsx +0 -186
  88. package/src/react-ui/components/MorphingPopover/morphing-popover.module.css +0 -153
  89. package/src/react-ui/components/index.ts +0 -9
  90. package/src/react-ui/hooks/Animation/UseAutoHeight.tsx +0 -123
  91. package/src/react-ui/hooks/DOM/UseIsInView.tsx +0 -44
  92. package/src/react-ui/hooks/Formatting/UseListFormat.ts +0 -134
  93. package/src/react-ui/hooks/State/UseControlledState.tsx +0 -57
  94. package/src/react-ui/hooks/State/UseDataState.tsx +0 -76
  95. package/src/react-ui/hooks/index.ts +0 -20
  96. package/src/react-ui/icons/index.ts +0 -12
  97. package/src/react-ui/icons/lucide-animated/activity.tsx +0 -109
  98. package/src/react-ui/icons/lucide-animated/arrow-down-to-line.tsx +0 -51
  99. package/src/react-ui/icons/lucide-animated/arrow-up.tsx +0 -50
  100. package/src/react-ui/icons/lucide-animated/bell-electric.tsx +0 -124
  101. package/src/react-ui/icons/lucide-animated/bell.tsx +0 -93
  102. package/src/react-ui/icons/lucide-animated/bot.tsx +0 -122
  103. package/src/react-ui/icons/lucide-animated/box.tsx +0 -117
  104. package/src/react-ui/icons/lucide-animated/check.tsx +0 -21
  105. package/src/react-ui/icons/lucide-animated/circle-check.tsx +0 -107
  106. package/src/react-ui/icons/lucide-animated/delete.tsx +0 -133
  107. package/src/react-ui/icons/lucide-animated/download.tsx +0 -99
  108. package/src/react-ui/icons/lucide-animated/edit-2.tsx +0 -21
  109. package/src/react-ui/icons/lucide-animated/globe.tsx +0 -23
  110. package/src/react-ui/icons/lucide-animated/home.tsx +0 -103
  111. package/src/react-ui/icons/lucide-animated/index.ts +0 -38
  112. package/src/react-ui/icons/lucide-animated/layers.tsx +0 -23
  113. package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +0 -143
  114. package/src/react-ui/icons/lucide-animated/list.tsx +0 -54
  115. package/src/react-ui/icons/lucide-animated/package.tsx +0 -24
  116. package/src/react-ui/icons/lucide-animated/palette.tsx +0 -25
  117. package/src/react-ui/icons/lucide-animated/plus.tsx +0 -92
  118. package/src/react-ui/icons/lucide-animated/refresh-cw.tsx +0 -24
  119. package/src/react-ui/icons/lucide-animated/rocket.tsx +0 -24
  120. package/src/react-ui/icons/lucide-animated/save.tsx +0 -23
  121. package/src/react-ui/icons/lucide-animated/search.tsx +0 -94
  122. package/src/react-ui/icons/lucide-animated/settings.tsx +0 -92
  123. package/src/react-ui/icons/lucide-animated/terminal.tsx +0 -46
  124. package/src/react-ui/icons/lucide-animated/trash-2.tsx +0 -25
  125. package/src/react-ui/icons/lucide-animated/trending-down.tsx +0 -151
  126. package/src/react-ui/icons/lucide-animated/trending-up.tsx +0 -150
  127. package/src/react-ui/icons/lucide-animated/type.tsx +0 -23
  128. package/src/react-ui/icons/lucide-animated/upload.tsx +0 -23
  129. package/src/react-ui/icons/lucide-animated/x.tsx +0 -102
  130. package/src/react-ui/index.ts +0 -30
  131. package/src/react-ui/lib/get-strict-context.tsx +0 -56
  132. package/src/react-ui/lib/icon-wrapper.tsx +0 -70
  133. package/src/react-ui/lib/index.ts +0 -9
  134. package/src/react-ui/lib/utils.ts +0 -24
  135. package/src/react-ui/primitives/AutoHeight/index.tsx +0 -74
  136. package/src/react-ui/primitives/CountingNumber/index.tsx +0 -147
  137. package/src/react-ui/primitives/Highlight/Highlight.types.ts +0 -136
  138. package/src/react-ui/primitives/Highlight/index.tsx +0 -577
  139. package/src/react-ui/primitives/Slot/index.tsx +0 -128
  140. package/src/react-ui/primitives/index.ts +0 -16
  141. package/src/react-ui/primitives/waapi/Gooey/Gooey.types.ts +0 -141
  142. package/src/react-ui/primitives/waapi/Gooey/GooeyCanvas.tsx +0 -217
  143. package/src/react-ui/primitives/waapi/Gooey/GooeyFilter.tsx +0 -77
  144. package/src/react-ui/primitives/waapi/Gooey/MorphPath.tsx +0 -58
  145. package/src/react-ui/primitives/waapi/Gooey/gooey-utils.ts +0 -253
  146. package/src/react-ui/primitives/waapi/Gooey/index.ts +0 -50
  147. package/src/react-ui/primitives/waapi/Gooey/useMorphPath.ts +0 -48
  148. package/src/react-ui/primitives/waapi/Morph/Morph.types.ts +0 -106
  149. package/src/react-ui/primitives/waapi/Morph/MorphContext.tsx +0 -21
  150. package/src/react-ui/primitives/waapi/Morph/index.tsx +0 -56
  151. package/src/react-ui/primitives/waapi/Morph/techniques/index.ts +0 -12
  152. package/src/react-ui/primitives/waapi/Morph/techniques/useCSSGridMorph.ts +0 -89
  153. package/src/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.ts +0 -176
  154. package/src/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.ts +0 -87
  155. package/src/react-ui/primitives/waapi/Morph/useMorph.ts +0 -101
  156. package/src/react-ui/primitives/waapi/Reorder/Reorder.types.ts +0 -177
  157. package/src/react-ui/primitives/waapi/Reorder/index.tsx +0 -260
  158. package/src/react-ui/primitives/waapi/Reorder/useReorder.ts +0 -47
  159. package/src/react-ui/primitives/waapi/Reorder/useReorderPresence.ts +0 -209
  160. package/src/react-ui/primitives/waapi/Reorder/utils/separatorCoordination.ts +0 -104
  161. package/src/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.ts +0 -14
  162. package/src/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.types.ts +0 -84
  163. package/src/react-ui/primitives/waapi/SlidingNumber/index.tsx +0 -474
  164. package/src/react-ui/primitives/waapi/SlidingText/SlidingText.styles.ts +0 -32
  165. package/src/react-ui/primitives/waapi/SlidingText/SlidingText.types.ts +0 -69
  166. package/src/react-ui/primitives/waapi/SlidingText/index.tsx +0 -140
  167. package/src/react-ui/primitives/waapi/core/animationConstants.ts +0 -215
  168. package/src/react-ui/primitives/waapi/core/index.ts +0 -53
  169. package/src/react-ui/primitives/waapi/core/types.ts +0 -200
  170. package/src/react-ui/primitives/waapi/core/useAnimationOrchestrator.ts +0 -430
  171. package/src/react-ui/primitives/waapi/core/useElementRegistry.ts +0 -81
  172. package/src/react-ui/primitives/waapi/core/useFLIPAnimation.ts +0 -138
  173. package/src/react-ui/primitives/waapi/core/usePositionCapture.ts +0 -106
  174. package/src/react-ui/primitives/waapi/index.ts +0 -139
  175. package/src/react-ui/styles/animations.css +0 -369
  176. package/src/react-ui/ui/Accordion/Accordion.styles.ts +0 -72
  177. package/src/react-ui/ui/Accordion/Accordion.types.ts +0 -199
  178. package/src/react-ui/ui/Accordion/index.tsx +0 -362
  179. package/src/react-ui/ui/AlertDialog/AlertDialog.styles.ts +0 -38
  180. package/src/react-ui/ui/AlertDialog/AlertDialog.types.ts +0 -296
  181. package/src/react-ui/ui/AlertDialog/index.tsx +0 -540
  182. package/src/react-ui/ui/Badge/Badge.styles.ts +0 -43
  183. package/src/react-ui/ui/Badge/Badge.types.ts +0 -26
  184. package/src/react-ui/ui/Badge/index.tsx +0 -34
  185. package/src/react-ui/ui/Button/Button.styles.ts +0 -57
  186. package/src/react-ui/ui/Button/Button.types.ts +0 -63
  187. package/src/react-ui/ui/Button/index.tsx +0 -155
  188. package/src/react-ui/ui/Card/Card.styles.ts +0 -32
  189. package/src/react-ui/ui/Card/Card.types.ts +0 -39
  190. package/src/react-ui/ui/Card/index.tsx +0 -130
  191. package/src/react-ui/ui/Checkbox/Checkbox.styles.ts +0 -40
  192. package/src/react-ui/ui/Checkbox/Checkbox.types.ts +0 -98
  193. package/src/react-ui/ui/Checkbox/index.tsx +0 -233
  194. package/src/react-ui/ui/Combobox/Combobox.styles.ts +0 -34
  195. package/src/react-ui/ui/Combobox/Combobox.types.ts +0 -89
  196. package/src/react-ui/ui/Combobox/index.tsx +0 -331
  197. package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +0 -38
  198. package/src/react-ui/ui/CornerBracket/CornerBracket.types.ts +0 -15
  199. package/src/react-ui/ui/CornerBracket/index.tsx +0 -49
  200. package/src/react-ui/ui/DataCard/DataCard.styles.ts +0 -94
  201. package/src/react-ui/ui/DataCard/DataCard.types.ts +0 -125
  202. package/src/react-ui/ui/DataCard/index.tsx +0 -340
  203. package/src/react-ui/ui/Dialog/Dialog.styles.ts +0 -59
  204. package/src/react-ui/ui/Dialog/Dialog.types.ts +0 -284
  205. package/src/react-ui/ui/Dialog/index.tsx +0 -452
  206. package/src/react-ui/ui/DropdownMenu/DropdownMenu.styles.ts +0 -35
  207. package/src/react-ui/ui/DropdownMenu/DropdownMenu.types.ts +0 -81
  208. package/src/react-ui/ui/DropdownMenu/index.tsx +0 -300
  209. package/src/react-ui/ui/DynamicToggle/DynamicToggle.css +0 -376
  210. package/src/react-ui/ui/DynamicToggle/DynamicToggle.styles.ts +0 -85
  211. package/src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts +0 -180
  212. package/src/react-ui/ui/DynamicToggle/index.tsx +0 -316
  213. package/src/react-ui/ui/DynamicToggle/prototype-v7-ios.html +0 -413
  214. package/src/react-ui/ui/DynamicToggle/prototype-v7.html +0 -615
  215. package/src/react-ui/ui/DynamicToggle/prototype-v8-gooey-safari.html +0 -560
  216. package/src/react-ui/ui/DynamicToggle/prototype-v8b-react-structure.html +0 -227
  217. package/src/react-ui/ui/DynamicToggle/prototype.html +0 -419
  218. package/src/react-ui/ui/Field/Field.styles.ts +0 -47
  219. package/src/react-ui/ui/Field/Field.types.ts +0 -60
  220. package/src/react-ui/ui/Field/index.tsx +0 -254
  221. package/src/react-ui/ui/Input/Input.styles.ts +0 -11
  222. package/src/react-ui/ui/Input/Input.types.ts +0 -10
  223. package/src/react-ui/ui/Input/index.tsx +0 -32
  224. package/src/react-ui/ui/InputGroup/InputGroup.styles.ts +0 -53
  225. package/src/react-ui/ui/InputGroup/InputGroup.types.ts +0 -44
  226. package/src/react-ui/ui/InputGroup/index.tsx +0 -149
  227. package/src/react-ui/ui/Label/Label.styles.ts +0 -10
  228. package/src/react-ui/ui/Label/Label.types.ts +0 -9
  229. package/src/react-ui/ui/Label/index.tsx +0 -27
  230. package/src/react-ui/ui/Menu/Menu.styles.ts +0 -71
  231. package/src/react-ui/ui/Menu/Menu.types.ts +0 -425
  232. package/src/react-ui/ui/Menu/index.tsx +0 -900
  233. package/src/react-ui/ui/Popover/Popover.styles.ts +0 -55
  234. package/src/react-ui/ui/Popover/Popover.types.ts +0 -261
  235. package/src/react-ui/ui/Popover/index.tsx +0 -422
  236. package/src/react-ui/ui/Progress/Progress.styles.ts +0 -36
  237. package/src/react-ui/ui/Progress/Progress.types.ts +0 -162
  238. package/src/react-ui/ui/Progress/index.tsx +0 -254
  239. package/src/react-ui/ui/Select/Select.styles.ts +0 -30
  240. package/src/react-ui/ui/Select/Select.types.ts +0 -51
  241. package/src/react-ui/ui/Select/index.tsx +0 -225
  242. package/src/react-ui/ui/Separator/Separator.styles.ts +0 -10
  243. package/src/react-ui/ui/Separator/Separator.types.ts +0 -10
  244. package/src/react-ui/ui/Separator/index.tsx +0 -37
  245. package/src/react-ui/ui/Switch/Switch.styles.ts +0 -50
  246. package/src/react-ui/ui/Switch/Switch.types.ts +0 -155
  247. package/src/react-ui/ui/Switch/index.tsx +0 -253
  248. package/src/react-ui/ui/Tabs/Tabs.css +0 -39
  249. package/src/react-ui/ui/Tabs/Tabs.styles.ts +0 -148
  250. package/src/react-ui/ui/Tabs/Tabs.types.ts +0 -255
  251. package/src/react-ui/ui/Tabs/index.tsx +0 -529
  252. package/src/react-ui/ui/TextFlow/TextFlow.styles.ts +0 -36
  253. package/src/react-ui/ui/TextFlow/TextFlow.types.ts +0 -118
  254. package/src/react-ui/ui/TextFlow/index.tsx +0 -276
  255. package/src/react-ui/ui/Textarea/Textarea.styles.ts +0 -10
  256. package/src/react-ui/ui/Textarea/Textarea.types.ts +0 -9
  257. package/src/react-ui/ui/Textarea/index.tsx +0 -27
  258. package/src/react-ui/ui/Tooltip/Tooltip.styles.ts +0 -43
  259. package/src/react-ui/ui/Tooltip/Tooltip.types.ts +0 -253
  260. package/src/react-ui/ui/Tooltip/index.tsx +0 -394
  261. package/src/react-ui/ui/index.ts +0 -41
  262. package/src/types/css-modules.d.ts +0 -18
@@ -1,180 +0,0 @@
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
-
10
- import type { TLogLevel } from './LogParser.types';
11
-
12
- /**
13
- * ANSI color combinations for badges.
14
- *
15
- * Uses standard 16-color palette for maximum compatibility.
16
- */
17
- const BADGE_COLORS = {
18
- info: '\x1b[44m\x1b[97m', // Blue bg, bright white fg
19
- warn: '\x1b[43m\x1b[30m', // Yellow bg, black fg
20
- error: '\x1b[41m\x1b[97m', // Red bg, bright white fg
21
- debug: '\x1b[46m\x1b[30m', // Cyan bg, black fg
22
- fatal: '\x1b[45m\x1b[97m', // Magenta bg, bright white fg
23
- trace: '\x1b[47m\x1b[30m', // White bg, black fg
24
- unknown: '\x1b[47m\x1b[30m', // White bg, black fg
25
- } as const;
26
-
27
- /**
28
- * Tag badge colors (cyan on gray).
29
- */
30
- const TAG_COLORS = '\x1b[90m\x1b[36m'; // Dim bg, cyan fg
31
-
32
- /**
33
- * Timestamp colors (gray).
34
- */
35
- const TIMESTAMP_COLORS = '\x1b[90m\x1b[37m'; // Dim bg, white fg
36
-
37
- /**
38
- * Reset code.
39
- */
40
- const RESET = '\x1b[0m';
41
-
42
- /**
43
- * Bold modifier.
44
- */
45
- const BOLD = '\x1b[1m';
46
-
47
- /**
48
- * Level badge icons.
49
- */
50
- const LEVEL_ICONS: Record<TLogLevel, string> = {
51
- info: 'I',
52
- warn: 'W',
53
- error: 'E',
54
- fatal: 'F',
55
- debug: 'D',
56
- trace: 'T',
57
- unknown: '?',
58
- };
59
-
60
- /**
61
- * Badge formatter class.
62
- *
63
- * Creates simple ANSI badges for log levels, tags, and timestamps.
64
- *
65
- * @example
66
- * ```ts
67
- * const formatter = new BadgeFormatter();
68
- * const infoBadge = formatter.createLevelBadge('info');
69
- * // Returns: '\x1b[1m\x1b[44m\x1b[97m[ INFO ]\x1b[0m'
70
- * ```
71
- */
72
- export class BadgeFormatter {
73
- /**
74
- * Create a level badge.
75
- *
76
- * Badge format: [ INFO ] with background color
77
- *
78
- * @param level - Log level
79
- * @returns ANSI-formatted level badge string
80
- */
81
- createLevelBadge(level: TLogLevel): string {
82
- const colors = BADGE_COLORS[level] ?? BADGE_COLORS.unknown;
83
- const icon = LEVEL_ICONS[level] ?? LEVEL_ICONS.unknown;
84
- const label = level.toUpperCase().padEnd(4); // "INFO", "WARN", etc.
85
-
86
- // Badge: [INFO] with background color
87
- return `${BOLD}${colors}[${icon}${label}]${RESET}`;
88
- }
89
-
90
- /**
91
- * Create a timestamp badge for end of line.
92
- *
93
- * Badge format: " 22:55:20" aligned to right
94
- *
95
- * @param timestamp - Display timestamp string
96
- * @returns ANSI-formatted timestamp string
97
- */
98
- createTimestampBadge(timestamp: string): string {
99
- if (!timestamp) return '';
100
-
101
- // Truncate to HH:MM:SS format for consistent width
102
- const timeOnly = timestamp.includes('.')
103
- ? timestamp.split('.')[0] // 22:55:20.916 -> 22:55:20
104
- : timestamp;
105
-
106
- // Pad to 12 chars for right alignment visual
107
- const padded = timeOnly.padStart(12);
108
-
109
- return `${TIMESTAMP_COLORS}${padded}${RESET}`;
110
- }
111
-
112
- /**
113
- * Create a tag badge.
114
- *
115
- * Badge format: [TAG] with subtle styling
116
- *
117
- * @param tag - Tag string
118
- * @returns ANSI-formatted tag badge string
119
- */
120
- createTagBadge(tag: string): string {
121
- // Truncate long tags
122
- const displayTag = tag.length > 12 ? tag.slice(0, 9) + '...' : tag;
123
-
124
- return `${TAG_COLORS}[${displayTag}]${RESET}`;
125
- }
126
-
127
- /**
128
- * Create multiple tag badges joined with space.
129
- *
130
- * @param tags - Array of tag strings
131
- * @returns ANSI-formatted tag badges string
132
- */
133
- createTagBadges(tags: string[]): string {
134
- if (!tags || tags.length === 0) return '';
135
- return tags.map(tag => this.createTagBadge(tag)).join('');
136
- }
137
-
138
- /**
139
- * Create a status indicator.
140
- *
141
- * @param status - Status type
142
- * @returns ANSI-formatted status indicator
143
- */
144
- createStatusIndicator(status: 'success' | 'warning' | 'error' | 'info'): string {
145
- const colors = {
146
- success: '\x1b[42m\x1b[97m', // Green
147
- warning: '\x1b[43m\x1b[30m', // Yellow
148
- error: '\x1b[41m\x1b[97m', // Red
149
- info: '\x1b[44m\x1b[97m', // Blue
150
- } as const;
151
-
152
- const symbols = {
153
- success: '✓',
154
- warning: '⚠',
155
- error: '✖',
156
- info: 'i',
157
- } as const;
158
-
159
- return `${colors[status]} ${symbols[status]} ${RESET}`;
160
- }
161
-
162
- /**
163
- * Create a box badge (multi-line).
164
- *
165
- * @param text - Text to display
166
- * @param level - Log level for color
167
- * @returns Multi-line ANSI box
168
- */
169
- createBoxBadge(text: string, level: TLogLevel = 'info'): string {
170
- const colors = BADGE_COLORS[level] ?? BADGE_COLORS.unknown;
171
- const padding = 2;
172
- const width = text.length + padding * 2 + 2;
173
-
174
- const topBorder = `\x1b[90m┌${'─'.repeat(width)}┐${RESET}`;
175
- const middle = `${colors}│${' '.repeat(padding)}${text}${' '.repeat(padding)}│${RESET}`;
176
- const bottomBorder = `\x1b[90m└${'─'.repeat(width)}┘${RESET}`;
177
-
178
- return `${topBorder}\r\n${middle}\r\n${bottomBorder}`;
179
- }
180
- }
@@ -1,248 +0,0 @@
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
-
10
- import type { IParsedLogEntry } from './LogParser.types';
11
-
12
- /**
13
- * HTTP method enumeration.
14
- */
15
- export type THttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE';
16
-
17
- /**
18
- * Parsed HTTP request data.
19
- */
20
- export interface IHttpParsedData {
21
- /** HTTP method */
22
- method: THttpMethod;
23
-
24
- /** Request path/route */
25
- path: string;
26
-
27
- /** Query parameters extracted from path */
28
- params?: Record<string, string>;
29
-
30
- /** Whether request opens a multiline block (has brace) */
31
- opensMultiline: boolean;
32
- }
33
-
34
- /**
35
- * HTTP log parser class.
36
- *
37
- * Detects HTTP requests in log lines and extracts structured data.
38
- * Supports various log formats:
39
- *
40
- * - `GET /api/endpoint`
41
- * - `GET /api/endpoint/:param {`
42
- * - `POST /api/users HTTP/1.1`
43
- *
44
- * @example
45
- * ```ts
46
- * const parser = new HttpLogParser();
47
- * const parsed = parser.parseLine('GET /api/logs/containers/:name/stream {');
48
- * // parsed.method = 'GET'
49
- * // parsed.path = '/api/logs/containers/:name/stream'
50
- * // parsed.opensMultiline = true
51
- * ```
52
- */
53
- export class HttpLogParser {
54
- /** HTTP method pattern */
55
- private readonly HTTP_PATTERN = /^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS|CONNECT|TRACE)\s+(.+?)(?:\s+(\{))?$/i;
56
-
57
- /** URL path with parameters pattern */
58
- private readonly PATH_PARAM_PATTERN = /:([a-zA-Z_][a-zA-Z0-9_]*)/g;
59
-
60
- /**
61
- * Parse a log line for HTTP request data.
62
- *
63
- * @param line - Log line to parse
64
- * @returns Parsed HTTP data or null if not an HTTP line
65
- */
66
- parseLine(line: string): IHttpParsedData | null {
67
- const match = line.match(this.HTTP_PATTERN);
68
- if (!match) return null;
69
-
70
- const [, method, path, hasBrace] = match;
71
-
72
- return {
73
- method: method.toUpperCase() as THttpMethod,
74
- path: path.trim(),
75
- params: this.extractPathParams(path),
76
- opensMultiline: hasBrace === '{',
77
- };
78
- }
79
-
80
- /**
81
- * Check if a line is an HTTP request line.
82
- *
83
- * @param line - Line to check
84
- * @returns true if line is an HTTP request
85
- */
86
- isHttpLine(line: string): boolean {
87
- return this.HTTP_PATTERN.test(line);
88
- }
89
-
90
- /**
91
- * Extract path parameters from a route path.
92
- *
93
- * @param path - Route path (e.g., `/api/users/:id`)
94
- * @returns Object with parameter names
95
- */
96
- extractPathParams(path: string): Record<string, string> | undefined {
97
- const matches = path.matchAll(this.PATH_PARAM_PATTERN);
98
- const params: Record<string, string> = {};
99
-
100
- for (const match of matches) {
101
- params[match[1]] = `:${match[1]}`;
102
- }
103
-
104
- return Object.keys(params).length > 0 ? params : undefined;
105
- }
106
-
107
- /**
108
- * Format HTTP method with syntax highlighting class.
109
- *
110
- * @param _method - HTTP method
111
- * @returns CSS class for highlighting
112
- */
113
- getMethodClass(_method: THttpMethod): string {
114
- // All methods get the same pink color
115
- return 'text-pink-400 font-semibold';
116
- }
117
-
118
- /**
119
- * Format path with syntax highlighting.
120
- *
121
- * @param path - Request path
122
- * @returns CSS class for path highlighting
123
- */
124
- getPathClass(): string {
125
- return 'text-cyan-400';
126
- }
127
-
128
- /**
129
- * Highlight an HTTP request line.
130
- *
131
- * Returns an array of parts with their associated CSS classes.
132
- *
133
- * @param line - HTTP request line
134
- * @returns Array of {text, className} parts
135
- */
136
- highlightLine(line: string): Array<{ text: string; className?: string }> {
137
- const parts: Array<{ text: string; className?: string }> = [];
138
-
139
- const match = line.match(this.HTTP_PATTERN);
140
- if (!match) {
141
- return [{ text: line }];
142
- }
143
-
144
- const [fullMatch, method, path, hasBrace] = match;
145
- const beforeMethod = line.indexOf(fullMatch);
146
-
147
- // Text before the HTTP request (timestamp, level, etc)
148
- if (beforeMethod > 0) {
149
- parts.push({ text: line.slice(0, beforeMethod) });
150
- }
151
-
152
- // HTTP method
153
- parts.push({
154
- text: method.toUpperCase(),
155
- className: this.getMethodClass(method as THttpMethod),
156
- });
157
-
158
- // Space after method
159
- parts.push({ text: ' ' });
160
-
161
- // Path - highlight segments
162
- const pathParts = this.highlightPath(path.trim());
163
- parts.push(...pathParts);
164
-
165
- // Opening brace if present
166
- if (hasBrace) {
167
- parts.push({
168
- text: ' {',
169
- className: 'text-yellow-500',
170
- });
171
- }
172
-
173
- return parts;
174
- }
175
-
176
- /**
177
- * Highlight path segments (routes and parameters).
178
- *
179
- * @param path - Path string
180
- * @returns Highlighted parts
181
- * @private
182
- */
183
- private highlightPath(path: string): Array<{ text: string; className?: string }> {
184
- const parts: Array<{ text: string; className?: string }> = [];
185
- let remaining = path;
186
-
187
- while (remaining.length > 0) {
188
- // Find next path parameter
189
- const paramMatch = remaining.match(/^\/?:([a-zA-Z_][a-zA-Z0-9_]*)/);
190
-
191
- if (paramMatch) {
192
- // Text before parameter (path segments)
193
- const beforeParam = remaining.slice(0, paramMatch.index);
194
- if (beforeParam.length > 0) {
195
- parts.push({ text: beforeParam, className: this.getPathClass() });
196
- }
197
-
198
- // Parameter
199
- parts.push({
200
- text: paramMatch[0],
201
- className: 'text-purple-400 bg-purple-500/10 px-0.5 rounded',
202
- });
203
-
204
- remaining = remaining.slice(paramMatch[0].length);
205
- } else {
206
- // No more parameters, add remaining text
207
- parts.push({ text: remaining, className: this.getPathClass() });
208
- break;
209
- }
210
- }
211
-
212
- return parts;
213
- }
214
-
215
- /**
216
- * Parse a multiline HTTP request block.
217
- *
218
- * Combines the initial request line with continuation lines
219
- * that form JSON or structured data.
220
- *
221
- * @param lines - Array of log lines
222
- * @returns Parsed entry with HTTP data
223
- */
224
- parseHttpBlock(lines: string[]): IParsedLogEntry | null {
225
- if (lines.length === 0) return null;
226
-
227
- const firstLine = lines[0];
228
- const httpData = this.parseLine(firstLine);
229
-
230
- if (!httpData) return null;
231
-
232
- // Combine all lines into the raw text
233
- const raw = lines.join('\n');
234
-
235
- return {
236
- raw,
237
- formatted: raw,
238
- level: 'info',
239
- line_number: 0, // Set by caller
240
- is_stderr: false,
241
- message: firstLine,
242
- content_type: 'http',
243
- http_method: httpData.method,
244
- http_path: httpData.path,
245
- is_continuation: false,
246
- };
247
- }
248
- }
@@ -1,283 +0,0 @@
1
- /**
2
- * Log parser types for terminal log processing.
3
- *
4
- * Provides interfaces and types for parsing raw log strings into
5
- * structured, formatted output with ANSI colorization, log level detection,
6
- * timestamp extraction, and structured data handling.
7
- *
8
- * @module components/devenv/terminal/parsing/types
9
- */
10
-
11
- /**
12
- * Log level enumeration matching common logging frameworks.
13
- *
14
- * Ordered from least to most severe for filtering operations.
15
- * Maps to Synthwave design system colors:
16
- * - trace: gray (hsl(240, 10%, 50%))
17
- * - debug: cyan (hsl(190, 100%, 50%))
18
- * - info: blue (hsl(210, 100%, 60%))
19
- * - warn: yellow (hsl(45, 100%, 50%))
20
- * - error: red (hsl(350, 100%, 63%))
21
- * - fatal: magenta (hsl(330, 85%, 43%))
22
- */
23
- export type TLogLevel =
24
- | 'trace'
25
- | 'debug'
26
- | 'info'
27
- | 'warn'
28
- | 'error'
29
- | 'fatal'
30
- | 'unknown';
31
-
32
- /**
33
- * Content type for specialized syntax highlighting.
34
- */
35
- export type TContentType = 'plain' | 'http' | 'json' | 'table' | 'error';
36
-
37
- /**
38
- * Filter type for log level filtering.
39
- *
40
- * Extends TLogLevel to include 'all' for showing all logs.
41
- */
42
- export type TLogLevelFilter = TLogLevel | 'all';
43
-
44
- /**
45
- * Parsed log entry representing a single line from a log stream.
46
- *
47
- * Contains the original raw text along with parsed metadata including
48
- * formatted text with ANSI codes, detected log level, timestamp, and
49
- * any structured data extracted from JSON logs.
50
- */
51
- export interface IParsedLogEntry {
52
- /** Original raw text from log stream */
53
- raw: string;
54
-
55
- /** Parsed and formatted text with ANSI escape codes for xterm.js */
56
- formatted: string;
57
-
58
- /** Detected log level based on pattern matching */
59
- level: TLogLevel;
60
-
61
- /** ISO 8601 timestamp if present in the log line */
62
- timestamp?: string;
63
-
64
- /** Display-formatted timestamp (time, date, or relative) */
65
- timestamp_display?: string;
66
-
67
- /** Line number in the stream (1-indexed) */
68
- line_number: number;
69
-
70
- /** Whether this line is from stderr (vs stdout) */
71
- is_stderr: boolean;
72
-
73
- /** Structured data if log line contains valid JSON */
74
- structured?: Record<string, unknown>;
75
-
76
- /** Detected components/tags (e.g., ⦗COMPONENT⦘ ⦗LOGSROUTES⦘) */
77
- tags?: string[];
78
-
79
- /** Message content after removing metadata */
80
- message?: string;
81
-
82
- /** Whether this line is a continuation of a multiline JSON/structured entry */
83
- is_continuation?: boolean;
84
-
85
- /** Line number of parent entry if this is a continuation line */
86
- parent_line_number?: number;
87
-
88
- /** Content type for specialized syntax highlighting */
89
- content_type?: TContentType;
90
-
91
- /** HTTP method if this is an HTTP request line */
92
- http_method?: string;
93
-
94
- /** HTTP path if this is an HTTP request line */
95
- http_path?: string;
96
-
97
- /** Table data if this is part of a table */
98
- table_data?: unknown;
99
- }
100
-
101
- /**
102
- * Parser state for incremental parsing of streaming logs.
103
- *
104
- * Maintains buffer and context between chunks for proper
105
- * multiline log aggregation.
106
- */
107
- export interface IParserState {
108
- /** Incomplete multiline log buffer */
109
- buffer: string;
110
-
111
- /** Current line number (continues across chunks) */
112
- line_number: number;
113
-
114
- /** Last detected level (for multiline continuation) */
115
- last_level: TLogLevel;
116
-
117
- /** Last detected timestamp (for multiline continuation) */
118
- last_timestamp?: string;
119
-
120
- /** Multiline aggregation state (persists across chunks) */
121
- multiline_state?: {
122
- /** Whether currently in multiline mode */
123
- isMultiline: boolean;
124
- /** Parent entry for continuation lines */
125
- parentEntry?: {
126
- line_number: number;
127
- level: TLogLevel;
128
- };
129
- /** Current depth of nested braces/brackets */
130
- depth: number;
131
- /** Expected closing character */
132
- expectedClose?: '}' | ']';
133
- };
134
- }
135
-
136
- /**
137
- * ANSI style information extracted from escape codes.
138
- *
139
- * Represents parsed ANSI SGR (Select Graphic Rendition) sequences
140
- * for color and text styling.
141
- */
142
- export interface IAnsiStyle {
143
- /** Foreground color code (30-37, 90-97) or undefined */
144
- fg_color?: number;
145
-
146
- /** Background color code (40-47, 100-107) or undefined */
147
- bg_color?: number;
148
-
149
- /** Text modifiers: bold, dim, italic, underline, blink, inverse, hidden */
150
- modifiers: string[];
151
-
152
- /** Index in the styles array (for tracking order) */
153
- index?: number;
154
- }
155
-
156
- /**
157
- * ANSI parse result with converted text and extracted styles.
158
- *
159
- * Result of parsing ANSI escape codes from a text string.
160
- */
161
- export interface IAnsiParseResult {
162
- /** Text with ANSI codes converted to xterm.js format */
163
- text: string;
164
-
165
- /** Detected styles (for potential CSS mapping) */
166
- styles: IAnsiStyle[];
167
- }
168
-
169
- /**
170
- * Log level detection result with confidence scoring.
171
- *
172
- * Provides the detected level along with metadata about
173
- * the match for filtering and display purposes.
174
- */
175
- export interface ILogLevelDetection {
176
- /** Detected log level */
177
- level: TLogLevel;
178
-
179
- /** Confidence score (0-1, higher = more certain) */
180
- confidence: number;
181
-
182
- /** Matched string that triggered the detection */
183
- matched: string;
184
-
185
- /** Position of match in the string (0-indexed) */
186
- position: number;
187
- }
188
-
189
- /**
190
- * Log parser options for customization.
191
- *
192
- * Configuration options for the LogParserService to customize
193
- * parsing behavior for different log formats.
194
- */
195
- export interface ILogParserOptions {
196
- /** Enable ANSI escape code parsing (default: true) */
197
- enable_ansi?: boolean;
198
-
199
- /** Timestamp format for display (default: 'time') */
200
- timestamp_format?: 'full' | 'time' | 'relative' | 'none';
201
-
202
- /** Custom log level pattern overrides */
203
- level_patterns?: Partial<Record<TLogLevel, RegExp>>;
204
-
205
- /** Whether to detect and parse JSON structured logs (default: true) */
206
- enable_structured?: boolean;
207
-
208
- /** Whether to extract tags from log lines (default: true) */
209
- enable_tags?: boolean;
210
-
211
- /** Maximum line length before truncation (default: 10000) */
212
- max_line_length?: number;
213
- }
214
-
215
- /**
216
- * Log filter options for filtering parsed entries.
217
- *
218
- * Options for filtering log entries by level, time range, or content.
219
- */
220
- export interface ILogFilterOptions {
221
- /** Minimum log level to include (trace is most permissive) */
222
- min_level?: TLogLevel;
223
-
224
- /** Only include logs after this timestamp (ISO string) */
225
- after?: string;
226
-
227
- /** Only include logs before this timestamp (ISO string) */
228
- before?: string;
229
-
230
- /** Only include logs matching this regex pattern */
231
- pattern?: RegExp;
232
-
233
- /** Only include logs from stderr (if true) or stdout (if false) */
234
- stderr_only?: boolean;
235
-
236
- /** Only include logs containing specific tags */
237
- tags?: string[];
238
- }
239
-
240
- /**
241
- * Timestamp format options for display.
242
- */
243
- export type TTimestampFormat = 'full' | 'time' | 'relative' | 'none';
244
-
245
- /**
246
- * Log statistics for a collection of entries.
247
- *
248
- * Aggregate statistics about log entries for display in
249
- * status bars and footers.
250
- */
251
- export interface ILogStats {
252
- /** Total number of log entries */
253
- total: number;
254
-
255
- /** Count per log level */
256
- by_level: Partial<Record<TLogLevel, number>>;
257
-
258
- /** Total bytes (raw text size) */
259
- bytes: number;
260
-
261
- /** Earliest timestamp (ISO string) */
262
- earliest?: string;
263
-
264
- /** Latest timestamp (ISO string) */
265
- latest?: string;
266
- }
267
-
268
- /**
269
- * Log export options for downloading logs.
270
- */
271
- export interface ILogExportOptions {
272
- /** Format for export */
273
- format: 'raw' | 'json' | 'csv';
274
-
275
- /** Whether to include ANSI codes in raw export */
276
- include_ansi?: boolean;
277
-
278
- /** Filter options to apply before export */
279
- filter?: ILogFilterOptions;
280
-
281
- /** Filename for download (without extension) */
282
- filename?: string;
283
- }