@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/README.md +16 -2
- package/build/static/css/main.css +1 -1
- package/build/static/css/main.css.map +1 -1
- package/build/static/js/main.js +1 -1
- package/build/static/js/main.js.map +1 -1
- package/dist/access-qa-bot.js +1 -1
- package/dist/access-qa-bot.js.map +1 -1
- package/dist/access-qa-bot.standalone.js +4 -4
- package/dist/access-qa-bot.standalone.js.map +1 -1
- package/dist/access-qa-bot.umd.cjs +1 -1
- package/dist/access-qa-bot.umd.cjs.map +1 -1
- package/index.d.ts +12 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
interface QABotProps {
|
|
2
2
|
apiKey?: string;
|
|
3
|
-
/** Whether the chat window is open
|
|
4
|
-
|
|
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:
|
|
14
|
-
//
|
|
15
|
-
// const
|
|
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<
|