teodor-new-chat-ui 4.3.661 → 4.3.663
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/dist/components/ui/resizable.d.ts +1 -1
- package/dist/features/conversation/contexts/ChatUIContext.d.ts +41 -0
- package/dist/features/conversation/contexts/index.d.ts +1 -0
- package/dist/features/conversation/list/MessageList.d.ts +1 -29
- package/dist/features/conversation/list/MessageRow.d.ts +1 -19
- package/dist/features/conversation/modals/ToolDetailsModal.d.ts +8 -0
- package/dist/index.esm.js +5546 -5494
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +42 -42
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
2
2
|
declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare const ResizablePanel: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLAnchorElement | HTMLElement |
|
|
3
|
+
declare const ResizablePanel: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLAnchorElement | HTMLElement | HTMLDivElement | HTMLButtonElement | HTMLParagraphElement | HTMLImageElement | HTMLSpanElement | HTMLPreElement | HTMLUListElement | HTMLLIElement | HTMLHeadingElement | HTMLTimeElement | HTMLObjectElement | HTMLSourceElement | HTMLDataElement | HTMLHeadElement | HTMLLinkElement | HTMLBodyElement | HTMLMapElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
|
|
4
4
|
className?: string | undefined;
|
|
5
5
|
collapsedSize?: number | undefined;
|
|
6
6
|
collapsible?: boolean | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ChatMessage, RespondToInterruptOptions, ToolConfig, PendingInterrupt } from "@/types";
|
|
3
|
+
import type { MessageBubbleProps } from "../messages/components/MessageBubble";
|
|
4
|
+
import type { EditMeta } from "@/features/persistence/checkpoints/types";
|
|
5
|
+
import type { CheckpointIndex } from "@/features/persistence/checkpoints/utils/checkpointIndex";
|
|
6
|
+
import type { ToolCallWithResult } from "../messages/utils/toolCallUtils";
|
|
7
|
+
export interface ChatUIContextValue {
|
|
8
|
+
layoutSize: "phone" | "tablet" | "desktop" | "half-screen";
|
|
9
|
+
customStyles: {
|
|
10
|
+
container?: string;
|
|
11
|
+
messagesArea?: string;
|
|
12
|
+
inputArea?: string;
|
|
13
|
+
sendButton?: string;
|
|
14
|
+
textarea?: string;
|
|
15
|
+
moreButton?: string;
|
|
16
|
+
};
|
|
17
|
+
messageCustomStyles?: (message: ChatMessage) => MessageBubbleProps["customStyles"] | undefined;
|
|
18
|
+
renderArtifactsInline: boolean;
|
|
19
|
+
showThinkingIndicator: boolean;
|
|
20
|
+
enableMessageEditing: boolean;
|
|
21
|
+
editingMessageId: string | null;
|
|
22
|
+
showToolMessages: boolean;
|
|
23
|
+
followNewMessages: boolean;
|
|
24
|
+
streamingDebounceMs: number;
|
|
25
|
+
toolConfig?: ToolConfig;
|
|
26
|
+
selectedToolCall?: ToolCallWithResult | null;
|
|
27
|
+
onSelectToolCall?: (toolCall: ToolCallWithResult | null) => void;
|
|
28
|
+
checkpointIndex?: CheckpointIndex;
|
|
29
|
+
activeCheckpointId?: string | null;
|
|
30
|
+
onSelectCheckpoint?: (checkpointId: string | null, parentCheckpointId?: string | null, isLatest?: boolean) => Promise<void> | void;
|
|
31
|
+
pendingInterrupt: PendingInterrupt | null;
|
|
32
|
+
onEdit: (messageId: string, content: string, meta?: EditMeta) => void;
|
|
33
|
+
onRegenerate: (messageIndex: number) => void;
|
|
34
|
+
onCancelEdit: () => void;
|
|
35
|
+
getInterruptOptions?: (message: ChatMessage) => RespondToInterruptOptions | undefined;
|
|
36
|
+
}
|
|
37
|
+
export interface ChatUIProviderProps extends ChatUIContextValue {
|
|
38
|
+
children: React.ReactNode;
|
|
39
|
+
}
|
|
40
|
+
export declare function ChatUIProvider({ children, ...value }: ChatUIProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function useChatUI(): ChatUIContextValue;
|
|
@@ -1,45 +1,17 @@
|
|
|
1
|
-
import type { ChatMessage
|
|
2
|
-
import type { EditMeta, TimelineCheckpoint } from "@/features/persistence/checkpoints/types";
|
|
3
|
-
import type { CheckpointIndex } from "@/features/persistence/checkpoints/utils/checkpointIndex";
|
|
1
|
+
import type { ChatMessage } from "@/types";
|
|
4
2
|
import React from "react";
|
|
5
3
|
import type { MessageRowProps } from "./MessageRow";
|
|
6
|
-
import type { ToolConfig } from "../messages";
|
|
7
|
-
import type { MessageBubbleProps } from "../messages/components/MessageBubble";
|
|
8
4
|
export interface MessageListProps {
|
|
9
5
|
messages: ChatMessage[];
|
|
10
6
|
isStreaming: boolean;
|
|
11
|
-
streamingDebounceMs?: number;
|
|
12
|
-
layoutSize: "phone" | "tablet" | "desktop" | "half-screen";
|
|
13
|
-
enableMessageEditing: boolean;
|
|
14
|
-
editingMessageId: string | null;
|
|
15
7
|
onStartReached?: () => Promise<void> | void;
|
|
16
|
-
onEdit: (messageId: string, content: string, meta?: EditMeta) => void;
|
|
17
|
-
onRegenerate: (messageIndex: number) => void;
|
|
18
|
-
onCancelEdit: () => void;
|
|
19
8
|
className?: string;
|
|
20
9
|
style?: React.CSSProperties;
|
|
21
10
|
emptyMessage?: React.ReactNode;
|
|
22
|
-
/** If true, automatically follow new messages when the user is at the bottom. */
|
|
23
|
-
followNewMessages?: boolean;
|
|
24
|
-
/** If true, prevents automatic scrolling during checkpoint navigation */
|
|
25
|
-
isNavigatingCheckpoint?: boolean;
|
|
26
11
|
/** Callback to notify parent when user scrolls away from bottom */
|
|
27
12
|
onScrollAway?: (scrolledAway: boolean) => void;
|
|
28
13
|
/** Callback to notify parent when user is at bottom */
|
|
29
14
|
onAtBottom?: (atBottom: boolean) => void;
|
|
30
|
-
showToolMessages?: boolean;
|
|
31
|
-
toolConfig?: ToolConfig;
|
|
32
|
-
checkpointIndex?: CheckpointIndex;
|
|
33
|
-
activeCheckpointId?: string | null;
|
|
34
|
-
onSelectCheckpoint?: (checkpointId: string | null, parentCheckpointId?: string | null, isLatest?: boolean) => Promise<void> | void;
|
|
35
|
-
timelineCheckpoints?: TimelineCheckpoint[];
|
|
36
|
-
/** Whether to show the thinking indicator/message while streaming. Defaults to true. */
|
|
37
|
-
getMessageCustomStyles?: (message: ChatMessage) => MessageBubbleProps["customStyles"] | undefined;
|
|
38
|
-
getInterruptOptions?: (message: ChatMessage) => RespondToInterruptOptions | undefined;
|
|
39
|
-
/** Pending interrupt state to automatically generate "user_choice" messages */
|
|
40
|
-
pendingInterrupt?: PendingInterrupt | null;
|
|
41
|
-
/** Whether to render artifacts (plots, images) inline in the message. Defaults to true. */
|
|
42
|
-
renderArtifactsInline?: boolean;
|
|
43
15
|
renderAiTurn?: MessageRowProps["renderAiTurn"];
|
|
44
16
|
}
|
|
45
17
|
export interface MessageListHandle {
|
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
import type { ChatTurn, ToolConfig,
|
|
2
|
-
import type { CheckpointIndex } from "@/features/persistence/checkpoints/utils/checkpointIndex";
|
|
3
|
-
import type { EditMeta } from "@/features/persistence/checkpoints/types";
|
|
1
|
+
import type { ChatTurn, ToolConfig, ChatMessage } from "@/types";
|
|
4
2
|
import React from "react";
|
|
5
|
-
import type { MessageBubbleProps } from "../messages/components/MessageBubble";
|
|
6
3
|
export interface MessageRowProps {
|
|
7
4
|
turn: ChatTurn;
|
|
8
5
|
index: number;
|
|
9
|
-
streamingDebounceMs?: number;
|
|
10
|
-
layoutSize: "phone" | "tablet" | "desktop" | "half-screen";
|
|
11
|
-
enableMessageEditing: boolean;
|
|
12
|
-
editingMessageId: string | null;
|
|
13
|
-
onEdit: (messageId: string, content: string, meta?: EditMeta) => void;
|
|
14
|
-
onRegenerate: (messageIndex: number) => void;
|
|
15
|
-
onCancelEdit: () => void;
|
|
16
|
-
showToolMessages: boolean;
|
|
17
|
-
checkpointIndex?: CheckpointIndex;
|
|
18
|
-
activeCheckpointId?: string | null;
|
|
19
|
-
onSelectCheckpoint?: (checkpointId: string | null, parentCheckpointId?: string | null, isLatest?: boolean) => Promise<void> | void;
|
|
20
|
-
getMessageCustomStyles?: (message: ChatMessage) => MessageBubbleProps["customStyles"] | undefined;
|
|
21
|
-
toolConfig?: ToolConfig;
|
|
22
|
-
getInterruptOptions?: (message: ChatMessage) => RespondToInterruptOptions | undefined;
|
|
23
|
-
renderArtifactsInline?: boolean;
|
|
24
6
|
renderAiTurn?: (params: {
|
|
25
7
|
turn: ChatTurn;
|
|
26
8
|
aiMessages: ChatMessage[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToolCallWithResult } from "../messages/utils/toolCallUtils";
|
|
2
|
+
interface ToolDetailsModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
toolCall: ToolCallWithResult | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function ToolDetailsModal({ isOpen, onOpenChange, toolCall, }: ToolDetailsModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|