@tangle-network/ui 11.12.0 → 11.13.1

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 (276) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/_virtual/_rolldown/runtime.js +13 -0
  3. package/dist/auth/auth.d.ts +53 -0
  4. package/dist/{auth-DOETfnd9.js → auth/auth.js} +7 -37
  5. package/dist/auth/login-layout.d.ts +20 -0
  6. package/dist/auth/login-layout.js +36 -0
  7. package/dist/auth.d.ts +2 -1
  8. package/dist/auth.js +2 -1
  9. package/dist/chat/agent-timeline.d.ts +83 -0
  10. package/dist/chat/agent-timeline.js +236 -0
  11. package/dist/chat/chat-container.d.ts +51 -0
  12. package/dist/chat/chat-container.js +309 -0
  13. package/dist/chat/chat-message.d.ts +22 -0
  14. package/dist/chat/chat-message.js +38 -0
  15. package/dist/chat/message-list.d.ts +32 -0
  16. package/dist/chat/message-list.js +37 -0
  17. package/dist/chat/thinking-indicator.d.ts +6 -0
  18. package/dist/chat/thinking-indicator.js +38 -0
  19. package/dist/chat/user-message.d.ts +21 -0
  20. package/dist/chat/user-message.js +42 -0
  21. package/dist/chat.d.ts +6 -1
  22. package/dist/chat.js +6 -1
  23. package/dist/editor/document-editor-pane.d.ts +37 -0
  24. package/dist/editor/document-editor-pane.js +199 -0
  25. package/dist/editor/editor-lazy.js +37 -0
  26. package/dist/editor/editor-loading.js +21 -0
  27. package/dist/editor/editor-peers.d.ts +6 -0
  28. package/dist/editor/editor-peers.js +155 -0
  29. package/dist/editor/editor-provider.d.ts +97 -0
  30. package/dist/editor/editor-provider.js +253 -0
  31. package/dist/editor/editor-toolbar.d.ts +11 -0
  32. package/dist/editor/editor-toolbar.js +106 -0
  33. package/dist/editor/markdown-conversion.js +23 -0
  34. package/dist/editor/markdown-document-editor.js +103 -0
  35. package/dist/editor/tiptap-editor.d.ts +45 -0
  36. package/dist/editor/tiptap-editor.js +271 -0
  37. package/dist/editor/use-editor.d.ts +67 -0
  38. package/dist/editor/use-editor.js +158 -0
  39. package/dist/editor.d.ts +6 -119
  40. package/dist/editor.js +5 -1
  41. package/dist/files/file-artifact-pane.d.ts +47 -0
  42. package/dist/files/file-artifact-pane.js +114 -0
  43. package/dist/files/file-format.d.ts +51 -0
  44. package/dist/{file-format-BgXbr-Ib.js → files/file-format.js} +1 -1
  45. package/dist/files/file-preview.d.ts +27 -0
  46. package/dist/files/file-preview.js +359 -0
  47. package/dist/files/file-tabs.d.ts +19 -0
  48. package/dist/files/file-tabs.js +48 -0
  49. package/dist/files/file-tree.d.ts +31 -0
  50. package/dist/files/file-tree.js +135 -0
  51. package/dist/files/rich-file-tree.d.ts +62 -0
  52. package/dist/files/rich-file-tree.js +122 -0
  53. package/dist/files.d.ts +6 -1
  54. package/dist/files.js +6 -2
  55. package/dist/hooks/use-auth.d.ts +40 -0
  56. package/dist/hooks/use-auth.js +91 -0
  57. package/dist/hooks/use-auto-scroll.d.ts +11 -0
  58. package/dist/hooks/use-auto-scroll.js +48 -0
  59. package/dist/hooks/use-dropdown-menu.d.ts +12 -0
  60. package/dist/hooks/use-dropdown-menu.js +31 -0
  61. package/dist/hooks/use-live-time.d.ts +7 -0
  62. package/dist/hooks/use-live-time.js +22 -0
  63. package/dist/hooks/use-realtime-session.d.ts +32 -0
  64. package/dist/hooks/use-realtime-session.js +235 -0
  65. package/dist/hooks/use-run-collapse-state.d.ts +13 -0
  66. package/dist/hooks/use-run-collapse-state.js +24 -0
  67. package/dist/hooks/use-run-groups.d.ts +11 -0
  68. package/dist/hooks/use-run-groups.js +85 -0
  69. package/dist/hooks/use-sdk-session.d.ts +59 -0
  70. package/dist/hooks/use-sdk-session.js +322 -0
  71. package/dist/hooks/use-sse-stream.d.ts +124 -0
  72. package/dist/hooks/use-sse-stream.js +229 -0
  73. package/dist/hooks/use-tool-call-stream.d.ts +23 -0
  74. package/dist/hooks/use-tool-call-stream.js +75 -0
  75. package/dist/hooks.d.ts +11 -49
  76. package/dist/hooks.js +10 -110
  77. package/dist/index.d.ts +99 -25
  78. package/dist/index.js +86 -36
  79. package/dist/lib/focus.d.ts +55 -0
  80. package/dist/{focus-BcE_SHqz.js → lib/focus.js} +1 -1
  81. package/dist/lib/utils.d.ts +4 -0
  82. package/dist/{utils-C_uf36nf.js → lib/utils.js} +1 -1
  83. package/dist/{code-block-B9miUPht.d.ts → markdown/code-block.d.ts} +5 -6
  84. package/dist/{code-block-B36KVUSN.js → markdown/code-block.js} +60 -55
  85. package/dist/{markdown-C0atSabr.d.ts → markdown/markdown.d.ts} +4 -5
  86. package/dist/{markdown-Db08KAYF.js → markdown/markdown.js} +3 -3
  87. package/dist/markdown.d.ts +2 -2
  88. package/dist/markdown.js +2 -2
  89. package/dist/{openui-artifact-renderer-fkBQaoLO.d.ts → openui/openui-artifact-renderer.d.ts} +20 -21
  90. package/dist/{openui-artifact-renderer-DG_i2lOR.js → openui/openui-artifact-renderer.js} +9 -7
  91. package/dist/{schema-BpW9rSSG.js → openui/schema-compiled.js} +2 -354
  92. package/dist/{schema-DAstk-J4.d.ts → openui/schema-data.d.ts} +3 -24
  93. package/dist/openui/schema-data.js +206 -0
  94. package/dist/openui-schema.d.ts +22 -3
  95. package/dist/openui-schema.js +138 -1
  96. package/dist/openui.d.ts +3 -2
  97. package/dist/openui.js +3 -2
  98. package/dist/{artifact-pane-BL_DFWNl.d.ts → primitives/artifact-pane.d.ts} +3 -4
  99. package/dist/{artifact-pane-DMXT9a8U.js → primitives/artifact-pane.js} +2 -2
  100. package/dist/primitives/avatar.d.ts +8 -0
  101. package/dist/primitives/avatar.js +25 -0
  102. package/dist/primitives/badge.d.ts +22 -0
  103. package/dist/primitives/badge.js +47 -0
  104. package/dist/{button-yoIv77e2.d.ts → primitives/button.d.ts} +2 -2
  105. package/dist/primitives/button.js +113 -0
  106. package/dist/primitives/card.d.ts +18 -0
  107. package/dist/primitives/card.js +52 -0
  108. package/dist/primitives/code-block.d.ts +6 -0
  109. package/dist/primitives/code-block.js +13 -0
  110. package/dist/primitives/dialog.d.ts +23 -0
  111. package/dist/primitives/dialog.js +59 -0
  112. package/dist/primitives/drop-zone.d.ts +23 -0
  113. package/dist/primitives/drop-zone.js +104 -0
  114. package/dist/primitives/dropdown-menu.d.ts +29 -0
  115. package/dist/{dropdown-menu-BpcLa5vF.js → primitives/dropdown-menu.js} +2 -23
  116. package/dist/primitives/empty-state.d.ts +11 -0
  117. package/dist/primitives/empty-state.js +32 -0
  118. package/dist/primitives/heading.d.ts +23 -0
  119. package/dist/primitives/heading.js +38 -0
  120. package/dist/primitives/input.d.ts +23 -0
  121. package/dist/primitives/input.js +110 -0
  122. package/dist/primitives/label.d.ts +6 -0
  123. package/dist/primitives/label.js +16 -0
  124. package/dist/primitives/metric-strip.d.ts +48 -0
  125. package/dist/primitives/metric-strip.js +52 -0
  126. package/dist/primitives/page-header.d.ts +25 -0
  127. package/dist/primitives/page-header.js +47 -0
  128. package/dist/primitives/page-shell.d.ts +14 -0
  129. package/dist/primitives/page-shell.js +17 -0
  130. package/dist/primitives/progress.d.ts +9 -0
  131. package/dist/primitives/progress.js +29 -0
  132. package/dist/primitives/segmented-control.d.ts +40 -0
  133. package/dist/primitives/segmented-control.js +57 -0
  134. package/dist/primitives/select.d.ts +15 -0
  135. package/dist/primitives/select.js +74 -0
  136. package/dist/primitives/sidebar-drop-zone.d.ts +21 -0
  137. package/dist/primitives/sidebar-drop-zone.js +88 -0
  138. package/dist/primitives/skeleton.d.ts +10 -0
  139. package/dist/primitives/skeleton.js +50 -0
  140. package/dist/primitives/stat-card.d.ts +16 -0
  141. package/dist/primitives/stat-card.js +60 -0
  142. package/dist/primitives/status-pill.d.ts +44 -0
  143. package/dist/primitives/status-pill.js +119 -0
  144. package/dist/primitives/switch.d.ts +6 -0
  145. package/dist/primitives/switch.js +16 -0
  146. package/dist/primitives/table.d.ts +22 -0
  147. package/dist/primitives/table.js +63 -0
  148. package/dist/primitives/tabs.d.ts +13 -0
  149. package/dist/{tabs-BVHR6NkO.js → primitives/tabs.js} +3 -3
  150. package/dist/primitives/terminal-display.d.ts +25 -0
  151. package/dist/primitives/terminal-display.js +109 -0
  152. package/dist/primitives/text-shimmer.d.ts +16 -0
  153. package/dist/{text-shimmer-BUUo6I-g.js → primitives/text-shimmer.js} +2 -2
  154. package/dist/primitives/theme-toggle.d.ts +11 -0
  155. package/dist/primitives/theme-toggle.js +154 -0
  156. package/dist/primitives/toast.d.ts +29 -0
  157. package/dist/primitives/toast.js +142 -0
  158. package/dist/primitives/toolbar.d.ts +55 -0
  159. package/dist/primitives/toolbar.js +37 -0
  160. package/dist/primitives/upload-progress.d.ts +23 -0
  161. package/dist/primitives/upload-progress.js +72 -0
  162. package/dist/primitives.d.ts +35 -5
  163. package/dist/primitives.js +35 -9
  164. package/dist/{index-COgqsFAQ.d.ts → redaction/redacted-document.d.ts} +6 -7
  165. package/dist/{redaction-CGGB2ENG.js → redaction/redacted-document.js} +2 -2
  166. package/dist/redaction.d.ts +1 -1
  167. package/dist/redaction.js +1 -1
  168. package/dist/run/expandable-content.js +41 -0
  169. package/dist/run/expanded-tool-detail.d.ts +12 -0
  170. package/dist/run/expanded-tool-detail.js +163 -0
  171. package/dist/run/inline-thinking-item.d.ts +11 -0
  172. package/dist/run/inline-thinking-item.js +60 -0
  173. package/dist/run/inline-tool-item.d.ts +25 -0
  174. package/dist/run/inline-tool-item.js +63 -0
  175. package/dist/run/run-group.d.ts +26 -0
  176. package/dist/{run-group-BWGeesgs.js → run/run-group.js} +9 -60
  177. package/dist/run/run-item-primitives.d.ts +5 -0
  178. package/dist/{run-ZsIKPA6J.js → run/run-item-primitives.js} +2 -2
  179. package/dist/run/run-row-shell.d.ts +53 -0
  180. package/dist/run/run-row-shell.js +114 -0
  181. package/dist/{tool-call-feed-BeB1_4pX.d.ts → run/tool-call-feed.d.ts} +7 -12
  182. package/dist/{tool-call-feed-BpmMLpPX.js → run/tool-call-feed.js} +4 -4
  183. package/dist/run/tool-call-step.d.ts +5 -0
  184. package/dist/run/tool-call-step.js +82 -0
  185. package/dist/run.d.ts +8 -2
  186. package/dist/run.js +7 -4
  187. package/dist/sdk-hooks.d.ts +8 -1
  188. package/dist/sdk-hooks.js +8 -2
  189. package/dist/stores/active-sessions-store.d.ts +83 -0
  190. package/dist/{active-sessions-store-Gt1R0rFG.js → stores/active-sessions-store.js} +1 -1
  191. package/dist/stores/chat-store.d.ts +14 -0
  192. package/dist/stores/chat-store.js +33 -0
  193. package/dist/stores.d.ts +3 -16
  194. package/dist/stores.js +2 -33
  195. package/dist/tool-previews/command-preview.d.ts +11 -0
  196. package/dist/tool-previews/command-preview.js +91 -0
  197. package/dist/tool-previews/diff-preview.d.ts +7 -0
  198. package/dist/tool-previews/diff-preview.js +76 -0
  199. package/dist/tool-previews/glob-results-preview.d.ts +7 -0
  200. package/dist/tool-previews/glob-results-preview.js +53 -0
  201. package/dist/tool-previews/grep-results-preview.d.ts +7 -0
  202. package/dist/tool-previews/grep-results-preview.js +99 -0
  203. package/dist/tool-previews/preview-primitives.js +58 -0
  204. package/dist/tool-previews/question-preview.d.ts +7 -0
  205. package/dist/tool-previews/question-preview.js +63 -0
  206. package/dist/tool-previews/web-search-preview.d.ts +7 -0
  207. package/dist/tool-previews/web-search-preview.js +78 -0
  208. package/dist/tool-previews/write-file-preview.d.ts +11 -0
  209. package/dist/tool-previews/write-file-preview.js +52 -0
  210. package/dist/tool-previews.d.ts +7 -1
  211. package/dist/tool-previews.js +7 -1
  212. package/dist/{branding-26d5ARIr.d.ts → types/branding.d.ts} +2 -3
  213. package/dist/{message-vhUI0c5G.d.ts → types/message.d.ts} +2 -3
  214. package/dist/{parts-5mhy9yJ3.d.ts → types/parts.d.ts} +8 -9
  215. package/dist/{run-OyWmIDqu.d.ts → types/run.d.ts} +9 -10
  216. package/dist/{tool-display-DgmL5rIU.d.ts → types/tool-display.d.ts} +5 -6
  217. package/dist/types.d.ts +5 -5
  218. package/dist/utils/copy-text.d.ts +7 -0
  219. package/dist/{utils-Bl_CZ0Qp.js → utils/copy-text.js} +1 -11
  220. package/dist/utils/format.d.ts +22 -0
  221. package/dist/{format-DfcLWqMa.js → utils/format.js} +1 -1
  222. package/dist/utils/time-ago.d.ts +3 -0
  223. package/dist/utils/time-ago.js +11 -0
  224. package/dist/utils/tool-display.d.ts +16 -0
  225. package/dist/{tool-display-BAuAVa43.js → utils/tool-display.js} +1 -1
  226. package/dist/utils.d.ts +6 -1
  227. package/dist/utils.js +6 -5
  228. package/package.json +2 -2
  229. package/src/files/rich-file-tree.stories.tsx +1 -1
  230. package/src/files/rich-file-tree.tsx +12 -9
  231. package/src/markdown/code-block.test.tsx +80 -2
  232. package/src/markdown/code-block.tsx +76 -80
  233. package/src/primitives/button.stories.tsx +37 -1
  234. package/src/primitives/button.test.tsx +230 -0
  235. package/src/primitives/button.tsx +62 -14
  236. package/src/primitives/card-anatomy.stories.tsx +51 -0
  237. package/src/primitives/card.test.tsx +71 -0
  238. package/src/primitives/card.tsx +25 -13
  239. package/src/primitives/heading.stories.tsx +35 -0
  240. package/src/primitives/heading.test.tsx +56 -0
  241. package/src/primitives/heading.tsx +76 -0
  242. package/src/primitives/index.ts +8 -0
  243. package/src/primitives/input.stories.tsx +28 -0
  244. package/src/primitives/input.test.tsx +161 -0
  245. package/src/primitives/input.tsx +34 -28
  246. package/src/primitives/page-header.stories.tsx +51 -0
  247. package/src/primitives/page-header.test.tsx +48 -0
  248. package/src/primitives/page-header.tsx +35 -35
  249. package/src/primitives/page-shell.stories.tsx +89 -0
  250. package/src/primitives/page-shell.test.tsx +24 -0
  251. package/src/primitives/page-shell.tsx +26 -0
  252. package/src/primitives/table-wrapper.stories.tsx +54 -0
  253. package/src/primitives/table.test.tsx +72 -0
  254. package/src/primitives/table.tsx +33 -12
  255. package/src/primitives/theme-toggle.test.tsx +167 -0
  256. package/src/primitives/theme-toggle.tsx +111 -39
  257. package/dist/active-sessions-store-nl70ZnMC.d.ts +0 -84
  258. package/dist/button-C87nEe2R.js +0 -78
  259. package/dist/chat-DDvF2oGQ.js +0 -672
  260. package/dist/diff-preview-BcK3nRXb.js +0 -533
  261. package/dist/document-editor-pane-BilJfiCo.d.ts +0 -136
  262. package/dist/document-editor-pane-POsq5Q0o.js +0 -1279
  263. package/dist/files-hywocVZz.js +0 -753
  264. package/dist/index-2UntyjBb.d.ts +0 -52
  265. package/dist/index-BgUHilZm.d.ts +0 -108
  266. package/dist/index-CJ8wRfiC.d.ts +0 -236
  267. package/dist/index-CPDET_s1.d.ts +0 -549
  268. package/dist/index-Cg6gYAqh.d.ts +0 -73
  269. package/dist/index-Cs7j8V7l.d.ts +0 -203
  270. package/dist/index-DjKxO357.d.ts +0 -128
  271. package/dist/primitives-Bx59fT-U.js +0 -1239
  272. package/dist/table-Bss73DhB.js +0 -146
  273. package/dist/tool-call-step-DNebqhmX.js +0 -434
  274. package/dist/use-auto-scroll-C5Pjeqon.js +0 -153
  275. package/dist/use-sse-stream-DjqRuDft.js +0 -884
  276. package/dist/use-sse-stream-Dm6R5YWz.d.ts +0 -282
