@townco/ui 0.1.7 → 0.1.9

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 (243) hide show
  1. package/dist/core/hooks/index.d.ts +1 -0
  2. package/dist/core/hooks/index.d.ts.map +1 -0
  3. package/dist/core/hooks/index.js +1 -0
  4. package/dist/core/hooks/index.js.map +1 -0
  5. package/dist/core/hooks/use-chat-input.d.ts +17 -17
  6. package/dist/core/hooks/use-chat-input.d.ts.map +1 -0
  7. package/dist/core/hooks/use-chat-input.js +64 -55
  8. package/dist/core/hooks/use-chat-input.js.map +1 -0
  9. package/dist/core/hooks/use-chat-messages.d.ts +11 -11
  10. package/dist/core/hooks/use-chat-messages.d.ts.map +1 -0
  11. package/dist/core/hooks/use-chat-messages.js +121 -114
  12. package/dist/core/hooks/use-chat-messages.js.map +1 -0
  13. package/dist/core/hooks/use-chat-session.d.ts +5 -5
  14. package/dist/core/hooks/use-chat-session.d.ts.map +1 -0
  15. package/dist/core/hooks/use-chat-session.js +78 -80
  16. package/dist/core/hooks/use-chat-session.js.map +1 -0
  17. package/dist/core/hooks/use-media-query.d.ts +39 -0
  18. package/dist/core/hooks/use-media-query.js +84 -0
  19. package/dist/core/index.d.ts.map +1 -0
  20. package/dist/core/index.js.map +1 -0
  21. package/dist/core/schemas/chat.d.ts +83 -56
  22. package/dist/core/schemas/chat.d.ts.map +1 -0
  23. package/dist/core/schemas/chat.js +27 -25
  24. package/dist/core/schemas/chat.js.map +1 -0
  25. package/dist/core/schemas/index.d.ts.map +1 -0
  26. package/dist/core/schemas/index.js.map +1 -0
  27. package/dist/core/store/chat-store.d.ts +28 -22
  28. package/dist/core/store/chat-store.d.ts.map +1 -0
  29. package/dist/core/store/chat-store.js +59 -50
  30. package/dist/core/store/chat-store.js.map +1 -0
  31. package/dist/gui/components/Button.d.ts +23 -7
  32. package/dist/gui/components/Button.d.ts.map +1 -0
  33. package/dist/gui/components/Button.js +40 -27
  34. package/dist/gui/components/Button.js.map +1 -0
  35. package/dist/gui/components/Card.d.ts +26 -7
  36. package/dist/gui/components/Card.d.ts.map +1 -0
  37. package/dist/gui/components/Card.js +54 -8
  38. package/dist/gui/components/Card.js.map +1 -0
  39. package/dist/gui/components/ChatHeader.d.ts +38 -0
  40. package/dist/gui/components/ChatHeader.js +86 -0
  41. package/dist/gui/components/ChatInput.d.ts +19 -1
  42. package/dist/gui/components/ChatInput.d.ts.map +1 -0
  43. package/dist/gui/components/ChatInput.js +94 -11
  44. package/dist/gui/components/ChatInput.js.map +1 -0
  45. package/dist/gui/components/ChatInputCommandMenu.d.ts +20 -0
  46. package/dist/gui/components/ChatInputCommandMenu.js +62 -0
  47. package/dist/gui/components/ChatInterface.d.ts +12 -0
  48. package/dist/gui/components/ChatInterface.d.ts.map +1 -0
  49. package/dist/gui/components/ChatInterface.js +204 -0
  50. package/dist/gui/components/ChatInterface.js.map +1 -0
  51. package/dist/gui/components/ChatLayout.d.ts +52 -0
  52. package/dist/gui/components/ChatLayout.js +105 -0
  53. package/dist/gui/components/ChatPanelTabContent.d.ts +18 -0
  54. package/dist/gui/components/ChatPanelTabContent.js +15 -0
  55. package/dist/gui/components/ChatPreview.d.ts +12 -0
  56. package/dist/gui/components/ChatPreview.d.ts.map +1 -0
  57. package/dist/gui/components/ChatPreview.js +214 -0
  58. package/dist/gui/components/ChatPreview.js.map +1 -0
  59. package/dist/gui/components/ChatSecondaryPanel.d.ts +14 -11
  60. package/dist/gui/components/ChatSecondaryPanel.d.ts.map +1 -0
  61. package/dist/gui/components/ChatSecondaryPanel.js +115 -38
  62. package/dist/gui/components/ChatSecondaryPanel.js.map +1 -0
  63. package/dist/gui/components/ChatSidebar.d.ts +14 -0
  64. package/dist/gui/components/ChatSidebar.js +23 -0
  65. package/dist/gui/components/ChatStatus.d.ts +4 -2
  66. package/dist/gui/components/ChatStatus.d.ts.map +1 -0
  67. package/dist/gui/components/ChatStatus.js +45 -34
  68. package/dist/gui/components/ChatStatus.js.map +1 -0
  69. package/dist/gui/components/ChatView.d.ts +8 -0
  70. package/dist/gui/components/ChatView.d.ts.map +1 -0
  71. package/dist/gui/components/ChatView.js +42 -0
  72. package/dist/gui/components/ChatView.js.map +1 -0
  73. package/dist/gui/components/ConfigPanel.d.ts +20 -0
  74. package/dist/gui/components/ConfigPanel.d.ts.map +1 -0
  75. package/dist/gui/components/ConfigPanel.js +225 -0
  76. package/dist/gui/components/ConfigPanel.js.map +1 -0
  77. package/dist/gui/components/Conversation.d.ts +17 -14
  78. package/dist/gui/components/Conversation.d.ts.map +1 -0
  79. package/dist/gui/components/Conversation.js +143 -83
  80. package/dist/gui/components/Conversation.js.map +1 -0
  81. package/dist/gui/components/Dialog.d.ts +57 -11
  82. package/dist/gui/components/Dialog.d.ts.map +1 -0
  83. package/dist/gui/components/Dialog.js +84 -8
  84. package/dist/gui/components/Dialog.js.map +1 -0
  85. package/dist/gui/components/DropdownMenu.d.ts +27 -0
  86. package/dist/gui/components/DropdownMenu.js +68 -0
  87. package/dist/gui/components/HeightTransition.d.ts +12 -7
  88. package/dist/gui/components/HeightTransition.d.ts.map +1 -0
  89. package/dist/gui/components/HeightTransition.js +88 -77
  90. package/dist/gui/components/HeightTransition.js.map +1 -0
  91. package/dist/gui/components/Input.d.ts +13 -6
  92. package/dist/gui/components/Input.d.ts.map +1 -0
  93. package/dist/gui/components/Input.js +27 -16
  94. package/dist/gui/components/Input.js.map +1 -0
  95. package/dist/gui/components/InputBox.d.ts +21 -0
  96. package/dist/gui/components/InputBox.d.ts.map +1 -0
  97. package/dist/gui/components/InputBox.js +90 -0
  98. package/dist/gui/components/InputBox.js.map +1 -0
  99. package/dist/gui/components/Label.d.ts +7 -1
  100. package/dist/gui/components/Label.d.ts.map +1 -0
  101. package/dist/gui/components/Label.js +12 -2
  102. package/dist/gui/components/Label.js.map +1 -0
  103. package/dist/gui/components/MarkdownRenderer.d.ts +6 -4
  104. package/dist/gui/components/MarkdownRenderer.d.ts.map +1 -0
  105. package/dist/gui/components/MarkdownRenderer.js +178 -81
  106. package/dist/gui/components/MarkdownRenderer.js.map +1 -0
  107. package/dist/gui/components/Message.d.ts +4 -0
  108. package/dist/gui/components/Message.d.ts.map +1 -0
  109. package/dist/gui/components/Message.js +77 -3
  110. package/dist/gui/components/Message.js.map +1 -0
  111. package/dist/gui/components/MessageContent.d.ts +29 -22
  112. package/dist/gui/components/MessageContent.d.ts.map +1 -0
  113. package/dist/gui/components/MessageContent.js +1 -1
  114. package/dist/gui/components/MessageContent.js.map +1 -0
  115. package/dist/gui/components/MessageList.d.ts.map +1 -0
  116. package/dist/gui/components/MessageList.js.map +1 -0
  117. package/dist/gui/components/PlaygroundLayout.d.ts +14 -0
  118. package/dist/gui/components/PlaygroundLayout.d.ts.map +1 -0
  119. package/dist/gui/components/PlaygroundLayout.js +49 -0
  120. package/dist/gui/components/PlaygroundLayout.js.map +1 -0
  121. package/dist/gui/components/Reasoning.d.ts +30 -24
  122. package/dist/gui/components/Reasoning.d.ts.map +1 -0
  123. package/dist/gui/components/Reasoning.js +187 -60
  124. package/dist/gui/components/Reasoning.js.map +1 -0
  125. package/dist/gui/components/Response.d.ts +11 -9
  126. package/dist/gui/components/Response.d.ts.map +1 -0
  127. package/dist/gui/components/Response.js +229 -90
  128. package/dist/gui/components/Response.js.map +1 -0
  129. package/dist/gui/components/Select.d.ts +69 -10
  130. package/dist/gui/components/Select.d.ts.map +1 -0
  131. package/dist/gui/components/Select.js +118 -12
  132. package/dist/gui/components/Select.js.map +1 -0
  133. package/dist/gui/components/Sonner.d.ts +5 -0
  134. package/dist/gui/components/Sonner.js +23 -0
  135. package/dist/gui/components/StatusBar.d.ts +12 -0
  136. package/dist/gui/components/StatusBar.d.ts.map +1 -0
  137. package/dist/gui/components/StatusBar.js +58 -0
  138. package/dist/gui/components/StatusBar.js.map +1 -0
  139. package/dist/gui/components/Tabs.d.ts +24 -4
  140. package/dist/gui/components/Tabs.d.ts.map +1 -0
  141. package/dist/gui/components/Tabs.js +32 -4
  142. package/dist/gui/components/Tabs.js.map +1 -0
  143. package/dist/gui/components/Task.d.ts +28 -24
  144. package/dist/gui/components/Task.d.ts.map +1 -0
  145. package/dist/gui/components/Task.js +164 -31
  146. package/dist/gui/components/Task.js.map +1 -0
  147. package/dist/gui/components/Textarea.d.ts +15 -7
  148. package/dist/gui/components/Textarea.d.ts.map +1 -0
  149. package/dist/gui/components/Textarea.js +63 -46
  150. package/dist/gui/components/Textarea.js.map +1 -0
  151. package/dist/gui/components/ThinkingBlock.d.ts +20 -10
  152. package/dist/gui/components/ThinkingBlock.d.ts.map +1 -0
  153. package/dist/gui/components/ThinkingBlock.js +134 -35
  154. package/dist/gui/components/ThinkingBlock.js.map +1 -0
  155. package/dist/gui/components/TodoList.d.ts +12 -10
  156. package/dist/gui/components/TodoList.d.ts.map +1 -0
  157. package/dist/gui/components/TodoList.js +22 -7
  158. package/dist/gui/components/TodoList.js.map +1 -0
  159. package/dist/gui/components/TodoListItem.d.ts +9 -6
  160. package/dist/gui/components/TodoListItem.d.ts.map +1 -0
  161. package/dist/gui/components/TodoListItem.js +18 -4
  162. package/dist/gui/components/TodoListItem.js.map +1 -0
  163. package/dist/gui/components/index.d.ts +9 -1
  164. package/dist/gui/components/index.d.ts.map +1 -0
  165. package/dist/gui/components/index.js +11 -1
  166. package/dist/gui/components/index.js.map +1 -0
  167. package/dist/gui/index.d.ts.map +1 -0
  168. package/dist/gui/index.js.map +1 -0
  169. package/dist/gui/lib/utils.d.ts.map +1 -0
  170. package/dist/gui/lib/utils.js +1 -1
  171. package/dist/gui/lib/utils.js.map +1 -0
  172. package/dist/index.d.ts.map +1 -0
  173. package/dist/index.js.map +1 -0
  174. package/dist/index.test.js +0 -1
  175. package/dist/sdk/client/acp-client.d.ts +88 -76
  176. package/dist/sdk/client/acp-client.d.ts.map +1 -0
  177. package/dist/sdk/client/acp-client.js +215 -217
  178. package/dist/sdk/client/acp-client.js.map +1 -0
  179. package/dist/sdk/client/index.d.ts.map +1 -0
  180. package/dist/sdk/client/index.js.map +1 -0
  181. package/dist/sdk/index.d.ts.map +1 -0
  182. package/dist/sdk/index.js.map +1 -0
  183. package/dist/sdk/schemas/agent.d.ts +111 -64
  184. package/dist/sdk/schemas/agent.d.ts.map +1 -0
  185. package/dist/sdk/schemas/agent.js +24 -24
  186. package/dist/sdk/schemas/agent.js.map +1 -0
  187. package/dist/sdk/schemas/index.d.ts.map +1 -0
  188. package/dist/sdk/schemas/index.js.map +1 -0
  189. package/dist/sdk/schemas/message.d.ts +245 -147
  190. package/dist/sdk/schemas/message.d.ts.map +1 -0
  191. package/dist/sdk/schemas/message.js +40 -40
  192. package/dist/sdk/schemas/message.js.map +1 -0
  193. package/dist/sdk/schemas/session.d.ts +219 -135
  194. package/dist/sdk/schemas/session.d.ts.map +1 -0
  195. package/dist/sdk/schemas/session.js +27 -27
  196. package/dist/sdk/schemas/session.js.map +1 -0
  197. package/dist/sdk/transports/http.d.ts +55 -55
  198. package/dist/sdk/transports/http.d.ts.map +1 -0
  199. package/dist/sdk/transports/http.js +472 -469
  200. package/dist/sdk/transports/http.js.map +1 -0
  201. package/dist/sdk/transports/index.d.ts.map +1 -0
  202. package/dist/sdk/transports/index.js.map +1 -0
  203. package/dist/sdk/transports/stdio.d.ts +20 -20
  204. package/dist/sdk/transports/stdio.d.ts.map +1 -0
  205. package/dist/sdk/transports/stdio.js.map +1 -0
  206. package/dist/sdk/transports/types.d.ts +42 -42
  207. package/dist/sdk/transports/types.d.ts.map +1 -0
  208. package/dist/sdk/transports/types.js.map +1 -0
  209. package/dist/sdk/transports/websocket.d.ts +12 -12
  210. package/dist/sdk/transports/websocket.d.ts.map +1 -0
  211. package/dist/sdk/transports/websocket.js +52 -46
  212. package/dist/sdk/transports/websocket.js.map +1 -0
  213. package/dist/tui/components/ChatView.d.ts +4 -2
  214. package/dist/tui/components/ChatView.d.ts.map +1 -0
  215. package/dist/tui/components/ChatView.js +51 -18
  216. package/dist/tui/components/ChatView.js.map +1 -0
  217. package/dist/tui/components/GameOfLife.d.ts.map +1 -0
  218. package/dist/tui/components/GameOfLife.js +64 -35
  219. package/dist/tui/components/GameOfLife.js.map +1 -0
  220. package/dist/tui/components/InputBox.d.ts +18 -11
  221. package/dist/tui/components/InputBox.d.ts.map +1 -0
  222. package/dist/tui/components/InputBox.js +70 -10
  223. package/dist/tui/components/InputBox.js.map +1 -0
  224. package/dist/tui/components/MessageList.d.ts +4 -2
  225. package/dist/tui/components/MessageList.d.ts.map +1 -0
  226. package/dist/tui/components/MessageList.js +37 -10
  227. package/dist/tui/components/MessageList.js.map +1 -0
  228. package/dist/tui/components/ReadlineInput.d.ts +12 -6
  229. package/dist/tui/components/ReadlineInput.d.ts.map +1 -0
  230. package/dist/tui/components/ReadlineInput.js +252 -237
  231. package/dist/tui/components/ReadlineInput.js.map +1 -0
  232. package/dist/tui/components/SingleSelect.d.ts +15 -9
  233. package/dist/tui/components/SingleSelect.js +84 -43
  234. package/dist/tui/components/StatusBar.d.ts +11 -6
  235. package/dist/tui/components/StatusBar.d.ts.map +1 -0
  236. package/dist/tui/components/StatusBar.js +102 -67
  237. package/dist/tui/components/StatusBar.js.map +1 -0
  238. package/dist/tui/components/index.d.ts.map +1 -0
  239. package/dist/tui/components/index.js.map +1 -0
  240. package/dist/tui/index.d.ts.map +1 -0
  241. package/dist/tui/index.js.map +1 -0
  242. package/package.json +6 -4
  243. package/src/styles/global.css +2 -0
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import type { TodoItem } from "./TodoListItem.js";
3
+ /**
4
+ * Shared tab content components for both mobile (ChatHeader) and desktop (Panel) views
5
+ * Following component architecture best practices
6
+ */
7
+ export interface TodoTabContentProps extends React.HTMLAttributes<HTMLDivElement> {
8
+ todos: TodoItem[];
9
+ }
10
+ export declare const TodoTabContent: React.ForwardRefExoticComponent<TodoTabContentProps & React.RefAttributes<HTMLDivElement>>;
11
+ export interface FilesTabContentProps extends React.HTMLAttributes<HTMLDivElement> {
12
+ files?: string[];
13
+ }
14
+ export declare const FilesTabContent: React.ForwardRefExoticComponent<FilesTabContentProps & React.RefAttributes<HTMLDivElement>>;
15
+ export interface DatabaseTabContentProps extends React.HTMLAttributes<HTMLDivElement> {
16
+ data?: unknown;
17
+ }
18
+ export declare const DatabaseTabContent: React.ForwardRefExoticComponent<DatabaseTabContentProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../lib/utils.js";
4
+ export const TodoTabContent = React.forwardRef(({ todos, className, ...props }, ref) => {
5
+ return (_jsx("div", { ref: ref, className: cn("space-y-2", className), ...props, children: todos.length === 0 ? (_jsx("div", { className: "flex items-center justify-center h-full min-h-[200px]", children: _jsx("p", { className: "text-sm text-muted-foreground", children: "No todos yet" }) })) : (todos.map((todo) => (_jsx("div", { className: "text-sm", children: todo.text }, todo.id)))) }));
6
+ });
7
+ TodoTabContent.displayName = "TodoTabContent";
8
+ export const FilesTabContent = React.forwardRef(({ files = [], className, ...props }, ref) => {
9
+ return (_jsx("div", { ref: ref, className: cn("space-y-2", className), ...props, children: files.length === 0 ? (_jsx("div", { className: "flex items-center justify-center h-full min-h-[200px]", children: _jsx("p", { className: "text-sm text-muted-foreground", children: "No files attached" }) })) : (files.map((file) => (_jsx("div", { className: "text-sm", children: file }, file)))) }));
10
+ });
11
+ FilesTabContent.displayName = "FilesTabContent";
12
+ export const DatabaseTabContent = React.forwardRef(({ data, className, ...props }, ref) => {
13
+ return (_jsxs("div", { ref: ref, className: cn("space-y-4", className), ...props, children: [_jsx("h3", { className: "font-semibold text-lg", children: "Database" }), _jsxs("div", { className: "text-sm text-muted-foreground", children: [_jsx("p", { children: "Database viewer - panel automatically expanded to large size" }), _jsxs("div", { className: "mt-4 p-4 border border-border rounded", children: [_jsx("p", { children: "Your large data table would go here" }), data && typeof data === "object" ? (_jsx("pre", { className: "mt-2 text-xs overflow-auto", children: JSON.stringify(data, null, 2) })) : null] })] })] }));
14
+ });
15
+ DatabaseTabContent.displayName = "DatabaseTabContent";
@@ -0,0 +1,12 @@
1
+ import type { ThemeConfig } from "./ConfigPanel.js";
2
+ interface ChatPreviewProps {
3
+ config: ThemeConfig;
4
+ status: string;
5
+ iframeSrc?: string;
6
+ }
7
+ export declare function ChatPreview({
8
+ config,
9
+ status,
10
+ iframeSrc,
11
+ }: ChatPreviewProps): import("react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=ChatPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatPreview.d.ts","sourceRoot":"","sources":["../../../src/gui/components/ChatPreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,UAAU,gBAAgB;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAYD,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,MAAM,EACN,SAA8B,GAC/B,EAAE,gBAAgB,2CA2OlB"}
@@ -0,0 +1,214 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ export function ChatPreview({
4
+ config,
5
+ status,
6
+ iframeSrc = "/chat-standalone",
7
+ }) {
8
+ const iframeRef = useRef(null);
9
+ const containerRef = useRef(null);
10
+ const [dimensions, setDimensions] = useState({
11
+ width: 800,
12
+ height: 600,
13
+ });
14
+ const [isResizing, setIsResizing] = useState({
15
+ horizontal: false,
16
+ vertical: false,
17
+ });
18
+ const resizeStartRef = useRef({ x: 0, y: 0, width: 0, height: 0 });
19
+ const isResizingRef = useRef({
20
+ horizontal: false,
21
+ vertical: false,
22
+ });
23
+ const resizeHandlersRef = useRef({
24
+ mouseMove: null,
25
+ mouseUp: null,
26
+ mouseLeave: null,
27
+ });
28
+ const sendConfigToIframe = (configToSend) => {
29
+ const iframe = iframeRef.current;
30
+ if (iframe?.contentWindow) {
31
+ iframe.contentWindow.postMessage(
32
+ {
33
+ type: "CONFIG_UPDATE",
34
+ config: configToSend,
35
+ },
36
+ "*",
37
+ );
38
+ }
39
+ };
40
+ const sendStatusToIframe = (statusToSend) => {
41
+ const iframe = iframeRef.current;
42
+ if (iframe?.contentWindow) {
43
+ iframe.contentWindow.postMessage(
44
+ {
45
+ type: "STATUS_UPDATE",
46
+ status: statusToSend,
47
+ },
48
+ "*",
49
+ );
50
+ }
51
+ };
52
+ useEffect(() => {
53
+ const iframe = iframeRef.current;
54
+ if (!iframe) return;
55
+ const handleMessage = (event) => {
56
+ if (event.data && event.data.type === "REQUEST_CONFIG") {
57
+ sendConfigToIframe(config);
58
+ }
59
+ };
60
+ window.addEventListener("message", handleMessage);
61
+ // Send initial config and status when iframe loads
62
+ const handleLoad = () => {
63
+ sendConfigToIframe(config);
64
+ sendStatusToIframe(status);
65
+ };
66
+ iframe.addEventListener("load", handleLoad);
67
+ return () => {
68
+ window.removeEventListener("message", handleMessage);
69
+ iframe.removeEventListener("load", handleLoad);
70
+ };
71
+ }, [config, status]);
72
+ // Update iframe when config changes (after initial load)
73
+ useEffect(() => {
74
+ const iframe = iframeRef.current;
75
+ // Only send if iframe is already loaded
76
+ if (
77
+ iframe?.contentWindow &&
78
+ iframe.contentDocument?.readyState === "complete"
79
+ ) {
80
+ sendConfigToIframe(config);
81
+ }
82
+ }, [config]);
83
+ // Update iframe when status changes (after initial load)
84
+ useEffect(() => {
85
+ const iframe = iframeRef.current;
86
+ // Only send if iframe is already loaded
87
+ if (
88
+ iframe?.contentWindow &&
89
+ iframe.contentDocument?.readyState === "complete"
90
+ ) {
91
+ sendStatusToIframe(status);
92
+ }
93
+ }, [status]);
94
+ // Sync ref with state for UI updates
95
+ useEffect(() => {
96
+ isResizingRef.current = isResizing;
97
+ }, [isResizing]);
98
+ // Cleanup on unmount
99
+ useEffect(() => {
100
+ return () => {
101
+ stopResizing();
102
+ };
103
+ }, []);
104
+ const stopResizing = () => {
105
+ const handlers = resizeHandlersRef.current;
106
+ if (handlers.mouseMove) {
107
+ window.removeEventListener("mousemove", handlers.mouseMove);
108
+ }
109
+ if (handlers.mouseUp) {
110
+ window.removeEventListener("mouseup", handlers.mouseUp, true);
111
+ }
112
+ if (handlers.mouseLeave) {
113
+ document.removeEventListener("mouseleave", handlers.mouseLeave);
114
+ }
115
+ setIsResizing({ horizontal: false, vertical: false });
116
+ isResizingRef.current = { horizontal: false, vertical: false };
117
+ resizeHandlersRef.current = {
118
+ mouseMove: null,
119
+ mouseUp: null,
120
+ mouseLeave: null,
121
+ };
122
+ };
123
+ const handleResizeStart = (direction, e) => {
124
+ e.preventDefault();
125
+ e.stopPropagation();
126
+ // Clean up any existing listeners first
127
+ stopResizing();
128
+ const resizeState =
129
+ direction === "horizontal"
130
+ ? { horizontal: true, vertical: false }
131
+ : { horizontal: false, vertical: true };
132
+ setIsResizing(resizeState);
133
+ isResizingRef.current = resizeState;
134
+ resizeStartRef.current = {
135
+ x: e.clientX,
136
+ y: e.clientY,
137
+ width: dimensions.width,
138
+ height: dimensions.height,
139
+ };
140
+ const handleMouseMove = (e) => {
141
+ if (
142
+ !isResizingRef.current.horizontal &&
143
+ !isResizingRef.current.vertical
144
+ ) {
145
+ return;
146
+ }
147
+ const deltaX = e.clientX - resizeStartRef.current.x;
148
+ const deltaY = e.clientY - resizeStartRef.current.y;
149
+ let newWidth = resizeStartRef.current.width;
150
+ let newHeight = resizeStartRef.current.height;
151
+ if (isResizingRef.current.horizontal) {
152
+ newWidth = Math.max(
153
+ 400,
154
+ Math.min(1200, resizeStartRef.current.width + deltaX),
155
+ );
156
+ }
157
+ if (isResizingRef.current.vertical) {
158
+ newHeight = Math.max(
159
+ 300,
160
+ Math.min(900, resizeStartRef.current.height + deltaY),
161
+ );
162
+ }
163
+ setDimensions({ width: newWidth, height: newHeight });
164
+ };
165
+ const handleMouseUp = (e) => {
166
+ e.preventDefault();
167
+ e.stopPropagation();
168
+ stopResizing();
169
+ };
170
+ const handleMouseLeave = () => {
171
+ // If mouse leaves window during resize, stop resizing
172
+ stopResizing();
173
+ };
174
+ // Store handlers for cleanup
175
+ resizeHandlersRef.current = {
176
+ mouseMove: handleMouseMove,
177
+ mouseUp: handleMouseUp,
178
+ mouseLeave: handleMouseLeave,
179
+ };
180
+ // Use capture phase to ensure we catch events even if they bubble
181
+ window.addEventListener("mousemove", handleMouseMove);
182
+ window.addEventListener("mouseup", handleMouseUp, { capture: true });
183
+ document.addEventListener("mouseleave", handleMouseLeave);
184
+ };
185
+ return _jsxs("div", {
186
+ ref: containerRef,
187
+ className:
188
+ "relative rounded-xl overflow-visible bg-[var(--color-surface)] shadow-lg min-w-[400px] min-h-[300px]",
189
+ style: {
190
+ width: `${dimensions.width}px`,
191
+ height: `${dimensions.height}px`,
192
+ },
193
+ children: [
194
+ _jsx("iframe", {
195
+ ref: iframeRef,
196
+ src: iframeSrc,
197
+ className:
198
+ "w-full h-full rounded-xl border-1 border-[var(--color-border)] block",
199
+ title: "Chat Preview",
200
+ }),
201
+ _jsx("div", {
202
+ className:
203
+ "absolute -right-4 top-1/2 -translate-y-1/2 w-1.5 h-10 rounded-full bg-black/20 cursor-ew-resize hover:opacity-80 transition-opacity",
204
+ onMouseDown: (e) => handleResizeStart("horizontal", e),
205
+ }),
206
+ _jsx("div", {
207
+ className:
208
+ "absolute -bottom-4 left-1/2 -translate-x-1/2 w-10 h-1.5 rounded-full bg-black/20 cursor-ns-resize hover:opacity-80 transition-opacity",
209
+ onMouseDown: (e) => handleResizeStart("vertical", e),
210
+ }),
211
+ ],
212
+ });
213
+ }
214
+ //# sourceMappingURL=ChatPreview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatPreview.js","sourceRoot":"","sources":["../../../src/gui/components/ChatPreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAA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gB,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAC5D,CAAC,CAAC;IAEF,OAAO,CACL,eACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAC,sGAAsG,EAChH,KAAK,EAAE;YACL,KAAK,EAAE,GAAG,UAAU,CAAC,KAAK,IAAI;YAC9B,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,IAAI;SACjC,aAED,iBACE,GAAG,EAAE,SAAS,EACd,GAAG,EAAE,SAAS,EACd,SAAS,EAAC,sEAAsE,EAChF,KAAK,EAAC,cAAc,GACpB,EACF,cACE,SAAS,EAAC,qIAAqI,EAC/I,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,YAAY,EAAE,CAAC,CAAC,GACtD,EACF,cACE,SAAS,EAAC,uIAAuI,EACjJ,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,EAAE,CAAC,CAAC,GACpD,IACE,CACP,CAAC;AACJ,CAAC"}
@@ -6,15 +6,18 @@ import type { TodoItem } from "./TodoListItem.js";
6
6
  * 1. Hook-based: Pass `client` prop (future support when todos are in store)
7
7
  * 2. Prop-based: Pass `todos` prop directly
8
8
  */
9
- export interface ChatSecondaryPanelProps extends React.HTMLAttributes<HTMLDivElement> {
10
- /**
11
- * ACP Client for hook-based todo fetching (future support)
12
- */
13
- client?: AcpClient | null;
14
- /**
15
- * Todos to display (prop-based pattern)
16
- * Either client or todos should be provided
17
- */
18
- todos?: TodoItem[];
9
+ export interface ChatSecondaryPanelProps
10
+ extends React.HTMLAttributes<HTMLDivElement> {
11
+ /**
12
+ * ACP Client for hook-based todo fetching (future support)
13
+ */
14
+ client?: AcpClient | null;
15
+ /**
16
+ * Todos to display (prop-based pattern)
17
+ * Either client or todos should be provided
18
+ */
19
+ todos?: TodoItem[];
19
20
  }
20
- export declare const ChatSecondaryPanel: React.ForwardRefExoticComponent<ChatSecondaryPanelProps & React.RefAttributes<HTMLDivElement>>;
21
+ export declare const ChatSecondaryPanel: React.ForwardRefExoticComponent<
22
+ ChatSecondaryPanelProps & React.RefAttributes<HTMLDivElement>
23
+ >;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatSecondaryPanel.d.ts","sourceRoot":"","sources":["../../../src/gui/components/ChatSecondaryPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;;;GAIG;AACH,MAAM,WAAW,uBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,kBAAkB,gGAwG7B,CAAC"}
@@ -1,44 +1,121 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
1
  import * as React from "react";
3
2
  import { useEffect, useRef, useState } from "react";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import { cn } from "../lib/utils.js";
5
5
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "./Tabs.js";
6
6
  import { TodoList } from "./TodoList.js";
7
- export const ChatSecondaryPanel = React.forwardRef(({ client, todos, className, ...props }, ref) => {
8
- // For now, just use prop-based todos
9
- // Future: Add hook to get todos from store when available
10
- const todosToDisplay = todos || [];
11
- const [activeTab, setActiveTab] = useState("todo");
12
- const containerRef = useRef(null);
13
- const activeTabElementRef = useRef(null);
14
- useEffect(() => {
15
- const updateClipPath = () => {
16
- const container = containerRef.current;
17
- if (activeTab && container) {
18
- const activeTabElement = activeTabElementRef.current;
19
- if (activeTabElement) {
20
- const containerRect = container.getBoundingClientRect();
21
- const tabRect = activeTabElement.getBoundingClientRect();
22
- const offsetLeft = tabRect.left - containerRect.left;
23
- const offsetWidth = tabRect.width;
24
- const clipLeftPercent = (offsetLeft / containerRect.width) * 100;
25
- const clipRightPercent = 100 - ((offsetLeft + offsetWidth) / containerRect.width) * 100;
26
- container.style.clipPath = `inset(0 ${clipRightPercent.toFixed(2)}% 0 ${clipLeftPercent.toFixed(2)}% round 999px)`;
27
- }
28
- }
29
- };
30
- // Small delay to ensure DOM is ready
31
- const timeoutId = setTimeout(updateClipPath, 0);
32
- return () => clearTimeout(timeoutId);
33
- }, [activeTab]);
34
- const tabs = [
35
- { id: "todo", label: "To-Do List" },
36
- { id: "files", label: "Files" },
37
- { id: "database", label: "Database" },
38
- ];
39
- return (_jsx("div", { ref: ref, className: cn("select-none", className), ...props, children: _jsxs(Tabs, { value: activeTab, onValueChange: setActiveTab, className: "w-full", children: [_jsxs("div", { className: "relative mb-4 border-border", children: [_jsx(TabsList, { className: "bg-transparent p-0 h-auto rounded-none w-full border-none", children: tabs.map((tab) => (_jsx(TabsTrigger, { value: tab.id, className: "px-3 py-1 text-sm font-[var(--font-family)] font-medium rounded-none text-foreground opacity-60 data-[state=active]:opacity-100 data-[state=active]:bg-transparent data-[state=active]:shadow-none", children: tab.label }, tab.id))) }), _jsx("div", { ref: containerRef, className: "absolute top-0 left-0 w-full overflow-hidden z-10 pointer-events-none", style: {
40
- clipPath: "inset(0 100% 0 0% round 999px)",
41
- transition: "clip-path 0.25s ease-out",
42
- }, children: _jsx(TabsList, { className: "bg-secondary p-0 h-auto rounded-none w-full border-none", children: tabs.map((tab) => (_jsx(TabsTrigger, { value: tab.id, ref: activeTab === tab.id ? activeTabElementRef : null, className: "px-3 py-1 text-sm font-[var(--font-family)] font-medium rounded-none text-primary bg-transparent data-[state=active]:shadow-none shadow-none", tabIndex: -1, children: tab.label }, tab.id))) }) })] }), _jsx(TabsContent, { value: "todo", children: _jsx(TodoList, { todos: todosToDisplay }) }), _jsx(TabsContent, { value: "files", children: _jsx("div", { className: "text-sm text-foreground opacity-60 italic", children: "Files tab coming soon..." }) }), _jsx(TabsContent, { value: "database", children: _jsx("div", { className: "text-sm text-foreground opacity-60 italic", children: "Database tab coming soon..." }) })] }) }));
43
- });
7
+ export const ChatSecondaryPanel = React.forwardRef(
8
+ ({ client, todos, className, ...props }, ref) => {
9
+ // For now, just use prop-based todos
10
+ // Future: Add hook to get todos from store when available
11
+ const todosToDisplay = todos || [];
12
+ const [activeTab, setActiveTab] = useState("todo");
13
+ const containerRef = useRef(null);
14
+ const activeTabElementRef = useRef(null);
15
+ useEffect(() => {
16
+ const updateClipPath = () => {
17
+ const container = containerRef.current;
18
+ if (activeTab && container) {
19
+ const activeTabElement = activeTabElementRef.current;
20
+ if (activeTabElement) {
21
+ const containerRect = container.getBoundingClientRect();
22
+ const tabRect = activeTabElement.getBoundingClientRect();
23
+ const offsetLeft = tabRect.left - containerRect.left;
24
+ const offsetWidth = tabRect.width;
25
+ const clipLeftPercent = (offsetLeft / containerRect.width) * 100;
26
+ const clipRightPercent =
27
+ 100 - ((offsetLeft + offsetWidth) / containerRect.width) * 100;
28
+ container.style.clipPath = `inset(0 ${clipRightPercent.toFixed(2)}% 0 ${clipLeftPercent.toFixed(2)}% round 999px)`;
29
+ }
30
+ }
31
+ };
32
+ // Small delay to ensure DOM is ready
33
+ const timeoutId = setTimeout(updateClipPath, 0);
34
+ return () => clearTimeout(timeoutId);
35
+ }, [activeTab]);
36
+ const tabs = [
37
+ { id: "todo", label: "To-Do List" },
38
+ { id: "files", label: "Files" },
39
+ { id: "database", label: "Database" },
40
+ ];
41
+ return _jsx("div", {
42
+ ref: ref,
43
+ className: cn("select-none", className),
44
+ ...props,
45
+ children: _jsxs(Tabs, {
46
+ value: activeTab,
47
+ onValueChange: setActiveTab,
48
+ className: "w-full",
49
+ children: [
50
+ _jsxs("div", {
51
+ className: "relative mb-4 border-border",
52
+ children: [
53
+ _jsx(TabsList, {
54
+ className:
55
+ "bg-transparent p-0 h-auto rounded-none w-full border-none",
56
+ children: tabs.map((tab) =>
57
+ _jsx(
58
+ TabsTrigger,
59
+ {
60
+ value: tab.id,
61
+ className:
62
+ "px-3 py-1 text-sm font-[var(--font-family)] font-medium rounded-none text-foreground opacity-60 data-[state=active]:opacity-100 data-[state=active]:bg-transparent data-[state=active]:shadow-none",
63
+ children: tab.label,
64
+ },
65
+ tab.id,
66
+ ),
67
+ ),
68
+ }),
69
+ _jsx("div", {
70
+ ref: containerRef,
71
+ className:
72
+ "absolute top-0 left-0 w-full overflow-hidden z-10 pointer-events-none",
73
+ style: {
74
+ clipPath: "inset(0 100% 0 0% round 999px)",
75
+ transition: "clip-path 0.25s ease-out",
76
+ },
77
+ children: _jsx(TabsList, {
78
+ className:
79
+ "bg-secondary p-0 h-auto rounded-none w-full border-none",
80
+ children: tabs.map((tab) =>
81
+ _jsx(
82
+ TabsTrigger,
83
+ {
84
+ value: tab.id,
85
+ ref: activeTab === tab.id ? activeTabElementRef : null,
86
+ className:
87
+ "px-3 py-1 text-sm font-[var(--font-family)] font-medium rounded-none text-primary bg-transparent data-[state=active]:shadow-none shadow-none",
88
+ tabIndex: -1,
89
+ children: tab.label,
90
+ },
91
+ tab.id,
92
+ ),
93
+ ),
94
+ }),
95
+ }),
96
+ ],
97
+ }),
98
+ _jsx(TabsContent, {
99
+ value: "todo",
100
+ children: _jsx(TodoList, { todos: todosToDisplay }),
101
+ }),
102
+ _jsx(TabsContent, {
103
+ value: "files",
104
+ children: _jsx("div", {
105
+ className: "text-sm text-foreground opacity-60 italic",
106
+ children: "Files tab coming soon...",
107
+ }),
108
+ }),
109
+ _jsx(TabsContent, {
110
+ value: "database",
111
+ children: _jsx("div", {
112
+ className: "text-sm text-foreground opacity-60 italic",
113
+ children: "Database tab coming soon...",
114
+ }),
115
+ }),
116
+ ],
117
+ }),
118
+ });
119
+ },
120
+ );
44
121
  ChatSecondaryPanel.displayName = "ChatSecondaryPanel";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatSec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EAAE,GAAG,CAAC,EAAE,EACb,SAAS,EAAC,6MAA6M,YAEtN,GAAG,CAAC,KAAK,IAJL,GAAG,CAAC,EAAE,CAKC,CACf,CAAC,GACO,EAGX,cACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAC,uEAAuE,EACjF,KAAK,EAAE;gCACL,QAAQ,EAAE,gCAAgC;gCAC1C,UAAU,EAAE,0BAA0B;6BACvC,YAED,KAAC,QAAQ,IAAC,SAAS,EAAC,uEAAuE,YACxF,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,KAAC,WAAW,IAEV,KAAK,EAAE,GAAG,CAAC,EAAE,EACb,GAAG,EAAE,SAAS,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,EACtD,SAAS,EAAC,8IAA8I,EACxJ,QAAQ,EAAE,CAAC,CAAC,YAEX,GAAG,CAAC,KAAK,IANL,GAAG,CAAC,EAAE,CAOC,CACf,CAAC,GACO,GACP,IACF,EAGN,KAAC,WAAW,IAAC,KAAK,EAAC,MAAM,YACvB,KAAC,QAAQ,IAAC,KAAK,EAAE,cAAc,GAAI,GACvB,EAEd,KAAC,WAAW,IAAC,KAAK,EAAC,OAAO,YACxB,cAAK,SAAS,EAAC,oDAAoD,yCAE7D,GACM,EAEd,KAAC,WAAW,IAAC,KAAK,EAAC,UAAU,YAC3B,cAAK,SAAS,EAAC,oDAAoD,4CAE7D,GACM,IACT,GACH,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ export interface ChatSidebarRootProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ }
4
+ declare const ChatSidebarRoot: React.ForwardRefExoticComponent<ChatSidebarRootProps & React.RefAttributes<HTMLDivElement>>;
5
+ export interface ChatSidebarHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ }
7
+ declare const ChatSidebarHeader: React.ForwardRefExoticComponent<ChatSidebarHeaderProps & React.RefAttributes<HTMLDivElement>>;
8
+ export interface ChatSidebarContentProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ }
10
+ declare const ChatSidebarContent: React.ForwardRefExoticComponent<ChatSidebarContentProps & React.RefAttributes<HTMLDivElement>>;
11
+ export interface ChatSidebarFooterProps extends React.HTMLAttributes<HTMLDivElement> {
12
+ }
13
+ declare const ChatSidebarFooter: React.ForwardRefExoticComponent<ChatSidebarFooterProps & React.RefAttributes<HTMLDivElement>>;
14
+ export { ChatSidebarRoot as Root, ChatSidebarHeader as Header, ChatSidebarContent as Content, ChatSidebarFooter as Footer, };
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../lib/utils.js";
4
+ const ChatSidebarRoot = React.forwardRef(({ className, children, ...props }, ref) => {
5
+ return (_jsx("div", { ref: ref, className: cn("flex h-full flex-col", className), ...props, children: children }));
6
+ });
7
+ ChatSidebarRoot.displayName = "ChatSidebar.Root";
8
+ const ChatSidebarHeader = React.forwardRef(({ className, children, ...props }, ref) => {
9
+ return (_jsx("div", { ref: ref, className: cn("border-b border-border px-4 py-3", className), ...props, children: children }));
10
+ });
11
+ ChatSidebarHeader.displayName = "ChatSidebar.Header";
12
+ const ChatSidebarContent = React.forwardRef(({ className, children, ...props }, ref) => {
13
+ return (_jsx("div", { ref: ref, className: cn("flex-1 overflow-y-auto p-4", className), ...props, children: children }));
14
+ });
15
+ ChatSidebarContent.displayName = "ChatSidebar.Content";
16
+ const ChatSidebarFooter = React.forwardRef(({ className, children, ...props }, ref) => {
17
+ return (_jsx("div", { ref: ref, className: cn("border-t border-border px-4 py-3", className), ...props, children: children }));
18
+ });
19
+ ChatSidebarFooter.displayName = "ChatSidebar.Footer";
20
+ /* -------------------------------------------------------------------------------------------------
21
+ * Exports
22
+ * -----------------------------------------------------------------------------------------------*/
23
+ export { ChatSidebarRoot as Root, ChatSidebarHeader as Header, ChatSidebarContent as Content, ChatSidebarFooter as Footer, };
@@ -1,6 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { type ReactNode } from "react";
3
3
  export interface ChatStatusProps extends React.HTMLAttributes<HTMLSpanElement> {
4
- children: ReactNode;
4
+ children: ReactNode;
5
5
  }
