@iloveagents/foundry-web-ui 0.31.0 → 0.32.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.
@@ -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
  }
@@ -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.
@@ -92,6 +92,9 @@ const BRANDING_KEYS = [
92
92
  "darkLogoUrl",
93
93
  "iconUrl",
94
94
  "darkIconUrl",
95
+ "faviconUrl",
96
+ "darkFaviconUrl",
97
+ "touchIconUrl",
95
98
  "logoHeight",
96
99
  ];
97
100
  const SURFACE_IMPACT = Object.fromEntries(COLOR_KEYS.map((key, index) => [key, index]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iloveagents/foundry-web-ui",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
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.31.0",
84
- "@iloveagents/foundry-web-primitives": "^0.31.0"
83
+ "@iloveagents/foundry-agent": "^0.32.0",
84
+ "@iloveagents/foundry-web-primitives": "^0.32.0"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@ag-ui/client": "^0.0.52",