teodor-new-chat-ui 4.3.565 → 4.3.567
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/features/chat/components/ChatLayout.d.ts +25 -0
- package/dist/features/chat/components/Composer.d.ts +4 -0
- package/dist/features/chat/components/Message/MessageList.d.ts +3 -1
- package/dist/features/chat/components/index.d.ts +2 -0
- package/dist/features/chat/hooks/index.d.ts +1 -0
- package/dist/features/chat/hooks/useChatController.d.ts +42 -0
- package/dist/features/chat/index.d.ts +1 -0
- package/dist/index.esm.js +4982 -4745
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +39 -39
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const CHAT_INTERFACE_BASE_CLASSES: {
|
|
3
|
+
container: string;
|
|
4
|
+
messagesArea: string;
|
|
5
|
+
inputArea: string;
|
|
6
|
+
errorBanner: string;
|
|
7
|
+
editingPill: string;
|
|
8
|
+
editingPillHeader: string;
|
|
9
|
+
editingPillTitleRow: string;
|
|
10
|
+
editingCloseButton: string;
|
|
11
|
+
inputError: string;
|
|
12
|
+
connectionBadge: string;
|
|
13
|
+
connectionErrorBadge: string;
|
|
14
|
+
statusOverlay: string;
|
|
15
|
+
statusText: string;
|
|
16
|
+
};
|
|
17
|
+
interface BaseProps {
|
|
18
|
+
className?: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
export declare function ChatContainer({ className, children, style }: BaseProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function ChatMessagesArea({ className, children, style }: BaseProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function ChatInputArea({ className, children, style }: BaseProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatMessage, DefaultMessage, RespondToInterruptOptions } from "@/types";
|
|
1
|
+
import type { ChatMessage, DefaultMessage, RespondToInterruptOptions, PendingInterrupt } from "@/types";
|
|
2
2
|
import type { EditMeta, TimelineCheckpoint } from "@/features/checkpoint/types";
|
|
3
3
|
import type { CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
|
|
4
4
|
import React from "react";
|
|
@@ -39,6 +39,8 @@ export interface MessageListProps {
|
|
|
39
39
|
forceSyntheticThinking?: boolean;
|
|
40
40
|
getMessageCustomStyles?: (message: ChatMessage | DefaultMessage) => MessageComponentProps["customStyles"] | undefined;
|
|
41
41
|
getInterruptOptions?: (message: ChatMessage | DefaultMessage) => RespondToInterruptOptions | undefined;
|
|
42
|
+
/** Pending interrupt state to automatically generate "user_choice" messages */
|
|
43
|
+
pendingInterrupt?: PendingInterrupt | null;
|
|
42
44
|
}
|
|
43
45
|
export interface MessageListHandle {
|
|
44
46
|
scrollToLatest: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./useChatController";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ChatRequest, type ProjectInfo, type ChatMessage, type StreamSubmitPayload, type SendOptions, type StreamEvent } from "@/types";
|
|
2
|
+
export type EditContextMeta = {
|
|
3
|
+
checkpointId?: string | null;
|
|
4
|
+
checkpointNs?: string | null;
|
|
5
|
+
};
|
|
6
|
+
export interface UseChatControllerProps {
|
|
7
|
+
submit: (payload: StreamSubmitPayload, options?: SendOptions) => Promise<void>;
|
|
8
|
+
chatRequest: ChatRequest;
|
|
9
|
+
lastCheckpointId: string | null;
|
|
10
|
+
lastCheckpointNs: string | null;
|
|
11
|
+
onMessageSent?: (message: string) => void;
|
|
12
|
+
onExcelUploadSuccess?: (payload: {
|
|
13
|
+
file: File;
|
|
14
|
+
}) => void;
|
|
15
|
+
onError?: (error: string) => void;
|
|
16
|
+
enableMessageEditing?: boolean;
|
|
17
|
+
messages: ChatMessage[];
|
|
18
|
+
setPendingAssistantResponse: (pending: boolean) => void;
|
|
19
|
+
project?: ProjectInfo | null;
|
|
20
|
+
/** Optional callback for stream events */
|
|
21
|
+
onEvent?: (event: StreamEvent) => void;
|
|
22
|
+
/** The active thread ID for draft isolation */
|
|
23
|
+
activeThreadId?: string | null;
|
|
24
|
+
/** Callback to ensure valid token before operations like upload */
|
|
25
|
+
ensureValidToken?: () => Promise<string | void>;
|
|
26
|
+
}
|
|
27
|
+
export declare function useChatController({ submit, chatRequest, lastCheckpointId, lastCheckpointNs, onMessageSent, onExcelUploadSuccess, onError, enableMessageEditing, messages, setPendingAssistantResponse, project, onEvent, activeThreadId, ensureValidToken, }: UseChatControllerProps): {
|
|
28
|
+
editingMessageId: string | null;
|
|
29
|
+
editingInitialValue: string;
|
|
30
|
+
inputError: string | null;
|
|
31
|
+
setInputError: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
32
|
+
dismissError: boolean;
|
|
33
|
+
setDismissError: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
34
|
+
composerValue: string;
|
|
35
|
+
handleComposerChange: (text: string) => void;
|
|
36
|
+
handleSendMessage: (text: string, attachments: File[]) => Promise<void>;
|
|
37
|
+
handleQuickPrompt: (prompt: string, isComposerDisabled: boolean) => void;
|
|
38
|
+
handleExcelUpload: (file: File) => Promise<void>;
|
|
39
|
+
startEditing: (messageId: string, content: string, meta?: EditContextMeta) => void;
|
|
40
|
+
cancelEditing: () => void;
|
|
41
|
+
handleRegenerateCb: (messageIndex: number) => void;
|
|
42
|
+
};
|