vanilla-agent 1.15.0 → 1.17.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/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.global.js +23 -23
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ui.ts +15 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vanilla-agent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.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(
|
|
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);
|
|
@@ -446,19 +447,27 @@ export const createAgentExperience = (
|
|
|
446
447
|
container.style.borderRadius = panelBorderRadius;
|
|
447
448
|
|
|
448
449
|
if (fullHeight) {
|
|
450
|
+
// Check if this is inline embed mode (launcher disabled) vs launcher mode
|
|
451
|
+
const isInlineEmbed = config.launcher?.enabled === false;
|
|
452
|
+
|
|
449
453
|
// Mount container
|
|
450
454
|
mount.style.display = 'flex';
|
|
451
455
|
mount.style.flexDirection = 'column';
|
|
452
456
|
mount.style.height = '100%';
|
|
453
457
|
mount.style.minHeight = '0';
|
|
454
458
|
|
|
455
|
-
// Wrapper
|
|
459
|
+
// Wrapper
|
|
460
|
+
// - Inline embed: needs overflow:hidden to contain the flex layout
|
|
461
|
+
// - Launcher mode: no overflow:hidden to allow panel's box-shadow to render fully
|
|
456
462
|
wrapper.style.display = 'flex';
|
|
457
463
|
wrapper.style.flexDirection = 'column';
|
|
458
464
|
wrapper.style.flex = '1 1 0%';
|
|
459
465
|
wrapper.style.minHeight = '0';
|
|
460
466
|
wrapper.style.maxHeight = '100%';
|
|
461
467
|
wrapper.style.height = '100%';
|
|
468
|
+
if (isInlineEmbed) {
|
|
469
|
+
wrapper.style.overflow = 'hidden';
|
|
470
|
+
}
|
|
462
471
|
|
|
463
472
|
// Panel
|
|
464
473
|
panel.style.display = 'flex';
|
|
@@ -570,6 +579,8 @@ export const createAgentExperience = (
|
|
|
570
579
|
wrapper.style.cssText += maxHeightStyles + paddingStyles;
|
|
571
580
|
};
|
|
572
581
|
applyFullHeightStyles();
|
|
582
|
+
// Apply theme variables after applyFullHeightStyles since it resets mount.style.cssText
|
|
583
|
+
applyThemeVariables(mount, config);
|
|
573
584
|
|
|
574
585
|
const destroyCallbacks: Array<() => void> = [];
|
|
575
586
|
const suggestionsManager = createSuggestions(suggestions);
|
|
@@ -1728,8 +1739,9 @@ export const createAgentExperience = (
|
|
|
1728
1739
|
update(nextConfig: AgentWidgetConfig) {
|
|
1729
1740
|
const previousToolCallConfig = config.toolCall;
|
|
1730
1741
|
config = { ...config, ...nextConfig };
|
|
1731
|
-
|
|
1742
|
+
// applyFullHeightStyles resets mount.style.cssText, so call it before applyThemeVariables
|
|
1732
1743
|
applyFullHeightStyles();
|
|
1744
|
+
applyThemeVariables(mount, config);
|
|
1733
1745
|
|
|
1734
1746
|
// Update plugins
|
|
1735
1747
|
const newPlugins = pluginRegistry.getForInstance(config.plugins);
|