@mcp-b/react-components 0.16.1 → 0.18.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 (371) hide show
  1. package/dist/{AgentActivity-BNUNrP9O.d.ts → AgentActivity-D2SHSGFX.d.ts} +1 -1
  2. package/dist/{AgentChat-CrlpbvQJ.d.ts → AgentChat-ClxViuUM.d.ts} +4 -29
  3. package/dist/AgentMessageParts-CyD2UB3V.d.ts +46 -0
  4. package/dist/AgentToolRunsContext-BVe4stgw.d.ts +21 -0
  5. package/dist/{Button-FX_hpqxm.d.ts → Button-DLGzHsjc.d.ts} +13 -7
  6. package/dist/{CodeBlock-BmB4Xaqq.js → CodeBlock-Bfp5PAg3.js} +9 -6
  7. package/dist/{CodeBlock-BRajW4QU.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
  8. package/dist/Collapsible-N64ASIQr.d.ts +119 -0
  9. package/dist/{Combobox-B9Fcd6q-.d.ts → Combobox-CYc37s5l.d.ts} +11 -33
  10. package/dist/{FileTree-CkVbIMWV.js → FileTree-3zYtrddG.js} +46 -20
  11. package/dist/{Menu-Bgu-ufb5.d.ts → Menu-L6MZm-7N.d.ts} +15 -56
  12. package/dist/{Message-BkMdE3bS.js → Message-BXtmfc9Q.js} +13 -20
  13. package/dist/{ModelSelector-SlJNgwKY.js → ModelSelector-Cqw_qrUG.js} +18 -25
  14. package/dist/{PromptInput-BWTuXMOD.d.ts → PromptInput-Bdh9pqlo.d.ts} +41 -71
  15. package/dist/{ResponsiveSidebarShell-Dd9DCcBT.d.ts → ResponsiveSidebarShell-CsAh4NyL.d.ts} +1 -0
  16. package/dist/{Select-BeEsefzh.d.ts → Select-B_13gg_J.d.ts} +16 -44
  17. package/dist/{Tabs-3Zc4tb9D.d.ts → Tabs-ColWK-XA.d.ts} +14 -20
  18. package/dist/{ThinkChat-CzC-zNGA.js → ThinkChat-15EhfvYJ.js} +123 -73
  19. package/dist/{ThinkChatActivity-BFQnb2ct.d.ts → ThinkChatActivity-Bzot45kX.d.ts} +9 -4
  20. package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts} +1 -1
  21. package/dist/{ThinkChatContext-C3Eb1Xpi.d.ts → ThinkChatContext-DrsZqdaO.d.ts} +1 -1
  22. package/dist/ThinkRecoveryNotice-DFIcG9UX.d.ts +19 -0
  23. package/dist/{Toggle-CAAlNl-M.d.ts → Toggle-JKZ43D5S.d.ts} +2 -2
  24. package/dist/{ToggleGroup-8hPv-b69.d.ts → ToggleGroup-DNd6cDJZ.d.ts} +4 -5
  25. package/dist/Workspace-Jez8ffUj.d.ts +274 -0
  26. package/dist/WorkspaceExplorer-B9dQWNVK.d.ts +32 -0
  27. package/dist/{WorkspaceFile-DOZkPwzu.d.ts → WorkspaceFile-CzyHnESE.d.ts} +1 -1
  28. package/dist/{WorkspaceFileView-rSN_yT0L.js → WorkspaceFileView-C68Ub8S8.js} +121 -128
  29. package/dist/{WorkspaceLink-DIPbXrUM.js → WorkspaceLink-BYYeTQLf.js} +20 -55
  30. package/dist/{WorkspaceLink-DK1DWMHe.d.ts → WorkspaceLink-O-EBKUJ8.d.ts} +6 -9
  31. package/dist/class-names-BiMDVpUo.js +14 -0
  32. package/dist/components/Accordion.d.ts +5 -15
  33. package/dist/components/Accordion.js +16 -10
  34. package/dist/components/Activity.d.ts +5 -10
  35. package/dist/components/Activity.js +2 -2
  36. package/dist/components/AgentActivity.d.ts +1 -1
  37. package/dist/components/AgentActivity.js +4 -5
  38. package/dist/components/AgentActivityPreview.d.ts +9 -9
  39. package/dist/components/AgentActivityPreview.js +8 -12
  40. package/dist/components/AgentAttention.d.ts +2 -2
  41. package/dist/components/AgentAttention.js +1 -1
  42. package/dist/components/AgentChat.d.ts +2 -2
  43. package/dist/components/AgentChat.js +113 -218
  44. package/dist/components/AgentChatMessageEditor.js +3 -3
  45. package/dist/components/AgentChatTurnError.js +2 -2
  46. package/dist/components/AgentConnection.js +4 -4
  47. package/dist/components/AgentMessageParts.d.ts +2 -0
  48. package/dist/components/AgentMessageParts.js +119 -0
  49. package/dist/components/AgentToolDetail.d.ts +57 -0
  50. package/dist/components/AgentToolDetail.js +100 -0
  51. package/dist/components/AgentToolRunsContext.d.ts +2 -0
  52. package/dist/components/AgentToolRunsContext.js +16 -0
  53. package/dist/components/AlertDialog.d.ts +7 -19
  54. package/dist/components/AlertDialog.js +21 -32
  55. package/dist/components/AppTopBar.d.ts +28 -8
  56. package/dist/components/AppTopBar.js +36 -12
  57. package/dist/components/Approval.d.ts +102 -0
  58. package/dist/components/Approval.js +227 -0
  59. package/dist/components/Artifact.d.ts +3 -5
  60. package/dist/components/Artifact.js +7 -5
  61. package/dist/components/Autocomplete.d.ts +11 -33
  62. package/dist/components/Autocomplete.js +23 -30
  63. package/dist/components/Avatar.d.ts +4 -12
  64. package/dist/components/Avatar.js +13 -12
  65. package/dist/components/Badge.js +3 -0
  66. package/dist/components/BrowserLiveView.js +27 -12
  67. package/dist/components/BrowserReplay.js +4 -3
  68. package/dist/components/BrowserRunPanel.js +58 -78
  69. package/dist/components/Button.d.ts +1 -1
  70. package/dist/components/Button.js +14 -16
  71. package/dist/components/Card.d.ts +7 -8
  72. package/dist/components/Card.js +19 -10
  73. package/dist/components/ChainOfThought.d.ts +5 -11
  74. package/dist/components/ChainOfThought.js +3 -2
  75. package/dist/components/ChatGptSignInScreen.js +8 -8
  76. package/dist/components/Checkbox.d.ts +2 -4
  77. package/dist/components/Checkbox.js +6 -5
  78. package/dist/components/CheckboxGroup.d.ts +1 -3
  79. package/dist/components/CheckboxGroup.js +15 -14
  80. package/dist/components/Checkpoint.d.ts +64 -0
  81. package/dist/components/Checkpoint.js +63 -0
  82. package/dist/components/CodeBlock.d.ts +1 -1
  83. package/dist/components/CodeBlock.js +1 -1
  84. package/dist/components/CodexModelSelector.d.ts +1 -1
  85. package/dist/components/CodexModelSelector.js +2 -2
  86. package/dist/components/Collapsible.d.ts +1 -124
  87. package/dist/components/Collapsible.js +7 -10
  88. package/dist/components/Combobox.d.ts +1 -1
  89. package/dist/components/Combobox.js +23 -30
  90. package/dist/components/Commit.d.ts +5 -11
  91. package/dist/components/Commit.js +6 -5
  92. package/dist/components/Context.js +1 -1
  93. package/dist/components/ContextMenu.d.ts +21 -37
  94. package/dist/components/ContextMenu.js +34 -51
  95. package/dist/components/Conversation.d.ts +3 -5
  96. package/dist/components/Conversation.js +5 -4
  97. package/dist/components/DescriptionListParts.js +1 -1
  98. package/dist/components/Dialog.d.ts +6 -17
  99. package/dist/components/Dialog.js +17 -24
  100. package/dist/components/EnvironmentVariables.d.ts +1 -1
  101. package/dist/components/EnvironmentVariables.js +4 -3
  102. package/dist/components/Field.d.ts +17 -20
  103. package/dist/components/Field.js +20 -17
  104. package/dist/components/Fieldset.d.ts +2 -7
  105. package/dist/components/Fieldset.js +7 -6
  106. package/dist/components/FileTree.d.ts +6 -0
  107. package/dist/components/FileTree.js +1 -1
  108. package/dist/components/Form.d.ts +1 -4
  109. package/dist/components/Form.js +3 -2
  110. package/dist/components/GithubMotionMark.js +1 -1
  111. package/dist/components/IconButton.d.ts +2 -3
  112. package/dist/components/IconButton.js +2 -1
  113. package/dist/components/InlineCitation.d.ts +66 -0
  114. package/dist/components/InlineCitation.js +142 -0
  115. package/dist/components/Input.d.ts +1 -4
  116. package/dist/components/Input.js +3 -2
  117. package/dist/components/Marker.js +1 -1
  118. package/dist/components/McpConnectionRequest.js +2 -2
  119. package/dist/components/McpServerPicker.d.ts +1 -1
  120. package/dist/components/McpServerPicker.js +6 -5
  121. package/dist/components/MediaPreviewCard.d.ts +103 -0
  122. package/dist/components/MediaPreviewCard.js +193 -0
  123. package/dist/components/Menu.d.ts +1 -1
  124. package/dist/components/Menu.js +33 -52
  125. package/dist/components/Menubar.d.ts +22 -43
  126. package/dist/components/Menubar.js +36 -53
  127. package/dist/components/Message.d.ts +7 -7
  128. package/dist/components/Message.js +1 -1
  129. package/dist/components/MessageScroller.d.ts +2 -2
  130. package/dist/components/MessageScroller.js +6 -5
  131. package/dist/components/Meter.d.ts +5 -20
  132. package/dist/components/Meter.js +11 -10
  133. package/dist/components/ModelSelector.d.ts +6 -9
  134. package/dist/components/ModelSelector.js +1 -1
  135. package/dist/components/NavigationMenu.d.ts +11 -33
  136. package/dist/components/NavigationMenu.js +23 -30
  137. package/dist/components/NumberField.d.ts +6 -24
  138. package/dist/components/NumberField.js +13 -12
  139. package/dist/components/Plan.d.ts +103 -0
  140. package/dist/components/Plan.js +113 -0
  141. package/dist/components/Popover.d.ts +9 -36
  142. package/dist/components/Popover.js +23 -34
  143. package/dist/components/PreviewCard.d.ts +6 -24
  144. package/dist/components/PreviewCard.js +13 -24
  145. package/dist/components/PricingBillingToggle.js +1 -1
  146. package/dist/components/PricingFAQ.js +1 -1
  147. package/dist/components/PricingPage.js +2 -1
  148. package/dist/components/PricingPlanCard.js +5 -4
  149. package/dist/components/PricingUsageCalculator.js +3 -3
  150. package/dist/components/Progress.d.ts +3 -8
  151. package/dist/components/Progress.js +7 -10
  152. package/dist/components/PromptInput.d.ts +2 -2
  153. package/dist/components/PromptInput.js +83 -218
  154. package/dist/components/Queue.d.ts +7 -17
  155. package/dist/components/Queue.js +2 -3
  156. package/dist/components/RadioGroup.d.ts +3 -8
  157. package/dist/components/RadioGroup.js +7 -10
  158. package/dist/components/Reasoning.d.ts +4 -8
  159. package/dist/components/Reasoning.js +3 -6
  160. package/dist/components/ResizableSidePanel.js +2 -2
  161. package/dist/components/ResponsiveSidebarShell.d.ts +1 -1
  162. package/dist/components/ResponsiveSidebarShell.js +18 -11
  163. package/dist/components/ScrollArea.d.ts +5 -20
  164. package/dist/components/ScrollArea.js +12 -10
  165. package/dist/components/SearchField.d.ts +43 -0
  166. package/dist/components/SearchField.js +52 -0
  167. package/dist/components/Select.d.ts +1 -1
  168. package/dist/components/Select.js +33 -57
  169. package/dist/components/Separator.d.ts +1 -5
  170. package/dist/components/Separator.js +3 -6
  171. package/dist/components/Slider.d.ts +6 -19
  172. package/dist/components/Slider.js +15 -14
  173. package/dist/components/Sources.d.ts +4 -9
  174. package/dist/components/Sources.js +3 -2
  175. package/dist/components/Stepper.js +16 -9
  176. package/dist/components/SubagentRunDetails.js +1 -1
  177. package/dist/components/SubagentRunIndicator.js +2 -2
  178. package/dist/components/SubagentRunList.d.ts +3 -5
  179. package/dist/components/SubagentRunList.js +3 -5
  180. package/dist/components/SubagentRunSelector.d.ts +9 -22
  181. package/dist/components/SubagentRunSelector.js +29 -31
  182. package/dist/components/Switch.d.ts +4 -7
  183. package/dist/components/Switch.js +6 -10
  184. package/dist/components/Tabs.d.ts +2 -2
  185. package/dist/components/Tabs.js +21 -18
  186. package/dist/components/Task.d.ts +4 -9
  187. package/dist/components/Task.js +4 -3
  188. package/dist/components/Terminal.d.ts +3 -4
  189. package/dist/components/Terminal.js +5 -4
  190. package/dist/components/TestResults.d.ts +4 -9
  191. package/dist/components/TestResults.js +11 -6
  192. package/dist/components/Textarea.js +1 -1
  193. package/dist/components/ThemeModeControl.js +1 -1
  194. package/dist/components/ThinkChat.d.ts +45 -22
  195. package/dist/components/ThinkChat.js +7 -5
  196. package/dist/components/ThinkChatActivity.d.ts +2 -2
  197. package/dist/components/ThinkChatActivity.js +24 -7
  198. package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
  199. package/dist/components/ThinkChatActivitySummary.js +7 -3
  200. package/dist/components/ThinkChatContext.d.ts +1 -1
  201. package/dist/components/ThinkChatToolPanels.js +27 -17
  202. package/dist/components/ThinkExecutionDetail.js +2 -2
  203. package/dist/components/ThinkExecutionStatus.js +2 -2
  204. package/dist/components/ThinkExecutionWorkbench.d.ts +30 -8
  205. package/dist/components/ThinkExecutionWorkbench.js +70 -134
  206. package/dist/components/ThinkFullApp.d.ts +40 -15
  207. package/dist/components/ThinkFullApp.js +193 -117
  208. package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
  209. package/dist/components/ThinkFullAppViewSwitch.js +2 -2
  210. package/dist/components/ThinkPendingApproval.d.ts +60 -0
  211. package/dist/components/ThinkPendingApproval.js +99 -0
  212. package/dist/components/ThinkRecoveryNotice.d.ts +2 -0
  213. package/dist/components/ThinkRecoveryNotice.js +46 -0
  214. package/dist/components/ThinkRoutine.js +1 -0
  215. package/dist/components/ThinkRoutineBrowser.d.ts +17 -9
  216. package/dist/components/ThinkRoutineBrowser.js +37 -44
  217. package/dist/components/ThinkRoutineDetail.d.ts +5 -2
  218. package/dist/components/ThinkRoutineDetail.js +4 -4
  219. package/dist/components/ThinkRoutineForm.d.ts +3 -2
  220. package/dist/components/ThinkRoutineForm.js +11 -10
  221. package/dist/components/ThinkRoutineLibrary.d.ts +27 -25
  222. package/dist/components/ThinkRoutineLibrary.js +104 -80
  223. package/dist/components/ThinkRoutineRuns.d.ts +3 -2
  224. package/dist/components/ThinkRoutineRuns.js +31 -24
  225. package/dist/components/ThinkThreadPicker.d.ts +17 -11
  226. package/dist/components/ThinkThreadPicker.js +163 -39
  227. package/dist/components/ThinkThreadShell.d.ts +1 -1
  228. package/dist/components/Toast.d.ts +7 -28
  229. package/dist/components/Toast.js +15 -14
  230. package/dist/components/Toggle.d.ts +1 -1
  231. package/dist/components/Toggle.js +10 -8
  232. package/dist/components/ToggleGroup.d.ts +1 -1
  233. package/dist/components/ToggleGroup.js +21 -26
  234. package/dist/components/ToolApproval.d.ts +28 -0
  235. package/dist/components/ToolApproval.js +35 -0
  236. package/dist/components/ToolInvocation.d.ts +26 -0
  237. package/dist/components/ToolInvocation.js +72 -0
  238. package/dist/components/Toolbar.d.ts +6 -24
  239. package/dist/components/Toolbar.js +13 -12
  240. package/dist/components/Tooltip.d.ts +11 -10
  241. package/dist/components/Tooltip.js +17 -11
  242. package/dist/components/TransitionSurface.d.ts +27 -0
  243. package/dist/components/TransitionSurface.js +20 -0
  244. package/dist/components/WebPreview.d.ts +6 -7
  245. package/dist/components/WebPreview.js +70 -55
  246. package/dist/components/Workspace.d.ts +2 -2
  247. package/dist/components/Workspace.js +361 -346
  248. package/dist/components/WorkspaceBrowser.d.ts +4 -7
  249. package/dist/components/WorkspaceBrowser.js +16 -26
  250. package/dist/components/WorkspaceExplorer.d.ts +5 -33
  251. package/dist/components/WorkspaceExplorer.js +19 -32
  252. package/dist/components/WorkspaceFile.d.ts +1 -1
  253. package/dist/components/WorkspaceFileView.d.ts +14 -2
  254. package/dist/components/WorkspaceFileView.js +1 -1
  255. package/dist/components/WorkspaceHeader.d.ts +0 -8
  256. package/dist/components/WorkspaceHeader.js +3 -15
  257. package/dist/components/WorkspaceLink.d.ts +1 -1
  258. package/dist/components/WorkspaceLink.js +1 -1
  259. package/dist/components/icons.d.ts +2 -2
  260. package/dist/components/icons.js +2 -2
  261. package/dist/{copy-button-DtPMgN7e.d.ts → copy-button-D7aAYA-2.d.ts} +2 -3
  262. package/dist/{copy-button-Dejn5heL.js → copy-button-DeK6KXEV.js} +3 -2
  263. package/dist/{icons-CpfUer49.js → icons-CQJ-aMnI.js} +7 -3
  264. package/dist/{icons-GQd1xF4e.d.ts → icons-CYXmvKlJ.d.ts} +22 -2
  265. package/dist/navigation-link-Cob7KBlM.js +19 -0
  266. package/dist/styles/accordion.css +4 -19
  267. package/dist/styles/activity.css +48 -56
  268. package/dist/styles/agent-activity-preview.css +6 -0
  269. package/dist/styles/agent-chat.css +14 -63
  270. package/dist/styles/agent-connection.css +0 -12
  271. package/dist/styles/agent-tool-detail.css +54 -0
  272. package/dist/styles/alert-dialog.css +16 -18
  273. package/dist/styles/app-top-bar.css +17 -9
  274. package/dist/styles/approval.css +177 -0
  275. package/dist/styles/artifact.css +6 -18
  276. package/dist/styles/autocomplete.css +2 -1
  277. package/dist/styles/avatar.css +35 -30
  278. package/dist/styles/badge.css +10 -10
  279. package/dist/styles/base-ui-motion.css +94 -39
  280. package/dist/styles/browser-control-overlay.css +0 -1
  281. package/dist/styles/browser-live-view.css +39 -22
  282. package/dist/styles/browser-replay.css +1 -1
  283. package/dist/styles/browser-run-panel.css +13 -6
  284. package/dist/styles/button.css +36 -33
  285. package/dist/styles/card.css +5 -6
  286. package/dist/styles/chain-of-thought.css +22 -24
  287. package/dist/styles/checkbox.css +18 -5
  288. package/dist/styles/checkpoint.css +58 -0
  289. package/dist/styles/codex-model-selector.css +3 -7
  290. package/dist/styles/collapsible.css +10 -10
  291. package/dist/styles/combobox.css +4 -3
  292. package/dist/styles/commit.css +19 -39
  293. package/dist/styles/composition-motion.css +83 -0
  294. package/dist/styles/context-menu.css +3 -11
  295. package/dist/styles/context.css +11 -10
  296. package/dist/styles/conversation.css +18 -23
  297. package/dist/styles/dialog.css +15 -15
  298. package/dist/styles/environment-variables.css +0 -13
  299. package/dist/styles/field.css +32 -12
  300. package/dist/styles/file-tree.css +66 -22
  301. package/dist/styles/form.css +1 -1
  302. package/dist/styles/index.css +13 -4
  303. package/dist/styles/inline-citation.css +107 -0
  304. package/dist/styles/input.css +2 -2
  305. package/dist/styles/marker.css +14 -13
  306. package/dist/styles/mcp-server-picker.css +20 -47
  307. package/dist/styles/media-preview-card.css +160 -0
  308. package/dist/styles/menu.css +11 -40
  309. package/dist/styles/menubar.css +12 -19
  310. package/dist/styles/message-scroller.css +0 -12
  311. package/dist/styles/message.css +25 -31
  312. package/dist/styles/meter.css +2 -2
  313. package/dist/styles/model-selector.css +16 -34
  314. package/dist/styles/motion-reduction.css +29 -0
  315. package/dist/styles/navigation-menu.css +14 -30
  316. package/dist/styles/number-field.css +22 -4
  317. package/dist/styles/plan.css +132 -0
  318. package/dist/styles/popover.css +15 -52
  319. package/dist/styles/preview-card.css +2 -32
  320. package/dist/styles/progress.css +8 -3
  321. package/dist/styles/prompt-input.css +76 -269
  322. package/dist/styles/queue.css +48 -32
  323. package/dist/styles/radio.css +19 -12
  324. package/dist/styles/reasoning.css +2 -1
  325. package/dist/styles/recipes.css +207 -26
  326. package/dist/styles/resizable-side-panel.css +4 -10
  327. package/dist/styles/responsive-sidebar-shell.css +32 -34
  328. package/dist/styles/scroll-area.css +32 -15
  329. package/dist/styles/search-field.css +21 -0
  330. package/dist/styles/select.css +19 -12
  331. package/dist/styles/slider.css +25 -29
  332. package/dist/styles/sources.css +3 -11
  333. package/dist/styles/stepper.css +36 -26
  334. package/dist/styles/subagent-run.css +13 -71
  335. package/dist/styles/switch.css +32 -29
  336. package/dist/styles/tabs.css +79 -23
  337. package/dist/styles/task.css +11 -23
  338. package/dist/styles/test-results.css +29 -36
  339. package/dist/styles/theme-mode-control.css +8 -0
  340. package/dist/styles/think-execution-workbench.css +18 -15
  341. package/dist/styles/think-full-app.css +51 -100
  342. package/dist/styles/think-routine-library.css +51 -40
  343. package/dist/styles/think-thread-picker.css +207 -50
  344. package/dist/styles/toast.css +48 -34
  345. package/dist/styles/toggle-group.css +2 -36
  346. package/dist/styles/toggle.css +29 -5
  347. package/dist/styles/toolbar.css +25 -27
  348. package/dist/styles/tooltip.css +2 -32
  349. package/dist/styles/transition-surface.css +55 -0
  350. package/dist/styles/utilities.css +31 -0
  351. package/dist/styles/web-preview.css +0 -21
  352. package/dist/styles/workspace-explorer.css +104 -99
  353. package/dist/summarize-tool-input-CqTcGRYy.js +15 -0
  354. package/dist/think-agent-Cip5KAPj.d.ts +7 -0
  355. package/dist/utils/codex-model-catalog.d.ts +4 -4
  356. package/dist/utils/mcp-server-catalog.d.ts +132 -0
  357. package/dist/utils/mcp-server-catalog.js +90 -0
  358. package/dist/utils/structured-code.d.ts +1 -1
  359. package/dist/workspace-path-L_KmjRjq.js +26 -0
  360. package/package.json +14 -9
  361. package/dist/Workspace-D39LxGvP.d.ts +0 -62
  362. package/dist/class-names-9UtZwb0J.js +0 -12
  363. package/dist/components/AppFrame.d.ts +0 -24
  364. package/dist/components/AppFrame.js +0 -25
  365. package/dist/components/Shell.d.ts +0 -163
  366. package/dist/components/Shell.js +0 -137
  367. package/dist/components/SubagentRun.d.ts +0 -86
  368. package/dist/components/SubagentRun.js +0 -108
  369. package/dist/styles/app-frame.css +0 -15
  370. package/dist/styles/shell.css +0 -122
  371. package/dist/summarize-tool-input-BUJsENSn.js +0 -12
