@bmx-labs/chat-widget 0.0.3 → 0.0.5
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/chat/ChatButton.d.ts +1 -1
- package/dist/components/chat/ChatInput.d.ts +1 -1
- package/dist/components/chat/ChatPanel.d.ts +1 -1
- package/dist/components/ogl/OrbButton.d.ts +1 -1
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/useChatState.d.ts +14 -0
- package/dist/hooks/useClickOutside.d.ts +8 -0
- package/dist/hooks/useIsMobile.d.ts +1 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +11 -0
- package/dist/hooks/useMessageHandling.d.ts +12 -0
- package/dist/hooks/usePortal.d.ts +8 -0
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -6,5 +6,5 @@ interface ChatButtonProps {
|
|
|
6
6
|
rotateOnHover?: boolean;
|
|
7
7
|
forceHoverState?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare
|
|
9
|
+
export declare const ChatButton: import("react").ForwardRefExoticComponent<ChatButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
10
10
|
export {};
|
|
@@ -7,5 +7,5 @@ interface ChatInputProps {
|
|
|
7
7
|
placeholder: string;
|
|
8
8
|
sending: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare
|
|
10
|
+
export declare const ChatInput: import("react").ForwardRefExoticComponent<ChatInputProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
11
11
|
export {};
|
|
@@ -21,5 +21,5 @@ interface ChatPanelProps {
|
|
|
21
21
|
onRotateOnHoverChange: (rotate: boolean) => void;
|
|
22
22
|
onSuggestionClick?: (suggestion: string) => void;
|
|
23
23
|
}
|
|
24
|
-
export declare
|
|
24
|
+
export declare const ChatPanel: import("react").ForwardRefExoticComponent<ChatPanelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
25
|
export {};
|
|
@@ -6,5 +6,5 @@ interface OrbButtonProps {
|
|
|
6
6
|
rotateOnHover?: boolean;
|
|
7
7
|
forceHoverState?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare
|
|
9
|
+
export declare const OrbButton: import("react").ForwardRefExoticComponent<OrbButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
10
10
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { useIsMobile } from "./useIsMobile";
|
|
2
|
+
export { useChatState } from "./useChatState";
|
|
3
|
+
export { useKeyboardShortcuts } from "./useKeyboardShortcuts";
|
|
4
|
+
export { useClickOutside } from "./useClickOutside";
|
|
5
|
+
export { useMessageHandling } from "./useMessageHandling";
|
|
6
|
+
export { usePortal } from "./usePortal";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChatMessage } from "../types";
|
|
2
|
+
interface UseChatStateProps {
|
|
3
|
+
storage?: "local" | "none";
|
|
4
|
+
storageKey?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function useChatState({ storage, storageKey, }: UseChatStateProps): {
|
|
7
|
+
messages: ChatMessage[];
|
|
8
|
+
setMessages: import("react").Dispatch<import("react").SetStateAction<ChatMessage[]>>;
|
|
9
|
+
sending: boolean;
|
|
10
|
+
setSending: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
11
|
+
clearHistory: () => void;
|
|
12
|
+
addMessage: (message: ChatMessage) => void;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface UseClickOutsideProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
widgetRef: React.RefObject<HTMLDivElement>;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
chatButtonRef: React.RefObject<HTMLButtonElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare function useClickOutside({ isOpen, widgetRef, onClose, chatButtonRef, }: UseClickOutsideProps): void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsMobile: (breakpoint?: number) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface UseKeyboardShortcutsProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
showSettings: boolean;
|
|
4
|
+
onToggleChat: () => void;
|
|
5
|
+
onToggleSettings: () => void;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
chatButtonRef: React.RefObject<HTMLButtonElement>;
|
|
8
|
+
chatPanelRef: React.RefObject<HTMLDivElement>;
|
|
9
|
+
}
|
|
10
|
+
export declare function useKeyboardShortcuts({ open, showSettings, onToggleChat, onToggleSettings, onClose, chatButtonRef, chatPanelRef, }: UseKeyboardShortcutsProps): void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BmxChatApiAdapter, ChatMessage } from "../types";
|
|
2
|
+
interface UseMessageHandlingProps {
|
|
3
|
+
api: BmxChatApiAdapter;
|
|
4
|
+
messages: ChatMessage[];
|
|
5
|
+
projectId?: string;
|
|
6
|
+
setMessages: React.Dispatch<React.SetStateAction<ChatMessage[]>>;
|
|
7
|
+
setSending: React.Dispatch<React.SetStateAction<boolean>>;
|
|
8
|
+
}
|
|
9
|
+
export declare function useMessageHandling({ api, messages, projectId, setMessages, setSending, }: UseMessageHandlingProps): {
|
|
10
|
+
sendMessage: (messageText: string) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|