@assistant-ui/react 0.15.21 → 0.15.22

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 (610) hide show
  1. package/README.md +1 -1
  2. package/dist/assistant-transport.d.ts +24 -24
  3. package/dist/assistant-transport.d.ts.map +1 -1
  4. package/dist/assistant-transport.js.map +1 -1
  5. package/dist/augmentations.d.ts +28 -5
  6. package/dist/augmentations.d.ts.map +1 -1
  7. package/dist/cloud-renderer/CloudRendererHost.d.ts +13 -0
  8. package/dist/cloud-renderer/CloudRendererHost.d.ts.map +1 -0
  9. package/dist/cloud-renderer/CloudRendererHost.js +291 -0
  10. package/dist/cloud-renderer/CloudRendererHost.js.map +1 -0
  11. package/dist/context/ReadonlyStore.d.ts +1 -3
  12. package/dist/context/ReadonlyStore.d.ts.map +1 -1
  13. package/dist/context/index.d.ts +13 -13
  14. package/dist/context/index.d.ts.map +1 -0
  15. package/dist/context/providers/AttachmentByIndexProvider.d.ts +2 -2
  16. package/dist/context/providers/AttachmentByIndexProvider.d.ts.map +1 -0
  17. package/dist/context/providers/ChainOfThoughtByIndicesProvider.d.ts +2 -2
  18. package/dist/context/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -0
  19. package/dist/context/providers/ChainOfThoughtPartByIndexProvider.d.ts +2 -2
  20. package/dist/context/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -0
  21. package/dist/context/providers/MessageByIndexProvider.d.ts +2 -2
  22. package/dist/context/providers/MessageByIndexProvider.d.ts.map +1 -0
  23. package/dist/context/providers/MessageProvider.d.ts +2 -4
  24. package/dist/context/providers/MessageProvider.d.ts.map +1 -1
  25. package/dist/context/providers/PartByIndexProvider.d.ts +2 -2
  26. package/dist/context/providers/PartByIndexProvider.d.ts.map +1 -0
  27. package/dist/context/providers/SuggestionByIndexProvider.d.ts +2 -2
  28. package/dist/context/providers/SuggestionByIndexProvider.d.ts.map +1 -0
  29. package/dist/context/providers/TextMessagePartProvider.d.ts +2 -2
  30. package/dist/context/providers/TextMessagePartProvider.d.ts.map +1 -0
  31. package/dist/context/providers/ThreadListItemProvider.d.ts +2 -2
  32. package/dist/context/providers/ThreadListItemProvider.d.ts.map +1 -0
  33. package/dist/context/providers/ThreadViewportProvider.d.ts +3 -5
  34. package/dist/context/providers/ThreadViewportProvider.d.ts.map +1 -1
  35. package/dist/context/react/ThreadViewportContext.d.ts +17 -19
  36. package/dist/context/react/ThreadViewportContext.d.ts.map +1 -1
  37. package/dist/context/react/utils/createContextHook.d.ts +2 -4
  38. package/dist/context/react/utils/createContextHook.d.ts.map +1 -1
  39. package/dist/context/react/utils/createContextStoreHook.d.ts +15 -17
  40. package/dist/context/react/utils/createContextStoreHook.d.ts.map +1 -1
  41. package/dist/context/stores/ThreadViewport.d.ts +72 -74
  42. package/dist/context/stores/ThreadViewport.d.ts.map +1 -1
  43. package/dist/devtools/DevToolsHooks.d.ts +19 -20
  44. package/dist/devtools/DevToolsHooks.d.ts.map +1 -1
  45. package/dist/hooks/useMessageQuote.d.ts +1 -3
  46. package/dist/hooks/useMessageQuote.d.ts.map +1 -1
  47. package/dist/hooks/useMessageTiming.d.ts +1 -3
  48. package/dist/hooks/useMessageTiming.d.ts.map +1 -1
  49. package/dist/hooks/useToolCallElapsed.d.ts +0 -2
  50. package/dist/hooks/useToolCallElapsed.d.ts.map +1 -1
  51. package/dist/hooks/useToolCallElapsed.js +1 -1
  52. package/dist/index.d.ts +126 -82
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +14 -13
  55. package/dist/internal.d.ts +8 -11
  56. package/dist/internal.d.ts.map +1 -1
  57. package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts +24 -26
  58. package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts.map +1 -1
  59. package/dist/legacy-runtime/AssistantRuntimeProvider.js +1 -1
  60. package/dist/legacy-runtime/RuntimeAdapter.d.ts +2 -2
  61. package/dist/legacy-runtime/RuntimeAdapter.d.ts.map +1 -0
  62. package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts +2 -2
  63. package/dist/legacy-runtime/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -0
  64. package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts +3 -3
  65. package/dist/legacy-runtime/runtime/AssistantRuntime.d.ts.map +1 -0
  66. package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts +3 -3
  67. package/dist/legacy-runtime/runtime/AttachmentRuntime.d.ts.map +1 -0
  68. package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts +4 -3
  69. package/dist/legacy-runtime/runtime/ComposerRuntime.d.ts.map +1 -0
  70. package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts +3 -3
  71. package/dist/legacy-runtime/runtime/RuntimeBindings.d.ts.map +1 -0
  72. package/dist/legacy-runtime/runtime/RuntimePathTypes.d.ts +2 -2
  73. package/dist/legacy-runtime/runtime/RuntimePathTypes.d.ts.map +1 -0
  74. package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts +5 -3
  75. package/dist/legacy-runtime/runtime/ThreadListItemRuntime.d.ts.map +1 -0
  76. package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts +4 -3
  77. package/dist/legacy-runtime/runtime/ThreadRuntime.d.ts.map +1 -0
  78. package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts +2 -2
  79. package/dist/legacy-runtime/runtime-cores/adapters/RuntimeAdapterProvider.d.ts.map +1 -0
  80. package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts +2 -2
  81. package/dist/legacy-runtime/runtime-cores/adapters/attachment/CloudFileAttachmentAdapter.d.ts.map +1 -0
  82. package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts +2 -2
  83. package/dist/legacy-runtime/runtime-cores/composer/BaseComposerRuntimeCore.d.ts.map +1 -0
  84. package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts +2 -2
  85. package/dist/legacy-runtime/runtime-cores/composer/DefaultEditComposerRuntimeCore.d.ts.map +1 -0
  86. package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts +2 -2
  87. package/dist/legacy-runtime/runtime-cores/composer/DefaultThreadComposerRuntimeCore.d.ts.map +1 -0
  88. package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts +2 -2
  89. package/dist/legacy-runtime/runtime-cores/core/AssistantRuntimeCore.d.ts.map +1 -0
  90. package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts +2 -2
  91. package/dist/legacy-runtime/runtime-cores/core/BaseAssistantRuntimeCore.d.ts.map +1 -0
  92. package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts +2 -2
  93. package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts.map +1 -0
  94. package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts +2 -2
  95. package/dist/legacy-runtime/runtime-cores/core/ComposerRuntimeCore.d.ts.map +1 -0
  96. package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts +2 -2
  97. package/dist/legacy-runtime/runtime-cores/core/ThreadListRuntimeCore.d.ts.map +1 -0
  98. package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts +2 -2
  99. package/dist/legacy-runtime/runtime-cores/core/ThreadRuntimeCore.d.ts.map +1 -0
  100. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts +2 -2
  101. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreAdapter.d.ts.map +1 -0
  102. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts +2 -2
  103. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreRuntimeCore.d.ts.map +1 -0
  104. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts +3 -2
  105. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +1 -0
  106. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts +2 -2
  107. package/dist/legacy-runtime/runtime-cores/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -0
  108. package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts +3 -2
  109. package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageConverter.d.ts.map +1 -0
  110. package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts +3 -3
  111. package/dist/legacy-runtime/runtime-cores/external-store/ThreadMessageLike.d.ts.map +1 -0
  112. package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts +2 -2
  113. package/dist/legacy-runtime/runtime-cores/external-store/auto-status.d.ts.map +1 -0
  114. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts +2 -2
  115. package/dist/legacy-runtime/runtime-cores/external-store/createMessageConverter.d.ts.map +1 -0
  116. package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts +2 -2
  117. package/dist/legacy-runtime/runtime-cores/external-store/external-message-converter.d.ts.map +1 -0
  118. package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts +2 -2
  119. package/dist/legacy-runtime/runtime-cores/external-store/useExternalStoreRuntime.d.ts.map +1 -0
  120. package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts +2 -2
  121. package/dist/legacy-runtime/runtime-cores/local/ChatModelAdapter.d.ts.map +1 -0
  122. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts +2 -2
  123. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeCore.d.ts.map +1 -0
  124. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts +4 -3
  125. package/dist/legacy-runtime/runtime-cores/local/LocalRuntimeOptions.d.ts.map +1 -0
  126. package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts +3 -2
  127. package/dist/legacy-runtime/runtime-cores/local/LocalThreadListRuntimeCore.d.ts.map +1 -0
  128. package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts +2 -2
  129. package/dist/legacy-runtime/runtime-cores/local/LocalThreadRuntimeCore.d.ts.map +1 -0
  130. package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts +2 -2
  131. package/dist/legacy-runtime/runtime-cores/local/shouldContinue.d.ts.map +1 -0
  132. package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts +2 -2
  133. package/dist/legacy-runtime/runtime-cores/local/useLocalRuntime.d.ts.map +1 -0
  134. package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts +2 -2
  135. package/dist/legacy-runtime/runtime-cores/remote-thread-list/BaseSubscribable.d.ts.map +1 -0
  136. package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts +2 -2
  137. package/dist/legacy-runtime/runtime-cores/remote-thread-list/EMPTY_THREAD_CORE.d.ts.map +1 -0
  138. package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts +2 -2
  139. package/dist/legacy-runtime/runtime-cores/remote-thread-list/OptimisticState.d.ts.map +1 -0
  140. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts +2 -2
  141. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts.map +1 -0
  142. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts +2 -2
  143. package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -0
  144. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts +2 -2
  145. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/cloud.d.ts.map +1 -0
  146. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts +2 -2
  147. package/dist/legacy-runtime/runtime-cores/remote-thread-list/adapter/in-memory.d.ts.map +1 -0
  148. package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts +2 -2
  149. package/dist/legacy-runtime/runtime-cores/remote-thread-list/types.d.ts.map +1 -0
  150. package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts +2 -2
  151. package/dist/legacy-runtime/runtime-cores/remote-thread-list/useRemoteThreadListRuntime.d.ts.map +1 -0
  152. package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts +4 -3
  153. package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.d.ts.map +1 -0
  154. package/dist/legacy-runtime/runtime-cores/utils/MessageRepository.js +1 -1
  155. package/dist/mcp-apps/McpAppRenderer.d.ts +49 -51
  156. package/dist/mcp-apps/McpAppRenderer.d.ts.map +1 -1
  157. package/dist/mcp-apps/McpAppRenderer.js +2 -2
  158. package/dist/mcp-apps/McpAppsRemoteHost.d.ts +1 -3
  159. package/dist/mcp-apps/McpAppsRemoteHost.d.ts.map +1 -1
  160. package/dist/mcp-apps/app-frame.d.ts +2 -4
  161. package/dist/mcp-apps/app-frame.d.ts.map +1 -1
  162. package/dist/mcp-apps/bridge.d.ts +11 -13
  163. package/dist/mcp-apps/bridge.d.ts.map +1 -1
  164. package/dist/mcp-apps/index.d.ts +5 -5
  165. package/dist/mcp-apps/index.d.ts.map +1 -0
  166. package/dist/mcp-apps/types.d.ts +95 -97
  167. package/dist/mcp-apps/types.d.ts.map +1 -1
  168. package/dist/mcp-apps/utils.d.ts +2 -3
  169. package/dist/mcp-apps/utils.d.ts.map +1 -1
  170. package/dist/model-context/frame/useAssistantFrameHost.d.ts +8 -8
  171. package/dist/model-context/frame/useAssistantFrameHost.d.ts.map +1 -1
  172. package/dist/model-context/frame/useAssistantFrameHost.js +1 -1
  173. package/dist/model-context/makeAssistantVisible.d.ts +4 -6
  174. package/dist/model-context/makeAssistantVisible.d.ts.map +1 -1
  175. package/dist/model-context/makeAssistantVisible.js +2 -2
  176. package/dist/primitives/actionBar/ActionBarCopy.d.ts +13 -14
  177. package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
  178. package/dist/primitives/actionBar/ActionBarCopy.js +1 -1
  179. package/dist/primitives/actionBar/ActionBarEdit.d.ts +10 -11
  180. package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
  181. package/dist/primitives/actionBar/ActionBarExportMarkdown.d.ts +11 -12
  182. package/dist/primitives/actionBar/ActionBarExportMarkdown.d.ts.map +1 -1
  183. package/dist/primitives/actionBar/ActionBarExportMarkdown.js +4 -1
  184. package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
  185. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +6 -7
  186. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
  187. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +11 -9
  188. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
  189. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +6 -7
  190. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
  191. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +11 -9
  192. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
  193. package/dist/primitives/actionBar/ActionBarInteractionContext.d.ts +1 -3
  194. package/dist/primitives/actionBar/ActionBarInteractionContext.d.ts.map +1 -1
  195. package/dist/primitives/actionBar/ActionBarReload.d.ts +10 -11
  196. package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
  197. package/dist/primitives/actionBar/ActionBarRoot.d.ts +49 -50
  198. package/dist/primitives/actionBar/ActionBarRoot.d.ts.map +1 -1
  199. package/dist/primitives/actionBar/ActionBarSpeak.d.ts +6 -7
  200. package/dist/primitives/actionBar/ActionBarSpeak.d.ts.map +1 -1
  201. package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts +6 -7
  202. package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts.map +1 -1
  203. package/dist/primitives/actionBar/useActionBarFloatStatus.d.ts +8 -10
  204. package/dist/primitives/actionBar/useActionBarFloatStatus.d.ts.map +1 -1
  205. package/dist/primitives/actionBar.d.ts +9 -14
  206. package/dist/primitives/actionBar.d.ts.map +1 -1
  207. package/dist/primitives/actionBarMore/ActionBarMoreContent.d.ts +10 -12
  208. package/dist/primitives/actionBarMore/ActionBarMoreContent.d.ts.map +1 -1
  209. package/dist/primitives/actionBarMore/ActionBarMoreItem.d.ts +7 -9
  210. package/dist/primitives/actionBarMore/ActionBarMoreItem.d.ts.map +1 -1
  211. package/dist/primitives/actionBarMore/ActionBarMoreRoot.d.ts +3 -5
  212. package/dist/primitives/actionBarMore/ActionBarMoreRoot.d.ts.map +1 -1
  213. package/dist/primitives/actionBarMore/ActionBarMoreSeparator.d.ts +7 -9
  214. package/dist/primitives/actionBarMore/ActionBarMoreSeparator.d.ts.map +1 -1
  215. package/dist/primitives/actionBarMore/ActionBarMoreTrigger.d.ts +7 -9
  216. package/dist/primitives/actionBarMore/ActionBarMoreTrigger.d.ts.map +1 -1
  217. package/dist/primitives/actionBarMore/scope.d.ts +4 -6
  218. package/dist/primitives/actionBarMore/scope.d.ts.map +1 -1
  219. package/dist/primitives/actionBarMore.d.ts +5 -10
  220. package/dist/primitives/actionBarMore.d.ts.map +1 -1
  221. package/dist/primitives/assistantModal/AssistantModalAnchor.d.ts +7 -9
  222. package/dist/primitives/assistantModal/AssistantModalAnchor.d.ts.map +1 -1
  223. package/dist/primitives/assistantModal/AssistantModalContent.d.ts +12 -14
  224. package/dist/primitives/assistantModal/AssistantModalContent.d.ts.map +1 -1
  225. package/dist/primitives/assistantModal/AssistantModalRoot.d.ts +5 -7
  226. package/dist/primitives/assistantModal/AssistantModalRoot.d.ts.map +1 -1
  227. package/dist/primitives/assistantModal/AssistantModalRoot.js +1 -1
  228. package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts +7 -9
  229. package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts.map +1 -1
  230. package/dist/primitives/assistantModal/popoverRenderPrimitives.d.ts +7 -9
  231. package/dist/primitives/assistantModal/popoverRenderPrimitives.d.ts.map +1 -1
  232. package/dist/primitives/assistantModal/scope.d.ts +4 -6
  233. package/dist/primitives/assistantModal/scope.d.ts.map +1 -1
  234. package/dist/primitives/assistantModal.d.ts +4 -9
  235. package/dist/primitives/assistantModal.d.ts.map +1 -1
  236. package/dist/primitives/attachment/AttachmentName.d.ts +2 -4
  237. package/dist/primitives/attachment/AttachmentName.d.ts.map +1 -1
  238. package/dist/primitives/attachment/AttachmentRemove.d.ts +6 -7
  239. package/dist/primitives/attachment/AttachmentRemove.d.ts.map +1 -1
  240. package/dist/primitives/attachment/AttachmentRemove.js +1 -1
  241. package/dist/primitives/attachment/AttachmentRoot.d.ts +10 -11
  242. package/dist/primitives/attachment/AttachmentRoot.d.ts.map +1 -1
  243. package/dist/primitives/attachment/AttachmentThumb.d.ts +6 -7
  244. package/dist/primitives/attachment/AttachmentThumb.d.ts.map +1 -1
  245. package/dist/primitives/attachment/AttachmentThumb.js +1 -1
  246. package/dist/primitives/attachment.d.ts +4 -9
  247. package/dist/primitives/attachment.d.ts.map +1 -1
  248. package/dist/primitives/branchPicker/BranchPickerCount.d.ts +6 -8
  249. package/dist/primitives/branchPicker/BranchPickerCount.d.ts.map +1 -1
  250. package/dist/primitives/branchPicker/BranchPickerNext.d.ts +10 -11
  251. package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
  252. package/dist/primitives/branchPicker/BranchPickerNumber.d.ts +2 -4
  253. package/dist/primitives/branchPicker/BranchPickerNumber.d.ts.map +1 -1
  254. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts +10 -11
  255. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
  256. package/dist/primitives/branchPicker/BranchPickerRoot.d.ts +18 -20
  257. package/dist/primitives/branchPicker/BranchPickerRoot.d.ts.map +1 -1
  258. package/dist/primitives/branchPicker/BranchPickerRoot.js +1 -1
  259. package/dist/primitives/branchPicker.d.ts +5 -10
  260. package/dist/primitives/branchPicker.d.ts.map +1 -1
  261. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts +10 -11
  262. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts.map +1 -1
  263. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js +1 -1
  264. package/dist/primitives/chainOfThought/ChainOfThoughtParts.d.ts +2 -2
  265. package/dist/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -0
  266. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts +6 -7
  267. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts.map +1 -1
  268. package/dist/primitives/chainOfThought.d.ts +3 -8
  269. package/dist/primitives/chainOfThought.d.ts.map +1 -1
  270. package/dist/primitives/composer/ComposerAddAttachment.d.ts +11 -12
  271. package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
  272. package/dist/primitives/composer/ComposerAddAttachment.js +1 -1
  273. package/dist/primitives/composer/ComposerAttachmentDropzone.d.ts +10 -11
  274. package/dist/primitives/composer/ComposerAttachmentDropzone.d.ts.map +1 -1
  275. package/dist/primitives/composer/ComposerAttachmentDropzone.js +9 -7
  276. package/dist/primitives/composer/ComposerAttachmentDropzone.js.map +1 -1
  277. package/dist/primitives/composer/ComposerAttachments.d.ts +2 -2
  278. package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -0
  279. package/dist/primitives/composer/ComposerCancel.d.ts +10 -11
  280. package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
  281. package/dist/primitives/composer/ComposerCompactContext.d.ts +1 -3
  282. package/dist/primitives/composer/ComposerCompactContext.d.ts.map +1 -1
  283. package/dist/primitives/composer/ComposerDictate.d.ts +6 -7
  284. package/dist/primitives/composer/ComposerDictate.d.ts.map +1 -1
  285. package/dist/primitives/composer/ComposerDictationTranscript.d.ts +5 -7
  286. package/dist/primitives/composer/ComposerDictationTranscript.d.ts.map +1 -1
  287. package/dist/primitives/composer/ComposerDictationTranscript.js +1 -1
  288. package/dist/primitives/composer/ComposerIf.d.ts +3 -2
  289. package/dist/primitives/composer/ComposerIf.d.ts.map +1 -0
  290. package/dist/primitives/composer/ComposerInput.d.ts +72 -74
  291. package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
  292. package/dist/primitives/composer/ComposerInput.js +3 -3
  293. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  294. package/dist/primitives/composer/ComposerInputPluginContext.d.ts +22 -24
  295. package/dist/primitives/composer/ComposerInputPluginContext.d.ts.map +1 -1
  296. package/dist/primitives/composer/ComposerQueue.d.ts +2 -2
  297. package/dist/primitives/composer/ComposerQueue.d.ts.map +1 -0
  298. package/dist/primitives/composer/ComposerQuote.d.ts +13 -15
  299. package/dist/primitives/composer/ComposerQuote.d.ts.map +1 -1
  300. package/dist/primitives/composer/ComposerQuote.js +1 -1
  301. package/dist/primitives/composer/ComposerRoot.d.ts +26 -28
  302. package/dist/primitives/composer/ComposerRoot.d.ts.map +1 -1
  303. package/dist/primitives/composer/ComposerRoot.js +1 -1
  304. package/dist/primitives/composer/ComposerSend.d.ts +9 -11
  305. package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
  306. package/dist/primitives/composer/ComposerStopDictation.d.ts +6 -7
  307. package/dist/primitives/composer/ComposerStopDictation.d.ts.map +1 -1
  308. package/dist/primitives/composer/ComposerStopDictation.js +1 -1
  309. package/dist/primitives/composer/trigger/TriggerPopover.d.ts +27 -29
  310. package/dist/primitives/composer/trigger/TriggerPopover.d.ts.map +1 -1
  311. package/dist/primitives/composer/trigger/TriggerPopover.js +2 -2
  312. package/dist/primitives/composer/trigger/TriggerPopoverAction.d.ts +10 -12
  313. package/dist/primitives/composer/trigger/TriggerPopoverAction.d.ts.map +1 -1
  314. package/dist/primitives/composer/trigger/TriggerPopoverAction.js +1 -1
  315. package/dist/primitives/composer/trigger/TriggerPopoverBack.d.ts +5 -7
  316. package/dist/primitives/composer/trigger/TriggerPopoverBack.d.ts.map +1 -1
  317. package/dist/primitives/composer/trigger/TriggerPopoverCategories.d.ts +16 -18
  318. package/dist/primitives/composer/trigger/TriggerPopoverCategories.d.ts.map +1 -1
  319. package/dist/primitives/composer/trigger/TriggerPopoverDirective.d.ts +8 -10
  320. package/dist/primitives/composer/trigger/TriggerPopoverDirective.d.ts.map +1 -1
  321. package/dist/primitives/composer/trigger/TriggerPopoverDirective.js +1 -1
  322. package/dist/primitives/composer/trigger/TriggerPopoverItems.d.ts +18 -20
  323. package/dist/primitives/composer/trigger/TriggerPopoverItems.d.ts.map +1 -1
  324. package/dist/primitives/composer/trigger/TriggerPopoverResource.d.ts +41 -43
  325. package/dist/primitives/composer/trigger/TriggerPopoverResource.d.ts.map +1 -1
  326. package/dist/primitives/composer/trigger/TriggerPopoverRootContext.d.ts +27 -28
  327. package/dist/primitives/composer/trigger/TriggerPopoverRootContext.d.ts.map +1 -1
  328. package/dist/primitives/composer/trigger/detectTrigger.d.ts +3 -5
  329. package/dist/primitives/composer/trigger/detectTrigger.d.ts.map +1 -1
  330. package/dist/primitives/composer/trigger/index.d.ts +15 -18
  331. package/dist/primitives/composer/trigger/index.d.ts.map +1 -1
  332. package/dist/primitives/composer/trigger/matchesTriggerItemQuery.d.ts +1 -3
  333. package/dist/primitives/composer/trigger/matchesTriggerItemQuery.d.ts.map +1 -1
  334. package/dist/primitives/composer/trigger/triggerDetectionResource.d.ts +10 -12
  335. package/dist/primitives/composer/trigger/triggerDetectionResource.d.ts.map +1 -1
  336. package/dist/primitives/composer/trigger/triggerKeyboardResource.d.ts +22 -24
  337. package/dist/primitives/composer/trigger/triggerKeyboardResource.d.ts.map +1 -1
  338. package/dist/primitives/composer/trigger/triggerNavigationResource.d.ts +18 -20
  339. package/dist/primitives/composer/trigger/triggerNavigationResource.d.ts.map +1 -1
  340. package/dist/primitives/composer/trigger/triggerSelectionResource.d.ts +23 -25
  341. package/dist/primitives/composer/trigger/triggerSelectionResource.d.ts.map +1 -1
  342. package/dist/primitives/composer/useComposerInputState.d.ts +4 -6
  343. package/dist/primitives/composer/useComposerInputState.d.ts.map +1 -1
  344. package/dist/primitives/composer.d.ts +31 -25
  345. package/dist/primitives/composer.d.ts.map +1 -1
  346. package/dist/primitives/dropdownMenuRenderPrimitives.d.ts +9 -11
  347. package/dist/primitives/dropdownMenuRenderPrimitives.d.ts.map +1 -1
  348. package/dist/primitives/error/ErrorMessage.d.ts +5 -7
  349. package/dist/primitives/error/ErrorMessage.d.ts.map +1 -1
  350. package/dist/primitives/error/ErrorRoot.d.ts +5 -7
  351. package/dist/primitives/error/ErrorRoot.d.ts.map +1 -1
  352. package/dist/primitives/error.d.ts +2 -7
  353. package/dist/primitives/error.d.ts.map +1 -1
  354. package/dist/primitives/message/MessageAttachments.d.ts +2 -2
  355. package/dist/primitives/message/MessageAttachments.d.ts.map +1 -0
  356. package/dist/primitives/message/MessageError.d.ts +1 -3
  357. package/dist/primitives/message/MessageError.d.ts.map +1 -1
  358. package/dist/primitives/message/MessageIf.d.ts +15 -16
  359. package/dist/primitives/message/MessageIf.d.ts.map +1 -1
  360. package/dist/primitives/message/MessageParts.d.ts +4 -6
  361. package/dist/primitives/message/MessageParts.d.ts.map +1 -1
  362. package/dist/primitives/message/MessagePartsGrouped.d.ts +132 -133
  363. package/dist/primitives/message/MessagePartsGrouped.d.ts.map +1 -1
  364. package/dist/primitives/message/MessagePartsGrouped.js +103 -71
  365. package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
  366. package/dist/primitives/message/MessageRoot.d.ts +5 -7
  367. package/dist/primitives/message/MessageRoot.d.ts.map +1 -1
  368. package/dist/primitives/message/MessageRoot.js +6 -2
  369. package/dist/primitives/message/MessageRoot.js.map +1 -1
  370. package/dist/primitives/message.d.ts +12 -12
  371. package/dist/primitives/message.d.ts.map +1 -1
  372. package/dist/primitives/messagePart/MessagePartImage.d.ts +9 -11
  373. package/dist/primitives/messagePart/MessagePartImage.d.ts.map +1 -1
  374. package/dist/primitives/messagePart/MessagePartInProgress.d.ts +2 -2
  375. package/dist/primitives/messagePart/MessagePartInProgress.d.ts.map +1 -0
  376. package/dist/primitives/messagePart/MessagePartText.d.ts +35 -37
  377. package/dist/primitives/messagePart/MessagePartText.d.ts.map +1 -1
  378. package/dist/primitives/messagePart/useMessagePartData.d.ts +1 -3
  379. package/dist/primitives/messagePart/useMessagePartData.d.ts.map +1 -1
  380. package/dist/primitives/messagePart/useMessagePartFile.d.ts +2 -4
  381. package/dist/primitives/messagePart/useMessagePartFile.d.ts.map +1 -1
  382. package/dist/primitives/messagePart/useMessagePartImage.d.ts +2 -4
  383. package/dist/primitives/messagePart/useMessagePartImage.d.ts.map +1 -1
  384. package/dist/primitives/messagePart/useMessagePartReasoning.d.ts +2 -4
  385. package/dist/primitives/messagePart/useMessagePartReasoning.d.ts.map +1 -1
  386. package/dist/primitives/messagePart/useMessagePartSource.d.ts +19 -21
  387. package/dist/primitives/messagePart/useMessagePartSource.d.ts.map +1 -1
  388. package/dist/primitives/messagePart/useMessagePartText.d.ts +3 -5
  389. package/dist/primitives/messagePart/useMessagePartText.d.ts.map +1 -1
  390. package/dist/primitives/messagePart.d.ts +4 -9
  391. package/dist/primitives/messagePart.d.ts.map +1 -1
  392. package/dist/primitives/queueItem/QueueItemRemove.d.ts +6 -7
  393. package/dist/primitives/queueItem/QueueItemRemove.d.ts.map +1 -1
  394. package/dist/primitives/queueItem/QueueItemRemove.js +1 -1
  395. package/dist/primitives/queueItem/QueueItemSteer.d.ts +6 -7
  396. package/dist/primitives/queueItem/QueueItemSteer.d.ts.map +1 -1
  397. package/dist/primitives/queueItem/QueueItemSteer.js +1 -1
  398. package/dist/primitives/queueItem/QueueItemText.d.ts +5 -7
  399. package/dist/primitives/queueItem/QueueItemText.d.ts.map +1 -1
  400. package/dist/primitives/queueItem/QueueItemText.js +1 -1
  401. package/dist/primitives/queueItem.d.ts +3 -8
  402. package/dist/primitives/queueItem.d.ts.map +1 -1
  403. package/dist/primitives/reasoning/useScrollLock.d.ts +1 -3
  404. package/dist/primitives/reasoning/useScrollLock.d.ts.map +1 -1
  405. package/dist/primitives/reasoning/useScrollLock.js +14 -15
  406. package/dist/primitives/reasoning/useScrollLock.js.map +1 -1
  407. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.d.ts +5 -7
  408. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.d.ts.map +1 -1
  409. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js +1 -1
  410. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.d.ts +12 -13
  411. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.d.ts.map +1 -1
  412. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js +81 -42
  413. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js.map +1 -1
  414. package/dist/primitives/selectionToolbar.d.ts +2 -7
  415. package/dist/primitives/selectionToolbar.d.ts.map +1 -1
  416. package/dist/primitives/suggestion/SuggestionDescription.d.ts +5 -7
  417. package/dist/primitives/suggestion/SuggestionDescription.d.ts.map +1 -1
  418. package/dist/primitives/suggestion/SuggestionDescription.js +1 -1
  419. package/dist/primitives/suggestion/SuggestionTitle.d.ts +5 -7
  420. package/dist/primitives/suggestion/SuggestionTitle.d.ts.map +1 -1
  421. package/dist/primitives/suggestion/SuggestionTitle.js +1 -1
  422. package/dist/primitives/suggestion/SuggestionTrigger.d.ts +35 -36
  423. package/dist/primitives/suggestion/SuggestionTrigger.d.ts.map +1 -1
  424. package/dist/primitives/suggestion.d.ts +3 -8
  425. package/dist/primitives/suggestion.d.ts.map +1 -1
  426. package/dist/primitives/thread/ThreadEmpty.d.ts +2 -4
  427. package/dist/primitives/thread/ThreadEmpty.d.ts.map +1 -1
  428. package/dist/primitives/thread/ThreadIf.d.ts +7 -8
  429. package/dist/primitives/thread/ThreadIf.d.ts.map +1 -1
  430. package/dist/primitives/thread/ThreadMessages.d.ts +2 -2
  431. package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -0
  432. package/dist/primitives/thread/ThreadRoot.d.ts +9 -11
  433. package/dist/primitives/thread/ThreadRoot.d.ts.map +1 -1
  434. package/dist/primitives/thread/ThreadRoot.js +15 -8
  435. package/dist/primitives/thread/ThreadRoot.js.map +1 -1
  436. package/dist/primitives/thread/ThreadRootElementContext.d.ts +4 -0
  437. package/dist/primitives/thread/ThreadRootElementContext.d.ts.map +1 -0
  438. package/dist/primitives/thread/ThreadRootElementContext.js +11 -0
  439. package/dist/primitives/thread/ThreadRootElementContext.js.map +1 -0
  440. package/dist/primitives/thread/ThreadScrollToBottom.d.ts +11 -13
  441. package/dist/primitives/thread/ThreadScrollToBottom.d.ts.map +1 -1
  442. package/dist/primitives/thread/ThreadSuggestion.d.ts +47 -48
  443. package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
  444. package/dist/primitives/thread/ThreadSuggestions.d.ts +2 -2
  445. package/dist/primitives/thread/ThreadSuggestions.d.ts.map +1 -0
  446. package/dist/primitives/thread/ThreadViewport.d.ts +88 -90
  447. package/dist/primitives/thread/ThreadViewport.d.ts.map +1 -1
  448. package/dist/primitives/thread/ThreadViewport.js +1 -1
  449. package/dist/primitives/thread/ThreadViewportFooter.d.ts +5 -7
  450. package/dist/primitives/thread/ThreadViewportFooter.d.ts.map +1 -1
  451. package/dist/primitives/thread/topAnchor/computeTopAnchorSlack.d.ts +6 -8
  452. package/dist/primitives/thread/topAnchor/computeTopAnchorSlack.d.ts.map +1 -1
  453. package/dist/primitives/thread/topAnchor/createReserveObservers.d.ts +2 -4
  454. package/dist/primitives/thread/topAnchor/createReserveObservers.d.ts.map +1 -1
  455. package/dist/primitives/thread/topAnchor/mountTopAnchorReserve.d.ts +16 -18
  456. package/dist/primitives/thread/topAnchor/mountTopAnchorReserve.d.ts.map +1 -1
  457. package/dist/primitives/thread/topAnchor/mountTopAnchorReserve.js +55 -6
  458. package/dist/primitives/thread/topAnchor/mountTopAnchorReserve.js.map +1 -1
  459. package/dist/primitives/thread/topAnchor/topAnchorTurn.d.ts +10 -11
  460. package/dist/primitives/thread/topAnchor/topAnchorTurn.d.ts.map +1 -1
  461. package/dist/primitives/thread/topAnchor/topAnchorUtils.d.ts +0 -2
  462. package/dist/primitives/thread/topAnchor/topAnchorUtils.d.ts.map +1 -1
  463. package/dist/primitives/thread/topAnchor/useTopAnchorReserve.d.ts +0 -2
  464. package/dist/primitives/thread/topAnchor/useTopAnchorReserve.d.ts.map +1 -1
  465. package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts +29 -31
  466. package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
  467. package/dist/primitives/thread/useThreadViewportAutoScroll.js +16 -1
  468. package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
  469. package/dist/primitives/thread.d.ts +12 -15
  470. package/dist/primitives/thread.d.ts.map +1 -1
  471. package/dist/primitives/threadList/ThreadListItems.d.ts +2 -2
  472. package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -0
  473. package/dist/primitives/threadList/ThreadListLoadMore.d.ts +6 -7
  474. package/dist/primitives/threadList/ThreadListLoadMore.d.ts.map +1 -1
  475. package/dist/primitives/threadList/ThreadListNew.d.ts +5 -7
  476. package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
  477. package/dist/primitives/threadList/ThreadListNew.js +1 -1
  478. package/dist/primitives/threadList/ThreadListRoot.d.ts +6 -7
  479. package/dist/primitives/threadList/ThreadListRoot.d.ts.map +1 -1
  480. package/dist/primitives/threadList.d.ts +5 -9
  481. package/dist/primitives/threadList.d.ts.map +1 -1
  482. package/dist/primitives/threadListFocusGroup.d.ts +14 -16
  483. package/dist/primitives/threadListFocusGroup.d.ts.map +1 -1
  484. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +6 -7
  485. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
  486. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +6 -7
  487. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts.map +1 -1
  488. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts +6 -7
  489. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -1
  490. package/dist/primitives/threadListItem/ThreadListItemRoot.js +1 -1
  491. package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts +2 -2
  492. package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -0
  493. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +6 -7
  494. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -1
  495. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +6 -7
  496. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -1
  497. package/dist/primitives/threadListItem.d.ts +6 -11
  498. package/dist/primitives/threadListItem.d.ts.map +1 -1
  499. package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.d.ts +10 -12
  500. package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.d.ts.map +1 -1
  501. package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.d.ts +7 -9
  502. package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.d.ts.map +1 -1
  503. package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.d.ts +11 -13
  504. package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.d.ts.map +1 -1
  505. package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.d.ts +7 -9
  506. package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.d.ts.map +1 -1
  507. package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.d.ts +7 -9
  508. package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.d.ts.map +1 -1
  509. package/dist/primitives/threadListItemMore/scope.d.ts +4 -6
  510. package/dist/primitives/threadListItemMore/scope.d.ts.map +1 -1
  511. package/dist/primitives/threadListItemMore.d.ts +5 -10
  512. package/dist/primitives/threadListItemMore.d.ts.map +1 -1
  513. package/dist/sandbox-host/SandboxHost.d.ts +24 -26
  514. package/dist/sandbox-host/SandboxHost.d.ts.map +1 -1
  515. package/dist/unstable/useComposerInput.d.ts +32 -34
  516. package/dist/unstable/useComposerInput.d.ts.map +1 -1
  517. package/dist/unstable/useComposerInput.js +1 -1
  518. package/dist/unstable/useComposerInputHistory.d.ts +3 -5
  519. package/dist/unstable/useComposerInputHistory.d.ts.map +1 -1
  520. package/dist/unstable/useComposerInputHistory.js +2 -2
  521. package/dist/unstable/useLiveCompletionAdapter.d.ts +18 -20
  522. package/dist/unstable/useLiveCompletionAdapter.d.ts.map +1 -1
  523. package/dist/unstable/useMentionAdapter.d.ts +57 -59
  524. package/dist/unstable/useMentionAdapter.d.ts.map +1 -1
  525. package/dist/unstable/useMentionAdapter.js +1 -1
  526. package/dist/unstable/useMessageStallDetection.d.ts +10 -12
  527. package/dist/unstable/useMessageStallDetection.d.ts.map +1 -1
  528. package/dist/unstable/useMessageStallDetection.js +1 -1
  529. package/dist/unstable/useModelContextSnapshot.d.ts +13 -15
  530. package/dist/unstable/useModelContextSnapshot.d.ts.map +1 -1
  531. package/dist/unstable/useSlashCommandAdapter.d.ts +20 -22
  532. package/dist/unstable/useSlashCommandAdapter.d.ts.map +1 -1
  533. package/dist/unstable/webmcp/WebMcpRegistrationResource.d.ts +7 -9
  534. package/dist/unstable/webmcp/WebMcpRegistrationResource.d.ts.map +1 -1
  535. package/dist/unstable/webmcp/convertTools.d.ts +5 -7
  536. package/dist/unstable/webmcp/convertTools.d.ts.map +1 -1
  537. package/dist/unstable/webmcp/convertTools.js +2 -2
  538. package/dist/unstable/webmcp/convertTools.js.map +1 -1
  539. package/dist/unstable/webmcp/useWebMcpProvider.d.ts +4 -6
  540. package/dist/unstable/webmcp/useWebMcpProvider.d.ts.map +1 -1
  541. package/dist/unstable/webmcp/useWebMcpProvider.js +1 -1
  542. package/dist/unstable/webmcp/webmcp-host.d.ts +23 -25
  543. package/dist/unstable/webmcp/webmcp-host.d.ts.map +1 -1
  544. package/dist/utils/Primitive.d.ts +91 -92
  545. package/dist/utils/Primitive.d.ts.map +1 -1
  546. package/dist/utils/RequireAtLeastOne.d.ts +3 -3
  547. package/dist/utils/RequireAtLeastOne.d.ts.map +1 -1
  548. package/dist/utils/createActionButton.d.ts +5 -6
  549. package/dist/utils/createActionButton.d.ts.map +1 -1
  550. package/dist/utils/getSelectionMessageId.d.ts +1 -3
  551. package/dist/utils/getSelectionMessageId.d.ts.map +1 -1
  552. package/dist/utils/getSelectionMessageId.js +2 -1
  553. package/dist/utils/getSelectionMessageId.js.map +1 -1
  554. package/dist/utils/hooks/useManagedRef.d.ts +0 -2
  555. package/dist/utils/hooks/useManagedRef.d.ts.map +1 -1
  556. package/dist/utils/hooks/useMediaQuery.d.ts +0 -2
  557. package/dist/utils/hooks/useMediaQuery.d.ts.map +1 -1
  558. package/dist/utils/hooks/useOnResizeContent.d.ts +0 -2
  559. package/dist/utils/hooks/useOnResizeContent.d.ts.map +1 -1
  560. package/dist/utils/hooks/useOnScrollToBottom.d.ts +1 -3
  561. package/dist/utils/hooks/useOnScrollToBottom.d.ts.map +1 -1
  562. package/dist/utils/hooks/useSizeHandle.d.ts +1 -3
  563. package/dist/utils/hooks/useSizeHandle.d.ts.map +1 -1
  564. package/dist/utils/smooth/SmoothContext.d.ts +105 -107
  565. package/dist/utils/smooth/SmoothContext.d.ts.map +1 -1
  566. package/dist/utils/smooth/SmoothContext.js +1 -1
  567. package/dist/utils/smooth/useSmooth.d.ts +26 -28
  568. package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
  569. package/dist/utils/smooth/useSmooth.js +1 -1
  570. package/package.json +8 -8
  571. package/src/assistant-transport.ts +5 -4
  572. package/src/cloud-renderer/CloudRendererHost.test.tsx +362 -0
  573. package/src/cloud-renderer/CloudRendererHost.tsx +249 -0
  574. package/src/index.ts +29 -1
  575. package/src/primitives/actionBar/ActionBarExportMarkdown.test.tsx +30 -0
  576. package/src/primitives/actionBar/ActionBarExportMarkdown.tsx +4 -0
  577. package/src/primitives/actionBar/ActionBarFeedback.test.tsx +87 -0
  578. package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +1 -0
  579. package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +1 -0
  580. package/src/primitives/composer/ComposerAttachmentDropzone.test.tsx +54 -0
  581. package/src/primitives/composer/ComposerAttachmentDropzone.tsx +12 -6
  582. package/src/primitives/composer/ComposerInput.test.tsx +18 -0
  583. package/src/primitives/composer/ComposerInput.tsx +8 -2
  584. package/src/primitives/message/MessagePartsGrouped.test.tsx +151 -4
  585. package/src/primitives/message/MessagePartsGrouped.tool-interaction.test.tsx +97 -0
  586. package/src/primitives/message/MessagePartsGrouped.tsx +14 -5
  587. package/src/primitives/message/MessageRoot.test.tsx +108 -0
  588. package/src/primitives/message/MessageRoot.tsx +5 -1
  589. package/src/primitives/reasoning/useScrollLock.test.tsx +47 -0
  590. package/src/primitives/reasoning/useScrollLock.ts +15 -17
  591. package/src/primitives/selectionToolbar/SelectionToolbarRoot.test.tsx +228 -14
  592. package/src/primitives/selectionToolbar/SelectionToolbarRoot.tsx +60 -12
  593. package/src/primitives/thread/ThreadRoot.tsx +10 -1
  594. package/src/primitives/thread/ThreadRootElementContext.ts +10 -0
  595. package/src/primitives/thread/topAnchor/mountTopAnchorReserve.test.ts +196 -0
  596. package/src/primitives/thread/topAnchor/mountTopAnchorReserve.ts +78 -5
  597. package/src/primitives/thread/useThreadViewportAutoScroll.test.tsx +222 -0
  598. package/src/primitives/thread/useThreadViewportAutoScroll.ts +37 -2
  599. package/src/tests/augmentations.test.ts +7 -0
  600. package/src/unstable/webmcp/convertTools.test.ts +23 -3
  601. package/src/unstable/webmcp/convertTools.ts +7 -11
  602. package/src/utils/getSelectionMessageId.test.ts +28 -0
  603. package/src/utils/getSelectionMessageId.ts +7 -1
  604. package/dist/tests/remote-thread-list-test-helpers.d.ts +0 -5
  605. package/dist/tests/remote-thread-list-test-helpers.d.ts.map +0 -1
  606. package/dist/tests/remote-thread-list-test-helpers.js +0 -29
  607. package/dist/tests/remote-thread-list-test-helpers.js.map +0 -1
  608. package/dist/tests/setup.d.ts +0 -1
  609. package/dist/tests/setup.js +0 -6
  610. package/dist/tests/setup.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
