@mks2508/mks-ui 0.5.4 → 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 +23 -4
  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 +2 -2
  4. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts.map +1 -1
  5. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.js +292 -31
  6. package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts +7 -0
  7. package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts.map +1 -1
  8. package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.js +6 -1
  9. package/dist/react-ui/ui/DynamicToggle/{DynamicToggle-Cm6-VceQ.css → DynamicToggle-DJLwEkHr.css} +116 -51
  10. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.css +116 -51
  11. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts +1 -0
  12. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts.map +1 -1
  13. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.js +9 -3
  14. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts +61 -31
  15. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts.map +1 -1
  16. package/dist/react-ui/ui/DynamicToggle/index.d.ts +9 -3
  17. package/dist/react-ui/ui/DynamicToggle/index.d.ts.map +1 -1
  18. package/dist/react-ui/ui/DynamicToggle/index.js +68 -37
  19. package/package.json +52 -13
  20. package/src/assets/react.svg +0 -1
  21. package/src/core/index.ts +0 -7
  22. package/src/core/types.ts +0 -82
  23. package/src/css.d.ts +0 -7
  24. package/src/index.css +0 -129
  25. package/src/index.ts +0 -29
  26. package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +0 -278
  27. package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +0 -97
  28. package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +0 -155
  29. package/src/react-ui/blocks/Terminal/Terminal.theme.ts +0 -80
  30. package/src/react-ui/blocks/Terminal/Terminal.types.ts +0 -438
  31. package/src/react-ui/blocks/Terminal/TerminalDisplay.styles.ts +0 -38
  32. package/src/react-ui/blocks/Terminal/TerminalDisplay.tsx +0 -254
  33. package/src/react-ui/blocks/Terminal/TerminalDisplay.types.ts +0 -73
  34. package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +0 -269
  35. package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +0 -326
  36. package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +0 -230
  37. package/src/react-ui/blocks/Terminal/XTermAdapter.ts +0 -163
  38. package/src/react-ui/blocks/Terminal/chrome.ts +0 -25
  39. package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +0 -316
  40. package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +0 -218
  41. package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +0 -386
  42. package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +0 -67
  43. package/src/react-ui/blocks/Terminal/components/index.ts +0 -10
  44. package/src/react-ui/blocks/Terminal/display.ts +0 -46
  45. package/src/react-ui/blocks/Terminal/hooks/index.ts +0 -22
  46. package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +0 -229
  47. package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +0 -292
  48. package/src/react-ui/blocks/Terminal/index.ts +0 -111
  49. package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +0 -330
  50. package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +0 -242
  51. package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +0 -202
  52. package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +0 -140
  53. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +0 -68
  54. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +0 -85
  55. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +0 -383
  56. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +0 -439
  57. package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +0 -550
  58. package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +0 -259
  59. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.ts +0 -75
  60. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +0 -266
  61. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +0 -82
  62. package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +0 -112
  63. package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +0 -178
  64. package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +0 -203
  65. package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +0 -252
  66. package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +0 -334
  67. package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +0 -261
  68. package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +0 -248
  69. package/src/react-ui/blocks/Terminal/panel/index.ts +0 -72
  70. package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +0 -59
  71. package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +0 -59
  72. package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +0 -180
  73. package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +0 -248
  74. package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +0 -283
  75. package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +0 -686
  76. package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +0 -466
  77. package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +0 -343
  78. package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +0 -167
  79. package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +0 -348
  80. package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +0 -251
  81. package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +0 -390
  82. package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +0 -320
  83. package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +0 -20
  84. package/src/react-ui/blocks/Terminal/parsing/index.ts +0 -69
  85. package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +0 -68
  86. package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +0 -436
  87. package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +0 -14
  88. package/src/react-ui/blocks/index.ts +0 -11
  89. package/src/react-ui/components/MorphingPopover/MorphingPopover.types.ts +0 -49
  90. package/src/react-ui/components/MorphingPopover/index.tsx +0 -186
  91. package/src/react-ui/components/MorphingPopover/morphing-popover.module.css +0 -153
  92. package/src/react-ui/components/index.ts +0 -9
  93. package/src/react-ui/hooks/Animation/UseAutoHeight.tsx +0 -123
  94. package/src/react-ui/hooks/DOM/UseIsInView.tsx +0 -44
  95. package/src/react-ui/hooks/Formatting/UseListFormat.ts +0 -134
  96. package/src/react-ui/hooks/State/UseControlledState.tsx +0 -57
  97. package/src/react-ui/hooks/State/UseDataState.tsx +0 -76
  98. package/src/react-ui/hooks/index.ts +0 -20
  99. package/src/react-ui/icons/index.ts +0 -12
  100. package/src/react-ui/icons/lucide-animated/activity.tsx +0 -109
  101. package/src/react-ui/icons/lucide-animated/arrow-down-to-line.tsx +0 -51
  102. package/src/react-ui/icons/lucide-animated/arrow-up.tsx +0 -50
  103. package/src/react-ui/icons/lucide-animated/bell-electric.tsx +0 -124
  104. package/src/react-ui/icons/lucide-animated/bell.tsx +0 -93
  105. package/src/react-ui/icons/lucide-animated/bot.tsx +0 -122
  106. package/src/react-ui/icons/lucide-animated/box.tsx +0 -117
  107. package/src/react-ui/icons/lucide-animated/check.tsx +0 -21
  108. package/src/react-ui/icons/lucide-animated/circle-check.tsx +0 -107
  109. package/src/react-ui/icons/lucide-animated/delete.tsx +0 -133
  110. package/src/react-ui/icons/lucide-animated/download.tsx +0 -99
  111. package/src/react-ui/icons/lucide-animated/edit-2.tsx +0 -21
  112. package/src/react-ui/icons/lucide-animated/globe.tsx +0 -23
  113. package/src/react-ui/icons/lucide-animated/home.tsx +0 -103
  114. package/src/react-ui/icons/lucide-animated/index.ts +0 -38
  115. package/src/react-ui/icons/lucide-animated/layers.tsx +0 -23
  116. package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +0 -143
  117. package/src/react-ui/icons/lucide-animated/list.tsx +0 -54
  118. package/src/react-ui/icons/lucide-animated/package.tsx +0 -24
  119. package/src/react-ui/icons/lucide-animated/palette.tsx +0 -25
  120. package/src/react-ui/icons/lucide-animated/plus.tsx +0 -92
  121. package/src/react-ui/icons/lucide-animated/refresh-cw.tsx +0 -24
  122. package/src/react-ui/icons/lucide-animated/rocket.tsx +0 -24
  123. package/src/react-ui/icons/lucide-animated/save.tsx +0 -23
  124. package/src/react-ui/icons/lucide-animated/search.tsx +0 -94
  125. package/src/react-ui/icons/lucide-animated/settings.tsx +0 -92
  126. package/src/react-ui/icons/lucide-animated/terminal.tsx +0 -46
  127. package/src/react-ui/icons/lucide-animated/trash-2.tsx +0 -25
  128. package/src/react-ui/icons/lucide-animated/trending-down.tsx +0 -151
  129. package/src/react-ui/icons/lucide-animated/trending-up.tsx +0 -150
  130. package/src/react-ui/icons/lucide-animated/type.tsx +0 -23
  131. package/src/react-ui/icons/lucide-animated/upload.tsx +0 -23
  132. package/src/react-ui/icons/lucide-animated/x.tsx +0 -102
  133. package/src/react-ui/index.ts +0 -30
  134. package/src/react-ui/lib/get-strict-context.tsx +0 -56
  135. package/src/react-ui/lib/icon-wrapper.tsx +0 -70
  136. package/src/react-ui/lib/index.ts +0 -9
  137. package/src/react-ui/lib/utils.ts +0 -24
  138. package/src/react-ui/primitives/AutoHeight/index.tsx +0 -74
  139. package/src/react-ui/primitives/CountingNumber/index.tsx +0 -147
  140. package/src/react-ui/primitives/Highlight/Highlight.types.ts +0 -136
  141. package/src/react-ui/primitives/Highlight/index.tsx +0 -577
  142. package/src/react-ui/primitives/Slot/index.tsx +0 -128
  143. package/src/react-ui/primitives/index.ts +0 -16
  144. package/src/react-ui/primitives/waapi/Gooey/Gooey.types.ts +0 -123
  145. package/src/react-ui/primitives/waapi/Gooey/GooeyCanvas.tsx +0 -80
  146. package/src/react-ui/primitives/waapi/Gooey/GooeyFilter.tsx +0 -77
  147. package/src/react-ui/primitives/waapi/Gooey/MorphPath.tsx +0 -58
  148. package/src/react-ui/primitives/waapi/Gooey/gooey-utils.ts +0 -244
  149. package/src/react-ui/primitives/waapi/Gooey/index.ts +0 -50
  150. package/src/react-ui/primitives/waapi/Gooey/useMorphPath.ts +0 -48
  151. package/src/react-ui/primitives/waapi/Morph/Morph.types.ts +0 -106
  152. package/src/react-ui/primitives/waapi/Morph/MorphContext.tsx +0 -21
  153. package/src/react-ui/primitives/waapi/Morph/index.tsx +0 -56
  154. package/src/react-ui/primitives/waapi/Morph/techniques/index.ts +0 -12
  155. package/src/react-ui/primitives/waapi/Morph/techniques/useCSSGridMorph.ts +0 -89
  156. package/src/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.ts +0 -176
  157. package/src/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.ts +0 -87
  158. package/src/react-ui/primitives/waapi/Morph/useMorph.ts +0 -101
  159. package/src/react-ui/primitives/waapi/Reorder/Reorder.types.ts +0 -177
  160. package/src/react-ui/primitives/waapi/Reorder/index.tsx +0 -260
  161. package/src/react-ui/primitives/waapi/Reorder/useReorder.ts +0 -47
  162. package/src/react-ui/primitives/waapi/Reorder/useReorderPresence.ts +0 -209
  163. package/src/react-ui/primitives/waapi/Reorder/utils/separatorCoordination.ts +0 -104
  164. package/src/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.ts +0 -14
  165. package/src/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.types.ts +0 -84
  166. package/src/react-ui/primitives/waapi/SlidingNumber/index.tsx +0 -474
  167. package/src/react-ui/primitives/waapi/SlidingText/SlidingText.styles.ts +0 -32
  168. package/src/react-ui/primitives/waapi/SlidingText/SlidingText.types.ts +0 -69
  169. package/src/react-ui/primitives/waapi/SlidingText/index.tsx +0 -140
  170. package/src/react-ui/primitives/waapi/core/animationConstants.ts +0 -215
  171. package/src/react-ui/primitives/waapi/core/index.ts +0 -53
  172. package/src/react-ui/primitives/waapi/core/types.ts +0 -200
  173. package/src/react-ui/primitives/waapi/core/useAnimationOrchestrator.ts +0 -430
  174. package/src/react-ui/primitives/waapi/core/useElementRegistry.ts +0 -81
  175. package/src/react-ui/primitives/waapi/core/useFLIPAnimation.ts +0 -138
  176. package/src/react-ui/primitives/waapi/core/usePositionCapture.ts +0 -106
  177. package/src/react-ui/primitives/waapi/index.ts +0 -139
  178. package/src/react-ui/styles/animations.css +0 -369
  179. package/src/react-ui/ui/Accordion/Accordion.styles.ts +0 -72
  180. package/src/react-ui/ui/Accordion/Accordion.types.ts +0 -199
  181. package/src/react-ui/ui/Accordion/index.tsx +0 -362
  182. package/src/react-ui/ui/AlertDialog/AlertDialog.styles.ts +0 -38
  183. package/src/react-ui/ui/AlertDialog/AlertDialog.types.ts +0 -296
  184. package/src/react-ui/ui/AlertDialog/index.tsx +0 -540
  185. package/src/react-ui/ui/Badge/Badge.styles.ts +0 -43
  186. package/src/react-ui/ui/Badge/Badge.types.ts +0 -26
  187. package/src/react-ui/ui/Badge/index.tsx +0 -34
  188. package/src/react-ui/ui/Button/Button.styles.ts +0 -57
  189. package/src/react-ui/ui/Button/Button.types.ts +0 -63
  190. package/src/react-ui/ui/Button/index.tsx +0 -155
  191. package/src/react-ui/ui/Card/Card.styles.ts +0 -32
  192. package/src/react-ui/ui/Card/Card.types.ts +0 -39
  193. package/src/react-ui/ui/Card/index.tsx +0 -130
  194. package/src/react-ui/ui/Checkbox/Checkbox.styles.ts +0 -40
  195. package/src/react-ui/ui/Checkbox/Checkbox.types.ts +0 -98
  196. package/src/react-ui/ui/Checkbox/index.tsx +0 -233
  197. package/src/react-ui/ui/Combobox/Combobox.styles.ts +0 -34
  198. package/src/react-ui/ui/Combobox/Combobox.types.ts +0 -89
  199. package/src/react-ui/ui/Combobox/index.tsx +0 -331
  200. package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +0 -38
  201. package/src/react-ui/ui/CornerBracket/CornerBracket.types.ts +0 -15
  202. package/src/react-ui/ui/CornerBracket/index.tsx +0 -49
  203. package/src/react-ui/ui/DataCard/DataCard.styles.ts +0 -94
  204. package/src/react-ui/ui/DataCard/DataCard.types.ts +0 -125
  205. package/src/react-ui/ui/DataCard/index.tsx +0 -340
  206. package/src/react-ui/ui/Dialog/Dialog.styles.ts +0 -59
  207. package/src/react-ui/ui/Dialog/Dialog.types.ts +0 -284
  208. package/src/react-ui/ui/Dialog/index.tsx +0 -452
  209. package/src/react-ui/ui/DropdownMenu/DropdownMenu.styles.ts +0 -35
  210. package/src/react-ui/ui/DropdownMenu/DropdownMenu.types.ts +0 -81
  211. package/src/react-ui/ui/DropdownMenu/index.tsx +0 -300
  212. package/src/react-ui/ui/DynamicToggle/DynamicToggle.css +0 -303
  213. package/src/react-ui/ui/DynamicToggle/DynamicToggle.styles.ts +0 -85
  214. package/src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts +0 -174
  215. package/src/react-ui/ui/DynamicToggle/index.tsx +0 -294
  216. package/src/react-ui/ui/DynamicToggle/prototype-v7.html +0 -615
  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,348 +0,0 @@
