@tangle-network/ui 11.0.0 → 11.2.0

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/{artifact-pane-DvJyPWV4.d.ts → artifact-pane-DpuWcAiF.d.ts} +10 -1
  3. package/dist/chat.d.ts +8 -2
  4. package/dist/chat.js +5 -5
  5. package/dist/{chunk-52Y3FMFI.js → chunk-3M7BPSSW.js} +1 -1
  6. package/dist/chunk-4ORVXSMU.js +507 -0
  7. package/dist/{chunk-LELGOLFV.js → chunk-GGDYWMFF.js} +15 -7
  8. package/dist/{chunk-CCM2KRQH.js → chunk-HW4ROISY.js} +1 -1
  9. package/dist/{chunk-KBOD47AW.js → chunk-J3YZIQNI.js} +2 -2
  10. package/dist/{chunk-CSAIKY36.js → chunk-LTEKI7YJ.js} +12 -7
  11. package/dist/{chunk-KHO7DYXH.js → chunk-OTZWQJ5W.js} +107 -72
  12. package/dist/{chunk-FJBTCTZM.js → chunk-P5F43A65.js} +1 -1
  13. package/dist/{chunk-SZ44QDA6.js → chunk-RADUPP44.js} +12 -5
  14. package/dist/{chunk-HHYUPAOJ.js → chunk-SRAKCVPO.js} +49 -81
  15. package/dist/{document-editor-pane-DyDEX_Zm.d.ts → document-editor-pane-C3cYEDWZ.d.ts} +2 -2
  16. package/dist/{document-editor-pane-WCTA3ZOE.js → document-editor-pane-OQNGM4RJ.js} +3 -3
  17. package/dist/editor.d.ts +3 -3
  18. package/dist/editor.js +3 -3
  19. package/dist/files.d.ts +5 -3
  20. package/dist/files.js +3 -3
  21. package/dist/hooks.js +4 -4
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.js +9 -9
  24. package/dist/markdown.js +1 -1
  25. package/dist/openui.js +2 -2
  26. package/dist/primitives.d.ts +1 -1
  27. package/dist/primitives.js +1 -1
  28. package/dist/run.d.ts +4 -3
  29. package/dist/run.js +5 -5
  30. package/dist/sdk-hooks.js +4 -4
  31. package/package.json +1 -1
  32. package/src/chat/agent-timeline.stories.tsx +11 -0
  33. package/src/chat/agent-timeline.test.tsx +34 -0
  34. package/src/chat/agent-timeline.tsx +65 -12
  35. package/src/chat/chat-container.tsx +5 -0
  36. package/src/editor/document-editor-pane.stories.tsx +74 -0
  37. package/src/editor/document-editor-pane.tsx +10 -3
  38. package/src/files/file-artifact-pane.tsx +14 -2
  39. package/src/files/file-preview.stories.tsx +22 -1
  40. package/src/files/file-preview.tsx +2 -2
  41. package/src/markdown/markdown.stories.tsx +55 -1
  42. package/src/markdown/markdown.test.tsx +23 -0
  43. package/src/markdown/markdown.tsx +1 -1
  44. package/src/primitives/artifact-pane.tsx +52 -26
  45. package/src/run/expandable-content.test.tsx +52 -0
  46. package/src/run/expandable-content.tsx +73 -0
  47. package/src/run/expanded-tool-detail.tsx +17 -12
  48. package/src/run/inline-thinking-item.stories.tsx +30 -1
  49. package/src/run/inline-thinking-item.tsx +34 -70
  50. package/src/run/inline-tool-item.tsx +30 -116
  51. package/src/run/run-row-shell.test.tsx +38 -0
  52. package/src/run/run-row-shell.tsx +191 -0
  53. package/dist/chunk-INMWNFAS.js +0 -369
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-ZRVH3WCA.js";
7
7
  import {
8
8
  ArtifactPane
9
- } from "./chunk-CSAIKY36.js";
9
+ } from "./chunk-LTEKI7YJ.js";
10
10
  import {
11
11
  Markdown
12
- } from "./chunk-FJBTCTZM.js";
12
+ } from "./chunk-P5F43A65.js";
13
13
  import {
14
14
  CodeBlock,
15
15
  CopyButton
@@ -407,7 +407,7 @@ function PdfPreview({ blobUrl, filename }) {
407
407
  ) });