- import { useAuiState } from "@assistant-ui/store";
5
4
  import { forwardRef } from "@assistant-ui/tap/react-shim";
5
+ import { useAuiState } from "@assistant-ui/store";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  //#region src/primitives/composer/ComposerDictationTranscript.tsx
8
8
  /**
@@ -1,2 +1,3 @@
1
- import { ComposerPrimitiveIf, UseComposerIfProps } from "@assistant-ui/core/react";
2
- export { ComposerPrimitiveIf, type UseComposerIfProps };
1
+ export { ComposerPrimitiveIf } from "@assistant-ui/core/react";
2
+ export type { UseComposerIfProps } from "@assistant-ui/core/react";
3
+ //# sourceMappingURL=ComposerIf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComposerIf.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerIf.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,77 +1,76 @@
1
- import { ReactElement } from "react";
2
- import { TextareaAutosizeProps } from "react-textarea-autosize";
3
- //#region src/primitives/composer/ComposerInput.d.ts
1
+ import { type ReactElement } from "react";
2
+ import { type TextareaAutosizeProps } from "react-textarea-autosize";
4
3
  export declare namespace ComposerPrimitiveInput {
5
- export type Element = HTMLTextAreaElement;
6
- type BaseProps = {
7
- /**
8
- * Whether to render as a child component using Slot.
9
- * When true, the component will merge its props with its child.
10
- */
11
- asChild?: boolean | undefined;
12
- /**
13
- * A React element to use as the input container, with props merged in.
14
- */
15
- render?: ReactElement | undefined;
16
- /**
17
- * Whether to cancel message composition when Escape is pressed.
18
- * @default true
19
- */
20
- cancelOnEscape?: boolean | undefined;
21
- /**
22
- * Whether to automatically focus the input when a new run starts.
23
- * @default true
24
- */
25
- unstable_focusOnRunStart?: boolean | undefined;
26
- /**
27
- * Whether to automatically focus the input when scrolling to bottom.
28
- * @default true
29
- */
30
- unstable_focusOnScrollToBottom?: boolean | undefined;
31
- /**
32
- * Whether to automatically focus the input when switching threads.
33
- * @default true
34
- */
35
- unstable_focusOnThreadSwitched?: boolean | undefined;
36
- /**
37
- * Whether plain Enter on a touch-primary device should insert a newline
38
- * instead of submitting, detected via
39
- * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect
40
- * when `submitMode` resolves to `"enter"`.
41
- * @default false
42
- */
43
- unstable_insertNewlineOnTouchEnter?: boolean | undefined;
44
- /**
45
- * Whether to automatically add pasted files as attachments.
46
- * @default true
47
- */
48
- addAttachmentOnPaste?: boolean | undefined;
49
- };
50
- type SubmitModeProps = {
51
- /**
52
- * Controls how the Enter key submits messages.
53
- * - "enter": Plain Enter submits (Shift+Enter for newline)
54
- * - "ctrlEnter": Ctrl/Cmd+Enter submits (plain Enter for newline)
55
- * - "none": Keyboard submission disabled
56
- * @default "enter"
57
- */
58
- submitMode?: "enter" | "ctrlEnter" | "none" | undefined;
59
- /**
60
- * @deprecated Use `submitMode` instead
61
- * @ignore
62
- */
63
- submitOnEnter?: never;
64
- } | {
65
- submitMode?: never;
66
- /**
67
- * Whether to submit the message when Enter is pressed (without Shift).
68
- * @default true
69
- * @deprecated Use `submitMode` instead. Will be removed in a future version.
70
- */
71
- submitOnEnter?: boolean | undefined;
72
- };
73
- export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;
74
- export {};
4
+ export type Element = HTMLTextAreaElement;
5
+ type BaseProps = {
6
+ /**
7
+ * Whether to render as a child component using Slot.
8
+ * When true, the component will merge its props with its child.
9
+ */
10
+ asChild?: boolean | undefined;
11
+ /**
12
+ * A React element to use as the input container, with props merged in.
13
+ */
14
+ render?: ReactElement | undefined;
15
+ /**
16
+ * Whether to cancel message composition when Escape is pressed.
17
+ * @default true
18
+ */
19
+ cancelOnEscape?: boolean | undefined;
20
+ /**
21
+ * Whether to automatically focus the input when a new run starts.
22
+ * @default true
23
+ */
24
+ unstable_focusOnRunStart?: boolean | undefined;
25
+ /**
26
+ * Whether to automatically focus the input when scrolling to bottom.
27
+ * @default true
28
+ */
29
+ unstable_focusOnScrollToBottom?: boolean | undefined;
30
+ /**
31
+ * Whether to automatically focus the input when switching threads.
32
+ * @default true
33
+ */
34
+ unstable_focusOnThreadSwitched?: boolean | undefined;
35
+ /**
36
+ * Whether plain Enter on a touch-primary device should insert a newline
37
+ * instead of submitting, detected via
38
+ * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect
39
+ * when `submitMode` resolves to `"enter"`.
40
+ * @default false
41
+ */
42
+ unstable_insertNewlineOnTouchEnter?: boolean | undefined;
43
+ /**
44
+ * Whether to automatically add pasted files as attachments.
45
+ * @default true
46
+ */
47
+ addAttachmentOnPaste?: boolean | undefined;
48
+ };
49
+ type SubmitModeProps = {
50
+ /**
51
+ * Controls how the Enter key submits messages.
52
+ * - "enter": Plain Enter submits (Shift+Enter for newline)
53
+ * - "ctrlEnter": Ctrl/Cmd+Enter submits (plain Enter for newline)
54
+ * - "none": Keyboard submission disabled
55
+ * @default "enter"
56
+ */
57
+ submitMode?: "enter" | "ctrlEnter" | "none" | undefined;
58
+ /**
59
+ * @deprecated Use `submitMode` instead
60
+ * @ignore
61
+ */
62
+ submitOnEnter?: never;
63
+ } | {
64
+ submitMode?: never;
65
+ /**
66
+ * Whether to submit the message when Enter is pressed (without Shift).
67
+ * @default true
68
+ * @deprecated Use `submitMode` instead. Will be removed in a future version.
69
+ */
70
+ submitOnEnter?: boolean | undefined;
71
+ };
72
+ export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;
73
+ export {};
75
74
  }
