@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,550 +0,0 @@
1
- /**
2
- * TerminalLogsPanel Component.
3
- *
4
- * Ghostty-inspired terminal panel with session tabs, glassmorphic header,
5
- * tab-style filters, compact actions, and premium visual effects.
6
- *
7
- * @module components/devenv/terminal/panel
8
- */
9
-
10
- 'use client';
11
-
12
- import { useRef, useEffect, forwardRef, useImperativeHandle, useMemo } from 'react';
13
- import { Terminal } from '@xterm/xterm';
14
- import { FitAddon } from '@xterm/addon-fit';
15
- import { WebLinksAddon } from '@xterm/addon-web-links';
16
- import { SearchAddon } from '@xterm/addon-search';
17
- import { getTerminalTheme } from '../Terminal.theme';
18
- import { LogParserService, type TLogLevel } from '../parsing';
19
- import { useTerminalSettings } from '../hooks/useTerminalSettings';
20
- import type {
21
- ITerminalLogsPanelProps,
22
- TLogLevelFilter,
23
- ITerminalSession,
24
- } from './TerminalLogsPanel.types';
25
- import { TerminalPanelChrome } from './TerminalPanelChrome';
26
- import { TerminalFilterDropdown } from './TerminalFilterDropdown';
27
- import { TerminalPanelFooter } from './TerminalPanelFooter';
28
- import { LogLinesViewer } from './LogLinesViewer';
29
- import { TerminalIcon } from '@/react-ui/icons/lucide-animated';
30
- import { ArrowDownToLineIcon, ArrowUpIcon, ListIcon, SearchIcon, DeleteIcon, DownloadIcon } from '@/react-ui/icons/lucide-animated';
31
- import { cn } from '@/react-ui/lib/utils';
32
- import { IconWrapper } from '@/react-ui/lib/icon-wrapper';
33
- import '@xterm/xterm/css/xterm.css';
34
-
35
- /**
36
- * Terminal display container styles.
37
- */
38
- const terminalContainerStyles =
39
- 'relative bg-[#241B2F] min-h-[400px] border-x border-border/10 terminal-scroll';
40
-
41
- /**
42
- * Toggle button styles.
43
- */
44
- const toggleStyles = {
45
- base: 'h-9 w-9 p-2 rounded-md transition-all hover:bg-muted/20 active:bg-muted/30 flex items-center justify-center flex-shrink-0',
46
- inactive: 'bg-muted/40 text-muted-foreground',
47
- active: 'bg-primary/20 text-primary border border-primary/40 shadow-[0_0_10px_hsla(330,85%,43%,0.2)]',
48
- };
49
-
50
- /**
51
- * Action button styles.
52
- */
53
- const actionButtonStyles = {
54
- base: 'h-9 w-9 p-2 rounded-md transition-all hover:bg-muted/20 active:bg-muted/30 flex items-center justify-center flex-shrink-0',
55
- default: 'bg-muted/40 text-muted-foreground hover:text-foreground',
56
- };
57
-
58
- /**
59
- * Imperative handle for TerminalLogsPanel component.
60
- * Exposes terminal control methods to parent components.
61
- */
62
- export interface ITerminalLogsPanelRef {
63
- /** Search for term in terminal buffer */
64
- search: (term: string) => void;
65
-
66
- /** Clear terminal and reset position */
67
- clear: () => void;
68
-
69
- /** Write text to terminal */
70
- write: (text: string) => void;
71
-
72
- /** Scroll to bottom of terminal */
73
- scrollToBottom: () => void;
74
- }
75
-
76
- /**
77
- * Get the severity value for a log level for filtering comparison.
78
- * Higher value = more severe.
79
- */
80
- function getSeverity(level: TLogLevelFilter): number {
81
- const severity: Record<TLogLevel, number> = {
82
- trace: 0,
83
- debug: 1,
84
- info: 2,
85
- warn: 3,
86
- error: 4,
87
- fatal: 5,
88
- unknown: 1,
89
- };
90
- return level === 'all' ? 0 : severity[level] ?? 1;
91
- }
92
-
93
- /**
94
- * Get the display name for the current session or container.
95
- */
96
- function getDisplayName(containerName: string, sessions?: ITerminalSession[], activeSessionId?: string | null): string {
97
- if (!sessions || sessions.length === 0) {
98
- return containerName;
99
- }
100
- const activeSession = sessions.find((s) => s.id === activeSessionId);
101
- return activeSession?.name ?? containerName;
102
- }
103
-
104
- /**
105
- * TerminalLogsPanel Component.
106
- *
107
- * Ghostty-inspired complete terminal panel with:
108
- * - Session tabs (multi-session support)
109
- * - Enhanced glassmorphic header
110
- * - Tab-style filter buttons
111
- * - Compact action bar
112
- * - xterm.js terminal display
113
- * - Status footer with counts
114
- * - Multi-layer glassmorphism
115
- * - Noise texture for depth
116
- * - Animated accent lines
117
- *
118
- * @example
119
- * ```tsx
120
- * const panelRef = useRef<ITerminalLogsPanelRef>(null);
121
- *
122
- * <TerminalLogsPanel
123
- * ref={panelRef}
124
- * containerName="devenv-agent-backend"
125
- * isConnected={true}
126
- * parsedEntries={state.parsedEntries}
127
- * filterLevel="all"
128
- * followCursor={true}
129
- * showLineNumbers={false}
130
- * levelCounts={{ info: 42, warn: 3 }}
131
- * sessions={sessions}
132
- * activeSessionId="session-1"
133
- * onSessionChange={(id) => setActiveSession(id)}
134
- * onSessionClose={(id) => closeSession(id)}
135
- * onNewSession={() => createSession()}
136
- * onFilterChange={(level) => setFilterLevel(level)}
137
- * onFollowCursorChange={(enabled) => setFollowCursor(enabled)}
138
- * onShowLineNumbersChange={(enabled) => setShowLineNumbers(enabled)}
139
- * onClear={() => clearLogs()}
140
- * onDownload={() => downloadLogs()}
141
- * onSearch={() => openSearch()}
142
- * />
143
- * ```
144
- */
145
- export const TerminalLogsPanel = forwardRef<ITerminalLogsPanelRef, ITerminalLogsPanelProps>(
146
- (
147
- {
148
- containerName,
149
- isConnected,
150
- _logs = '', // Kept for API compatibility, unused in favor of parsedEntries
151
- parsedEntries = [],
152
- filterLevel,
153
- followCursor,
154
- showLineNumbers,
155
- levelCounts,
156
- className,
157
- viewMode = 'terminal',
158
- containers,
159
- sessions,
160
- activeSessionId,
161
- onSessionChange,
162
- onSessionClose,
163
- onNewSession,
164
- onContainerSelect,
165
- onSessionStop,
166
- onAddContainer,
167
- onFilterChange,
168
- onFollowCursorChange,
169
- onShowLineNumbersChange,
170
- onViewModeChange,
171
- onClear,
172
- onDownload,
173
- onSearch,
174
- },
175
- ref
176
- ) => {
177
- const terminalRef = useRef<Terminal | null>(null);
178
- const fitAddonRef = useRef<FitAddon | null>(null);
179
- const searchAddonRef = useRef<SearchAddon | null>(null);
180
- const containerRef = useRef<HTMLDivElement>(null);
181
- const lastWrittenCountRef = useRef(0);
182
- const terminalReadyRef = useRef(false);
183
-
184
- const { settings: terminalSettings } = useTerminalSettings();
185
-
186
- // Create parser instance for formatting
187
- const parser = useMemo(() => new LogParserService({ timestamp_format: 'time' }), []);
188
-
189
- // Get display name from active session or container
190
- const displayName = getDisplayName(containerName, sessions, activeSessionId);
191
-
192
- const filteredEntries = useMemo(() => {
193
- if (filterLevel === 'all') return parsedEntries;
194
-
195
- const minSeverity = getSeverity(filterLevel);
196
- return parsedEntries.filter((entry) => {
197
- const entrySeverity = getSeverity(entry.level);
198
- return entrySeverity >= minSeverity;
199
- });
200
- }, [parsedEntries, filterLevel]);
201
-
202
- /**
203
- * Calculate line and byte counts from logs.
204
- */
205
- const lineCount = filteredEntries.length;
206
- const byteCount = filteredEntries.reduce((sum, e) => sum + e.raw.length, 0);
207
-
208
- /**
209
- * Initialize xterm.js instance with addons.
210
- * Only runs in terminal mode.
211
- */
212
- useEffect(() => {
213
- // Skip initialization if not in terminal mode
214
- if (viewMode !== 'terminal') return;
215
- if (!containerRef.current) return;
216
-
217
- // Create terminal with readonly mode (no cursor)
218
- const terminal = new Terminal({
219
- cursorBlink: false,
220
- cursorInactiveStyle: 'none',
221
- scrollback: 10000,
222
- fontSize: 13,
223
- fontFamily: "'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace",
224
- theme: getTerminalTheme(),
225
- allowProposedApi: true,
226
- disableStdin: true,
227
- });
228
-
229
- // Load addons
230
- const fitAddon = new FitAddon();
231
- const webLinksAddon = new WebLinksAddon();
232
- const searchAddon = new SearchAddon();
233
-
234
- terminal.loadAddon(fitAddon);
235
- terminal.loadAddon(webLinksAddon);
236
- terminal.loadAddon(searchAddon);
237
-
238
- // Open terminal in container
239
- terminal.open(containerRef.current);
240
-
241
- // Defer fit until after DOM has been painted to avoid dimension errors
242
- const rafId = requestAnimationFrame(() => {
243
- const rafId2 = requestAnimationFrame(() => {
244
- try {
245
- fitAddon.fit();
246
- } catch (e) {
247
- // Silently ignore fit errors during initialization
248
- console.debug('[TerminalLogsPanel] Fit deferred:', e);
249
- }
250
- });
251
- return () => cancelAnimationFrame(rafId2);
252
- });
253
-
254
- // Store references
255
- terminalRef.current = terminal;
256
- fitAddonRef.current = fitAddon;
257
- searchAddonRef.current = searchAddon;
258
-
259
- // Mark terminal as ready
260
- terminalReadyRef.current = true;
261
-
262
- // Cleanup on unmount
263
- return () => {
264
- cancelAnimationFrame(rafId);
265
- terminalReadyRef.current = false;
266
- terminal.dispose();
267
- };
268
- }, [viewMode]);
269
-
270
- /**
271
- * Write filtered and formatted entries to terminal.
272
- * Only writes new entries since last update (incremental).
273
- * Only runs in terminal mode.
274
- */
275
- useEffect(() => {
276
- // Skip if not in terminal mode
277
- if (viewMode !== 'terminal') return;
278
- if (!terminalRef.current || !terminalReadyRef.current) return;
279
-
280
- // Get new entries to write (incremental)
281
- const newEntries = filteredEntries.slice(lastWrittenCountRef.current);
282
- if (newEntries.length === 0) return;
283
-
284
- // Format and write each entry (raw mode preserves original ANSI)
285
- for (const entry of newEntries) {
286
- const formatted = parser.formatForTerminal(entry, 'raw');
287
- terminalRef.current.write(formatted + '\r\n');
288
- }
289
-
290
- lastWrittenCountRef.current = filteredEntries.length;
291
-
292
- // Auto-scroll to bottom when follow cursor is enabled
293
- if (followCursor) {
294
- terminalRef.current.scrollToBottom();
295
- }
296
- }, [filteredEntries, followCursor, parser, viewMode]);
297
-
298
- /**
299
- * Clear terminal when filter changes to full refresh.
300
- * Only runs in terminal mode.
301
- */
302
- useEffect(() => {
303
- // Skip if not in terminal mode
304
- if (viewMode !== 'terminal') return;
305
- if (!terminalRef.current || !terminalReadyRef.current) return;
306
-
307
- // Clear and rewrite when filter level changes
308
- terminalRef.current.clear();
309
- lastWrittenCountRef.current = 0;
310
- }, [filterLevel, viewMode]);
311
-
312
- /**
313
- * Handle window resize with auto-fit.
314
- */
315
- useEffect(() => {
316
- const handleResize = () => {
317
- // Defer fit to avoid dimension errors during resize
318
- requestAnimationFrame(() => {
319
- if (fitAddonRef.current && terminalRef.current) {
320
- try {
321
- fitAddonRef.current.fit();
322
- } catch (e) {
323
- // Silently ignore fit errors during resize
324
- console.debug('[TerminalLogsPanel] Resize fit error:', e);
325
- }
326
- }
327
- });
328
- };
329
-
330
- window.addEventListener('resize', handleResize);
331
- return () => window.removeEventListener('resize', handleResize);
332
- }, []);
333
-
334
- /**
335
- * Expose imperative methods to parent.
336
- */
337
- useImperativeHandle(ref, () => ({
338
- search: (term: string) => {
339
- searchAddonRef.current?.findNext(term);
340
- },
341
- clear: () => {
342
- terminalRef.current?.clear();
343
- lastWrittenCountRef.current = 0; // Reset counter when clearing
344
- },
345
- write: (text: string) => {
346
- terminalRef.current?.write(text);
347
- },
348
- scrollToBottom: () => {
349
- terminalRef.current?.scrollToBottom();
350
- },
351
- }));
352
-
353
- return (
354
- <TerminalPanelChrome
355
- containerName={displayName}
356
- isConnected={isConnected}
357
- viewMode={viewMode}
358
- onViewModeChange={onViewModeChange}
359
- crtEffect={terminalSettings.crtEffect}
360
- sessions={sessions}
361
- activeSessionId={activeSessionId}
362
- onSessionTabClick={(sessionId) => {
363
- onSessionChange?.(sessionId);
364
- onContainerSelect?.(sessionId);
365
- }}
366
- onSessionClose={(sessionId) => {
367
- onSessionClose?.(sessionId);
368
- if (sessionId === activeSessionId) {
369
- onSessionStop?.();
370
- }
371
- }}
372
- onNewSession={onNewSession}
373
- availableContainers={containers}
374
- onAddContainer={onAddContainer}
375
- actionBar={
376
- <>
377
- {/* Unified Action Bar with Filter */}
378
- <div className="flex items-center gap-2 px-3 h-12 bg-muted/10 border-b border-white/10">
379
- {/* Filter Dropdown */}
380
- <TerminalFilterDropdown
381
- filterLevel={filterLevel}
382
- levelCounts={levelCounts}
383
- onFilterChange={onFilterChange}
384
- />
385
-
386
- {/* Divider */}
387
- <div className="w-px h-6 bg-border/30 flex-shrink-0" />
388
-
389
- {/* Toggles */}
390
- <div className="flex items-center gap-1">
391
- {/* Follow Cursor Toggle (only in terminal mode) */}
392
- {viewMode === 'terminal' && (
393
- <button
394
- type="button"
395
- onClick={() => onFollowCursorChange(!followCursor)}
396
- className={cn(toggleStyles.base, followCursor ? toggleStyles.active : toggleStyles.inactive)}
397
- title={followCursor ? 'Disable auto-scroll (Ctrl+F)' : 'Enable auto-scroll (Ctrl+F)'}
398
- >
399
- {followCursor ? (
400
- <ArrowDownToLineIcon className="w-4 h-4 flex-shrink-0" />
401
- ) : (
402
- <ArrowUpIcon className="w-4 h-4 flex-shrink-0" />
403
- )}
404
- </button>
405
- )}
406
-
407
- {/* Line Numbers Toggle */}
408
- <button
409
- type="button"
410
- onClick={() => onShowLineNumbersChange(!showLineNumbers)}
411
- className={cn(toggleStyles.base, showLineNumbers ? toggleStyles.active : toggleStyles.inactive)}
412
- title={showLineNumbers ? 'Hide line numbers (Ctrl+L)' : 'Show line numbers (Ctrl+L)'}
413
- >
414
- <ListIcon className="w-4 h-4 flex-shrink-0" />
415
- </button>
416
- </div>
417
-
418
- {/* Spacer */}
419
- <div className="flex-1" />
420
-
421
- {/* Action Buttons */}
422
- <div className="flex items-center gap-1">
423
- {/* Search */}
424
- <button
425
- type="button"
426
- onClick={onSearch}
427
- className={cn(actionButtonStyles.base, actionButtonStyles.default)}
428
- title="Search in logs (Ctrl+Shift+F)"
429
- >
430
- <IconWrapper icon={SearchIcon} size={16} />
431
- </button>
432
-
433
- {/* Clear */}
434
- <button
435
- type="button"
436
- onClick={onClear}
437
- className={cn(actionButtonStyles.base, actionButtonStyles.default)}
438
- title="Clear logs (Ctrl+K)"
439
- >
440
- <IconWrapper icon={DeleteIcon} size={16} />
441
- </button>
442
-
443
- {/* Download */}
444
- <button
445
- type="button"
446
- onClick={onDownload}
447
- className={cn(actionButtonStyles.base, actionButtonStyles.default)}
448
- title="Download logs"
449
- >
450
- <IconWrapper icon={DownloadIcon} size={16} />
451
- </button>
452
- </div>
453
- </div>
454
- </>
455
- }
456
- footer={<TerminalPanelFooter lineCount={lineCount} byteCount={byteCount} filterLevel={filterLevel} />}
457
- className={className}
458
- >
459
- {/* Terminal Display or React Viewer */}
460
- {activeSessionId ? (
461
- viewMode === 'terminal' ? (
462
- /* xterm.js Terminal Display */
463
- <div className="relative min-h-[400px]">
464
- <div ref={containerRef} className={terminalContainerStyles} />
465
- {/* Terminal placeholder when no logs */}
466
- {parsedEntries.length === 0 && (
467
- <div className="absolute inset-0 flex items-center justify-center pointer-events-none">
468
- <div className="text-center">
469
- <TerminalIcon className="w-12 h-12 mx-auto mb-3 text-muted-foreground/30" />
470
- <p className="text-sm text-muted-foreground/50 font-mono">
471
- Waiting for logs...
472
- </p>
473
- </div>
474
- </div>
475
- )}
476
- </div>
477
- ) : (
478
- /* React Log Viewer */
479
- <LogLinesViewer
480
- entries={parsedEntries}
481
- filterLevel={filterLevel}
482
- levelCounts={levelCounts}
483
- showLineNumbers={showLineNumbers}
484
- followCursor={followCursor}
485
- onScrollToBottom={() => {
486
- if (followCursor && terminalRef.current) {
487
- terminalRef.current.scrollToBottom();
488
- }
489
- }}
490
- className="min-h-[400px]"
491
- />
492
- )
493
- ) : (
494
- /* Empty State - No container selected */
495
- <div className="flex flex-col items-center justify-center min-h-[400px] px-8 py-12 text-center">
496
- {/* Empty State Icon */}
497
- <div className="w-16 h-16 mb-4 rounded-full bg-muted/20 flex items-center justify-center">
498
- <TerminalIcon className="w-8 h-8 text-muted-foreground/50" />
499
- </div>
500
-
501
- {/* Empty State Message */}
502
- <h3 className="text-lg font-medium text-foreground mb-2">
503
- No container selected
504
- </h3>
505
- <p className="text-sm text-muted-foreground mb-6 max-w-md">
506
- Click the <span className="text-primary font-mono">+</span> button above to add a container tab and view its logs in real-time.
507
- </p>
508
-
509
- {/* Add Container Button (when no tabs open) */}
510
- {containers && containers.length > 0 && onAddContainer && (
511
- <div className="flex flex-col items-center gap-2">
512
- <div className="text-xs text-muted-foreground mb-2">Available containers:</div>
513
- <div className="flex flex-wrap gap-2 justify-center">
514
- {containers.slice(0, 3).map((container) => (
515
- <button
516
- key={container.id}
517
- type="button"
518
- onClick={() => onAddContainer(container.name)}
519
- className={cn(
520
- 'px-3 py-1.5 rounded-lg text-sm font-mono transition-colors',
521
- 'bg-muted/30 text-muted-foreground hover:bg-primary/20 hover:text-primary',
522
- 'hover:shadow-[0_0_10px_hsla(330,85%,43%,0.2)]'
523
- )}
524
- >
525
- {container.name}
526
- </button>
527
- ))}
528
- {containers.length > 3 && (
529
- <button
530
- type="button"
531
- onClick={() => onNewSession?.()}
532
- className={cn(
533
- 'px-3 py-1.5 rounded-lg text-sm font-mono transition-colors',
534
- 'bg-muted/30 text-muted-foreground hover:bg-primary/20 hover:text-primary'
535
- )}
536
- >
537
- +{containers.length - 3} more
538
- </button>
539
- )}
540
- </div>
541
- </div>
542
- )}
543
- </div>
544
- )}
545
- </TerminalPanelChrome>
546
- );
547
- }
548
- );
549
-
550
- TerminalLogsPanel.displayName = 'TerminalLogsPanel';