@@ -1,52 +0,0 @@
1
- import { i as ToolPart } from "./parts-5mhy9yJ3.js";
2
- //#region src/tool-previews/command-preview.d.ts
3
- interface CommandPreviewProps {
4
- part: ToolPart;
5
- }
6
- /**
7
- * Terminal-style command output preview.
8
- * Shows the command, exit code, and stdout/stderr with expand/collapse.
9
- */
10
- declare const CommandPreview: import("react").MemoExoticComponent<({ part }: CommandPreviewProps) => import("react").JSX.Element>;
11
- //#endregion
12
- //#region src/tool-previews/write-file-preview.d.ts
13
- interface WriteFilePreviewProps {
14
- part: ToolPart;
15
- }
16
- /**
17
- * Preview for file write/create operations.
18
- * Shows file path, line count, and the written content.
19
- */
20
- declare const WriteFilePreview: import("react").MemoExoticComponent<({ part }: WriteFilePreviewProps) => import("react").JSX.Element | null>;
21
- //#endregion
22
- //#region src/tool-previews/grep-results-preview.d.ts
23
- interface GrepResultsPreviewProps {
24
- part: ToolPart;
25
- }
26
- declare const GrepResultsPreview: import("react").MemoExoticComponent<({ part }: GrepResultsPreviewProps) => import("react").JSX.Element>;
27
- //#endregion
28
- //#region src/tool-previews/glob-results-preview.d.ts
29
- interface GlobResultsPreviewProps {
30
- part: ToolPart;
31
- }
32
- declare const GlobResultsPreview: import("react").MemoExoticComponent<({ part }: GlobResultsPreviewProps) => import("react").JSX.Element>;
33
- //#endregion
34
- //#region src/tool-previews/web-search-preview.d.ts
35
- interface WebSearchPreviewProps {
36
- part: ToolPart;
37
- }
38
- declare const WebSearchPreview: import("react").MemoExoticComponent<({ part }: WebSearchPreviewProps) => import("react").JSX.Element>;
39
- //#endregion
40
- //#region src/tool-previews/question-preview.d.ts
41
- interface QuestionPreviewProps {
42
- part: ToolPart;
43
- }
44
- declare const QuestionPreview: import("react").MemoExoticComponent<({ part }: QuestionPreviewProps) => import("react").JSX.Element>;
45
- //#endregion
46
- //#region src/tool-previews/diff-preview.d.ts
47
- interface DiffPreviewProps {
48
- part: ToolPart;
49
- }
50
- declare const DiffPreview: import("react").MemoExoticComponent<({ part }: DiffPreviewProps) => import("react").JSX.Element>;
51
- //#endregion
52
- export { WebSearchPreview as a, GlobResultsPreviewProps as c, WriteFilePreview as d, WriteFilePreviewProps as f, QuestionPreviewProps as i, GrepResultsPreview as l, CommandPreviewProps as m, DiffPreviewProps as n, WebSearchPreviewProps as o, CommandPreview as p, QuestionPreview as r, GlobResultsPreview as s, DiffPreview as t, GrepResultsPreviewProps as u };
@@ -1,108 +0,0 @@
1
- import { i as ToolPart } from "./parts-5mhy9yJ3.js";
2
- import { r as ToolDisplayMetadata } from "./tool-display-DgmL5rIU.js";
3
- import { s as ToolCategory } from "./run-OyWmIDqu.js";
4
- import { ClassValue } from "clsx";
5
- //#region src/utils/copy-text.d.ts
6
- /**
7
- * Copy text to clipboard with a non-secure-context fallback.
8
- * Returns true if a copy strategy likely succeeded.
9
- */
10
- declare function copyText(text: string): Promise<boolean>;
11
- //#endregion
12
- //#region src/utils/format.d.ts
13
- /** Format a duration in milliseconds to a human-readable string. */
14
- declare function formatDuration(ms: number): string;
15
- /** Truncate text to `max` characters, appending "..." if truncated. */
16
- declare function truncateText(text: string, max: number): string;
17
- /**
18
- * Format an uptime duration in milliseconds with progressive
19
- * granularity, so short-lived sandboxes don't render as "0d 0h".
20
- * - < 60s → "Ns"
21
- * - < 60m → "Nm Ss"
22
- * - < 24h → "Nh Mm"
23
- * - otherwise → "Nd Hh"
24
- */
25
- declare function formatUptime(ms: number): string;
26
- /**
27
- * Format a byte count using binary units (KiB/MiB/GiB, surfaced as
28
- * "KB/MB/GB" for readability). KB and MB use one decimal below 10 and
29
- * round above; GB keeps two decimals below 10 so half-GB changes stay
30
- * visible on memory dashboards, and drops to one decimal above.
31
- */
32
- declare function formatBytes(bytes: number): string;
33
- //#endregion
34
- //#region src/utils/time-ago.d.ts
35
- declare function timeAgo(ts: number): string;
36
- //#endregion
37
- //#region src/utils/tool-display.d.ts
38
- declare const TOOL_CATEGORY_ICONS: Record<ToolCategory, string>;
39
- declare function getToolCategory(toolName: string): ToolCategory;
40
- /**
41
- * Title is the bare verb ("Read", "Edit", "Shell"); the path, command, pattern
42
- * or query lives in `description` only, so a row prints its subject once.
43
- * `targetPath` / `commandSnippet` carry the untruncated value for consumers
44
- * that need it (diff headers, expanded detail).
45
- */
46
- declare function getToolDisplayMetadata(part: ToolPart): ToolDisplayMetadata;
47
- /** Extract error text from a tool part, if any. */
48
- declare function getToolErrorText(part: ToolPart, fallback?: string): string | undefined;
49
- //#endregion
50
- //#region src/lib/utils.d.ts
51
- declare function cn(...inputs: ClassValue[]): string;
52
- //#endregion
53
- //#region src/lib/focus.d.ts
54
- /**
55
- * The focus treatment every control shares, in two shapes over one palette
56
- * (`--focus-border`, `--focus-halo` and `--border-strong` from
57
- * `@tangle-network/brand`'s tokens.css).
58
- *
59
- * A FIELD — input, textarea, select trigger, composer — shows focus on its own
60
- * border: the hairline shifts to `--focus-border` and a 3px `--focus-halo` ring
61
- * spreads outside it. It keys off `:focus`, because a caret in a field needs the
62
- * cue whether the field was clicked or tabbed into.
63
- *
64
- * A CONTROL — button, tab, switch, link, card — has no border to shift, so it
65
- * draws a 1px `--focus-border` outline with the same 3px halo beyond it. It keys
66
- * off `:focus-visible`, so a mouse click leaves no ring.
67
- *
68
- * The halo is a Tailwind ring, which renders as box-shadow: it follows
69
- * border-radius and never moves layout, and a consumer removes it with
70
- * `focus:ring-0` / `focus-visible:ring-0`, which tailwind-merge resolves against
71
- * these classes. The control's line is an outline so that forced-colors mode,
72
- * which drops box-shadows, still paints it. A field has its border for that, so
73
- * it hides the outline with `outline-hidden`, which stays transparent-but-present
74
- * in forced-colors mode.
75
- */
76
- /**
77
- * Resting hairline, neutral hover, and `:focus` border plus halo for a text
78
- * field. The hover is a plain `hover:` class so a consumer's `hover:border-*`
79
- * replaces it through tailwind-merge; the focus border outranks it because
80
- * Tailwind emits `focus:` after `hover:`.
81
- */
82
- declare const focusField = "border-border transition-[border-color,box-shadow] duration-150 ease-out hover:border-[var(--border-strong)] focus:outline-hidden focus:border-[var(--focus-border)] focus:ring-3 focus:ring-[var(--focus-halo)]";
83
- /**
84
- * The field treatment for a container that wraps a borderless field, such as a
85
- * composer around a textarea and its buttons. It lights while a FIELD inside
86
- * has focus: a text input, textarea, native select or contenteditable editor. A
87
- * focused button, checkbox or button-type input inside the container shows only
88
- * its own ring, so a click on the send button does not read as field focus and
89
- * a tab to it does not stack two indicators. `:focus-within` cannot tell the
90
- * two apart, so the rule keys off `:has()`; a consumer's `focus-within:*` class
91
- * therefore does not replace it. To style that container's focus differently,
92
- * compose your own classes instead of this helper. The field selector is
93
- * written out in full because Tailwind reads class names statically.
94
- * Base styles use its marker class to clear the inner editor fallback outline.
95
- */
96
- declare const focusFieldWithin = "focus-field-within border-border transition-[border-color,box-shadow] duration-150 ease-out hover:border-[var(--border-strong)] has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:border-[var(--focus-border)] has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:ring-3 has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:ring-[var(--focus-halo)]";
97
- /** Error state for a field: a danger hairline and the same focus shape in danger. Compose after `focusField`. */
98
- declare const focusFieldInvalid = "border-[var(--surface-danger-border)] hover:border-[var(--surface-danger-border)] focus:border-[var(--focus-border-danger)] focus:ring-[var(--focus-halo-danger)]";
99
- /** Keyboard-only focus for a control: a 1px focus line with the halo beyond it. */
100
- declare const focusRing = "focus-visible:outline-1 focus-visible:outline-[var(--focus-border)] focus-visible:ring-4 focus-visible:ring-[var(--focus-halo)] focus-visible:outline-offset-0";
101
- /**
102
- * `focusRing` drawn inside the box, for a control flush against a scroll
103
- * container or its neighbours (a tab strip, a list row), where an outer ring
104
- * would be clipped or would overlap them.
105
- */
106
- declare const focusRingInset = "focus-visible:outline-1 focus-visible:outline-[var(--focus-border)] focus-visible:ring-4 focus-visible:ring-[var(--focus-halo)] focus-visible:-outline-offset-1 focus-visible:ring-inset";
107
- //#endregion
108
- export { focusRingInset as a, getToolCategory as c, timeAgo as d, formatBytes as f, copyText as g, truncateText as h, focusRing as i, getToolDisplayMetadata as l, formatUptime as m, focusFieldInvalid as n, cn as o, formatDuration as p, focusFieldWithin as r, TOOL_CATEGORY_ICONS as s, focusField as t, getToolErrorText as u };
@@ -1,236 +0,0 @@
1
- import { i as DocumentEditorPaneCollaborationConfig, n as DocumentEditorMode, t as DocumentEditorBackend } from "./document-editor-pane-BilJfiCo.js";
2
- import { n as ArtifactPaneProps } from "./artifact-pane-BL_DFWNl.js";
3
- import { CSSProperties, ReactNode } from "react";
4
- import { UrlTransform } from "react-markdown";
5
- import { ContextMenuItem, ContextMenuOpenContext, GitStatus, GitStatusEntry } from "@pierre/trees";
6
- //#region src/files/file-tree.d.ts
7
- /**
8
- * FileTree — directory browser with file type icons.
9
- *
10
- * Renders a hierarchical file system view. Clicking a file
11
- * triggers onSelect with the full path.
12
- */
13
- interface FileNode {
14
- name: string;
15
- path: string;
16
- type: "file" | "directory";
17
- children?: FileNode[];
18
- size?: number;
19
- mimeType?: string;
20
- }
21
- interface FileTreeProps {
22
- root: FileNode;
23
- selectedPath?: string;
24
- onSelect?: (path: string, node: FileNode) => void;
25
- className?: string;
26
- defaultExpanded?: boolean;
27
- visibility?: FileTreeVisibilityOptions;
28
- }
29
- interface FileTreeVisibilityOptions {
30
- hiddenPaths?: string[];
31
- hiddenPathPrefixes?: string[];
32
- isVisible?: (node: FileNode) => boolean;
33
- }
34
- declare function filterFileTree(root: FileNode, visibility?: FileTreeVisibilityOptions): FileNode | null;
35
- declare function FileTree({ root, selectedPath, onSelect, className, defaultExpanded, visibility }: FileTreeProps): import("react").JSX.Element | null;
36
- //#endregion
37
- //#region src/files/rich-file-tree.d.ts
38
- /**
39
- * Re-export Pierre's git-status union under a stable name so consumers
40
- * don't import directly from the dep. If we ever swap the underlying
41
- * implementation, only this file changes.
42
- */
43
- type RichFileTreeGitStatus = GitStatus;
44
- type RichFileTreeGitEntry = GitStatusEntry;
45
- interface RichFileTreeProps {
46
- /**
47
- * Either a recursive `FileNode` tree (matches the existing FileTree
48
- * input) or a flat list of canonical paths. Pass exactly one.
49
- */
50
- root?: FileNode;
51
- paths?: ReadonlyArray<string>;
52
- /** Currently-selected path. Pierre supports multi-select internally; the
53
- * wrapper exposes a single string for parity with FileTree. */
54
- selectedPath?: string;
55
- /** Called whenever the selection changes (single-select fan-out). */
56
- onSelect?: (path: string) => void;
57
- /** Show the inline search input. Defaults to true. */
58
- search?: boolean;
59
- /** Open / closed initial expansion. Defaults to "open" — match FileTree. */
60
- initialExpansion?: "open" | "closed";
61
- /** Optional git-status decorations per path. */
62
- gitStatus?: ReadonlyArray<RichFileTreeGitEntry>;
63
- /**
64
- * Right-click / button-lane menu content. Receives the row and the
65
- * trigger context (which interaction opened the menu).
66
- */
67
- renderContextMenu?: (item: ContextMenuItem, context: ContextMenuOpenContext) => ReactNode;
68
- /** Optional header rendered above the tree rows. */
69
- header?: ReactNode;
70
- /**
71
- * Theme override map for shadow-DOM CSS variables. Most consumers can
72
- * leave this — defaults derive from the host element's computed
73
- * tokens via `cssVarFromToken()`.
74
- */
75
- themeOverrides?: Partial<RichFileTreeThemeVars>;
76
- className?: string;
77
- style?: CSSProperties;
78
- /** Inline height (or set via `style.height`). Defaults to 100% of parent. */
79
- height?: number | string;
80
- }
81
- interface RichFileTreeThemeVars {
82
- /** Selected-row background. */
83
- selectedBg: string;
84
- /** Selected-row foreground. */
85
- selectedFg: string;
86
- /** Default row foreground. */
87
- fg: string;
88
- /** Hover background. */
89
- hoverBg: string;
90
- /** Border / divider color. */
91
- border: string;
92
- /** Muted (parent path, breadcrumb) foreground. */
93
- mutedFg: string;
94
- }
95
- declare function RichFileTree({ root, paths, selectedPath, onSelect, search, initialExpansion, gitStatus, renderContextMenu, header, themeOverrides, className, style, height }: RichFileTreeProps): import("react").JSX.Element;
96
- //#endregion
97
- //#region src/files/file-preview.d.ts
98
- interface FilePreviewProps {
99
- filename: string;
100
- content?: string;
101
- /** Object URL or remote URL for binary content: images, PDF, video, audio. */
102
- blobUrl?: string;
103
- mimeType?: string;
104
- /** Size in bytes; download cards show it when known. */
105
- size?: number;
106
- /** Transform Markdown links and images through the shared URL policy. */
107
- urlTransform?: UrlTransform;
108
- onClose?: () => void;
109
- onDownload?: () => void;
110
- hideHeader?: boolean;
111
- className?: string;
112
- }
113
- /** Rows rendered by the CSV preview; the count line reports the total. */
114
- declare const CSV_PREVIEW_ROW_LIMIT = 500;
115
- /**
116
- * Split CSV text into rows of cells (RFC 4180): a quoted cell may hold commas,
117
- * line breaks, and doubled quotes. Unquoted cells are trimmed; blank lines and
118
- * a trailing line break add no row.
119
- */
120
- declare function parseCsv(content: string): string[][];
121
- declare function FilePreview({ filename, content, blobUrl, mimeType, size, urlTransform, onClose, onDownload, hideHeader, className }: FilePreviewProps): import("react").JSX.Element;
122
- //#endregion
123
- //#region src/files/file-tabs.d.ts
124
- /**
125
- * FileTabs — tab bar for open files in the preview panel.
126
- */
127
- interface FileTabData {
128
- id: string;
129
- name: string;
130
- path: string;
131
- dirty?: boolean;
132
- }
133
- interface FileTabsProps {
134
- tabs: FileTabData[];
135
- activeId?: string;
136
- onSelect: (id: string) => void;
137
- onClose: (id: string) => void;
138
- className?: string;
139
- }
140
- declare function FileTabs({ tabs, activeId, onSelect, onClose, className }: FileTabsProps): import("react").JSX.Element | null;
141
- //#endregion
142
- //#region src/files/file-artifact-pane.d.ts
143
- interface FileArtifactPaneEditorOptions {
144
- enabled?: boolean;
145
- /** Persisted baseline when content is the current draft. */
146
- savedContent?: string;
147
- mode?: DocumentEditorMode;
148
- defaultMode?: DocumentEditorMode;
149
- onModeChange?: (mode: DocumentEditorMode) => void;
150
- backend?: DocumentEditorBackend;
151
- collaboration?: DocumentEditorPaneCollaborationConfig;
152
- placeholder?: string;
153
- autoFocus?: boolean;
154
- readOnly?: boolean;
155
- saving?: boolean;
156
- saveLabel?: string;
157
- onChange?: (markdown: string) => void;
158
- onSave?: (markdown: string) => Promise<void> | void;
159
- previewClassName?: string;
160
- editorClassName?: string;
161
- }
162
- interface FileArtifactPaneProps extends Omit<FilePreviewProps, "className"> {
163
- path?: string;
164
- tabs?: FileTabData[];
165
- activeTabId?: string;
166
- onTabSelect?: (id: string) => void;
167
- onTabClose?: (id: string) => void;
168
- eyebrow?: ArtifactPaneProps["eyebrow"];
169
- meta?: ArtifactPaneProps["meta"];
170
- toolbar?: ArtifactPaneProps["toolbar"];
171
- footer?: ArtifactPaneProps["footer"];
172
- className?: string;
173
- headerClassName?: ArtifactPaneProps["headerClassName"];
174
- hideTitleBlock?: ArtifactPaneProps["hideTitleBlock"];
175
- editor?: FileArtifactPaneEditorOptions;
176
- }
177
- /**
178
- * FileArtifactPane — opinionated artifact frame for file previews with tabs and
179
- * header actions. The body is `FilePreview`, so every kind it renders (image,
180
- * PDF, video, audio, CSV, spreadsheet, markdown, code, text) renders here too;
181
- * `onDownload` drives both the header button and the body's download cards.
182
- */
183
- declare function FileArtifactPane({ filename, content, blobUrl, mimeType, size, onClose, onDownload, urlTransform, path, tabs, activeTabId, onTabSelect, onTabClose, eyebrow, meta, toolbar, footer, className, headerClassName, hideTitleBlock, editor }: FileArtifactPaneProps): import("react").JSX.Element;
184
- //#endregion
185
- //#region src/files/file-format.d.ts
186
- /**
187
- * Shared file-format detection for every file surface — the preview pane, the
188
- * artifact pane, and code rendering. Centralising extension/MIME → format logic
189
- * keeps chat and artifact views consistent and avoids the same mapping drifting
190
- * across components.
191
- */
192
- type FileFormat = "pdf" | "image" | "video" | "audio" | "csv" | "spreadsheet" | "code" | "json" | "yaml" | "markdown" | "text" | "unknown";
193
- /**
194
- * How a file surface renders a file. Every format maps to its own renderer;
195
- * `unknown` becomes `binary`, which renders string content as text and offers a
196
- * download for anything else.
197
- */
198
- type FilePreviewKind = Exclude<FileFormat, "unknown"> | "binary";
199
- /**
200
- * Lowercased trailing extension. Returns "" for a name with no extension
201
- * ("README", "json" → ""), and the post-dot name for a dotfile (".bashrc" →
202
- * "bashrc"). Directory components are ignored so dots in a directory name don't
203
- * leak in ("my.config/file" → "").
204
- */
205
- declare function fileExtension(filename: string): string;
206
- /**
207
- * Resolve a filename + optional MIME type to the renderer format. A specific,
208
- * authoritative MIME type wins over the extension; otherwise the extension
209
- * decides; a generic text/plain payload is the final fallback.
210
- */
211
- declare function detectFileFormat(filename: string, mimeType?: string): FileFormat;
212
- /**
213
- * The preview renderer for a file, from its name and optional MIME type only.
214
- * Same precedence as `detectFileFormat` (MIME outranks extension); a file that
215
- * matches nothing is `binary`. Content is not an input: the preview renders a
216
- * `binary` file's string content as text and offers a download otherwise.
217
- */
218
- declare function resolveFilePreviewKind(filename: string, mimeType?: string): FilePreviewKind;
219
- /** Human-facing label for a detected format or preview kind. */
220
- declare function getFormatLabel(format: FileFormat | FilePreviewKind): string;
221
- /**
222
- * Map a filename (or path) to a highlight.js language id for CodeBlock. Returns
223
- * undefined when there is no confident mapping; CodeBlock then renders themed
224
- * monospace and lets the highlighter auto-detect, so callers never need a
225
- * bespoke language table.
226
- */
227
- declare function getSyntaxLanguage(filename: string): string | undefined;
228
- /**
229
- * Highlight language for a file already classified as a code-like format.
230
- * `json`/`yaml` are their own highlight language even when detected purely from
231
- * a MIME type on an extensionless file (where the extension can't reveal it);
232
- * any other code format keys off the extension.
233
- */
234
- declare function getCodeLanguage(filename: string, format: FileFormat | FilePreviewKind): string | undefined;
235
- //#endregion
236
- export { FileNode as C, filterFileTree as D, FileTreeVisibilityOptions as E, RichFileTreeThemeVars as S, FileTreeProps as T, parseCsv as _, getCodeLanguage as a, RichFileTreeGitStatus as b, resolveFilePreviewKind as c, FileTabData as d, FileTabs as f, FilePreviewProps as g, FilePreview as h, fileExtension as i, FileArtifactPane as l, CSV_PREVIEW_ROW_LIMIT as m, FilePreviewKind as n, getFormatLabel as o, FileTabsProps as p, detectFileFormat as r, getSyntaxLanguage as s, FileFormat as t, FileArtifactPaneProps as u, RichFileTree as v, FileTree as w, RichFileTreeProps as x, RichFileTreeGitEntry as y };