76
75
  /**
77
76
  * A text input component for composing messages.
@@ -108,5 +107,4 @@ export declare namespace ComposerPrimitiveInput {
108
107
  * ```
109
108
  */
110
109
  export declare const ComposerPrimitiveInput: import("react").ForwardRefExoticComponent<ComposerPrimitiveInput.Props & import("react").RefAttributes<HTMLTextAreaElement>>;
111
- //#endregion
112
110
  //# sourceMappingURL=ComposerInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInput.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"mappings":";;;yBAoCiB;cACH,UAAU;OAEjB;;;;;IAKH;;;;IAIA,SAAS;;;;;IAKT;;;;;IAKA;;;;;IAKA;;;;;IAKA;;;;;;;;IAQA;;;;;IAKA;;OAGG;;;;;;;;IASC;;;;;IAKA;;IAGA;;;;;;IAMA;;cAGM,QAAQ,wBAAwB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqC7C,wCAAsB,0BAAA,uBAAA,wBAAA,cAAA"}
1
+ {"version":3,"file":"ComposerInput.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,YAAY,EAOlB,MAAM,OAAO,CAAC;AACf,OAAyB,EACvB,KAAK,qBAAqB,EAE3B,MAAM,yBAAyB,CAAC;AAiBjC,yBAAiB,sBAAsB,CAAC;IACtC,MAAM,MAAM,OAAO,GAAG,mBAAmB,CAAC;IAE1C,KAAK,SAAS,GAAG;QACf;;;WAGG;QACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC9B;;WAEG;QACH,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;QAClC;;;WAGG;QACH,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrC;;;WAGG;QACH,wBAAwB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC/C;;;WAGG;QACH,8BAA8B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrD;;;WAGG;QACH,8BAA8B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrD;;;;;;WAMG;QACH,kCAAkC,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACzD;;;WAGG;QACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC5C,CAAC;IAEF,KAAK,eAAe,GAChB;QACE;;;;;;WAMG;QACH,UAAU,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;QACxD;;;WAGG;QACH,aAAa,CAAC,EAAE,KAAK,CAAC;KACvB,GACD;QACE,UAAU,CAAC,EAAE,KAAK,CAAC;QACnB;;;;WAIG;QACH,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KACrC,CAAC;IAEN,MAAM,MAAM,KAAK,GAAG,qBAAqB,GAAG,SAAS,GAAG,eAAe,CAAC;;CACzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,sBAAsB,8HAiTlC,CAAC"}
@@ -5,13 +5,13 @@ import { useOnScrollToBottom } from "../../utils/hooks/useOnScrollToBottom.js";
5
5
  import { useMediaQuery } from "../../utils/hooks/useMediaQuery.js";
