@snf/access-qa-bot 2.0.0-rc.2 → 2.1.0-rc.1

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/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  interface QABotProps {
2
2
  apiKey?: string;
3
- /** Whether the chat window is open by default (floating mode only, ignored for embedded) */
4
- defaultOpen?: boolean;
3
+ /** Whether the chat window is open (floating mode only, ignored for embedded) */
4
+ open?: boolean;
5
+ /** Callback when chat window open state changes */
6
+ onOpenChange?: (open: boolean) => void;
5
7
  /** Whether the bot is embedded in the page (always open when embedded) */
6
8
  embedded?: boolean;
7
9
  isLoggedIn?: boolean;
@@ -10,9 +12,14 @@ interface QABotProps {
10
12
  [key: string]: any; // Allow additional props
11
13
  }
12
14
 
13
- // Note: To control the chat window externally, use the useChatWindow hook from react-chatbotify:
14
- // import { useChatWindow } from 'react-chatbotify';
15
- // const { toggleChatWindow } = useChatWindow();
15
+ // Note: The React component uses controlled mode - manage state in your parent component:
16
+ //
17
+ // const [isOpen, setIsOpen] = useState(false);
18
+ // <QABot open={isOpen} onOpenChange={setIsOpen} />
19
+ //
20
+ // To control the chat window via imperative methods, use the ref:
21
+ // const botRef = useRef();
22
+ // botRef.current?.openChat();
16
23
 
17
24
  // React component
18
25
  export const QABot: React.ForwardRefExoticComponent<
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snf/access-qa-bot",
3
- "version": "2.0.0-rc.2",
3
+ "version": "2.1.0-rc.1",
4
4
  "private": false,
5
5
  "homepage": ".",
6
6
  "description": "ACCESS Q&A Bot React Component and Web Component",