408
408
  }
409
409
  function TextPreview({ content }) {
410
- return /* @__PURE__ */ jsx3("pre", { className: "bg-background rounded-[var(--radius-md)] border border-border p-4 overflow-auto max-h-[70vh] text-sm text-foreground font-mono leading-[1.55]", children: content });
410
+ return /* @__PURE__ */ jsx3("pre", { className: "bg-card rounded-[var(--radius-md)] border border-border p-4 overflow-auto max-h-[70vh] text-sm text-foreground font-mono leading-[1.55]", children: content });
411
411
  }
412
412
  function UnsupportedPreview({
413
413
  filename,
@@ -422,7 +422,7 @@ function UnsupportedPreview({
422
422
  ] });
423
423
  }
424
424
  function MarkdownPreview({ content }) {
425
- return /* @__PURE__ */ jsx3("div", { className: "rounded-[var(--radius-md)] border border-border bg-background p-5", children: /* @__PURE__ */ jsx3(Markdown, { className: "prose-sm max-w-none", children: content }) });
425
+ return /* @__PURE__ */ jsx3("div", { className: "rounded-[var(--radius-md)] border border-border bg-background p-5", children: /* @__PURE__ */ jsx3(Markdown, { children: content }) });
426
426
  }
427
427
  function EmptyPreview({ filename }) {
428
428
  return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center justify-center py-16 text-muted-foreground", children: [
@@ -560,7 +560,7 @@ import { lazy, Suspense } from "react";
560
560
  import { Download as Download2, X as X3 } from "lucide-react";
561
561
  import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
562
562
  var LazyDocumentEditorPane = lazy(async () => {
563
- const module = await import("./document-editor-pane-WCTA3ZOE.js");
563
+ const module = await import("./document-editor-pane-OQNGM4RJ.js");
564
564
  return { default: module.DocumentEditorPane };
565
565
  });
566
566
  function FileArtifactPane({
@@ -580,6 +580,8 @@ function FileArtifactPane({
580
580
  toolbar,
581
581
  footer,
582
582
  className,
583
+ headerClassName,
584
+ hideTitleBlock,
583
585
  editor
584
586
  }) {
585
587
  const showTabs = tabs.length > 0 && onTabSelect && onTabClose;
@@ -594,7 +596,7 @@ function FileArtifactPane({
594
596
  ) : void 0;
595
597
  const isMarkdown = detectFileFormat(filename, mimeType) === "markdown" || (path ? detectFileFormat(path, mimeType) === "markdown" : false);
596
598
  const isEditableMarkdown = isMarkdown && editor?.enabled;
597
- const headerActions = /* @__PURE__ */ jsxs4(Fragment, { children: [
599
+ const headerActions = onDownload || onClose ? /* @__PURE__ */ jsxs4(Fragment, { children: [
598
600
  onDownload && /* @__PURE__ */ jsx5(
599
601
  "button",
600
602
  {
@@ -615,7 +617,7 @@ function FileArtifactPane({
615
617
  children: /* @__PURE__ */ jsx5(X3, { className: "h-4 w-4" })
616
618
  }
617
619
  )
618
- ] });
620
+ ] }) : void 0;
619
621
  if (isEditableMarkdown) {
620
622
  return /* @__PURE__ */ jsx5(
621
623
  Suspense,
@@ -632,6 +634,8 @@ function FileArtifactPane({
632
634
  className,
633
635
  tabs: paneTabs,
634
636
  headerActions,
637
+ headerClassName,
638
+ hideTitleBlock,
635
639
  children: /* @__PURE__ */ jsx5("div", { className: "flex min-h-[12rem] items-center justify-center rounded-[var(--radius-lg)] border border-dashed border-border bg-muted text-sm text-muted-foreground", children: "Loading editor\u2026" })
636
640
  }
637
641
  ),
@@ -647,6 +651,8 @@ function FileArtifactPane({
647
651
  className,
648
652
  tabs: paneTabs,
649
653
  headerActions,
654
+ headerClassName,
655
+ hideTitleBlock,
650
656
  markdown: content ?? "",
651
657
  mode: editor.mode,
652
658
  defaultMode: editor.defaultMode,
@@ -679,6 +685,8 @@ function FileArtifactPane({
679
685
  className,
680
686
  tabs: paneTabs,
681
687
  headerActions,
688
+ headerClassName,
689
+ hideTitleBlock,
682
690
  children: /* @__PURE__ */ jsx5(
683
691
  FilePreview,
684
692
  {
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-OEX7NZE3.js";
12
12
  import {
13
13
  parseToolEvent
14
- } from "./chunk-KBOD47AW.js";
14
+ } from "./chunk-J3YZIQNI.js";
15
15
 
16
16
  // src/hooks/use-dropdown-menu.ts
17
17
  import { useEffect, useRef, useState } from "react";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ToolCallGroup,
3
3
  ToolCallStep
4
- } from "./chunk-INMWNFAS.js";
4
+ } from "./chunk-4ORVXSMU.js";
5
5
  import {
6
6
  Markdown
7
- } from "./chunk-FJBTCTZM.js";
7
+ } from "./chunk-P5F43A65.js";
8
8
  import {
9
9
  cn
10
10
  } from "./chunk-RQHJBTEU.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-RQHJBTEU.js";
4
4
 
5
5
  // src/primitives/artifact-pane.tsx
6
- import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  function ArtifactPane({
8
8
  eyebrow,
9
9
  title,
@@ -16,9 +16,14 @@ function ArtifactPane({
16
16
  emptyState,
17
17
  children,
18
18
  className,
19
- contentClassName
19
+ contentClassName,
20
+ headerClassName,
21
+ hideTitleBlock = false
20
22
  }) {
21
23
  const hasContent = children !== void 0 && children !== null;
24
+ const showTitleRow = !hideTitleBlock || Boolean(headerActions);
25
+ const hasHeader = showTitleRow || Boolean(tabs) || Boolean(toolbar);
26
+ const toolbarNeedsDivider = showTitleRow || Boolean(tabs);
22
27
  return /* @__PURE__ */ jsxs(
23
28
  "section",
24
29
  {
@@ -27,20 +32,20 @@ function ArtifactPane({
27
32
  className
28
33
  ),
29
34
  children: [
30
- /* @__PURE__ */ jsxs("header", { className: "border-b border-border bg-muted/10", children: [
31
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3 px-3 py-2", children: [
32
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
35
+ hasHeader && /* @__PURE__ */ jsxs("header", { className: cn("border-b border-border bg-muted/10", headerClassName), children: [
36
+ showTitleRow && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3 px-3 py-2", children: [
37
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: !hideTitleBlock && /* @__PURE__ */ jsxs(Fragment, { children: [
33
38
  eyebrow && /* @__PURE__ */ jsx("div", { className: "mb-1 inline-flex max-w-full items-center px-1 py-0.5 text-[10px] font-bold uppercase tracking-wider text-muted-foreground", children: eyebrow }),
34
39
  /* @__PURE__ */ jsx("div", { className: "min-w-0 text-[13px] font-medium text-foreground", children: title }),
35
40
  (subtitle || meta) && /* @__PURE__ */ jsxs("div", { className: "mt-1 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs leading-relaxed text-muted-foreground", children: [
36
41
  subtitle && /* @__PURE__ */ jsx("span", { className: "truncate", children: subtitle }),
37
42
  meta && /* @__PURE__ */ jsx("span", { className: "flex items-center gap-2", children: meta })
38
43
  ] })
39
- ] }),
44
+ ] }) }),
40
45
  headerActions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-1.5", children: headerActions })
41
46
  ] }),
42
47
  tabs,
43
- toolbar && /* @__PURE__ */ jsx("div", { className: "border-t border-border px-3 py-2", children: toolbar })
48
+ toolbar && /* @__PURE__ */ jsx("div", { className: cn("px-3 py-2", toolbarNeedsDivider && "border-t border-border"), children: toolbar })
44
49
  ] }),
45
50
  /* @__PURE__ */ jsx("div", { className: cn("min-h-0 flex-1 overflow-auto", contentClassName), children: hasContent ? children : emptyState ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center p-6", children: emptyState }) : null }),
46
51
  footer && /* @__PURE__ */ jsx("footer", { className: "shrink-0 border-t border-border bg-card px-3 py-2", children: footer })
@@ -6,20 +6,20 @@ import {
6
6
  import {
7
7
  InlineThinkingItem,
8
8
  RunGroup
9
- } from "./chunk-HHYUPAOJ.js";
9
+ } from "./chunk-SRAKCVPO.js";
10
10
  import {
11
11
  ToolCallGroup,
12
12
  ToolCallStep
13
- } from "./chunk-INMWNFAS.js";
13
+ } from "./chunk-4ORVXSMU.js";
14
14
  import {
15
15
  getToolDisplayMetadata
16
16
  } from "./chunk-ULDNFLIM.js";
17
17
  import {
18
18
  OpenUIArtifactRenderer
19
- } from "./chunk-52Y3FMFI.js";
19
+ } from "./chunk-3M7BPSSW.js";
20
20
  import {
21
21
  Markdown
22
- } from "./chunk-FJBTCTZM.js";
22
+ } from "./chunk-P5F43A65.js";
23
23
  import {
24
24
  cn
25
25
  } from "./chunk-RQHJBTEU.js";
@@ -103,6 +103,7 @@ var MessageList = memo2(
103
103
  MessageList.displayName = "MessageList";
104
104
 
105
105
  // src/chat/agent-timeline.tsx
106
+ import { useState as useState2 } from "react";
106
107
  import {
107
108
  AlertTriangle,
108
109
  CheckCircle2,
@@ -170,11 +171,12 @@ var TONE_STYLES = {
170
171
  function formatTime2(date) {
171
172
  return date.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
172
173
  }
173
- function AgentTimelineRow({ isLast, accentClassName, children }) {
174
+ var CARD_ROW_DOT = "mt-[calc((2.5rem-var(--timeline-dot-size))/2)]";
175
+ function AgentTimelineRow({ isLast, accentClassName, dotClassName = "mt-2", children }) {
174
176
  return /* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-[1.25rem_minmax(0,1fr)] gap-x-4", children: [
175
177
  /* @__PURE__ */ jsxs3("div", { className: "relative flex justify-center", children: [
176
178
  !isLast && /* @__PURE__ */ jsx4("span", { className: "absolute top-4 bottom-[-0.75rem] left-1/2 w-px -translate-x-1/2 bg-border" }),
177
- /* @__PURE__ */ jsx4("span", { className: cn("relative mt-2 h-[var(--timeline-dot-size)] w-[var(--timeline-dot-size)] rounded-full ring-4 ring-[var(--bg-root)]", accentClassName) })
179
+ /* @__PURE__ */ jsx4("span", { className: cn("relative h-[var(--timeline-dot-size)] w-[var(--timeline-dot-size)] rounded-full ring-4 ring-[var(--bg-root)]", dotClassName, accentClassName) })
178
180
  ] }),
179
181
  /* @__PURE__ */ jsx4("div", { className: "min-w-0 pb-3", children })
180
182
  ] });
@@ -233,80 +235,111 @@ function AgentTimeline({
233
235
  isThinking,
234
236
  emptyState,
235
237
  className,
236
- renderToolActions
238
+ renderToolActions,
239
+ collapseAfter
237
240
  }) {
241
+ const [expanded, setExpanded] = useState2(false);
238
242
  if (items.length === 0 && !isThinking) {
239
243
  return emptyState ? /* @__PURE__ */ jsx4("div", { className: cn("flex h-full items-center justify-center p-4", className), children: emptyState }) : null;
240
244
  }
241
245
  const renderedItems = isThinking ? [...items, { id: "__thinking__", kind: "custom", content: /* @__PURE__ */ jsx4(ThinkingIndicator, {}) }] : items;
242
- const timelineItems = renderedItems.filter((item) => !(item.kind === "message" && item.role === "user"));
243
- return /* @__PURE__ */ jsx4("div", { className: cn("mx-auto w-full max-w-5xl px-4 py-4", className), children: renderedItems.map((item, index) => {
244
- if (item.kind === "message" && item.role === "user") {
245
- return /* @__PURE__ */ jsx4("div", { className: "mt-6 mb-4 first:mt-0", children: /* @__PURE__ */ jsx4(UserMessage, { content: item.content, timestamp: item.timestamp }) }, item.id);
246
+ const isUserMessage = (item) => item.kind === "message" && item.role === "user";
247
+ const timelineItems = renderedItems.filter((item) => !isUserMessage(item));
248
+ const limit = collapseAfter ?? Infinity;
249
+ const collapsible = timelineItems.length > limit;
250
+ const collapsed = collapsible && !expanded;
251
+ let renderList = renderedItems;
252
+ let hiddenCount = 0;
253
+ if (collapsed) {
254
+ const visible = [];
255
+ let spineCount = 0;
256
+ for (const item of renderedItems) {
257
+ if (spineCount >= limit) break;
258
+ visible.push(item);
259
+ if (!isUserMessage(item)) spineCount += 1;
246
260
  }
247
- const timelineIndex = timelineItems.indexOf(item);
248
- const isLast = timelineIndex === timelineItems.length - 1;
249
- if (item.kind === "message") {
250
- return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--brand-glow)]", children: /* @__PURE__ */ jsx4(AssistantMessage, { item }) }, item.id);
251
- }
252
- if (item.kind === "tool") {
253
- return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--border-hover)]", children: /* @__PURE__ */ jsx4(
254
- ToolCallStep,
255
- {
256
- type: item.call.type,
257
- label: item.call.label,
258
- status: item.call.status,
259
- detail: item.call.detail,
260
- output: item.call.output,
261
- duration: item.call.duration,
262
- part: item.part,
263
- actions: item.part ? renderToolActions?.(item.part) : void 0
264
- }
265
- ) }, item.id);
266
- }
267
- if (item.kind === "tool_group") {
268
- return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--border-hover)]", children: /* @__PURE__ */ jsx4(ToolCallGroup, { title: item.title, children: item.calls.map((call, callIndex) => {
269
- const part = item.parts?.[callIndex];
270
- return /* @__PURE__ */ jsx4(
261
+ renderList = visible;
262
+ hiddenCount = timelineItems.length - limit;
263
+ }
264
+ const visibleSpine = renderList.filter((item) => !isUserMessage(item));
265
+ const lastSpineItem = collapsible ? void 0 : visibleSpine[visibleSpine.length - 1];
266
+ return /* @__PURE__ */ jsxs3("div", { className: cn("mx-auto w-full max-w-5xl px-4 py-4", className), children: [
267
+ renderList.map((item) => {
268
+ if (item.kind === "message" && item.role === "user") {
269
+ return /* @__PURE__ */ jsx4("div", { className: "mt-6 mb-4 first:mt-0", children: /* @__PURE__ */ jsx4(UserMessage, { content: item.content, timestamp: item.timestamp }) }, item.id);
270
+ }
271
+ const isLast = item === lastSpineItem;
272
+ if (item.kind === "message") {
273
+ return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--brand-glow)]", children: /* @__PURE__ */ jsx4(AssistantMessage, { item }) }, item.id);
274
+ }
275
+ if (item.kind === "tool") {
276
+ return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--border-hover)]", dotClassName: CARD_ROW_DOT, children: /* @__PURE__ */ jsx4(
271
277
  ToolCallStep,
272
278
  {
273
- type: call.type,
274
- label: call.label,
275
- status: call.status,
276
- detail: call.detail,
277
- output: call.output,
278
- duration: call.duration,
279
- part,
280
- actions: part ? renderToolActions?.(part) : void 0
279
+ type: item.call.type,
280
+ label: item.call.label,
281
+ status: item.call.status,
282
+ detail: item.call.detail,
283
+ output: item.call.output,
284
+ duration: item.call.duration,
285
+ part: item.part,
286
+ actions: item.part ? renderToolActions?.(item.part) : void 0
287
+ }
288
+ ) }, item.id);
289
+ }
290
+ if (item.kind === "tool_group") {
291
+ return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--border-hover)]", dotClassName: CARD_ROW_DOT, children: /* @__PURE__ */ jsx4(ToolCallGroup, { title: item.title, children: item.calls.map((call, callIndex) => {
292
+ const part = item.parts?.[callIndex];
293
+ return /* @__PURE__ */ jsx4(
294
+ ToolCallStep,
295
+ {
296
+ type: call.type,
297
+ label: call.label,
298
+ status: call.status,
299
+ detail: call.detail,
300
+ output: call.output,
301
+ duration: call.duration,
302
+ part,
303
+ actions: part ? renderToolActions?.(part) : void 0
304
+ },
305
+ call.id
306
+ );
307
+ }) }) }, item.id);
308
+ }
309
+ if (item.kind === "status") {
310
+ return /* @__PURE__ */ jsx4(
311
+ AgentTimelineRow,
312
+ {
313
+ isLast,
314
+ accentClassName: TONE_STYLES[item.tone ?? "default"].dot,
315
+ children: /* @__PURE__ */ jsx4(StatusCard, { item })
281
316
  },
282
- call.id
317
+ item.id
283
318
  );
284
- }) }) }, item.id);
285
- }
286
- if (item.kind === "status") {
287
- return /* @__PURE__ */ jsx4(
288
- AgentTimelineRow,
289
- {
290
- isLast,
291
- accentClassName: TONE_STYLES[item.tone ?? "default"].dot,
292
- children: /* @__PURE__ */ jsx4(StatusCard, { item })
293
- },
294
- item.id
295
- );
296
- }
297
- if (item.kind === "artifact") {
298
- return /* @__PURE__ */ jsx4(
299
- AgentTimelineRow,
300
- {
301
- isLast,
302
- accentClassName: TONE_STYLES[item.tone ?? "default"].dot,
303
- children: /* @__PURE__ */ jsx4(ArtifactCard, { item })
304
- },
305
- item.id
306
- );
307
- }
308
- return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--border-hover)]", children: item.content }, item.id);
309
- }) });
319
+ }
320
+ if (item.kind === "artifact") {
321
+ return /* @__PURE__ */ jsx4(
322
+ AgentTimelineRow,
323
+ {
324
+ isLast,
325
+ accentClassName: TONE_STYLES[item.tone ?? "default"].dot,
326
+ children: /* @__PURE__ */ jsx4(ArtifactCard, { item })
327
+ },
328
+ item.id
329
+ );
330
+ }
331
+ return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--border-hover)]", dotClassName: CARD_ROW_DOT, children: item.content }, item.id);
332
+ }),
333
+ collapsible ? /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast: true, accentClassName: "bg-[var(--border-hover)]", children: /* @__PURE__ */ jsx4(
334
+ "button",
335
+ {
336
+ type: "button",
337
+ onClick: () => setExpanded((value) => !value),
338
+ className: "text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",
339
+ children: collapsed ? `Show ${hiddenCount} more step${hiddenCount === 1 ? "" : "s"}` : "Show less"
340
+ }
341
+ ) }) : null
342
+ ] });
310
343
  }
