@assistant-ui/react 0.14.18 → 0.14.19

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 (335) hide show
  1. package/dist/client/ExternalThread.d.ts +3 -2
  2. package/dist/client/ExternalThread.d.ts.map +1 -1
  3. package/dist/client/ExternalThread.js +721 -256
  4. package/dist/client/ExternalThread.js.map +1 -1
  5. package/dist/client/InMemoryThreadList.d.ts.map +1 -1
  6. package/dist/client/InMemoryThreadList.js +292 -108
  7. package/dist/client/InMemoryThreadList.js.map +1 -1
  8. package/dist/client/SingleThreadList.js +139 -53
  9. package/dist/client/SingleThreadList.js.map +1 -1
  10. package/dist/context/ReadonlyStore.js.map +1 -1
  11. package/dist/context/providers/MessageProvider.js +38 -5
  12. package/dist/context/providers/MessageProvider.js.map +1 -1
  13. package/dist/context/providers/ThreadViewportProvider.js +76 -20
  14. package/dist/context/providers/ThreadViewportProvider.js.map +1 -1
  15. package/dist/context/react/ThreadViewportContext.js.map +1 -1
  16. package/dist/context/react/utils/createContextHook.js.map +1 -1
  17. package/dist/context/react/utils/createContextStoreHook.js +17 -2
  18. package/dist/context/react/utils/createContextStoreHook.js.map +1 -1
  19. package/dist/context/react/utils/createStateHookForRuntime.js.map +1 -1
  20. package/dist/context/react/utils/ensureBinding.js.map +1 -1
  21. package/dist/context/react/utils/useRuntimeState.js +18 -2
  22. package/dist/context/react/utils/useRuntimeState.js.map +1 -1
  23. package/dist/context/stores/ThreadViewport.js.map +1 -1
  24. package/dist/devtools/DevToolsHooks.js.map +1 -1
  25. package/dist/hooks/useMessageQuote.js.map +1 -1
  26. package/dist/hooks/useMessageTiming.js +4 -1
  27. package/dist/hooks/useMessageTiming.js.map +1 -1
  28. package/dist/hooks/useToolCallElapsed.d.ts +23 -0
  29. package/dist/hooks/useToolCallElapsed.d.ts.map +1 -0
  30. package/dist/hooks/useToolCallElapsed.js +72 -0
  31. package/dist/hooks/useToolCallElapsed.js.map +1 -0
  32. package/dist/index.d.ts +4 -2
  33. package/dist/index.js +3 -1
  34. package/dist/internal.js.map +1 -1
  35. package/dist/legacy-runtime/AssistantRuntimeProvider.js +46 -10
  36. package/dist/legacy-runtime/AssistantRuntimeProvider.js.map +1 -1
  37. package/dist/legacy-runtime/cloud/auiV0.js.map +1 -1
  38. package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.js +27 -6
  39. package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.js.map +1 -1
  40. package/dist/legacy-runtime/hooks/AssistantContext.js +13 -2
  41. package/dist/legacy-runtime/hooks/AssistantContext.js.map +1 -1
  42. package/dist/legacy-runtime/hooks/AttachmentContext.js +9 -1
  43. package/dist/legacy-runtime/hooks/AttachmentContext.js.map +1 -1
  44. package/dist/legacy-runtime/hooks/ComposerContext.js +9 -1
  45. package/dist/legacy-runtime/hooks/ComposerContext.js.map +1 -1
  46. package/dist/legacy-runtime/hooks/MessageContext.js +12 -2
  47. package/dist/legacy-runtime/hooks/MessageContext.js.map +1 -1
  48. package/dist/legacy-runtime/hooks/MessagePartContext.js +9 -1
  49. package/dist/legacy-runtime/hooks/MessagePartContext.js.map +1 -1
  50. package/dist/legacy-runtime/hooks/ThreadContext.js +33 -5
  51. package/dist/legacy-runtime/hooks/ThreadContext.js.map +1 -1
  52. package/dist/legacy-runtime/hooks/ThreadListItemContext.js +9 -1
  53. package/dist/legacy-runtime/hooks/ThreadListItemContext.js.map +1 -1
  54. package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.js +3 -3
  55. package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.js.map +1 -1
  56. package/dist/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.js +71 -31
  57. package/dist/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.js.map +1 -1
  58. package/dist/legacy-runtime/runtime-cores/assistant-transport/runManager.js.map +1 -1
  59. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +24 -16
  60. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
  61. package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.js +17 -12
  62. package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.js.map +1 -1
  63. package/dist/legacy-runtime/runtime-cores/assistant-transport/useLatestRef.js +17 -3
  64. package/dist/legacy-runtime/runtime-cores/assistant-transport/useLatestRef.js.map +1 -1
  65. package/dist/mcp-apps/McpAppRenderer.js +6 -6
  66. package/dist/mcp-apps/McpAppRenderer.js.map +1 -1
  67. package/dist/mcp-apps/McpAppsRemoteHost.js +3 -3
  68. package/dist/mcp-apps/McpAppsRemoteHost.js.map +1 -1
  69. package/dist/mcp-apps/app-frame.js +33 -14
  70. package/dist/mcp-apps/app-frame.js.map +1 -1
  71. package/dist/mcp-apps/bridge.js.map +1 -1
  72. package/dist/mcp-apps/types.js.map +1 -1
  73. package/dist/mcp-apps/utils.js.map +1 -1
  74. package/dist/model-context/frame/useAssistantFrameHost.js +32 -14
  75. package/dist/model-context/frame/useAssistantFrameHost.js.map +1 -1
  76. package/dist/model-context/makeAssistantVisible.js +64 -26
  77. package/dist/model-context/makeAssistantVisible.js.map +1 -1
  78. package/dist/primitives/actionBar/ActionBarCopy.js +94 -20
  79. package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
  80. package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
  81. package/dist/primitives/actionBar/ActionBarExportMarkdown.js +105 -37
  82. package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
  83. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +60 -11
  84. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
  85. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +60 -11
  86. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
  87. package/dist/primitives/actionBar/ActionBarInteractionContext.js +3 -1
  88. package/dist/primitives/actionBar/ActionBarInteractionContext.js.map +1 -1
  89. package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
  90. package/dist/primitives/actionBar/ActionBarRoot.js +84 -25
  91. package/dist/primitives/actionBar/ActionBarRoot.js.map +1 -1
  92. package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
  93. package/dist/primitives/actionBar/ActionBarStopSpeaking.js +45 -14
  94. package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
  95. package/dist/primitives/actionBar/useActionBarFloatStatus.js +22 -10
  96. package/dist/primitives/actionBar/useActionBarFloatStatus.js.map +1 -1
  97. package/dist/primitives/actionBar.js.map +1 -1
  98. package/dist/primitives/actionBarMore/ActionBarMoreContent.js +44 -7
  99. package/dist/primitives/actionBarMore/ActionBarMoreContent.js.map +1 -1
  100. package/dist/primitives/actionBarMore/ActionBarMoreItem.js +28 -6
  101. package/dist/primitives/actionBarMore/ActionBarMoreItem.js.map +1 -1
  102. package/dist/primitives/actionBarMore/ActionBarMoreRoot.js +103 -36
  103. package/dist/primitives/actionBarMore/ActionBarMoreRoot.js.map +1 -1
  104. package/dist/primitives/actionBarMore/ActionBarMoreSeparator.js +28 -6
  105. package/dist/primitives/actionBarMore/ActionBarMoreSeparator.js.map +1 -1
  106. package/dist/primitives/actionBarMore/ActionBarMoreTrigger.js +28 -6
  107. package/dist/primitives/actionBarMore/ActionBarMoreTrigger.js.map +1 -1
  108. package/dist/primitives/actionBarMore/scope.js.map +1 -1
  109. package/dist/primitives/actionBarMore.js.map +1 -1
  110. package/dist/primitives/assistantModal/AssistantModalAnchor.js +27 -6
  111. package/dist/primitives/assistantModal/AssistantModalAnchor.js.map +1 -1
  112. package/dist/primitives/assistantModal/AssistantModalContent.js +71 -10
  113. package/dist/primitives/assistantModal/AssistantModalContent.js.map +1 -1
  114. package/dist/primitives/assistantModal/AssistantModalRoot.js +93 -26
  115. package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
  116. package/dist/primitives/assistantModal/AssistantModalTrigger.js +27 -6
  117. package/dist/primitives/assistantModal/AssistantModalTrigger.js.map +1 -1
  118. package/dist/primitives/assistantModal/scope.js.map +1 -1
  119. package/dist/primitives/assistantModal.js.map +1 -1
  120. package/dist/primitives/attachment/AttachmentName.js +13 -1
  121. package/dist/primitives/attachment/AttachmentName.js.map +1 -1
  122. package/dist/primitives/attachment/AttachmentRemove.js +11 -4
  123. package/dist/primitives/attachment/AttachmentRemove.js.map +1 -1
  124. package/dist/primitives/attachment/AttachmentRoot.js +13 -4
  125. package/dist/primitives/attachment/AttachmentRoot.js.map +1 -1
  126. package/dist/primitives/attachment/AttachmentThumb.js +20 -9
  127. package/dist/primitives/attachment/AttachmentThumb.js.map +1 -1
  128. package/dist/primitives/attachment.js.map +1 -1
  129. package/dist/primitives/branchPicker/BranchPickerCount.js +14 -2
  130. package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
  131. package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
  132. package/dist/primitives/branchPicker/BranchPickerNumber.js +14 -2
  133. package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
  134. package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
  135. package/dist/primitives/branchPicker/BranchPickerRoot.js +34 -6
  136. package/dist/primitives/branchPicker/BranchPickerRoot.js.map +1 -1
  137. package/dist/primitives/branchPicker.js.map +1 -1
  138. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js +16 -5
  139. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js.map +1 -1
  140. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.js +13 -4
  141. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.js.map +1 -1
  142. package/dist/primitives/chainOfThought.js.map +1 -1
  143. package/dist/primitives/composer/ComposerAddAttachment.js +37 -24
  144. package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
  145. package/dist/primitives/composer/ComposerAttachmentDropzone.js +124 -49
  146. package/dist/primitives/composer/ComposerAttachmentDropzone.js.map +1 -1
  147. package/dist/primitives/composer/ComposerCancel.js.map +1 -1
  148. package/dist/primitives/composer/ComposerDictate.js.map +1 -1
  149. package/dist/primitives/composer/ComposerDictationTranscript.js +32 -7
  150. package/dist/primitives/composer/ComposerDictationTranscript.js.map +1 -1
  151. package/dist/primitives/composer/ComposerInput.js +26 -26
  152. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  153. package/dist/primitives/composer/ComposerInputPluginContext.js +71 -25
  154. package/dist/primitives/composer/ComposerInputPluginContext.js.map +1 -1
  155. package/dist/primitives/composer/ComposerQuote.js +92 -23
  156. package/dist/primitives/composer/ComposerQuote.js.map +1 -1
  157. package/dist/primitives/composer/ComposerRoot.js +45 -11
  158. package/dist/primitives/composer/ComposerRoot.js.map +1 -1
  159. package/dist/primitives/composer/ComposerSend.js +9 -2
  160. package/dist/primitives/composer/ComposerSend.js.map +1 -1
  161. package/dist/primitives/composer/ComposerStopDictation.js +15 -5
  162. package/dist/primitives/composer/ComposerStopDictation.js.map +1 -1
  163. package/dist/primitives/composer/trigger/TriggerPopover.d.ts.map +1 -1
  164. package/dist/primitives/composer/trigger/TriggerPopover.js +215 -75
  165. package/dist/primitives/composer/trigger/TriggerPopover.js.map +1 -1
  166. package/dist/primitives/composer/trigger/TriggerPopoverAction.js.map +1 -1
  167. package/dist/primitives/composer/trigger/TriggerPopoverBack.js +35 -7
  168. package/dist/primitives/composer/trigger/TriggerPopoverBack.js.map +1 -1
  169. package/dist/primitives/composer/trigger/TriggerPopoverCategories.js +134 -28
  170. package/dist/primitives/composer/trigger/TriggerPopoverCategories.js.map +1 -1
  171. package/dist/primitives/composer/trigger/TriggerPopoverDirective.js.map +1 -1
  172. package/dist/primitives/composer/trigger/TriggerPopoverItems.js +132 -28
  173. package/dist/primitives/composer/trigger/TriggerPopoverItems.js.map +1 -1
  174. package/dist/primitives/composer/trigger/TriggerPopoverResource.js +124 -52
  175. package/dist/primitives/composer/trigger/TriggerPopoverResource.js.map +1 -1
  176. package/dist/primitives/composer/trigger/TriggerPopoverRootContext.js +181 -78
  177. package/dist/primitives/composer/trigger/TriggerPopoverRootContext.js.map +1 -1
  178. package/dist/primitives/composer/trigger/detectTrigger.js.map +1 -1
  179. package/dist/primitives/composer/trigger/index.js.map +1 -1
  180. package/dist/primitives/composer/trigger/triggerDetectionResource.js +28 -14
  181. package/dist/primitives/composer/trigger/triggerDetectionResource.js.map +1 -1
  182. package/dist/primitives/composer/trigger/triggerKeyboardResource.js +115 -58
  183. package/dist/primitives/composer/trigger/triggerKeyboardResource.js.map +1 -1
  184. package/dist/primitives/composer/trigger/triggerNavigationResource.js +202 -70
  185. package/dist/primitives/composer/trigger/triggerNavigationResource.js.map +1 -1
  186. package/dist/primitives/composer/trigger/triggerSelectionResource.js +49 -13
  187. package/dist/primitives/composer/trigger/triggerSelectionResource.js.map +1 -1
  188. package/dist/primitives/composer.js.map +1 -1
  189. package/dist/primitives/dropdownMenuRenderPrimitives.js.map +1 -1
  190. package/dist/primitives/error/ErrorMessage.js +28 -6
  191. package/dist/primitives/error/ErrorMessage.js.map +1 -1
  192. package/dist/primitives/error/ErrorRoot.js +14 -5
  193. package/dist/primitives/error/ErrorRoot.js.map +1 -1
  194. package/dist/primitives/error.js.map +1 -1
  195. package/dist/primitives/message/MessageError.js +2 -1
  196. package/dist/primitives/message/MessageError.js.map +1 -1
  197. package/dist/primitives/message/MessageIf.js +50 -20
  198. package/dist/primitives/message/MessageIf.js.map +1 -1
  199. package/dist/primitives/message/MessageParts.js +41 -7
  200. package/dist/primitives/message/MessageParts.js.map +1 -1
  201. package/dist/primitives/message/MessagePartsGrouped.js +399 -94
  202. package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
  203. package/dist/primitives/message/MessageRoot.js +197 -65
  204. package/dist/primitives/message/MessageRoot.js.map +1 -1
  205. package/dist/primitives/message.js.map +1 -1
  206. package/dist/primitives/messagePart/MessagePartImage.js +15 -5
  207. package/dist/primitives/messagePart/MessagePartImage.js.map +1 -1
  208. package/dist/primitives/messagePart/MessagePartText.js +35 -7
  209. package/dist/primitives/messagePart/MessagePartText.js.map +1 -1
  210. package/dist/primitives/messagePart/useMessagePartData.js +5 -4
  211. package/dist/primitives/messagePart/useMessagePartData.js.map +1 -1
  212. package/dist/primitives/messagePart/useMessagePartFile.js +5 -4
  213. package/dist/primitives/messagePart/useMessagePartFile.js.map +1 -1
  214. package/dist/primitives/messagePart/useMessagePartImage.js +5 -4
  215. package/dist/primitives/messagePart/useMessagePartImage.js.map +1 -1
  216. package/dist/primitives/messagePart/useMessagePartReasoning.js +5 -4
  217. package/dist/primitives/messagePart/useMessagePartReasoning.js.map +1 -1
  218. package/dist/primitives/messagePart/useMessagePartSource.js +5 -4
  219. package/dist/primitives/messagePart/useMessagePartSource.js.map +1 -1
  220. package/dist/primitives/messagePart/useMessagePartText.js +5 -4
  221. package/dist/primitives/messagePart/useMessagePartText.js.map +1 -1
  222. package/dist/primitives/messagePart.js.map +1 -1
  223. package/dist/primitives/queueItem/QueueItemRemove.js +11 -4
  224. package/dist/primitives/queueItem/QueueItemRemove.js.map +1 -1
  225. package/dist/primitives/queueItem/QueueItemSteer.js +11 -4
  226. package/dist/primitives/queueItem/QueueItemSteer.js.map +1 -1
  227. package/dist/primitives/queueItem/QueueItemText.js +20 -6
  228. package/dist/primitives/queueItem/QueueItemText.js.map +1 -1
  229. package/dist/primitives/queueItem.js.map +1 -1
  230. package/dist/primitives/reasoning/useScrollLock.js +61 -43
  231. package/dist/primitives/reasoning/useScrollLock.js.map +1 -1
  232. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js +56 -16
  233. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js.map +1 -1
  234. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js +120 -59
  235. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js.map +1 -1
  236. package/dist/primitives/selectionToolbar.js.map +1 -1
  237. package/dist/primitives/suggestion/SuggestionDescription.js +20 -6
  238. package/dist/primitives/suggestion/SuggestionDescription.js.map +1 -1
  239. package/dist/primitives/suggestion/SuggestionTitle.js +20 -6
  240. package/dist/primitives/suggestion/SuggestionTitle.js.map +1 -1
  241. package/dist/primitives/suggestion/SuggestionTrigger.js +39 -26
  242. package/dist/primitives/suggestion/SuggestionTrigger.js.map +1 -1
  243. package/dist/primitives/suggestion.js.map +1 -1
  244. package/dist/primitives/thread/ThreadEmpty.js +6 -2
  245. package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
  246. package/dist/primitives/thread/ThreadIf.js +32 -10
  247. package/dist/primitives/thread/ThreadIf.js.map +1 -1
  248. package/dist/primitives/thread/ThreadRoot.js +13 -4
  249. package/dist/primitives/thread/ThreadRoot.js.map +1 -1
  250. package/dist/primitives/thread/ThreadScrollToBottom.js +24 -6
  251. package/dist/primitives/thread/ThreadScrollToBottom.js.map +1 -1
  252. package/dist/primitives/thread/ThreadSuggestion.js +18 -6
  253. package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
  254. package/dist/primitives/thread/ThreadViewport.js +185 -47
  255. package/dist/primitives/thread/ThreadViewport.js.map +1 -1
  256. package/dist/primitives/thread/ThreadViewportFooter.js +22 -9
  257. package/dist/primitives/thread/ThreadViewportFooter.js.map +1 -1
  258. package/dist/primitives/thread/topAnchor/computeTopAnchorSlack.js.map +1 -1
  259. package/dist/primitives/thread/topAnchor/createReserveObservers.js.map +1 -1
  260. package/dist/primitives/thread/topAnchor/mountTopAnchorReserve.js.map +1 -1
  261. package/dist/primitives/thread/topAnchor/topAnchorTurn.js.map +1 -1
  262. package/dist/primitives/thread/topAnchor/topAnchorUtils.js.map +1 -1
  263. package/dist/primitives/thread/topAnchor/useTopAnchorReserve.js +19 -4
  264. package/dist/primitives/thread/topAnchor/useTopAnchorReserve.js.map +1 -1
  265. package/dist/primitives/thread/useThreadViewportAutoScroll.js +16 -16
  266. package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
  267. package/dist/primitives/thread.js.map +1 -1
  268. package/dist/primitives/threadList/ThreadListLoadMore.js.map +1 -1
  269. package/dist/primitives/threadList/ThreadListNew.js +53 -11
  270. package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
  271. package/dist/primitives/threadList/ThreadListRoot.js +13 -4
  272. package/dist/primitives/threadList/ThreadListRoot.js.map +1 -1
  273. package/dist/primitives/threadList.js.map +1 -1
  274. package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
  275. package/dist/primitives/threadListItem/ThreadListItemDelete.js.map +1 -1
  276. package/dist/primitives/threadListItem/ThreadListItemRoot.js +26 -7
  277. package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
  278. package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -1
  279. package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -1
  280. package/dist/primitives/threadListItem.js.map +1 -1
  281. package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js +44 -7
  282. package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js.map +1 -1
  283. package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.js +28 -6
  284. package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.js.map +1 -1
  285. package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js +25 -5
  286. package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js.map +1 -1
  287. package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.js +28 -6
  288. package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.js.map +1 -1
  289. package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js +28 -6
  290. package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js.map +1 -1
  291. package/dist/primitives/threadListItemMore/scope.js.map +1 -1
  292. package/dist/primitives/threadListItemMore.js.map +1 -1
  293. package/dist/sandbox-host/SandboxHost.js.map +1 -1
  294. package/dist/tests/remote-thread-list-test-helpers.js.map +1 -1
  295. package/dist/tests/setup.js.map +1 -1
  296. package/dist/unstable/useComposerInputHistory.js.map +1 -1
  297. package/dist/unstable/useMentionAdapter.js.map +1 -1
  298. package/dist/unstable/useMessageStallDetection.d.ts +29 -0
  299. package/dist/unstable/useMessageStallDetection.d.ts.map +1 -0
  300. package/dist/unstable/useMessageStallDetection.js +69 -0
  301. package/dist/unstable/useMessageStallDetection.js.map +1 -0
  302. package/dist/unstable/useSlashCommandAdapter.js.map +1 -1
  303. package/dist/utils/Primitive.js +57 -12
  304. package/dist/utils/Primitive.js.map +1 -1
  305. package/dist/utils/createActionButton.js +23 -7
  306. package/dist/utils/createActionButton.js.map +1 -1
  307. package/dist/utils/getSelectionMessageId.js.map +1 -1
  308. package/dist/utils/hooks/useManagedRef.js +16 -8
  309. package/dist/utils/hooks/useManagedRef.js.map +1 -1
  310. package/dist/utils/hooks/useMediaQuery.js +25 -10
  311. package/dist/utils/hooks/useMediaQuery.js.map +1 -1
  312. package/dist/utils/hooks/useOnResizeContent.js +29 -19
  313. package/dist/utils/hooks/useOnResizeContent.js.map +1 -1
  314. package/dist/utils/hooks/useOnScrollToBottom.js +20 -4
  315. package/dist/utils/hooks/useOnScrollToBottom.js.map +1 -1
  316. package/dist/utils/hooks/useSizeHandle.js +23 -15
  317. package/dist/utils/hooks/useSizeHandle.js.map +1 -1
  318. package/dist/utils/json/is-json-equal.js.map +1 -1
  319. package/dist/utils/json/is-json.js.map +1 -1
  320. package/dist/utils/smooth/SmoothContext.js +41 -11
  321. package/dist/utils/smooth/SmoothContext.js.map +1 -1
  322. package/dist/utils/smooth/useSmooth.js +5 -5
  323. package/dist/utils/smooth/useSmooth.js.map +1 -1
  324. package/dist/utils/useToolArgsFieldStatus.d.ts +2 -2
  325. package/dist/utils/useToolArgsFieldStatus.d.ts.map +1 -1
  326. package/dist/utils/useToolArgsFieldStatus.js +13 -5
  327. package/dist/utils/useToolArgsFieldStatus.js.map +1 -1
  328. package/package.json +6 -6
  329. package/src/client/ExternalThread.ts +81 -52
  330. package/src/client/InMemoryThreadList.ts +12 -14
  331. package/src/hooks/useToolCallElapsed.ts +52 -0
  332. package/src/index.ts +11 -0
  333. package/src/primitives/composer/trigger/TriggerPopover.tsx +4 -5
  334. package/src/tests/toolCallTiming.test.tsx +221 -0
  335. package/src/unstable/useMessageStallDetection.ts +91 -0