6
- export declare const ChatStatus: React.ForwardRefExoticComponent<ChatStatusProps & React.RefAttributes<HTMLSpanElement>>;
6
+ export declare const ChatStatus: React.ForwardRefExoticComponent<
7
+ ChatStatusProps & React.RefAttributes<HTMLSpanElement>
8
+ >;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatStatus.d.ts","sourceRoot":"","sources":["../../../src/gui/components/ChatStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpE,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IAC5E,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,yFAqDtB,CAAC"}
@@ -1,38 +1,49 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  import * as React from "react";
3
2
  import { useEffect, useRef, useState } from "react";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { cn } from "../lib/utils.js";
5
- export const ChatStatus = React.forwardRef(({ children, className, ...props }, ref) => {
6
- const [displayContent, setDisplayContent] = useState(children);
7
- const [isTransitioning, setIsTransitioning] = useState(false);
8
- const previousContentRef = useRef(children);
9
- const isInitialMountRef = useRef(true);
10
- useEffect(() => {
11
- // Skip transition on initial mount
12
- if (isInitialMountRef.current) {
13
- isInitialMountRef.current = false;
14
- previousContentRef.current = children;
15
- return;
16
- }
17
- // Only transition if content actually changed
18
- if (previousContentRef.current === children) {
19
- return;
20
- }
21
- // Start transition out
22
- setIsTransitioning(true);
23
- // After fade out, update content and fade in
24
- const timeoutId = setTimeout(() => {
25
- setDisplayContent(children);
26
- previousContentRef.current = children;
27
- // Trigger fade in
28
- requestAnimationFrame(() => {
29
- setIsTransitioning(false);
30
- });
31
- }, 150); // Half of transition duration (300ms total)
32
- return () => {
33
- clearTimeout(timeoutId);
34
- };
35
- }, [children]);
36
- return (_jsx("span", { ref: ref, className: cn("text-sm text-foreground opacity-60 transition-opacity duration-300", isTransitioning ? "opacity-0" : "opacity-60", className), ...props, children: displayContent }));
37
- });
5
+ export const ChatStatus = React.forwardRef(
6
+ ({ children, className, ...props }, ref) => {
7
+ const [displayContent, setDisplayContent] = useState(children);
8
+ const [isTransitioning, setIsTransitioning] = useState(false);
9
+ const previousContentRef = useRef(children);
10
+ const isInitialMountRef = useRef(true);
11
+ useEffect(() => {
12
+ // Skip transition on initial mount
13
+ if (isInitialMountRef.current) {
14
+ isInitialMountRef.current = false;
15
+ previousContentRef.current = children;
16
+ return;
17
+ }
18
+ // Only transition if content actually changed
19
+ if (previousContentRef.current === children) {
20
+ return;
21
+ }
22
+ // Start transition out
23
+ setIsTransitioning(true);
24
+ // After fade out, update content and fade in
25
+ const timeoutId = setTimeout(() => {
26
+ setDisplayContent(children);
27
+ previousContentRef.current = children;
28
+ // Trigger fade in
29
+ requestAnimationFrame(() => {
30
+ setIsTransitioning(false);
31
+ });
32
+ }, 150); // Half of transition duration (300ms total)
33
+ return () => {
34
+ clearTimeout(timeoutId);
35
+ };
36
+ }, [children]);
37
+ return _jsx("span", {
38
+ ref: ref,
39
+ className: cn(
40
+ "text-sm text-foreground opacity-60 transition-opacity duration-300",
41
+ isTransitioning ? "opacity-0" : "opacity-60",
42
+ className,
43
+ ),
44
+ ...props,
45
+ children: displayContent,
46
+ });
47
+ },
48
+ );
38
49
  ChatStatus.displayName = "ChatStatus";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatStatus.js","sourceRoot":"","sources":["../../../src/gui/components/ChatStatus.tsx"],"names":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E,GAAG,CAAC,CAAC,CAAC,4CAA4C;QAErD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,eACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,6EAA6E,EAC7E,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,EAC5C,SAAS,CACV,KACG,KAAK,YAER,cAAc,GACV,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AACF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { AcpClient } from "@agent-hub/sdk";
2
+ export interface ChatViewProps {
3
+ client: AcpClient | null;
4
+ }
5
+ export declare function ChatView({
6
+ client,
7
+ }: ChatViewProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=ChatView.d.ts.map