@personaliai/react-widget 0.1.1 → 0.2.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.
- package/README.md +61 -73
- package/dist/index.cjs +68 -98023
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +81 -25
- package/dist/index.js +52 -71935
- package/dist/index.js.map +1 -1
- package/package.json +34 -22
- package/dist/chunk-PR4QN5HX.js +0 -43
- package/dist/chunk-PR4QN5HX.js.map +0 -1
- package/dist/emoji-picker-react.esm-JCK7JWXK.js +0 -26071
- package/dist/emoji-picker-react.esm-JCK7JWXK.js.map +0 -1
- package/dist/index.d.cts +0 -28
- package/dist/styles.css +0 -259
- package/src/ChatWidgetCore.tsx +0 -1919
- package/src/attach-menu.tsx +0 -60
- package/src/color-contrast.ts +0 -186
- package/src/index.ts +0 -1
- package/src/quick-emoji-picker.tsx +0 -75
- package/src/safe-markdown-link.tsx +0 -44
- package/src/voice-call-widget.tsx +0 -564
- package/src/widget-presets.css +0 -259
- package/src/widget-style.ts +0 -88
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
interface ChattyWidgetProps {
|
|
2
|
+
/**
|
|
3
|
+
* Your bot's unique UUID from the Chatty dashboard.
|
|
4
|
+
*/
|
|
4
5
|
botId: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Host URL for widget.js (defaults to "https://chatty.personaliai.com/widget.js").
|
|
8
|
+
*/
|
|
9
|
+
widgetUrl?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Corner anchor for the launcher button ("right" | "left"). Defaults to "right".
|
|
12
|
+
*/
|
|
13
|
+
position?: "right" | "left";
|
|
14
|
+
/**
|
|
15
|
+
* Hex color override for launcher button (e.g. "#4F46E5").
|
|
16
|
+
*/
|
|
17
|
+
color?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Widget visual style preset ("minimal", "playful", "corporate", etc.).
|
|
20
|
+
*/
|
|
21
|
+
style?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to preserve desktop floating panel layout on mobile (defaults to true).
|
|
24
|
+
*/
|
|
25
|
+
mobileFullscreen?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to display the proactive greeting teaser bubble (defaults to true).
|
|
28
|
+
*/
|
|
29
|
+
teaser?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to play notification audio chimes on new AI replies (defaults to true).
|
|
32
|
+
*/
|
|
33
|
+
sound?: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface ChattyAPI {
|
|
36
|
+
open: () => void;
|
|
37
|
+
close: () => void;
|
|
38
|
+
toggle: () => void;
|
|
39
|
+
}
|
|
40
|
+
declare global {
|
|
41
|
+
interface Window {
|
|
42
|
+
Chatty?: ChattyAPI;
|
|
43
|
+
__chattyWidgetLoaded?: boolean;
|
|
44
|
+
CHATTY_BOT_ID?: string;
|
|
45
|
+
}
|
|
25
46
|
}
|
|
26
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Official React component for Chatty.
|
|
49
|
+
*
|
|
50
|
+
* Mounts the Chatty AI chat assistant into your application using the lightweight
|
|
51
|
+
* script method into an isolated Shadow DOM container.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* import { ChattyWidget } from "@personaliai/react-widget";
|
|
56
|
+
*
|
|
57
|
+
* export default function App() {
|
|
58
|
+
* return <ChattyWidget botId="your-bot-uuid" position="right" color="#4F46E5" />;
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
declare function ChattyWidget({ botId, widgetUrl, position, color, style, mobileFullscreen, teaser, sound, }: ChattyWidgetProps): null;
|
|
63
|
+
declare const ChatWidget: typeof ChattyWidget;
|
|
64
|
+
type ChatWidgetProps = ChattyWidgetProps;
|
|
65
|
+
/**
|
|
66
|
+
* Hook to programmatically open, close, or toggle the Chatty chat drawer.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* import { useChatty } from "@personaliai/react-widget";
|
|
71
|
+
*
|
|
72
|
+
* export function HelpButton() {
|
|
73
|
+
* const { open, close, toggle } = useChatty();
|
|
74
|
+
* return <button onClick={open}>Chat with Support</button>;
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
declare function useChatty(): {
|
|
79
|
+
open: () => void;
|
|
80
|
+
close: () => void;
|
|
81
|
+
toggle: () => void;
|
|
82
|
+
};
|
|
27
83
|
|
|
28
|
-
export {
|
|
84
|
+
export { ChatWidget, type ChatWidgetProps, type ChattyAPI, ChattyWidget, type ChattyWidgetProps, ChattyWidget as default, useChatty };
|