@@ -1 +1 @@
1
- {"version":3,"file":"BranchPickerNext.js","names":["useBranchPickerNext","useBranchPickerNextBehavior"],"sources":["../../../src/primitives/branchPicker/BranchPickerNext.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useBranchPickerNext as useBranchPickerNextBehavior } from \"@assistant-ui/core/react\";\n\nconst useBranchPickerNext = () => {\n const { disabled, next } = useBranchPickerNextBehavior();\n if (disabled) return null;\n return next;\n};\n\nexport namespace BranchPickerPrimitiveNext {\n export type Element = ActionButtonElement;\n /**\n * Props for the BranchPickerPrimitive.Next component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useBranchPickerNext>;\n}\n\n/**\n * A button component that navigates to the next branch in the message tree.\n *\n * This component automatically handles switching to the next available branch\n * and is disabled when there are no more branches to navigate to.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Next>\n * Next →\n * </BranchPickerPrimitive.Next>\n * ```\n */\nexport const BranchPickerPrimitiveNext = createActionButton(\n \"BranchPickerPrimitive.Next\",\n useBranchPickerNext,\n);\n"],"mappings":";;;;AASA,MAAMA,8BAA4B;CAChC,MAAM,EAAE,UAAU,SAASC,oBAA4B;CACvD,IAAI,UAAU,OAAO;CACrB,OAAO;AACT;;;;;;;;;;;;;;AAwBA,MAAa,4BAA4B,mBACvC,8BACAD,qBACF"}
1
+ {"version":3,"file":"BranchPickerNext.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useBranchPickerNext","useBranchPickerNextBehavior","disabled","next","BranchPickerPrimitiveNext","Element","Props"],"sources":["../../../src/primitives/branchPicker/BranchPickerNext.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useBranchPickerNext as useBranchPickerNextBehavior } from \"@assistant-ui/core/react\";\n\nconst useBranchPickerNext = () => {\n const { disabled, next } = useBranchPickerNextBehavior();\n if (disabled) return null;\n return next;\n};\n\nexport namespace BranchPickerPrimitiveNext {\n export type Element = ActionButtonElement;\n /**\n * Props for the BranchPickerPrimitive.Next component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useBranchPickerNext>;\n}\n\n/**\n * A button component that navigates to the next branch in the message tree.\n *\n * This component automatically handles switching to the next available branch\n * and is disabled when there are no more branches to navigate to.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Next>\n * Next →\n * </BranchPickerPrimitive.Next>\n * ```\n */\nexport const BranchPickerPrimitiveNext = createActionButton(\n \"BranchPickerPrimitive.Next\",\n useBranchPickerNext,\n);\n"],"mappings":";;;;AASA,MAAMG,8BAAsB;CAC1B,MAAA,EAAAE,UAAAC,SAA2BF,oBAA4B;CACvD,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAI;;;;;;;;;;;;;;AAyBb,MAAaC,4BAA4BL,mBACvC,8BACAC,qBACF"}
@@ -1,14 +1,26 @@
1
1
  "use client";