@@ -0,0 +1,72 @@
1
+ import { Activity, ActivityContent, ActivityPanel, ActivityTrigger } from "./Activity.js";
2
+ import { getToolDisplayName, isToolPartFailed, isToolPartWorking } from "./ThinkChatToolParts.js";
3
+ import { t as summarizeToolInput } from "../summarize-tool-input-CqTcGRYy.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { getToolName } from "ai";
6
+ import { getToolInput, getToolOutput, getToolPartState } from "@cloudflare/think/react";
7
+ //#region src/components/ToolInvocation.tsx
8
+ function formatToolValue(value) {
9
+ if (value === void 0) return void 0;
10
+ return typeof value === "string" ? value : JSON.stringify(value, null, 2);
11
+ }
12
+ function describeToolPart(part) {
13
+ const name = getToolDisplayName(part);
14
+ let action;
15
+ switch (part.state) {
16
+ case "approval-requested":
17
+ action = `${name} awaiting approval`;
18
+ break;
19
+ case "approval-responded":
20
+ action = part.approval.approved ? `Running ${name}` : `${name} denied`;
21
+ break;
22
+ case "output-error":
23
+ action = `${name} failed`;
24
+ break;
25
+ case "output-denied":
26
+ action = `${name} denied`;
27
+ break;
28
+ case "output-available":
29
+ action = part.preliminary ? `Running ${name}` : `Ran ${name}`;
30
+ break;
31
+ case "input-streaming":
32
+ case "input-available":
33
+ action = `Running ${name}`;
34
+ break;
35
+ }
36
+ const detail = summarizeToolInput(getToolInput(part));
37
+ return detail ? `${action} · ${detail}` : action;
38
+ }
39
+ /**
40
+ * Read-only generic disclosure for one upstream AI SDK tool invocation.
41
+ *
42
+ * The component derives its name, state, input, output, denial, and error
43
+ * presentation from the whole `ToolUIPart | DynamicToolUIPart`. Approval
44
+ * response controls belong to transport-aware adapters rather than this
45
+ * transcript renderer. ThinkChat may replace this fallback with richer panels
46
+ * for known workspace, browser, fetch, session, skill, and execute tools.
47
+ */
48
+ function ToolInvocation({ part, defaultOpen }) {
49
+ const state = getToolPartState(part);
50
+ const failed = isToolPartFailed(part);
51
+ const deniedReason = part.state === "output-denied" ? part.approval.reason : void 0;
52
+ const output = state === "error" ? part.errorText : state === "denied" ? deniedReason ?? "Denied" : formatToolValue(getToolOutput(part));
53
+ const inputStatus = part.state === "approval-requested" ? "awaiting approval" : part.state === "approval-responded" ? part.approval.approved ? "approved" : "denied" : void 0;
54
+ const outputStatus = state === "denied" ? "denied" : failed ? "error" : part.state === "output-available" && part.preliminary ? "preliminary" : void 0;
55
+ return /* @__PURE__ */ jsxs(Activity, {
56
+ isStreaming: isToolPartWorking(part),
57
+ defaultOpen,
58
+ children: [/* @__PURE__ */ jsx(ActivityTrigger, { label: describeToolPart(part) }), /* @__PURE__ */ jsxs(ActivityContent, { children: [/* @__PURE__ */ jsx(ActivityPanel, {
59
+ label: part.title ?? getToolName(part),
60
+ text: formatToolValue(getToolInput(part)),
61
+ status: inputStatus,
62
+ error: inputStatus === "denied"
63
+ }), output !== void 0 ? /* @__PURE__ */ jsx(ActivityPanel, {
64
+ label: "output",
65
+ text: output,
66
+ status: outputStatus,
67
+ error: failed
68
+ }) : null] })]
69
+ });
70
+ }
71
+ //#endregion
72
+ export { ToolInvocation };
@@ -5,45 +5,27 @@ import { Toolbar as Toolbar$1 } from "@base-ui/react/toolbar";
5
5
  /**
6
6
  * Props for the Toolbar.Root component.
7
7
  */