6
6
  import { useComposerInputPluginRegistryOptional } from "./ComposerInputPluginContext.js";
7
7
  import { useComposerInputDisabled, useComposerInputValue, useTriggerPopoverAriaProps } from "./useComposerInputState.js";
8
- import { useAui } from "@assistant-ui/store";
9
8
  import { forwardRef, isValidElement, useCallback, useEffect, useRef } from "@assistant-ui/tap/react-shim";
9
+ import { useAui } from "@assistant-ui/store";
10
+ import { flushTapSync } from "@assistant-ui/tap";
10
11
  import { jsx } from "react/jsx-runtime";
11
12
  import { composeEventHandlers, useComposedRefs, useEscapeKeydown } from "radix-ui/internal";
12
13
  import { Slot } from "radix-ui";
13
14
  import TextareaAutosize from "react-textarea-autosize";
14
- import { flushTapSync } from "@assistant-ui/tap";
15
15
  //#region src/primitives/composer/ComposerInput.tsx
16
16
  const TOUCH_PRIMARY_QUERY = "(pointer: coarse) and (not (any-pointer: fine))";
17
17
  /**
@@ -88,7 +88,7 @@ const ComposerPrimitiveInput = forwardRef(({ autoFocus = false, asChild, render,
88
88
  return;
89
89
  }
90
90
  if (e_0.shiftKey) return;
91
- if (threadState.isRunning && !hasQueue) return;
91
+ if (threadState.isRunning && !hasQueue && threadState.voice === void 0) return;
92
92
  let shouldSubmit = false;
93
93
  if (effectiveSubmitMode === "ctrlEnter") shouldSubmit = e_0.ctrlKey || e_0.metaKey;
94
94
  else if (effectiveSubmitMode === "enter") shouldSubmit = true;
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInput.js","names":["composeEventHandlers","useComposedRefs","Slot","ClipboardEvent","KeyboardEvent","ReactElement","ReactNode","forwardRef","useCallback","useEffect","useRef","isValidElement","TextareaAutosize","TextareaAutosizeProps","TextareaHeightChangeMeta","useEscapeKeydown","useOnScrollToBottom","useMediaQuery","renderSlot","useAui","flushTapSync","useComposerInputPluginRegistryOptional","useComposerCompactContextOptional","useComposerInputDisabled","useComposerInputValue","useTriggerPopoverAriaProps","TOUCH_PRIMARY_QUERY","ComposerPrimitiveInput","Element","HTMLTextAreaElement","BaseProps","asChild","render","cancelOnEscape","unstable_focusOnRunStart","unstable_focusOnScrollToBottom","unstable_focusOnThreadSwitched","unstable_insertNewlineOnTouchEnter","addAttachmentOnPaste","SubmitModeProps","submitMode","submitOnEnter","Props","autoFocus","disabled","disabledProp","onChange","onKeyDown","onPaste","onSelect","onHeightChange","rest","forwardedRef","aui","pluginRegistry","compactContext","declaredSubmitMode","isTouchPrimary","effectiveSubmitMode","value","isDisabled","textareaRef","ref","compositionRef","e","current","contains","target","Node","isComposing","plugin","getPlugins","handleKeyDown","composer","getState","canCancel","cancel","preventDefault","handleKeyPress","nativeEvent","key","threadState","thread","hasQueue","capabilities","queue","shiftKey","ctrlKey","metaKey","canSend","send","steer","isRunning","shouldSubmit","closest","requestSubmit","handlePaste","threadCapabilities","files","Array","from","clipboardData","attachments","length","Promise","all","map","file","addAttachment","handleHeightChange","height","meta","el","cs","getComputedStyle","contentHeight","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","Math","round","rowHeight","setMultiline","autoFocusEnabled","focus","textarea","preventScroll","setSelectionRange","type","undefined","on","ariaComboboxProps","inputProps","name","const","React","ForwardedRef","ChangeEvent","isEditing","nativeIsComposing","setText","pos","selectionStart","setCursorPosition","onCompositionStart","CompositionEventHandler","onCompositionEnd","CompositionEvent","SyntheticEvent","children","Component","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Slot } from \"radix-ui\";\nimport {\n type ClipboardEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n type TextareaHeightChangeMeta,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"radix-ui/internal\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useMediaQuery } from \"../../utils/hooks/useMediaQuery\";\nimport { renderSlot } from \"../../utils/Primitive\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\nimport { useComposerInputPluginRegistryOptional } from \"./ComposerInputPluginContext\";\nimport { useComposerCompactContextOptional } from \"./ComposerCompactContext\";\nimport {\n useComposerInputDisabled,\n useComposerInputValue,\n useTriggerPopoverAriaProps,\n} from \"./useComposerInputState\";\n\nconst TOUCH_PRIMARY_QUERY = \"(pointer: coarse) and (not (any-pointer: fine))\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to automatically focus the input when a new run starts.\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether plain Enter on a touch-primary device should insert a newline\n * instead of submitting, detected via\n * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect\n * when `submitMode` resolves to `\"enter\"`.\n * @default false\n */\n unstable_insertNewlineOnTouchEnter?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * When rendered inside `Unstable_TriggerPopoverRoot` and a popover is open, the\n * underlying `<textarea>` automatically receives `aria-controls`,\n * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the\n * combobox relationship. These computed attributes override user-provided\n * values for those four ARIA props while the popover is open.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Insert a newline on Enter on touch-primary devices.\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * unstable_insertNewlineOnTouchEnter\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n unstable_insertNewlineOnTouchEnter = false,\n addAttachmentOnPaste = true,\n onHeightChange,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const pluginRegistry = useComposerInputPluginRegistryOptional();\n const compactContext = useComposerCompactContextOptional();\n\n const declaredSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n const isTouchPrimary = useMediaQuery(\n unstable_insertNewlineOnTouchEnter ? TOUCH_PRIMARY_QUERY : null,\n );\n const effectiveSubmitMode =\n unstable_insertNewlineOnTouchEnter &&\n isTouchPrimary &&\n declaredSubmitMode === \"enter\"\n ? \"none\"\n : declaredSubmitMode;\n\n const value = useComposerInputValue();\n const isDisabled = useComposerInputDisabled(disabledProp);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n // suppress text/cursor broadcasts during IME composition\n const compositionRef = useRef(false);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // ignore IME composition events\n if (e.isComposing) return;\n\n // Let registered plugins (mention, slash command, etc.) handle Escape first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer;\n if (composer.getState().canCancel) {\n composer.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (e.nativeEvent.isComposing) return;\n\n // Let registered plugins (mention, slash command, etc.) handle keyboard events first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread.getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and canSend)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n declaredSubmitMode !== \"none\" &&\n aui.composer.getState().canSend\n ) {\n e.preventDefault();\n aui.composer.send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported\n if (threadState.isRunning && !hasQueue) return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread.getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n e.preventDefault();\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer.addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n }),\n );\n }\n };\n\n const handleHeightChange = (\n height: number,\n meta: TextareaHeightChangeMeta,\n ) => {\n onHeightChange?.(height, meta);\n if (!compactContext) return;\n const el = textareaRef.current;\n if (!el || el.value === \"\") return;\n const cs = getComputedStyle(el);\n const contentHeight =\n cs.boxSizing === \"border-box\"\n ? height -\n parseFloat(cs.paddingTop) -\n parseFloat(cs.paddingBottom) -\n parseFloat(cs.borderTopWidth) -\n parseFloat(cs.borderBottomWidth)\n : height;\n if (Math.round(contentHeight / meta.rowHeight) > 1) {\n compactContext.setMultiline(true);\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer.getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focus);\n }, [unstable_focusOnRunStart, focus, aui]);\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched\n )\n return undefined;\n\n return aui.on(\"threads.selectionChanged\", focus);\n }, [unstable_focusOnThreadSwitched, focus, aui]);\n\n useEffect(() => {\n if (value === \"\") compactContext?.setMultiline(false);\n }, [value, compactContext]);\n\n const ariaComboboxProps = useTriggerPopoverAriaProps();\n\n const inputProps = {\n name: \"input\" as const,\n value,\n ...rest,\n ...ariaComboboxProps,\n ref: ref as React.ForwardedRef<HTMLTextAreaElement>,\n disabled: isDisabled,\n onChange: composeEventHandlers(\n onChange,\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!aui.composer.getState().isEditing) return;\n const nativeIsComposing =\n (e.nativeEvent as { isComposing?: boolean }).isComposing === true;\n // recover stuck compositionRef when the browser drops compositionend\n if (compositionRef.current && !nativeIsComposing) {\n compositionRef.current = false;\n }\n const isComposing = nativeIsComposing || compositionRef.current;\n // keep controlled value in sync mid-IME so react does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer.setText(e.target.value);\n });\n if (isComposing) return;\n const pos = e.target.selectionStart ?? e.target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyPress),\n onCompositionStart: composeEventHandlers(\n (rest as { onCompositionStart?: React.CompositionEventHandler })\n .onCompositionStart,\n () => {\n compositionRef.current = true;\n },\n ),\n onCompositionEnd: composeEventHandlers(\n (rest as { onCompositionEnd?: React.CompositionEventHandler })\n .onCompositionEnd,\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = false;\n if (!aui.composer.getState().isEditing) return;\n const target = e.target as HTMLTextAreaElement;\n flushTapSync(() => {\n aui.composer.setText(target.value);\n });\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onSelect: composeEventHandlers(\n onSelect,\n (e: React.SyntheticEvent<HTMLTextAreaElement>) => {\n if (compositionRef.current) return;\n const target = e.target as HTMLTextAreaElement;\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onPaste: composeEventHandlers(onPaste, handlePaste),\n ...(compactContext\n ? { onHeightChange: handleHeightChange }\n : onHeightChange !== undefined\n ? { onHeightChange }\n : {}),\n };\n\n if (render && isValidElement(render)) {\n return renderSlot(\n render,\n (rest as { children?: ReactNode }).children,\n inputProps,\n );\n }\n\n const Component = asChild ? Slot.Root : TextareaAutosize;\n return <Component {...inputProps} />;\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,MAAM0B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiH5B,MAAaC,yBAAyBpB,YAKlC,EACEoC,YAAY,OACZZ,SACAC,QACAY,UAAUC,cACVC,UACAC,WACAC,SACAC,UACAR,eACAD,YACAP,iBAAiB,MACjBC,2BAA2B,MAC3BC,iCAAiC,MACjCC,iCAAiC,MACjCC,qCAAqC,OACrCC,uBAAuB,MACvBY,gBACA,GAAGC,QAELC,iBACG;CACH,MAAMC,MAAMlC,OAAO;CACnB,MAAMmC,iBAAiBjC,uCAAuC;CAC9D,MAAMkC,iBAAiBjC,kCAAkC;CAEzD,MAAMkC,qBACJhB,eAAeC,kBAAkB,QAAQ,SAAS;CACpD,MAAMgB,iBAAiBxC,cACrBoB,qCAAqCX,sBAAsB,IAC7D;CACA,MAAMgC,sBACJrB,sCACAoB,kBACAD,uBAAuB,UACnB,SACAA;CAEN,MAAMG,QAAQnC,sBAAsB;CACpC,MAAMoC,aAAarC,yBAAyBsB,YAAY;CACxD,MAAMgB,cAAcnD,OAA4B,IAAI;CACpD,MAAMoD,MAAM7D,gBAAgBmD,cAAcS,WAAW;CAErD,MAAME,iBAAiBrD,OAAO,KAAK;CAEnCK,kBAAkBiD,MAAM;EAEtB,IAAI,CAACH,YAAYI,SAASC,SAASF,EAAEG,MAAc,GAAG;EAGtD,IAAIH,EAAEK,aAAa;EAGnB,IAAIf,gBACG;QAAA,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QAAmD;GAClDD,eAAeE,UAAU;GACzB,IAAI,CAACZ,IAAIoB,SAASC,SAAS,CAAC,CAACmE,WAAW;GACxC,MAAM1E,SAASH,IAAEG;GACjB/C,mBAAmB;IACjBiC,IAAIoB,SAASsE,QAAQ5E,OAAOR,KAAK;GACnC,CAAC;GACD,MAAMqF,QAAM7E,OAAO8E,kBAAkB9E,OAAOR,MAAM4C;GAClD,IAAIjD,gBACF,KAAK,MAAMgB,YAAUhB,eAAeiB,WAAW,GAC7CD,SAAO4E,kBAAkBF,KAAG;EAGlC,CACF;EACA/F,UAAUjD,qBACRiD,WACCe,QAAiD;GAChD,IAAID,eAAeE,SAAS;GAC5B,MAAME,WAASH,IAAEG;GACjB,MAAM6E,QAAM7E,SAAO8E,kBAAkB9E,SAAOR,MAAM4C;GAClD,IAAIjD,gBACF,KAAK,MAAMgB,YAAUhB,eAAeiB,WAAW,GAC7CD,SAAO4E,kBAAkBF,KAAG;EAGlC,CACF;EACAhG,SAAShD,qBAAqBgD,SAASgD,WAAW;EAClD,GAAIzC,iBACA,EAAEL,gBAAgB2D,mBAAmB,IACrC3D,mBAAmBkF,KAAAA,IACjB,EAAElF,eAAe,IACjB,CAAC;CACT;CAEA,IAAIlB,UAAUrB,eAAeqB,MAAM,GACjC,OAAOd,WACLc,QACCmB,KAAkCqG,UACnCjB,UACF;CAGF,MAAMkB,YAAY1H,UAAU7B,KAAKwJ,OAAO9I;CACxC,OAAO,oBAAC,WAAD,EAAW,GAAI2H,WAAW,CAAA;AACnC,CACF;AAEA5G,uBAAuBgI,cAAc"}
1
+ {"version":3,"file":"ComposerInput.js","names":["composeEventHandlers","useComposedRefs","Slot","ClipboardEvent","KeyboardEvent","ReactElement","ReactNode","forwardRef","useCallback","useEffect","useRef","isValidElement","TextareaAutosize","TextareaAutosizeProps","TextareaHeightChangeMeta","useEscapeKeydown","useOnScrollToBottom","useMediaQuery","renderSlot","useAui","flushTapSync","useComposerInputPluginRegistryOptional","useComposerCompactContextOptional","useComposerInputDisabled","useComposerInputValue","useTriggerPopoverAriaProps","TOUCH_PRIMARY_QUERY","ComposerPrimitiveInput","Element","HTMLTextAreaElement","BaseProps","asChild","render","cancelOnEscape","unstable_focusOnRunStart","unstable_focusOnScrollToBottom","unstable_focusOnThreadSwitched","unstable_insertNewlineOnTouchEnter","addAttachmentOnPaste","SubmitModeProps","submitMode","submitOnEnter","Props","autoFocus","disabled","disabledProp","onChange","onKeyDown","onPaste","onSelect","onHeightChange","rest","forwardedRef","aui","pluginRegistry","compactContext","declaredSubmitMode","isTouchPrimary","effectiveSubmitMode","value","isDisabled","textareaRef","ref","compositionRef","e","current","contains","target","Node","isComposing","plugin","getPlugins","handleKeyDown","composer","getState","canCancel","cancel","preventDefault","handleKeyPress","nativeEvent","key","threadState","thread","hasQueue","capabilities","queue","shiftKey","ctrlKey","metaKey","canSend","send","steer","isRunning","voice","undefined","shouldSubmit","closest","requestSubmit","handlePaste","threadCapabilities","files","Array","from","clipboardData","attachments","length","Promise","all","map","file","addAttachment","handleHeightChange","height","meta","el","cs","getComputedStyle","contentHeight","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","Math","round","rowHeight","setMultiline","autoFocusEnabled","focus","textarea","preventScroll","setSelectionRange","type","on","ariaComboboxProps","inputProps","name","const","React","ForwardedRef","ChangeEvent","isEditing","nativeIsComposing","setText","pos","selectionStart","setCursorPosition","onCompositionStart","CompositionEventHandler","onCompositionEnd","CompositionEvent","SyntheticEvent","children","Component","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Slot } from \"radix-ui\";\nimport {\n type ClipboardEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n type TextareaHeightChangeMeta,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"radix-ui/internal\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useMediaQuery } from \"../../utils/hooks/useMediaQuery\";\nimport { renderSlot } from \"../../utils/Primitive\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\nimport { useComposerInputPluginRegistryOptional } from \"./ComposerInputPluginContext\";\nimport { useComposerCompactContextOptional } from \"./ComposerCompactContext\";\nimport {\n useComposerInputDisabled,\n useComposerInputValue,\n useTriggerPopoverAriaProps,\n} from \"./useComposerInputState\";\n\nconst TOUCH_PRIMARY_QUERY = \"(pointer: coarse) and (not (any-pointer: fine))\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to automatically focus the input when a new run starts.\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether plain Enter on a touch-primary device should insert a newline\n * instead of submitting, detected via\n * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect\n * when `submitMode` resolves to `\"enter\"`.\n * @default false\n */\n unstable_insertNewlineOnTouchEnter?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * When rendered inside `Unstable_TriggerPopoverRoot` and a popover is open, the\n * underlying `<textarea>` automatically receives `aria-controls`,\n * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the\n * combobox relationship. These computed attributes override user-provided\n * values for those four ARIA props while the popover is open.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Insert a newline on Enter on touch-primary devices.\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * unstable_insertNewlineOnTouchEnter\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n unstable_insertNewlineOnTouchEnter = false,\n addAttachmentOnPaste = true,\n onHeightChange,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const pluginRegistry = useComposerInputPluginRegistryOptional();\n const compactContext = useComposerCompactContextOptional();\n\n const declaredSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n const isTouchPrimary = useMediaQuery(\n unstable_insertNewlineOnTouchEnter ? TOUCH_PRIMARY_QUERY : null,\n );\n const effectiveSubmitMode =\n unstable_insertNewlineOnTouchEnter &&\n isTouchPrimary &&\n declaredSubmitMode === \"enter\"\n ? \"none\"\n : declaredSubmitMode;\n\n const value = useComposerInputValue();\n const isDisabled = useComposerInputDisabled(disabledProp);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n // suppress text/cursor broadcasts during IME composition\n const compositionRef = useRef(false);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // ignore IME composition events\n if (e.isComposing) return;\n\n // Let registered plugins (mention, slash command, etc.) handle Escape first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer;\n if (composer.getState().canCancel) {\n composer.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (e.nativeEvent.isComposing) return;\n\n // Let registered plugins (mention, slash command, etc.) handle keyboard events first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread.getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and canSend)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n declaredSubmitMode !== \"none\" &&\n aui.composer.getState().canSend\n ) {\n e.preventDefault();\n aui.composer.send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported; a voice\n // session leaves the decision to canSend\n if (\n threadState.isRunning &&\n !hasQueue &&\n threadState.voice === undefined\n )\n return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread.getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n e.preventDefault();\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer.addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n }),\n );\n }\n };\n\n const handleHeightChange = (\n height: number,\n meta: TextareaHeightChangeMeta,\n ) => {\n onHeightChange?.(height, meta);\n if (!compactContext) return;\n const el = textareaRef.current;\n if (!el || el.value === \"\") return;\n const cs = getComputedStyle(el);\n const contentHeight =\n cs.boxSizing === \"border-box\"\n ? height -\n parseFloat(cs.paddingTop) -\n parseFloat(cs.paddingBottom) -\n parseFloat(cs.borderTopWidth) -\n parseFloat(cs.borderBottomWidth)\n : height;\n if (Math.round(contentHeight / meta.rowHeight) > 1) {\n compactContext.setMultiline(true);\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer.getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focus);\n }, [unstable_focusOnRunStart, focus, aui]);\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched\n )\n return undefined;\n\n return aui.on(\"threads.selectionChanged\", focus);\n }, [unstable_focusOnThreadSwitched, focus, aui]);\n\n useEffect(() => {\n if (value === \"\") compactContext?.setMultiline(false);\n }, [value, compactContext]);\n\n const ariaComboboxProps = useTriggerPopoverAriaProps();\n\n const inputProps = {\n name: \"input\" as const,\n value,\n ...rest,\n ...ariaComboboxProps,\n ref: ref as React.ForwardedRef<HTMLTextAreaElement>,\n disabled: isDisabled,\n onChange: composeEventHandlers(\n onChange,\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!aui.composer.getState().isEditing) return;\n const nativeIsComposing =\n (e.nativeEvent as { isComposing?: boolean }).isComposing === true;\n // recover stuck compositionRef when the browser drops compositionend\n if (compositionRef.current && !nativeIsComposing) {\n compositionRef.current = false;\n }\n const isComposing = nativeIsComposing || compositionRef.current;\n // keep controlled value in sync mid-IME so react does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer.setText(e.target.value);\n });\n if (isComposing) return;\n const pos = e.target.selectionStart ?? e.target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyPress),\n onCompositionStart: composeEventHandlers(\n (rest as { onCompositionStart?: React.CompositionEventHandler })\n .onCompositionStart,\n () => {\n compositionRef.current = true;\n },\n ),\n onCompositionEnd: composeEventHandlers(\n (rest as { onCompositionEnd?: React.CompositionEventHandler })\n .onCompositionEnd,\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = false;\n if (!aui.composer.getState().isEditing) return;\n const target = e.target as HTMLTextAreaElement;\n flushTapSync(() => {\n aui.composer.setText(target.value);\n });\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onSelect: composeEventHandlers(\n onSelect,\n (e: React.SyntheticEvent<HTMLTextAreaElement>) => {\n if (compositionRef.current) return;\n const target = e.target as HTMLTextAreaElement;\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onPaste: composeEventHandlers(onPaste, handlePaste),\n ...(compactContext\n ? { onHeightChange: handleHeightChange }\n : onHeightChange !== undefined\n ? { onHeightChange }\n : {}),\n };\n\n if (render && isValidElement(render)) {\n return renderSlot(\n render,\n (rest as { children?: ReactNode }).children,\n inputProps,\n );\n }\n\n const Component = asChild ? Slot.Root : TextareaAutosize;\n return <Component {...inputProps} />;\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,MAAM0B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiH5B,MAAaC,yBAAyBpB,YAKlC,EACEoC,YAAY,OACZZ,SACAC,QACAY,UAAUC,cACVC,UACAC,WACAC,SACAC,UACAR,eACAD,YACAP,iBAAiB,MACjBC,2BAA2B,MAC3BC,iCAAiC,MACjCC,iCAAiC,MACjCC,qCAAqC,OACrCC,uBAAuB,MACvBY,gBACA,GAAGC,QAELC,iBACG;CACH,MAAMC,MAAMlC,OAAO;CACnB,MAAMmC,iBAAiBjC,uCAAuC;CAC9D,MAAMkC,iBAAiBjC,kCAAkC;CAEzD,MAAMkC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AAe,IACjB,CAAC;CACT;CAEA,IAAIlB,UAAUrB,eAAeqB,MAAM,GACjC,OAAOd,WACLc,QACCmB,KAAkCsG,UACnCjB,UACF;CAGF,MAAMkB,YAAY3H,UAAU7B,KAAKyJ,OAAO/I;CACxC,OAAO,oBAAC,WAAD,EAAW,GAAI4H,WAAW,CAAA;AACnC,CACF;AAEA7G,uBAAuBiI,cAAc"}
@@ -1,40 +1,38 @@
1
- import { FC, ReactNode } from "react";
2
- //#region src/primitives/composer/ComposerInputPluginContext.d.ts
1
+ import { type ReactNode, type FC } from "react";
3
2
  /**
4
3
  * A plugin that intercepts keyboard events and cursor changes in the composer
5
4
  * input. Used by trigger popover declarations to handle popover navigation
6
5
  * without ComposerInput knowing about specific triggers.
7
6
  */
