vanilla-agent 1.17.0 → 1.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vanilla-agent",
3
- "version": "1.17.0",
3
+ "version": "1.19.0",
4
4
  "description": "Themeable, plugable streaming agent widget for websites, in plain JS with support for voice input and reasoning / tool output.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -18,12 +18,18 @@ export const createWrapper = (config?: AgentWidgetConfig): PanelWrapper => {
18
18
  // and only the chat messages area scrolls
19
19
  const wrapper = createElement(
20
20
  "div",
21
- "tvw-relative tvw-w-full tvw-h-full tvw-flex tvw-flex-col tvw-flex-1 tvw-min-h-0"
21
+ "tvw-relative tvw-h-full tvw-flex tvw-flex-col tvw-flex-1 tvw-min-h-0"
22
22
  );
23
23
  const panel = createElement(
24
24
  "div",
25
- "tvw-relative tvw-w-full tvw-flex-1 tvw-flex tvw-flex-col tvw-min-h-0"
25
+ "tvw-relative tvw-flex-1 tvw-flex tvw-flex-col tvw-min-h-0"
26
26
  );
27
+
28
+ // Apply width from config, defaulting to 100% for inline embed mode
29
+ const inlineWidth = config?.launcher?.width ?? "100%";
30
+ wrapper.style.width = inlineWidth;
31
+ panel.style.width = "100%";
32
+
27
33
  wrapper.appendChild(panel);
28
34
  return { wrapper, panel };
29
35
  }
@@ -94,12 +94,9 @@ export const initAgentWidget = (
94
94
  host.className = "vanilla-agent-host";
95
95
 
96
96
  // When launcher is disabled (inline embed mode), ensure the host fills its container
97
- // This allows the widget to respect the parent container's height
98
97
  const launcherEnabled = options.config?.launcher?.enabled ?? true;
99
98
  if (!launcherEnabled) {
100
99
  host.style.height = "100%";
101
- host.style.display = "flex";
102
- host.style.flexDirection = "column";
103
100
  }
104
101
 
105
102
  target.appendChild(host);
package/src/ui.ts CHANGED
@@ -446,10 +446,10 @@ export const createAgentExperience = (
446
446
  container.style.border = panelBorder;
447
447
  container.style.borderRadius = panelBorderRadius;
448
448
 
449
+ // Check if this is inline embed mode (launcher disabled) vs launcher mode
450
+ const isInlineEmbed = config.launcher?.enabled === false;
451
+
449
452
  if (fullHeight) {
450
- // Check if this is inline embed mode (launcher disabled) vs launcher mode
451
- const isInlineEmbed = config.launcher?.enabled === false;
452
-
453
453
  // Mount container
454
454
  mount.style.display = 'flex';
455
455
  mount.style.flexDirection = 'column';
@@ -502,8 +502,8 @@ export const createAgentExperience = (
502
502
  'tvw-bottom-4', 'tvw-right-4', 'tvw-left-4', 'tvw-top-4'
503
503
  );
504
504
 
505
- if (!sidebarMode) {
506
- // Restore positioning classes when not in sidebar mode
505
+ if (!sidebarMode && !isInlineEmbed) {
506
+ // Restore positioning classes when not in sidebar mode (launcher mode only)
507
507
  const positionClasses = positionMap[position as keyof typeof positionMap] ?? positionMap['bottom-right'];
508
508
  positionClasses.split(' ').forEach(cls => wrapper.classList.add(cls));
509
509
  }
@@ -574,9 +574,12 @@ export const createAgentExperience = (
574
574
  // Apply max-height constraints to wrapper to prevent expanding past viewport top
575
575
  // Use both -moz-available (Firefox) and stretch (standard) for cross-browser support
576
576
  // Append to cssText to allow multiple fallback values for the same property
577
- const maxHeightStyles = 'max-height: -moz-available !important; max-height: stretch !important;';
578
- const paddingStyles = sidebarMode ? '' : 'padding-top: 1.25em !important;';
579
- wrapper.style.cssText += maxHeightStyles + paddingStyles;
577
+ // Only apply to launcher mode (not sidebar or inline embed)
578
+ if (!isInlineEmbed) {
579
+ const maxHeightStyles = 'max-height: -moz-available !important; max-height: stretch !important;';
580
+ const paddingStyles = sidebarMode ? '' : 'padding-top: 1.25em !important;';
581
+ wrapper.style.cssText += maxHeightStyles + paddingStyles;
582
+ }
580
583
  };
581
584
  applyFullHeightStyles();
582
585
  // Apply theme variables after applyFullHeightStyles since it resets mount.style.cssText