@snf/access-qa-bot 2.1.0-rc.2 → 2.1.0-rc.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/index.d.ts CHANGED
@@ -15,37 +15,26 @@ interface QABotProps {
15
15
  // Note: The React component uses controlled mode - manage state in your parent component:
16
16
  //
17
17
  // const [isOpen, setIsOpen] = useState(false);
18
- // <QABot open={isOpen} onOpenChange={setIsOpen} />
18
+ // const [userLoggedIn, setUserLoggedIn] = useState(false);
19
+ // <QABot open={isOpen} onOpenChange={setIsOpen} isLoggedIn={userLoggedIn} />
19
20
  //
20
- // To control the chat window via imperative methods, use the ref:
21
+ // To send messages programmatically, use the ref:
21
22
  // const botRef = useRef();
22
- // botRef.current?.openChat();
23
+ // botRef.current?.addMessage("Hello World!");
23
24
 
24
25
  // React component
25
26
  export const QABot: React.ForwardRefExoticComponent<
26
27
  QABotProps & React.RefAttributes<{
27
28
  addMessage: (message: string) => void;
28
- setBotIsLoggedIn: (status: boolean) => void;
29
- openChat: () => void;
30
- closeChat: () => void;
31
- toggleChat: () => void;
32
29
  }>
33
30
  >;
34
31
 
35
- // Web Component class (available in the standalone build)
36
- export class WebComponentQABot extends HTMLElement {
37
- static observedAttributes: string[];
38
- attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
39
- connectedCallback(): void;
40
- disconnectedCallback(): void;
41
- }
42
-
43
- // Function for non-React integration
32
+ // Function for non-React integration (now React-backed for everything)
44
33
  interface QABotConfig extends QABotProps {
45
34
  target: HTMLElement;
46
35
  }
47
36
 
48
- // Main function for programmatic usage (works with React or Web Component)
37
+ // Main function for programmatic usage (now React-backed for all usage)
49
38
  export function qaBot(config: QABotConfig): {
50
39
  addMessage: (message: string) => void;
51
40
  setBotIsLoggedIn: (status: boolean) => void;
@@ -55,23 +44,5 @@ export function qaBot(config: QABotConfig): {
55
44
  destroy: () => void;
56
45
  };
57
46
 
58
- // Web Component specific function (exposed in the standalone bundle)
59
- export function webComponentQABot(config: QABotConfig): () => void;
60
-
61
47
  // Default export (React component)
62
48
  export default QABot;
63
-
64
- // Augment the HTMLElementTagNameMap to include our custom element
65
- declare global {
66
- interface HTMLElementTagNameMap {
67
- 'qa-bot': WebComponentQABot;
68
- }
69
-
70
- // Global object for standalone usage
71
- interface Window {
72
- qaBot?: typeof webComponentQABot;
73
- }
74
-
75
- // Global function available without window prefix
76
- var qaBot: typeof webComponentQABot;
77
- }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@snf/access-qa-bot",
3
- "version": "2.1.0-rc.2",
3
+ "version": "2.1.0-rc.5",
4
4
  "private": false,
5
5
  "homepage": ".",
6
- "description": "ACCESS Q&A Bot React Component and Web Component",
6
+ "description": "ACCESS Q&A Bot React Component",
7
7
  "main": "./dist/access-qa-bot.umd.cjs",
8
8
  "module": "./dist/access-qa-bot.js",
9
9
  "exports": {