@cas0570/chat-widget 0.0.6 → 0.0.8

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.
@@ -1,3 +1,3 @@
1
1
  import { ChatWidgetProps } from '../types';
2
2
 
3
- export declare function ChatWidget({ apiUrl, tenantId, title, subtitle, placeholder, greeting, primaryColor, position, defaultOpen, defaultSize, headers, onOpen, onClose, onMessageSent, onResponseReceived, }: ChatWidgetProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function ChatWidget({ apiUrl, authUrl, tenantId, title, subtitle, placeholder, greeting, primaryColor, position, defaultOpen, defaultSize, headers, onOpen, onClose, onMessageSent, onResponseReceived, }: ChatWidgetProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { Message, WidgetSize } from '../types';
1
+ import { Message, WidgetSize, SessionSummaryResponse } from '../types';
2
2
 
3
3
  interface ChatWindowProps {
4
4
  title: string;
@@ -12,8 +12,13 @@ interface ChatWindowProps {
12
12
  onClear: () => void;
13
13
  onSizeChange: (size: WidgetSize) => void;
14
14
  onPopout: () => void;
15
+ onNewSession: () => void;
16
+ onSelectSession: (sessionId: string) => void;
17
+ onListSessions: () => Promise<SessionSummaryResponse[]>;
18
+ onDeleteSession: (sessionId: string) => Promise<void>;
19
+ currentSessionId: string | null;
15
20
  primaryColor: string;
16
21
  size: WidgetSize;
17
22
  }
18
- export declare function ChatWindow({ title, subtitle, placeholder, messages, isLoading, isLoadingSession, onSendMessage, onClose, onClear, onSizeChange, onPopout, primaryColor, size, }: ChatWindowProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function ChatWindow({ title, subtitle, placeholder, messages, isLoading, isLoadingSession, onSendMessage, onClose, onClear, onSizeChange, onPopout, onNewSession, onSelectSession, onListSessions, onDeleteSession, currentSessionId, primaryColor, size, }: ChatWindowProps): import("react/jsx-runtime").JSX.Element;
19
24
  export {};
@@ -0,0 +1,11 @@
1
+ interface ConfirmModalProps {
2
+ title: string;
3
+ message: string;
4
+ confirmLabel?: string;
5
+ cancelLabel?: string;
6
+ onConfirm: () => void;
7
+ onCancel: () => void;
8
+ variant?: 'danger' | 'default';
9
+ }
10
+ export declare function ConfirmModal({ title, message, confirmLabel, cancelLabel, onConfirm, onCancel, variant, }: ConfirmModalProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -5,6 +5,8 @@ interface HeaderMenuProps {
5
5
  onCycleSize: () => void;
6
6
  onPopout: () => void;
7
7
  onClear: () => void;
8
+ onNewSession: () => void;
9
+ onShowHistory: () => void;
8
10
  }
9
- export declare function HeaderMenu({ size, onCycleSize, onPopout, onClear }: HeaderMenuProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function HeaderMenu({ size, onCycleSize, onPopout, onClear, onNewSession, onShowHistory }: HeaderMenuProps): import("react/jsx-runtime").JSX.Element;
10
12
  export {};
@@ -5,12 +5,6 @@ interface ResizeIconProps {
5
5
  className?: string;
6
6
  }
7
7
  export declare function ResizeIcon({ size, className }: ResizeIconProps): import("react/jsx-runtime").JSX.Element;
8
- export declare function ExpandIcon({ className }: {
9
- className?: string;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- export declare function ContractIcon({ className }: {
12
- className?: string;
13
- }): import("react/jsx-runtime").JSX.Element;
14
8
  export declare function PopoutIcon({ className }: {
15
9
  className?: string;
16
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -23,4 +17,13 @@ export declare function TrashIcon({ className }: {
23
17
  export declare function ChatIcon({ className }: {
24
18
  className?: string;
25
19
  }): import("react/jsx-runtime").JSX.Element;
20
+ export declare function NewChatIcon({ className }: {
21
+ className?: string;
22
+ }): import("react/jsx-runtime").JSX.Element;
23
+ export declare function HistoryIcon({ className }: {
24
+ className?: string;
25
+ }): import("react/jsx-runtime").JSX.Element;
26
+ export declare function ArrowLeftIcon({ className }: {
27
+ className?: string;
28
+ }): import("react/jsx-runtime").JSX.Element;
26
29
  export {};
@@ -1,6 +1,6 @@
1
- import { Message, WidgetSize } from '../types';
1
+ import { Message } from '../types';
2
2
 
3
- interface PopoutConfig {
3
+ export interface PopoutConfig {
4
4
  apiUrl: string;
5
5
  tenantId?: string;
6
6
  title: string;
@@ -11,15 +11,7 @@ interface PopoutConfig {
11
11
  messages: Message[];
12
12
  headers?: Record<string, string>;
13
13
  }
14
- interface UsePopoutReturn {
15
- isPoppedOut: boolean;
16
- openPopout: () => void;
17
- closePopout: () => void;
18
- focusPopout: () => void;
19
- }
20
14
  /**
21
- * Hook to manage the popout window state
15
+ * Generate the HTML for the popout window
22
16
  */
23
- export declare function usePopout(config: PopoutConfig, size: WidgetSize, onPopoutClose?: () => void): UsePopoutReturn;
24
- export declare function ChatWindowStandalone(): null;
25
- export {};
17
+ export declare function getPopoutHTML(config: PopoutConfig): string;
@@ -0,0 +1,13 @@
1
+ import { SessionSummaryResponse } from '../types';
2
+
3
+ interface SessionHistoryProps {
4
+ currentSessionId: string | null;
5
+ onBack: () => void;
6
+ onSelectSession: (sessionId: string) => void;
7
+ onNewSession: () => void;
8
+ onDeleteSession: (sessionId: string) => Promise<void>;
9
+ onListSessions: () => Promise<SessionSummaryResponse[]>;
10
+ primaryColor: string;
11
+ }
12
+ export declare function SessionHistory({ currentSessionId, onBack, onSelectSession, onNewSession, onDeleteSession, onListSessions, primaryColor, }: SessionHistoryProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -4,6 +4,11 @@ export { ChatBubble } from './ChatBubble';
4
4
  export { MessageList } from './MessageList';
5
5
  export { MessageInput } from './MessageInput';
6
6
  export { ToggleButton } from './ToggleButton';
7
+ export { SessionHistory } from './SessionHistory';
8
+ export { ConfirmModal } from './ConfirmModal';
7
9
  export { MarkdownRenderer } from './MarkdownRenderer';
8
- export { usePopout } from './PopoutWindow';
9
- export { ResizeIcon, ExpandIcon, ContractIcon, PopoutIcon, CloseIcon, TrashIcon, ChatIcon } from './Icons';
10
+ export { getPopoutHTML } from './PopoutWindow';
11
+ export { TypingIndicator } from './TypingIndicator';
12
+ export { HeaderMenu } from './HeaderMenu';
13
+ export { ResizeIcon, PopoutIcon, CloseIcon, TrashIcon, ChatIcon, NewChatIcon, HistoryIcon, ArrowLeftIcon, } from './Icons';
14
+ export type { PopoutConfig } from './PopoutWindow';