311
344
 
312
345
  // src/chat/chat-container.tsx
@@ -552,7 +585,8 @@ var ChatContainer = memo3(
552
585
  renderRunActions,
553
586
  renderUserMessageActions,
554
587
  renderToolActions,
555
- renderTimelineToolActions
588
+ renderTimelineToolActions,
589
+ collapseTimelineAfter
556
590
  }) => {
557
591
  const scrollRef = useRef(null);
558
592
  const groups = useRunGroups({ messages, partMap, isStreaming });
@@ -578,7 +612,8 @@ var ChatContainer = memo3(
578
612
  {
579
613
  items: timeline.items,
580
614
  isThinking: timeline.showThinking,
581
- renderToolActions: renderTimelineToolActions
615
+ renderToolActions: renderTimelineToolActions,
616
+ collapseAfter: collapseTimelineAfter
582
617
  }
583
618
  ) }) : /* @__PURE__ */ jsx5("div", { className: "mx-auto flex min-h-full w-full max-w-3xl flex-col justify-end", children: /* @__PURE__ */ jsx5(
584
619
  MessageList,
@@ -16,7 +16,7 @@ var Markdown = memo(({ children, className }) => {
16
16
  return /* @__PURE__ */ jsx(
17
17
  "div",
18
18
  {
19
- className: cn("prose prose-sm dark:prose-invert max-w-none", className),
19
+ className: cn("tangle-prose max-w-none text-sm", className),
20
20
  children: /* @__PURE__ */ jsx(
21
21
  ReactMarkdown,
22
22
  {
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-Q56BYXQF.js";
7
7
  import {
8
8
  ArtifactPane
9
- } from "./chunk-CSAIKY36.js";
9
+ } from "./chunk-LTEKI7YJ.js";
10
10
  import {
11
11
  Markdown
12
- } from "./chunk-FJBTCTZM.js";
12
+ } from "./chunk-P5F43A65.js";
13
13
  import {
14
14
  cn
15
15
  } from "./chunk-RQHJBTEU.js";
@@ -1030,6 +1030,8 @@ function DocumentEditorPane({
1030
1030
  footer,
1031
1031
  className,
1032
1032
  contentClassName,
1033
+ headerClassName,
1034
+ hideTitleBlock,
1033
1035
  tabs,
1034
1036
  toolbar,
1035
1037
  markdown = "",
@@ -1126,10 +1128,13 @@ function DocumentEditorPane({
1126
1128
  "div",
1127
1129
  {
1128
1130
  className: cn(
1129
- "rounded-[var(--radius-lg)] border border-border bg-background p-5",
1131
+ // The outer margin is the card's gutter (rather than padding on the tab
1132
+ // panel) so `previewClassName` can govern the whole box — gutter, border,
1133
+ // surface, and inner padding — e.g. to render the document full-bleed.
1134
+ "m-4 rounded-[var(--radius-lg)] border border-border bg-card p-5",
1130
1135
  previewClassName
1131
1136
  ),
1132
- children: /* @__PURE__ */ jsx5(Markdown, { className: "prose-sm max-w-none", children: draft })
1137
+ children: /* @__PURE__ */ jsx5(Markdown, { children: draft })
1133
1138
  }
1134
1139
  );
1135
1140
  const localEditor = /* @__PURE__ */ jsx5(
@@ -1174,9 +1179,11 @@ function DocumentEditorPane({
1174
1179
  tabs,
1175
1180
  className,
1176
1181
  contentClassName,
1182
+ headerClassName,
1177
1183
  toolbar: editorToolbar,
1184
+ hideTitleBlock,
1178
1185
  children: [
1179
- /* @__PURE__ */ jsx5(TabsContent, { value: "preview", className: "mt-0 h-full px-4 py-4", children: preview }),
1186
+ /* @__PURE__ */ jsx5(TabsContent, { value: "preview", className: "mt-0 h-full", children: preview }),
1180
1187
  /* @__PURE__ */ jsx5(TabsContent, { value: "edit", className: "mt-0 h-full px-4 py-4", children: isCollaborative ? collaborativeEditor : localEditor })
1181
1188
  ]
1182
1189
  }