@tangle-network/ui 11.11.3 → 11.11.4
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-BUJhNpx2.js → chat-CpzvkA6m.js} +5 -5
- package/dist/chat.d.ts +1 -1
- package/dist/chat.js +1 -1
- package/dist/{index-CUhfHT_V.d.ts → index-aoBxiKex.d.ts} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/chat/user-message.test.tsx +9 -3
- package/src/chat/user-message.tsx +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @tangle-network/ui
|
|
2
2
|
|
|
3
|
+
## 11.11.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 720de9a: Normalize the shared neutral palette and regenerate standalone chart tokens so charts follow the palette. Make user message cards wrap in narrow layouts.
|
|
8
|
+
|
|
3
9
|
## 11.11.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -17,8 +17,8 @@ function formatTime$1(date) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* The single user message bubble — a quiet, right-aligned
|
|
21
|
-
*
|
|
20
|
+
* The single user message bubble — a quiet, right-aligned card with a subtle
|
|
21
|
+
* semantic border (no loud fill, no uppercase label). The timestamp sits
|
|
22
22
|
* beside the bubble and appears on hover, so it costs no height. Used by both
|
|
23
23
|
* the run/message list (session-model `parts`) and AgentTimeline (direct
|
|
24
24
|
* `content`/`timestamp`).
|
|
@@ -29,15 +29,15 @@ const UserMessage = memo(({ message: _message, parts, content, timestamp, action
|
|
|
29
29
|
return /* @__PURE__ */ jsx("div", {
|
|
30
30
|
className: "flex justify-end",
|
|
31
31
|
children: /* @__PURE__ */ jsxs("div", {
|
|
32
|
-
className: "group flex max-w-[78%] flex-col items-end gap-2",
|
|
32
|
+
className: "group flex min-w-0 max-w-[78%] flex-col items-end gap-2",
|
|
33
33
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
34
|
-
className: "relative w-full rounded-2xl bg-
|
|
34
|
+
className: "relative w-full min-w-0 rounded-2xl border border-border bg-card px-4 py-3",
|
|
35
35
|
children: [timestamp ? /* @__PURE__ */ jsx("span", {
|
|
36
36
|
"data-user-message-time": "",
|
|
37
37
|
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
38
|
children: formatTime$1(timestamp)
|
|
39
39
|
}) : null, /* @__PURE__ */ jsx("div", {
|
|
40
|
-
className: "whitespace-pre-wrap text-[var(--font-size-base)] leading-[1.5] text-foreground",
|
|
40
|
+
className: "break-words whitespace-pre-wrap text-[var(--font-size-base)] leading-[1.5] text-foreground",
|
|
41
41
|
children: text
|
|
42
42
|
})]
|
|
43
43
|
}), actions ? /* @__PURE__ */ jsx("div", {
|
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-aoBxiKex.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-CpzvkA6m.js";
|
|
2
2
|
export { AgentTimeline, ChatContainer, ChatMessage, MessageList, ThinkingIndicator, UserMessage };
|
|
@@ -87,8 +87,8 @@ interface UserMessageProps {
|
|
|
87
87
|
actions?: ReactNode;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* The single user message bubble — a quiet, right-aligned
|
|
91
|
-
*
|
|
90
|
+
* The single user message bubble — a quiet, right-aligned card with a subtle
|
|
91
|
+
* semantic border (no loud fill, no uppercase label). The timestamp sits
|
|
92
92
|
* beside the bubble and appears on hover, so it costs no height. Used by both
|
|
93
93
|
* the run/message list (session-model `parts`) and AgentTimeline (direct
|
|
94
94
|
* `content`/`timestamp`).
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { t as AgentBranding } from "./branding-26d5ARIr.js";
|
|
|
6
6
|
import { n as DisplayVariant, r as ToolDisplayMetadata, t as CustomToolRenderer } from "./tool-display-DgmL5rIU.js";
|
|
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 { _ 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-D3E5bIAI.js";
|
|
9
|
-
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-
|
|
9
|
+
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-aoBxiKex.js";
|
|
10
10
|
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";
|
|
11
11
|
import { n as ArtifactPaneProps, t as ArtifactPane } from "./artifact-pane-BL_DFWNl.js";
|
|
12
12
|
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 { t as Markdown } from "./markdown-BGqicV82.js";
|
|
19
19
|
import { n as InlineThinkingItem, t as RunGroup } from "./run-group-CxNskmHd.js";
|
|
20
20
|
import { t as OpenUIArtifactRenderer } from "./openui-artifact-renderer-C3bmqfjX.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-CpzvkA6m.js";
|
|
22
22
|
import { t as LiveDuration } from "./run-ZsIKPA6J.js";
|
|
23
23
|
import { n as parseToolEvent, t as ToolCallFeed } from "./tool-call-feed-Djt2q11V.js";
|
|
24
24
|
import "./openui.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/ui",
|
|
3
|
-
"version": "11.11.
|
|
3
|
+
"version": "11.11.4",
|
|
4
4
|
"description": "Generic React UI components for Tangle products — primitives, chat, run, files, editor, markdown.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"peerDependencies": {
|
|
140
140
|
"@hocuspocus/provider": ">=2.15.0 <5.0.0",
|
|
141
141
|
"@nanostores/react": ">=0.8.4 <3.0.0",
|
|
142
|
-
"@tangle-network/brand": "^1.
|
|
142
|
+
"@tangle-network/brand": "^1.9.0",
|
|
143
143
|
"@tiptap/core": ">=3.20.4 <4.0.0",
|
|
144
144
|
"@tiptap/extension-collaboration": ">=3.20.4 <4.0.0",
|
|
145
145
|
"@tiptap/extension-collaboration-caret": ">=3.7.0 <4.0.0",
|
|
@@ -3,13 +3,19 @@ import { describe, expect, it } from "vitest"
|
|
|
3
3
|
import { UserMessage } from "./user-message"
|
|
4
4
|
|
|
5
5
|
describe("UserMessage", () => {
|
|
6
|
-
it("renders the text in a
|
|
6
|
+
it("renders the text in a bordered card 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).
|
|
11
|
+
expect(bubble!.className).toContain("bg-card")
|
|
12
|
+
expect(bubble!.className).toContain("border-border")
|
|
13
|
+
expect(container.querySelector(".group")?.className).toContain(
|
|
14
|
+
"min-w-0",
|
|
15
|
+
)
|
|
16
|
+
expect(screen.getByText("Run the tests.").className).toContain(
|
|
17
|
+
"break-words",
|
|
18
|
+
)
|
|
13
19
|
})
|
|
14
20
|
|
|
15
21
|
it("keeps the timestamp beside the bubble as a hover-revealed label", () => {
|
|
@@ -17,8 +17,8 @@ function formatTime(date: Date): string {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The single user message bubble — a quiet, right-aligned
|
|
21
|
-
*
|
|
20
|
+
* The single user message bubble — a quiet, right-aligned card with a subtle
|
|
21
|
+
* semantic border (no loud fill, no uppercase label). The timestamp sits
|
|
22
22
|
* beside the bubble and appears on hover, so it costs no height. Used by both
|
|
23
23
|
* the run/message list (session-model `parts`) and AgentTimeline (direct
|
|
24
24
|
* `content`/`timestamp`).
|
|
@@ -36,8 +36,10 @@ export const UserMessage = memo(
|
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<div className="flex justify-end">
|
|
39
|
-
<div className="group flex max-w-[78%] flex-col items-end gap-2">
|
|
40
|
-
<div
|
|
39
|
+
<div className="group flex min-w-0 max-w-[78%] flex-col items-end gap-2">
|
|
40
|
+
<div
|
|
41
|
+
className="relative w-full min-w-0 rounded-2xl border border-border bg-card px-4 py-3"
|
|
42
|
+
>
|
|
41
43
|
{timestamp ? (
|
|
42
44
|
<span
|
|
43
45
|
data-user-message-time=""
|
|
@@ -46,7 +48,7 @@ export const UserMessage = memo(
|
|
|
46
48
|
{formatTime(timestamp)}
|
|
47
49
|
</span>
|
|
48
50
|
) : null}
|
|
49
|
-
<div className="whitespace-pre-wrap text-[var(--font-size-base)] leading-[1.5] text-foreground">
|
|
51
|
+
<div className="break-words whitespace-pre-wrap text-[var(--font-size-base)] leading-[1.5] text-foreground">
|
|
50
52
|
{text}
|
|
51
53
|
</div>
|
|
52
54
|
</div>
|