2
2
  import { useAuiState } from "@assistant-ui/store";
3
+ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
4
  import { Fragment, jsx } from "react/jsx-runtime";
4
5
  //#region src/primitives/branchPicker/BranchPickerNumber.tsx
5
6
  const useBranchPickerNumber = () => {
6
- return useAuiState((s) => s.message.branchNumber);
7
+ return useAuiState(_temp);
7
8
  };
8
9
  const BranchPickerPrimitiveNumber = () => {
9
- return /* @__PURE__ */ jsx(Fragment, { children: useBranchPickerNumber() });
10
+ const $ = c(2);
11
+ const branchNumber = useBranchPickerNumber();
12
+ let t0;
13
+ if ($[0] !== branchNumber) {
14
+ t0 = /* @__PURE__ */ jsx(Fragment, { children: branchNumber });
15
+ $[0] = branchNumber;
16
+ $[1] = t0;
17
+ } else t0 = $[1];
18
+ return t0;
10
19
  };
11
20
  BranchPickerPrimitiveNumber.displayName = "BranchPickerPrimitive.Number";
21
+ function _temp(s) {
22
+ return s.message.branchNumber;
23
+ }
12
24
  //#endregion
13
25
  export { BranchPickerPrimitiveNumber };
14
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"BranchPickerNumber.js","names":[],"sources":["../../../src/primitives/branchPicker/BranchPickerNumber.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nconst useBranchPickerNumber = () => {\n const branchNumber = useAuiState((s) => s.message.branchNumber);\n return branchNumber;\n};\n\nexport namespace BranchPickerPrimitiveNumber {\n export type Props = Record<string, never>;\n}\n\nexport const BranchPickerPrimitiveNumber: FC<\n BranchPickerPrimitiveNumber.Props\n> = () => {\n const branchNumber = useBranchPickerNumber();\n return <>{branchNumber}</>;\n};\n\nBranchPickerPrimitiveNumber.displayName = \"BranchPickerPrimitive.Number\";\n"],"mappings":";;;;AAKA,MAAM,8BAA8B;CAElC,OADqB,aAAa,MAAM,EAAE,QAAQ,YAChC;AACpB;AAMA,MAAa,oCAEH;CAER,OAAO,oBAAA,UAAA,EAAA,UADc,sBACA,EAAI,CAAA;AAC3B;AAEA,4BAA4B,cAAc"}
1
+ {"version":3,"file":"BranchPickerNumber.js","names":["c","_c","FC","useAuiState","useBranchPickerNumber","branchNumber","_temp","BranchPickerPrimitiveNumber","Props","Record","$","t0","displayName","s","message"],"sources":["../../../src/primitives/branchPicker/BranchPickerNumber.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nconst useBranchPickerNumber = () => {\n const branchNumber = useAuiState((s) => s.message.branchNumber);\n return branchNumber;\n};\n\nexport namespace BranchPickerPrimitiveNumber {\n export type Props = Record<string, never>;\n}\n\nexport const BranchPickerPrimitiveNumber: FC<\n BranchPickerPrimitiveNumber.Props\n> = () => {\n const branchNumber = useBranchPickerNumber();\n return <>{branchNumber}</>;\n};\n\nBranchPickerPrimitiveNumber.displayName = \"BranchPickerPrimitive.Number\";\n"],"mappings":";;;;;AAKA,MAAMI,8BAAwB;CACoC,OAA3CD,YAAYG,KAC1BD;AAAY;AAOrB,MAAaE,oCAET;CAAA,MAAAG,IAAAT,EAAA,CAAA;CACF,MAAAI,eAAqBD,sBAAsB;CAAE,IAAAO;CAAA,IAAAD,EAAA,OAAAL,cAAA;EACtCM,KAAA,oBAAA,UAAA,EAAA,UAAGN,aAAY,CAAA;EAAIK,EAAA,KAAAL;EAAAK,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAAnBC;AAAmB;AAG5BJ,4BAA4BK,cAAc;AAhBZ,SAAAN,MAAAO,GAAA;CAAA,OACYA,EAACC,QAAQT;AAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"BranchPickerPrevious.js","names":["useBranchPickerPrevious","useBranchPickerPreviousBehavior"],"sources":["../../../src/primitives/branchPicker/BranchPickerPrevious.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useBranchPickerPrevious as useBranchPickerPreviousBehavior } from \"@assistant-ui/core/react\";\n\nconst useBranchPickerPrevious = () => {\n const { disabled, previous } = useBranchPickerPreviousBehavior();\n if (disabled) return null;\n return previous;\n};\n\nexport namespace BranchPickerPrimitivePrevious {\n export type Element = ActionButtonElement;\n /**\n * Props for the BranchPickerPrimitive.Previous component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useBranchPickerPrevious>;\n}\n\n/**\n * A button component that navigates to the previous branch in the message tree.\n *\n * This component automatically handles switching to the previous available branch\n * and is disabled when there are no previous branches to navigate to.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Previous>\n * ← Previous\n * </BranchPickerPrimitive.Previous>\n * ```\n */\nexport const BranchPickerPrimitivePrevious = createActionButton(\n \"BranchPickerPrimitive.Previous\",\n useBranchPickerPrevious,\n);\n"],"mappings":";;;;AASA,MAAMA,kCAAgC;CACpC,MAAM,EAAE,UAAU,aAAaC,wBAAgC;CAC/D,IAAI,UAAU,OAAO;CACrB,OAAO;AACT;;;;;;;;;;;;;;AAwBA,MAAa,gCAAgC,mBAC3C,kCACAD,yBACF"}
1
+ {"version":3,"file":"BranchPickerPrevious.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useBranchPickerPrevious","useBranchPickerPreviousBehavior","disabled","previous","BranchPickerPrimitivePrevious","Element","Props"],"sources":["../../../src/primitives/branchPicker/BranchPickerPrevious.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useBranchPickerPrevious as useBranchPickerPreviousBehavior } from \"@assistant-ui/core/react\";\n\nconst useBranchPickerPrevious = () => {\n const { disabled, previous } = useBranchPickerPreviousBehavior();\n if (disabled) return null;\n return previous;\n};\n\nexport namespace BranchPickerPrimitivePrevious {\n export type Element = ActionButtonElement;\n /**\n * Props for the BranchPickerPrimitive.Previous component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useBranchPickerPrevious>;\n}\n\n/**\n * A button component that navigates to the previous branch in the message tree.\n *\n * This component automatically handles switching to the previous available branch\n * and is disabled when there are no previous branches to navigate to.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Previous>\n * ← Previous\n * </BranchPickerPrimitive.Previous>\n * ```\n */\nexport const BranchPickerPrimitivePrevious = createActionButton(\n \"BranchPickerPrimitive.Previous\",\n useBranchPickerPrevious,\n);\n"],"mappings":";;;;AASA,MAAMG,kCAA0B;CAC9B,MAAA,EAAAE,UAAAC,aAA+BF,wBAAgC;CAC/D,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAQ;;;;;;;;;;;;;;AAyBjB,MAAaC,gCAAgCL,mBAC3C,kCACAC,yBACF"}
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
3
  import { MessagePrimitiveIf } from "../message/MessageIf.js";
4
+ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
5
  import { forwardRef } from "@assistant-ui/tap/react-shim";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  //#region src/primitives/branchPicker/BranchPickerRoot.tsx
@@ -21,14 +22,41 @@ import { jsx } from "react/jsx-runtime";
21
22
  * </BranchPickerPrimitive.Root>
