vanilla-agent 1.16.0 → 1.18.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.16.0",
3
+ "version": "1.18.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",
package/src/ui.ts CHANGED
@@ -139,7 +139,8 @@ export const createAgentExperience = (
139
139
  }
140
140
 
141
141
  let config = mergeWithDefaults(initialConfig) as AgentWidgetConfig;
142
- applyThemeVariables(mount, config);
142
+ // Note: applyThemeVariables is called after applyFullHeightStyles() below
143
+ // because applyFullHeightStyles resets mount.style.cssText
143
144
 
144
145
  // Get plugins for this instance
145
146
  const plugins = pluginRegistry.getForInstance(config.plugins);
@@ -445,10 +446,10 @@ export const createAgentExperience = (
445
446
  container.style.border = panelBorder;
446
447
  container.style.borderRadius = panelBorderRadius;
447
448
 
449
+ // Check if this is inline embed mode (launcher disabled) vs launcher mode
450
+ const isInlineEmbed = config.launcher?.enabled === false;
451
+
448
452
  if (fullHeight) {
449
- // Check if this is inline embed mode (launcher disabled) vs launcher mode
450
- const isInlineEmbed = config.launcher?.enabled === false;
451
-
452
453
  // Mount container
453
454
  mount.style.display = 'flex';
454
455
  mount.style.flexDirection = 'column';
@@ -501,8 +502,8 @@ export const createAgentExperience = (
501
502
  'tvw-bottom-4', 'tvw-right-4', 'tvw-left-4', 'tvw-top-4'
502
503
  );
503
504
 
504
- if (!sidebarMode) {
505
- // Restore positioning classes when not in sidebar mode
505
+ if (!sidebarMode && !isInlineEmbed) {
506
+ // Restore positioning classes when not in sidebar mode (launcher mode only)
506
507
  const positionClasses = positionMap[position as keyof typeof positionMap] ?? positionMap['bottom-right'];
507
508
  positionClasses.split(' ').forEach(cls => wrapper.classList.add(cls));
508
509
  }
@@ -573,11 +574,16 @@ export const createAgentExperience = (
573
574
  // Apply max-height constraints to wrapper to prevent expanding past viewport top
574
575
  // Use both -moz-available (Firefox) and stretch (standard) for cross-browser support
575
576
  // Append to cssText to allow multiple fallback values for the same property
576
- const maxHeightStyles = 'max-height: -moz-available !important; max-height: stretch !important;';
577
- const paddingStyles = sidebarMode ? '' : 'padding-top: 1.25em !important;';
578
- 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
+ }
579
583
  };
580
584
  applyFullHeightStyles();
585
+ // Apply theme variables after applyFullHeightStyles since it resets mount.style.cssText
586
+ applyThemeVariables(mount, config);
581
587
 
582
588
  const destroyCallbacks: Array<() => void> = [];
583
589
  const suggestionsManager = createSuggestions(suggestions);
@@ -1736,8 +1742,9 @@ export const createAgentExperience = (
1736
1742
  update(nextConfig: AgentWidgetConfig) {
1737
1743
  const previousToolCallConfig = config.toolCall;
1738
1744
  config = { ...config, ...nextConfig };
1739
- applyThemeVariables(mount, config);
1745
+ // applyFullHeightStyles resets mount.style.cssText, so call it before applyThemeVariables
1740
1746
  applyFullHeightStyles();
1747
+ applyThemeVariables(mount, config);
1741
1748
 
1742
1749
  // Update plugins
1743
1750
  const newPlugins = pluginRegistry.getForInstance(config.plugins);