@myned-ai/avatar-chat-widget 0.3.0 → 0.5.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 CHANGED
@@ -23,8 +23,7 @@ Add directly to any HTML page or website builder:
23
23
  AvatarChat.init({
24
24
  container: '#avatar-chat',
25
25
  serverUrl: 'wss://your-backend-server.com/ws',
26
- position: 'bottom-right',
27
- theme: 'light'
26
+ position: 'bottom-right'
28
27
  });
29
28
  </script>
30
29
  ```
@@ -63,7 +62,6 @@ chat.destroy(); // Cleanup
63
62
  | `container` | `string \| HTMLElement` | **required** | CSS selector or DOM element |
64
63
  | `serverUrl` | `string` | **required** | WebSocket server URL (ws:// or wss://) |
65
64
  | `position` | `string` | `'bottom-right'` | `bottom-right`, `bottom-left`, `top-right`, `top-left`, `inline` |
66
- | `theme` | `string` | `'light'` | `light`, `dark`, `auto` (follows system preference) |
67
65
  | `startCollapsed` | `boolean` | `true` | Start minimized as bubble |
68
66
  | `width` | `number` | `380` | Widget width (200-2000px) |
69
67
  | `height` | `number` | `550` | Widget height (300-2000px) |
Binary file
Binary file
@@ -37,11 +37,10 @@ declare class AvatarChatElement extends HTMLElement {
37
37
  private config;
38
38
  private avatar;
39
39
  private chatManager;
40
+ private drawerController;
40
41
  private _isMounted;
41
42
  private _isConnected;
42
43
  private _isCollapsed;
43
- private themeMediaQuery;
44
- private themeChangeHandler;
45
44
  constructor();
46
45
  /**
47
46
  * Configure the widget (call before mount)
@@ -63,6 +62,11 @@ declare class AvatarChatElement extends HTMLElement {
63
62
  * Initialize avatar renderer
64
63
  */
65
64
  private initializeAvatar;
65
+ /**
66
+ * Resolve the avatar URL from config or assets base URL
67
+ * Ensures we always have an absolute URL that works across different deployment scenarios
68
+ */
69
+ private resolveAvatarUrl;
66
70
  /**
67
71
  * Initialize chat manager
68
72
  */
@@ -76,9 +80,25 @@ declare class AvatarChatElement extends HTMLElement {
76
80
  */
77
81
  private escapeHtml;
78
82
  /**
79
- * Expand the widget to full height (called on first interaction)
83
+ * Mark that conversation has messages (shows chat area instead of suggestions)
84
+ */
85
+ private markHasMessages;
86
+ /**
87
+ * Initialize the drawer controller and view mode selector
88
+ */
89
+ private initializeDrawer;
90
+ /**
91
+ * Setup expand button for text-focus mode
92
+ */
93
+ private setupExpandButton;
94
+ /**
95
+ * Setup view mode toggle button
96
+ */
97
+ private setupViewModeSelector;
98
+ /**
99
+ * Update view mode UI to reflect current state (no longer needed with toggle button)
80
100
  */
81
- private expandWidgetHeight;
101
+ private updateViewModeUI;
82
102
  /**
83
103
  * Update connection status (stub - connection indicator removed from UI)
84
104
  */