22
23
  * ```
23
24
  */
24
- const BranchPickerPrimitiveRoot = forwardRef(({ hideWhenSingleBranch, ...rest }, ref) => {
25
- return /* @__PURE__ */ jsx(MessagePrimitiveIf, {
26
- hasBranches: hideWhenSingleBranch ? true : void 0,
27
- children: /* @__PURE__ */ jsx(Primitive.div, {
25
+ const BranchPickerPrimitiveRoot = forwardRef((t0, ref) => {
26
+ const $ = c(9);
27
+ let hideWhenSingleBranch;
28
+ let rest;
29
+ if ($[0] !== t0) {
30
+ ({hideWhenSingleBranch, ...rest} = t0);
31
+ $[0] = t0;
32
+ $[1] = hideWhenSingleBranch;
33
+ $[2] = rest;
34
+ } else {
35
+ hideWhenSingleBranch = $[1];
36
+ rest = $[2];
37
+ }
38
+ const t1 = hideWhenSingleBranch ? true : void 0;
39
+ let t2;
40
+ if ($[3] !== ref || $[4] !== rest) {
41
+ t2 = /* @__PURE__ */ jsx(Primitive.div, {
28
42
  ...rest,
29
43
  ref
30
- })
31
- });
44
+ });
45
+ $[3] = ref;
46
+ $[4] = rest;
47
+ $[5] = t2;
48
+ } else t2 = $[5];
49
+ let t3;
50
+ if ($[6] !== t1 || $[7] !== t2) {
51
+ t3 = /* @__PURE__ */ jsx(MessagePrimitiveIf, {
52
+ hasBranches: t1,
53
+ children: t2
54
+ });
55
+ $[6] = t1;
56
+ $[7] = t2;
57
+ $[8] = t3;
58
+ } else t3 = $[8];
59
+ return t3;
32
60
  });
33
61
  BranchPickerPrimitiveRoot.displayName = "BranchPickerPrimitive.Root";
34
62
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"BranchPickerRoot.js","names":["If"],"sources":["../../../src/primitives/branchPicker/BranchPickerRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n} from \"react\";\nimport { MessagePrimitiveIf as If } from \"../message/MessageIf\";\n\nexport namespace BranchPickerPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n /**\n * Whether to hide the branch picker when there's only one branch available.\n * When true, the component will only render when multiple branches exist.\n * @default false\n */\n hideWhenSingleBranch?: boolean | undefined;\n };\n}\n\n/**\n * The root container for branch picker components.\n *\n * This component provides a container for branch navigation controls,\n * with optional conditional rendering based on the number of available branches.\n * It integrates with the message branching system to allow users to navigate\n * between different response variations.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Root hideWhenSingleBranch={true}>\n * <BranchPickerPrimitive.Previous />\n * <BranchPickerPrimitive.Count />\n * <BranchPickerPrimitive.Next />\n * </BranchPickerPrimitive.Root>\n * ```\n */\nexport const BranchPickerPrimitiveRoot = forwardRef<\n BranchPickerPrimitiveRoot.Element,\n BranchPickerPrimitiveRoot.Props\n>(({ hideWhenSingleBranch, ...rest }, ref) => {\n return (\n <If hasBranches={hideWhenSingleBranch ? true : undefined}>\n <Primitive.div {...rest} ref={ref} />\n </If>\n );\n});\n\nBranchPickerPrimitiveRoot.displayName = \"BranchPickerPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAa,4BAA4B,YAGtC,EAAE,sBAAsB,GAAG,QAAQ,QAAQ;CAC5C,OACE,oBAACA,oBAAD;EAAI,aAAa,uBAAuB,OAAO,KAAA;YAC7C,oBAAC,UAAU,KAAX;GAAe,GAAI;GAAW;EAAM,CAAA;CAClC,CAAA;AAER,CAAC;AAED,0BAA0B,cAAc"}
1
+ {"version":3,"file":"BranchPickerRoot.js","names":["c","_c","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","MessagePrimitiveIf","If","BranchPickerPrimitiveRoot","Element","div","Props","hideWhenSingleBranch","t0","ref","$","rest","t1","undefined","t2","t3","displayName"],"sources":["../../../src/primitives/branchPicker/BranchPickerRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n} from \"react\";\nimport { MessagePrimitiveIf as If } from \"../message/MessageIf\";\n\nexport namespace BranchPickerPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n /**\n * Whether to hide the branch picker when there's only one branch available.\n * When true, the component will only render when multiple branches exist.\n * @default false\n */\n hideWhenSingleBranch?: boolean | undefined;\n };\n}\n\n/**\n * The root container for branch picker components.\n *\n * This component provides a container for branch navigation controls,\n * with optional conditional rendering based on the number of available branches.\n * It integrates with the message branching system to allow users to navigate\n * between different response variations.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Root hideWhenSingleBranch={true}>\n * <BranchPickerPrimitive.Previous />\n * <BranchPickerPrimitive.Count />\n * <BranchPickerPrimitive.Next />\n * </BranchPickerPrimitive.Root>\n * ```\n */\nexport const BranchPickerPrimitiveRoot = forwardRef<\n BranchPickerPrimitiveRoot.Element,\n BranchPickerPrimitiveRoot.Props\n>(({ hideWhenSingleBranch, ...rest }, ref) => {\n return (\n <If hasBranches={hideWhenSingleBranch ? true : undefined}>\n <Primitive.div {...rest} ref={ref} />\n </If>\n );\n});\n\nBranchPickerPrimitiveRoot.displayName = \"BranchPickerPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAaQ,4BAA4BJ,YAGvCS,IAAAC,QAAA;CAAA,MAAAC,IAAAd,EAAA,CAAA;CAAA,IAAAW;CAAA,IAAAI;CAAA,IAAAD,EAAA,OAAAF,IAAA;EAAC,CAAA,CAAAD,yBAAAI,QAAAH;EAAiCE,EAAA,KAAAF;EAAAE,EAAA,KAAAH;EAAAG,EAAA,KAAAC;CAAA,OAAA;EAAAJ,uBAAAG,EAAA;EAAAC,OAAAD,EAAA;CAAA;CAEf,MAAAE,KAAAL,uBAAA,OAAAM,KAAAA;CAAuC,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAC,MAAA;EACtDG,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBH;GAAWF;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAE,MAAAF,EAAA,OAAAI,IAAA;EADvCC,KAAA,oBAAC,oBAAD;GAAiB,aAAAH;aACfE;EADC,CAAA;EAEEJ,EAAA,KAAAE;EAAAF,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFLK;AAEK,CAER;AAEDZ,0BAA0Ba,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"branchPicker.js","names":[],"sources":["../../src/primitives/branchPicker.ts"],"sourcesContent":["export { BranchPickerPrimitiveNext as Next } from \"./branchPicker/BranchPickerNext\";\nexport { BranchPickerPrimitivePrevious as Previous } from \"./branchPicker/BranchPickerPrevious\";\nexport { BranchPickerPrimitiveCount as Count } from \"./branchPicker/BranchPickerCount\";\nexport { BranchPickerPrimitiveNumber as Number } from \"./branchPicker/BranchPickerNumber\";\nexport { BranchPickerPrimitiveRoot as Root } from \"./branchPicker/BranchPickerRoot\";\n"],"mappings":""}
1
+ {"version":3,"file":"branchPicker.js","names":["BranchPickerPrimitiveNext","Next","BranchPickerPrimitivePrevious","Previous","BranchPickerPrimitiveCount","Count","BranchPickerPrimitiveNumber","Number","BranchPickerPrimitiveRoot","Root"],"sources":["../../src/primitives/branchPicker.ts"],"sourcesContent":["export { BranchPickerPrimitiveNext as Next } from \"./branchPicker/BranchPickerNext\";\nexport { BranchPickerPrimitivePrevious as Previous } from \"./branchPicker/BranchPickerPrevious\";\nexport { BranchPickerPrimitiveCount as Count } from \"./branchPicker/BranchPickerCount\";\nexport { BranchPickerPrimitiveNumber as Number } from \"./branchPicker/BranchPickerNumber\";\nexport { BranchPickerPrimitiveRoot as Root } from \"./branchPicker/BranchPickerRoot\";\n"],"mappings":""}
@@ -1,14 +1,22 @@
1
1
  "use client";
2
2
  import { createActionButton } from "../../utils/createActionButton.js";
3
3
  import { useAui, useAuiState } from "@assistant-ui/store";
4
- import { useCallback } from "@assistant-ui/tap/react-shim";
4
+ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
5
5
  //#region src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.ts
6
6
  const useChainOfThoughtAccordionTrigger = () => {
7
+ const $ = c(3);
7
8
  const aui = useAui();
8
- const collapsed = useAuiState((s) => s.chainOfThought.collapsed);
9
- return useCallback(() => {
10
- aui.chainOfThought().setCollapsed(!collapsed);
11
- }, [aui, collapsed]);
9
+ const collapsed = useAuiState(_temp);
10
+ let t0;
11
+ if ($[0] !== aui || $[1] !== collapsed) {
12
+ t0 = () => {
13
+ aui.chainOfThought().setCollapsed(!collapsed);
14
+ };
15
+ $[0] = aui;
16
+ $[1] = collapsed;
17
+ $[2] = t0;
18
+ } else t0 = $[2];
19
+ return t0;
12
20
  };
13
21
  /**
14
22
  * A button component that toggles the collapsed state of the chain of thought accordion.
@@ -24,6 +32,9 @@ const useChainOfThoughtAccordionTrigger = () => {
24
32
  * ```
25
33
  */
26
34
  const ChainOfThoughtPrimitiveAccordionTrigger = createActionButton("ChainOfThoughtPrimitive.AccordionTrigger", useChainOfThoughtAccordionTrigger);
35
+ function _temp(s) {
36
+ return s.chainOfThought.collapsed;
37
+ }
27
38
  //#endregion
28
39
  export { ChainOfThoughtPrimitiveAccordionTrigger };
29
40
 
