@townco/ui 0.1.6 → 0.1.7
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.
- package/README.md +11 -11
- package/dist/core/hooks/use-chat-input.d.ts +17 -17
- package/dist/core/hooks/use-chat-input.js +55 -64
- package/dist/core/hooks/use-chat-messages.d.ts +11 -11
- package/dist/core/hooks/use-chat-messages.js +114 -121
- package/dist/core/hooks/use-chat-session.d.ts +5 -5
- package/dist/core/hooks/use-chat-session.js +80 -78
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/schemas/chat.d.ts +56 -83
- package/dist/core/schemas/chat.js +25 -27
- package/dist/core/store/chat-store.d.ts +22 -28
- package/dist/core/store/chat-store.js +50 -59
- package/dist/gui/components/Button.d.ts +7 -23
- package/dist/gui/components/Button.js +27 -40
- package/dist/gui/components/Card.d.ts +7 -26
- package/dist/gui/components/Card.js +8 -54
- package/dist/gui/components/ChatInput.d.ts +36 -58
- package/dist/gui/components/ChatInput.js +121 -191
- package/dist/gui/components/ChatSecondaryPanel.d.ts +11 -14
- package/dist/gui/components/ChatSecondaryPanel.js +38 -115
- package/dist/gui/components/ChatStatus.d.ts +2 -4
- package/dist/gui/components/ChatStatus.js +34 -45
- package/dist/gui/components/Conversation.d.ts +14 -17
- package/dist/gui/components/Conversation.js +83 -143
- package/dist/gui/components/Dialog.d.ts +11 -57
- package/dist/gui/components/Dialog.js +8 -84
- package/dist/gui/components/HeightTransition.d.ts +7 -12
- package/dist/gui/components/HeightTransition.js +77 -88
- package/dist/gui/components/Input.d.ts +6 -13
- package/dist/gui/components/Input.js +16 -27
- package/dist/gui/components/Label.d.ts +1 -7
- package/dist/gui/components/Label.js +2 -12
- package/dist/gui/components/MarkdownRenderer.d.ts +4 -6
- package/dist/gui/components/MarkdownRenderer.js +81 -178
- package/dist/gui/components/Message.d.ts +18 -25
- package/dist/gui/components/Message.js +23 -44
- package/dist/gui/components/MessageContent.d.ts +22 -29
- package/dist/gui/components/MessageContent.js +85 -157
- package/dist/gui/components/Reasoning.d.ts +24 -30
- package/dist/gui/components/Reasoning.js +60 -187
- package/dist/gui/components/Response.d.ts +9 -11
- package/dist/gui/components/Response.js +90 -229
- package/dist/gui/components/Select.d.ts +10 -69
- package/dist/gui/components/Select.js +12 -118
- package/dist/gui/components/Tabs.d.ts +4 -24
- package/dist/gui/components/Tabs.js +4 -32
- package/dist/gui/components/Task.d.ts +24 -28
- package/dist/gui/components/Task.js +31 -164
- package/dist/gui/components/Textarea.d.ts +7 -15
- package/dist/gui/components/Textarea.js +46 -63
- package/dist/gui/components/ThinkingBlock.d.ts +10 -20
- package/dist/gui/components/ThinkingBlock.js +35 -134
- package/dist/gui/components/TodoList.d.ts +10 -12
- package/dist/gui/components/TodoList.js +7 -22
- package/dist/gui/components/TodoListItem.d.ts +6 -9
- package/dist/gui/components/TodoListItem.js +4 -18
- package/dist/gui/components/index.d.ts +8 -59
- package/dist/gui/components/index.js +8 -42
- package/dist/gui/lib/utils.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.test.js +1 -0
- package/dist/sdk/client/acp-client.d.ts +76 -88
- package/dist/sdk/client/acp-client.js +217 -215
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/schemas/agent.d.ts +64 -111
- package/dist/sdk/schemas/agent.js +24 -24
- package/dist/sdk/schemas/message.d.ts +147 -245
- package/dist/sdk/schemas/message.js +40 -40
- package/dist/sdk/schemas/session.d.ts +135 -219
- package/dist/sdk/schemas/session.js +27 -27
- package/dist/sdk/transports/http.d.ts +55 -55
- package/dist/sdk/transports/http.js +469 -472
- package/dist/sdk/transports/stdio.d.ts +20 -20
- package/dist/sdk/transports/stdio.js +286 -289
- package/dist/sdk/transports/types.d.ts +42 -42
- package/dist/sdk/transports/websocket.d.ts +12 -12
- package/dist/sdk/transports/websocket.js +46 -52
- package/dist/tui/components/ChatView.d.ts +2 -4
- package/dist/tui/components/ChatView.js +18 -51
- package/dist/tui/components/GameOfLife.js +35 -64
- package/dist/tui/components/InputBox.d.ts +11 -18
- package/dist/tui/components/InputBox.js +10 -70
- package/dist/tui/components/MessageList.d.ts +2 -4
- package/dist/tui/components/MessageList.js +10 -37
- package/dist/tui/components/MultiSelect.d.ts +10 -15
- package/dist/tui/components/MultiSelect.js +73 -116
- package/dist/tui/components/ReadlineInput.d.ts +6 -12
- package/dist/tui/components/ReadlineInput.js +237 -252
- package/dist/tui/components/SingleSelect.d.ts +9 -15
- package/dist/tui/components/SingleSelect.js +43 -84
- package/dist/tui/components/StatusBar.d.ts +6 -11
- package/dist/tui/components/StatusBar.js +67 -102
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/package.json +2 -2
- package/dist/core/hooks/index.d.ts.map +0 -1
- package/dist/core/hooks/index.js.map +0 -1
- package/dist/core/hooks/use-chat-input.d.ts.map +0 -1
- package/dist/core/hooks/use-chat-input.js.map +0 -1
- package/dist/core/hooks/use-chat-messages.d.ts.map +0 -1
- package/dist/core/hooks/use-chat-messages.js.map +0 -1
- package/dist/core/hooks/use-chat-session.d.ts.map +0 -1
- package/dist/core/hooks/use-chat-session.js.map +0 -1
- package/dist/core/hooks/use-media-query.d.ts +0 -39
- package/dist/core/hooks/use-media-query.js +0 -80
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/schemas/chat.d.ts.map +0 -1
- package/dist/core/schemas/chat.js.map +0 -1
- package/dist/core/schemas/index.d.ts.map +0 -1
- package/dist/core/schemas/index.js.map +0 -1
- package/dist/core/store/chat-store.d.ts.map +0 -1
- package/dist/core/store/chat-store.js.map +0 -1
- package/dist/gui/components/Button.d.ts.map +0 -1
- package/dist/gui/components/Button.js.map +0 -1
- package/dist/gui/components/Card.d.ts.map +0 -1
- package/dist/gui/components/Card.js.map +0 -1
- package/dist/gui/components/ChatHeader.d.ts +0 -65
- package/dist/gui/components/ChatHeader.js +0 -189
- package/dist/gui/components/ChatInput.d.ts.map +0 -1
- package/dist/gui/components/ChatInput.js.map +0 -1
- package/dist/gui/components/ChatInterface.d.ts +0 -12
- package/dist/gui/components/ChatInterface.d.ts.map +0 -1
- package/dist/gui/components/ChatInterface.js +0 -204
- package/dist/gui/components/ChatInterface.js.map +0 -1
- package/dist/gui/components/ChatLayout.d.ts +0 -82
- package/dist/gui/components/ChatLayout.js +0 -232
- package/dist/gui/components/ChatPanelTabContent.d.ts +0 -27
- package/dist/gui/components/ChatPanelTabContent.js +0 -93
- package/dist/gui/components/ChatPreview.d.ts +0 -12
- package/dist/gui/components/ChatPreview.d.ts.map +0 -1
- package/dist/gui/components/ChatPreview.js +0 -214
- package/dist/gui/components/ChatPreview.js.map +0 -1
- package/dist/gui/components/ChatSecondaryPanel.d.ts.map +0 -1
- package/dist/gui/components/ChatSecondaryPanel.js.map +0 -1
- package/dist/gui/components/ChatSidebar.d.ts +0 -27
- package/dist/gui/components/ChatSidebar.js +0 -57
- package/dist/gui/components/ChatStatus.d.ts.map +0 -1
- package/dist/gui/components/ChatStatus.js.map +0 -1
- package/dist/gui/components/ChatView.d.ts +0 -8
- package/dist/gui/components/ChatView.d.ts.map +0 -1
- package/dist/gui/components/ChatView.js +0 -42
- package/dist/gui/components/ChatView.js.map +0 -1
- package/dist/gui/components/ConfigPanel.d.ts +0 -20
- package/dist/gui/components/ConfigPanel.d.ts.map +0 -1
- package/dist/gui/components/ConfigPanel.js +0 -225
- package/dist/gui/components/ConfigPanel.js.map +0 -1
- package/dist/gui/components/Conversation.d.ts.map +0 -1
- package/dist/gui/components/Conversation.js.map +0 -1
- package/dist/gui/components/Dialog.d.ts.map +0 -1
- package/dist/gui/components/Dialog.js.map +0 -1
- package/dist/gui/components/DropdownMenu.d.ts +0 -108
- package/dist/gui/components/DropdownMenu.js +0 -215
- package/dist/gui/components/HeightTransition.d.ts.map +0 -1
- package/dist/gui/components/HeightTransition.js.map +0 -1
- package/dist/gui/components/Input.d.ts.map +0 -1
- package/dist/gui/components/Input.js.map +0 -1
- package/dist/gui/components/InputBox.d.ts +0 -21
- package/dist/gui/components/InputBox.d.ts.map +0 -1
- package/dist/gui/components/InputBox.js +0 -90
- package/dist/gui/components/InputBox.js.map +0 -1
- package/dist/gui/components/Label.d.ts.map +0 -1
- package/dist/gui/components/Label.js.map +0 -1
- package/dist/gui/components/MarkdownRenderer.d.ts.map +0 -1
- package/dist/gui/components/MarkdownRenderer.js.map +0 -1
- package/dist/gui/components/Message.d.ts.map +0 -1
- package/dist/gui/components/Message.js.map +0 -1
- package/dist/gui/components/MessageContent.d.ts.map +0 -1
- package/dist/gui/components/MessageContent.js.map +0 -1
- package/dist/gui/components/MessageList.d.ts.map +0 -1
- package/dist/gui/components/MessageList.js.map +0 -1
- package/dist/gui/components/PlaygroundLayout.d.ts +0 -14
- package/dist/gui/components/PlaygroundLayout.d.ts.map +0 -1
- package/dist/gui/components/PlaygroundLayout.js +0 -49
- package/dist/gui/components/PlaygroundLayout.js.map +0 -1
- package/dist/gui/components/Reasoning.d.ts.map +0 -1
- package/dist/gui/components/Reasoning.js.map +0 -1
- package/dist/gui/components/Response.d.ts.map +0 -1
- package/dist/gui/components/Response.js.map +0 -1
- package/dist/gui/components/Select.d.ts.map +0 -1
- package/dist/gui/components/Select.js.map +0 -1
- package/dist/gui/components/Sonner.d.ts +0 -7
- package/dist/gui/components/Sonner.js +0 -34
- package/dist/gui/components/StatusBar.d.ts +0 -12
- package/dist/gui/components/StatusBar.d.ts.map +0 -1
- package/dist/gui/components/StatusBar.js +0 -58
- package/dist/gui/components/StatusBar.js.map +0 -1
- package/dist/gui/components/Tabs.d.ts.map +0 -1
- package/dist/gui/components/Tabs.js.map +0 -1
- package/dist/gui/components/Task.d.ts.map +0 -1
- package/dist/gui/components/Task.js.map +0 -1
- package/dist/gui/components/Textarea.d.ts.map +0 -1
- package/dist/gui/components/Textarea.js.map +0 -1
- package/dist/gui/components/ThinkingBlock.d.ts.map +0 -1
- package/dist/gui/components/ThinkingBlock.js.map +0 -1
- package/dist/gui/components/TodoList.d.ts.map +0 -1
- package/dist/gui/components/TodoList.js.map +0 -1
- package/dist/gui/components/TodoListItem.d.ts.map +0 -1
- package/dist/gui/components/TodoListItem.js.map +0 -1
- package/dist/gui/components/index.d.ts.map +0 -1
- package/dist/gui/components/index.js.map +0 -1
- package/dist/gui/index.d.ts.map +0 -1
- package/dist/gui/index.js.map +0 -1
- package/dist/gui/lib/utils.d.ts.map +0 -1
- package/dist/gui/lib/utils.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/sdk/client/acp-client.d.ts.map +0 -1
- package/dist/sdk/client/acp-client.js.map +0 -1
- package/dist/sdk/client/index.d.ts.map +0 -1
- package/dist/sdk/client/index.js.map +0 -1
- package/dist/sdk/index.d.ts.map +0 -1
- package/dist/sdk/index.js.map +0 -1
- package/dist/sdk/schemas/agent.d.ts.map +0 -1
- package/dist/sdk/schemas/agent.js.map +0 -1
- package/dist/sdk/schemas/index.d.ts.map +0 -1
- package/dist/sdk/schemas/index.js.map +0 -1
- package/dist/sdk/schemas/message.d.ts.map +0 -1
- package/dist/sdk/schemas/message.js.map +0 -1
- package/dist/sdk/schemas/session.d.ts.map +0 -1
- package/dist/sdk/schemas/session.js.map +0 -1
- package/dist/sdk/transports/http.d.ts.map +0 -1
- package/dist/sdk/transports/http.js.map +0 -1
- package/dist/sdk/transports/index.d.ts.map +0 -1
- package/dist/sdk/transports/index.js.map +0 -1
- package/dist/sdk/transports/stdio.d.ts.map +0 -1
- package/dist/sdk/transports/stdio.js.map +0 -1
- package/dist/sdk/transports/types.d.ts.map +0 -1
- package/dist/sdk/transports/types.js.map +0 -1
- package/dist/sdk/transports/websocket.d.ts.map +0 -1
- package/dist/sdk/transports/websocket.js.map +0 -1
- package/dist/tui/components/ChatView.d.ts.map +0 -1
- package/dist/tui/components/ChatView.js.map +0 -1
- package/dist/tui/components/GameOfLife.d.ts.map +0 -1
- package/dist/tui/components/GameOfLife.js.map +0 -1
- package/dist/tui/components/InputBox.d.ts.map +0 -1
- package/dist/tui/components/InputBox.js.map +0 -1
- package/dist/tui/components/MessageList.d.ts.map +0 -1
- package/dist/tui/components/MessageList.js.map +0 -1
- package/dist/tui/components/ReadlineInput.d.ts.map +0 -1
- package/dist/tui/components/ReadlineInput.js.map +0 -1
- package/dist/tui/components/StatusBar.d.ts.map +0 -1
- package/dist/tui/components/StatusBar.js.map +0 -1
- package/dist/tui/components/index.d.ts.map +0 -1
- package/dist/tui/components/index.js.map +0 -1
- package/dist/tui/index.d.ts.map +0 -1
- package/dist/tui/index.js.map +0 -1
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
interface ChatHeaderContextValue {
|
|
3
|
-
isExpanded: boolean;
|
|
4
|
-
setIsExpanded: (expanded: boolean) => void;
|
|
5
|
-
}
|
|
6
|
-
declare const useChatHeaderContext: () => ChatHeaderContextValue;
|
|
7
|
-
export interface ChatHeaderRootProps
|
|
8
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
-
/** Initial expanded state */
|
|
10
|
-
defaultExpanded?: boolean;
|
|
11
|
-
/** Controlled expanded state */
|
|
12
|
-
expanded?: boolean;
|
|
13
|
-
/** Callback when expanded state changes */
|
|
14
|
-
onExpandedChange?: (expanded: boolean) => void;
|
|
15
|
-
}
|
|
16
|
-
declare const ChatHeaderRoot: React.ForwardRefExoticComponent<
|
|
17
|
-
ChatHeaderRootProps & React.RefAttributes<HTMLDivElement>
|
|
18
|
-
>;
|
|
19
|
-
export interface ChatHeaderTitleProps
|
|
20
|
-
extends React.HTMLAttributes<HTMLHeadingElement> {}
|
|
21
|
-
declare const ChatHeaderTitle: React.ForwardRefExoticComponent<
|
|
22
|
-
ChatHeaderTitleProps & React.RefAttributes<HTMLHeadingElement>
|
|
23
|
-
>;
|
|
24
|
-
export interface ChatHeaderActionsProps
|
|
25
|
-
extends React.HTMLAttributes<HTMLDivElement> {}
|
|
26
|
-
declare const ChatHeaderActions: React.ForwardRefExoticComponent<
|
|
27
|
-
ChatHeaderActionsProps & React.RefAttributes<HTMLDivElement>
|
|
28
|
-
>;
|
|
29
|
-
export type ConnectionStatus =
|
|
30
|
-
| "connected"
|
|
31
|
-
| "connecting"
|
|
32
|
-
| "error"
|
|
33
|
-
| "disconnected";
|
|
34
|
-
export interface ChatHeaderStatusIndicatorProps
|
|
35
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
36
|
-
/** Connection status */
|
|
37
|
-
status: ConnectionStatus;
|
|
38
|
-
/** Optional status text override */
|
|
39
|
-
statusText?: string;
|
|
40
|
-
}
|
|
41
|
-
declare const ChatHeaderStatusIndicator: React.ForwardRefExoticComponent<
|
|
42
|
-
ChatHeaderStatusIndicatorProps & React.RefAttributes<HTMLDivElement>
|
|
43
|
-
>;
|
|
44
|
-
export interface ChatHeaderToggleProps
|
|
45
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
46
|
-
/** Icon to display (should rotate based on expanded state) */
|
|
47
|
-
icon?: React.ReactNode;
|
|
48
|
-
}
|
|
49
|
-
declare const ChatHeaderToggle: React.ForwardRefExoticComponent<
|
|
50
|
-
ChatHeaderToggleProps & React.RefAttributes<HTMLButtonElement>
|
|
51
|
-
>;
|
|
52
|
-
export interface ChatHeaderExpandablePanelProps
|
|
53
|
-
extends React.HTMLAttributes<HTMLDivElement> {}
|
|
54
|
-
declare const ChatHeaderExpandablePanel: React.ForwardRefExoticComponent<
|
|
55
|
-
ChatHeaderExpandablePanelProps & React.RefAttributes<HTMLDivElement>
|
|
56
|
-
>;
|
|
57
|
-
export {
|
|
58
|
-
ChatHeaderRoot as Root,
|
|
59
|
-
ChatHeaderTitle as Title,
|
|
60
|
-
ChatHeaderActions as Actions,
|
|
61
|
-
ChatHeaderStatusIndicator as StatusIndicator,
|
|
62
|
-
ChatHeaderToggle as Toggle,
|
|
63
|
-
ChatHeaderExpandablePanel as ExpandablePanel,
|
|
64
|
-
useChatHeaderContext,
|
|
65
|
-
};
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "../lib/utils.js";
|
|
4
|
-
|
|
5
|
-
const ChatHeaderContext = React.createContext(undefined);
|
|
6
|
-
const useChatHeaderContext = () => {
|
|
7
|
-
const context = React.useContext(ChatHeaderContext);
|
|
8
|
-
if (!context) {
|
|
9
|
-
throw new Error(
|
|
10
|
-
"ChatHeader components must be used within ChatHeader.Root",
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
return context;
|
|
14
|
-
};
|
|
15
|
-
const ChatHeaderRoot = React.forwardRef(
|
|
16
|
-
(
|
|
17
|
-
{
|
|
18
|
-
defaultExpanded = false,
|
|
19
|
-
expanded: expandedProp,
|
|
20
|
-
onExpandedChange,
|
|
21
|
-
className,
|
|
22
|
-
children,
|
|
23
|
-
...props
|
|
24
|
-
},
|
|
25
|
-
ref,
|
|
26
|
-
) => {
|
|
27
|
-
const [isExpandedInternal, setIsExpandedInternal] =
|
|
28
|
-
React.useState(defaultExpanded);
|
|
29
|
-
const isExpanded = expandedProp ?? isExpandedInternal;
|
|
30
|
-
const setIsExpanded = React.useCallback(
|
|
31
|
-
(expanded) => {
|
|
32
|
-
setIsExpandedInternal(expanded);
|
|
33
|
-
onExpandedChange?.(expanded);
|
|
34
|
-
},
|
|
35
|
-
[onExpandedChange],
|
|
36
|
-
);
|
|
37
|
-
// Separate children into main content and expandable panel
|
|
38
|
-
const childrenArray = React.Children.toArray(children);
|
|
39
|
-
const expandablePanel = childrenArray.find(
|
|
40
|
-
(child) =>
|
|
41
|
-
React.isValidElement(child) &&
|
|
42
|
-
child.type?.displayName === "ChatHeader.ExpandablePanel",
|
|
43
|
-
);
|
|
44
|
-
const mainContent = childrenArray.filter(
|
|
45
|
-
(child) => child !== expandablePanel,
|
|
46
|
-
);
|
|
47
|
-
return _jsxs(ChatHeaderContext.Provider, {
|
|
48
|
-
value: { isExpanded, setIsExpanded },
|
|
49
|
-
children: [
|
|
50
|
-
_jsx("div", {
|
|
51
|
-
ref: ref,
|
|
52
|
-
className: cn(
|
|
53
|
-
"flex items-center justify-between px-6 py-4",
|
|
54
|
-
className,
|
|
55
|
-
),
|
|
56
|
-
...props,
|
|
57
|
-
children: mainContent,
|
|
58
|
-
}),
|
|
59
|
-
expandablePanel,
|
|
60
|
-
],
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
);
|
|
64
|
-
ChatHeaderRoot.displayName = "ChatHeader.Root";
|
|
65
|
-
const ChatHeaderTitle = React.forwardRef(
|
|
66
|
-
({ className, children, ...props }, ref) => {
|
|
67
|
-
return _jsx("h1", {
|
|
68
|
-
ref: ref,
|
|
69
|
-
className: cn("m-0 text-xl font-semibold", className),
|
|
70
|
-
...props,
|
|
71
|
-
children: children,
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
);
|
|
75
|
-
ChatHeaderTitle.displayName = "ChatHeader.Title";
|
|
76
|
-
const ChatHeaderActions = React.forwardRef(
|
|
77
|
-
({ className, children, ...props }, ref) => {
|
|
78
|
-
return _jsx("div", {
|
|
79
|
-
ref: ref,
|
|
80
|
-
className: cn("flex items-center gap-3", className),
|
|
81
|
-
...props,
|
|
82
|
-
children: children,
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
);
|
|
86
|
-
ChatHeaderActions.displayName = "ChatHeader.Actions";
|
|
87
|
-
const getStatusColor = (status) => {
|
|
88
|
-
switch (status) {
|
|
89
|
-
case "connected":
|
|
90
|
-
return "bg-green-500";
|
|
91
|
-
case "connecting":
|
|
92
|
-
return "bg-yellow-500";
|
|
93
|
-
case "error":
|
|
94
|
-
return "bg-red-500";
|
|
95
|
-
default:
|
|
96
|
-
return "bg-gray-500";
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
const getDefaultStatusText = (status) => {
|
|
100
|
-
switch (status) {
|
|
101
|
-
case "connected":
|
|
102
|
-
return "Connected";
|
|
103
|
-
case "connecting":
|
|
104
|
-
return "Connecting...";
|
|
105
|
-
case "error":
|
|
106
|
-
return "Connection Error";
|
|
107
|
-
default:
|
|
108
|
-
return "No Server";
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
const ChatHeaderStatusIndicator = React.forwardRef(
|
|
112
|
-
({ status, statusText, className, ...props }, ref) => {
|
|
113
|
-
const text = statusText ?? getDefaultStatusText(status);
|
|
114
|
-
const colorClass = getStatusColor(status);
|
|
115
|
-
return _jsxs("div", {
|
|
116
|
-
ref: ref,
|
|
117
|
-
className: cn("flex items-center gap-2", className),
|
|
118
|
-
...props,
|
|
119
|
-
children: [
|
|
120
|
-
_jsx("div", { className: cn("h-2 w-2 rounded-full", colorClass) }),
|
|
121
|
-
_jsx("span", {
|
|
122
|
-
className: "text-sm text-muted-foreground",
|
|
123
|
-
children: text,
|
|
124
|
-
}),
|
|
125
|
-
],
|
|
126
|
-
});
|
|
127
|
-
},
|
|
128
|
-
);
|
|
129
|
-
ChatHeaderStatusIndicator.displayName = "ChatHeader.StatusIndicator";
|
|
130
|
-
const ChatHeaderToggle = React.forwardRef(
|
|
131
|
-
({ icon, className, children, onClick, ...props }, ref) => {
|
|
132
|
-
const { isExpanded, setIsExpanded } = useChatHeaderContext();
|
|
133
|
-
const handleClick = (e) => {
|
|
134
|
-
setIsExpanded(!isExpanded);
|
|
135
|
-
onClick?.(e);
|
|
136
|
-
};
|
|
137
|
-
return _jsxs("button", {
|
|
138
|
-
ref: ref,
|
|
139
|
-
type: "button",
|
|
140
|
-
onClick: handleClick,
|
|
141
|
-
className: cn(
|
|
142
|
-
"rounded p-1 transition-colors hover:bg-background lg:hidden",
|
|
143
|
-
className,
|
|
144
|
-
),
|
|
145
|
-
"aria-label": isExpanded ? "Collapse header" : "Expand header",
|
|
146
|
-
...props,
|
|
147
|
-
children: [
|
|
148
|
-
icon &&
|
|
149
|
-
_jsx("div", {
|
|
150
|
-
className: cn(
|
|
151
|
-
"transition-transform duration-200",
|
|
152
|
-
isExpanded && "rotate-180",
|
|
153
|
-
),
|
|
154
|
-
children: icon,
|
|
155
|
-
}),
|
|
156
|
-
children,
|
|
157
|
-
],
|
|
158
|
-
});
|
|
159
|
-
},
|
|
160
|
-
);
|
|
161
|
-
ChatHeaderToggle.displayName = "ChatHeader.Toggle";
|
|
162
|
-
const ChatHeaderExpandablePanel = React.forwardRef(
|
|
163
|
-
({ className, children, ...props }, ref) => {
|
|
164
|
-
const { isExpanded } = useChatHeaderContext();
|
|
165
|
-
if (!isExpanded) return null;
|
|
166
|
-
return _jsx("div", {
|
|
167
|
-
ref: ref,
|
|
168
|
-
className: cn(
|
|
169
|
-
"absolute top-full left-0 right-0 z-50 border-b border-border bg-card px-6 py-4 shadow-lg lg:hidden",
|
|
170
|
-
className,
|
|
171
|
-
),
|
|
172
|
-
...props,
|
|
173
|
-
children: children,
|
|
174
|
-
});
|
|
175
|
-
},
|
|
176
|
-
);
|
|
177
|
-
ChatHeaderExpandablePanel.displayName = "ChatHeader.ExpandablePanel";
|
|
178
|
-
/* -------------------------------------------------------------------------------------------------
|
|
179
|
-
* Exports
|
|
180
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
181
|
-
export {
|
|
182
|
-
ChatHeaderRoot as Root,
|
|
183
|
-
ChatHeaderTitle as Title,
|
|
184
|
-
ChatHeaderActions as Actions,
|
|
185
|
-
ChatHeaderStatusIndicator as StatusIndicator,
|
|
186
|
-
ChatHeaderToggle as Toggle,
|
|
187
|
-
ChatHeaderExpandablePanel as ExpandablePanel,
|
|
188
|
-
useChatHeaderContext,
|
|
189
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../src/gui/components/ChatInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA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BAAoB,EAChC,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,eAAe,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAEjD;;oGAEoG;AAEpG,OAAO,EACL,aAAa,IAAI,IAAI,EACrB,cAAc,IAAI,KAAK,EACvB,eAAe,IAAI,MAAM,GAC1B,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type DisplayMessage } from "./MessageList.js";
|
|
2
|
-
interface ChatInterfaceProps {
|
|
3
|
-
initialMessages?: DisplayMessage[];
|
|
4
|
-
thinkingDisplayStyle?: "collapsible" | "inline";
|
|
5
|
-
status?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function ChatInterface({
|
|
8
|
-
initialMessages,
|
|
9
|
-
thinkingDisplayStyle,
|
|
10
|
-
status,
|
|
11
|
-
}: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
//# sourceMappingURL=ChatInterface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInterface.d.ts","sourceRoot":"","sources":["../../../src/gui/components/ChatInterface.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQpE,UAAU,kBAAkB;IAC1B,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,oBAAoB,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA2FD,wBAAgB,aAAa,CAAC,EAC5B,eAAiC,EACjC,oBAAoC,EACpC,MAAoB,GACrB,EAAE,kBAAkB,2CA+FpB"}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { ChevronDown } from "lucide-react";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { ChatInput } from "./ChatInput.js";
|
|
5
|
-
import { ChatSecondaryPanel } from "./ChatSecondaryPanel.js";
|
|
6
|
-
import { ChatStatus } from "./ChatStatus.js";
|
|
7
|
-
import { HeightTransition } from "./HeightTransition.js";
|
|
8
|
-
import { MessageList } from "./MessageList.js";
|
|
9
|
-
|
|
10
|
-
const SAMPLE_TODOS = [
|
|
11
|
-
{
|
|
12
|
-
id: "1",
|
|
13
|
-
text: "Identify the last 25 Winter Olympics host countries",
|
|
14
|
-
status: "completed",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
id: "2",
|
|
18
|
-
text: "For each host country, find the tallest mountain",
|
|
19
|
-
status: "in_progress",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: "3",
|
|
23
|
-
text: "Gather key details for each mountain (name, elevation, location)",
|
|
24
|
-
status: "pending",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
id: "4",
|
|
28
|
-
text: "Verify information using reliable sources (geographical databases, official records)",
|
|
29
|
-
status: "pending",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "5",
|
|
33
|
-
text: "Compile findings into a summary table or document",
|
|
34
|
-
status: "pending",
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
const SAMPLE_MESSAGES = [
|
|
38
|
-
{
|
|
39
|
-
id: "msg-1",
|
|
40
|
-
role: "user",
|
|
41
|
-
content: "Hello! Can you help me understand how to use markdown?",
|
|
42
|
-
timestamp: new Date().toISOString(),
|
|
43
|
-
isStreaming: false,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
id: "msg-2",
|
|
47
|
-
role: "assistant",
|
|
48
|
-
content: `Sure! Markdown is a lightweight markup language. Here are some basics:
|
|
49
|
-
|
|
50
|
-
## Headings
|
|
51
|
-
Use \`#\` for headings. More \`#\` symbols make smaller headings.
|
|
52
|
-
|
|
53
|
-
## Lists
|
|
54
|
-
- Unordered lists use dashes
|
|
55
|
-
- Or asterisks
|
|
56
|
-
- Or plus signs
|
|
57
|
-
|
|
58
|
-
1. Ordered lists
|
|
59
|
-
2. Use numbers
|
|
60
|
-
3. Like this
|
|
61
|
-
|
|
62
|
-
## Code
|
|
63
|
-
Inline code uses \`backticks\` and code blocks use triple backticks:
|
|
64
|
-
|
|
65
|
-
\`\`\`javascript
|
|
66
|
-
function hello() {
|
|
67
|
-
console.log("Hello world!");
|
|
68
|
-
}
|
|
69
|
-
\`\`\`
|
|
70
|
-
|
|
71
|
-
## Links and emphasis
|
|
72
|
-
[This is a link](https://example.com)
|
|
73
|
-
|
|
74
|
-
You can make text **bold** or *italic*.
|
|
75
|
-
|
|
76
|
-
> Blockquotes use the > character
|
|
77
|
-
|
|
78
|
-
## Tables
|
|
79
|
-
| Header 1 | Header 2 |
|
|
80
|
-
|----------|----------|
|
|
81
|
-
| Cell 1 | Cell 2 |
|
|
82
|
-
| Cell 3 | Cell 4 |`,
|
|
83
|
-
timestamp: new Date().toISOString(),
|
|
84
|
-
isStreaming: false,
|
|
85
|
-
metadata: {
|
|
86
|
-
thinking: "Let me provide a comprehensive overview of markdown syntax...",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: "msg-3",
|
|
91
|
-
role: "user",
|
|
92
|
-
content: "That's really helpful, thank you!",
|
|
93
|
-
timestamp: new Date().toISOString(),
|
|
94
|
-
isStreaming: false,
|
|
95
|
-
},
|
|
96
|
-
];
|
|
97
|
-
export function ChatInterface({
|
|
98
|
-
initialMessages = SAMPLE_MESSAGES,
|
|
99
|
-
thinkingDisplayStyle = "collapsible",
|
|
100
|
-
status = "Connected",
|
|
101
|
-
}) {
|
|
102
|
-
const [messages, setMessages] = useState(initialMessages);
|
|
103
|
-
const [currentStatus, setCurrentStatus] = useState(status);
|
|
104
|
-
const [config, setConfig] = useState(null);
|
|
105
|
-
const [isHeaderExpanded, setIsHeaderExpanded] = useState(false);
|
|
106
|
-
const [todos] = useState(SAMPLE_TODOS);
|
|
107
|
-
// Listen for config and status updates from parent window
|
|
108
|
-
useEffect(() => {
|
|
109
|
-
const handleMessage = (event) => {
|
|
110
|
-
if (event.data.type === "CONFIG_UPDATE") {
|
|
111
|
-
const newConfig = event.data.config;
|
|
112
|
-
setConfig(newConfig);
|
|
113
|
-
applyConfigToDocument(newConfig);
|
|
114
|
-
} else if (event.data.type === "STATUS_UPDATE") {
|
|
115
|
-
setCurrentStatus(event.data.status);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
window.addEventListener("message", handleMessage);
|
|
119
|
-
// Request config from parent on mount
|
|
120
|
-
if (window.parent !== window) {
|
|
121
|
-
window.parent.postMessage({ type: "REQUEST_CONFIG" }, "*");
|
|
122
|
-
}
|
|
123
|
-
return () => {
|
|
124
|
-
window.removeEventListener("message", handleMessage);
|
|
125
|
-
};
|
|
126
|
-
}, []);
|
|
127
|
-
const applyConfigToDocument = (cfg) => {
|
|
128
|
-
const root = document.documentElement;
|
|
129
|
-
root.setAttribute("data-theme", cfg.colorScheme);
|
|
130
|
-
root.style.setProperty("--color-accent", cfg.accentColor);
|
|
131
|
-
root.style.setProperty("--font-family", cfg.typography);
|
|
132
|
-
root.style.setProperty("--font-size", `${cfg.fontSize}px`);
|
|
133
|
-
};
|
|
134
|
-
return _jsxs("div", {
|
|
135
|
-
className:
|
|
136
|
-
"flex flex-col h-screen bg-[var(--color-bg)] text-[var(--color-text)]",
|
|
137
|
-
children: [
|
|
138
|
-
_jsxs("div", {
|
|
139
|
-
className:
|
|
140
|
-
"relative border-b border-[var(--color-border)] bg-[var(--color-surface)] z-10",
|
|
141
|
-
children: [
|
|
142
|
-
_jsxs("div", {
|
|
143
|
-
className: "flex items-center justify-between px-6 py-4",
|
|
144
|
-
children: [
|
|
145
|
-
_jsx("h1", {
|
|
146
|
-
className: "text-xl font-semibold m-0",
|
|
147
|
-
children: "Chat Interface",
|
|
148
|
-
}),
|
|
149
|
-
_jsxs("div", {
|
|
150
|
-
className: "flex items-center gap-3",
|
|
151
|
-
children: [
|
|
152
|
-
_jsx(ChatStatus, { children: currentStatus }),
|
|
153
|
-
_jsx("button", {
|
|
154
|
-
onClick: () => setIsHeaderExpanded(!isHeaderExpanded),
|
|
155
|
-
className:
|
|
156
|
-
"p-1 rounded hover:bg-[var(--color-bg)] transition-colors",
|
|
157
|
-
"aria-label": isHeaderExpanded
|
|
158
|
-
? "Collapse header"
|
|
159
|
-
: "Expand header",
|
|
160
|
-
children: _jsx(ChevronDown, {
|
|
161
|
-
className: `w-5 h-5 text-[var(--color-text)] transition-transform duration-200 ${isHeaderExpanded ? "rotate-180" : ""}`,
|
|
162
|
-
}),
|
|
163
|
-
}),
|
|
164
|
-
],
|
|
165
|
-
}),
|
|
166
|
-
],
|
|
167
|
-
}),
|
|
168
|
-
_jsx("div", {
|
|
169
|
-
className: "absolute top-full left-0 right-0 z-20",
|
|
170
|
-
children: _jsx(HeightTransition, {
|
|
171
|
-
children:
|
|
172
|
-
isHeaderExpanded &&
|
|
173
|
-
_jsx("div", {
|
|
174
|
-
className:
|
|
175
|
-
"bg-[var(--color-surface)] border-b border-[var(--color-border)] px-6 py-4 shadow-lg",
|
|
176
|
-
children: _jsx(ChatSecondaryPanel, { todos: todos }),
|
|
177
|
-
}),
|
|
178
|
-
}),
|
|
179
|
-
}),
|
|
180
|
-
],
|
|
181
|
-
}),
|
|
182
|
-
_jsx("div", {
|
|
183
|
-
className: "flex-1 overflow-y-auto py-4",
|
|
184
|
-
children: _jsx(MessageList, {
|
|
185
|
-
messages: messages,
|
|
186
|
-
thinkingDisplayStyle:
|
|
187
|
-
config?.thinkingDisplayStyle || thinkingDisplayStyle,
|
|
188
|
-
}),
|
|
189
|
-
}),
|
|
190
|
-
_jsx("div", {
|
|
191
|
-
className:
|
|
192
|
-
"border-t border-[var(--color-border)] px-6 py-4 bg-[var(--color-surface)]",
|
|
193
|
-
children: _jsx(ChatInput, {
|
|
194
|
-
value: "",
|
|
195
|
-
onChange: () => {},
|
|
196
|
-
onSubmit: () => {},
|
|
197
|
-
disabled: true,
|
|
198
|
-
placeholder: "Type a message...",
|
|
199
|
-
}),
|
|
200
|
-
}),
|
|
201
|
-
],
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
//# sourceMappingURL=ChatInterface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInterface.js","sourceRoot":"","sources":["../../../src/gui/components/ChatInterface.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAuB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAU3C,MAAM,YAAY,GAAe;IAC/B;QACE,EAAE,EAAE,GAAG;QACP,IAAI,EAAE,qDAAqD;QAC3D,MAAM,EAAE,WAAW;KACpB;IACD;QACE,EAAE,EAAE,GAAG;QACP,IAAI,EAAE,kDAAkD;QACxD,MAAM,EAAE,aAAa;KACtB;IACD;QACE,EAAE,EAAE,GAAG;QACP,IAAI,EAAE,kEAAkE;QACxE,MAAM,EAAE,SAAS;KAClB;IACD;QACE,EAAE,EAAE,GAAG;QACP,IAAI,EAAE,sFAAsF;QAC5F,MAAM,EAAE,SAAS;KAClB;IACD;QACE,EAAE,EAAE,GAAG;QACP,IAAI,EAAE,mDAAmD;QACzD,MAAM,EAAE,SAAS;KAClB;CACF,CAAC;AAEF,MAAM,eAAe,GAAqB;IACxC;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,wDAAwD;QACjE,SAAS,EAAE,IAAI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AAoB,EAC7D,eAAK,SAAS,EAAC,yBAAyB,aACtC,KAAC,UAAU,cAAE,aAAa,GAAc,EACxC,iBACE,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,CAAC,gBAAgB,CAAC,EACrD,SAAS,EAAC,0DAA0D,gBACxD,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe,YAElE,KAAC,WAAW,IACV,SAAS,EAAE,sEACT,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EACpC,EAAE,GACF,GACK,IACL,IACF,EAGN,cAAK,SAAS,EAAC,uCAAuC,YACpD,KAAC,gBAAgB,cACd,gBAAgB,IAAI,CACnB,cAAK,SAAS,EAAC,qFAAqF,YAClG,KAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,GAAI,GAChC,CACP,GACgB,GACf,IACF,EAGN,cAAK,SAAS,EAAC,6BAA6B,YAC1C,KAAC,WAAW,IACV,QAAQ,EAAE,QAAQ,EAClB,oBAAoB,EAClB,MAAM,EAAE,oBAAoB,IAAI,oBAAoB,GAEtD,GACE,EAGN,cAAK,SAAS,EAAC,2EAA2E,YACxF,KAAC,SAAS,IACR,KAAK,EAAC,EAAE,EACR,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAClB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAClB,QAAQ,QACR,WAAW,EAAC,mBAAmB,GAC/B,GACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
type PanelSize = "hidden" | "small" | "large";
|
|
3
|
-
type PanelTabType = "todo" | "files" | "database";
|
|
4
|
-
interface ChatLayoutContextValue {
|
|
5
|
-
sidebarOpen: boolean;
|
|
6
|
-
setSidebarOpen: (open: boolean) => void;
|
|
7
|
-
panelSize: PanelSize;
|
|
8
|
-
setPanelSize: (size: PanelSize) => void;
|
|
9
|
-
activeTab: PanelTabType;
|
|
10
|
-
setActiveTab: (tab: PanelTabType) => void;
|
|
11
|
-
}
|
|
12
|
-
declare const useChatLayoutContext: () => ChatLayoutContextValue;
|
|
13
|
-
export interface ChatLayoutRootProps
|
|
14
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
-
/** Initial sidebar open state */
|
|
16
|
-
defaultSidebarOpen?: boolean;
|
|
17
|
-
/** Initial panel size state */
|
|
18
|
-
defaultPanelSize?: PanelSize;
|
|
19
|
-
/** Initial active tab */
|
|
20
|
-
defaultActiveTab?: PanelTabType;
|
|
21
|
-
}
|
|
22
|
-
declare const ChatLayoutRoot: React.ForwardRefExoticComponent<
|
|
23
|
-
ChatLayoutRootProps & React.RefAttributes<HTMLDivElement>
|
|
24
|
-
>;
|
|
25
|
-
export interface ChatLayoutHeaderProps
|
|
26
|
-
extends React.HTMLAttributes<HTMLDivElement> {}
|
|
27
|
-
declare const ChatLayoutHeader: React.ForwardRefExoticComponent<
|
|
28
|
-
ChatLayoutHeaderProps & React.RefAttributes<HTMLDivElement>
|
|
29
|
-
>;
|
|
30
|
-
export interface ChatLayoutMainProps
|
|
31
|
-
extends React.HTMLAttributes<HTMLDivElement> {}
|
|
32
|
-
declare const ChatLayoutMain: React.ForwardRefExoticComponent<
|
|
33
|
-
ChatLayoutMainProps & React.RefAttributes<HTMLDivElement>
|
|
34
|
-
>;
|
|
35
|
-
export interface ChatLayoutBodyProps
|
|
36
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
37
|
-
/** Whether to show toaster */
|
|
38
|
-
showToaster?: boolean;
|
|
39
|
-
}
|
|
40
|
-
declare const ChatLayoutBody: React.ForwardRefExoticComponent<
|
|
41
|
-
ChatLayoutBodyProps & React.RefAttributes<HTMLDivElement>
|
|
42
|
-
>;
|
|
43
|
-
export interface ChatLayoutMessagesProps
|
|
44
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
45
|
-
/** Callback when scroll position changes */
|
|
46
|
-
onScrollChange?: (isAtBottom: boolean) => void;
|
|
47
|
-
/** Whether to show scroll to bottom button */
|
|
48
|
-
showScrollToBottom?: boolean;
|
|
49
|
-
}
|
|
50
|
-
declare const ChatLayoutMessages: React.ForwardRefExoticComponent<
|
|
51
|
-
ChatLayoutMessagesProps & React.RefAttributes<HTMLDivElement>
|
|
52
|
-
>;
|
|
53
|
-
export interface ChatLayoutFooterProps
|
|
54
|
-
extends React.HTMLAttributes<HTMLDivElement> {}
|
|
55
|
-
declare const ChatLayoutFooter: React.ForwardRefExoticComponent<
|
|
56
|
-
ChatLayoutFooterProps & React.RefAttributes<HTMLDivElement>
|
|
57
|
-
>;
|
|
58
|
-
export interface ChatLayoutSidebarProps
|
|
59
|
-
extends React.HTMLAttributes<HTMLDivElement> {}
|
|
60
|
-
declare const ChatLayoutSidebar: React.ForwardRefExoticComponent<
|
|
61
|
-
ChatLayoutSidebarProps & React.RefAttributes<HTMLDivElement>
|
|
62
|
-
>;
|
|
63
|
-
export interface ChatLayoutAsideProps
|
|
64
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
65
|
-
/** Show panel on these breakpoints (default: lg and above) */
|
|
66
|
-
breakpoint?: "md" | "lg" | "xl" | "2xl";
|
|
67
|
-
}
|
|
68
|
-
declare const ChatLayoutAside: React.ForwardRefExoticComponent<
|
|
69
|
-
ChatLayoutAsideProps & React.RefAttributes<HTMLDivElement>
|
|
70
|
-
>;
|
|
71
|
-
export {
|
|
72
|
-
ChatLayoutRoot as Root,
|
|
73
|
-
ChatLayoutHeader as Header,
|
|
74
|
-
ChatLayoutMain as Main,
|
|
75
|
-
ChatLayoutBody as Body,
|
|
76
|
-
ChatLayoutMessages as Messages,
|
|
77
|
-
ChatLayoutFooter as Footer,
|
|
78
|
-
ChatLayoutSidebar as Sidebar,
|
|
79
|
-
ChatLayoutAside as Aside,
|
|
80
|
-
useChatLayoutContext,
|
|
81
|
-
};
|
|
82
|
-
export type { PanelSize, PanelTabType };
|