@iloveagents/foundry-web-ui 0.27.0 → 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.
@@ -44,7 +44,7 @@ export interface ChatContentProps {
44
44
  * invitation is what belongs here: it says the box takes anything, which is
45
45
  * the one thing a first-time user does not know.
46
46
  */
47
- export declare const DEFAULT_COMPOSER_PLACEHOLDER = "Ask anything";
47
+ export declare const DEFAULT_COMPOSER_PLACEHOLDER = "Do anything";
48
48
  /**
49
49
  * Reusable chat content — used by ChatPage and ChatBubble.
50
50
  * Renders inside a ThreadPrimitive.Root context.
@@ -123,7 +123,7 @@ const DropZone = ({ children, centered, }) => {
123
123
  * invitation is what belongs here: it says the box takes anything, which is
124
124
  * the one thing a first-time user does not know.
125
125
  */
126
- export const DEFAULT_COMPOSER_PLACEHOLDER = "Ask anything";
126
+ export const DEFAULT_COMPOSER_PLACEHOLDER = "Do anything";
127
127
  /**
128
128
  * Reusable chat content — used by ChatPage and ChatBubble.
129
129
  * Renders inside a ThreadPrimitive.Root context.
@@ -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
- if (import.meta.env.DEV) {
13
- try {
14
- const choice = new URLSearchParams(window.location.search).get("ux");
15
- preview =
16
- choice === "workbench" ||
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
- if (!user)
24
- return null;
25
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", className: "gap-2 rounded-full px-2", 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" }) })), _jsx("span", { className: "text-xs text-muted-foreground hidden sm:inline", children: user.name })] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-56", 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, {}), import.meta.env.DEV && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuCheckboxItem, { checked: preview, onCheckedChange: (enabled) => {
26
- const url = new URL(window.location.href);
27
- url.searchParams.set("ux", enabled ? "workbench" : "classic");
28
- window.location.assign(url.href);
29
- }, children: "UI preview" }), _jsx(DropdownMenuSeparator, {})] })), _jsxs(DropdownMenuItem, { onClick: signOut, className: "text-destructive cursor-pointer", children: [_jsx(LogOut, { className: "size-4" }), "Sign out"] })] })] }));
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
  };
@@ -28,5 +28,5 @@ export function WorkbenchPreview({ page, chatOnly: chatRoute = false, }) {
28
28
  }, children: [_jsx(WorkbenchChatHeader, { collapsed: collapsed, chatWidth: chatWidth, buttonClass: buttonClass, toggleNavigation: toggleNavigation, setCollapsed: setCollapsed, showHistory: showHistory, startChat: startChat, returnToChat: returnToChat, openHistory: openHistory, chatOnly: chatOnly, setContentCollapsed: setContentCollapsed }), !collapsed && showHistory && (_jsx(ConversationHistory, { groups: navGroups, workspaceId: workspaceGroups?.[0]?.meta?.exclusiveRootId, onClose: returnToChat, showBack: true })), !chatWidth.compact && !collapsed && !contentCollapsed && (_jsx(ChatResizeHandle, { chatWidth: chatWidth })), _jsx("div", { className: "min-h-0 flex-1 flex-col", style: {
29
29
  display: collapsed || showHistory ? "none" : "flex",
30
30
  paddingBottom: spaciousChat && emptyChat && !historyOpen ? "clamp(32px, 10vh, 96px)" : undefined,
31
- }, children: _jsx(ChatContent, { centerComposer: spaciousChat && emptyChat && !historyOpen, composerIntro: spaciousChat && emptyChat ? (_jsx(WelcomeIntro, { navGroups: navGroups, historyShortcut: historyShortcut })) : undefined, placeholder: chatOnly ? "Ask anything" : "Ask about this page…", compactComposer: !spaciousChat, hideCurrentPageBadge: true, showPinButton: false, starterSuggestions: [], emptyState: _jsxs("div", { className: "flex min-h-full flex-col justify-center gap-3 px-6 py-8", children: [_jsx("h1", { className: "text-lg font-semibold tracking-tight", children: "What would you like to get done?" }), _jsx("p", { className: "max-w-sm text-sm leading-relaxed text-muted-foreground", children: pageLabel && !pageLabel.startsWith("/") ? (_jsxs(_Fragment, { children: ["Work with ", _jsx("span", { className: "font-medium text-foreground", children: pageLabel }), " ", "or across your spaces: find information, create or edit content, and run actions."] })) : ("Find information, create or edit content, and run actions across your spaces.") }), _jsx("p", { className: "max-w-sm text-xs leading-relaxed text-muted-foreground", children: "Your conversation continues as you browse. Select text or a field to work more specifically." }), historyShortcut] }) }) })] }), _jsx(WorkbenchContentPane, { contentHidden: contentHidden, panelOpen: panelOpen, chatWidth: chatWidth, contentCollapsed: contentCollapsed, collapsed: collapsed, buttonClass: buttonClass, setCollapsed: setCollapsed, setContentCollapsed: setContentCollapsed, closePanel: closePanel, page: page }), contentCollapsed && !chatOnly && !chatWidth.compact && (_jsx("aside", { "aria-label": "Collapsed content", className: "flex w-11 shrink-0 flex-col items-center", style: { width: 44 }, children: _jsx("div", { className: "flex h-full w-full flex-col items-center", "data-chat-rail": true, children: _jsx("div", { className: "flex items-center justify-center", style: { height: 60 }, children: _jsx(TooltipIconButton, { tooltip: "Expand content", className: buttonClass, "aria-label": "Expand content", onClick: () => setContentCollapsed(false), children: _jsx(FileText, { size: 18 }) }) }) }) }))] })] })] }));
31
+ }, children: _jsx(ChatContent, { centerComposer: spaciousChat && emptyChat && !historyOpen, composerIntro: spaciousChat && emptyChat ? (_jsx(WelcomeIntro, { navGroups: navGroups, historyShortcut: historyShortcut })) : undefined, compactComposer: !spaciousChat, hideCurrentPageBadge: true, showPinButton: false, starterSuggestions: [], emptyState: _jsxs("div", { className: "flex min-h-full flex-col justify-center gap-3 px-6 py-8", children: [_jsx("h1", { className: "text-lg font-semibold tracking-tight", children: "What would you like to get done?" }), _jsx("p", { className: "max-w-sm text-sm leading-relaxed text-muted-foreground", children: pageLabel && !pageLabel.startsWith("/") ? (_jsxs(_Fragment, { children: ["Work with ", _jsx("span", { className: "font-medium text-foreground", children: pageLabel }), " ", "or across your spaces: find information, create or edit content, and run actions."] })) : ("Find information, create or edit content, and run actions across your spaces.") }), _jsx("p", { className: "max-w-sm text-xs leading-relaxed text-muted-foreground", children: "Your conversation continues as you browse. Select text or a field to work more specifically." }), historyShortcut] }) }) })] }), _jsx(WorkbenchContentPane, { contentHidden: contentHidden, panelOpen: panelOpen, chatWidth: chatWidth, contentCollapsed: contentCollapsed, collapsed: collapsed, buttonClass: buttonClass, setCollapsed: setCollapsed, setContentCollapsed: setContentCollapsed, closePanel: closePanel, page: page }), contentCollapsed && !chatOnly && !chatWidth.compact && (_jsx("aside", { "aria-label": "Collapsed content", className: "flex w-11 shrink-0 flex-col items-center", style: { width: 44 }, children: _jsx("div", { className: "flex h-full w-full flex-col items-center", "data-chat-rail": true, children: _jsx("div", { className: "flex items-center justify-center", style: { height: 60 }, children: _jsx(TooltipIconButton, { tooltip: "Expand content", className: buttonClass, "aria-label": "Expand content", onClick: () => setContentCollapsed(false), children: _jsx(FileText, { size: 18 }) }) }) }) }))] })] })] }));
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iloveagents/foundry-web-ui",
3
- "version": "0.27.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.27.0",
84
- "@iloveagents/foundry-web-primitives": "^0.27.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",