@iloveagents/foundry-web-ui 0.27.1 → 0.28.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/components/user-menu.js +13 -17
- package/package.json +3 -3
|
@@ -9,22 +9,18 @@ import { Button } from "@iloveagents/foundry-web-primitives";
|
|
|
9
9
|
export const UserMenu = () => {
|
|
10
10
|
const { user, signOut } = useStore(authStore, useShallow((s) => ({ user: s.user, signOut: s.signOut })));
|
|
11
11
|
let preview = false;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
choice
|
|
17
|
-
(choice !== "classic" && sessionStorage.getItem("foundry.workbench-preview") === "on");
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
20
|
-
/* Storage may be unavailable in embedded browsers. */
|
|
21
|
-
}
|
|
12
|
+
try {
|
|
13
|
+
const choice = new URLSearchParams(window.location.search).get("ux");
|
|
14
|
+
preview =
|
|
15
|
+
choice === "workbench" ||
|
|
16
|
+
(choice !== "classic" && sessionStorage.getItem("foundry.workbench-preview") === "on");
|
|
22
17
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
catch {
|
|
19
|
+
/* Storage may be unavailable in embedded browsers. */
|
|
20
|
+
}
|
|
21
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", className: "gap-2 rounded-full px-2", "aria-label": user ? "User menu" : "Interface menu", children: [user?.avatar ? (_jsx("img", { src: user.avatar, alt: user.name, className: "size-6 rounded-full" })) : (_jsx("div", { className: cn("size-6 rounded-full", "bg-primary/10 text-primary", "flex items-center justify-center"), children: _jsx(User, { className: "size-3.5" }) })), user && (_jsx("span", { className: "text-xs text-muted-foreground hidden sm:inline", children: user.name }))] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-56", children: [user && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuLabel, { className: "font-normal", children: _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("p", { className: "text-sm font-medium", children: user.name }), _jsx("p", { className: "text-xs text-muted-foreground", children: user.email })] }) }), _jsx(DropdownMenuSeparator, {})] })), _jsx(DropdownMenuCheckboxItem, { checked: preview, onCheckedChange: (enabled) => {
|
|
22
|
+
const url = new URL(window.location.href);
|
|
23
|
+
url.searchParams.set("ux", enabled ? "workbench" : "classic");
|
|
24
|
+
window.location.assign(url.href);
|
|
25
|
+
}, children: "UI preview" }), _jsx(DropdownMenuSeparator, {}), user && (_jsxs(DropdownMenuItem, { onClick: signOut, className: "text-destructive cursor-pointer", children: [_jsx(LogOut, { className: "size-4" }), "Sign out"] }))] })] }));
|
|
30
26
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iloveagents/foundry-web-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.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.
|
|
84
|
-
"@iloveagents/foundry-web-primitives": "^0.
|
|
83
|
+
"@iloveagents/foundry-agent": "^0.28.0",
|
|
84
|
+
"@iloveagents/foundry-web-primitives": "^0.28.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@ag-ui/client": "^0.0.52",
|