@tangle-network/ui 11.11.6 → 11.11.7
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 +6 -0
- package/dist/{chat-DXidmE_w.js → chat-8WnrR5AQ.js} +6 -6
- package/dist/chat.d.ts +1 -1
- package/dist/chat.js +1 -1
- package/dist/{index-D-9c3r-Y.d.ts → index-Cs7j8V7l.d.ts} +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/chat/chat-message.tsx +8 -8
- package/src/chat/user-message.test.tsx +3 -3
- package/src/chat/user-message.tsx +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -17,8 +17,7 @@ function formatTime$1(date) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* The single user message bubble
|
|
21
|
-
* semantic border (no loud fill, no uppercase label). The timestamp sits
|
|
20
|
+
* The single user message bubble uses inverse theme colors. The timestamp sits
|
|
22
21
|
* beside the bubble and appears on hover, so it costs no height. Used by both
|
|
23
22
|
* the run/message list (session-model `parts`) and AgentTimeline (direct
|
|
24
23
|
* `content`/`timestamp`).
|
|
@@ -31,13 +30,13 @@ const UserMessage = memo(({ message: _message, parts, content, timestamp, action
|
|
|
31
30
|
children: /* @__PURE__ */ jsxs("div", {
|
|
32
31
|
className: "group flex min-w-0 max-w-[78%] flex-col items-end gap-2",
|
|
33
32
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
34
|
-
className: "relative w-full min-w-0 rounded-2xl
|
|
33
|
+
className: "relative w-full min-w-0 rounded-2xl bg-foreground px-4 py-3 text-background",
|
|
35
34
|
children: [timestamp ? /* @__PURE__ */ jsx("span", {
|
|
36
35
|
"data-user-message-time": "",
|
|
37
36
|
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",
|
|
38
37
|
children: formatTime$1(timestamp)
|
|
39
38
|
}) : null, /* @__PURE__ */ jsx("div", {
|
|
40
|
-
className: "break-words whitespace-pre-wrap text-[var(--font-size-base)] leading-[1.5]
|
|
39
|
+
className: "break-words whitespace-pre-wrap text-[var(--font-size-base)] leading-[1.5]",
|
|
41
40
|
children: text
|
|
42
41
|
})]
|
|
43
42
|
}), actions ? /* @__PURE__ */ jsx("div", {
|
|
@@ -639,6 +638,7 @@ ChatContainer.displayName = "ChatContainer";
|
|
|
639
638
|
//#region src/chat/chat-message.tsx
|
|
640
639
|
function ChatMessage({ role, content, toolCalls, isStreaming, timestamp, className, userLabel = "You", assistantLabel = "Agent", hideRoleLabel }) {
|
|
641
640
|
const isUser = role === "user";
|
|
641
|
+
const isAssistant = role === "assistant";
|
|
642
642
|
return /* @__PURE__ */ jsxs("div", {
|
|
643
643
|
className: cn("flex flex-col gap-1", isUser ? "items-end" : "items-start", className),
|
|
644
644
|
children: [!hideRoleLabel && /* @__PURE__ */ jsxs("div", {
|
|
@@ -651,9 +651,9 @@ function ChatMessage({ role, content, toolCalls, isStreaming, timestamp, classNa
|
|
|
651
651
|
children: formatTime(timestamp)
|
|
652
652
|
})]
|
|
653
653
|
}), /* @__PURE__ */ jsxs("div", {
|
|
654
|
-
className: cn("min-w-0 max-w-[85%] space-y-1 rounded-[var(--radius-lg)]
|
|
654
|
+
className: cn("min-w-0 max-w-[85%] space-y-1", isUser ? "rounded-[var(--radius-lg)] bg-foreground px-[var(--chat-message-px)] py-[var(--chat-message-py)] text-background" : isAssistant ? "text-foreground" : "rounded-[var(--radius-lg)] border border-border bg-card px-[var(--chat-message-px)] py-[var(--chat-message-py)]"),
|
|
655
655
|
children: [isUser ? /* @__PURE__ */ jsx("div", {
|
|
656
|
-
className: "whitespace-pre-wrap text-[var(--font-size-base)] leading-[var(--line-height-base)]
|
|
656
|
+
className: "whitespace-pre-wrap text-[var(--font-size-base)] leading-[var(--line-height-base)]",
|
|
657
657
|
children: content
|
|
658
658
|
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [content && /* @__PURE__ */ jsx(Markdown, {
|
|
659
659
|
className: "tangle-prose text-[var(--font-size-base)] leading-[var(--line-height-base)]",
|
package/dist/chat.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as UserMessageProps, a as AgentTimelineMessageItem, b as ChatContainer, c as AgentTimelineTone, d as ThinkingIndicator, f as ThinkingIndicatorProps, g as UserMessage, h as MessageRole, i as AgentTimelineItem, l as AgentTimelineToolGroupItem, m as ChatMessageProps, n as AgentTimelineArtifactItem, o as AgentTimelineProps, p as ChatMessage, r as AgentTimelineCustomItem, s as AgentTimelineStatusItem, t as AgentTimeline, u as AgentTimelineToolItem, v as MessageList, x as ChatContainerProps, y as MessageListProps } from "./index-
|
|
1
|
+
import { _ as UserMessageProps, a as AgentTimelineMessageItem, b as ChatContainer, c as AgentTimelineTone, d as ThinkingIndicator, f as ThinkingIndicatorProps, g as UserMessage, h as MessageRole, i as AgentTimelineItem, l as AgentTimelineToolGroupItem, m as ChatMessageProps, n as AgentTimelineArtifactItem, o as AgentTimelineProps, p as ChatMessage, r as AgentTimelineCustomItem, s as AgentTimelineStatusItem, t as AgentTimeline, u as AgentTimelineToolItem, v as MessageList, x as ChatContainerProps, y as MessageListProps } from "./index-Cs7j8V7l.js";
|
|
2
2
|
export { AgentTimeline, type AgentTimelineArtifactItem, type AgentTimelineCustomItem, type AgentTimelineItem, type AgentTimelineMessageItem, type AgentTimelineProps, type AgentTimelineStatusItem, type AgentTimelineTone, type AgentTimelineToolGroupItem, type AgentTimelineToolItem, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, MessageList, type MessageListProps, type MessageRole, ThinkingIndicator, type ThinkingIndicatorProps, UserMessage, type UserMessageProps };
|
package/dist/chat.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MessageList, i as ThinkingIndicator, n as ChatContainer, o as UserMessage, r as AgentTimeline, t as ChatMessage } from "./chat-
|
|
1
|
+
import { a as MessageList, i as ThinkingIndicator, n as ChatContainer, o as UserMessage, r as AgentTimeline, t as ChatMessage } from "./chat-8WnrR5AQ.js";
|
|
2
2
|
export { AgentTimeline, ChatContainer, ChatMessage, MessageList, ThinkingIndicator, UserMessage };
|
|
@@ -87,8 +87,7 @@ interface UserMessageProps {
|
|
|
87
87
|
actions?: ReactNode;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* The single user message bubble
|
|
91
|
-
* semantic border (no loud fill, no uppercase label). The timestamp sits
|
|
90
|
+
* The single user message bubble uses inverse theme colors. The timestamp sits
|
|
92
91
|
* beside the bubble and appears on hover, so it costs no height. Used by both
|
|
93
92
|
* the run/message list (session-model `parts`) and AgentTimeline (direct
|
|
94
93
|
* `content`/`timestamp`).
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { n as DisplayVariant, r as ToolDisplayMetadata, t as CustomToolRenderer
|
|
|
7
7
|
import { a as Run, i as MessageUser, n as GroupedMessage, o as RunStats, r as MessageRun, s as ToolCategory, t as FinalTextPart } from "./run-OyWmIDqu.js";
|
|
8
8
|
import { n as MarkdownProps, r as getSanitizedMarkdownHeadingIdFromRawFragment, t as Markdown } from "./markdown-C0atSabr.js";
|
|
9
9
|
import { _ as OpenUITableNode, a as OpenUIBadgeNode, c as OpenUIComponentNode, d as OpenUIKeyValueNode, f as OpenUIMarkdownNode, g as OpenUIStatNode, h as OpenUIStackNode, i as OpenUIArtifactRendererProps, l as OpenUIGridNode, m as OpenUISeparatorNode, n as OpenUIActionsNode, o as OpenUICardNode, p as OpenUIPrimitive, r as OpenUIArtifactRenderer, s as OpenUICodeNode, t as OpenUIAction, u as OpenUIHeadingNode, v as OpenUITextNode } from "./openui-artifact-renderer-fkBQaoLO.js";
|
|
10
|
-
import { _ as UserMessageProps, a as AgentTimelineMessageItem, b as ChatContainer, c as AgentTimelineTone, d as ThinkingIndicator, f as ThinkingIndicatorProps, g as UserMessage, h as MessageRole, i as AgentTimelineItem, l as AgentTimelineToolGroupItem, m as ChatMessageProps, n as AgentTimelineArtifactItem, o as AgentTimelineProps, p as ChatMessage, r as AgentTimelineCustomItem, s as AgentTimelineStatusItem, t as AgentTimeline, u as AgentTimelineToolItem, v as MessageList, x as ChatContainerProps, y as MessageListProps } from "./index-
|
|
10
|
+
import { _ as UserMessageProps, a as AgentTimelineMessageItem, b as ChatContainer, c as AgentTimelineTone, d as ThinkingIndicator, f as ThinkingIndicatorProps, g as UserMessage, h as MessageRole, i as AgentTimelineItem, l as AgentTimelineToolGroupItem, m as ChatMessageProps, n as AgentTimelineArtifactItem, o as AgentTimelineProps, p as ChatMessage, r as AgentTimelineCustomItem, s as AgentTimelineStatusItem, t as AgentTimeline, u as AgentTimelineToolItem, v as MessageList, x as ChatContainerProps, y as MessageListProps } from "./index-Cs7j8V7l.js";
|
|
11
11
|
import { a as parseToolEvent, i as ToolCallFeedProps, n as ToolCallData, o as ToolCallStatus, r as ToolCallFeed, s as ToolCallType, t as FeedSegment } from "./tool-call-feed-BeB1_4pX.js";
|
|
12
12
|
import { n as ArtifactPaneProps, t as ArtifactPane } from "./artifact-pane-BL_DFWNl.js";
|
|
13
13
|
import { C as FileNode, D as filterFileTree, E as FileTreeVisibilityOptions, S as RichFileTreeThemeVars, T as FileTreeProps, _ as parseCsv, a as getCodeLanguage, b as RichFileTreeGitStatus, c as resolveFilePreviewKind, d as FileTabData, f as FileTabs, g as FilePreviewProps, h as FilePreview, i as fileExtension, l as FileArtifactPane, m as CSV_PREVIEW_ROW_LIMIT, n as FilePreviewKind, o as getFormatLabel, p as FileTabsProps, r as detectFileFormat, s as getSyntaxLanguage, t as FileFormat, u as FileArtifactPaneProps, v as RichFileTree, w as FileTree, x as RichFileTreeProps, y as RichFileTreeGitEntry } from "./index-CyGSLGVF.js";
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { a as RunRowStatusDot, i as RunRowShell, o as ExpandedToolDetail, r as I
|
|
|
18
18
|
import { n as getSanitizedMarkdownHeadingIdFromRawFragment, t as Markdown } from "./markdown-PywkQXWk.js";
|
|
19
19
|
import { n as InlineThinkingItem, t as RunGroup } from "./run-group-COUIsZ_x.js";
|
|
20
20
|
import { t as OpenUIArtifactRenderer } from "./openui-artifact-renderer-DjLPuaP9.js";
|
|
21
|
-
import { a as MessageList, i as ThinkingIndicator, n as ChatContainer, o as UserMessage, r as AgentTimeline, t as ChatMessage } from "./chat-
|
|
21
|
+
import { a as MessageList, i as ThinkingIndicator, n as ChatContainer, o as UserMessage, r as AgentTimeline, t as ChatMessage } from "./chat-8WnrR5AQ.js";
|
|
22
22
|
import { t as LiveDuration } from "./run-ZsIKPA6J.js";
|
|
23
23
|
import { n as parseToolEvent, t as ToolCallFeed } from "./tool-call-feed-DNADpFyJ.js";
|
|
24
24
|
import "./openui.js";
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatMessage —
|
|
2
|
+
* ChatMessage — one message in the conversation.
|
|
3
3
|
*
|
|
4
4
|
* Supports user messages (plain text) and assistant messages
|
|
5
5
|
* (rich markdown with inline tool call activity).
|
|
@@ -41,6 +41,7 @@ export function ChatMessage({
|
|
|
41
41
|
hideRoleLabel,
|
|
42
42
|
}: ChatMessageProps) {
|
|
43
43
|
const isUser = role === "user";
|
|
44
|
+
const isAssistant = role === "assistant";
|
|
44
45
|
|
|
45
46
|
return (
|
|
46
47
|
<div
|
|
@@ -63,19 +64,18 @@ export function ChatMessage({
|
|
|
63
64
|
</div>
|
|
64
65
|
)}
|
|
65
66
|
|
|
66
|
-
{/* Bubble */}
|
|
67
67
|
<div
|
|
68
68
|
className={cn(
|
|
69
|
-
"min-w-0 max-w-[85%] space-y-1
|
|
70
|
-
"px-[var(--chat-message-px)] py-[var(--chat-message-py)]",
|
|
69
|
+
"min-w-0 max-w-[85%] space-y-1",
|
|
71
70
|
isUser
|
|
72
|
-
? "
|
|
73
|
-
:
|
|
71
|
+
? "rounded-[var(--radius-lg)] bg-foreground px-[var(--chat-message-px)] py-[var(--chat-message-py)] text-background"
|
|
72
|
+
: isAssistant
|
|
73
|
+
? "text-foreground"
|
|
74
|
+
: "rounded-[var(--radius-lg)] border border-border bg-card px-[var(--chat-message-px)] py-[var(--chat-message-py)]",
|
|
74
75
|
)}
|
|
75
76
|
>
|
|
76
|
-
{/* Message body */}
|
|
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-[var(--font-size-base)] leading-[var(--line-height-base)]">
|
|
79
79
|
{content}
|
|
80
80
|
</div>
|
|
81
81
|
) : (
|
|
@@ -3,13 +3,13 @@ import { describe, expect, it } from "vitest"
|
|
|
3
3
|
import { UserMessage } from "./user-message"
|
|
4
4
|
|
|
5
5
|
describe("UserMessage", () => {
|
|
6
|
-
it("renders
|
|
6
|
+
it("renders inverse text in a bubble that wraps in narrow panes", () => {
|
|
7
7
|
const { container } = render(<UserMessage content="Run the tests." />)
|
|
8
8
|
expect(screen.getByText("Run the tests.")).toBeInTheDocument()
|
|
9
9
|
const bubble = container.querySelector(".rounded-2xl")
|
|
10
10
|
expect(bubble).not.toBeNull()
|
|
11
|
-
expect(bubble!.className).toContain("bg-
|
|
12
|
-
expect(bubble!.className).toContain("
|
|
11
|
+
expect(bubble!.className).toContain("bg-foreground")
|
|
12
|
+
expect(bubble!.className).toContain("text-background")
|
|
13
13
|
expect(container.querySelector(".group")?.className).toContain(
|
|
14
14
|
"min-w-0",
|
|
15
15
|
)
|
|
@@ -17,8 +17,7 @@ function formatTime(date: Date): string {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The single user message bubble
|
|
21
|
-
* semantic border (no loud fill, no uppercase label). The timestamp sits
|
|
20
|
+
* The single user message bubble uses inverse theme colors. The timestamp sits
|
|
22
21
|
* beside the bubble and appears on hover, so it costs no height. Used by both
|
|
23
22
|
* the run/message list (session-model `parts`) and AgentTimeline (direct
|
|
24
23
|
* `content`/`timestamp`).
|
|
@@ -38,7 +37,7 @@ export const UserMessage = memo(
|
|
|
38
37
|
<div className="flex justify-end">
|
|
39
38
|
<div className="group flex min-w-0 max-w-[78%] flex-col items-end gap-2">
|
|
40
39
|
<div
|
|
41
|
-
className="relative w-full min-w-0 rounded-2xl
|
|
40
|
+
className="relative w-full min-w-0 rounded-2xl bg-foreground px-4 py-3 text-background"
|
|
42
41
|
>
|
|
43
42
|
{timestamp ? (
|
|
44
43
|
<span
|
|
@@ -48,7 +47,7 @@ export const UserMessage = memo(
|
|
|
48
47
|
{formatTime(timestamp)}
|
|
49
48
|
</span>
|
|
50
49
|
) : null}
|
|
51
|
-
<div className="break-words whitespace-pre-wrap text-[var(--font-size-base)] leading-[1.5]
|
|
50
|
+
<div className="break-words whitespace-pre-wrap text-[var(--font-size-base)] leading-[1.5]">
|
|
52
51
|
{text}
|
|
53
52
|
</div>
|
|
54
53
|
</div>
|