@@ -1 +1 @@
1
- {"version":3,"file":"ChainOfThoughtAccordionTrigger.js","names":[],"sources":["../../../src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAuiState, useAui } from \"@assistant-ui/store\";\n\nconst useChainOfThoughtAccordionTrigger = () => {\n const aui = useAui();\n const collapsed = useAuiState((s) => s.chainOfThought.collapsed);\n\n const callback = useCallback(() => {\n aui.chainOfThought().setCollapsed(!collapsed);\n }, [aui, collapsed]);\n\n return callback;\n};\n\nexport namespace ChainOfThoughtPrimitiveAccordionTrigger {\n export type Element = ActionButtonElement;\n /**\n * Props for the ChainOfThoughtPrimitive.AccordionTrigger component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<\n typeof useChainOfThoughtAccordionTrigger\n >;\n}\n\n/**\n * A button component that toggles the collapsed state of the chain of thought accordion.\n *\n * This component automatically handles the toggle functionality, expanding or collapsing\n * the chain of thought parts when clicked.\n *\n * @example\n * ```tsx\n * <ChainOfThoughtPrimitive.AccordionTrigger>\n * Toggle Reasoning\n * </ChainOfThoughtPrimitive.AccordionTrigger>\n * ```\n */\nexport const ChainOfThoughtPrimitiveAccordionTrigger = createActionButton(\n \"ChainOfThoughtPrimitive.AccordionTrigger\",\n useChainOfThoughtAccordionTrigger,\n);\n"],"mappings":";;;;;AAUA,MAAM,0CAA0C;CAC9C,MAAM,MAAM,OAAO;CACnB,MAAM,YAAY,aAAa,MAAM,EAAE,eAAe,SAAS;CAM/D,OAJiB,kBAAkB;EACjC,IAAI,eAAe,CAAC,CAAC,aAAa,CAAC,SAAS;CAC9C,GAAG,CAAC,KAAK,SAAS,CAEJ;AAChB;;;;;;;;;;;;;;AA0BA,MAAa,0CAA0C,mBACrD,4CACA,iCACF"}
1
+ {"version":3,"file":"ChainOfThoughtAccordionTrigger.js","names":["c","_c","ActionButtonElement","ActionButtonProps","createActionButton","useCallback","useAuiState","useAui","useChainOfThoughtAccordionTrigger","$","aui","collapsed","_temp","t0","chainOfThought","setCollapsed","callback","ChainOfThoughtPrimitiveAccordionTrigger","Element","Props","s"],"sources":["../../../src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAuiState, useAui } from \"@assistant-ui/store\";\n\nconst useChainOfThoughtAccordionTrigger = () => {\n const aui = useAui();\n const collapsed = useAuiState((s) => s.chainOfThought.collapsed);\n\n const callback = useCallback(() => {\n aui.chainOfThought().setCollapsed(!collapsed);\n }, [aui, collapsed]);\n\n return callback;\n};\n\nexport namespace ChainOfThoughtPrimitiveAccordionTrigger {\n export type Element = ActionButtonElement;\n /**\n * Props for the ChainOfThoughtPrimitive.AccordionTrigger component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<\n typeof useChainOfThoughtAccordionTrigger\n >;\n}\n\n/**\n * A button component that toggles the collapsed state of the chain of thought accordion.\n *\n * This component automatically handles the toggle functionality, expanding or collapsing\n * the chain of thought parts when clicked.\n *\n * @example\n * ```tsx\n * <ChainOfThoughtPrimitive.AccordionTrigger>\n * Toggle Reasoning\n * </ChainOfThoughtPrimitive.AccordionTrigger>\n * ```\n */\nexport const ChainOfThoughtPrimitiveAccordionTrigger = createActionButton(\n \"ChainOfThoughtPrimitive.AccordionTrigger\",\n useChainOfThoughtAccordionTrigger,\n);\n"],"mappings":";;;;;AAUA,MAAMQ,0CAAoC;CAAA,MAAAC,IAAAR,EAAA,CAAA;CACxC,MAAAS,MAAYH,OAAO;CACnB,MAAAI,YAAkBL,YAAYM,KAAiC;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAC,OAAAD,EAAA,OAAAE,WAAA;EAEpCE,WAAA;GAC3BH,IAAGI,eAAgB,CAAC,CAAAC,aAAc,CAACJ,SAAS;EAAC;EAC9CF,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAoB,OAEdO;AAAQ;;;;;;;;;;;;;;AA2BjB,MAAaC,0CAA0Cb,mBACrD,4CACAI,iCACF;AAtC0C,SAAAI,MAAAQ,GAAA;CAAA,OAEHA,EAACN,eAAeH;AAAU"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
+ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
4
  import { forwardRef } from "@assistant-ui/tap/react-shim";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  //#region src/primitives/chainOfThought/ChainOfThoughtRoot.tsx
@@ -20,10 +21,18 @@ import { jsx } from "react/jsx-runtime";
20
21
  * ```
21
22
  */
22
23
  const ChainOfThoughtPrimitiveRoot = forwardRef((props, ref) => {
23
- return /* @__PURE__ */ jsx(Primitive.div, {
24
- ...props,
25
- ref
26
- });
24
+ const $ = c(3);
25
+ let t0;
26
+ if ($[0] !== props || $[1] !== ref) {
27
+ t0 = /* @__PURE__ */ jsx(Primitive.div, {
28
+ ...props,
29
+ ref
30
+ });
31
+ $[0] = props;
32
+ $[1] = ref;
33
+ $[2] = t0;
34
+ } else t0 = $[2];
35
+ return t0;
27
36
  });
28
37
  ChainOfThoughtPrimitiveRoot.displayName = "ChainOfThoughtPrimitive.Root";
29
38
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ChainOfThoughtRoot.js","names":[],"sources":["../../../src/primitives/chainOfThought/ChainOfThoughtRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n} from \"react\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace ChainOfThoughtPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\n/**\n * The root container for chain of thought components.\n *\n * This component provides a wrapper for chain of thought content,\n * including reasoning and tool-call parts that can be collapsed in an accordion.\n *\n * @example\n * ```tsx\n * <ChainOfThoughtPrimitive.Root>\n * <ChainOfThoughtPrimitive.AccordionTrigger>\n * Toggle reasoning\n * </ChainOfThoughtPrimitive.AccordionTrigger>\n * <ChainOfThoughtPrimitive.Parts />\n * </ChainOfThoughtPrimitive.Root>\n * ```\n */\nexport const ChainOfThoughtPrimitiveRoot = forwardRef<\n ChainOfThoughtPrimitiveRoot.Element,\n ChainOfThoughtPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nChainOfThoughtPrimitiveRoot.displayName = \"ChainOfThoughtPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgCA,MAAa,8BAA8B,YAGxC,OAAO,QAAQ;CAChB,OAAO,oBAAC,UAAU,KAAX;EAAe,GAAI;EAAY;CAAM,CAAA;AAC9C,CAAC;AAED,4BAA4B,cAAc"}
1
+ {"version":3,"file":"ChainOfThoughtRoot.js","names":["c","_c","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","PrimitiveDivProps","div","ChainOfThoughtPrimitiveRoot","Element","Props","props","ref","$","t0","displayName"],"sources":["../../../src/primitives/chainOfThought/ChainOfThoughtRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n} from \"react\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace ChainOfThoughtPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\n/**\n * The root container for chain of thought components.\n *\n * This component provides a wrapper for chain of thought content,\n * including reasoning and tool-call parts that can be collapsed in an accordion.\n *\n * @example\n * ```tsx\n * <ChainOfThoughtPrimitive.Root>\n * <ChainOfThoughtPrimitive.AccordionTrigger>\n * Toggle reasoning\n * </ChainOfThoughtPrimitive.AccordionTrigger>\n * <ChainOfThoughtPrimitive.Parts />\n * </ChainOfThoughtPrimitive.Root>\n * ```\n */\nexport const ChainOfThoughtPrimitiveRoot = forwardRef<\n ChainOfThoughtPrimitiveRoot.Element,\n ChainOfThoughtPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nChainOfThoughtPrimitiveRoot.displayName = \"ChainOfThoughtPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAaQ,8BAA8BJ,YAGzCO,OAAAC,QAAA;CAAA,MAAAC,IAAAZ,EAAA,CAAA;CAAA,IAAAa;CAAA,IAAAD,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EACOE,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBH;GAAYC;EAAG,CAAA;EAAIC,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAAtCC;AAAsC,CAC9C;AAEDN,4BAA4BO,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"chainOfThought.js","names":[],"sources":["../../src/primitives/chainOfThought.ts"],"sourcesContent":["export {\n ChainOfThoughtPrimitiveRoot as Root,\n type ChainOfThoughtPrimitiveRoot as RootPrimitive,\n} from \"./chainOfThought/ChainOfThoughtRoot\";\n\nexport {\n ChainOfThoughtPrimitiveAccordionTrigger as AccordionTrigger,\n type ChainOfThoughtPrimitiveAccordionTrigger as AccordionTriggerPrimitive,\n} from \"./chainOfThought/ChainOfThoughtAccordionTrigger\";\n\nexport {\n ChainOfThoughtPrimitiveParts as Parts,\n type ChainOfThoughtPrimitiveParts as PartsPrimitive,\n} from \"./chainOfThought/ChainOfThoughtParts\";\n"],"mappings":""}
1
+ {"version":3,"file":"chainOfThought.js","names":["ChainOfThoughtPrimitiveRoot","Root","RootPrimitive","ChainOfThoughtPrimitiveAccordionTrigger","AccordionTrigger","AccordionTriggerPrimitive","ChainOfThoughtPrimitiveParts","Parts","PartsPrimitive"],"sources":["../../src/primitives/chainOfThought.ts"],"sourcesContent":["export {\n ChainOfThoughtPrimitiveRoot as Root,\n type ChainOfThoughtPrimitiveRoot as RootPrimitive,\n} from \"./chainOfThought/ChainOfThoughtRoot\";\n\nexport {\n ChainOfThoughtPrimitiveAccordionTrigger as AccordionTrigger,\n type ChainOfThoughtPrimitiveAccordionTrigger as AccordionTriggerPrimitive,\n} from \"./chainOfThought/ChainOfThoughtAccordionTrigger\";\n\nexport {\n ChainOfThoughtPrimitiveParts as Parts,\n type ChainOfThoughtPrimitiveParts as PartsPrimitive,\n} from \"./chainOfThought/ChainOfThoughtParts\";\n"],"mappings":""}
@@ -1,35 +1,48 @@
1
1
  "use client";
2
2
  import { createActionButton } from "../../utils/createActionButton.js";
3
3
  import { useAui } from "@assistant-ui/store";
4
+ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
5
  import { useComposerAddAttachment } from "@assistant-ui/core/react";
5
- import { useCallback } from "@assistant-ui/tap/react-shim";
6
6
  //#region src/primitives/composer/ComposerAddAttachment.ts
7
- const useComposerAddAttachment$1 = ({ multiple = true } = {}) => {
7
+ const useComposerAddAttachment$1 = (t0) => {
8
+ const $ = c(6);
9
+ let t1;
10
+ if ($[0] !== t0) {
11
+ t1 = t0 === void 0 ? {} : t0;
12
+ $[0] = t0;
13
+ $[1] = t1;
14
+ } else t1 = $[1];
15
+ const { multiple: t2 } = t1;
16
+ const multiple = t2 === void 0 ? true : t2;
8
17
  const { disabled, addAttachment } = useComposerAddAttachment();
9
18
  const aui = useAui();
10
- const callback = useCallback(() => {
11
- const input = document.createElement("input");
12
- input.type = "file";
13
- input.multiple = multiple;
14
- input.hidden = true;
15
- const attachmentAccept = aui.composer().getState().attachmentAccept;
16
- if (attachmentAccept !== "*") input.accept = attachmentAccept;
17
- document.body.appendChild(input);
18
- input.onchange = (e) => {
19
- const fileList = e.target.files;
20
- if (!fileList) return;
21
- for (const file of fileList) addAttachment(file);
22
- document.body.removeChild(input);
19
+ let t3;
20
+ if ($[2] !== addAttachment || $[3] !== aui || $[4] !== multiple) {
21
+ t3 = () => {
22
+ const input = document.createElement("input");
23
+ input.type = "file";
24
+ input.multiple = multiple;
25
+ input.hidden = true;
26
+ const attachmentAccept = aui.composer().getState().attachmentAccept;
27
+ if (attachmentAccept !== "*") input.accept = attachmentAccept;
28
+ document.body.appendChild(input);
29
+ input.onchange = (e) => {
30
+ const fileList = e.target.files;
31
+ if (!fileList) return;
32
+ for (const file of fileList) addAttachment(file);
33
+ document.body.removeChild(input);
34
+ };
35
+ input.oncancel = () => {
36
+ if (!input.files || input.files.length === 0) document.body.removeChild(input);
37
+ };
38
+ input.click();
23
39
  };
24
- input.oncancel = () => {
25
- if (!input.files || input.files.length === 0) document.body.removeChild(input);
26
- };
27
- input.click();
28
- }, [
29
- aui,
30
- multiple,
31
- addAttachment
32
- ]);
40
+ $[2] = addAttachment;
41
+ $[3] = aui;
42
+ $[4] = multiple;
43
+ $[5] = t3;
44
+ } else t3 = $[5];
45
+ const callback = t3;
33
46
  if (disabled) return null;
34
47
  return callback;
35
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerAddAttachment.js","names":["useComposerAddAttachment","useComposerAddAttachmentBehavior"],"sources":["../../../src/primitives/composer/ComposerAddAttachment.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useComposerAddAttachment as useComposerAddAttachmentBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerAddAttachment = ({\n multiple = true,\n}: {\n /** allow selecting multiple files */\n multiple?: boolean | undefined;\n} = {}) => {\n const { disabled, addAttachment } = useComposerAddAttachmentBehavior();\n const aui = useAui();\n\n const callback = useCallback(() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.multiple = multiple;\n input.hidden = true;\n\n const attachmentAccept = aui.composer().getState().attachmentAccept;\n if (attachmentAccept !== \"*\") {\n input.accept = attachmentAccept;\n }\n\n document.body.appendChild(input);\n\n input.onchange = (e) => {\n const fileList = (e.target as HTMLInputElement).files;\n if (!fileList) return;\n for (const file of fileList) {\n addAttachment(file);\n }\n\n document.body.removeChild(input);\n };\n\n input.oncancel = () => {\n if (!input.files || input.files.length === 0) {\n document.body.removeChild(input);\n }\n };\n\n input.click();\n }, [aui, multiple, addAttachment]);\n\n if (disabled) return null;\n return callback;\n};\n\nexport namespace ComposerPrimitiveAddAttachment {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerAddAttachment>;\n}\n\nexport const ComposerPrimitiveAddAttachment = createActionButton(\n \"ComposerPrimitive.AddAttachment\",\n useComposerAddAttachment,\n [\"multiple\"],\n);\n"],"mappings":";;;;;;AAWA,MAAMA,8BAA4B,EAChC,WAAW,SAIT,CAAC,MAAM;CACT,MAAM,EAAE,UAAU,kBAAkBC,yBAAiC;CACrE,MAAM,MAAM,OAAO;CAEnB,MAAM,WAAW,kBAAkB;EACjC,MAAM,QAAQ,SAAS,cAAc,OAAO;EAC5C,MAAM,OAAO;EACb,MAAM,WAAW;EACjB,MAAM,SAAS;EAEf,MAAM,mBAAmB,IAAI,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC;EACnD,IAAI,qBAAqB,KACvB,MAAM,SAAS;EAGjB,SAAS,KAAK,YAAY,KAAK;EAE/B,MAAM,YAAY,MAAM;GACtB,MAAM,WAAY,EAAE,OAA4B;GAChD,IAAI,CAAC,UAAU;GACf,KAAK,MAAM,QAAQ,UACjB,cAAc,IAAI;GAGpB,SAAS,KAAK,YAAY,KAAK;EACjC;EAEA,MAAM,iBAAiB;GACrB,IAAI,CAAC,MAAM,SAAS,MAAM,MAAM,WAAW,GACzC,SAAS,KAAK,YAAY,KAAK;EAEnC;EAEA,MAAM,MAAM;CACd,GAAG;EAAC;EAAK;EAAU;CAAa,CAAC;CAEjC,IAAI,UAAU,OAAO;CACrB,OAAO;AACT;AAOA,MAAa,iCAAiC,mBAC5C,mCACAD,4BACA,CAAC,UAAU,CACb"}
1
+ {"version":3,"file":"ComposerAddAttachment.js","names":["c","_c","ActionButtonElement","ActionButtonProps","createActionButton","useCallback","useAui","useComposerAddAttachment","useComposerAddAttachmentBehavior","t0","$","t1","undefined","multiple","t2","disabled","addAttachment","aui","t3","input","document","createElement","type","hidden","attachmentAccept","composer","getState","accept","body","appendChild","onchange","e","fileList","target","HTMLInputElement","files","file","removeChild","oncancel","length","click","callback","ComposerPrimitiveAddAttachment","Element","Props"],"sources":["../../../src/primitives/composer/ComposerAddAttachment.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useComposerAddAttachment as useComposerAddAttachmentBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerAddAttachment = ({\n multiple = true,\n}: {\n /** allow selecting multiple files */\n multiple?: boolean | undefined;\n} = {}) => {\n const { disabled, addAttachment } = useComposerAddAttachmentBehavior();\n const aui = useAui();\n\n const callback = useCallback(() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.multiple = multiple;\n input.hidden = true;\n\n const attachmentAccept = aui.composer().getState().attachmentAccept;\n if (attachmentAccept !== \"*\") {\n input.accept = attachmentAccept;\n }\n\n document.body.appendChild(input);\n\n input.onchange = (e) => {\n const fileList = (e.target as HTMLInputElement).files;\n if (!fileList) return;\n for (const file of fileList) {\n addAttachment(file);\n }\n\n document.body.removeChild(input);\n };\n\n input.oncancel = () => {\n if (!input.files || input.files.length === 0) {\n document.body.removeChild(input);\n }\n };\n\n input.click();\n }, [aui, multiple, addAttachment]);\n\n if (disabled) return null;\n return callback;\n};\n\nexport namespace ComposerPrimitiveAddAttachment {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerAddAttachment>;\n}\n\nexport const ComposerPrimitiveAddAttachment = createActionButton(\n \"ComposerPrimitive.AddAttachment\",\n useComposerAddAttachment,\n [\"multiple\"],\n);\n"],"mappings":";;;;;;AAWA,MAAMO,8BAA2BE,OAAA;CAAA,MAAAC,IAAAT,EAAA,CAAA;CAAA,IAAAU;CAAA,IAAAD,EAAA,OAAAD,IAAA;EAACE,KAAAF,OAAAG,KAAAA,IAAA,CAK7B,IAL6BH;EAK5BC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAL4B,MAAA,EAAAG,UAAAC,OAAAH;CAChC,MAAAE,WAAAC,OAAAF,KAAAA,IAAA,OAAAE;CAKA,MAAA,EAAAC,UAAAC,kBAAoCR,yBAAiC;CACrE,MAAAS,MAAYX,OAAO;CAAE,IAAAY;CAAA,IAAAR,EAAA,OAAAM,iBAAAN,EAAA,OAAAO,OAAAP,EAAA,OAAAG,UAAA;EAEQK,WAAA;GAC3B,MAAAC,QAAcC,SAAQC,cAAe,OAAO;GAC5CF,MAAKG,OAAQ;GACbH,MAAKN,WAAYA;GACjBM,MAAKI,SAAU;GAEf,MAAAC,mBAAyBP,IAAGQ,SAAU,CAAC,CAAAC,SAAU,CAAC,CAAAF;GAClD,IAAIA,qBAAqB,KACvBL,MAAKQ,SAAUH;GAGjBJ,SAAQQ,KAAKC,YAAaV,KAAK;GAE/BA,MAAKW,YAAYC,MAAA;IACf,MAAAC,WAAkBD,EAACE,OAA2BE;IAC9C,IAAI,CAACH,UAAQ;IACb,KAAK,MAAAI,QAAcJ,UACjBhB,cAAcoB,IAAI;IAGpBhB,SAAQQ,KAAKS,YAAalB,KAAK;GAAC;GAGlCA,MAAKmB,iBAAY;IACf,IAAI,CAACnB,MAAKgB,SAAUhB,MAAKgB,MAAMI,WAAY,GACzCnB,SAAQQ,KAAKS,YAAalB,KAAK;GAChC;GAGHA,MAAKqB,MAAO;EAAC;EACd9B,EAAA,KAAAM;EAAAN,EAAA,KAAAO;EAAAP,EAAA,KAAAG;EAAAH,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CA9BD,MAAA+B,WAAiBvB;CAgCjB,IAAIH,UAAQ,OAAS;CAAK,OACnB0B;AAAQ;AAQjB,MAAaC,iCAAiCtC,mBAC5C,mCACAG,4BACA,CAAC,UAAU,CACb"}
@@ -1,63 +1,138 @@
1
1
  "use client";
2
2
  import { useAui } from "@assistant-ui/store";
3
- import { cloneElement, forwardRef, isValidElement, useCallback, useState } from "@assistant-ui/tap/react-shim";
3
+ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { cloneElement, forwardRef, isValidElement, useState } from "@assistant-ui/tap/react-shim";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  import { composeEventHandlers } from "@radix-ui/primitive";
6
7
  import { Slot } from "radix-ui";
7
8
  //#region src/primitives/composer/ComposerAttachmentDropzone.tsx
8
- const ComposerPrimitiveAttachmentDropzone = forwardRef(({ disabled, asChild = false, render, children, ...rest }, ref) => {
9
+ const ComposerPrimitiveAttachmentDropzone = forwardRef((t0, ref) => {
10
+ const $ = c(30);
11
+ const { disabled, asChild: t1, render, children, ...rest } = t0;
12
+ const asChild = t1 === void 0 ? false : t1;
9
13
  const [isDragging, setIsDragging] = useState(false);
10
14
  const aui = useAui();
11
- const handleDragEnterCapture = useCallback((e) => {
12
- if (disabled) return;
13
- e.preventDefault();
14
- setIsDragging(true);
15
- }, [disabled]);
16
- const handleDragOverCapture = useCallback((e) => {
17
- if (disabled) return;
18
- e.preventDefault();
19
- if (!isDragging) setIsDragging(true);
20
- }, [disabled, isDragging]);
21
- const handleDragLeaveCapture = useCallback((e) => {
22
- if (disabled) return;
23
- e.preventDefault();
24
- const next = e.relatedTarget;
25
- if (next && e.currentTarget.contains(next)) return;
26
- setIsDragging(false);
27
- }, [disabled]);
28
- const handleDrop = useCallback(async (e) => {
29
- if (disabled) return;
30
- e.preventDefault();
31
- setIsDragging(false);
32
- const files = Array.from(e.dataTransfer.files);
33
- await Promise.all(files.map(async (file) => {
34
- try {
35
- await aui.composer().addAttachment(file);
36
- } catch (error) {
37
- console.error("Failed to add attachment:", error);
38
- }
39
- }));
40
- }, [disabled, aui]);
41
- const mergedProps = {
42
- ...isDragging ? { "data-dragging": "true" } : null,
43
- ...rest,
44
- onDragEnterCapture: composeEventHandlers(rest.onDragEnterCapture, handleDragEnterCapture),
45
- onDragOverCapture: composeEventHandlers(rest.onDragOverCapture, handleDragOverCapture),
46
- onDragLeaveCapture: composeEventHandlers(rest.onDragLeaveCapture, handleDragLeaveCapture),
47
- onDropCapture: composeEventHandlers(rest.onDropCapture, handleDrop),
48
- ref
49
- };
15
+ let t2;
16
+ if ($[0] !== disabled) {
17
+ t2 = (e) => {
18
+ if (disabled) return;
19
+ e.preventDefault();
20
+ setIsDragging(true);
21
+ };
22
+ $[0] = disabled;
23
+ $[1] = t2;
24
+ } else t2 = $[1];
25
+ const handleDragEnterCapture = t2;
26
+ let t3;
27
+ if ($[2] !== disabled || $[3] !== isDragging) {
28
+ t3 = (e_0) => {
29
+ if (disabled) return;
30
+ e_0.preventDefault();
31
+ if (!isDragging) setIsDragging(true);
32
+ };
33
+ $[2] = disabled;
34
+ $[3] = isDragging;
35
+ $[4] = t3;
36
+ } else t3 = $[4];
37
+ const handleDragOverCapture = t3;
38
+ let t4;
39
+ if ($[5] !== disabled) {
40
+ t4 = (e_1) => {
41
+ if (disabled) return;
42
+ e_1.preventDefault();
43
+ const next = e_1.relatedTarget;
44
+ if (next && e_1.currentTarget.contains(next)) return;
45
+ setIsDragging(false);
46
+ };
47
+ $[5] = disabled;
48
+ $[6] = t4;
49
+ } else t4 = $[6];
50
+ const handleDragLeaveCapture = t4;
51
+ let t5;
52
+ if ($[7] !== aui || $[8] !== disabled) {
53
+ t5 = async (e_2) => {
54
+ if (disabled) return;
55
+ e_2.preventDefault();
56
+ setIsDragging(false);
57
+ const files = Array.from(e_2.dataTransfer.files);
58
+ await Promise.all(files.map(async (file) => {
59
+ try {
60
+ await aui.composer().addAttachment(file);
61
+ } catch (t6) {
62
+ console.error("Failed to add attachment:", t6);
63
+ }
64
+ }));
65
+ };
66
+ $[7] = aui;
67
+ $[8] = disabled;
68
+ $[9] = t5;
69
+ } else t5 = $[9];
70
+ const handleDrop = t5;
71
+ let t6;
72
+ if ($[10] !== isDragging) {
73
+ t6 = isDragging ? { "data-dragging": "true" } : null;
74
+ $[10] = isDragging;
75
+ $[11] = t6;
76
+ } else t6 = $[11];
77
+ const t7 = composeEventHandlers(rest.onDragEnterCapture, handleDragEnterCapture);
78
+ const t8 = composeEventHandlers(rest.onDragOverCapture, handleDragOverCapture);
79
+ const t9 = composeEventHandlers(rest.onDragLeaveCapture, handleDragLeaveCapture);
80
+ const t10 = composeEventHandlers(rest.onDropCapture, handleDrop);
81
+ let t11;
82
+ if ($[12] !== ref || $[13] !== rest || $[14] !== t10 || $[15] !== t6 || $[16] !== t7 || $[17] !== t8 || $[18] !== t9) {
83
+ t11 = {
84
+ ...t6,
85
+ ...rest,
86
+ onDragEnterCapture: t7,
87
+ onDragOverCapture: t8,
88
+ onDragLeaveCapture: t9,
89
+ onDropCapture: t10,
90
+ ref
91
+ };
92
+ $[12] = ref;
93
+ $[13] = rest;
94
+ $[14] = t10;
95
+ $[15] = t6;
96
+ $[16] = t7;
97
+ $[17] = t8;
98
+ $[18] = t9;
99
+ $[19] = t11;
100
+ } else t11 = $[19];
101
+ const mergedProps = t11;
50
102
  if (render && isValidElement(render)) {
51
- const renderChildren = children !== void 0 ? children : render.props.children;
52
- return /* @__PURE__ */ jsx(Slot.Root, {
103
+ const t12 = children !== void 0 ? children : render.props.children;
104
+ let t13;
105
+ if ($[20] !== render || $[21] !== t12) {
106
+ t13 = cloneElement(render, void 0, t12);
107
+ $[20] = render;
108
+ $[21] = t12;
109
+ $[22] = t13;
110
+ } else t13 = $[22];
111
+ let t14;
112
+ if ($[23] !== mergedProps || $[24] !== t13) {
113
+ t14 = /* @__PURE__ */ jsx(Slot.Root, {
114
+ ...mergedProps,
115
+ children: t13
116
+ });
117
+ $[23] = mergedProps;
118
+ $[24] = t13;
119
+ $[25] = t14;
120
+ } else t14 = $[25];
121
+ return t14;
122
+ }
123
+ const Comp = asChild ? Slot.Root : "div";
124
+ let t12;
125
+ if ($[26] !== Comp || $[27] !== children || $[28] !== mergedProps) {
126
+ t12 = /* @__PURE__ */ jsx(Comp, {
53
127
  ...mergedProps,
54
- children: cloneElement(render, void 0, renderChildren)
128
+ children
55
129
  });
56
- }
57
- return /* @__PURE__ */ jsx(asChild ? Slot.Root : "div", {
58
- ...mergedProps,
59
- children
60
- });
130
+ $[26] = Comp;
131
+ $[27] = children;
132
+ $[28] = mergedProps;
133
+ $[29] = t12;
134
+ } else t12 = $[29];
135
+ return t12;
61
136
  });
62
137
  ComposerPrimitiveAttachmentDropzone.displayName = "ComposerPrimitive.AttachmentDropzone";
63
138
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerAttachmentDropzone.js","names":[],"sources":["../../../src/primitives/composer/ComposerAttachmentDropzone.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n useCallback,\n useState,\n type ReactElement,\n cloneElement,\n isValidElement,\n} from \"react\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Slot } from \"radix-ui\";\nimport type React from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\n\nexport namespace ComposerPrimitiveAttachmentDropzone {\n export type Element = HTMLDivElement;\n export type Props = React.HTMLAttributes<HTMLDivElement> & {\n asChild?: boolean | undefined;\n render?: ReactElement | undefined;\n disabled?: boolean | undefined;\n };\n}\n\nexport const ComposerPrimitiveAttachmentDropzone = forwardRef<\n HTMLDivElement,\n ComposerPrimitiveAttachmentDropzone.Props\n>(({ disabled, asChild = false, render, children, ...rest }, ref) => {\n const [isDragging, setIsDragging] = useState(false);\n const aui = useAui();\n\n const handleDragEnterCapture = useCallback(\n (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n setIsDragging(true);\n },\n [disabled],\n );\n\n const handleDragOverCapture = useCallback(\n (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n if (!isDragging) setIsDragging(true);\n },\n [disabled, isDragging],\n );\n\n const handleDragLeaveCapture = useCallback(\n (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n const next = e.relatedTarget as Node | null;\n if (next && e.currentTarget.contains(next)) {\n return;\n }\n setIsDragging(false);\n },\n [disabled],\n );\n\n const handleDrop = useCallback(\n async (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n setIsDragging(false);\n const files = Array.from(e.dataTransfer.files);\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer().addAttachment(file);\n } catch (error) {\n console.error(\"Failed to add attachment:\", error);\n }\n }),\n );\n },\n [disabled, aui],\n );\n\n const mergedProps = {\n ...(isDragging ? { \"data-dragging\": \"true\" } : null),\n ...rest,\n onDragEnterCapture: composeEventHandlers(\n rest.onDragEnterCapture,\n handleDragEnterCapture,\n ),\n onDragOverCapture: composeEventHandlers(\n rest.onDragOverCapture,\n handleDragOverCapture,\n ),\n onDragLeaveCapture: composeEventHandlers(\n rest.onDragLeaveCapture,\n handleDragLeaveCapture,\n ),\n onDropCapture: composeEventHandlers(rest.onDropCapture, handleDrop),\n ref,\n };\n\n if (render && isValidElement(render)) {\n const renderChildren =\n children !== undefined\n ? children\n : (render.props as Record<string, unknown>).children;\n return (\n <Slot.Root {...mergedProps}>\n {cloneElement(render, undefined, renderChildren as React.ReactNode)}\n </Slot.Root>\n );\n }\n\n const Comp = asChild ? Slot.Root : \"div\";\n return <Comp {...mergedProps}>{children}</Comp>;\n});\n\nComposerPrimitiveAttachmentDropzone.displayName =\n \"ComposerPrimitive.AttachmentDropzone\";\n"],"mappings":";;;;;;;AAyBA,MAAa,sCAAsC,YAGhD,EAAE,UAAU,UAAU,OAAO,QAAQ,UAAU,GAAG,QAAQ,QAAQ;CACnE,MAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;CAClD,MAAM,MAAM,OAAO;CAEnB,MAAM,yBAAyB,aAC5B,MAAuB;EACtB,IAAI,UAAU;EACd,EAAE,eAAe;EACjB,cAAc,IAAI;CACpB,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,wBAAwB,aAC3B,MAAuB;EACtB,IAAI,UAAU;EACd,EAAE,eAAe;EACjB,IAAI,CAAC,YAAY,cAAc,IAAI;CACrC,GACA,CAAC,UAAU,UAAU,CACvB;CAEA,MAAM,yBAAyB,aAC5B,MAAuB;EACtB,IAAI,UAAU;EACd,EAAE,eAAe;EACjB,MAAM,OAAO,EAAE;EACf,IAAI,QAAQ,EAAE,cAAc,SAAS,IAAI,GACvC;EAEF,cAAc,KAAK;CACrB,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,aAAa,YACjB,OAAO,MAAuB;EAC5B,IAAI,UAAU;EACd,EAAE,eAAe;EACjB,cAAc,KAAK;EACnB,MAAM,QAAQ,MAAM,KAAK,EAAE,aAAa,KAAK;EAC7C,MAAM,QAAQ,IACZ,MAAM,IAAI,OAAO,SAAS;GACxB,IAAI;IACF,MAAM,IAAI,SAAS,CAAC,CAAC,cAAc,IAAI;GACzC,SAAS,OAAO;IACd,QAAQ,MAAM,6BAA6B,KAAK;GAClD;EACF,CAAC,CACH;CACF,GACA,CAAC,UAAU,GAAG,CAChB;CAEA,MAAM,cAAc;EAClB,GAAI,aAAa,EAAE,iBAAiB,OAAO,IAAI;EAC/C,GAAG;EACH,oBAAoB,qBAClB,KAAK,oBACL,sBACF;EACA,mBAAmB,qBACjB,KAAK,mBACL,qBACF;EACA,oBAAoB,qBAClB,KAAK,oBACL,sBACF;EACA,eAAe,qBAAqB,KAAK,eAAe,UAAU;EAClE;CACF;CAEA,IAAI,UAAU,eAAe,MAAM,GAAG;EACpC,MAAM,iBACJ,aAAa,KAAA,IACT,WACC,OAAO,MAAkC;EAChD,OACE,oBAAC,KAAK,MAAN;GAAW,GAAI;aACZ,aAAa,QAAQ,KAAA,GAAW,cAAiC;EACzD,CAAA;CAEf;CAGA,OAAO,oBADM,UAAU,KAAK,OAAO,OAC5B;EAAM,GAAI;EAAc;CAAe,CAAA;AAChD,CAAC;AAED,oCAAoC,cAClC"}
1
+ {"version":3,"file":"ComposerAttachmentDropzone.js","names":["c","_c","forwardRef","useCallback","useState","ReactElement","cloneElement","isValidElement","composeEventHandlers","Slot","React","useAui","ComposerPrimitiveAttachmentDropzone","Element","HTMLDivElement","Props","HTMLAttributes","asChild","render","disabled","t0","ref","$","t1","children","rest","undefined","isDragging","setIsDragging","aui","t2","e","preventDefault","handleDragEnterCapture","t3","e_0","handleDragOverCapture","t4","e_1","next","relatedTarget","Node","currentTarget","contains","handleDragLeaveCapture","t5","e_2","files","Array","from","dataTransfer","Promise","all","map","file","composer","addAttachment","t6","error","console","handleDrop","t7","onDragEnterCapture","t8","onDragOverCapture","t9","onDragLeaveCapture","t10","onDropCapture","t11","mergedProps","renderChildren","props","Record","t12","ReactNode","t13","t14","Comp","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerAttachmentDropzone.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n useCallback,\n useState,\n type ReactElement,\n cloneElement,\n isValidElement,\n} from \"react\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Slot } from \"radix-ui\";\nimport type React from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\n\nexport namespace ComposerPrimitiveAttachmentDropzone {\n export type Element = HTMLDivElement;\n export type Props = React.HTMLAttributes<HTMLDivElement> & {\n asChild?: boolean | undefined;\n render?: ReactElement | undefined;\n disabled?: boolean | undefined;\n };\n}\n\nexport const ComposerPrimitiveAttachmentDropzone = forwardRef<\n HTMLDivElement,\n ComposerPrimitiveAttachmentDropzone.Props\n>(({ disabled, asChild = false, render, children, ...rest }, ref) => {\n const [isDragging, setIsDragging] = useState(false);\n const aui = useAui();\n\n const handleDragEnterCapture = useCallback(\n (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n setIsDragging(true);\n },\n [disabled],\n );\n\n const handleDragOverCapture = useCallback(\n (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n if (!isDragging) setIsDragging(true);\n },\n [disabled, isDragging],\n );\n\n const handleDragLeaveCapture = useCallback(\n (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n const next = e.relatedTarget as Node | null;\n if (next && e.currentTarget.contains(next)) {\n return;\n }\n setIsDragging(false);\n },\n [disabled],\n );\n\n const handleDrop = useCallback(\n async (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n setIsDragging(false);\n const files = Array.from(e.dataTransfer.files);\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer().addAttachment(file);\n } catch (error) {\n console.error(\"Failed to add attachment:\", error);\n }\n }),\n );\n },\n [disabled, aui],\n );\n\n const mergedProps = {\n ...(isDragging ? { \"data-dragging\": \"true\" } : null),\n ...rest,\n onDragEnterCapture: composeEventHandlers(\n rest.onDragEnterCapture,\n handleDragEnterCapture,\n ),\n onDragOverCapture: composeEventHandlers(\n rest.onDragOverCapture,\n handleDragOverCapture,\n ),\n onDragLeaveCapture: composeEventHandlers(\n rest.onDragLeaveCapture,\n handleDragLeaveCapture,\n ),\n onDropCapture: composeEventHandlers(rest.onDropCapture, handleDrop),\n ref,\n };\n\n if (render && isValidElement(render)) {\n const renderChildren =\n children !== undefined\n ? children\n : (render.props as Record<string, unknown>).children;\n return (\n <Slot.Root {...mergedProps}>\n {cloneElement(render, undefined, renderChildren as React.ReactNode)}\n </Slot.Root>\n );\n }\n\n const Comp = asChild ? Slot.Root : \"div\";\n return <Comp {...mergedProps}>{children}</Comp>;\n});\n\nComposerPrimitiveAttachmentDropzone.displayName =\n \"ComposerPrimitive.AttachmentDropzone\";\n"],"mappings":";;;;;;;;AAyBA,MAAaY,sCAAsCV,YAGjDkB,IAAAC,QAAA;CAAA,MAAAC,IAAArB,EAAA,EAAA;CAAC,MAAA,EAAAkB,UAAAF,SAAAM,IAAAL,QAAAM,UAAA,GAAAC,SAAAL;CAAY,MAAAH,UAAAM,OAAAG,KAAAA,IAAA,QAAAH;CACb,MAAA,CAAAI,YAAAC,iBAAoCxB,SAAS,KAAK;CAClD,MAAAyB,MAAYlB,OAAO;CAAE,IAAAmB;CAAA,IAAAR,EAAA,OAAAH,UAAA;EAGnBW,MAAAC,MAAA;GACE,IAAIZ,UAAQ;GACZY,EAACC,eAAgB;GACjBJ,cAAc,IAAI;EAAC;EACpBN,EAAA,KAAAH;EAAAG,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CALH,MAAAW,yBAA+BH;CAO7B,IAAAI;CAAA,IAAAZ,EAAA,OAAAH,YAAAG,EAAA,OAAAK,YAAA;EAGAO,MAAAC,QAAA;GACE,IAAIhB,UAAQ;GACZY,IAACC,eAAgB;GACjB,IAAI,CAACL,YAAYC,cAAc,IAAI;EAAE;EACtCN,EAAA,KAAAH;EAAAG,EAAA,KAAAK;EAAAL,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CALH,MAAAc,wBAA8BF;CAO5B,IAAAG;CAAA,IAAAf,EAAA,OAAAH,UAAA;EAGAkB,MAAAC,QAAA;GACE,IAAInB,UAAQ;GACZY,IAACC,eAAgB;GACjB,MAAAO,OAAaR,IAACS;GACd,IAAID,QAAQR,IAACW,cAAcC,SAAUJ,IAAI,GAAC;GAG1CX,cAAc,KAAK;EAAC;EACrBN,EAAA,KAAAH;EAAAG,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CATH,MAAAsB,yBAA+BP;CAW7B,IAAAQ;CAAA,IAAAvB,EAAA,OAAAO,OAAAP,EAAA,OAAAH,UAAA;EAGA0B,KAAA,OAAAC,QAAA;GACE,IAAI3B,UAAQ;GACZY,IAACC,eAAgB;GACjBJ,cAAc,KAAK;GACnB,MAAAmB,QAAcC,MAAKC,KAAMlB,IAACmB,aAAaH,KAAM;GAC7C,MAAMI,QAAOC,IACXL,MAAKM,IAAK,OAAAC,SAAA;IACR,IAAA;KACE,MAAMzB,IAAG0B,SAAU,CAAC,CAAAC,cAAeF,IAAI;IAAC,SAAAG,IAAA;KAExCE,QAAOD,MAAO,6BAA6BA,EAAK;IAAC;GAClD,CACF,CACH;EAAC;EACFpC,EAAA,KAAAO;EAAAP,EAAA,KAAAH;EAAAG,EAAA,KAAAuB;CAAA,OAAAA,KAAAvB,EAAA;CAfH,MAAAsC,aAAmBf;CAiBjB,IAAAY;CAAA,IAAAnC,EAAA,QAAAK,YAAA;EAGI8B,KAAA9B,aAAA,EAAA,iBAAgC,OAAc,IAA9C;EAA+CL,EAAA,MAAAK;EAAAL,EAAA,MAAAmC;CAAA,OAAAA,KAAAnC,EAAA;CAE/B,MAAAuC,KAAArD,qBAClBiB,KAAIqC,oBACJ7B,sBACF;CACmB,MAAA8B,KAAAvD,qBACjBiB,KAAIuC,mBACJ5B,qBACF;CACoB,MAAA6B,KAAAzD,qBAClBiB,KAAIyC,oBACJtB,sBACF;CACe,MAAAuB,MAAA3D,qBAAqBiB,KAAI2C,eAAgBR,UAAU;CAAC,IAAAS;CAAA,IAAA/C,EAAA,QAAAD,OAAAC,EAAA,QAAAG,QAAAH,EAAA,QAAA6C,OAAA7C,EAAA,QAAAmC,MAAAnC,EAAA,QAAAuC,MAAAvC,EAAA,QAAAyC,MAAAzC,EAAA,QAAA2C,IAAA;EAfjDI,MAAA;GAAA,GACdZ;GAA+C,GAChDhC;GAAIqC,oBACaD;GAGnBG,mBACkBD;GAGlBG,oBACmBD;GAGnBG,eACcD;GAAoD9C;EAErE;EAACC,EAAA,MAAAD;EAAAC,EAAA,MAAAG;EAAAH,EAAA,MAAA6C;EAAA7C,EAAA,MAAAmC;EAAAnC,EAAA,MAAAuC;EAAAvC,EAAA,MAAAyC;EAAAzC,EAAA,MAAA2C;EAAA3C,EAAA,MAAA+C;CAAA,OAAAA,MAAA/C,EAAA;CAjBD,MAAAgD,cAAoBD;CAmBpB,IAAInD,UAAUX,eAAeW,MAAM,GAAC;EAOG,MAAAwD,MALnClD,aAAaE,KAAAA,IAAbF,WAEKN,OAAMsD,MAAiChD;EAGwB,IAAAoD;EAAA,IAAAtD,EAAA,QAAAJ,UAAAI,EAAA,QAAAoD,KAAA;GAAjEE,MAAAtE,aAAaY,QAAQQ,KAAAA,GAAWgD,GAAiC;GAACpD,EAAA,MAAAJ;GAAAI,EAAA,MAAAoD;GAAApD,EAAA,MAAAsD;EAAA,OAAAA,MAAAtD,EAAA;EAAA,IAAAuD;EAAA,IAAAvD,EAAA,QAAAgD,eAAAhD,EAAA,QAAAsD,KAAA;GADrEC,MAAA,oBAAA,KAAA,MAAA;IAAA,GAAeP;cACZM;GACH,CAAA;GAAYtD,EAAA,MAAAgD;GAAAhD,EAAA,MAAAsD;GAAAtD,EAAA,MAAAuD;EAAA,OAAAA,MAAAvD,EAAA;EAAA,OAFZuD;CAEY;CAIhB,MAAAC,OAAa7D,UAAUR,KAAIsE,OAAd;CAA4B,IAAAL;CAAA,IAAApD,EAAA,QAAAwD,QAAAxD,EAAA,QAAAE,YAAAF,EAAA,QAAAgD,aAAA;EAClCI,MAAA,oBAAC,MAAD;GAAK,GAAKJ;GAAc9C;EAAnB,CAAA;EAAmCF,EAAA,MAAAwD;EAAAxD,EAAA,MAAAE;EAAAF,EAAA,MAAAgD;EAAAhD,EAAA,MAAAoD;CAAA,OAAAA,MAAApD,EAAA;CAAA,OAAxCoD;AAAwC,CAChD;AAED9D,oCAAoCoE,cAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerCancel.js","names":["useComposerCancel","useComposerCancelBehavior"],"sources":["../../../src/primitives/composer/ComposerCancel.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useComposerCancel as useComposerCancelBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerCancel = () => {\n const { disabled, cancel } = useComposerCancelBehavior();\n if (disabled) return null;\n return cancel;\n};\n\nexport namespace ComposerPrimitiveCancel {\n export type Element = ActionButtonElement;\n /**\n * Props for the ComposerPrimitive.Cancel component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useComposerCancel>;\n}\n\n/**\n * A button component that cancels the current message composition.\n *\n * This component automatically handles the cancel functionality and is disabled\n * when canceling is not available.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Cancel>\n * Cancel\n * </ComposerPrimitive.Cancel>\n * ```\n */\nexport const ComposerPrimitiveCancel = createActionButton(\n \"ComposerPrimitive.Cancel\",\n useComposerCancel,\n);\n"],"mappings":";;;;AASA,MAAMA,4BAA0B;CAC9B,MAAM,EAAE,UAAU,WAAWC,kBAA0B;CACvD,IAAI,UAAU,OAAO;CACrB,OAAO;AACT;;;;;;;;;;;;;;AAwBA,MAAa,0BAA0B,mBACrC,4BACAD,mBACF"}
1
+ {"version":3,"file":"ComposerCancel.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useComposerCancel","useComposerCancelBehavior","disabled","cancel","ComposerPrimitiveCancel","Element","Props"],"sources":["../../../src/primitives/composer/ComposerCancel.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useComposerCancel as useComposerCancelBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerCancel = () => {\n const { disabled, cancel } = useComposerCancelBehavior();\n if (disabled) return null;\n return cancel;\n};\n\nexport namespace ComposerPrimitiveCancel {\n export type Element = ActionButtonElement;\n /**\n * Props for the ComposerPrimitive.Cancel component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useComposerCancel>;\n}\n\n/**\n * A button component that cancels the current message composition.\n *\n * This component automatically handles the cancel functionality and is disabled\n * when canceling is not available.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Cancel>\n * Cancel\n * </ComposerPrimitive.Cancel>\n * ```\n */\nexport const ComposerPrimitiveCancel = createActionButton(\n \"ComposerPrimitive.Cancel\",\n useComposerCancel,\n);\n"],"mappings":";;;;AASA,MAAMG,4BAAoB;CACxB,MAAA,EAAAE,UAAAC,WAA6BF,kBAA0B;CACvD,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAM;;;;;;;;;;;;;;AAyBf,MAAaC,0BAA0BL,mBACrC,4BACAC,mBACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerDictate.js","names":["useComposerDictate","useComposerDictateBehavior"],"sources":["../../../src/primitives/composer/ComposerDictate.ts"],"sourcesContent":["\"use client\";\n\nimport type {\n ActionButtonElement,\n ActionButtonProps,\n} from \"../../utils/createActionButton\";\nimport { createActionButton } from \"../../utils/createActionButton\";\nimport { useComposerDictate as useComposerDictateBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerDictate = () => {\n const { disabled, startDictation } = useComposerDictateBehavior();\n if (disabled) return null;\n return startDictation;\n};\n\nexport namespace ComposerPrimitiveDictate {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerDictate>;\n}\n\n/**\n * A button that starts dictation to convert voice to text.\n *\n * Requires a DictationAdapter to be configured in the runtime.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Dictate>\n * <MicIcon />\n * </ComposerPrimitive.Dictate>\n * ```\n */\nexport const ComposerPrimitiveDictate = createActionButton(\n \"ComposerPrimitive.Dictate\",\n useComposerDictate,\n);\n"],"mappings":";;;;AASA,MAAMA,6BAA2B;CAC/B,MAAM,EAAE,UAAU,mBAAmBC,mBAA2B;CAChE,IAAI,UAAU,OAAO;CACrB,OAAO;AACT;;;;;;;;;;;;;AAmBA,MAAa,2BAA2B,mBACtC,6BACAD,oBACF"}
1
+ {"version":3,"file":"ComposerDictate.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useComposerDictate","useComposerDictateBehavior","disabled","startDictation","ComposerPrimitiveDictate","Element","Props"],"sources":["../../../src/primitives/composer/ComposerDictate.ts"],"sourcesContent":["\"use client\";\n\nimport type {\n ActionButtonElement,\n ActionButtonProps,\n} from \"../../utils/createActionButton\";\nimport { createActionButton } from \"../../utils/createActionButton\";\nimport { useComposerDictate as useComposerDictateBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerDictate = () => {\n const { disabled, startDictation } = useComposerDictateBehavior();\n if (disabled) return null;\n return startDictation;\n};\n\nexport namespace ComposerPrimitiveDictate {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerDictate>;\n}\n\n/**\n * A button that starts dictation to convert voice to text.\n *\n * Requires a DictationAdapter to be configured in the runtime.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Dictate>\n * <MicIcon />\n * </ComposerPrimitive.Dictate>\n * ```\n */\nexport const ComposerPrimitiveDictate = createActionButton(\n \"ComposerPrimitive.Dictate\",\n useComposerDictate,\n);\n"],"mappings":";;;;AASA,MAAMG,6BAAqB;CACzB,MAAA,EAAAE,UAAAC,mBAAqCF,mBAA2B;CAChE,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAc;;;;;;;;;;;;;AAoBvB,MAAaC,2BAA2BL,mBACtC,6BACAC,oBACF"}