@ciridae/ui-agent 0.3.9 → 0.3.11

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.
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /* eslint-disable max-lines, max-lines-per-function, react/jsx-max-depth */
3
2
  import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";
4
3
  import * as React from "react";
5
4
  import { AttachmentList, useAttachments, } from "./attachments.js";
@@ -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, translations, ...props }) {
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 }) {
@@ -196,7 +199,7 @@ function createMermaidMarkdown(code, meta) {
196
199
  return `${fence}${info}\n${code}\n${fence}`;
197
200
  }
198
201
  function getCodeLanguage(className) {
199
- const language = className?.match(/language-([^\s]+)/)?.[1];
202
+ const language = className?.match(/language-(\S+)/)?.[1];
200
203
  if (language && isBundledLanguage(language))
201
204
  return language;
202
205
  return "tsx";
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /* eslint-disable max-lines, react-refresh/only-export-components */
2
+ /* eslint-disable react-refresh/only-export-components */
3
3
  import { ChevronsUpDownIcon } from "lucide-react";
4
4
  import * as React from "react";
5
5
  import { Button } from "@ciridae/ui/button";
@@ -7,7 +7,7 @@ import { Command, CommandEmpty, CommandInput, CommandItem, CommandList } from "@
7
7
  import { Popover, PopoverContent, PopoverTrigger } from "@ciridae/ui/popover";
8
8
  import { cn } from "@ciridae/ui/utils";
9
9
  import { useControllableState } from "./use-controllable-state.js";
10
- const deviceIdRegex = /\(([\da-fA-F]{4}:[\da-fA-F]{4})\)$/;
10
+ const deviceIdRegex = /\(([\da-f]{4}:[\da-f]{4})\)$/i;
11
11
  const MicSelectorContext = React.createContext(null);
12
12
  function MicSelector({ children, defaultOpen = false, defaultValue, mics, onOpenChange, onValueChange, open: openProp, value: valueProp, ...props }) {
13
13
  const [value, setValue] = useControllableState({
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /* eslint-disable max-lines, react-refresh/only-export-components */
2
+ /* eslint-disable react-refresh/only-export-components */
3
3
  import { ArrowUpIcon, SquareIcon } from "lucide-react";
4
4
  import * as React from "react";
5
5
  export { AttachmentActionAddFiles as PromptInputActionAddAttachments, AttachmentActionAddScreenshot as PromptInputActionAddScreenshot, } from "./attachments.js";
@@ -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)
@@ -63,10 +63,17 @@ function parseStackFrames(stack) {
63
63
  }
64
64
  function parseStackLine(line) {
65
65
  const trimmed = line.trim().replace(/^at\s+/, "");
66
- const match = /^(?:(.+?)\s+\()?(.+):(\d+):(\d+)\)?$/.exec(trimmed);
67
- if (!match)
66
+ const location = /:(\d+):(\d+)\)?$/.exec(trimmed);
67
+ if (!location)
68
68
  return null;
69
- return { column: match[4], file: match[2], line: match[3], method: match[1] };
69
+ const locationPrefix = trimmed.slice(0, location.index);
70
+ const methodSeparator = locationPrefix.lastIndexOf(" (");
71
+ return {
72
+ column: location[2],
73
+ file: methodSeparator === -1 ? locationPrefix : locationPrefix.slice(methodSeparator + 2),
74
+ line: location[1],
75
+ method: methodSeparator === -1 ? undefined : locationPrefix.slice(0, methodSeparator),
76
+ };
70
77
  }
71
78
  function formatLocation(frame) {
72
79
  if (!frame.line)
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /* eslint-disable max-lines, react-refresh/only-export-components */
2
+ /* eslint-disable react-refresh/only-export-components */
3
3
  import { CircleSmallIcon, MarsIcon, PauseIcon, PlayIcon, TransgenderIcon, VenusAndMarsIcon, VenusIcon, } from "lucide-react";
4
4
  import * as React from "react";
5
5
  import { Button } from "@ciridae/ui/button";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ciridae/ui-agent",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
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.5.0"
67
+ "streamdown": "^2.6.0"
68
68
  }
69
69
  }