@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,330 +0,0 @@
1
- /**
2
- * Log lines viewer component (React mode).
3
- *
4
- * Displays parsed log entries with React components for:
5
- * - Level badges with CSS styling
6
- * - Syntax highlighted spans
7
- * - Timestamps right-aligned
8
- * - Virtual scrolling with @tanstack/react-virtual
9
- * - Auto-scroll to bottom when following logs
10
- *
11
- * @module components/devenv/terminal/panel/LogLinesViewer
12
- */
13
-
14
- 'use client';
15
-
16
- import { useMemo, useRef, useEffect, memo } from 'react';
17
- import { useVirtualizer } from '@tanstack/react-virtual';
18
- import type { IParsedLogEntry, TLogLevel } from '../parsing';
19
- import {
20
- LevelBadge,
21
- ContentTypeBadge,
22
- TagBadges,
23
- TimestampBadge,
24
- } from '../components/LogLineBadges';
25
- import { SyntaxHighlightedText } from '../components/SyntaxHighlight';
26
- import { SpecializedSyntaxHighlighter } from '../components/SpecializedSyntaxHighlighter';
27
- import { cn } from '@/react-ui/lib/utils';
28
-
29
- /**
30
- * Props for LogLinesViewer component.
31
- */
32
- export interface ILogLinesViewerProps {
33
- /** Parsed log entries to display */
34
- entries: IParsedLogEntry[];
35
-
36
- /** Current log level filter */
37
- filterLevel: TLogLevel | 'all';
38
-
39
- /** Level counts for badges */
40
- levelCounts: Partial<Record<TLogLevel, number>>;
41
-
42
- /** Optional custom class name */
43
- className?: string;
44
-
45
- /** Whether to show line numbers */
46
- showLineNumbers?: boolean;
47
-
48
- /** Whether to enable syntax highlighting */
49
- enableSyntaxHighlight?: boolean;
50
-
51
- /** Whether to auto-scroll to bottom when new entries arrive */
52
- followCursor?: boolean;
53
-
54
- /** Callback when scroll position changes (optional) */
55
- onScrollToBottom?: () => void;
56
- }
57
-
58
- /**
59
- * Get the severity value for a log level for filtering comparison.
60
- */
61
- function getSeverity(level: TLogLevel | 'all'): number {
62
- const severity: Record<TLogLevel, number> = {
63
- trace: 0,
64
- debug: 1,
65
- info: 2,
66
- warn: 3,
67
- error: 4,
68
- fatal: 5,
69
- unknown: 1,
70
- };
71
- return level === 'all' ? 0 : severity[level] ?? 1;
72
- }
73
-
74
- /**
75
- * Log lines viewer component.
76
- *
77
- * Displays parsed log entries with React components:
78
- * - Level badges (colored based on log level)
79
- * - Syntax highlighted message content
80
- * - Timestamps right-aligned
81
- * - Tag badges for component identification
82
- * - Virtual scrolling for performance with large logs
83
- * - Auto-scroll to bottom when following logs
84
- *
85
- * @example
86
- * ```tsx
87
- * <LogLinesViewer
88
- * entries={parsedEntries}
89
- * filterLevel="all"
90
- * levelCounts={{ info: 42, warn: 3 }}
91
- * showLineNumbers={true}
92
- * followCursor={true}
93
- * />
94
- * ```
95
- */
96
- export function LogLinesViewer({
97
- entries,
98
- filterLevel,
99
- levelCounts,
100
- className,
101
- showLineNumbers = false,
102
- enableSyntaxHighlight = true,
103
- followCursor = false,
104
- onScrollToBottom,
105
- }: ILogLinesViewerProps): React.JSX.Element {
106
- // Ref for the scroll container
107
- const scrollContainerRef = useRef<HTMLDivElement>(null);
108
- const prevEntriesLengthRef = useRef(entries.length);
109
-
110
- /**
111
- * Filter entries based on current filter level.
112
- * Memoized to avoid re-filtering on every render.
113
- */
114
- const filteredEntries = useMemo(() => {
115
- if (filterLevel === 'all') return entries;
116
-
117
- const minSeverity = getSeverity(filterLevel);
118
- return entries.filter((entry) => {
119
- const entrySeverity = getSeverity(entry.level);
120
- return entrySeverity >= minSeverity;
121
- });
122
- }, [entries, filterLevel]);
123
-
124
- /**
125
- * Virtual scrolling with @tanstack/react-virtual.
126
- * Only renders visible rows + overscan buffer for optimal performance.
127
- * Uses dynamic size measurement for variable-height rows.
128
- */
129
- const rowVirtualizer = useVirtualizer({
130
- count: filteredEntries.length,
131
- getScrollElement: () => scrollContainerRef.current,
132
- estimateSize: () => 28,
133
- overscan: 5, // Reduced for faster response
134
- });
135
-
136
- /**
137
- * Auto-scroll to bottom when new entries arrive and followCursor is enabled.
138
- * Uses requestAnimationFrame for non-blocking scroll.
139
- */
140
- useEffect(() => {
141
- if (followCursor && entries.length > prevEntriesLengthRef.current) {
142
- // Use RAF to avoid blocking the render
143
- requestAnimationFrame(() => {
144
- if (scrollContainerRef.current) {
145
- scrollContainerRef.current.scrollTop = scrollContainerRef.current.scrollHeight;
146
- }
147
- });
148
- onScrollToBottom?.();
149
- }
150
- prevEntriesLengthRef.current = entries.length;
151
- }, [entries.length, followCursor, onScrollToBottom]);
152
-
153
- /**
154
- * Calculate stats.
155
- */
156
- const lineCount = filteredEntries.length;
157
-
158
- return (
159
- <div className={cn('flex flex-col h-full', className)}>
160
- {/* Virtual scroll container */}
161
- <div
162
- ref={scrollContainerRef}
163
- className="flex-1 overflow-auto font-mono text-[13px] leading-relaxed bg-[#241B2F]"
164
- style={{ contain: 'layout style' }}
165
- >
166
- {filteredEntries.length === 0 ? (
167
- <div className="flex flex-col items-center justify-center h-full gap-2 text-muted-foreground/50">
168
- <svg className="w-8 h-8 opacity-30" fill="none" stroke="currentColor" viewBox="0 0 24 24">
169
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
170
- </svg>
171
- <span className="text-xs font-mono">No log entries to display</span>
172
- </div>
173
- ) : (
174
- <div
175
- style={{
176
- height: `${rowVirtualizer.getTotalSize()}px`,
177
- width: '100%',
178
- position: 'relative',
179
- }}
180
- >
181
- {rowVirtualizer.getVirtualItems().map((virtualRow) => {
182
- const entry = filteredEntries[virtualRow.index];
183
- return (
184
- <div
185
- key={entry.line_number}
186
- data-index={virtualRow.index}
187
- ref={rowVirtualizer.measureElement}
188
- style={{
189
- position: 'absolute',
190
- top: 0,
191
- left: 0,
192
- width: '100%',
193
- transform: `translateY(${virtualRow.start}px)`,
194
- }}
195
- >
196
- <LogLine
197
- entry={entry}
198
- index={virtualRow.index}
199
- showLineNumbers={showLineNumbers}
200
- enableSyntaxHighlight={enableSyntaxHighlight}
201
- />
202
- </div>
203
- );
204
- })}
205
- </div>
206
- )}
207
- </div>
208
- </div>
209
- );
210
- }
211
-
212
- /**
213
- * Props for LogLine component.
214
- */
215
- interface ILogLineProps {
216
- /** Parsed log entry */
217
- entry: IParsedLogEntry;
218
-
219
- /** Row index for alternating styling */
220
- index: number;
221
-
222
- /** Whether to show line numbers */
223
- showLineNumbers?: boolean;
224
-
225
- /** Whether to enable syntax highlighting */
226
- enableSyntaxHighlight?: boolean;
227
- }
228
-
229
- /**
230
- * Level-specific left border color for log lines.
231
- */
232
- const LEVEL_BORDER_COLORS: Record<string, string> = {
233
- error: 'border-l-red-500/60',
234
- fatal: 'border-l-pink-500/60',
235
- warn: 'border-l-yellow-500/50',
236
- info: 'border-l-blue-500/30',
237
- debug: 'border-l-cyan-500/20',
238
- trace: 'border-l-gray-500/15',
239
- unknown: 'border-l-transparent',
240
- };
241
-
242
- /**
243
- * Individual log line component (memoized).
244
- *
245
- * Renders a single log entry with badges and highlighted content.
246
- * Memoized to prevent re-renders when entry hasn't changed.
247
- */
248
- const LogLine = memo(function LogLine({ entry, index, showLineNumbers, enableSyntaxHighlight }: ILogLineProps): React.JSX.Element {
249
- return (
250
- <div
251
- className={cn(
252
- 'flex items-start gap-2 px-3 py-1 border-l-2 transition-colors',
253
- LEVEL_BORDER_COLORS[entry.level] || 'border-l-transparent',
254
- index % 2 === 0 ? 'bg-white/[0.02]' : '',
255
- 'hover:bg-white/[0.06]'
256
- )}
257
- >
258
- {/* Line number */}
259
- {showLineNumbers && (
260
- <span className="text-muted-foreground/50 text-xs w-12 flex-shrink-0 select-none">
261
- {entry.line_number}
262
- </span>
263
- )}
264
-
265
- {/* Level badge (skip for continuation lines) */}
266
- {!entry.is_continuation && <LevelBadge level={entry.level} />}
267
-
268
- {/* Content type badge (HTTP shows method like GET/POST, JSON shows JSON, etc.) */}
269
- {!entry.is_continuation && entry.content_type && entry.content_type !== 'plain' && (
270
- <ContentTypeBadge contentType={entry.content_type} httpMethod={entry.http_method} />
271
- )}
272
-
273
- {/* Tag badges */}
274
- {!entry.is_continuation && entry.tags && entry.tags.length > 0 && (
275
- <TagBadges tags={entry.tags} />
276
- )}
277
-
278
- {/* Message content with specialized highlighting */}
279
- <div className="flex-1 min-w-0">
280
- {enableSyntaxHighlight ? (
281
- // Use specialized highlighter for HTTP and table content
282
- (entry.content_type === 'http' || entry.content_type === 'table') ? (
283
- <SpecializedSyntaxHighlighter
284
- contentType={entry.content_type}
285
- httpMethod={entry.http_method}
286
- httpPath={entry.http_path}
287
- tableData={entry.table_data}
288
- text={entry.message ?? entry.raw}
289
- />
290
- ) : entry.content_type === 'json' && entry.structured ? (
291
- <SpecializedSyntaxHighlighter
292
- contentType="json"
293
- jsonData={entry.structured}
294
- text={entry.message ?? entry.raw}
295
- />
296
- ) : (
297
- <SyntaxHighlightedText text={entry.message ?? entry.raw} />
298
- )
299
- ) : (
300
- <span className="text-foreground/90">{entry.message ?? entry.raw}</span>
301
- )}
302
-
303
- {/* Structured data display (if present and not already shown) */}
304
- {entry.structured && entry.content_type !== 'json' && (
305
- <details className="mt-1 ml-4">
306
- <summary className="cursor-pointer text-xs text-muted-foreground hover:text-foreground">
307
- JSON data
308
- </summary>
309
- <pre className="mt-1 text-xs bg-black/20 p-2 rounded overflow-x-auto">
310
- {JSON.stringify(entry.structured, null, 2)}
311
- </pre>
312
- </details>
313
- )}
314
- </div>
315
-
316
- {/* Timestamp (right-aligned) */}
317
- {!entry.is_continuation && entry.timestamp_display && (
318
- <TimestampBadge timestamp={entry.timestamp_display} />
319
- )}
320
- </div>
321
- );
322
- }, (prevProps, nextProps) => {
323
- return (
324
- prevProps.entry.line_number === nextProps.entry.line_number &&
325
- prevProps.entry.raw === nextProps.entry.raw &&
326
- prevProps.index === nextProps.index &&
327
- prevProps.showLineNumbers === nextProps.showLineNumbers &&
328
- prevProps.enableSyntaxHighlight === nextProps.enableSyntaxHighlight
329
- );
330
- });
@@ -1,242 +0,0 @@
1
- /**
2
- * TerminalDebugPanel Component.
3
- *
4
- * Collapsible diagnostic panel below the terminal showing real-time
5
- * GPU/renderer info, FPS, grid dimensions, PTY status, and connection details.
6
- *
7
- * @module components/devenv/terminal/panel/TerminalDebugPanel
8
- */
9
-
10
- 'use client';
11
-
12
- import { useState, useEffect, useRef } from 'react';
13
- import { cn } from '@/react-ui/lib/utils';
14
-
15
- /**
16
- * Props for the TerminalDebugPanel component.
17
- */
18
- export interface ITerminalDebugPanelProps {
19
- /** Whether the panel is visible */
20
- visible: boolean;
21
- /** Renderer name (e.g. "WebGPU", "WebGL2", "xterm") */
22
- renderer?: string;
23
- /** Current FPS */
24
- fps?: number;
25
- /** GPU adapter name (e.g. "Apple M3 Pro") */
26
- gpu?: string;
27
- /** Canvas pixel dimensions */
28
- canvasSize?: { width: number; height: number };
29
- /** Grid dimensions in cols/rows */
30
- gridSize?: { cols: number; rows: number };
31
- /** Cell size in pixels */
32
- cellSize?: { width: number; height: number };
33
- /** Font description (e.g. "JetBrains Mono 14px") */
34
- font?: string;
35
- /** PTY connection status */
36
- ptyStatus?: string;
37
- /** PTY WebSocket URL */
38
- ptyUrl?: string;
39
- /** Active remote label */
40
- remoteName?: string;
41
- /** Theme name */
42
- themeName?: string;
43
- /** CRT effect enabled */
44
- crtEffect?: boolean;
45
- /** Connection uptime in seconds */
46
- uptimeSeconds?: number;
47
- /** Additional CSS classes */
48
- className?: string;
49
- }
50
-
51
- /**
52
- * Format uptime from seconds to human-readable string.
53
- *
54
- * @param seconds - Total seconds of uptime
55
- * @returns Formatted string (e.g. "5m 32s", "1h 23m")
56
- */
57
- function formatUptime(seconds: number): string {
58
- if (seconds < 60) return `${Math.floor(seconds)}s`;
59
- const m = Math.floor(seconds / 60);
60
- const s = Math.floor(seconds % 60);
61
- if (m < 60) return `${m}m ${s}s`;
62
- const h = Math.floor(m / 60);
63
- const rm = m % 60;
64
- return `${h}h ${rm}m`;
65
- }
66
-
67
- /**
68
- * Single row in the debug panel table.
69
- */
70
- function DebugRow({ label, value, valueColor }: { label: string; value: string; valueColor?: string }) {
71
- return (
72
- <div className="flex items-center gap-3 px-3 py-1 hover:bg-white/5 transition-colors">
73
- <span className="text-[10px] font-mono text-muted-foreground/60 uppercase tracking-wider w-24 flex-shrink-0">
74
- {label}
75
- </span>
76
- <span className={cn('text-xs font-mono', valueColor ?? 'text-foreground/80')}>
77
- {value}
78
- </span>
79
- </div>
80
- );
81
- }
82
-
83
- /**
84
- * TerminalDebugPanel Component.
85
- *
86
- * Renders a compact diagnostic panel with terminal runtime information.
87
- * Toggled via the debug panel setting in TerminalSettingsPopover.
88
- *
89
- * @param props - Debug panel props with runtime telemetry
90
- * @returns React element or null when hidden
91
- *
92
- * @example
93
- * ```tsx
94
- * <TerminalDebugPanel
95
- * visible={settings.debugPanel}
96
- * renderer="WebGPU"
97
- * fps={60}
98
- * gridSize={{ cols: 120, rows: 30 }}
99
- * ptyStatus="connected"
100
- * />
101
- * ```
102
- */
103
- export function TerminalDebugPanel({
104
- visible,
105
- renderer,
106
- fps,
107
- gpu,
108
- canvasSize,
109
- gridSize,
110
- cellSize,
111
- font,
112
- ptyStatus,
113
- ptyUrl,
114
- remoteName,
115
- themeName,
116
- crtEffect,
117
- uptimeSeconds,
118
- className,
119
- }: ITerminalDebugPanelProps) {
120
- const [isExpanded, setIsExpanded] = useState(true);
121
- const [liveUptime, setLiveUptime] = useState(uptimeSeconds ?? 0);
122
- const uptimeRef = useRef(uptimeSeconds ?? 0);
123
-
124
- // Live uptime counter
125
- useEffect(() => {
126
- uptimeRef.current = uptimeSeconds ?? 0;
127
- setLiveUptime(uptimeRef.current);
128
- }, [uptimeSeconds]);
129
-
130
- useEffect(() => {
131
- if (!visible || ptyStatus !== 'connected') return;
132
- const interval = setInterval(() => {
133
- uptimeRef.current += 1;
134
- setLiveUptime(uptimeRef.current);
135
- }, 1000);
136
- return () => clearInterval(interval);
137
- }, [visible, ptyStatus]);
138
-
139
- if (!visible) return null;
140
-
141
- const statusColor = ptyStatus === 'connected'
142
- ? 'text-green-400'
143
- : ptyStatus === 'connecting'
144
- ? 'text-yellow-400'
145
- : ptyStatus === 'error'
146
- ? 'text-red-400'
147
- : 'text-muted-foreground/50';
148
-
149
- return (
150
- <div className={cn(
151
- 'border-t border-white/10 bg-black/20',
152
- className,
153
- )}>
154
- {/* Toggle header */}
155
- <button
156
- type="button"
157
- onClick={() => setIsExpanded(!isExpanded)}
158
- className="w-full flex items-center gap-2 px-3 py-1.5 text-[10px] font-mono text-muted-foreground/60 uppercase tracking-wider hover:text-muted-foreground transition-colors"
159
- >
160
- <svg
161
- className={cn('w-3 h-3 transition-transform', isExpanded && 'rotate-90')}
162
- fill="none"
163
- stroke="currentColor"
164
- viewBox="0 0 24 24"
165
- strokeWidth={2}
166
- >
167
- <polyline points="9 18 15 12 9 6" />
168
- </svg>
169
- Debug Panel
170
- {fps != null && (
171
- <span className="ml-auto text-foreground/40">{fps.toFixed(0)} FPS</span>
172
- )}
173
- </button>
174
-
175
- {/* Expanded content */}
176
- {isExpanded && (
177
- <div className="pb-2">
178
- {renderer && (
179
- <DebugRow
180
- label="Renderer"
181
- value={renderer}
182
- valueColor="text-primary/80"
183
- />
184
- )}
185
- {fps != null && (
186
- <DebugRow label="FPS" value={fps.toFixed(1)} />
187
- )}
188
- {gpu && (
189
- <DebugRow label="GPU" value={gpu} />
190
- )}
191
- {canvasSize && (
192
- <DebugRow
193
- label="Canvas"
194
- value={`${canvasSize.width} \u00d7 ${canvasSize.height}`}
195
- />
196
- )}
197
- {gridSize && (
198
- <DebugRow
199
- label="Grid"
200
- value={`${gridSize.cols} cols \u00d7 ${gridSize.rows} rows`}
201
- />
202
- )}
203
- {cellSize && (
204
- <DebugRow
205
- label="Cell"
206
- value={`${cellSize.width.toFixed(1)} \u00d7 ${cellSize.height.toFixed(1)} px`}
207
- />
208
- )}
209
- {font && (
210
- <DebugRow label="Font" value={font} />
211
- )}
212
- <DebugRow
213
- label="PTY Status"
214
- value={ptyStatus ?? 'unknown'}
215
- valueColor={statusColor}
216
- />
217
- {ptyUrl && (
218
- <DebugRow
219
- label="PTY URL"
220
- value={ptyUrl}
221
- valueColor="text-foreground/40"
222
- />
223
- )}
224
- {remoteName && (
225
- <DebugRow label="Remote" value={remoteName} />
226
- )}
227
- {themeName && (
228
- <DebugRow label="Theme" value={themeName} />
229
- )}
230
- <DebugRow
231
- label="CRT Effect"
232
- value={crtEffect ? 'ON' : 'OFF'}
233
- valueColor={crtEffect ? 'text-primary/60' : 'text-muted-foreground/40'}
234
- />
235
- {ptyStatus === 'connected' && (
236
- <DebugRow label="Uptime" value={formatUptime(liveUptime)} />
237
- )}
238
- </div>
239
- )}
240
- </div>
241
- );
242
- }