andy-widget-react 2.2.0 → 2.2.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.
@@ -181,13 +181,3 @@ export interface HostClassOptions {
181
181
  theme?: 'light' | 'dark' | 'auto';
182
182
  orientation?: 'left' | 'right';
183
183
  }
184
- export interface KeyboardListenerCallback {
185
- (state: {
186
- isOpen: boolean;
187
- height: number;
188
- }): void;
189
- }
190
- export interface KeyboardDetector {
191
- addListener: (callback: KeyboardListenerCallback) => void;
192
- removeListener: (callback: KeyboardListenerCallback) => void;
193
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "andy-widget-react",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Official React Widget for embeddable Andy agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -67,6 +67,6 @@
67
67
  "react-dom": "^18.0.0 || ^19.0.0"
68
68
  },
69
69
  "dependencies": {
70
- "andy-widget-core": "2.2.0"
70
+ "andy-widget-core": "2.2.1"
71
71
  }
72
72
  }
package/src/AndyChat.tsx CHANGED
@@ -19,8 +19,6 @@ import {
19
19
  getFooterUrl,
20
20
  getDefaultBubbleLabel,
21
21
  getUiStrings,
22
- getKeyboardDetector,
23
- updateKeyboardHeight,
24
22
  isMobileDevice
25
23
  } from 'andy-widget-core'
26
24
 
@@ -192,24 +190,7 @@ const AndyChat: React.FC<AndyChatProps> = ({
192
190
 
193
191
  setShadowReady(true)
194
192
 
195
- const keyboardDetector = getKeyboardDetector()
196
- const keyboardListener = ({ isOpen: kbOpen, height }: { isOpen: boolean; height: number }) => {
197
- updateKeyboardHeight(containerRef.current, height)
198
-
199
- const chatWindow = shadowRef.current?.querySelector('.andy-chat-window')
200
- if (chatWindow) {
201
- if (kbOpen && height > 0) {
202
- chatWindow.classList.add('andy-chat-window--keyboard-open')
203
- } else {
204
- chatWindow.classList.remove('andy-chat-window--keyboard-open')
205
- }
206
- }
207
- }
208
-
209
- keyboardDetector.addListener(keyboardListener)
210
-
211
193
  return () => {
212
- keyboardDetector.removeListener(keyboardListener)
213
194
  shadowRef.current = null
214
195
  portalRef.current = null
215
196
  setShadowReady(false)
@@ -222,14 +222,3 @@ export interface HostClassOptions {
222
222
  theme?: 'light' | 'dark' | 'auto'
223
223
  orientation?: 'left' | 'right'
224
224
  }
225
-
226
- // Keyboard detector listener callback
227
- export interface KeyboardListenerCallback {
228
- (state: { isOpen: boolean; height: number }): void
229
- }
230
-
231
- // Keyboard detector interface
232
- export interface KeyboardDetector {
233
- addListener: (callback: KeyboardListenerCallback) => void
234
- removeListener: (callback: KeyboardListenerCallback) => void
235
- }