@iloveagents/foundry-web-ui 0.31.0 → 0.32.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,10 +181,43 @@ export function ThemeScope({ children, className, style, }) {
|
|
|
181
181
|
}
|
|
182
182
|
export function ThemeDocumentMetadata() {
|
|
183
183
|
const runtime = useThemeRuntime();
|
|
184
|
+
const { faviconUrl, darkFaviconUrl, iconUrl, darkIconUrl, touchIconUrl } = runtime.branding;
|
|
185
|
+
const favicon = runtime.mode === "dark"
|
|
186
|
+
? darkFaviconUrl || faviconUrl || darkIconUrl || iconUrl
|
|
187
|
+
: faviconUrl || darkFaviconUrl || iconUrl || darkIconUrl;
|
|
184
188
|
useEffect(() => {
|
|
185
189
|
if (typeof document === "undefined")
|
|
186
190
|
return;
|
|
187
191
|
document.title = runtime.branding.appTitle || runtime.branding.appName || "Foundry UI";
|
|
188
192
|
}, [runtime.branding.appName, runtime.branding.appTitle]);
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
if (typeof document === "undefined")
|
|
195
|
+
return;
|
|
196
|
+
const managed = [];
|
|
197
|
+
const addIcon = (rel, href) => {
|
|
198
|
+
if (!href)
|
|
199
|
+
return;
|
|
200
|
+
let resolved;
|
|
201
|
+
try {
|
|
202
|
+
resolved = new URL(href, document.baseURI);
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (resolved.protocol !== "http:" &&
|
|
208
|
+
resolved.protocol !== "https:" &&
|
|
209
|
+
!(resolved.protocol === "data:" && /^data:image\//i.test(href)))
|
|
210
|
+
return;
|
|
211
|
+
const link = document.createElement("link");
|
|
212
|
+
link.rel = rel;
|
|
213
|
+
link.href = href;
|
|
214
|
+
link.dataset.themeIcon = "true";
|
|
215
|
+
document.head.appendChild(link);
|
|
216
|
+
managed.push(link);
|
|
217
|
+
};
|
|
218
|
+
addIcon("icon", favicon);
|
|
219
|
+
addIcon("apple-touch-icon", touchIconUrl);
|
|
220
|
+
return () => managed.forEach((link) => link.remove());
|
|
221
|
+
}, [favicon, touchIconUrl]);
|
|
189
222
|
return null;
|
|
190
223
|
}
|
|
@@ -16,5 +16,5 @@ export function ToolCallCard({ icon, title, description, status, action, childre
|
|
|
16
16
|
const isError = status.type === "incomplete" && status.reason === "error";
|
|
17
17
|
const isRunning = status.type === "running";
|
|
18
18
|
const requiresAction = status.type === "requires-action";
|
|
19
|
-
return (_jsx(Collapsible, { open: isOpen, onOpenChange: setIsOpen, className: className, children: _jsxs("div", { className: cn("flex items-start gap-3 p-3 rounded-lg border", "bg-muted/50 text-sm transition-colors", isSuccess && "border-primary/30 bg-primary/5", isError && "border-destructive/30 bg-destructive/5", requiresAction && "border-primary/30 bg-primary/5"), children: [_jsxs("div", { className: "flex-shrink-0 mt-0.5", children: [isRunning && _jsx(Loader2, { className: "size-4 text-primary animate-spin" }), isSuccess && _jsx(CheckCircle2, { className: "size-4 text-primary" }), isError && _jsx(XCircle, { className: "size-4 text-destructive" }), requiresAction && _jsx(AlertCircle, { className: "size-4 text-primary" })] }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [icon && _jsx("span", { className: "text-muted-foreground", children: icon }), _jsx("span", { className: "font-medium text-foreground", children: title }), _jsxs("div", { className: "ml-auto flex items-center gap-1.5", children: [action && !isRunning && (_jsx("button", { type: "button", onClick: action.onClick, disabled: action.disabled, className: cn("h-6 px-
|
|
19
|
+
return (_jsx(Collapsible, { open: isOpen, onOpenChange: setIsOpen, className: className, children: _jsxs("div", { className: cn("flex items-start gap-3 p-3 rounded-lg border", "bg-muted/50 text-sm transition-colors", isSuccess && "border-primary/30 bg-primary/5", isError && "border-destructive/30 bg-destructive/5", requiresAction && "border-primary/30 bg-primary/5"), children: [_jsxs("div", { className: "flex-shrink-0 mt-0.5", children: [isRunning && _jsx(Loader2, { className: "size-4 text-primary animate-spin" }), isSuccess && _jsx(CheckCircle2, { className: "size-4 text-primary" }), isError && _jsx(XCircle, { className: "size-4 text-destructive" }), requiresAction && _jsx(AlertCircle, { className: "size-4 text-primary" })] }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [icon && _jsx("span", { className: "text-muted-foreground", children: icon }), _jsx("span", { className: "font-medium text-foreground", children: title }), _jsxs("div", { className: "ml-auto flex items-center gap-1.5", children: [action && !isRunning && (_jsx("button", { type: "button", onClick: action.onClick, disabled: action.disabled, className: cn("min-h-6 px-1.5 text-xs font-medium rounded-md text-primary", "hover:bg-primary/10 transition-colors", "disabled:opacity-50 disabled:pointer-events-none"), children: action.label })), children && (_jsx(CollapsibleTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "p-0.5 hover:bg-muted rounded transition-colors", "aria-label": "Toggle details", children: _jsx(ChevronDown, { className: cn("size-4 text-muted-foreground transition-transform", isOpen && "rotate-180") }) }) }))] })] }), description && (_jsx("div", { className: cn("text-xs mt-0.5 wrap-anywhere", isError ? "text-destructive" : "text-primary"), children: description })), children && (_jsx(CollapsibleContent, { children: _jsx("div", { className: "mt-2", children: children }) }))] })] }) }));
|
|
20
20
|
}
|
|
@@ -118,6 +118,11 @@ export interface ThemeBranding {
|
|
|
118
118
|
*/
|
|
119
119
|
iconUrl?: string;
|
|
120
120
|
darkIconUrl?: string;
|
|
121
|
+
/** Browser tab icon; falls back to the compact brand icon when unset. */
|
|
122
|
+
faviconUrl?: string;
|
|
123
|
+
darkFaviconUrl?: string;
|
|
124
|
+
/** Square PNG recommended for mobile home-screen bookmarks. */
|
|
125
|
+
touchIconUrl?: string;
|
|
121
126
|
/**
|
|
122
127
|
* Rendered height of the mark, as a CSS length (`"2rem"`, `"32px"`).
|
|
123
128
|
* Defaults to the 20px lockup height when unset.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iloveagents/foundry-web-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React agent UI core for Foundry UI — chat, composer, AG-UI adapter for assistant-ui, tool cards, panels, sidebar, theme runtime, and UI stores.",
|
|
6
6
|
"keywords": [
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"recharts": "^3.10.1",
|
|
81
81
|
"remark-gfm": "^4.0.0",
|
|
82
82
|
"tailwind-merge": "^3.5.0",
|
|
83
|
-
"@iloveagents/foundry-agent": "^0.
|
|
84
|
-
"@iloveagents/foundry-web-primitives": "^0.
|
|
83
|
+
"@iloveagents/foundry-agent": "^0.32.1",
|
|
84
|
+
"@iloveagents/foundry-web-primitives": "^0.32.1"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@ag-ui/client": "^0.0.52",
|