teodor-new-chat-ui 4.3.476 → 4.3.478
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/core/types/context.d.ts +0 -2
- package/dist/features/messaging/components/chat/ChatInterface.d.ts +4 -1
- package/dist/features/messaging/components/message/MessageList.d.ts +2 -0
- package/dist/features/messaging/components/message/MessageRow.d.ts +2 -0
- package/dist/features/streaming/contexts/types.d.ts +0 -3
- package/dist/features/thread/hooks/useThreadHistoryState.d.ts +1 -5
- package/dist/features/ui/components/sheet.d.ts +1 -1
- package/dist/index.esm.js +3611 -3635
- package/dist/index.umd.js +40 -40
- package/package.json +1 -1
|
@@ -54,9 +54,7 @@ export interface ThreadStateContextValue {
|
|
|
54
54
|
checkpoints: HydratedCheckpointSnapshot[];
|
|
55
55
|
metadata: ThreadStateMetadata;
|
|
56
56
|
isLoading: boolean;
|
|
57
|
-
isHistoryLoading: boolean;
|
|
58
57
|
error: string | null;
|
|
59
|
-
hasMore: boolean;
|
|
60
58
|
loadOlder: (opts?: {
|
|
61
59
|
limit?: number;
|
|
62
60
|
}) => Promise<void>;
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Designed for use across multiple applications with customizable styling.
|
|
4
4
|
* Relies on the split context hooks (useThreads/useMessages/useStream/useApi).
|
|
5
5
|
*/
|
|
6
|
+
import type { ChatMessage, DefaultMessage } from "@/types";
|
|
7
|
+
import type { MessageComponentProps } from "../message/MessageComponent";
|
|
6
8
|
export interface ChatInterfaceProps {
|
|
7
9
|
className?: string;
|
|
8
10
|
placeholder?: string;
|
|
@@ -30,6 +32,7 @@ export interface ChatInterfaceProps {
|
|
|
30
32
|
textarea?: string;
|
|
31
33
|
moreButton?: string;
|
|
32
34
|
};
|
|
35
|
+
messageCustomStyles?: (message: ChatMessage | DefaultMessage) => MessageComponentProps["customStyles"] | undefined;
|
|
33
36
|
onMessageSent?: (message: string) => void;
|
|
34
37
|
onExcelUploadSuccess?: (payload: {
|
|
35
38
|
file: File;
|
|
@@ -42,4 +45,4 @@ export interface ChatInterfaceProps {
|
|
|
42
45
|
*/
|
|
43
46
|
defaultMessage?: string | null;
|
|
44
47
|
}
|
|
45
|
-
export declare function ChatInterface({ className, placeholder, autoFocus, maxHeight, streamingDebounceMs, streamingThrottleMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, payloadExtras, customStyles, onMessageSent, onExcelUploadSuccess, onError, defaultMessage, }: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function ChatInterface({ className, placeholder, autoFocus, maxHeight, streamingDebounceMs, streamingThrottleMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, payloadExtras, customStyles, messageCustomStyles, onMessageSent, onExcelUploadSuccess, onError, defaultMessage, }: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,7 @@ import type { ChatMessage, DefaultMessage, 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";
|
|
5
|
+
import type { MessageComponentProps } from "./MessageComponent";
|
|
5
6
|
export interface MessageListProps {
|
|
6
7
|
messages: (ChatMessage | DefaultMessage)[];
|
|
7
8
|
isStreaming: boolean;
|
|
@@ -42,6 +43,7 @@ export interface MessageListProps {
|
|
|
42
43
|
createSyntheticThinkingMessage?: boolean;
|
|
43
44
|
/** Force showing the synthetic thinking message even before the assistant message appears */
|
|
44
45
|
forceSyntheticThinking?: boolean;
|
|
46
|
+
getMessageCustomStyles?: (message: ChatMessage | DefaultMessage) => MessageComponentProps["customStyles"] | undefined;
|
|
45
47
|
}
|
|
46
48
|
export interface MessageListHandle {
|
|
47
49
|
scrollToLatest: () => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ChatMessage, DefaultMessage, PendingInterrupt } from "@/types";
|
|
2
2
|
import type { EditMeta } from "@/features/checkpoint/types";
|
|
3
3
|
import { type CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
|
|
4
|
+
import type { MessageComponentProps } from "./MessageComponent";
|
|
4
5
|
import React from "react";
|
|
5
6
|
export declare const getMessageDomKey: (message: ChatMessage | DefaultMessage | undefined, index: number) => string;
|
|
6
7
|
export interface MessageRowProps {
|
|
@@ -23,5 +24,6 @@ export interface MessageRowProps {
|
|
|
23
24
|
checkpointIndex?: CheckpointIndex;
|
|
24
25
|
activeCheckpointId?: string | null;
|
|
25
26
|
onSelectCheckpoint?: (checkpointId: string | null, parentCheckpointId?: string | null, isLatest?: boolean) => Promise<void> | void;
|
|
27
|
+
getMessageCustomStyles?: (message: ChatMessage | DefaultMessage) => MessageComponentProps["customStyles"] | undefined;
|
|
26
28
|
}
|
|
27
29
|
export declare const MessageRow: React.NamedExoticComponent<MessageRowProps>;
|
|
@@ -40,11 +40,8 @@ export interface ThreadStateContextValue {
|
|
|
40
40
|
timelineCheckpoints: TimelineCheckpoint[];
|
|
41
41
|
metadata: ThreadStateMetadata;
|
|
42
42
|
isLoading: boolean;
|
|
43
|
-
isHistoryLoading: boolean;
|
|
44
43
|
isLoadingCheckpoint: boolean;
|
|
45
44
|
error: string | null;
|
|
46
|
-
hasMore: boolean;
|
|
47
|
-
loadOlder: () => Promise<void>;
|
|
48
45
|
clearState: () => void;
|
|
49
46
|
navigateToCheckpoint: (checkpointId: string, checkpointNs?: string | null) => Promise<void>;
|
|
50
47
|
setCurrentCheckpointId: (checkpointId: string | null, checkpointNs?: string | null) => void;
|
|
@@ -11,7 +11,6 @@ interface UseThreadHistoryStateOptions {
|
|
|
11
11
|
checkpointNs?: string | null;
|
|
12
12
|
pendingInterrupt?: PendingInterrupt;
|
|
13
13
|
}) => void;
|
|
14
|
-
prepend: (messages: ChatMessage[]) => void;
|
|
15
14
|
onError?: (msg: string) => void;
|
|
16
15
|
currentThreadId: string | null;
|
|
17
16
|
initialThreadId?: string | null;
|
|
@@ -26,15 +25,12 @@ interface ThreadHistoryResult {
|
|
|
26
25
|
threadTimeline: TimelineCheckpoint[];
|
|
27
26
|
checkpointIndex: CheckpointIndex;
|
|
28
27
|
isLoadingThread: boolean;
|
|
29
|
-
isHistoryLoading: boolean;
|
|
30
28
|
isLoadingCheckpoint: boolean;
|
|
31
29
|
threadStateError: string | null;
|
|
32
|
-
hasMoreHistory: boolean;
|
|
33
30
|
loadThread: (threadId: string, checkpointId?: string, options?: {
|
|
34
31
|
clearProgress?: boolean;
|
|
35
32
|
}) => Promise<void>;
|
|
36
33
|
navigateToCheckpoint: (checkpointId: string, checkpointNs?: string | null) => Promise<void>;
|
|
37
|
-
loadOlderMessages: () => Promise<void>;
|
|
38
34
|
setCurrentCheckpointId: (checkpointId: string | null, checkpointNs?: string | null) => void;
|
|
39
35
|
returnToLatest: () => Promise<void>;
|
|
40
36
|
handleStateHistoryEvent: (event: StateHistoryEvent) => void;
|
|
@@ -42,5 +38,5 @@ interface ThreadHistoryResult {
|
|
|
42
38
|
markStreamPendingThread: (threadId: string | null) => void;
|
|
43
39
|
resetHistoryState: () => void;
|
|
44
40
|
}
|
|
45
|
-
export declare function useThreadHistoryState({ api, seed,
|
|
41
|
+
export declare function useThreadHistoryState({ api, seed, onError, currentThreadId, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, isStreaming, getMessages, }: UseThreadHistoryStateOptions): ThreadHistoryResult;
|
|
46
42
|
export {};
|
|
@@ -7,7 +7,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
7
7
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
8
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
declare const sheetVariants: (props?: ({
|
|
10
|
-
side?: "top" | "
|
|
10
|
+
side?: "top" | "left" | "right" | "bottom" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
12
12
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
13
13
|
}
|