8
7
  export type ComposerInputPlugin = {
9
- /** Handle a key event. Return true if consumed (stops propagation to other plugins and default behavior). */
10
- handleKeyDown(e: {
11
- readonly key: string;
12
- readonly shiftKey: boolean;
13
- readonly ctrlKey?: boolean;
14
- readonly metaKey?: boolean;
15
- readonly nativeEvent?: {
16
- isComposing?: boolean;
17
- };
18
- preventDefault(): void;
19
- }): boolean;
20
- /** Called on every cursor position change (selection change / text change). */
21
- setCursorPosition(pos: number): void;
8
+ /** Handle a key event. Return true if consumed (stops propagation to other plugins and default behavior). */
9
+ handleKeyDown(e: {
10
+ readonly key: string;
11
+ readonly shiftKey: boolean;
12
+ readonly ctrlKey?: boolean;
13
+ readonly metaKey?: boolean;
14
+ readonly nativeEvent?: {
15
+ isComposing?: boolean;
16
+ };
17
+ preventDefault(): void;
18
+ }): boolean;
19
+ /** Called on every cursor position change (selection change / text change). */
20
+ setCursorPosition(pos: number): void;
22
21
  };
23
22
  /** Options for registering a plugin. */
24
23
  export type ComposerInputPluginRegisterOptions = {
25
- /**
26
- * Relative priority. Plugins with higher priority receive events first.
27
- * @default 0
28
- */
29
- priority?: number;
24
+ /**
25
+ * Relative priority. Plugins with higher priority receive events first.
26
+ * @default 0
27
+ */
28
+ priority?: number;
30
29
  };
