@alxxsck/ai-assistant 1.7.0 → 1.8.0

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.
@@ -22,6 +22,7 @@ export type MessageStore = {
22
22
  messages: MessageData[];
23
23
  conversations: ConversationData[];
24
24
  threadIds: string[];
25
+ loadedThreadIds: Set<string>;
25
26
  threads: Map<string, MessageData[]>;
26
27
  threadsPreviews: ThreadSummary[];
27
28
  sendError: string | null;
@@ -66,6 +67,8 @@ export declare const useCurrentThreadId: () => string | undefined;
66
67
  export declare const useLatestReadMessageDate: () => string | null;
67
68
  export declare const useLatestMessageDate: () => string | null;
68
69
  export declare const useSendError: () => string | null;
70
+ export declare const selectIsCurrentThreadLoading: (state: MessageStore) => boolean;
71
+ export declare const useIsCurrentThreadLoading: () => boolean;
69
72
  export declare const useIsAwaitingFirstToken: () => boolean;
70
73
  export declare const useIsResponseActive: () => boolean;
71
74
  export declare const selectCurrentThreadPendingCustomerMessage: (state: MessageStore) => PendingCustomerMessage | null;
@@ -3,5 +3,6 @@ import { type MessageData } from "@/api/messages.api.types";
3
3
  * Plain-text preview from HTML for list items etc. Truncation works with CSS (e.g. truncate).
4
4
  */
5
5
  export declare function htmlToPlainPreview(html: string, maxLength?: number): string;
6
+ export declare function messageToPlainPreview(message: MessageData, maxLength?: number): string;
6
7
  export declare function getRenderableMessageContent(message: MessageData): MessageData["content"] | null;
7
8
  export declare function retrieveContent(message: MessageData): string;
@@ -7,6 +7,10 @@ export declare const CHAT_PATHS: {
7
7
  readonly voice: "/chat/voice";
8
8
  readonly text: "/chat/text";
9
9
  };
10
+ export type ChatListNavigationState = {
11
+ chatMode: ChatMode;
12
+ };
13
+ export declare function getChatModeFromNavigationState(state: unknown): ChatMode | null;
10
14
  export declare function getChatModeFromPathname(pathname: string): ChatMode;
11
15
  export declare function isChatListPath(pathname: string): boolean;
12
16
  export declare function isVoiceChatPath(pathname: string): boolean;
@@ -1,10 +1,8 @@
1
1
  import type { MessageData } from "@/api/messages.api.types";
2
2
  export interface ChatListItemProps {
3
- chat: {
4
- threadId: string;
5
- message: MessageData;
6
- };
3
+ threadId: string;
4
+ message: MessageData;
7
5
  isSelected?: boolean;
8
- onSelect: () => void;
6
+ onSelect: (threadId: string) => void;
9
7
  }
10
- export declare function ChatListItem({ chat, isSelected, onSelect, }: ChatListItemProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare const ChatListItem: import("react").NamedExoticComponent<ChatListItemProps>;
@@ -0,0 +1 @@
1
+ export declare function ChatMessageSkeleton(): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alxxsck/ai-assistant",
3
3
  "private": false,
4
- "version": "1.7.0",
4
+ "version": "1.8.0",
5
5
  "description": "Embeddable chat widget for communication with Bridge AI agent",
6
6
  "type": "module",
7
7
  "main": "dist/bridge-ai-chat-widget.es.js",