8
- interface ToolbarRootProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Root>, "className"> {
9
- /** Additional CSS class names */
10
- className?: string;
11
- }
8
+ interface ToolbarRootProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Root> {}
12
9
  /**
13
10
  * Props for the Toolbar.Button component.
14
11
  */
15
- interface ToolbarButtonProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Button>, "className"> {
16
- /** Additional CSS class names */
17
- className?: string;
18
- }
12
+ interface ToolbarButtonProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Button> {}
19
13
  /**
20
14
  * Props for the Toolbar.Link component.
21
15
  */
22
- interface ToolbarLinkProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Link>, "className"> {
23
- /** Additional CSS class names */
24
- className?: string;
25
- }
16
+ interface ToolbarLinkProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Link> {}
26
17
  /**
27
18
  * Props for the Toolbar.Group component.
28
19
  */
29
- interface ToolbarGroupProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Group>, "className"> {
30
- /** Additional CSS class names */
31
- className?: string;
32
- }
20
+ interface ToolbarGroupProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Group> {}
33
21
  /**
34
22
  * Props for the Toolbar.Separator component.
35
23
  */
36
- interface ToolbarSeparatorProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Separator>, "className"> {
37
- /** Additional CSS class names */
38
- className?: string;
39
- }
24
+ interface ToolbarSeparatorProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Separator> {}
40
25
  /**
41
26
  * Props for the Toolbar.Input component.
42
27
  */
