@ciridae/ui-agent 0.3.10 → 0.3.12
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.
|
@@ -188,16 +188,19 @@
|
|
|
188
188
|
color: var(--accent-foreground);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
/* Streamdown puts a table in two boxes: an outer card holding the copy,
|
|
192
|
+
download, and fullscreen controls, and an inner bordered scroll container
|
|
193
|
+
whose own classes draw the one visible border; the table's own w-full fills
|
|
194
|
+
it. The card loses its chrome. */
|
|
195
|
+
.agentic-message-response [data-streamdown="table-wrapper"] {
|
|
196
|
+
background: transparent;
|
|
197
|
+
border: 0;
|
|
198
|
+
padding: 0;
|
|
199
|
+
}
|
|
200
|
+
|
|
191
201
|
.agentic-message-response :where(table) {
|
|
192
|
-
border: 1px solid var(--border);
|
|
193
202
|
border-collapse: separate;
|
|
194
|
-
border-radius: var(--radius-md);
|
|
195
203
|
border-spacing: 0;
|
|
196
|
-
display: block;
|
|
197
|
-
margin-block: 1rem;
|
|
198
|
-
max-width: 100%;
|
|
199
|
-
overflow-x: auto;
|
|
200
|
-
width: max-content;
|
|
201
204
|
}
|
|
202
205
|
|
|
203
206
|
.agentic-message-response :where(thead) {
|
|
@@ -16,14 +16,20 @@ type MessageActionProps = React.ComponentProps<typeof Button> & {
|
|
|
16
16
|
tooltip?: string;
|
|
17
17
|
};
|
|
18
18
|
type MessageToolbarProps = React.ComponentProps<"div">;
|
|
19
|
-
type MessageResponseProps = React.ComponentProps<typeof Streamdown> & {
|
|
19
|
+
type MessageResponseProps = Omit<React.ComponentProps<typeof Streamdown>, "tableMaxHeight"> & {
|
|
20
20
|
isStreaming?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Height at which a markdown table starts scrolling; numbers are pixels.
|
|
23
|
+
* Pass 300 for Streamdown's own scroll box.
|
|
24
|
+
* @default "none"
|
|
25
|
+
*/
|
|
26
|
+
tableMaxHeight?: React.ComponentProps<typeof Streamdown>["tableMaxHeight"];
|
|
21
27
|
};
|
|
22
28
|
declare function Message({ className, role, ...props }: MessageProps): React.JSX.Element;
|
|
23
29
|
declare function MessageContent({ className, variant, ...props }: MessageContentProps): React.JSX.Element;
|
|
24
30
|
declare function MessageActions({ className, ...props }: MessageActionsProps): React.JSX.Element;
|
|
25
31
|
declare function MessageAction({ children, label, tooltip, variant, size, ...props }: MessageActionProps): React.JSX.Element;
|
|
26
|
-
declare const MessageResponse: React.MemoExoticComponent<({ animated, className, components, controls, icons, isAnimating, isStreaming, mermaid: mermaidOptions, plugins, prefix, translations, ...props }: MessageResponseProps) => React.JSX.Element>;
|
|
32
|
+
declare const MessageResponse: React.MemoExoticComponent<({ animated, className, components, controls, icons, isAnimating, isStreaming, mermaid: mermaidOptions, plugins, prefix, tableMaxHeight, translations, ...props }: MessageResponseProps) => React.JSX.Element>;
|
|
27
33
|
declare function MessageToolbar({ className, ...props }: MessageToolbarProps): React.JSX.Element;
|
|
28
34
|
export { Message, MessageAction, MessageActions, MessageBranch, MessageBranchContent, MessageBranchNext, MessageBranchPage, MessageBranchPrevious, MessageBranchSelector, MessageContent, MessageResponse, MessageToolbar, };
|
|
29
35
|
export type { MessageActionProps, MessageActionsProps, MessageBranchContentProps, MessageBranchNextProps, MessageBranchPageProps, MessageBranchPreviousProps, MessageBranchProps, MessageBranchSelectorProps, MessageContentProps, MessageProps, MessageResponseProps, MessageToolbarProps, };
|
|
@@ -141,7 +141,10 @@ function MessageAction({ children, label, tooltip, variant = "ghost", size = "ic
|
|
|
141
141
|
return button;
|
|
142
142
|
return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { children: _jsx("p", { children: tooltip }) })] }) }));
|
|
143
143
|
}
|
|
144
|
-
const MessageResponse = memo(function MessageResponse({ animated, className, components, controls, icons, isAnimating = false, isStreaming = false, mermaid: mermaidOptions, plugins, prefix,
|
|
144
|
+
const MessageResponse = memo(function MessageResponse({ animated, className, components, controls, icons, isAnimating = false, isStreaming = false, mermaid: mermaidOptions, plugins, prefix,
|
|
145
|
+
// Streamdown defaults a table to a 300px scroll box, which hides most rows
|
|
146
|
+
// of a modest table behind an inner scrollbar; a chat shows the whole table.
|
|
147
|
+
tableMaxHeight = "none", translations, ...props }) {
|
|
145
148
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
146
149
|
const isActivelyStreaming = isAnimating || isStreaming;
|
|
147
150
|
const resolvedAnimation = animated === true ? messageResponseAnimation : animated;
|
|
@@ -155,7 +158,7 @@ const MessageResponse = memo(function MessageResponse({ animated, className, com
|
|
|
155
158
|
prefix,
|
|
156
159
|
translations,
|
|
157
160
|
}), [controls, icons, mermaidOptions, prefix, resolvedPlugins, translations]);
|
|
158
|
-
return (_jsx(MessageResponseStreamingContext.Provider, { value: isActivelyStreaming, children: _jsx(MessageResponseRendererOptionsContext.Provider, { value: rendererOptions, children: _jsx(Streamdown, { animated: prefersReducedMotion ? false : resolvedAnimation, className: cn("agentic-message-response", className), components: resolvedComponents, controls: controls, icons: icons, isAnimating: isActivelyStreaming, mermaid: mermaidOptions, plugins: resolvedPlugins, prefix: prefix, translations: translations, ...props }) }) }));
|
|
161
|
+
return (_jsx(MessageResponseStreamingContext.Provider, { value: isActivelyStreaming, children: _jsx(MessageResponseRendererOptionsContext.Provider, { value: rendererOptions, children: _jsx(Streamdown, { animated: prefersReducedMotion ? false : resolvedAnimation, className: cn("agentic-message-response", className), components: resolvedComponents, controls: controls, icons: icons, isAnimating: isActivelyStreaming, mermaid: mermaidOptions, plugins: resolvedPlugins, prefix: prefix, tableMaxHeight: tableMaxHeight, translations: translations, ...props }) }) }));
|
|
159
162
|
});
|
|
160
163
|
MessageResponse.displayName = "MessageResponse";
|
|
161
164
|
function MessageResponseCode({ children, className, "data-block": dataBlock, node, ...props }) {
|
|
@@ -94,7 +94,7 @@ const ReasoningTrigger = memo(function ReasoningTrigger({ children, className, g
|
|
|
94
94
|
return (_jsxs(CollapsibleTrigger, { "data-slot": "reasoning-trigger", className: cn("group flex w-full items-center justify-between gap-3 px-3 py-2 text-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-[var(--focus-ring-width)] focus-visible:ring-ring focus-visible:outline-none", className), ...props, children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx(BrainIcon, { "aria-hidden": "true", className: "size-4 shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 truncate", children: children ?? getThinkingMessage(isStreaming, duration) })] }), _jsx(ChevronDownIcon, { "aria-hidden": "true", className: cn("size-4 shrink-0 text-muted-foreground transition-transform", isOpen ? "rotate-180" : undefined) })] }));
|
|
95
95
|
});
|
|
96
96
|
const ReasoningContent = memo(function ReasoningContent({ children, className, ...props }) {
|
|
97
|
-
return (_jsx(CollapsibleContent, { "data-slot": "reasoning-content", className: cn("border-t px-3 py-3 text-sm", className), ...props, children: _jsx(Streamdown, { className: cn("agentic-message-response text-muted-foreground"), plugins: streamdownPlugins, children: children }) }));
|
|
97
|
+
return (_jsx(CollapsibleContent, { "data-slot": "reasoning-content", className: cn("border-t px-3 py-3 text-sm", className), ...props, children: _jsx(Streamdown, { className: cn("agentic-message-response text-muted-foreground"), plugins: streamdownPlugins, tableMaxHeight: "none", children: children }) }));
|
|
98
98
|
});
|
|
99
99
|
function defaultGetThinkingMessage(isStreaming, duration) {
|
|
100
100
|
if (isStreaming || duration === 0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ciridae/ui-agent",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -64,6 +64,6 @@
|
|
|
64
64
|
"lucide-react": "^1.23.0",
|
|
65
65
|
"react-jsx-parser": "^2.4.1",
|
|
66
66
|
"shiki": "^4.3.0",
|
|
67
|
-
"streamdown": "^2.
|
|
67
|
+
"streamdown": "^2.6.0"
|
|
68
68
|
}
|
|
69
69
|
}
|