31
30
  export type ComposerInputPluginRegistry = {
32
- register(plugin: ComposerInputPlugin, opts?: ComposerInputPluginRegisterOptions): () => void;
33
- getPlugins(): readonly ComposerInputPlugin[];
31
+ register(plugin: ComposerInputPlugin, opts?: ComposerInputPluginRegisterOptions): () => void;
32
+ getPlugins(): readonly ComposerInputPlugin[];
34
33
  };
35
34
  export declare const useComposerInputPluginRegistryOptional: () => ComposerInputPluginRegistry | null;
36
35
  export declare const ComposerInputPluginProvider: FC<{
37
- children: ReactNode;
36
+ children: ReactNode;
38
37
  }>;
39
- //#endregion
40
38
  //# sourceMappingURL=ComposerInputPluginContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInputPluginContext.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerInputPluginContext.tsx"],"mappings":";;;;;;;YAiBY;;EAEV,cAAc;aACH;aACA;aACA;aACA;aACA;MAAgB;;IACzB;;;EAIF,kBAAkB;;;YAIR;;;;;EAKV;;YAIU;EACV,SACE,QAAQ,qBACR,OAAO;EAET,uBAAuB;;qBAMZ,8CACP;qBAIO,6BAA6B;EAAK,UAAU"}
1
+ {"version":3,"file":"ComposerInputPluginContext.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerInputPluginContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,SAAS,EACd,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAEf;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,6GAA6G;IAC7G,aAAa,CAAC,CAAC,EAAE;QACf,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE;YAAE,WAAW,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC;QACjD,cAAc,IAAI,IAAI,CAAC;KACxB,GAAG,OAAO,CAAC;IAEZ,+EAA+E;IAC/E,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,wCAAwC;AACxC,MAAM,MAAM,kCAAkC,GAAG;IAC/C;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,CACN,MAAM,EAAE,mBAAmB,EAC3B,IAAI,CAAC,EAAE,kCAAkC,GACxC,MAAM,IAAI,CAAC;IACd,UAAU,IAAI,SAAS,mBAAmB,EAAE,CAAC;CAC9C,CAAC;AAKF,eAAO,MAAM,sCAAsC,QAC7C,2BAA2B,GAAG,IAEjC,CAAC;AAEJ,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CA4CnE,CAAC"}
@@ -1,2 +1,2 @@
1
- import { ComposerPrimitiveQueue } from "@assistant-ui/core/react";
2
- export { ComposerPrimitiveQueue };
1
+ export { ComposerPrimitiveQueue } from "@assistant-ui/core/react";
2
+ //# sourceMappingURL=ComposerQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComposerQueue.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerQueue.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,9 +1,8 @@
1
1
  import { Primitive } from "../../utils/Primitive.js";
2
- import { ComponentPropsWithoutRef, ComponentRef } from "react";
3
- //#region src/primitives/composer/ComposerQuote.d.ts
2
+ import { type ComponentRef, type ComponentPropsWithoutRef } from "react";
4
3
  export declare namespace ComposerPrimitiveQuote {
5
- type Element = ComponentRef<typeof Primitive.div>;
6
- type Props = ComponentPropsWithoutRef<typeof Primitive.div>;
4
+ type Element = ComponentRef<typeof Primitive.div>;
5
+ type Props = ComponentPropsWithoutRef<typeof Primitive.div>;
7
6
  }
8
7
  /**
9
8
  * Renders a container for the quoted text preview in the composer.
@@ -18,13 +17,13 @@ export declare namespace ComposerPrimitiveQuote {
18
17
  * ```
19
18
  */
20
19
  export declare const ComposerPrimitiveQuote: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
21
- asChild?: boolean;
20
+ asChild?: boolean;
22
21
  }, "ref"> & {
23
- render?: import("react").ReactElement | undefined;
22
+ render?: import("react").ReactElement | undefined;
24
23
  } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
25
24
  export declare namespace ComposerPrimitiveQuoteText {
26
- type Element = ComponentRef<typeof Primitive.span>;
27
- type Props = ComponentPropsWithoutRef<typeof Primitive.span>;
25
+ type Element = ComponentRef<typeof Primitive.span>;
26
+ type Props = ComponentPropsWithoutRef<typeof Primitive.span>;
28
27
  }
29
28
  /**
30
29
  * Renders the quoted text content.
@@ -35,13 +34,13 @@ export declare namespace ComposerPrimitiveQuoteText {
35
34
  * ```
36
35
  */
37
36
  export declare const ComposerPrimitiveQuoteText: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
38
- asChild?: boolean;
37
+ asChild?: boolean;
39
38
  }, "ref"> & {
40
- render?: import("react").ReactElement | undefined;
39
+ render?: import("react").ReactElement | undefined;
41
40
  } & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
42
41
  export declare namespace ComposerPrimitiveQuoteDismiss {
43
- type Element = ComponentRef<typeof Primitive.button>;
44
- type Props = ComponentPropsWithoutRef<typeof Primitive.button>;
42
+ type Element = ComponentRef<typeof Primitive.button>;
43
+ type Props = ComponentPropsWithoutRef<typeof Primitive.button>;
45
44
  }
46
45
  /**
47
46
  * A button that clears the current quote from the composer.
@@ -52,9 +51,8 @@ export declare namespace ComposerPrimitiveQuoteDismiss {
52
51
  * ```
53
52
  */
54
53
  export declare const ComposerPrimitiveQuoteDismiss: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
55
- asChild?: boolean;
54
+ asChild?: boolean;
56
55
  }, "ref"> & {
57
- render?: import("react").ReactElement | undefined;
56
+ render?: import("react").ReactElement | undefined;
58
57
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
59
- //#endregion
60
58
  //# sourceMappingURL=ComposerQuote.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerQuote.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerQuote.tsx"],"mappings":";;;yBAciB;OACH,UAAU,oBAAoB,UAAU;OACxC,QAAQ,gCAAgC,UAAU;;;;;;;;;;;;;;qBAenD,wCAAsB,0BAAA,KAAA,qBAAA,gBAAA,kCAAA,eAAA;;;;oBAQjC,cAAA,0CAAA,cAAA;yBAMe;OACH,UAAU,oBAAoB,UAAU;OACxC,QAAQ,gCAAgC,UAAU;;;;;;;;;;qBAWnD,4CAA0B,0BAAA,KAAA,qBAAA,gBAAA,mCAAA,eAAA;;;;oBAYrC,cAAA,2CAAA,cAAA;yBAMe;OACH,UAAU,oBAAoB,UAAU;OACxC,QAAQ,gCAAgC,UAAU;;;;;;;;;;qBAWnD,+CAA6B,0BAAA,KAAA,qBAAA,gBAAA,qCAAA,qBAAA;;;;oBAiBxC,cAAA,6CAAA,cAAA"}
1
+ {"version":3,"file":"ComposerQuote.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerQuote.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iCAA8B;AAClD,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAG9B,MAAM,OAAO,CAAC;AAMf,yBAAiB,sBAAsB,CAAC;IACtC,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACzD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;CACpE;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB;;;;0GAQjC,CAAC;AAMH,yBAAiB,0BAA0B,CAAC;IAC1C,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1D,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;CACrE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;4GAYrC,CAAC;AAMH,yBAAiB,6BAA6B,CAAC;IAC7C,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5D,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;CACvE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B;;;;gHAiBxC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Primitive as Primitive$1 } from "../../utils/Primitive.js";
3
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
- import { useAui, useAuiState } from "@assistant-ui/store";
5
4
  import { forwardRef } from "@assistant-ui/tap/react-shim";
5
+ import { useAui, useAuiState } from "@assistant-ui/store";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { composeEventHandlers } from "radix-ui/internal";
8
8
  //#region src/primitives/composer/ComposerQuote.tsx
@@ -1,23 +1,22 @@
1
1
  import { Primitive } from "../../utils/Primitive.js";
2
- import { ComponentPropsWithoutRef, ComponentRef } from "react";
3
- //#region src/primitives/composer/ComposerRoot.d.ts
2
+ import { type ComponentRef, type ComponentPropsWithoutRef } from "react";
4
3
  export declare namespace ComposerPrimitiveRoot {
5
- type Element = ComponentRef<typeof Primitive.form>;
6
- /**
7
- * Props for the ComposerPrimitive.Root component.
8
- * Accepts all standard form element props.
9
- */
10
- type Props = ComponentPropsWithoutRef<typeof Primitive.form> & {
4
+ type Element = ComponentRef<typeof Primitive.form>;
11
5
  /**
12
- * Opt the composer into compact mode. While the input holds at most a single
13
- * line of text and there are no attachments, quote, queued messages, or
14
- * active dictation, the root renders a `data-compact` attribute so styles
15
- * can collapse the composer into a single row. It expands automatically
16
- * when any of those conditions stop holding.
17
- * @default false
6
+ * Props for the ComposerPrimitive.Root component.
7
+ * Accepts all standard form element props.
18
8
  */
19
- compact?: boolean | undefined;
20
- };
9
+ type Props = ComponentPropsWithoutRef<typeof Primitive.form> & {
10
+ /**
11
+ * Opt the composer into compact mode. While the input holds at most a single
12
+ * line of text and there are no attachments, quote, queued messages, or
13
+ * active dictation, the root renders a `data-compact` attribute so styles
14
+ * can collapse the composer into a single row. It expands automatically
15
+ * when any of those conditions stop holding.
16
+ * @default false
17
+ */
18
+ compact?: boolean | undefined;
19
+ };
21
20
  }
22
21
  /**
23
22
  * The root form container for message composition.
@@ -40,19 +39,18 @@ export declare namespace ComposerPrimitiveRoot {
40
39
  * ```
41
40
  */
42
41
  export declare const ComposerPrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & {
43
- asChild?: boolean;
42
+ asChild?: boolean;
44
43
  }, "ref"> & {
45
- render?: import("react").ReactElement | undefined;
44
+ render?: import("react").ReactElement | undefined;
46
45
  } & import("react").RefAttributes<HTMLFormElement>, "ref"> & {
47
- /**
48
- * Opt the composer into compact mode. While the input holds at most a single
49
- * line of text and there are no attachments, quote, queued messages, or
50
- * active dictation, the root renders a `data-compact` attribute so styles
51
- * can collapse the composer into a single row. It expands automatically
52
- * when any of those conditions stop holding.
53
- * @default false
54
- */
55
- compact?: boolean | undefined;
46
+ /**
47
+ * Opt the composer into compact mode. While the input holds at most a single
48
+ * line of text and there are no attachments, quote, queued messages, or
49
+ * active dictation, the root renders a `data-compact` attribute so styles
50
+ * can collapse the composer into a single row. It expands automatically
51
+ * when any of those conditions stop holding.
52
+ * @default false
53
+ */
54
+ compact?: boolean | undefined;
56
55
  } & import("react").RefAttributes<HTMLFormElement>>;
57
- //#endregion
58
56
  //# sourceMappingURL=ComposerRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerRoot.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerRoot.tsx"],"mappings":";;;yBAwCiB;OACH,UAAU,oBAAoB,UAAU;;;;;OAKxC,QAAQ,gCAAgC,UAAU;;;;;;;;;IAS5D;;;;;;;;;;;;;;;;;;;;;;;qBAwBS,uCAAqB,0BAAA,KAAA,qBAAA,gBAAA,mCAAA,mBAAA;;;;;;;;;;;;;EAxBpB;oBAgFZ,cAAA"}
1
+ {"version":3,"file":"ComposerRoot.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerRoot.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,iCAA8B;AAClD,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,wBAAwB,EAI9B,MAAM,OAAO,CAAC;AA2Bf,yBAAiB,qBAAqB,CAAC;IACrC,KAAY,OAAO,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1D;;;OAGG;IACH,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG;QACpE;;;;;;;WAOG;QACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC/B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,qBAAqB;;;;;IAhC9B;;;;;;;OAOG;cACO,OAAO,GAAG,SAAS;mDAgF/B,CAAC"}
@@ -3,8 +3,8 @@ import { Primitive as Primitive$1 } from "../../utils/Primitive.js";
3
3
  import { useComposerSend } from "./ComposerSend.js";
4
4
  import { ComposerCompactContext } from "./ComposerCompactContext.js";
5
5
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
6
- import { useAuiState } from "@assistant-ui/store";
7
6
  import { forwardRef, useState } from "@assistant-ui/tap/react-shim";
7
+ import { useAuiState } from "@assistant-ui/store";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  import { composeEventHandlers } from "radix-ui/internal";
10
10
  //#region src/primitives/composer/ComposerRoot.tsx
@@ -1,13 +1,12 @@
1
- import { ActionButtonElement, ActionButtonProps } from "../../utils/createActionButton.js";
2
- //#region src/primitives/composer/ComposerSend.d.ts
1
+ import { type ActionButtonElement, type ActionButtonProps } from "../../utils/createActionButton.js";
3
2
  export declare const useComposerSend: () => (() => void) | null;
4
3
  export declare namespace ComposerPrimitiveSend {
5
- type Element = ActionButtonElement;
6
- /**
7
- * Props for the ComposerPrimitive.Send component.
8
- * Inherits all button element props and action button functionality.
9
- */
10
- type Props = ActionButtonProps<typeof useComposerSend>;
4
+ type Element = ActionButtonElement;
5
+ /**
6
+ * Props for the ComposerPrimitive.Send component.
7
+ * Inherits all button element props and action button functionality.
8
+ */
9
+ type Props = ActionButtonProps<typeof useComposerSend>;
11
10
  }
12
11
  /**
13
12
  * A button component that sends the current message in the composer.
@@ -24,9 +23,8 @@ export declare namespace ComposerPrimitiveSend {
24
23
  * ```
25
24
  */
26
25
  export declare const ComposerPrimitiveSend: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
27
- asChild?: boolean;
26
+ asChild?: boolean;
28
27
  }, "ref"> & {
29
- render?: import("react").ReactElement | undefined;
28
+ render?: import("react").ReactElement | undefined;
30
29
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
31
- //#endregion
32
30
  //# sourceMappingURL=ComposerSend.d.ts.map