43
- interface ToolbarInputProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Input>, "className"> {
44
- /** Additional CSS class names */
45
- className?: string;
46
- }
28
+ interface ToolbarInputProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Input> {}
47
29
  /**
48
30
  * Container for grouping toolbar buttons and controls.
49
31
  *
@@ -1,3 +1,4 @@
1
+ import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
1
2
  import "react";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { Toolbar as Toolbar$1 } from "@base-ui/react/toolbar";
@@ -17,8 +18,8 @@ import { Toolbar as Toolbar$1 } from "@base-ui/react/toolbar";
17
18
  *
18
19
  * @see {@link https://base-ui.com/react/components/toolbar | Base UI Toolbar}
19
20
  */
20
- function ToolbarRoot({ className = "", ref, ...props }) {
21
- const classes = ["toolbar", className].filter(Boolean).join(" ");
21
+ function ToolbarRoot({ className, ref, ...props }) {
22
+ const classes = mergeBaseClassName("toolbar", className);
22
23
  return /* @__PURE__ */ jsx(Toolbar$1.Root, {
23
24
  ref,
24
25
  "data-slot": "toolbar",
@@ -29,8 +30,8 @@ function ToolbarRoot({ className = "", ref, ...props }) {
29
30
  /**
30
31
  * A clickable button within the toolbar.
31
32
  */
32
- function ToolbarButton({ className = "", ref, ...props }) {
33
- const classes = ["toolbar__button", className].filter(Boolean).join(" ");
33
+ function ToolbarButton({ className, ref, ...props }) {
34
+ const classes = mergeBaseClassName("toolbar__button", className);
34
35
  return /* @__PURE__ */ jsx(Toolbar$1.Button, {
35
36
  ref,
36
37
  "data-slot": "toolbar-button",
@@ -41,8 +42,8 @@ function ToolbarButton({ className = "", ref, ...props }) {
41
42
  /**
42
43
  * A link element within the toolbar.
43
44
  */
44
- function ToolbarLink({ className = "", ref, ...props }) {
45
- const classes = ["toolbar__link", className].filter(Boolean).join(" ");
45
+ function ToolbarLink({ className, ref, ...props }) {
46
+ const classes = mergeBaseClassName("toolbar__link", className);
46
47
  return /* @__PURE__ */ jsx(Toolbar$1.Link, {
47
48
  ref,
48
49
  "data-slot": "toolbar-link",
@@ -53,8 +54,8 @@ function ToolbarLink({ className = "", ref, ...props }) {
53
54
  /**
54
55
  * Groups toolbar items together.
55
56
  */
56
- function ToolbarGroup({ className = "", ref, ...props }) {
57
- const classes = ["toolbar__group", className].filter(Boolean).join(" ");
57
+ function ToolbarGroup({ className, ref, ...props }) {
58
+ const classes = mergeBaseClassName("toolbar__group", className);
58
59
  return /* @__PURE__ */ jsx(Toolbar$1.Group, {
59
60
  ref,
60
61
  "data-slot": "toolbar-group",
@@ -65,8 +66,8 @@ function ToolbarGroup({ className = "", ref, ...props }) {
65
66
  /**
66
67
  * Visual separator between toolbar sections.
67
68
  */
68
- function ToolbarSeparator({ className = "", ref, ...props }) {
69
- const classes = ["toolbar__separator", className].filter(Boolean).join(" ");
69
+ function ToolbarSeparator({ className, ref, ...props }) {
70
+ const classes = mergeBaseClassName("toolbar__separator", className);
70
71
  return /* @__PURE__ */ jsx(Toolbar$1.Separator, {
71
72
  ref,
72
73
  "data-slot": "toolbar-separator",
@@ -77,8 +78,8 @@ function ToolbarSeparator({ className = "", ref, ...props }) {
77
78
  /**
78
79
  * Input element within the toolbar.
79
80
  */
80
- function ToolbarInput({ className = "", ref, ...props }) {
81
- const classes = ["toolbar__input", className].filter(Boolean).join(" ");
81
+ function ToolbarInput({ className, ref, ...props }) {
82
+ const classes = mergeBaseClassName("toolbar__input", className);
82
83
  return /* @__PURE__ */ jsx(Toolbar$1.Input, {
83
84
  ref,
84
85
  "data-slot": "toolbar-input",
@@ -9,15 +9,9 @@ interface TooltipPositionerProps extends Tooltip$1.Positioner.Props {}
9
9
  interface TooltipProviderProps extends Tooltip$1.Provider.Props {
10
10
  delayDuration?: number;
11
11
  }
12
- interface TooltipPopupProps extends Omit<Tooltip$1.Popup.Props, "className"> {
13
- className?: string;
14
- }
15
- interface TooltipViewportProps extends Omit<Tooltip$1.Viewport.Props, "className"> {
16
- className?: string;
17
- }
18
- interface TooltipArrowProps extends Omit<Tooltip$1.Arrow.Props, "className"> {
19
- className?: string;
20
- }
12
+ interface TooltipPopupProps extends Tooltip$1.Popup.Props {}
13
+ interface TooltipViewportProps extends Tooltip$1.Viewport.Props {}
14
+ interface TooltipArrowProps extends Tooltip$1.Arrow.Props {}
21
15
  /**
22
16
  * A tooltip component for displaying helpful information on hover.
23
17
  *
@@ -46,6 +40,13 @@ declare function TooltipProvider({
46
40
  ...props
47
41
  }: TooltipProviderProps): React.JSX.Element;
48
42
  declare function TooltipTrigger(props: TooltipTriggerProps): React.JSX.Element;
43
+ declare function TooltipPositioner({
44
+ className,
45
+ ref,
46
+ ...props
47
+ }: TooltipPositionerProps & {
48
+ ref?: React.Ref<HTMLDivElement>;
49
+ }): React.JSX.Element;
49
50
  declare function TooltipPopup({
50
51
  className,
51
52
  ref,
@@ -83,7 +84,7 @@ declare const Tooltip: {
83
84
  Provider: typeof TooltipProvider;
84
85
  Trigger: typeof TooltipTrigger;
85
86
  Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").TooltipPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
86
- Positioner: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").TooltipPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
87
+ Positioner: typeof TooltipPositioner;
87
88
  Popup: typeof TooltipPopup;
88
89
  Viewport: typeof TooltipViewport;
89
90
  Arrow: typeof TooltipArrow;
@@ -1,3 +1,4 @@
1
+ import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
1
2
  import "react";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
@@ -36,12 +37,17 @@ function TooltipTrigger(props) {
36
37
  ...props
37
38
  });
38
39
  }
39
- function TooltipPopup({ className = "", ref, role = "tooltip", ...props }) {
40
- const classes = [
41
- "tooltip__popup",
42
- "base-ui-popup",
43
- className
44
- ].filter(Boolean).join(" ");
40
+ function TooltipPositioner({ className, ref, ...props }) {
41
+ const classes = mergeBaseClassName(["tooltip__positioner", "base-ui-positioner"].filter(Boolean).join(" "), className);
42
+ return /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
43
+ ref,
44
+ "data-slot": "tooltip-positioner",
45
+ className: classes,
46
+ ...props
47
+ });
48
+ }
49
+ function TooltipPopup({ className, ref, role = "tooltip", ...props }) {
50
+ const classes = mergeBaseClassName(["tooltip__popup", "base-ui-popup"].filter(Boolean).join(" "), className);
45
51
  return /* @__PURE__ */ jsx(Tooltip$1.Popup, {
46
52
  ref,
47
53
  role,
@@ -55,8 +61,8 @@ function TooltipPopup({ className = "", ref, role = "tooltip", ...props }) {
55
61
  * triggers. Pair the adaptive classes from `base-ui-motion.css` with the
56
62
  * positioner, popup, and this viewport when that behavior is needed.
57
63
  */
58
- function TooltipViewport({ className = "", ref, ...props }) {
59
- const classes = ["tooltip__viewport", className].filter(Boolean).join(" ");
64
+ function TooltipViewport({ className, ref, ...props }) {
65
+ const classes = mergeBaseClassName(["tooltip__viewport"].filter(Boolean).join(" "), className);
60
66
  return /* @__PURE__ */ jsx(Tooltip$1.Viewport, {
61
67
  ref,
62
68
  "data-slot": "tooltip-viewport",
@@ -64,8 +70,8 @@ function TooltipViewport({ className = "", ref, ...props }) {
64
70
  ...props
65
71
  });
66
72
  }
67
- function TooltipArrow({ className = "", ref, ...props }) {
68
- const classes = ["tooltip__arrow", className].filter(Boolean).join(" ");
73
+ function TooltipArrow({ className, ref, ...props }) {
74
+ const classes = mergeBaseClassName(["tooltip__arrow"].filter(Boolean).join(" "), className);
69
75
  return /* @__PURE__ */ jsx(Tooltip$1.Arrow, {
70
76
  ref,
71
77
  "data-slot": "tooltip-arrow",
@@ -83,7 +89,7 @@ const Tooltip = {
83
89
  Provider: TooltipProvider,
84
90
  Trigger: TooltipTrigger,
85
91
  Portal: Tooltip$1.Portal,
86
- Positioner: Tooltip$1.Positioner,
92
+ Positioner: TooltipPositioner,
87
93
  Popup: TooltipPopup,
88
94
  Viewport: TooltipViewport,
89
95
  Arrow: TooltipArrow
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+
3
+ //#region src/components/TransitionSurface.d.ts
4
+ type TransitionSurfaceVariant = "fade" | "scale" | "slide-block" | "slide-inline";
5
+ interface TransitionSurfaceProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ /**
7
+ * The restrained entrance and hidden-state treatment applied to the surface.
8
+ * Pair separate surfaces around Suspense fallback and resolved content.
9
+ * @default "fade"
10
+ */
11
+ variant?: TransitionSurfaceVariant;
12
+ }
13
+ /**
14
+ * A lightweight presence surface for content inserted by React or revealed
15
+ * from `hidden`. CSS owns its motion through `@starting-style` and discrete
16
+ * transitions; this component does not own data loading or Suspense state.
17
+ */
18
+ declare function TransitionSurface({
19
+ className,
20
+ variant,
21
+ ref,
22
+ ...props
23
+ }: TransitionSurfaceProps & {
24
+ ref?: React.Ref<HTMLDivElement>;
25
+ }): React.JSX.Element;
26
+ //#endregion
27
+ export { TransitionSurface, TransitionSurfaceProps, TransitionSurfaceVariant };
@@ -0,0 +1,20 @@
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/components/TransitionSurface.tsx
5
+ /**
6
+ * A lightweight presence surface for content inserted by React or revealed
7
+ * from `hidden`. CSS owns its motion through `@starting-style` and discrete
8
+ * transitions; this component does not own data loading or Suspense state.
9
+ */
10
+ function TransitionSurface({ className, variant = "fade", ref, ...props }) {
11
+ return /* @__PURE__ */ jsx("div", {
12
+ ref,
13
+ "data-slot": "transition-surface",
14
+ "data-variant": variant,
15
+ className: cx("transition-surface", className),
16
+ ...props
17
+ });
18
+ }
19
+ //#endregion
20
+ export { TransitionSurface };
@@ -1,4 +1,4 @@
1
- import { r as ButtonProps } from "../Button-FX_hpqxm.js";
1
+ import { r as ButtonProps } from "../Button-DLGzHsjc.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/WebPreview.d.ts
@@ -17,9 +17,9 @@ interface WebPreviewContextValue {
17
17
  interface WebPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
18
18
  /** Initial URL for uncontrolled preview history. */
19
19
  defaultUrl?: string;
20
- /** Controlled URL pushed into preview history when it changes. */
20
+ /** Controlled URL. Controlled previews leave history ownership to the caller. */
21
21
  url?: string;
22
- /** Called when the displayed URL changes. */
22
+ /** Called when navigation requests a URL change. Controlled callers update `url`. */
23
23
  onUrlChange?: (url: string) => void;
24
24
  /** Additional class names for layout only; do not override iframe sandboxing from apps. */
25
25
  className?: string;
@@ -28,8 +28,8 @@ interface WebPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
28
28
  }
29
29
  /**
30
30
  * An iframe preview with a navigation bar, URL input, and optional console
31
- * panel. Tracks browsing history internally so back/forward buttons work
32
- * without depending on the iframe's own history.
31
+ * panel. Uncontrolled previews track browsing history internally; controlled
32
+ * previews leave history and back/forward behavior to their caller.
33
33
  *
34
34
  * Built internally for agent/browser preview surfaces. Use it to display a
35
35
  * known URL with local navigation controls. Do not use it for trusted app
@@ -77,8 +77,7 @@ declare function WebPreviewNavigation({
77
77
  }: WebPreviewNavigationProps & {
78
78
  ref?: React.Ref<HTMLDivElement>;
79
79
  }): React.JSX.Element;
80
- interface WebPreviewNavigationButtonProps extends Omit<ButtonProps, "variant" | "size" | "color" | "className" | "onClick"> {
81
- className?: string;
80
+ interface WebPreviewNavigationButtonProps extends Omit<ButtonProps, "variant" | "size" | "color" | "onClick"> {
82
81
  action?: "back" | "forward" | "reload";
83
82
  label?: string;
84
83
  tooltip?: string;
@@ -1,5 +1,5 @@
1
- import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { L as RefreshIcon, n as ArrowLeftIcon, r as ArrowRightIcon, s as ChevronDownIcon } from "../icons-CpfUer49.js";
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
+ import { H as RefreshIcon, i as ArrowRightIcon, r as ArrowLeftIcon, u as ChevronDownIcon } from "../icons-CQJ-aMnI.js";
3
3
  import { Button } from "./Button.js";
4
4
  import { Tooltip } from "./Tooltip.js";
5
5
  import { Badge } from "./Badge.js";
@@ -16,8 +16,8 @@ function useWebPreviewContext() {
16
16
  }
17
17
  /**
18
18
  * An iframe preview with a navigation bar, URL input, and optional console
19
- * panel. Tracks browsing history internally so back/forward buttons work
20
- * without depending on the iframe's own history.
19
+ * panel. Uncontrolled previews track browsing history internally; controlled
20
+ * previews leave history and back/forward behavior to their caller.
21
21
  *
22
22
  * Built internally for agent/browser preview surfaces. Use it to display a
23
23
  * known URL with local navigation controls. Do not use it for trusted app
@@ -46,61 +46,65 @@ function useWebPreviewContext() {
46
46
  * ```
47
47
  */
48
48
  function WebPreview({ className, defaultUrl = "", url: controlledUrl, onUrlChange, children, ref, ...props }) {
49
- const initialUrl = controlledUrl ?? defaultUrl;
50
- const [history, setHistory] = React.useState(() => initialUrl ? [initialUrl] : []);
51
- const [index, setIndex] = React.useState(initialUrl ? 0 : -1);
49
+ const [navigation, setNavigation] = React.useState(() => ({
50
+ history: defaultUrl ? [defaultUrl] : [],
51
+ index: defaultUrl ? 0 : -1
52
+ }));
52
53
  const [reloadToken, setReloadToken] = React.useState(0);
53
54
  const [consoleOpen, setConsoleOpen] = React.useState(false);
54
- const url = index >= 0 ? history[index] ?? "" : "";
55
- const onUrlChangeRef = React.useRef(onUrlChange);
56
- onUrlChangeRef.current = onUrlChange;
57
- const historyRef = React.useRef(history);
58
- historyRef.current = history;
59
- const indexRef = React.useRef(index);
60
- indexRef.current = index;
61
- const prevControlledUrlRef = React.useRef(controlledUrl);
62
- React.useEffect(() => {
63
- if (controlledUrl === void 0) return;
64
- if (controlledUrl === prevControlledUrlRef.current) return;
65
- prevControlledUrlRef.current = controlledUrl;
66
- if (!controlledUrl) {
67
- setHistory([]);
68
- setIndex(-1);
69
- return;
70
- }
71
- const currentHistory = historyRef.current;
72
- const currentIndex = indexRef.current;
73
- if (currentIndex >= 0 && currentHistory[currentIndex] === controlledUrl) return;
74
- setHistory([...currentHistory.slice(0, currentIndex + 1), controlledUrl]);
75
- setIndex(currentIndex + 1);
76
- }, [controlledUrl]);
55
+ const { history, index } = navigation;
56
+ const isControlled = controlledUrl !== void 0;
57
+ const url = controlledUrl ?? (index >= 0 ? history[index] ?? "" : "");
77
58
  const setUrl = React.useCallback((next) => {
78
- setHistory((prev) => [...prev.slice(0, index + 1), next]);
79
- setIndex((prev) => prev + 1);
80
- onUrlChangeRef.current?.(next);
81
- }, [index]);
59
+ if (!isControlled) setNavigation((current) => {
60
+ const history = [...current.history.slice(0, current.index + 1), next];
61
+ return {
62
+ history,
63
+ index: history.length - 1
64
+ };
65
+ });
66
+ onUrlChange?.(next);
67
+ }, [isControlled, onUrlChange]);
82
68
  const goBack = React.useCallback(() => {
83
- setIndex((prev) => Math.max(0, prev - 1));
84
- }, []);
69
+ if (isControlled) return;
70
+ const nextIndex = Math.max(0, index - 1);
71
+ if (nextIndex === index) return;
72
+ setNavigation((current) => ({
73
+ ...current,
74
+ index: nextIndex
75
+ }));
76
+ onUrlChange?.(history[nextIndex] ?? "");
77
+ }, [
78
+ history,
79
+ index,
80
+ isControlled,
81
+ onUrlChange
82
+ ]);
85
83
  const goForward = React.useCallback(() => {
86
- setIndex((prev) => Math.min(history.length - 1, prev + 1));
87
- }, [history.length]);
84
+ if (isControlled) return;
85
+ const nextIndex = Math.min(history.length - 1, index + 1);
86
+ if (nextIndex === index) return;
87
+ setNavigation((current) => ({
88
+ ...current,
89
+ index: nextIndex
90
+ }));
91
+ onUrlChange?.(history[nextIndex] ?? "");
92
+ }, [
93
+ history,
94
+ index,
95
+ isControlled,
96
+ onUrlChange
97
+ ]);
88
98
  const reload = React.useCallback(() => {
89
99
  setReloadToken((n) => n + 1);
90
100
  }, []);
91
- const prevIndexRef = React.useRef(index);
92
- React.useEffect(() => {
93
- if (index === prevIndexRef.current) return;
94
- prevIndexRef.current = index;
95
- if (index >= 0) onUrlChangeRef.current?.(history[index] ?? "");
96
- }, [index, history]);
97
101
  const ctxValue = React.useMemo(() => ({
98
102
  url,
99
103
  setUrl,
100
104
  consoleOpen,
101
105
  setConsoleOpen,
102
- canGoBack: index > 0,
103
- canGoForward: index >= 0 && index < history.length - 1,
106
+ canGoBack: !isControlled && index > 0,
107
+ canGoForward: !isControlled && index >= 0 && index < history.length - 1,
104
108
  goBack,
105
109
  goForward,
106
110
  reload,
@@ -109,6 +113,7 @@ function WebPreview({ className, defaultUrl = "", url: controlledUrl, onUrlChang
109
113
  url,
110
114
  setUrl,
111
115
  consoleOpen,
116
+ isControlled,
112
117
  index,
113
118
  history.length,
114
119
  goBack,
@@ -122,6 +127,7 @@ function WebPreview({ className, defaultUrl = "", url: controlledUrl, onUrlChang
122
127
  ref,
123
128
  className: cx("web-preview", className),
124
129
  ...props,
130
+ "data-recipe": "framed-panel",
125
131
  children
126
132
  })
127
133
  });
@@ -163,7 +169,8 @@ function WebPreviewNavigationButton({ className, action, label, tooltip, childre
163
169
  };
164
170
  const button = /* @__PURE__ */ jsx(Button, {
165
171
  variant: "ghost",
166
- size: "icon",
172
+ size: "sm",
173
+ iconOnly: true,
167
174
  "aria-label": resolvedLabel,
168
175
  disabled: def?.disabled,
169
176
  className: cx("web-preview__nav-button", action && `web-preview__nav-button--${action}`, className),
@@ -176,11 +183,16 @@ function WebPreviewNavigationButton({ className, action, label, tooltip, childre
176
183
  }
177
184
  function WebPreviewUrl({ className, placeholder = "Enter URL…", value, onChange, onKeyDown, ref, ...props }) {
178
185
  const { url, setUrl } = useWebPreviewContext();
179
- const [draft, setDraft] = React.useState(url);
180
- const inputValue = value ?? draft;
181
- React.useEffect(() => {
182
- setDraft(url);
183
- }, [url]);
186
+ const [draft, setDraft] = React.useState(() => ({
187
+ url,
188
+ value: url
189
+ }));
190
+ if (draft.url !== url) setDraft({
191
+ url,
192
+ value: url
193
+ });
194
+ const derivedDraft = draft.url === url ? draft.value : url;
195
+ const inputValue = value ?? derivedDraft;
184
196
  return /* @__PURE__ */ jsx("form", {
185
197
  className: "web-preview__url-form",
186
198
  onSubmit: (e) => {
@@ -193,7 +205,10 @@ function WebPreviewUrl({ className, placeholder = "Enter URL…", value, onChang
193
205
  type: "text",
194
206
  value: inputValue,
195
207
  onChange: (e) => {
196
- setDraft(e.target.value);
208
+ setDraft({
209
+ url,
210
+ value: e.target.value
211
+ });
197
212
  onChange?.(e);
198
213
  },
199
214
  onKeyDown: (e) => {
@@ -217,7 +232,7 @@ function WebPreviewBody({ className, loading, src, ref, interactive = true, ...p
217
232
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("iframe", {
218
233
  ref,
219
234
  src: iframeSrc,
220
- sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-presentation",
235
+ sandbox: "allow-scripts allow-forms allow-popups allow-presentation",
221
236
  title: "Web preview",
222
237
  className: cx("web-preview__body", !interactive && "web-preview__body--readonly", className),
223
238
  ...props
@@ -246,7 +261,7 @@ function WebPreviewConsole({ className, logs = [], children, ref, ...props }) {
246
261
  children: [/* @__PURE__ */ jsxs(ScrollArea.Viewport, {
247
262
  className: "web-preview__console-viewport",
248
263
  children: [/* @__PURE__ */ jsx("ul", {
249
- className: "web-preview__console-list",
264
+ className: "web-preview__console-list sigvelo-stack-list",
250
265
  children: logs.length === 0 ? /* @__PURE__ */ jsx("li", {
251
266
  className: "web-preview__console-empty",
252
267
  children: "No console output"
@@ -1,2 +1,2 @@
1
- import { a as useWorkspace, i as WorkspaceState, n as WorkspaceInfo, r as WorkspaceSource, t as UseWorkspaceOptions } from "../Workspace-D39LxGvP.js";
2
- export { UseWorkspaceOptions, WorkspaceInfo, WorkspaceSource, WorkspaceState, useWorkspace };
1
+ import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceFileStatQueryOptions, f as workspaceInfoQueryOptions, i as WorkspaceQueryKey, l as workspaceDirectoryQueryOptions, m as workspaceTextFileQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceQueryKey, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceFileAssetQueryOptions } from "../Workspace-Jez8ffUj.js";
2
+ export { UseWorkspaceOptions, WorkspaceFileReadTarget, WorkspaceInfo, WorkspaceQueryKey, WorkspaceSource, WorkspaceState, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };