@tangle-network/ui 11.16.3 → 11.16.5
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/CHANGELOG.md +14 -0
- package/dist/chat/agent-timeline.js +3 -2
- package/dist/chat/chat-message.js +2 -2
- package/dist/chat/thinking-indicator.js +1 -1
- package/dist/chat/user-message.js +2 -2
- package/dist/markdown/code-block.js +9 -1
- package/dist/openui/schema-compiled.js +108 -209
- package/dist/openui/schema-data.js +0 -1
- package/dist/openui-schema.js +4 -0
- package/dist/run/expandable-content.js +2 -2
- package/dist/run/expanded-tool-detail.js +3 -0
- package/package.json +1 -1
- package/src/chat/agent-timeline.test.tsx +0 -14
- package/src/chat/agent-timeline.tsx +18 -2
- package/src/chat/chat-message.tsx +2 -2
- package/src/chat/thinking-indicator.tsx +1 -1
- package/src/chat/user-message.tsx +2 -2
- package/src/markdown/code-block.tsx +14 -2
- package/src/openui/schema-compiled.ts +1 -1
- package/src/openui/schema-data.ts +5 -1
- package/src/openui/schema.test.tsx +45 -0
- package/src/openui/schema.ts +5 -0
- package/src/run/expandable-content.tsx +8 -1
- package/src/run/expanded-tool-detail.tsx +6 -2
|
@@ -75,12 +75,12 @@ export function ChatMessage({
|
|
|
75
75
|
)}
|
|
76
76
|
>
|
|
77
77
|
{isUser ? (
|
|
78
|
-
<div className="whitespace-pre-wrap text-[var(--font-size-base)] leading-[var(--line-height-base)]">
|
|
78
|
+
<div className="whitespace-pre-wrap text-[length:var(--font-size-base)] leading-[var(--line-height-base)]">
|
|
79
79
|
{content}
|
|
80
80
|
</div>
|
|
81
81
|
) : (
|
|
82
82
|
<>
|
|
83
|
-
{content && <Markdown className="tangle-prose text-[var(--font-size-base)] leading-[var(--line-height-base)]">{content}</Markdown>}
|
|
83
|
+
{content && <Markdown className="tangle-prose text-[length:var(--font-size-base)] leading-[var(--line-height-base)]">{content}</Markdown>}
|
|
84
84
|
{isStreaming && (
|
|
85
85
|
<span className="ml-0.5 inline-block h-4 w-2 animate-pulse rounded-sm bg-[var(--brand-cool)] align-text-bottom" />
|
|
86
86
|
)}
|
|
@@ -25,7 +25,7 @@ export function ThinkingIndicator({ className }: ThinkingIndicatorProps) {
|
|
|
25
25
|
<span className="h-[var(--indicator-dot-size)] w-[var(--indicator-dot-size)] animate-bounce rounded-full bg-[var(--brand-glow)]" style={{ animationDelay: "300ms" }} />
|
|
26
26
|
</div>
|
|
27
27
|
{elapsed > 3 && (
|
|
28
|
-
<span className="text-[var(--font-size-xs)] tabular-nums text-muted-foreground">
|
|
28
|
+
<span className="text-[length:var(--font-size-xs)] tabular-nums text-muted-foreground">
|
|
29
29
|
{elapsed}s
|
|
30
30
|
</span>
|
|
31
31
|
)}
|
|
@@ -37,12 +37,12 @@ function UserBubble({ text, timestamp, actions }: {
|
|
|
37
37
|
{timestamp ? (
|
|
38
38
|
<span
|
|
39
39
|
data-user-message-time=""
|
|
40
|
-
className="pointer-events-none absolute right-full top-1/2 mr-3 -translate-y-1/2 whitespace-nowrap text-[var(--font-size-xs)] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"
|
|
40
|
+
className="pointer-events-none absolute right-full top-1/2 mr-3 -translate-y-1/2 whitespace-nowrap text-[length:var(--font-size-xs)] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"
|
|
41
41
|
>
|
|
42
42
|
{formatTime(timestamp)}
|
|
43
43
|
</span>
|
|
44
44
|
) : null}
|
|
45
|
-
<div className="break-words whitespace-pre-wrap text-[var(--font-size-base)] leading-[1.5]">
|
|
45
|
+
<div className="break-words whitespace-pre-wrap text-[length:var(--font-size-base)] leading-[1.5]">
|
|
46
46
|
{text}
|
|
47
47
|
</div>
|
|
48
48
|
</div>
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "react";
|
|
10
10
|
import type SyntaxHighlighter from "react-syntax-highlighter";
|
|
11
11
|
import { Check, Copy } from "lucide-react";
|
|
12
|
-
import { focusRing } from "../lib/focus";
|
|
12
|
+
import { focusRing, focusRingInset } from "../lib/focus";
|
|
13
13
|
import { cn } from "../lib/utils";
|
|
14
14
|
|
|
15
15
|
// Leave variables unresolved: the browser resolves them on each token span,
|
|
@@ -118,6 +118,17 @@ export const CodeBlock = memo(
|
|
|
118
118
|
overflowX: "auto" as const,
|
|
119
119
|
};
|
|
120
120
|
const codeTagProps = { style: { fontFamily: "var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)" } };
|
|
121
|
+
// A long line scrolls the block sideways, which a keyboard reaches only if
|
|
122
|
+
// the block takes focus (axe scrollable-region-focusable). A label on a bare
|
|
123
|
+
// <pre> is prohibited ARIA, so the block is a named region, as the terminal
|
|
124
|
+
// output regions are.
|
|
125
|
+
const scrollRegion = {
|
|
126
|
+
tabIndex: 0,
|
|
127
|
+
role: "region",
|
|
128
|
+
"aria-label": headerLabel ? `${headerLabel} code` : "Code",
|
|
129
|
+
// Inset: the rounded, overflow-clipped card would cut an outer ring.
|
|
130
|
+
className: focusRingInset,
|
|
131
|
+
} as const;
|
|
121
132
|
|
|
122
133
|
return (
|
|
123
134
|
<div
|
|
@@ -151,11 +162,12 @@ export const CodeBlock = memo(
|
|
|
151
162
|
customStyle={customStyle}
|
|
152
163
|
codeTagProps={codeTagProps}
|
|
153
164
|
wrapLines={false}
|
|
165
|
+
{...scrollRegion}
|
|
154
166
|
>
|
|
155
167
|
{code}
|
|
156
168
|
</Highlighter>
|
|
157
169
|
) : (
|
|
158
|
-
<pre style={{ ...syntaxTheme.hljs, ...customStyle }}>
|
|
170
|
+
<pre {...scrollRegion} style={{ ...syntaxTheme.hljs, ...customStyle }}>
|
|
159
171
|
<code style={{ ...codeTagProps.style, whiteSpace: "pre" }}>{code}</code>
|
|
160
172
|
</pre>
|
|
161
173
|
)}
|