1
- /**
2
- * Table parser for box-drawing character tables.
3
- *
4
- * Detects and parses tables created with box-drawing characters
5
- * (├─│└┌) commonly found in CLI output.
6
- *
7
- * @module components/devenv/terminal/parsing/TableParser
8
- */
9
-
10
- import type { IParsedLogEntry } from './LogParser.types';
11
-
12
- /**
13
- * Box-drawing characters used for table borders.
14
- * Unicode range: U+2500-U+257F
15
- */
16
- export const TABLE_CHARS = [
17
- '─', '│', '┌', '┐', '└', '┘',
18
- '├', '┤', '┬', '┴', '┼',
19
- '═', '║', '╔', '╗', '╚', '╝',
20
- '╠', '╣', '╦', '╩', '╬',
21
- '╒', '╓', '╕', '╖', '╘', '╙',
22
- '╛', '╜', '╢', '╡', '╤', '╧',
23
- '╟', '╞', '╡', '╢', '╪', '╫',
24
- ] as const;
25
-
26
- /**
27
- * Table row type.
28
- */
29
- export type TTableRowType = 'top' | 'header' | 'separator' | 'data' | 'bottom' | 'unknown';
30
-
31
- /**
32
- * Parsed table row.
33
- */
34
- export interface ITableRow {
35
- /** Raw line */
36
- raw: string;
37
-
38
- /** Row type */
39
- type: TTableRowType;
40
-
41
- /** Cells extracted from the row (for data rows) */
42
- cells?: string[];
43
-
44
- /** Line number */
45
- lineNumber: number;
46
- }
47
-
48
- /**
49
- * Parsed table data.
50
- */
51
- export interface ITableData {
52
- /** All rows in the table */
53
- rows: ITableRow[];
54
-
55
- /** Number of columns */
56
- columnCount: number;
57
-
58
- /** Header row if present */
59
- headers?: string[];
60
-
61
- /** Data rows (excluding borders) */
62
- dataRows: string[][];
63
-
64
- /** Line number of first row */
65
- startLine: number;
66
-
67
- /** Line number of last row */
68
- endLine: number;
69
- }
70
-
71
- /**
72
- * Table parser class.
73
- *
74
- * Detects and parses tables created with box-drawing characters.
75
- * Groups consecutive table lines and extracts cell data.
76
- *
77
- * @example
78
- * ```ts
79
- * const parser = new TableParser();
80
- * const isTable = parser.isTableLine('├──────────┼──────────┤');
81
- * const table = parser.parseTable(lines);
82
- * ```
83
- */
84
- export class TableParser {
85
- /** Minimum box-drawing characters to consider a line a table */
86
- private readonly MIN_TABLE_CHARS = 2;
87
-
88
- /**
89
- * Check if a line is a table line.
90
- *
91
- * A line is considered a table line if it contains multiple
92
- * box-drawing characters.
93
- *
94
- * @param line - Line to check
95
- * @returns true if line is part of a table
96
- */
97
- isTableLine(line: string): boolean {
98
- let count = 0;
99
-
100
- for (const char of TABLE_CHARS) {
101
- if (line.includes(char)) {
102
- count++;
103
- if (count >= this.MIN_TABLE_CHARS) {
104
- return true;
105
- }
106
- }
107
- }
108
-
109
- return count >= this.MIN_TABLE_CHARS;
110
- }
111
-
112
- /**
113
- * Determine the type of a table row.
114
- *
115
- * @param line - Table row line
116
- * @returns Row type
117
- */
118
- getRowType(line: string): TTableRowType {
119
- const trimmed = line.trim();
120
-
121
- // Top border: starts with ┌ or ╒
122
- if (/^[┌╒]/.test(trimmed)) {
123
- return 'top';
124
- }
125
-
126
- // Bottom border: starts with └ or ╘
127
- if (/^[└╘]/.test(trimmed)) {
128
- return 'bottom';
129
- }
130
-
131
- // Separator: contains ├, ┼, ┬, ┴, ╪, ╤, ╧, etc.
132
- if (/[├┼┬┴╪╤╧╠╦╩╬]/.test(trimmed)) {
133
- return 'separator';
134
- }
135
-
136
- // Header separator: usually has ═ or ─
137
- if (/[═]/.test(trimmed) && /[│║]/.test(trimmed)) {
138
- return 'separator';
139
- }
140
-
141
- // Data or header row: contains │ with text
142
- if (/[│║]/.test(trimmed) && /[a-zA-Z0-9]/.test(trimmed)) {
143
- // Check if it looks like a header (all caps or specific patterns)
144
- const content = trimmed.replace(/[│║═─┼┬┴├╪╤╧]/g, ' ').trim();
145
- if (content.length > 0 && content === content.toUpperCase() && content.length < 50) {
146
- return 'header';
147
- }
148
- return 'data';
149
- }
150
-
151
- return 'unknown';
152
- }
153
-
154
- /**
155
- * Extract cells from a table row.
156
- *
157
- * Splits the row by │ characters and trims each cell.
158
- *
159
- * @param line - Table row line
160
- * @returns Array of cell contents
161
- */
162
- extractCells(line: string): string[] {
163
- // Remove border characters and split by │
164
- const cleaned = line.replace(/^[│║]|[│║]$/g, '');
165
- const cells = cleaned.split(/[│║]/);
166
-
167
- return cells.map((cell) => cell.trim()).filter((cell) => cell.length > 0);
168
- }
169
-
170
- /**
171
- * Parse a complete table from an array of lines.
172
- *
173
- * Groups consecutive table lines and extracts structured data.
174
- *
175
- * @param lines - Array of table lines
176
- * @param startLine - Starting line number
177
- * @returns Parsed table data
178
- */
179
- parseTable(lines: string[], startLine: number): ITableData {
180
- const rows: ITableRow[] = [];
181
- const dataRows: string[][] = [];
182
-
183
- for (let i = 0; i < lines.length; i++) {
184
- const line = lines[i];
185
- const type = this.getRowType(line);
186
- const cells = type === 'data' || type === 'header' ? this.extractCells(line) : undefined;
187
-
188
- const row: ITableRow = {
189
- raw: line,
190
- type,
191
- cells,
192
- lineNumber: startLine + i,
193
- };
194
-
195
- rows.push(row);
196
-
197
- if (cells) {
198
- dataRows.push(cells);
199
- }
200
- }
201
-
202
- // Determine column count from the widest row
203
- const columnCount = Math.max(...dataRows.map((r) => r.length), 1);
204
-
205
- // Extract headers if present (first data row that looks like headers)
206
- const headerRow = rows.find((r) => r.type === 'header');
207
- const headers = headerRow?.cells;
208
-
209
- return {
210
- rows,
211
- columnCount,
212
- headers,
213
- dataRows,
214
- startLine,
215
- endLine: startLine + lines.length - 1,
216
- };
217
- }
218
-
219
- /**
220
- * Parse table entries from a log stream.
221
- *
222
- * Scans through lines, grouping table lines into entries.
223
- *
224
- * @param lines - Array of log lines
225
- * @param startLine - Starting line number
226
- * @returns Array of parsed log entries
227
- */
228
- parseTableEntries(lines: string[], startLine: number): IParsedLogEntry[] {
229
- const entries: IParsedLogEntry[] = [];
230
- let inTable = false;
231
- let tableStartLine = 0;
232
- const tableLines: string[] = [];
233
-
234
- for (let i = 0; i < lines.length; i++) {
235
- const line = lines[i];
236
- const isTable = this.isTableLine(line);
237
-
238
- if (isTable && !inTable) {
239
- // Start of a new table
240
- inTable = true;
241
- tableStartLine = startLine + i;
242
- tableLines.push(line);
243
- } else if (isTable && inTable) {
244
- // Continuation of table
245
- tableLines.push(line);
246
- } else if (!isTable && inTable) {
247
- // End of table - create entry
248
- const tableData = this.parseTable(tableLines, tableStartLine);
249
-
250
- entries.push({
251
- raw: tableLines.join('\n'),
252
- formatted: tableLines.join('\n'),
253
- level: 'info',
254
- line_number: tableStartLine,
255
- is_stderr: false,
256
- content_type: 'table',
257
- table_data: tableData,
258
- is_continuation: false,
259
- });
260
-
261
- // Mark continuation lines
262
- for (let j = 1; j < tableLines.length; j++) {
263
- entries.push({
264
- raw: tableLines[j],
265
- formatted: tableLines[j],
266
- level: 'info',
267
- line_number: tableStartLine + j,
268
- is_stderr: false,
269
- content_type: 'table',
270
- is_continuation: true,
271
- parent_line_number: tableStartLine,
272
- });
273
- }
274
-
275
- // Reset state
276
- inTable = false;
277
- tableLines.length = 0;
278
-
279
- // Process current line as normal entry (will be handled by caller)
280
- // Don't add non-table line here - let other parsers handle it
281
- } else {
282
- // Not a table line, not in table - skip (handled by other parsers)
283
- }
284
- }
285
-
286
- // Handle table that ends at the end of the batch
287
- if (tableLines.length > 0) {
288
- const tableData = this.parseTable(tableLines, tableStartLine);
289
-
290
- entries.push({
291
- raw: tableLines.join('\n'),
292
- formatted: tableLines.join('\n'),
293
- level: 'info',
294
- line_number: tableStartLine,
295
- is_stderr: false,
296
- content_type: 'table',
297
- table_data: tableData,
298
- is_continuation: false,
299
- });
300
-
301
- for (let j = 1; j < tableLines.length; j++) {
302
- entries.push({
303
- raw: tableLines[j],
304
- formatted: tableLines[j],
305
- level: 'info',
306
- line_number: tableStartLine + j,
307
- is_stderr: false,
308
- content_type: 'table',
309
- is_continuation: true,
310
- parent_line_number: tableStartLine,
311
- });
312
- }
313
- }
314
-
315
- return entries;
316
- }
317
-
318
- /**
319
- * Get CSS class for a table row type.
320
- *
321
- * @param type - Row type
322
- * @returns CSS class string
323
- */
324
- getRowClass(type: TTableRowType): string {
325
- switch (type) {
326
- case 'top':
327
- case 'bottom':
328
- return 'text-gray-500';
329
- case 'separator':
330
- return 'text-gray-600';
331
- case 'header':
332
- return 'font-semibold text-foreground';
333
- case 'data':
334
- return 'text-foreground';
335
- default:
336
- return 'text-foreground';
337
- }
338
- }
339
- }
340
-
341
- /**
342
- * Create a new table parser instance.
343
- *
344
- * @returns New TableParser instance
345
- */
346
- export function createTableParser(): TableParser {
347
- return new TableParser();
348
- }
@@ -1,251 +0,0 @@
1
- /**
2
- * ANSI color mapper for Synthwave theme integration.
3
- *
4
- * Maps ANSI color codes to Synthwave Industrial Dark theme colors
5
- * from Terminal.theme.ts. Provides utilities for converting between
6
- * different color representations and applying theme-aware coloring.
7
- *
8
- * @module components/devenv/terminal/parsing/ansi/mapper
9
- */
10
-
11
- import { SYNTHWAVE_ANSI_COLORS } from './ansi.constants';
12
- import type { IAnsiStyle } from '../LogParser.types';
13
-
14
- /**
15
- * ANSI color mapper class.
16
- *
17
- * Provides static methods for mapping ANSI color codes to
18
- * Synthwave theme colors and converting between color formats.
19
- */
20
- export class AnsiColorMapper {
21
- /**
22
- * Get hex color for ANSI foreground color code.
23
- *
24
- * Converts ANSI SGR foreground color codes (30-37, 90-97) to
25
- * their corresponding hex colors in the Synthwave theme.
26
- *
27
- * @param code - ANSI color code (e.g., 31 for red, 32 for green)
28
- * @returns Hex color string (e.g., '#ff4466') or undefined if unknown
29
- *
30
- * @example
31
- * ```ts
32
- * const red = AnsiColorMapper.fgColor(31); // '#ff4466'
33
- * const green = AnsiColorMapper.fgColor(32); // '#44ffaa'
34
- * ```
35
- */
36
- static fgColor(code: number): string | undefined {
37
- return SYNTHWAVE_ANSI_COLORS[code];
38
- }
39
-
40
- /**
41
- * Get hex color for ANSI background color code.
42
- *
43
- * Converts ANSI SGR background color codes (40-47, 100-107) to
44
- * their corresponding hex colors by converting to foreground
45
- * code and looking up in theme.
46
- *
47
- * @param code - ANSI background color code (e.g., 41 for red bg)
48
- * @returns Hex color string or undefined if unknown
49
- *
50
- * @example
51
- * ```ts
52
- * const redBg = AnsiColorMapper.bgColor(41); // '#ff4466'
53
- * ```
54
- */
55
- static bgColor(code: number): string | undefined {
56
- // Convert background code (40-47, 100-107) to foreground (30-37, 90-97)
57
- const fgCode = code >= 100 ? code - 10 : code - 10;
58
- return SYNTHWAVE_ANSI_COLORS[fgCode];
59
- }
60
-
61
- /**
62
- * Check if color code is bright variant.
63
- *
64
- * @param code - ANSI color code
65
- * @returns true if code is bright (90-97 or 100-107)
66
- */
67
- static isBright(code: number): boolean {
68
- return (code >= 90 && code <= 97) || (code >= 100 && code <= 107);
69
- }
70
-
71
- /**
72
- * Check if color code is background color.
73
- *
74
- * @param code - ANSI color code
75
- * @returns true if code is background (40-47 or 100-107)
76
- */
77
- static isBackground(code: number): boolean {
78
- return (code >= 40 && code <= 47) || (code >= 100 && code <= 107);
79
- }
80
-
81
- /**
82
- * Convert ANSI style to hex color pair.
83
- *
84
- * Takes a parsed ANSI style and returns foreground and background
85
- * hex colors for use in xterm.js or CSS styling.
86
- *
87
- * @param style - Parsed ANSI style
88
- * @returns Object with fg and bg hex colors (undefined if not set)
89
- *
90
- * @example
91
- * ```ts
92
- * const colors = AnsiColorMapper.styleToHex({
93
- * fg_color: 31,
94
- * bg_color: 44,
95
- * modifiers: ['bold']
96
- * });
97
- * // { fg: '#ff4466', bg: '#00d9ff' }
98
- * ```
99
- */
100
- static styleToHex(style: IAnsiStyle): { fg?: string; bg?: string } {
101
- const result: { fg?: string; bg?: string } = {};
102
-
103
- if (style.fg_color !== undefined) {
104
- result.fg = this.fgColor(style.fg_color);
105
- }
106
-
107
- if (style.bg_color !== undefined) {
108
- result.bg = this.bgColor(style.bg_color);
109
- }
110
-
111
- return result;
112
- }
113
-
114
- /**
115
- * Convert hex color to xterm.js color index.
116
- *
117
- * xterm.js uses a 256-color palette. This method maps Synthwave
118
- * hex colors to the closest xterm.js color index.
119
- *
120
- * @param hex - Hex color string (e.g., '#ff4466')
121
- * @returns xterm.js color index (0-255) or closest match
122
- */
123
- static hexToXtermColor(hex: string): number {
124
- // Map Synthwave colors to xterm.js palette indices
125
- const colorMap: Record<string, number> = {
126
- '#1a1a2e': 0, // Black
127
- '#ff4466': 197, // Red (closest)
128
- '#44ffaa': 84, // Green (closest)
129
- '#ffcc00': 226, // Yellow
130
- '#00d9ff': 87, // Cyan
131
- '#D40C67': 198, // Magenta (closest)
132
- '#e8e8ec': 255, // White
133
- '#2d2d44': 8, // Bright Black
134
- '#ff6b6b': 203, // Bright Red
135
- '#66ffcc': 86, // Bright Green
136
- '#ffdd33': 227, // Bright Yellow
137
- '#33e0ff': 117, // Bright Cyan
138
- '#ff3399': 205, // Bright Magenta
139
- '#ffffff': 15, // Bright White
140
- };
141
-
142
- // Normalize hex
143
- const normalized = hex.toLowerCase();
144
- return colorMap[normalized] ?? 7; // Default to white
145
- }
146
-
147
- /**
148
- * Get log level color as hex.
149
- *
150
- * Returns the Synthwave theme color for a given log level.
151
- *
152
- * @param level - Log level
153
- * @returns Hex color string for the log level
154
- *
155
- * @example
156
- * ```ts
157
- * const errorColor = AnsiColorMapper.logLevelColor('error'); // '#ff4466'
158
- * const infoColor = AnsiColorMapper.logLevelColor('info'); // '#00d9ff'
159
- * ```
160
- */
161
- static logLevelColor(level: string): string {
162
- const levelColors: Record<string, string> = {
163
- trace: '#8b9bb4', // Gray (hsl(240, 10%, 50%))
164
- debug: '#00d9ff', // Cyan (hsl(190, 100%, 50%))
165
- info: '#4db8ff', // Blue (hsl(210, 100%, 60%))
166
- warn: '#ffcc00', // Yellow (hsl(45, 100%, 50%))
167
- error: '#ff4466', // Red (hsl(350, 100%, 63%))
168
- fatal: '#D40C67', // Magenta (hsl(330, 85%, 43%))
169
- unknown: '#e8e8ec', // White
170
- };
171
-
172
- return levelColors[level] ?? levelColors.unknown;
173
- }
174
-
175
- /**
176
- * Get log level background color (semi-transparent).
177
- *
178
- * Returns the background color for log level badges with
179
- * transparency for overlay effects.
180
- *
181
- * @param level - Log level
182
- * @returns RGBA color string for background
183
- *
184
- * @example
185
- * ```ts
186
- * const errorBg = AnsiColorMapper.logLevelBgColor('error'); // 'rgba(255, 68, 102, 0.1)'
187
- * ```
188
- */
189
- static logLevelBgColor(level: string): string {
190
- const hex = this.logLevelColor(level);
191
- // Convert hex to rgba with 10% opacity
192
- const r = parseInt(hex.slice(1, 3), 16);
193
- const g = parseInt(hex.slice(3, 5), 16);
194
- const b = parseInt(hex.slice(5, 7), 16);
195
- return `rgba(${r}, ${g}, ${b}, 0.1)`;
196
- }
197
-
198
- /**
199
- * Create xterm.js color sequence from hex.
200
- *
201
- * Generates xterm.js escape sequence for setting text color
202
- * from a hex color value.
203
- *
204
- * @param hex - Hex color string
205
- * @param isBackground - true for background color, false for foreground
206
- * @returns xterm.js escape sequence
207
- *
208
- * @example
209
- * ```ts
210
- * const seq = AnsiColorMapper.xtermColorSequence('#ff4466', false);
211
- * // '\x1b]4;196;#ff4466\x07' (OSC 4 sequence for true color)
212
- * ```
213
- */
214
- static xtermColorSequence(hex: string, isBackground = false): string {
215
- const prefix = isBackground ? '4' : '10';
216
- return `\x1b]${prefix};#${hex.slice(1)}\x07`;
217
- }
218
-
219
- /**
220
- * Convert RGB values to hex color.
221
- *
222
- * @param r - Red value (0-255)
223
- * @param g - Green value (0-255)
224
- * @param b - Blue value (0-255)
225
- * @returns Hex color string (e.g., '#ff4466')
226
- */
227
- static rgbToHex(r: number, g: number, b: number): string {
228
- const toHex = (n: number): string => {
229
- const hex = Math.round(Math.min(255, Math.max(0, n))).toString(16);
230
- return hex.length === 1 ? '0' + hex : hex;
231
- };
232
- return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
233
- }
234
-
235
- /**
236
- * Convert hex color to RGB values.
237
- *
238
- * @param hex - Hex color string
239
- * @returns Object with r, g, b values (0-255)
240
- */
241
- static hexToRgb(hex: string): { r: number; g: number; b: number } {
242
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
243
- return result
244
- ? {
245
- r: parseInt(result[1], 16),
246
- g: parseInt(result[2], 16),
247
- b: parseInt(result[3], 16),
248
- }
249
- : { r: 255, g: 255, b: 255 };
250
- }
251
- }