@assistant-ui/react 0.5.99 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (709) hide show
  1. package/dist/api/AssistantRuntime.d.ts +2 -52
  2. package/dist/api/AssistantRuntime.d.ts.map +1 -1
  3. package/dist/api/AssistantRuntime.js +0 -8
  4. package/dist/api/AssistantRuntime.js.map +1 -1
  5. package/dist/api/AssistantRuntime.mjs +0 -8
  6. package/dist/api/AssistantRuntime.mjs.map +1 -1
  7. package/dist/api/AttachmentRuntime.d.ts +0 -12
  8. package/dist/api/AttachmentRuntime.d.ts.map +1 -1
  9. package/dist/api/AttachmentRuntime.js.map +1 -1
  10. package/dist/api/AttachmentRuntime.mjs.map +1 -1
  11. package/dist/api/ComposerRuntime.d.ts +5 -121
  12. package/dist/api/ComposerRuntime.d.ts.map +1 -1
  13. package/dist/api/ComposerRuntime.js +4 -84
  14. package/dist/api/ComposerRuntime.js.map +1 -1
  15. package/dist/api/ComposerRuntime.mjs +4 -84
  16. package/dist/api/ComposerRuntime.mjs.map +1 -1
  17. package/dist/api/ContentPartRuntime.d.ts +0 -4
  18. package/dist/api/ContentPartRuntime.d.ts.map +1 -1
  19. package/dist/api/ContentPartRuntime.js.map +1 -1
  20. package/dist/api/ContentPartRuntime.mjs.map +1 -1
  21. package/dist/api/MessageRuntime.d.ts +1 -12
  22. package/dist/api/MessageRuntime.d.ts.map +1 -1
  23. package/dist/api/MessageRuntime.js +9 -5
  24. package/dist/api/MessageRuntime.js.map +1 -1
  25. package/dist/api/MessageRuntime.mjs +8 -4
  26. package/dist/api/MessageRuntime.mjs.map +1 -1
  27. package/dist/api/ThreadListItemRuntime.d.ts +9 -5
  28. package/dist/api/ThreadListItemRuntime.d.ts.map +1 -1
  29. package/dist/api/ThreadListItemRuntime.js +10 -6
  30. package/dist/api/ThreadListItemRuntime.js.map +1 -1
  31. package/dist/api/ThreadListItemRuntime.mjs +10 -6
  32. package/dist/api/ThreadListItemRuntime.mjs.map +1 -1
  33. package/dist/api/ThreadListRuntime.d.ts +5 -23
  34. package/dist/api/ThreadListRuntime.d.ts.map +1 -1
  35. package/dist/api/ThreadListRuntime.js +23 -26
  36. package/dist/api/ThreadListRuntime.js.map +1 -1
  37. package/dist/api/ThreadListRuntime.mjs +23 -26
  38. package/dist/api/ThreadListRuntime.mjs.map +1 -1
  39. package/dist/api/ThreadRuntime.d.ts +17 -164
  40. package/dist/api/ThreadRuntime.d.ts.map +1 -1
  41. package/dist/api/ThreadRuntime.js +2 -94
  42. package/dist/api/ThreadRuntime.js.map +1 -1
  43. package/dist/api/ThreadRuntime.mjs +2 -94
  44. package/dist/api/ThreadRuntime.mjs.map +1 -1
  45. package/dist/context/providers/AssistantRuntimeProvider.d.ts.map +1 -1
  46. package/dist/context/providers/AssistantRuntimeProvider.js +0 -1
  47. package/dist/context/providers/AssistantRuntimeProvider.js.map +1 -1
  48. package/dist/context/providers/AssistantRuntimeProvider.mjs +0 -1
  49. package/dist/context/providers/AssistantRuntimeProvider.mjs.map +1 -1
  50. package/dist/context/providers/TextContentPartProvider.d.ts.map +1 -1
  51. package/dist/context/providers/TextContentPartProvider.js +0 -2
  52. package/dist/context/providers/TextContentPartProvider.js.map +1 -1
  53. package/dist/context/providers/TextContentPartProvider.mjs +0 -2
  54. package/dist/context/providers/TextContentPartProvider.mjs.map +1 -1
  55. package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts +1 -4
  56. package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
  57. package/dist/context/providers/ThreadRuntimeProvider.d.ts.map +1 -1
  58. package/dist/context/providers/ThreadRuntimeProvider.js +1 -13
  59. package/dist/context/providers/ThreadRuntimeProvider.js.map +1 -1
  60. package/dist/context/providers/ThreadRuntimeProvider.mjs +1 -13
  61. package/dist/context/providers/ThreadRuntimeProvider.mjs.map +1 -1
  62. package/dist/context/react/AssistantContext.d.ts +16 -88
  63. package/dist/context/react/AssistantContext.d.ts.map +1 -1
  64. package/dist/context/react/AssistantContext.js +0 -15
  65. package/dist/context/react/AssistantContext.js.map +1 -1
  66. package/dist/context/react/AssistantContext.mjs +0 -11
  67. package/dist/context/react/AssistantContext.mjs.map +1 -1
  68. package/dist/context/react/AttachmentContext.d.ts +16 -32
  69. package/dist/context/react/AttachmentContext.d.ts.map +1 -1
  70. package/dist/context/react/ComposerContext.d.ts +0 -5
  71. package/dist/context/react/ComposerContext.d.ts.map +1 -1
  72. package/dist/context/react/ComposerContext.js +3 -5
  73. package/dist/context/react/ComposerContext.js.map +1 -1
  74. package/dist/context/react/ComposerContext.mjs +2 -3
  75. package/dist/context/react/ComposerContext.mjs.map +1 -1
  76. package/dist/context/react/ContentPartContext.d.ts +0 -5
  77. package/dist/context/react/ContentPartContext.d.ts.map +1 -1
  78. package/dist/context/react/ContentPartContext.js +3 -5
  79. package/dist/context/react/ContentPartContext.js.map +1 -1
  80. package/dist/context/react/ContentPartContext.mjs +2 -3
  81. package/dist/context/react/ContentPartContext.mjs.map +1 -1
  82. package/dist/context/react/MessageContext.d.ts +0 -10
  83. package/dist/context/react/MessageContext.d.ts.map +1 -1
  84. package/dist/context/react/MessageContext.js +2 -6
  85. package/dist/context/react/MessageContext.js.map +1 -1
  86. package/dist/context/react/MessageContext.mjs +2 -4
  87. package/dist/context/react/MessageContext.mjs.map +1 -1
  88. package/dist/context/react/ThreadContext.d.ts +25 -1635
  89. package/dist/context/react/ThreadContext.d.ts.map +1 -1
  90. package/dist/context/react/ThreadContext.js +4 -30
  91. package/dist/context/react/ThreadContext.js.map +1 -1
  92. package/dist/context/react/ThreadContext.mjs +4 -22
  93. package/dist/context/react/ThreadContext.mjs.map +1 -1
  94. package/dist/context/react/ThreadListItemContext.d.ts +6 -24
  95. package/dist/context/react/ThreadListItemContext.d.ts.map +1 -1
  96. package/dist/context/react/index.d.ts +5 -101
  97. package/dist/context/react/index.d.ts.map +1 -1
  98. package/dist/context/react/index.js +0 -38
  99. package/dist/context/react/index.js.map +1 -1
  100. package/dist/context/react/index.mjs +5 -49
  101. package/dist/context/react/index.mjs.map +1 -1
  102. package/dist/index.d.ts +0 -1
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +0 -2
  105. package/dist/index.js.map +1 -1
  106. package/dist/index.mjs +0 -1
  107. package/dist/index.mjs.map +1 -1
  108. package/dist/internal.d.ts +1 -0
  109. package/dist/internal.d.ts.map +1 -1
  110. package/dist/internal.js +3 -0
  111. package/dist/internal.js.map +1 -1
  112. package/dist/internal.mjs +2 -0
  113. package/dist/internal.mjs.map +1 -1
  114. package/dist/model-config/useAssistantToolUI.d.ts.map +1 -1
  115. package/dist/model-config/useAssistantToolUI.js.map +1 -1
  116. package/dist/model-config/useAssistantToolUI.mjs.map +1 -1
  117. package/dist/primitive-hooks/contentPart/useContentPartDisplay.d.ts +0 -3
  118. package/dist/primitive-hooks/contentPart/useContentPartDisplay.d.ts.map +1 -1
  119. package/dist/primitive-hooks/contentPart/useContentPartDisplay.js.map +1 -1
  120. package/dist/primitive-hooks/contentPart/useContentPartDisplay.mjs.map +1 -1
  121. package/dist/primitive-hooks/contentPart/useContentPartImage.d.ts +0 -3
  122. package/dist/primitive-hooks/contentPart/useContentPartImage.d.ts.map +1 -1
  123. package/dist/primitive-hooks/contentPart/useContentPartImage.js.map +1 -1
  124. package/dist/primitive-hooks/contentPart/useContentPartImage.mjs.map +1 -1
  125. package/dist/primitive-hooks/contentPart/useContentPartText.d.ts +0 -3
  126. package/dist/primitive-hooks/contentPart/useContentPartText.d.ts.map +1 -1
  127. package/dist/primitive-hooks/contentPart/useContentPartText.js.map +1 -1
  128. package/dist/primitive-hooks/contentPart/useContentPartText.mjs.map +1 -1
  129. package/dist/primitive-hooks/index.d.ts +0 -5
  130. package/dist/primitive-hooks/index.d.ts.map +1 -1
  131. package/dist/primitive-hooks/index.js +1 -11
  132. package/dist/primitive-hooks/index.js.map +1 -1
  133. package/dist/primitive-hooks/index.mjs +0 -5
  134. package/dist/primitive-hooks/index.mjs.map +1 -1
  135. package/dist/primitives/actionBar/ActionBarCopy.d.ts +1 -5
  136. package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
  137. package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
  138. package/dist/primitives/actionBar/ActionBarCopy.mjs.map +1 -1
  139. package/dist/primitives/actionBar/ActionBarEdit.d.ts +0 -4
  140. package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
  141. package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
  142. package/dist/primitives/actionBar/ActionBarEdit.mjs.map +1 -1
  143. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +0 -4
  144. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
  145. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
  146. package/dist/primitives/actionBar/ActionBarFeedbackNegative.mjs.map +1 -1
  147. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +0 -4
  148. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
  149. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
  150. package/dist/primitives/actionBar/ActionBarFeedbackPositive.mjs.map +1 -1
  151. package/dist/primitives/actionBar/ActionBarReload.d.ts +0 -4
  152. package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
  153. package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
  154. package/dist/primitives/actionBar/ActionBarReload.mjs.map +1 -1
  155. package/dist/primitives/actionBar/ActionBarRoot.d.ts +0 -4
  156. package/dist/primitives/actionBar/ActionBarRoot.d.ts.map +1 -1
  157. package/dist/primitives/actionBar/ActionBarRoot.js.map +1 -1
  158. package/dist/primitives/actionBar/ActionBarRoot.mjs.map +1 -1
  159. package/dist/primitives/actionBar/ActionBarSpeak.d.ts +0 -4
  160. package/dist/primitives/actionBar/ActionBarSpeak.d.ts.map +1 -1
  161. package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
  162. package/dist/primitives/actionBar/ActionBarSpeak.mjs.map +1 -1
  163. package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts +0 -4
  164. package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts.map +1 -1
  165. package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
  166. package/dist/primitives/actionBar/ActionBarStopSpeaking.mjs.map +1 -1
  167. package/dist/primitives/assistantModal/AssistantModalContent.d.ts +0 -4
  168. package/dist/primitives/assistantModal/AssistantModalContent.d.ts.map +1 -1
  169. package/dist/primitives/assistantModal/AssistantModalContent.js.map +1 -1
  170. package/dist/primitives/assistantModal/AssistantModalContent.mjs.map +1 -1
  171. package/dist/primitives/assistantModal/AssistantModalRoot.d.ts +0 -4
  172. package/dist/primitives/assistantModal/AssistantModalRoot.d.ts.map +1 -1
  173. package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
  174. package/dist/primitives/assistantModal/AssistantModalRoot.mjs.map +1 -1
  175. package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts +0 -4
  176. package/dist/primitives/assistantModal/AssistantModalTrigger.d.ts.map +1 -1
  177. package/dist/primitives/assistantModal/AssistantModalTrigger.js.map +1 -1
  178. package/dist/primitives/assistantModal/AssistantModalTrigger.mjs.map +1 -1
  179. package/dist/primitives/branchPicker/BranchPickerCount.d.ts +0 -4
  180. package/dist/primitives/branchPicker/BranchPickerCount.d.ts.map +1 -1
  181. package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
  182. package/dist/primitives/branchPicker/BranchPickerCount.mjs.map +1 -1
  183. package/dist/primitives/branchPicker/BranchPickerNext.d.ts +0 -4
  184. package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
  185. package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
  186. package/dist/primitives/branchPicker/BranchPickerNext.mjs.map +1 -1
  187. package/dist/primitives/branchPicker/BranchPickerNumber.d.ts +0 -4
  188. package/dist/primitives/branchPicker/BranchPickerNumber.d.ts.map +1 -1
  189. package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
  190. package/dist/primitives/branchPicker/BranchPickerNumber.mjs.map +1 -1
  191. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts +0 -4
  192. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
  193. package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
  194. package/dist/primitives/branchPicker/BranchPickerPrevious.mjs.map +1 -1
  195. package/dist/primitives/branchPicker/BranchPickerRoot.d.ts +0 -4
  196. package/dist/primitives/branchPicker/BranchPickerRoot.d.ts.map +1 -1
  197. package/dist/primitives/branchPicker/BranchPickerRoot.js.map +1 -1
  198. package/dist/primitives/branchPicker/BranchPickerRoot.mjs.map +1 -1
  199. package/dist/primitives/composer/ComposerAddAttachment.d.ts +1 -5
  200. package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
  201. package/dist/primitives/composer/ComposerAddAttachment.js +2 -2
  202. package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
  203. package/dist/primitives/composer/ComposerAddAttachment.mjs +1 -1
  204. package/dist/primitives/composer/ComposerAddAttachment.mjs.map +1 -1
  205. package/dist/primitives/composer/ComposerAttachments.d.ts +0 -4
  206. package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -1
  207. package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
  208. package/dist/primitives/composer/ComposerAttachments.mjs.map +1 -1
  209. package/dist/primitives/composer/ComposerCancel.d.ts +0 -4
  210. package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
  211. package/dist/primitives/composer/ComposerCancel.js.map +1 -1
  212. package/dist/primitives/composer/ComposerCancel.mjs.map +1 -1
  213. package/dist/primitives/composer/ComposerIf.d.ts +0 -4
  214. package/dist/primitives/composer/ComposerIf.d.ts.map +1 -1
  215. package/dist/primitives/composer/ComposerIf.js.map +1 -1
  216. package/dist/primitives/composer/ComposerIf.mjs.map +1 -1
  217. package/dist/primitives/composer/ComposerInput.d.ts +0 -4
  218. package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
  219. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  220. package/dist/primitives/composer/ComposerInput.mjs.map +1 -1
  221. package/dist/primitives/composer/ComposerRoot.d.ts +0 -1
  222. package/dist/primitives/composer/ComposerRoot.d.ts.map +1 -1
  223. package/dist/primitives/composer/ComposerRoot.js +2 -2
  224. package/dist/primitives/composer/ComposerRoot.js.map +1 -1
  225. package/dist/primitives/composer/ComposerRoot.mjs +1 -1
  226. package/dist/primitives/composer/ComposerRoot.mjs.map +1 -1
  227. package/dist/primitives/composer/ComposerSend.d.ts +1 -5
  228. package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
  229. package/dist/primitives/composer/ComposerSend.js +2 -2
  230. package/dist/primitives/composer/ComposerSend.js.map +1 -1
  231. package/dist/primitives/composer/ComposerSend.mjs +1 -1
  232. package/dist/primitives/composer/ComposerSend.mjs.map +1 -1
  233. package/dist/primitives/contentPart/ContentPartDisplay.d.ts +0 -4
  234. package/dist/primitives/contentPart/ContentPartDisplay.d.ts.map +1 -1
  235. package/dist/primitives/contentPart/ContentPartDisplay.js.map +1 -1
  236. package/dist/primitives/contentPart/ContentPartDisplay.mjs.map +1 -1
  237. package/dist/primitives/contentPart/ContentPartImage.d.ts +0 -4
  238. package/dist/primitives/contentPart/ContentPartImage.d.ts.map +1 -1
  239. package/dist/primitives/contentPart/ContentPartImage.js.map +1 -1
  240. package/dist/primitives/contentPart/ContentPartImage.mjs.map +1 -1
  241. package/dist/primitives/contentPart/ContentPartInProgress.d.ts +0 -4
  242. package/dist/primitives/contentPart/ContentPartInProgress.d.ts.map +1 -1
  243. package/dist/primitives/contentPart/ContentPartInProgress.js.map +1 -1
  244. package/dist/primitives/contentPart/ContentPartInProgress.mjs.map +1 -1
  245. package/dist/primitives/contentPart/ContentPartText.d.ts +0 -4
  246. package/dist/primitives/contentPart/ContentPartText.d.ts.map +1 -1
  247. package/dist/primitives/contentPart/ContentPartText.js.map +1 -1
  248. package/dist/primitives/contentPart/ContentPartText.mjs.map +1 -1
  249. package/dist/primitives/index.d.ts +0 -7
  250. package/dist/primitives/index.d.ts.map +1 -1
  251. package/dist/primitives/index.js.map +1 -1
  252. package/dist/primitives/index.mjs.map +1 -1
  253. package/dist/primitives/message/MessageAttachments.d.ts +0 -4
  254. package/dist/primitives/message/MessageAttachments.d.ts.map +1 -1
  255. package/dist/primitives/message/MessageAttachments.js +2 -4
  256. package/dist/primitives/message/MessageAttachments.js.map +1 -1
  257. package/dist/primitives/message/MessageAttachments.mjs +2 -4
  258. package/dist/primitives/message/MessageAttachments.mjs.map +1 -1
  259. package/dist/primitives/message/MessageContent.d.ts +0 -4
  260. package/dist/primitives/message/MessageContent.d.ts.map +1 -1
  261. package/dist/primitives/message/MessageContent.js +6 -6
  262. package/dist/primitives/message/MessageContent.js.map +1 -1
  263. package/dist/primitives/message/MessageContent.mjs +7 -7
  264. package/dist/primitives/message/MessageContent.mjs.map +1 -1
  265. package/dist/primitives/message/MessageIf.d.ts +0 -4
  266. package/dist/primitives/message/MessageIf.d.ts.map +1 -1
  267. package/dist/primitives/message/MessageIf.js.map +1 -1
  268. package/dist/primitives/message/MessageIf.mjs.map +1 -1
  269. package/dist/primitives/message/MessageRoot.d.ts +0 -4
  270. package/dist/primitives/message/MessageRoot.d.ts.map +1 -1
  271. package/dist/primitives/message/MessageRoot.js.map +1 -1
  272. package/dist/primitives/message/MessageRoot.mjs.map +1 -1
  273. package/dist/primitives/message/index.d.ts +0 -1
  274. package/dist/primitives/message/index.d.ts.map +1 -1
  275. package/dist/primitives/message/index.js +0 -3
  276. package/dist/primitives/message/index.js.map +1 -1
  277. package/dist/primitives/message/index.mjs +0 -2
  278. package/dist/primitives/message/index.mjs.map +1 -1
  279. package/dist/primitives/thread/ThreadEmpty.d.ts +0 -4
  280. package/dist/primitives/thread/ThreadEmpty.d.ts.map +1 -1
  281. package/dist/primitives/thread/ThreadEmpty.js +2 -2
  282. package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
  283. package/dist/primitives/thread/ThreadEmpty.mjs +1 -1
  284. package/dist/primitives/thread/ThreadEmpty.mjs.map +1 -1
  285. package/dist/primitives/thread/ThreadIf.d.ts +0 -4
  286. package/dist/primitives/thread/ThreadIf.d.ts.map +1 -1
  287. package/dist/primitives/thread/ThreadIf.js.map +1 -1
  288. package/dist/primitives/thread/ThreadIf.mjs.map +1 -1
  289. package/dist/primitives/thread/ThreadMessages.d.ts +0 -4
  290. package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
  291. package/dist/primitives/thread/ThreadMessages.js.map +1 -1
  292. package/dist/primitives/thread/ThreadMessages.mjs.map +1 -1
  293. package/dist/primitives/thread/ThreadRoot.d.ts +0 -4
  294. package/dist/primitives/thread/ThreadRoot.d.ts.map +1 -1
  295. package/dist/primitives/thread/ThreadRoot.js.map +1 -1
  296. package/dist/primitives/thread/ThreadRoot.mjs.map +1 -1
  297. package/dist/primitives/thread/ThreadScrollToBottom.d.ts +0 -4
  298. package/dist/primitives/thread/ThreadScrollToBottom.d.ts.map +1 -1
  299. package/dist/primitives/thread/ThreadScrollToBottom.js.map +1 -1
  300. package/dist/primitives/thread/ThreadScrollToBottom.mjs.map +1 -1
  301. package/dist/primitives/thread/ThreadSuggestion.d.ts +0 -4
  302. package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
  303. package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
  304. package/dist/primitives/thread/ThreadSuggestion.mjs.map +1 -1
  305. package/dist/primitives/thread/ThreadViewport.d.ts +0 -4
  306. package/dist/primitives/thread/ThreadViewport.d.ts.map +1 -1
  307. package/dist/primitives/thread/ThreadViewport.js.map +1 -1
  308. package/dist/primitives/thread/ThreadViewport.mjs.map +1 -1
  309. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
  310. package/dist/primitives/threadListItem/ThreadListItemArchive.js +3 -2
  311. package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
  312. package/dist/primitives/threadListItem/ThreadListItemArchive.mjs +3 -2
  313. package/dist/primitives/threadListItem/ThreadListItemArchive.mjs.map +1 -1
  314. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts +14 -0
  315. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -0
  316. package/dist/primitives/threadListItem/ThreadListItemRoot.js +47 -0
  317. package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -0
  318. package/dist/primitives/threadListItem/ThreadListItemRoot.mjs +23 -0
  319. package/dist/primitives/threadListItem/ThreadListItemRoot.mjs.map +1 -0
  320. package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts +8 -0
  321. package/dist/primitives/threadListItem/ThreadListItemTitle.d.ts.map +1 -0
  322. package/dist/primitives/{message/MessageInProgress.js → threadListItem/ThreadListItemTitle.js} +13 -10
  323. package/dist/primitives/threadListItem/ThreadListItemTitle.js.map +1 -0
  324. package/dist/primitives/threadListItem/ThreadListItemTitle.mjs +14 -0
  325. package/dist/primitives/threadListItem/ThreadListItemTitle.mjs.map +1 -0
  326. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +13 -0
  327. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -0
  328. package/dist/{runtimes/core/subscribeToMainThread.js → primitives/threadListItem/ThreadListItemTrigger.js} +17 -22
  329. package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -0
  330. package/dist/primitives/threadListItem/ThreadListItemTrigger.mjs +21 -0
  331. package/dist/primitives/threadListItem/ThreadListItemTrigger.mjs.map +1 -0
  332. package/dist/primitives/threadListItem/index.d.ts +3 -0
  333. package/dist/primitives/threadListItem/index.d.ts.map +1 -1
  334. package/dist/primitives/threadListItem/index.js +9 -0
  335. package/dist/primitives/threadListItem/index.js.map +1 -1
  336. package/dist/primitives/threadListItem/index.mjs +6 -0
  337. package/dist/primitives/threadListItem/index.mjs.map +1 -1
  338. package/dist/runtimes/attachment/AttachmentAdapter.d.ts +3 -7
  339. package/dist/runtimes/attachment/AttachmentAdapter.d.ts.map +1 -1
  340. package/dist/runtimes/attachment/AttachmentAdapter.js.map +1 -1
  341. package/dist/runtimes/attachment/CompositeAttachmentAdapter.d.ts +2 -6
  342. package/dist/runtimes/attachment/CompositeAttachmentAdapter.d.ts.map +1 -1
  343. package/dist/runtimes/attachment/CompositeAttachmentAdapter.js +1 -2
  344. package/dist/runtimes/attachment/CompositeAttachmentAdapter.js.map +1 -1
  345. package/dist/runtimes/attachment/CompositeAttachmentAdapter.mjs +1 -2
  346. package/dist/runtimes/attachment/CompositeAttachmentAdapter.mjs.map +1 -1
  347. package/dist/runtimes/composer/BaseComposerRuntimeCore.d.ts.map +1 -1
  348. package/dist/runtimes/composer/BaseComposerRuntimeCore.js +0 -6
  349. package/dist/runtimes/composer/BaseComposerRuntimeCore.js.map +1 -1
  350. package/dist/runtimes/composer/BaseComposerRuntimeCore.mjs +0 -6
  351. package/dist/runtimes/composer/BaseComposerRuntimeCore.mjs.map +1 -1
  352. package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts +5 -4
  353. package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts.map +1 -1
  354. package/dist/runtimes/core/BaseThreadRuntimeCore.js +8 -4
  355. package/dist/runtimes/core/BaseThreadRuntimeCore.js.map +1 -1
  356. package/dist/runtimes/core/BaseThreadRuntimeCore.mjs +8 -4
  357. package/dist/runtimes/core/BaseThreadRuntimeCore.mjs.map +1 -1
  358. package/dist/runtimes/core/ComposerRuntimeCore.d.ts +0 -3
  359. package/dist/runtimes/core/ComposerRuntimeCore.d.ts.map +1 -1
  360. package/dist/runtimes/core/ComposerRuntimeCore.js.map +1 -1
  361. package/dist/runtimes/core/ThreadListRuntimeCore.d.ts +7 -10
  362. package/dist/runtimes/core/ThreadListRuntimeCore.d.ts.map +1 -1
  363. package/dist/runtimes/core/ThreadListRuntimeCore.js.map +1 -1
  364. package/dist/runtimes/core/ThreadRuntimeCore.d.ts +14 -1
  365. package/dist/runtimes/core/ThreadRuntimeCore.d.ts.map +1 -1
  366. package/dist/runtimes/core/ThreadRuntimeCore.js.map +1 -1
  367. package/dist/runtimes/core/index.d.ts +1 -2
  368. package/dist/runtimes/core/index.d.ts.map +1 -1
  369. package/dist/runtimes/core/index.js +0 -12
  370. package/dist/runtimes/core/index.js.map +1 -1
  371. package/dist/runtimes/core/index.mjs +0 -5
  372. package/dist/runtimes/core/index.mjs.map +1 -1
  373. package/dist/runtimes/edge/converters/toCoreMessages.d.ts +1 -1
  374. package/dist/runtimes/edge/converters/toCoreMessages.d.ts.map +1 -1
  375. package/dist/runtimes/edge/converters/toCoreMessages.js.map +1 -1
  376. package/dist/runtimes/edge/converters/toCoreMessages.mjs.map +1 -1
  377. package/dist/runtimes/edge/createEdgeRuntimeAPI.d.ts +0 -4
  378. package/dist/runtimes/edge/createEdgeRuntimeAPI.d.ts.map +1 -1
  379. package/dist/runtimes/edge/createEdgeRuntimeAPI.js +0 -2
  380. package/dist/runtimes/edge/createEdgeRuntimeAPI.js.map +1 -1
  381. package/dist/runtimes/edge/createEdgeRuntimeAPI.mjs +0 -2
  382. package/dist/runtimes/edge/createEdgeRuntimeAPI.mjs.map +1 -1
  383. package/dist/runtimes/edge/streams/runResultStream.js +0 -2
  384. package/dist/runtimes/edge/streams/runResultStream.js.map +1 -1
  385. package/dist/runtimes/edge/streams/runResultStream.mjs +0 -2
  386. package/dist/runtimes/edge/streams/runResultStream.mjs.map +1 -1
  387. package/dist/runtimes/external-store/ExternalStoreAdapter.d.ts +3 -16
  388. package/dist/runtimes/external-store/ExternalStoreAdapter.d.ts.map +1 -1
  389. package/dist/runtimes/external-store/ExternalStoreAdapter.js.map +1 -1
  390. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.d.ts.map +1 -1
  391. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js +0 -3
  392. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js.map +1 -1
  393. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.mjs +0 -3
  394. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.mjs.map +1 -1
  395. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts +9 -11
  396. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +1 -1
  397. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.js +33 -8
  398. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.js.map +1 -1
  399. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.mjs +33 -8
  400. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.mjs.map +1 -1
  401. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts +0 -1
  402. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
  403. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js +12 -6
  404. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js.map +1 -1
  405. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.mjs +12 -6
  406. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.mjs.map +1 -1
  407. package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
  408. package/dist/runtimes/external-store/ThreadMessageLike.js +2 -0
  409. package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
  410. package/dist/runtimes/external-store/ThreadMessageLike.mjs +2 -0
  411. package/dist/runtimes/external-store/ThreadMessageLike.mjs.map +1 -1
  412. package/dist/runtimes/local/ChatModelAdapter.d.ts +0 -8
  413. package/dist/runtimes/local/ChatModelAdapter.d.ts.map +1 -1
  414. package/dist/runtimes/local/ChatModelAdapter.js.map +1 -1
  415. package/dist/runtimes/local/LocalRuntimeOptions.d.ts +1 -6
  416. package/dist/runtimes/local/LocalRuntimeOptions.d.ts.map +1 -1
  417. package/dist/runtimes/local/LocalRuntimeOptions.js +1 -2
  418. package/dist/runtimes/local/LocalRuntimeOptions.js.map +1 -1
  419. package/dist/runtimes/local/LocalRuntimeOptions.mjs +1 -2
  420. package/dist/runtimes/local/LocalRuntimeOptions.mjs.map +1 -1
  421. package/dist/runtimes/local/LocalThreadListRuntimeCore.d.ts +16 -20
  422. package/dist/runtimes/local/LocalThreadListRuntimeCore.d.ts.map +1 -1
  423. package/dist/runtimes/local/LocalThreadListRuntimeCore.js +112 -72
  424. package/dist/runtimes/local/LocalThreadListRuntimeCore.js.map +1 -1
  425. package/dist/runtimes/local/LocalThreadListRuntimeCore.mjs +112 -72
  426. package/dist/runtimes/local/LocalThreadListRuntimeCore.mjs.map +1 -1
  427. package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.d.ts +19 -0
  428. package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.d.ts.map +1 -0
  429. package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.js +87 -0
  430. package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.js.map +1 -0
  431. package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.mjs +62 -0
  432. package/dist/runtimes/local/LocalThreadMetadataRuntimeCore.mjs.map +1 -0
  433. package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts +1 -1
  434. package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts.map +1 -1
  435. package/dist/runtimes/local/LocalThreadRuntimeCore.js +15 -11
  436. package/dist/runtimes/local/LocalThreadRuntimeCore.js.map +1 -1
  437. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs +15 -11
  438. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs.map +1 -1
  439. package/dist/styles/index.css.map +1 -1
  440. package/dist/types/AssistantTypes.d.ts +1 -18
  441. package/dist/types/AssistantTypes.d.ts.map +1 -1
  442. package/dist/types/AssistantTypes.js.map +1 -1
  443. package/dist/types/AttachmentTypes.d.ts +1 -1
  444. package/dist/types/AttachmentTypes.d.ts.map +1 -1
  445. package/dist/types/AttachmentTypes.js.map +1 -1
  446. package/dist/types/ContentPartComponentTypes.d.ts +4 -28
  447. package/dist/types/ContentPartComponentTypes.d.ts.map +1 -1
  448. package/dist/types/ContentPartComponentTypes.js.map +1 -1
  449. package/dist/ui/assistant-message.d.ts +1 -10
  450. package/dist/ui/assistant-message.d.ts.map +1 -1
  451. package/dist/ui/assistant-message.js.map +1 -1
  452. package/dist/ui/assistant-message.mjs.map +1 -1
  453. package/dist/ui/composer.d.ts +1 -25
  454. package/dist/ui/composer.d.ts.map +1 -1
  455. package/dist/ui/composer.js.map +1 -1
  456. package/dist/ui/composer.mjs.map +1 -1
  457. package/dist/ui/index.d.ts +6 -14
  458. package/dist/ui/index.d.ts.map +1 -1
  459. package/dist/ui/index.js +0 -4
  460. package/dist/ui/index.js.map +1 -1
  461. package/dist/ui/index.mjs +14 -24
  462. package/dist/ui/index.mjs.map +1 -1
  463. package/dist/ui/thread-welcome.d.ts +5 -17
  464. package/dist/ui/thread-welcome.d.ts.map +1 -1
  465. package/dist/ui/thread-welcome.js.map +1 -1
  466. package/dist/ui/thread-welcome.mjs.map +1 -1
  467. package/dist/ui/thread.d.ts +1 -19
  468. package/dist/ui/thread.d.ts.map +1 -1
  469. package/dist/ui/thread.js.map +1 -1
  470. package/dist/ui/thread.mjs.map +1 -1
  471. package/dist/ui/user-message.d.ts +1 -18
  472. package/dist/ui/user-message.d.ts.map +1 -1
  473. package/dist/ui/user-message.js.map +1 -1
  474. package/dist/ui/user-message.mjs.map +1 -1
  475. package/dist/utils/smooth/SmoothContext.js +2 -2
  476. package/dist/utils/smooth/SmoothContext.js.map +1 -1
  477. package/dist/utils/smooth/SmoothContext.mjs +3 -3
  478. package/dist/utils/smooth/SmoothContext.mjs.map +1 -1
  479. package/dist/utils/smooth/useSmooth.d.ts.map +1 -1
  480. package/dist/utils/smooth/useSmooth.js +0 -1
  481. package/dist/utils/smooth/useSmooth.js.map +1 -1
  482. package/dist/utils/smooth/useSmooth.mjs +0 -1
  483. package/dist/utils/smooth/useSmooth.mjs.map +1 -1
  484. package/package.json +5 -5
  485. package/src/api/AssistantRuntime.ts +1 -23
  486. package/src/api/AttachmentRuntime.ts +0 -12
  487. package/src/api/ComposerRuntime.ts +11 -207
  488. package/src/api/ContentPartRuntime.ts +0 -4
  489. package/src/api/MessageRuntime.ts +7 -11
  490. package/src/api/ThreadListItemRuntime.ts +16 -8
  491. package/src/api/ThreadListRuntime.ts +34 -53
  492. package/src/api/ThreadRuntime.ts +11 -203
  493. package/src/context/providers/AssistantRuntimeProvider.tsx +0 -1
  494. package/src/context/providers/TextContentPartProvider.tsx +0 -2
  495. package/src/context/providers/ThreadRuntimeProvider.tsx +1 -17
  496. package/src/context/react/AssistantContext.ts +0 -25
  497. package/src/context/react/ComposerContext.ts +1 -1
  498. package/src/context/react/ContentPartContext.ts +1 -1
  499. package/src/context/react/MessageContext.ts +2 -2
  500. package/src/context/react/ThreadContext.ts +5 -42
  501. package/src/context/react/index.ts +2 -125
  502. package/src/index.ts +0 -1
  503. package/src/internal.ts +1 -0
  504. package/src/model-config/useAssistantToolUI.tsx +0 -1
  505. package/src/primitive-hooks/contentPart/useContentPartDisplay.tsx +1 -1
  506. package/src/primitive-hooks/contentPart/useContentPartImage.tsx +1 -2
  507. package/src/primitive-hooks/contentPart/useContentPartText.tsx +1 -1
  508. package/src/primitive-hooks/index.ts +0 -5
  509. package/src/primitives/actionBar/ActionBarCopy.tsx +0 -5
  510. package/src/primitives/actionBar/ActionBarEdit.tsx +0 -5
  511. package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +0 -6
  512. package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +0 -6
  513. package/src/primitives/actionBar/ActionBarReload.tsx +0 -5
  514. package/src/primitives/actionBar/ActionBarRoot.tsx +0 -5
  515. package/src/primitives/actionBar/ActionBarSpeak.tsx +0 -5
  516. package/src/primitives/actionBar/ActionBarStopSpeaking.tsx +0 -6
  517. package/src/primitives/assistantModal/AssistantModalContent.tsx +1 -7
  518. package/src/primitives/assistantModal/AssistantModalRoot.tsx +0 -6
  519. package/src/primitives/assistantModal/AssistantModalTrigger.tsx +0 -6
  520. package/src/primitives/branchPicker/BranchPickerCount.tsx +0 -5
  521. package/src/primitives/branchPicker/BranchPickerNext.tsx +0 -6
  522. package/src/primitives/branchPicker/BranchPickerNumber.tsx +0 -5
  523. package/src/primitives/branchPicker/BranchPickerPrevious.tsx +1 -6
  524. package/src/primitives/branchPicker/BranchPickerRoot.tsx +0 -5
  525. package/src/primitives/composer/ComposerAddAttachment.tsx +2 -7
  526. package/src/primitives/composer/ComposerAttachments.tsx +0 -6
  527. package/src/primitives/composer/ComposerCancel.tsx +0 -5
  528. package/src/primitives/composer/ComposerIf.tsx +0 -5
  529. package/src/primitives/composer/ComposerInput.tsx +0 -5
  530. package/src/primitives/composer/ComposerRoot.tsx +1 -3
  531. package/src/primitives/composer/ComposerSend.tsx +2 -7
  532. package/src/primitives/contentPart/ContentPartDisplay.tsx +0 -6
  533. package/src/primitives/contentPart/ContentPartImage.tsx +0 -5
  534. package/src/primitives/contentPart/ContentPartInProgress.tsx +0 -6
  535. package/src/primitives/contentPart/ContentPartText.tsx +0 -5
  536. package/src/primitives/index.ts +0 -8
  537. package/src/primitives/message/MessageAttachments.tsx +2 -10
  538. package/src/primitives/message/MessageContent.tsx +7 -15
  539. package/src/primitives/message/MessageIf.tsx +0 -5
  540. package/src/primitives/message/MessageRoot.tsx +0 -5
  541. package/src/primitives/message/index.ts +0 -1
  542. package/src/primitives/thread/ThreadEmpty.tsx +1 -6
  543. package/src/primitives/thread/ThreadIf.tsx +0 -5
  544. package/src/primitives/thread/ThreadMessages.tsx +0 -5
  545. package/src/primitives/thread/ThreadRoot.tsx +0 -5
  546. package/src/primitives/thread/ThreadScrollToBottom.tsx +0 -6
  547. package/src/primitives/thread/ThreadSuggestion.tsx +0 -5
  548. package/src/primitives/thread/ThreadViewport.tsx +0 -5
  549. package/src/primitives/threadListItem/ThreadListItemArchive.ts +3 -2
  550. package/src/primitives/threadListItem/ThreadListItemRoot.tsx +29 -0
  551. package/src/primitives/threadListItem/ThreadListItemTitle.tsx +19 -0
  552. package/src/primitives/threadListItem/ThreadListItemTrigger.ts +25 -0
  553. package/src/primitives/threadListItem/index.ts +4 -1
  554. package/src/runtimes/attachment/AttachmentAdapter.ts +2 -12
  555. package/src/runtimes/attachment/CompositeAttachmentAdapter.ts +1 -1
  556. package/src/runtimes/composer/BaseComposerRuntimeCore.tsx +0 -8
  557. package/src/runtimes/core/BaseThreadRuntimeCore.tsx +11 -5
  558. package/src/runtimes/core/ComposerRuntimeCore.tsx +0 -3
  559. package/src/runtimes/core/ThreadListRuntimeCore.tsx +7 -11
  560. package/src/runtimes/core/ThreadRuntimeCore.tsx +18 -1
  561. package/src/runtimes/core/index.ts +1 -2
  562. package/src/runtimes/edge/converters/toCoreMessages.ts +1 -1
  563. package/src/runtimes/edge/createEdgeRuntimeAPI.ts +0 -6
  564. package/src/runtimes/edge/streams/runResultStream.ts +0 -2
  565. package/src/runtimes/external-store/ExternalStoreAdapter.tsx +3 -17
  566. package/src/runtimes/external-store/ExternalStoreRuntimeCore.tsx +0 -3
  567. package/src/runtimes/external-store/ExternalStoreThreadListRuntimeCore.tsx +47 -10
  568. package/src/runtimes/external-store/ExternalStoreThreadRuntimeCore.tsx +12 -6
  569. package/src/runtimes/external-store/ThreadMessageLike.tsx +4 -3
  570. package/src/runtimes/local/ChatModelAdapter.tsx +0 -9
  571. package/src/runtimes/local/LocalRuntimeOptions.tsx +1 -7
  572. package/src/runtimes/local/LocalThreadListRuntimeCore.tsx +140 -96
  573. package/src/runtimes/local/LocalThreadMetadataRuntimeCore.tsx +79 -0
  574. package/src/runtimes/local/LocalThreadRuntimeCore.tsx +16 -11
  575. package/src/types/AssistantTypes.ts +1 -20
  576. package/src/types/AttachmentTypes.ts +1 -2
  577. package/src/types/ContentPartComponentTypes.tsx +4 -31
  578. package/src/ui/assistant-message.tsx +0 -5
  579. package/src/ui/composer.tsx +0 -5
  580. package/src/ui/index.ts +5 -23
  581. package/src/ui/thread-welcome.tsx +6 -9
  582. package/src/ui/thread.tsx +0 -5
  583. package/src/ui/user-message.tsx +2 -12
  584. package/src/utils/smooth/SmoothContext.tsx +3 -3
  585. package/src/utils/smooth/useSmooth.tsx +0 -1
  586. package/dist/hooks/index.d.ts +0 -3
  587. package/dist/hooks/index.d.ts.map +0 -1
  588. package/dist/hooks/index.js +0 -34
  589. package/dist/hooks/index.js.map +0 -1
  590. package/dist/hooks/index.mjs +0 -8
  591. package/dist/hooks/index.mjs.map +0 -1
  592. package/dist/hooks/useAppendMessage.d.ts +0 -6
  593. package/dist/hooks/useAppendMessage.d.ts.map +0 -1
  594. package/dist/hooks/useAppendMessage.js +0 -42
  595. package/dist/hooks/useAppendMessage.js.map +0 -1
  596. package/dist/hooks/useAppendMessage.mjs +0 -17
  597. package/dist/hooks/useAppendMessage.mjs.map +0 -1
  598. package/dist/hooks/useSwitchToNewThread.d.ts +0 -5
  599. package/dist/hooks/useSwitchToNewThread.d.ts.map +0 -1
  600. package/dist/hooks/useSwitchToNewThread.js +0 -39
  601. package/dist/hooks/useSwitchToNewThread.js.map +0 -1
  602. package/dist/hooks/useSwitchToNewThread.mjs +0 -14
  603. package/dist/hooks/useSwitchToNewThread.mjs.map +0 -1
  604. package/dist/primitive-hooks/actionBar/index.d.ts +0 -34
  605. package/dist/primitive-hooks/actionBar/index.d.ts.map +0 -1
  606. package/dist/primitive-hooks/actionBar/index.js +0 -49
  607. package/dist/primitive-hooks/actionBar/index.js.map +0 -1
  608. package/dist/primitive-hooks/actionBar/index.mjs +0 -20
  609. package/dist/primitive-hooks/actionBar/index.mjs.map +0 -1
  610. package/dist/primitive-hooks/branchPicker/index.d.ts +0 -17
  611. package/dist/primitive-hooks/branchPicker/index.d.ts.map +0 -1
  612. package/dist/primitive-hooks/branchPicker/index.js +0 -40
  613. package/dist/primitive-hooks/branchPicker/index.js.map +0 -1
  614. package/dist/primitive-hooks/branchPicker/index.mjs +0 -12
  615. package/dist/primitive-hooks/branchPicker/index.mjs.map +0 -1
  616. package/dist/primitive-hooks/composer/index.d.ts +0 -17
  617. package/dist/primitive-hooks/composer/index.d.ts.map +0 -1
  618. package/dist/primitive-hooks/composer/index.js +0 -40
  619. package/dist/primitive-hooks/composer/index.js.map +0 -1
  620. package/dist/primitive-hooks/composer/index.mjs +0 -12
  621. package/dist/primitive-hooks/composer/index.mjs.map +0 -1
  622. package/dist/primitive-hooks/message/index.d.ts +0 -5
  623. package/dist/primitive-hooks/message/index.d.ts.map +0 -1
  624. package/dist/primitive-hooks/message/index.js +0 -31
  625. package/dist/primitive-hooks/message/index.js.map +0 -1
  626. package/dist/primitive-hooks/message/index.mjs +0 -6
  627. package/dist/primitive-hooks/message/index.mjs.map +0 -1
  628. package/dist/primitive-hooks/thread/index.d.ts +0 -17
  629. package/dist/primitive-hooks/thread/index.d.ts.map +0 -1
  630. package/dist/primitive-hooks/thread/index.js +0 -40
  631. package/dist/primitive-hooks/thread/index.js.map +0 -1
  632. package/dist/primitive-hooks/thread/index.mjs +0 -12
  633. package/dist/primitive-hooks/thread/index.mjs.map +0 -1
  634. package/dist/primitives/actionBar/types.d.ts +0 -9
  635. package/dist/primitives/actionBar/types.d.ts.map +0 -1
  636. package/dist/primitives/actionBar/types.js +0 -19
  637. package/dist/primitives/actionBar/types.js.map +0 -1
  638. package/dist/primitives/actionBar/types.mjs +0 -1
  639. package/dist/primitives/actionBar/types.mjs.map +0 -1
  640. package/dist/primitives/assistantModal/types.d.ts +0 -4
  641. package/dist/primitives/assistantModal/types.d.ts.map +0 -1
  642. package/dist/primitives/assistantModal/types.js +0 -19
  643. package/dist/primitives/assistantModal/types.js.map +0 -1
  644. package/dist/primitives/assistantModal/types.mjs +0 -1
  645. package/dist/primitives/assistantModal/types.mjs.map +0 -1
  646. package/dist/primitives/attachment/types.d.ts +0 -1
  647. package/dist/primitives/attachment/types.d.ts.map +0 -1
  648. package/dist/primitives/attachment/types.js +0 -2
  649. package/dist/primitives/attachment/types.js.map +0 -1
  650. package/dist/primitives/attachment/types.mjs +0 -1
  651. package/dist/primitives/attachment/types.mjs.map +0 -1
  652. package/dist/primitives/branchPicker/types.d.ts +0 -6
  653. package/dist/primitives/branchPicker/types.d.ts.map +0 -1
  654. package/dist/primitives/branchPicker/types.js +0 -19
  655. package/dist/primitives/branchPicker/types.js.map +0 -1
  656. package/dist/primitives/branchPicker/types.mjs +0 -1
  657. package/dist/primitives/branchPicker/types.mjs.map +0 -1
  658. package/dist/primitives/composer/types.d.ts +0 -6
  659. package/dist/primitives/composer/types.d.ts.map +0 -1
  660. package/dist/primitives/composer/types.js +0 -19
  661. package/dist/primitives/composer/types.js.map +0 -1
  662. package/dist/primitives/composer/types.mjs +0 -1
  663. package/dist/primitives/composer/types.mjs.map +0 -1
  664. package/dist/primitives/contentPart/types.d.ts +0 -5
  665. package/dist/primitives/contentPart/types.d.ts.map +0 -1
  666. package/dist/primitives/contentPart/types.js +0 -19
  667. package/dist/primitives/contentPart/types.js.map +0 -1
  668. package/dist/primitives/contentPart/types.mjs +0 -1
  669. package/dist/primitives/contentPart/types.mjs.map +0 -1
  670. package/dist/primitives/message/MessageInProgress.d.ts +0 -13
  671. package/dist/primitives/message/MessageInProgress.d.ts.map +0 -1
  672. package/dist/primitives/message/MessageInProgress.js.map +0 -1
  673. package/dist/primitives/message/MessageInProgress.mjs +0 -11
  674. package/dist/primitives/message/MessageInProgress.mjs.map +0 -1
  675. package/dist/primitives/message/types.d.ts +0 -5
  676. package/dist/primitives/message/types.d.ts.map +0 -1
  677. package/dist/primitives/message/types.js +0 -19
  678. package/dist/primitives/message/types.js.map +0 -1
  679. package/dist/primitives/message/types.mjs +0 -1
  680. package/dist/primitives/message/types.mjs.map +0 -1
  681. package/dist/primitives/thread/types.d.ts +0 -8
  682. package/dist/primitives/thread/types.d.ts.map +0 -1
  683. package/dist/primitives/thread/types.js +0 -19
  684. package/dist/primitives/thread/types.js.map +0 -1
  685. package/dist/primitives/thread/types.mjs +0 -1
  686. package/dist/primitives/thread/types.mjs.map +0 -1
  687. package/dist/runtimes/core/subscribeToMainThread.d.ts +0 -6
  688. package/dist/runtimes/core/subscribeToMainThread.d.ts.map +0 -1
  689. package/dist/runtimes/core/subscribeToMainThread.js.map +0 -1
  690. package/dist/runtimes/core/subscribeToMainThread.mjs +0 -23
  691. package/dist/runtimes/core/subscribeToMainThread.mjs.map +0 -1
  692. package/src/hooks/index.ts +0 -2
  693. package/src/hooks/useAppendMessage.tsx +0 -19
  694. package/src/hooks/useSwitchToNewThread.tsx +0 -14
  695. package/src/primitive-hooks/actionBar/index.ts +0 -39
  696. package/src/primitive-hooks/branchPicker/index.ts +0 -18
  697. package/src/primitive-hooks/composer/index.ts +0 -17
  698. package/src/primitive-hooks/message/index.ts +0 -4
  699. package/src/primitive-hooks/thread/index.ts +0 -16
  700. package/src/primitives/actionBar/types.ts +0 -8
  701. package/src/primitives/assistantModal/types.ts +0 -3
  702. package/src/primitives/attachment/types.ts +0 -0
  703. package/src/primitives/branchPicker/types.ts +0 -5
  704. package/src/primitives/composer/types.ts +0 -5
  705. package/src/primitives/contentPart/types.ts +0 -4
  706. package/src/primitives/message/MessageInProgress.tsx +0 -22
  707. package/src/primitives/message/types.ts +0 -4
  708. package/src/primitives/thread/types.ts +0 -7
  709. package/src/runtimes/core/subscribeToMainThread.ts +0 -30
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/message/MessageContent.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentType, type FC, memo, useMemo } from \"react\";\nimport {\n useContentPart,\n useContentPartRuntime,\n useToolUIs,\n} from \"../../context\";\nimport {\n useMessage,\n useMessageRuntime,\n} from \"../../context/react/MessageContext\";\nimport { ContentPartRuntimeProvider } from \"../../context/providers/ContentPartRuntimeProvider\";\nimport { ContentPartPrimitiveText } from \"../contentPart/ContentPartText\";\nimport { ContentPartPrimitiveImage } from \"../contentPart/ContentPartImage\";\nimport { ContentPartPrimitiveDisplay } from \"../contentPart/ContentPartDisplay\";\nimport type {\n Unstable_AudioContentPartComponent,\n EmptyContentPartComponent,\n ImageContentPartComponent,\n TextContentPartComponent,\n ToolCallContentPartComponent,\n ToolCallContentPartProps,\n UIContentPartComponent,\n} from \"../../types/ContentPartComponentTypes\";\nimport { ContentPartPrimitiveInProgress } from \"../contentPart/ContentPartInProgress\";\nimport { EMPTY_CONTENT } from \"../../api/MessageRuntime\";\n\n/**\n * @deprecated Use `MessagePrimitive.Content.Props` instead. This will be removed in 0.6.\n */\nexport type MessagePrimitiveContentProps = MessagePrimitiveContent.Props;\n\nexport namespace MessagePrimitiveContent {\n export type Props = {\n components?:\n | {\n Empty?: EmptyContentPartComponent | undefined;\n Text?: TextContentPartComponent | undefined;\n Image?: ImageContentPartComponent | undefined;\n Unstable_Audio?: Unstable_AudioContentPartComponent | undefined;\n UI?: UIContentPartComponent | undefined;\n tools?:\n | {\n by_name?:\n | Record<string, ToolCallContentPartComponent | undefined>\n | undefined;\n Fallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n }\n | undefined;\n };\n}\n\nconst ToolUIDisplay = ({\n UI,\n ...props\n}: {\n UI: ToolCallContentPartComponent | undefined;\n} & ToolCallContentPartProps) => {\n const Render = useToolUIs((s) => s.getToolUI(props.toolName)) ?? UI;\n if (!Render) return null;\n return <Render {...props} />;\n};\n\nconst defaultComponents = {\n Text: () => (\n <p style={{ whiteSpace: \"pre-line\" }}>\n <ContentPartPrimitiveText />\n <ContentPartPrimitiveInProgress>\n <span style={{ fontFamily: \"revert\" }}>{\" \\u25CF\"}</span>\n </ContentPartPrimitiveInProgress>\n </p>\n ),\n Image: () => <ContentPartPrimitiveImage />,\n Unstable_Audio: () => null,\n UI: () => <ContentPartPrimitiveDisplay />,\n} satisfies MessagePrimitiveContent.Props[\"components\"];\n\ntype MessageContentPartComponentProps = {\n components: MessagePrimitiveContent.Props[\"components\"];\n};\n\nconst MessageContentPartComponent: FC<MessageContentPartComponentProps> = ({\n components: {\n Text = defaultComponents.Text,\n Empty,\n Image = defaultComponents.Image,\n UI = defaultComponents.UI,\n Unstable_Audio: Audio = defaultComponents.Unstable_Audio,\n tools: { by_name = {}, Fallback = undefined } = {},\n } = {},\n}) => {\n const contentPartRuntime = useContentPartRuntime();\n\n const part = useContentPart();\n\n const type = part.type;\n if (type === \"tool-call\") {\n const Tool = by_name[part.toolName] || Fallback;\n const addResult = (result: any) => contentPartRuntime.addToolResult(result);\n return (\n <ToolUIDisplay {...part} part={part} UI={Tool} addResult={addResult} />\n );\n }\n\n if (part.status.type === \"requires-action\")\n throw new Error(\"Encountered unexpected requires-action status\");\n\n switch (type) {\n case \"text\":\n // TODO this relies on deprecated .part field\n if (part.part === EMPTY_CONTENT && !!Empty) {\n return <Empty status={part.status} />;\n }\n\n return <Text {...part} part={part} />;\n\n case \"image\":\n // eslint-disable-next-line jsx-a11y/alt-text\n return <Image {...part} part={part} />;\n\n case \"audio\":\n return <Audio {...part} part={part} />;\n\n case \"ui\":\n return <UI {...part} part={part} />;\n\n default:\n const unhandledType: never = type;\n throw new Error(`Unknown content part type: ${unhandledType}`);\n }\n};\n\ntype MessageContentPartProps = {\n partIndex: number;\n components: MessagePrimitiveContent.Props[\"components\"];\n};\n\nconst MessageContentPartImpl: FC<MessageContentPartProps> = ({\n partIndex,\n components,\n}) => {\n const messageRuntime = useMessageRuntime();\n const runtime = useMemo(\n () => messageRuntime.getContentPartByIndex(partIndex),\n [messageRuntime, partIndex],\n );\n\n return (\n <ContentPartRuntimeProvider runtime={runtime}>\n <MessageContentPartComponent components={components} />\n </ContentPartRuntimeProvider>\n );\n};\n\nconst MessageContentPart = memo(\n MessageContentPartImpl,\n (prev, next) =>\n prev.partIndex === next.partIndex &&\n prev.components?.Text === next.components?.Text &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.Unstable_Audio === next.components?.Unstable_Audio &&\n prev.components?.UI === next.components?.UI &&\n prev.components?.tools === next.components?.tools,\n);\n\nexport const MessagePrimitiveContent: FC<MessagePrimitiveContent.Props> = ({\n components,\n}) => {\n const contentLength = useMessage((s) => s.content.length) || 1;\n\n return Array.from({ length: contentLength }, (_, index) => (\n <MessageContentPart key={index} partIndex={index} components={components} />\n ));\n};\n\nMessagePrimitiveContent.displayName = \"MessagePrimitive.Content\";\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/message/MessageContent.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentType, type FC, memo, useMemo } from \"react\";\nimport {\n useContentPart,\n useContentPartRuntime,\n useToolUIs,\n} from \"../../context\";\nimport {\n useMessage,\n useMessageRuntime,\n} from \"../../context/react/MessageContext\";\nimport { ContentPartRuntimeProvider } from \"../../context/providers/ContentPartRuntimeProvider\";\nimport { ContentPartPrimitiveText } from \"../contentPart/ContentPartText\";\nimport { ContentPartPrimitiveImage } from \"../contentPart/ContentPartImage\";\nimport { ContentPartPrimitiveDisplay } from \"../contentPart/ContentPartDisplay\";\nimport type {\n Unstable_AudioContentPartComponent,\n EmptyContentPartComponent,\n ImageContentPartComponent,\n TextContentPartComponent,\n ToolCallContentPartComponent,\n ToolCallContentPartProps,\n UIContentPartComponent,\n} from \"../../types/ContentPartComponentTypes\";\nimport { ContentPartPrimitiveInProgress } from \"../contentPart/ContentPartInProgress\";\nimport { EMPTY_CONTENT_SYMBOL } from \"../../api/MessageRuntime\";\n\nexport namespace MessagePrimitiveContent {\n export type Props = {\n components?:\n | {\n Empty?: EmptyContentPartComponent | undefined;\n Text?: TextContentPartComponent | undefined;\n Image?: ImageContentPartComponent | undefined;\n Unstable_Audio?: Unstable_AudioContentPartComponent | undefined;\n UI?: UIContentPartComponent | undefined;\n tools?:\n | {\n by_name?:\n | Record<string, ToolCallContentPartComponent | undefined>\n | undefined;\n Fallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n }\n | undefined;\n };\n}\n\nconst ToolUIDisplay = ({\n UI,\n ...props\n}: {\n UI: ToolCallContentPartComponent | undefined;\n} & ToolCallContentPartProps) => {\n const Render = useToolUIs((s) => s.getToolUI(props.toolName)) ?? UI;\n if (!Render) return null;\n return <Render {...props} />;\n};\n\nconst defaultComponents = {\n Text: () => (\n <p style={{ whiteSpace: \"pre-line\" }}>\n <ContentPartPrimitiveText />\n <ContentPartPrimitiveInProgress>\n <span style={{ fontFamily: \"revert\" }}>{\" \\u25CF\"}</span>\n </ContentPartPrimitiveInProgress>\n </p>\n ),\n Image: () => <ContentPartPrimitiveImage />,\n Unstable_Audio: () => null,\n UI: () => <ContentPartPrimitiveDisplay />,\n} satisfies MessagePrimitiveContent.Props[\"components\"];\n\ntype MessageContentPartComponentProps = {\n components: MessagePrimitiveContent.Props[\"components\"];\n};\n\nconst MessageContentPartComponent: FC<MessageContentPartComponentProps> = ({\n components: {\n Text = defaultComponents.Text,\n Empty,\n Image = defaultComponents.Image,\n UI = defaultComponents.UI,\n Unstable_Audio: Audio = defaultComponents.Unstable_Audio,\n tools: { by_name = {}, Fallback = undefined } = {},\n } = {},\n}) => {\n const contentPartRuntime = useContentPartRuntime();\n\n const part = useContentPart();\n\n const type = part.type;\n if (type === \"tool-call\") {\n const Tool = by_name[part.toolName] || Fallback;\n const addResult = (result: any) => contentPartRuntime.addToolResult(result);\n return <ToolUIDisplay {...part} UI={Tool} addResult={addResult} />;\n }\n\n if (part.status.type === \"requires-action\")\n throw new Error(\"Encountered unexpected requires-action status\");\n\n switch (type) {\n case \"text\":\n if ((part as any)[EMPTY_CONTENT_SYMBOL] && !!Empty) {\n return <Empty status={part.status} />;\n }\n\n return <Text {...part} />;\n\n case \"image\":\n // eslint-disable-next-line jsx-a11y/alt-text\n return <Image {...part} />;\n\n case \"audio\":\n return <Audio {...part} />;\n\n case \"ui\":\n return <UI {...part} />;\n\n default:\n const unhandledType: never = type;\n throw new Error(`Unknown content part type: ${unhandledType}`);\n }\n};\n\ntype MessageContentPartProps = {\n partIndex: number;\n components: MessagePrimitiveContent.Props[\"components\"];\n};\n\nconst MessageContentPartImpl: FC<MessageContentPartProps> = ({\n partIndex,\n components,\n}) => {\n const messageRuntime = useMessageRuntime();\n const runtime = useMemo(\n () => messageRuntime.getContentPartByIndex(partIndex),\n [messageRuntime, partIndex],\n );\n\n return (\n <ContentPartRuntimeProvider runtime={runtime}>\n <MessageContentPartComponent components={components} />\n </ContentPartRuntimeProvider>\n );\n};\n\nconst MessageContentPart = memo(\n MessageContentPartImpl,\n (prev, next) =>\n prev.partIndex === next.partIndex &&\n prev.components?.Text === next.components?.Text &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.Unstable_Audio === next.components?.Unstable_Audio &&\n prev.components?.UI === next.components?.UI &&\n prev.components?.tools === next.components?.tools,\n);\n\nexport const MessagePrimitiveContent: FC<MessagePrimitiveContent.Props> = ({\n components,\n}) => {\n const contentLength = useMessage((s) => s.content.length) || 1;\n\n return Array.from({ length: contentLength }, (_, index) => (\n <MessageContentPart key={index} partIndex={index} components={components} />\n ));\n};\n\nMessagePrimitiveContent.displayName = \"MessagePrimitive.Content\";\n"],"mappings":"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","names":[]}
@@ -16,7 +16,7 @@ import { ContentPartPrimitiveText } from "../contentPart/ContentPartText.mjs";
16
16
  import { ContentPartPrimitiveImage } from "../contentPart/ContentPartImage.mjs";
17
17
  import { ContentPartPrimitiveDisplay } from "../contentPart/ContentPartDisplay.mjs";
18
18
  import { ContentPartPrimitiveInProgress } from "../contentPart/ContentPartInProgress.mjs";
19
- import { EMPTY_CONTENT } from "../../api/MessageRuntime.mjs";
19
+ import { EMPTY_CONTENT_SYMBOL } from "../../api/MessageRuntime.mjs";
20
20
  import { jsx, jsxs } from "react/jsx-runtime";
21
21
  var ToolUIDisplay = ({
22
22
  UI,
@@ -51,22 +51,22 @@ var MessageContentPartComponent = ({
51
51
  if (type === "tool-call") {
52
52
  const Tool = by_name[part.toolName] || Fallback;
53
53
  const addResult = (result) => contentPartRuntime.addToolResult(result);
54
- return /* @__PURE__ */ jsx(ToolUIDisplay, { ...part, part, UI: Tool, addResult });
54
+ return /* @__PURE__ */ jsx(ToolUIDisplay, { ...part, UI: Tool, addResult });
55
55
  }
56
56
  if (part.status.type === "requires-action")
57
57
  throw new Error("Encountered unexpected requires-action status");
58
58
  switch (type) {
59
59
  case "text":
60
- if (part.part === EMPTY_CONTENT && !!Empty) {
60
+ if (part[EMPTY_CONTENT_SYMBOL] && !!Empty) {
61
61
  return /* @__PURE__ */ jsx(Empty, { status: part.status });
62
62
  }
63
- return /* @__PURE__ */ jsx(Text, { ...part, part });
63
+ return /* @__PURE__ */ jsx(Text, { ...part });
64
64
  case "image":
65
- return /* @__PURE__ */ jsx(Image, { ...part, part });
65
+ return /* @__PURE__ */ jsx(Image, { ...part });
66
66
  case "audio":
67
- return /* @__PURE__ */ jsx(Audio, { ...part, part });
67
+ return /* @__PURE__ */ jsx(Audio, { ...part });
68
68
  case "ui":
69
- return /* @__PURE__ */ jsx(UI, { ...part, part });
69
+ return /* @__PURE__ */ jsx(UI, { ...part });
70
70
  default:
71
71
  const unhandledType = type;
72
72
  throw new Error(`Unknown content part type: ${unhandledType}`);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/message/MessageContent.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentType, type FC, memo, useMemo } from \"react\";\nimport {\n useContentPart,\n useContentPartRuntime,\n useToolUIs,\n} from \"../../context\";\nimport {\n useMessage,\n useMessageRuntime,\n} from \"../../context/react/MessageContext\";\nimport { ContentPartRuntimeProvider } from \"../../context/providers/ContentPartRuntimeProvider\";\nimport { ContentPartPrimitiveText } from \"../contentPart/ContentPartText\";\nimport { ContentPartPrimitiveImage } from \"../contentPart/ContentPartImage\";\nimport { ContentPartPrimitiveDisplay } from \"../contentPart/ContentPartDisplay\";\nimport type {\n Unstable_AudioContentPartComponent,\n EmptyContentPartComponent,\n ImageContentPartComponent,\n TextContentPartComponent,\n ToolCallContentPartComponent,\n ToolCallContentPartProps,\n UIContentPartComponent,\n} from \"../../types/ContentPartComponentTypes\";\nimport { ContentPartPrimitiveInProgress } from \"../contentPart/ContentPartInProgress\";\nimport { EMPTY_CONTENT } from \"../../api/MessageRuntime\";\n\n/**\n * @deprecated Use `MessagePrimitive.Content.Props` instead. This will be removed in 0.6.\n */\nexport type MessagePrimitiveContentProps = MessagePrimitiveContent.Props;\n\nexport namespace MessagePrimitiveContent {\n export type Props = {\n components?:\n | {\n Empty?: EmptyContentPartComponent | undefined;\n Text?: TextContentPartComponent | undefined;\n Image?: ImageContentPartComponent | undefined;\n Unstable_Audio?: Unstable_AudioContentPartComponent | undefined;\n UI?: UIContentPartComponent | undefined;\n tools?:\n | {\n by_name?:\n | Record<string, ToolCallContentPartComponent | undefined>\n | undefined;\n Fallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n }\n | undefined;\n };\n}\n\nconst ToolUIDisplay = ({\n UI,\n ...props\n}: {\n UI: ToolCallContentPartComponent | undefined;\n} & ToolCallContentPartProps) => {\n const Render = useToolUIs((s) => s.getToolUI(props.toolName)) ?? UI;\n if (!Render) return null;\n return <Render {...props} />;\n};\n\nconst defaultComponents = {\n Text: () => (\n <p style={{ whiteSpace: \"pre-line\" }}>\n <ContentPartPrimitiveText />\n <ContentPartPrimitiveInProgress>\n <span style={{ fontFamily: \"revert\" }}>{\" \\u25CF\"}</span>\n </ContentPartPrimitiveInProgress>\n </p>\n ),\n Image: () => <ContentPartPrimitiveImage />,\n Unstable_Audio: () => null,\n UI: () => <ContentPartPrimitiveDisplay />,\n} satisfies MessagePrimitiveContent.Props[\"components\"];\n\ntype MessageContentPartComponentProps = {\n components: MessagePrimitiveContent.Props[\"components\"];\n};\n\nconst MessageContentPartComponent: FC<MessageContentPartComponentProps> = ({\n components: {\n Text = defaultComponents.Text,\n Empty,\n Image = defaultComponents.Image,\n UI = defaultComponents.UI,\n Unstable_Audio: Audio = defaultComponents.Unstable_Audio,\n tools: { by_name = {}, Fallback = undefined } = {},\n } = {},\n}) => {\n const contentPartRuntime = useContentPartRuntime();\n\n const part = useContentPart();\n\n const type = part.type;\n if (type === \"tool-call\") {\n const Tool = by_name[part.toolName] || Fallback;\n const addResult = (result: any) => contentPartRuntime.addToolResult(result);\n return (\n <ToolUIDisplay {...part} part={part} UI={Tool} addResult={addResult} />\n );\n }\n\n if (part.status.type === \"requires-action\")\n throw new Error(\"Encountered unexpected requires-action status\");\n\n switch (type) {\n case \"text\":\n // TODO this relies on deprecated .part field\n if (part.part === EMPTY_CONTENT && !!Empty) {\n return <Empty status={part.status} />;\n }\n\n return <Text {...part} part={part} />;\n\n case \"image\":\n // eslint-disable-next-line jsx-a11y/alt-text\n return <Image {...part} part={part} />;\n\n case \"audio\":\n return <Audio {...part} part={part} />;\n\n case \"ui\":\n return <UI {...part} part={part} />;\n\n default:\n const unhandledType: never = type;\n throw new Error(`Unknown content part type: ${unhandledType}`);\n }\n};\n\ntype MessageContentPartProps = {\n partIndex: number;\n components: MessagePrimitiveContent.Props[\"components\"];\n};\n\nconst MessageContentPartImpl: FC<MessageContentPartProps> = ({\n partIndex,\n components,\n}) => {\n const messageRuntime = useMessageRuntime();\n const runtime = useMemo(\n () => messageRuntime.getContentPartByIndex(partIndex),\n [messageRuntime, partIndex],\n );\n\n return (\n <ContentPartRuntimeProvider runtime={runtime}>\n <MessageContentPartComponent components={components} />\n </ContentPartRuntimeProvider>\n );\n};\n\nconst MessageContentPart = memo(\n MessageContentPartImpl,\n (prev, next) =>\n prev.partIndex === next.partIndex &&\n prev.components?.Text === next.components?.Text &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.Unstable_Audio === next.components?.Unstable_Audio &&\n prev.components?.UI === next.components?.UI &&\n prev.components?.tools === next.components?.tools,\n);\n\nexport const MessagePrimitiveContent: FC<MessagePrimitiveContent.Props> = ({\n components,\n}) => {\n const contentLength = useMessage((s) => s.content.length) || 1;\n\n return Array.from({ length: contentLength }, (_, index) => (\n <MessageContentPart key={index} partIndex={index} components={components} />\n ));\n};\n\nMessagePrimitiveContent.displayName = \"MessagePrimitive.Content\";\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/message/MessageContent.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentType, type FC, memo, useMemo } from \"react\";\nimport {\n useContentPart,\n useContentPartRuntime,\n useToolUIs,\n} from \"../../context\";\nimport {\n useMessage,\n useMessageRuntime,\n} from \"../../context/react/MessageContext\";\nimport { ContentPartRuntimeProvider } from \"../../context/providers/ContentPartRuntimeProvider\";\nimport { ContentPartPrimitiveText } from \"../contentPart/ContentPartText\";\nimport { ContentPartPrimitiveImage } from \"../contentPart/ContentPartImage\";\nimport { ContentPartPrimitiveDisplay } from \"../contentPart/ContentPartDisplay\";\nimport type {\n Unstable_AudioContentPartComponent,\n EmptyContentPartComponent,\n ImageContentPartComponent,\n TextContentPartComponent,\n ToolCallContentPartComponent,\n ToolCallContentPartProps,\n UIContentPartComponent,\n} from \"../../types/ContentPartComponentTypes\";\nimport { ContentPartPrimitiveInProgress } from \"../contentPart/ContentPartInProgress\";\nimport { EMPTY_CONTENT_SYMBOL } from \"../../api/MessageRuntime\";\n\nexport namespace MessagePrimitiveContent {\n export type Props = {\n components?:\n | {\n Empty?: EmptyContentPartComponent | undefined;\n Text?: TextContentPartComponent | undefined;\n Image?: ImageContentPartComponent | undefined;\n Unstable_Audio?: Unstable_AudioContentPartComponent | undefined;\n UI?: UIContentPartComponent | undefined;\n tools?:\n | {\n by_name?:\n | Record<string, ToolCallContentPartComponent | undefined>\n | undefined;\n Fallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n }\n | undefined;\n };\n}\n\nconst ToolUIDisplay = ({\n UI,\n ...props\n}: {\n UI: ToolCallContentPartComponent | undefined;\n} & ToolCallContentPartProps) => {\n const Render = useToolUIs((s) => s.getToolUI(props.toolName)) ?? UI;\n if (!Render) return null;\n return <Render {...props} />;\n};\n\nconst defaultComponents = {\n Text: () => (\n <p style={{ whiteSpace: \"pre-line\" }}>\n <ContentPartPrimitiveText />\n <ContentPartPrimitiveInProgress>\n <span style={{ fontFamily: \"revert\" }}>{\" \\u25CF\"}</span>\n </ContentPartPrimitiveInProgress>\n </p>\n ),\n Image: () => <ContentPartPrimitiveImage />,\n Unstable_Audio: () => null,\n UI: () => <ContentPartPrimitiveDisplay />,\n} satisfies MessagePrimitiveContent.Props[\"components\"];\n\ntype MessageContentPartComponentProps = {\n components: MessagePrimitiveContent.Props[\"components\"];\n};\n\nconst MessageContentPartComponent: FC<MessageContentPartComponentProps> = ({\n components: {\n Text = defaultComponents.Text,\n Empty,\n Image = defaultComponents.Image,\n UI = defaultComponents.UI,\n Unstable_Audio: Audio = defaultComponents.Unstable_Audio,\n tools: { by_name = {}, Fallback = undefined } = {},\n } = {},\n}) => {\n const contentPartRuntime = useContentPartRuntime();\n\n const part = useContentPart();\n\n const type = part.type;\n if (type === \"tool-call\") {\n const Tool = by_name[part.toolName] || Fallback;\n const addResult = (result: any) => contentPartRuntime.addToolResult(result);\n return <ToolUIDisplay {...part} UI={Tool} addResult={addResult} />;\n }\n\n if (part.status.type === \"requires-action\")\n throw new Error(\"Encountered unexpected requires-action status\");\n\n switch (type) {\n case \"text\":\n if ((part as any)[EMPTY_CONTENT_SYMBOL] && !!Empty) {\n return <Empty status={part.status} />;\n }\n\n return <Text {...part} />;\n\n case \"image\":\n // eslint-disable-next-line jsx-a11y/alt-text\n return <Image {...part} />;\n\n case \"audio\":\n return <Audio {...part} />;\n\n case \"ui\":\n return <UI {...part} />;\n\n default:\n const unhandledType: never = type;\n throw new Error(`Unknown content part type: ${unhandledType}`);\n }\n};\n\ntype MessageContentPartProps = {\n partIndex: number;\n components: MessagePrimitiveContent.Props[\"components\"];\n};\n\nconst MessageContentPartImpl: FC<MessageContentPartProps> = ({\n partIndex,\n components,\n}) => {\n const messageRuntime = useMessageRuntime();\n const runtime = useMemo(\n () => messageRuntime.getContentPartByIndex(partIndex),\n [messageRuntime, partIndex],\n );\n\n return (\n <ContentPartRuntimeProvider runtime={runtime}>\n <MessageContentPartComponent components={components} />\n </ContentPartRuntimeProvider>\n );\n};\n\nconst MessageContentPart = memo(\n MessageContentPartImpl,\n (prev, next) =>\n prev.partIndex === next.partIndex &&\n prev.components?.Text === next.components?.Text &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.Unstable_Audio === next.components?.Unstable_Audio &&\n prev.components?.UI === next.components?.UI &&\n prev.components?.tools === next.components?.tools,\n);\n\nexport const MessagePrimitiveContent: FC<MessagePrimitiveContent.Props> = ({\n components,\n}) => {\n const contentLength = useMessage((s) => s.content.length) || 1;\n\n return Array.from({ length: contentLength }, (_, index) => (\n <MessageContentPart key={index} partIndex={index} components={components} />\n ));\n};\n\nMessagePrimitiveContent.displayName = \"MessagePrimitive.Content\";\n"],"mappings":"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","names":[]}
@@ -1,9 +1,5 @@
1
1
  import type { FC, PropsWithChildren } from "react";
2
2
  import { UseMessageIfProps } from "../../primitive-hooks/message/useMessageIf";
3
- /**
4
- * @deprecated Use `MessagePrimitive.If.Props` instead. This will be removed in 0.6.
5
- */
6
- export type MessagePrimitiveIfProps = MessagePrimitiveIf.Props;
7
3
  export declare namespace MessagePrimitiveIf {
8
4
  type Props = PropsWithChildren<UseMessageIfProps>;
9
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MessageIf.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageIf.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,iBAAiB,EAElB,MAAM,4CAA4C,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,kBAAkB,CAAC,KAAK,CAAC;AAE/D,yBAAiB,kBAAkB,CAAC;IAClC,KAAY,KAAK,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAC1D;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAM3D,CAAC"}
1
+ {"version":3,"file":"MessageIf.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageIf.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,iBAAiB,EAElB,MAAM,4CAA4C,CAAC;AAEpD,yBAAiB,kBAAkB,CAAC;IAClC,KAAY,KAAK,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAC1D;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAM3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/message/MessageIf.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport {\n UseMessageIfProps,\n useMessageIf,\n} from \"../../primitive-hooks/message/useMessageIf\";\n\n/**\n * @deprecated Use `MessagePrimitive.If.Props` instead. This will be removed in 0.6.\n */\nexport type MessagePrimitiveIfProps = MessagePrimitiveIf.Props;\n\nexport namespace MessagePrimitiveIf {\n export type Props = PropsWithChildren<UseMessageIfProps>;\n}\n\nexport const MessagePrimitiveIf: FC<MessagePrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useMessageIf(query);\n return result ? children : null;\n};\n\nMessagePrimitiveIf.displayName = \"MessagePrimitive.If\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAGO;AAWA,IAAM,qBAAmD,CAAC;AAAA,EAC/D;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,aAAS,kCAAa,KAAK;AACjC,SAAO,SAAS,WAAW;AAC7B;AAEA,mBAAmB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/message/MessageIf.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport {\n UseMessageIfProps,\n useMessageIf,\n} from \"../../primitive-hooks/message/useMessageIf\";\n\nexport namespace MessagePrimitiveIf {\n export type Props = PropsWithChildren<UseMessageIfProps>;\n}\n\nexport const MessagePrimitiveIf: FC<MessagePrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useMessageIf(query);\n return result ? children : null;\n};\n\nMessagePrimitiveIf.displayName = \"MessagePrimitive.If\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAGO;AAMA,IAAM,qBAAmD,CAAC;AAAA,EAC/D;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,aAAS,kCAAa,KAAK;AACjC,SAAO,SAAS,WAAW;AAC7B;AAEA,mBAAmB,cAAc;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/message/MessageIf.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport {\n UseMessageIfProps,\n useMessageIf,\n} from \"../../primitive-hooks/message/useMessageIf\";\n\n/**\n * @deprecated Use `MessagePrimitive.If.Props` instead. This will be removed in 0.6.\n */\nexport type MessagePrimitiveIfProps = MessagePrimitiveIf.Props;\n\nexport namespace MessagePrimitiveIf {\n export type Props = PropsWithChildren<UseMessageIfProps>;\n}\n\nexport const MessagePrimitiveIf: FC<MessagePrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useMessageIf(query);\n return result ? children : null;\n};\n\nMessagePrimitiveIf.displayName = \"MessagePrimitive.If\";\n"],"mappings":";;;AAGA;AAAA,EAEE;AAAA,OACK;AAWA,IAAM,qBAAmD,CAAC;AAAA,EAC/D;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,SAAS,aAAa,KAAK;AACjC,SAAO,SAAS,WAAW;AAC7B;AAEA,mBAAmB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/message/MessageIf.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport {\n UseMessageIfProps,\n useMessageIf,\n} from \"../../primitive-hooks/message/useMessageIf\";\n\nexport namespace MessagePrimitiveIf {\n export type Props = PropsWithChildren<UseMessageIfProps>;\n}\n\nexport const MessagePrimitiveIf: FC<MessagePrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useMessageIf(query);\n return result ? children : null;\n};\n\nMessagePrimitiveIf.displayName = \"MessagePrimitive.If\";\n"],"mappings":";;;AAGA;AAAA,EAEE;AAAA,OACK;AAMA,IAAM,qBAAmD,CAAC;AAAA,EAC/D;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,SAAS,aAAa,KAAK;AACjC,SAAO,SAAS,WAAW;AAC7B;AAEA,mBAAmB,cAAc;","names":[]}
@@ -1,9 +1,5 @@
1
1
  import { Primitive } from "@radix-ui/react-primitive";
2
2
  import { type ElementRef, ComponentPropsWithoutRef } from "react";
3
- /**
4
- * @deprecated Use `MessagePrimitive.Root.Props` instead. This will be removed in 0.6.
5
- */
6
- export type MessagePrimitiveRootProps = MessagePrimitiveRoot.Props;
7
3
  export declare namespace MessagePrimitiveRoot {
8
4
  type Element = ElementRef<typeof Primitive.div>;
9
5
  type Props = ComponentPropsWithoutRef<typeof Primitive.div>;
@@ -1 +1 @@
1
- {"version":3,"file":"MessageRoot.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,KAAK,UAAU,EAEf,wBAAwB,EAEzB,MAAM,OAAO,CAAC;AAiCf;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,CAAC,KAAK,CAAC;AAEnE,yBAAiB,oBAAoB,CAAC;IACpC,KAAY,OAAO,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACvD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,oBAAoB;;;;0DAQ/B,CAAC"}
1
+ {"version":3,"file":"MessageRoot.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,KAAK,UAAU,EAEf,wBAAwB,EAEzB,MAAM,OAAO,CAAC;AAiCf,yBAAiB,oBAAoB,CAAC;IACpC,KAAY,OAAO,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACvD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,oBAAoB;;;;0DAQ/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/message/MessageRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n forwardRef,\n ComponentPropsWithoutRef,\n useCallback,\n} from \"react\";\nimport { useMessageUtilsStore } from \"../../context/react/MessageContext\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\n\nconst useIsHoveringRef = () => {\n const messageUtilsStore = useMessageUtilsStore();\n const callbackRef = useCallback(\n (el: HTMLElement) => {\n const setIsHovering = messageUtilsStore.getState().setIsHovering;\n\n const handleMouseEnter = () => {\n setIsHovering(true);\n };\n const handleMouseLeave = () => {\n setIsHovering(false);\n };\n\n el.addEventListener(\"mouseenter\", handleMouseEnter);\n el.addEventListener(\"mouseleave\", handleMouseLeave);\n\n return () => {\n el.removeEventListener(\"mouseenter\", handleMouseEnter);\n el.removeEventListener(\"mouseleave\", handleMouseLeave);\n setIsHovering(false);\n };\n },\n [messageUtilsStore],\n );\n\n return useManagedRef(callbackRef);\n};\n\n/**\n * @deprecated Use `MessagePrimitive.Root.Props` instead. This will be removed in 0.6.\n */\nexport type MessagePrimitiveRootProps = MessagePrimitiveRoot.Props;\n\nexport namespace MessagePrimitiveRoot {\n export type Element = ElementRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const MessagePrimitiveRoot = forwardRef<\n MessagePrimitiveRoot.Element,\n MessagePrimitiveRoot.Props\n>((props, forwardRef) => {\n const isHoveringRef = useIsHoveringRef();\n const ref = useComposedRefs<HTMLDivElement>(forwardRef, isHoveringRef);\n\n return <Primitive.div {...props} ref={ref} />;\n});\n\nMessagePrimitiveRoot.displayName = \"MessagePrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,6BAA0B;AAC1B,mBAKO;AACP,4BAAqC;AACrC,2BAA8B;AAC9B,gCAAgC;AA+CvB;AA7CT,IAAM,mBAAmB,MAAM;AAC7B,QAAM,wBAAoB,4CAAqB;AAC/C,QAAM,kBAAc;AAAA,IAClB,CAAC,OAAoB;AACnB,YAAM,gBAAgB,kBAAkB,SAAS,EAAE;AAEnD,YAAM,mBAAmB,MAAM;AAC7B,sBAAc,IAAI;AAAA,MACpB;AACA,YAAM,mBAAmB,MAAM;AAC7B,sBAAc,KAAK;AAAA,MACrB;AAEA,SAAG,iBAAiB,cAAc,gBAAgB;AAClD,SAAG,iBAAiB,cAAc,gBAAgB;AAElD,aAAO,MAAM;AACX,WAAG,oBAAoB,cAAc,gBAAgB;AACrD,WAAG,oBAAoB,cAAc,gBAAgB;AACrD,sBAAc,KAAK;AAAA,MACrB;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB;AAAA,EACpB;AAEA,aAAO,oCAAc,WAAW;AAClC;AAYO,IAAM,2BAAuB,yBAGlC,CAAC,OAAOA,gBAAe;AACvB,QAAM,gBAAgB,iBAAiB;AACvC,QAAM,UAAM,2CAAgCA,aAAY,aAAa;AAErE,SAAO,4CAAC,iCAAU,KAAV,EAAe,GAAG,OAAO,KAAU;AAC7C,CAAC;AAED,qBAAqB,cAAc;","names":["forwardRef"]}
1
+ {"version":3,"sources":["../../../src/primitives/message/MessageRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n forwardRef,\n ComponentPropsWithoutRef,\n useCallback,\n} from \"react\";\nimport { useMessageUtilsStore } from \"../../context/react/MessageContext\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\n\nconst useIsHoveringRef = () => {\n const messageUtilsStore = useMessageUtilsStore();\n const callbackRef = useCallback(\n (el: HTMLElement) => {\n const setIsHovering = messageUtilsStore.getState().setIsHovering;\n\n const handleMouseEnter = () => {\n setIsHovering(true);\n };\n const handleMouseLeave = () => {\n setIsHovering(false);\n };\n\n el.addEventListener(\"mouseenter\", handleMouseEnter);\n el.addEventListener(\"mouseleave\", handleMouseLeave);\n\n return () => {\n el.removeEventListener(\"mouseenter\", handleMouseEnter);\n el.removeEventListener(\"mouseleave\", handleMouseLeave);\n setIsHovering(false);\n };\n },\n [messageUtilsStore],\n );\n\n return useManagedRef(callbackRef);\n};\n\nexport namespace MessagePrimitiveRoot {\n export type Element = ElementRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const MessagePrimitiveRoot = forwardRef<\n MessagePrimitiveRoot.Element,\n MessagePrimitiveRoot.Props\n>((props, forwardRef) => {\n const isHoveringRef = useIsHoveringRef();\n const ref = useComposedRefs<HTMLDivElement>(forwardRef, isHoveringRef);\n\n return <Primitive.div {...props} ref={ref} />;\n});\n\nMessagePrimitiveRoot.displayName = \"MessagePrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,6BAA0B;AAC1B,mBAKO;AACP,4BAAqC;AACrC,2BAA8B;AAC9B,gCAAgC;AA0CvB;AAxCT,IAAM,mBAAmB,MAAM;AAC7B,QAAM,wBAAoB,4CAAqB;AAC/C,QAAM,kBAAc;AAAA,IAClB,CAAC,OAAoB;AACnB,YAAM,gBAAgB,kBAAkB,SAAS,EAAE;AAEnD,YAAM,mBAAmB,MAAM;AAC7B,sBAAc,IAAI;AAAA,MACpB;AACA,YAAM,mBAAmB,MAAM;AAC7B,sBAAc,KAAK;AAAA,MACrB;AAEA,SAAG,iBAAiB,cAAc,gBAAgB;AAClD,SAAG,iBAAiB,cAAc,gBAAgB;AAElD,aAAO,MAAM;AACX,WAAG,oBAAoB,cAAc,gBAAgB;AACrD,WAAG,oBAAoB,cAAc,gBAAgB;AACrD,sBAAc,KAAK;AAAA,MACrB;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB;AAAA,EACpB;AAEA,aAAO,oCAAc,WAAW;AAClC;AAOO,IAAM,2BAAuB,yBAGlC,CAAC,OAAOA,gBAAe;AACvB,QAAM,gBAAgB,iBAAiB;AACvC,QAAM,UAAM,2CAAgCA,aAAY,aAAa;AAErE,SAAO,4CAAC,iCAAU,KAAV,EAAe,GAAG,OAAO,KAAU;AAC7C,CAAC;AAED,qBAAqB,cAAc;","names":["forwardRef"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/message/MessageRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n forwardRef,\n ComponentPropsWithoutRef,\n useCallback,\n} from \"react\";\nimport { useMessageUtilsStore } from \"../../context/react/MessageContext\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\n\nconst useIsHoveringRef = () => {\n const messageUtilsStore = useMessageUtilsStore();\n const callbackRef = useCallback(\n (el: HTMLElement) => {\n const setIsHovering = messageUtilsStore.getState().setIsHovering;\n\n const handleMouseEnter = () => {\n setIsHovering(true);\n };\n const handleMouseLeave = () => {\n setIsHovering(false);\n };\n\n el.addEventListener(\"mouseenter\", handleMouseEnter);\n el.addEventListener(\"mouseleave\", handleMouseLeave);\n\n return () => {\n el.removeEventListener(\"mouseenter\", handleMouseEnter);\n el.removeEventListener(\"mouseleave\", handleMouseLeave);\n setIsHovering(false);\n };\n },\n [messageUtilsStore],\n );\n\n return useManagedRef(callbackRef);\n};\n\n/**\n * @deprecated Use `MessagePrimitive.Root.Props` instead. This will be removed in 0.6.\n */\nexport type MessagePrimitiveRootProps = MessagePrimitiveRoot.Props;\n\nexport namespace MessagePrimitiveRoot {\n export type Element = ElementRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const MessagePrimitiveRoot = forwardRef<\n MessagePrimitiveRoot.Element,\n MessagePrimitiveRoot.Props\n>((props, forwardRef) => {\n const isHoveringRef = useIsHoveringRef();\n const ref = useComposedRefs<HTMLDivElement>(forwardRef, isHoveringRef);\n\n return <Primitive.div {...props} ref={ref} />;\n});\n\nMessagePrimitiveRoot.displayName = \"MessagePrimitive.Root\";\n"],"mappings":";;;AAEA,SAAS,iBAAiB;AAC1B;AAAA,EAEE;AAAA,EAEA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AA+CvB;AA7CT,IAAM,mBAAmB,MAAM;AAC7B,QAAM,oBAAoB,qBAAqB;AAC/C,QAAM,cAAc;AAAA,IAClB,CAAC,OAAoB;AACnB,YAAM,gBAAgB,kBAAkB,SAAS,EAAE;AAEnD,YAAM,mBAAmB,MAAM;AAC7B,sBAAc,IAAI;AAAA,MACpB;AACA,YAAM,mBAAmB,MAAM;AAC7B,sBAAc,KAAK;AAAA,MACrB;AAEA,SAAG,iBAAiB,cAAc,gBAAgB;AAClD,SAAG,iBAAiB,cAAc,gBAAgB;AAElD,aAAO,MAAM;AACX,WAAG,oBAAoB,cAAc,gBAAgB;AACrD,WAAG,oBAAoB,cAAc,gBAAgB;AACrD,sBAAc,KAAK;AAAA,MACrB;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB;AAAA,EACpB;AAEA,SAAO,cAAc,WAAW;AAClC;AAYO,IAAM,uBAAuB,WAGlC,CAAC,OAAOA,gBAAe;AACvB,QAAM,gBAAgB,iBAAiB;AACvC,QAAM,MAAM,gBAAgCA,aAAY,aAAa;AAErE,SAAO,oBAAC,UAAU,KAAV,EAAe,GAAG,OAAO,KAAU;AAC7C,CAAC;AAED,qBAAqB,cAAc;","names":["forwardRef"]}
1
+ {"version":3,"sources":["../../../src/primitives/message/MessageRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport {\n type ElementRef,\n forwardRef,\n ComponentPropsWithoutRef,\n useCallback,\n} from \"react\";\nimport { useMessageUtilsStore } from \"../../context/react/MessageContext\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\n\nconst useIsHoveringRef = () => {\n const messageUtilsStore = useMessageUtilsStore();\n const callbackRef = useCallback(\n (el: HTMLElement) => {\n const setIsHovering = messageUtilsStore.getState().setIsHovering;\n\n const handleMouseEnter = () => {\n setIsHovering(true);\n };\n const handleMouseLeave = () => {\n setIsHovering(false);\n };\n\n el.addEventListener(\"mouseenter\", handleMouseEnter);\n el.addEventListener(\"mouseleave\", handleMouseLeave);\n\n return () => {\n el.removeEventListener(\"mouseenter\", handleMouseEnter);\n el.removeEventListener(\"mouseleave\", handleMouseLeave);\n setIsHovering(false);\n };\n },\n [messageUtilsStore],\n );\n\n return useManagedRef(callbackRef);\n};\n\nexport namespace MessagePrimitiveRoot {\n export type Element = ElementRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const MessagePrimitiveRoot = forwardRef<\n MessagePrimitiveRoot.Element,\n MessagePrimitiveRoot.Props\n>((props, forwardRef) => {\n const isHoveringRef = useIsHoveringRef();\n const ref = useComposedRefs<HTMLDivElement>(forwardRef, isHoveringRef);\n\n return <Primitive.div {...props} ref={ref} />;\n});\n\nMessagePrimitiveRoot.displayName = \"MessagePrimitive.Root\";\n"],"mappings":";;;AAEA,SAAS,iBAAiB;AAC1B;AAAA,EAEE;AAAA,EAEA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AA0CvB;AAxCT,IAAM,mBAAmB,MAAM;AAC7B,QAAM,oBAAoB,qBAAqB;AAC/C,QAAM,cAAc;AAAA,IAClB,CAAC,OAAoB;AACnB,YAAM,gBAAgB,kBAAkB,SAAS,EAAE;AAEnD,YAAM,mBAAmB,MAAM;AAC7B,sBAAc,IAAI;AAAA,MACpB;AACA,YAAM,mBAAmB,MAAM;AAC7B,sBAAc,KAAK;AAAA,MACrB;AAEA,SAAG,iBAAiB,cAAc,gBAAgB;AAClD,SAAG,iBAAiB,cAAc,gBAAgB;AAElD,aAAO,MAAM;AACX,WAAG,oBAAoB,cAAc,gBAAgB;AACrD,WAAG,oBAAoB,cAAc,gBAAgB;AACrD,sBAAc,KAAK;AAAA,MACrB;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB;AAAA,EACpB;AAEA,SAAO,cAAc,WAAW;AAClC;AAOO,IAAM,uBAAuB,WAGlC,CAAC,OAAOA,gBAAe;AACvB,QAAM,gBAAgB,iBAAiB;AACvC,QAAM,MAAM,gBAAgCA,aAAY,aAAa;AAErE,SAAO,oBAAC,UAAU,KAAV,EAAe,GAAG,OAAO,KAAU;AAC7C,CAAC;AAED,qBAAqB,cAAc;","names":["forwardRef"]}
@@ -1,6 +1,5 @@
1
1
  export { MessagePrimitiveRoot as Root } from "./MessageRoot";
2
2
  export { MessagePrimitiveIf as If } from "./MessageIf";
3
3
  export { MessagePrimitiveContent as Content } from "./MessageContent";
4
- export { MessagePrimitiveInProgress as InProgress } from "./MessageInProgress";
5
4
  export { MessagePrimitiveAttachments as Attachments } from "./MessageAttachments";
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,IAAI,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,kBAAkB,IAAI,EAAE,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,0BAA0B,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,2BAA2B,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,IAAI,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,kBAAkB,IAAI,EAAE,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,2BAA2B,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC"}
@@ -23,21 +23,18 @@ __export(message_exports, {
23
23
  Attachments: () => import_MessageAttachments.MessagePrimitiveAttachments,
24
24
  Content: () => import_MessageContent.MessagePrimitiveContent,
25
25
  If: () => import_MessageIf.MessagePrimitiveIf,
26
- InProgress: () => import_MessageInProgress.MessagePrimitiveInProgress,
27
26
  Root: () => import_MessageRoot.MessagePrimitiveRoot
28
27
  });
29
28
  module.exports = __toCommonJS(message_exports);
30
29
  var import_MessageRoot = require("./MessageRoot.cjs");
31
30
  var import_MessageIf = require("./MessageIf.cjs");
32
31
  var import_MessageContent = require("./MessageContent.cjs");
33
- var import_MessageInProgress = require("./MessageInProgress.cjs");
34
32
  var import_MessageAttachments = require("./MessageAttachments.cjs");
35
33
  // Annotate the CommonJS export names for ESM import in node:
36
34
  0 && (module.exports = {
37
35
  Attachments,
38
36
  Content,
39
37
  If,
40
- InProgress,
41
38
  Root
42
39
  });
43
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/message/index.ts"],"sourcesContent":["export { MessagePrimitiveRoot as Root } from \"./MessageRoot\";\nexport { MessagePrimitiveIf as If } from \"./MessageIf\";\nexport { MessagePrimitiveContent as Content } from \"./MessageContent\";\nexport { MessagePrimitiveInProgress as InProgress } from \"./MessageInProgress\";\nexport { MessagePrimitiveAttachments as Attachments } from \"./MessageAttachments\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA6C;AAC7C,uBAAyC;AACzC,4BAAmD;AACnD,+BAAyD;AACzD,gCAA2D;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/message/index.ts"],"sourcesContent":["export { MessagePrimitiveRoot as Root } from \"./MessageRoot\";\nexport { MessagePrimitiveIf as If } from \"./MessageIf\";\nexport { MessagePrimitiveContent as Content } from \"./MessageContent\";\nexport { MessagePrimitiveAttachments as Attachments } from \"./MessageAttachments\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA6C;AAC7C,uBAAyC;AACzC,4BAAmD;AACnD,gCAA2D;","names":[]}
@@ -2,13 +2,11 @@
2
2
  import { MessagePrimitiveRoot } from "./MessageRoot.mjs";
3
3
  import { MessagePrimitiveIf } from "./MessageIf.mjs";
4
4
  import { MessagePrimitiveContent } from "./MessageContent.mjs";
5
- import { MessagePrimitiveInProgress } from "./MessageInProgress.mjs";
6
5
  import { MessagePrimitiveAttachments } from "./MessageAttachments.mjs";
7
6
  export {
8
7
  MessagePrimitiveAttachments as Attachments,
9
8
  MessagePrimitiveContent as Content,
10
9
  MessagePrimitiveIf as If,
11
- MessagePrimitiveInProgress as InProgress,
12
10
  MessagePrimitiveRoot as Root
13
11
  };
14
12
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/message/index.ts"],"sourcesContent":["export { MessagePrimitiveRoot as Root } from \"./MessageRoot\";\nexport { MessagePrimitiveIf as If } from \"./MessageIf\";\nexport { MessagePrimitiveContent as Content } from \"./MessageContent\";\nexport { MessagePrimitiveInProgress as InProgress } from \"./MessageInProgress\";\nexport { MessagePrimitiveAttachments as Attachments } from \"./MessageAttachments\";\n"],"mappings":";AAAA,SAAiC,4BAAY;AAC7C,SAA+B,0BAAU;AACzC,SAAoC,+BAAe;AACnD,SAAuC,kCAAkB;AACzD,SAAwC,mCAAmB;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/message/index.ts"],"sourcesContent":["export { MessagePrimitiveRoot as Root } from \"./MessageRoot\";\nexport { MessagePrimitiveIf as If } from \"./MessageIf\";\nexport { MessagePrimitiveContent as Content } from \"./MessageContent\";\nexport { MessagePrimitiveAttachments as Attachments } from \"./MessageAttachments\";\n"],"mappings":";AAAA,SAAiC,4BAAY;AAC7C,SAA+B,0BAAU;AACzC,SAAoC,+BAAe;AACnD,SAAwC,mCAAmB;","names":[]}
@@ -1,8 +1,4 @@
1
1
  import type { FC, PropsWithChildren } from "react";
2
- /**
3
- * @deprecated Use `ThreadPrimitive.Empty.Props` instead. This will be removed in 0.6.
4
- */
5
- export type ThreadPrimitiveEmptyProps = ThreadPrimitiveEmpty.Props;
6
2
  export declare namespace ThreadPrimitiveEmpty {
7
3
  type Props = PropsWithChildren;
8
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadEmpty.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadEmpty.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,CAAC,KAAK,CAAC;AAEnE,yBAAiB,oBAAoB,CAAC;IACpC,KAAY,KAAK,GAAG,iBAAiB,CAAC;CACvC;AAED,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAK/D,CAAC"}
1
+ {"version":3,"file":"ThreadEmpty.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadEmpty.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnD,yBAAiB,oBAAoB,CAAC;IACpC,KAAY,KAAK,GAAG,iBAAiB,CAAC;CACvC;AAED,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAK/D,CAAC"}
@@ -24,11 +24,11 @@ __export(ThreadEmpty_exports, {
24
24
  ThreadPrimitiveEmpty: () => ThreadPrimitiveEmpty
25
25
  });
26
26
  module.exports = __toCommonJS(ThreadEmpty_exports);
27
- var import_primitive_hooks = require("../../primitive-hooks/index.cjs");
27
+ var import_useThreadEmpty = require("../../primitive-hooks/thread/useThreadEmpty.cjs");
28
28
  var ThreadPrimitiveEmpty = ({
29
29
  children
30
30
  }) => {
31
- const empty = (0, import_primitive_hooks.useThreadEmpty)();
31
+ const empty = (0, import_useThreadEmpty.useThreadEmpty)();
32
32
  return empty ? children : null;
33
33
  };
34
34
  ThreadPrimitiveEmpty.displayName = "ThreadPrimitive.Empty";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadEmpty.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport { useThreadEmpty } from \"../../primitive-hooks\";\n\n/**\n * @deprecated Use `ThreadPrimitive.Empty.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveEmptyProps = ThreadPrimitiveEmpty.Props;\n\nexport namespace ThreadPrimitiveEmpty {\n export type Props = PropsWithChildren;\n}\n\nexport const ThreadPrimitiveEmpty: FC<ThreadPrimitiveEmpty.Props> = ({\n children,\n}) => {\n const empty = useThreadEmpty();\n return empty ? children : null;\n};\n\nThreadPrimitiveEmpty.displayName = \"ThreadPrimitive.Empty\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,6BAA+B;AAWxB,IAAM,uBAAuD,CAAC;AAAA,EACnE;AACF,MAAM;AACJ,QAAM,YAAQ,uCAAe;AAC7B,SAAO,QAAQ,WAAW;AAC5B;AAEA,qBAAqB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadEmpty.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport { useThreadEmpty } from \"../../primitive-hooks/thread/useThreadEmpty\";\n\nexport namespace ThreadPrimitiveEmpty {\n export type Props = PropsWithChildren;\n}\n\nexport const ThreadPrimitiveEmpty: FC<ThreadPrimitiveEmpty.Props> = ({\n children,\n}) => {\n const empty = useThreadEmpty();\n return empty ? children : null;\n};\n\nThreadPrimitiveEmpty.displayName = \"ThreadPrimitive.Empty\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,4BAA+B;AAMxB,IAAM,uBAAuD,CAAC;AAAA,EACnE;AACF,MAAM;AACJ,QAAM,YAAQ,sCAAe;AAC7B,SAAO,QAAQ,WAAW;AAC5B;AAEA,qBAAqB,cAAc;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  // src/primitives/thread/ThreadEmpty.tsx
4
- import { useThreadEmpty } from "../../primitive-hooks/index.mjs";
4
+ import { useThreadEmpty } from "../../primitive-hooks/thread/useThreadEmpty.mjs";
5
5
  var ThreadPrimitiveEmpty = ({
6
6
  children
7
7
  }) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadEmpty.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport { useThreadEmpty } from \"../../primitive-hooks\";\n\n/**\n * @deprecated Use `ThreadPrimitive.Empty.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveEmptyProps = ThreadPrimitiveEmpty.Props;\n\nexport namespace ThreadPrimitiveEmpty {\n export type Props = PropsWithChildren;\n}\n\nexport const ThreadPrimitiveEmpty: FC<ThreadPrimitiveEmpty.Props> = ({\n children,\n}) => {\n const empty = useThreadEmpty();\n return empty ? children : null;\n};\n\nThreadPrimitiveEmpty.displayName = \"ThreadPrimitive.Empty\";\n"],"mappings":";;;AAGA,SAAS,sBAAsB;AAWxB,IAAM,uBAAuD,CAAC;AAAA,EACnE;AACF,MAAM;AACJ,QAAM,QAAQ,eAAe;AAC7B,SAAO,QAAQ,WAAW;AAC5B;AAEA,qBAAqB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadEmpty.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport { useThreadEmpty } from \"../../primitive-hooks/thread/useThreadEmpty\";\n\nexport namespace ThreadPrimitiveEmpty {\n export type Props = PropsWithChildren;\n}\n\nexport const ThreadPrimitiveEmpty: FC<ThreadPrimitiveEmpty.Props> = ({\n children,\n}) => {\n const empty = useThreadEmpty();\n return empty ? children : null;\n};\n\nThreadPrimitiveEmpty.displayName = \"ThreadPrimitive.Empty\";\n"],"mappings":";;;AAGA,SAAS,sBAAsB;AAMxB,IAAM,uBAAuD,CAAC;AAAA,EACnE;AACF,MAAM;AACJ,QAAM,QAAQ,eAAe;AAC7B,SAAO,QAAQ,WAAW;AAC5B;AAEA,qBAAqB,cAAc;","names":[]}
@@ -1,9 +1,5 @@
1
1
  import type { FC, PropsWithChildren } from "react";
2
2
  import { UseThreadIfProps } from "../../primitive-hooks/thread/useThreadIf";
3
- /**
4
- * @deprecated Use `ThreadPrimitive.If.Props` instead. This will be removed in 0.6.
5
- */
6
- export type ThreadPrimitiveIfProps = ThreadPrimitiveIf.Props;
7
3
  export declare namespace ThreadPrimitiveIf {
8
4
  type Props = PropsWithChildren<UseThreadIfProps>;
9
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadIf.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadIf.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,gBAAgB,EAEjB,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,KAAK,CAAC;AAE7D,yBAAiB,iBAAiB,CAAC;IACjC,KAAY,KAAK,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CACzD;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAMzD,CAAC"}
1
+ {"version":3,"file":"ThreadIf.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadIf.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,gBAAgB,EAEjB,MAAM,0CAA0C,CAAC;AAElD,yBAAiB,iBAAiB,CAAC;IACjC,KAAY,KAAK,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CACzD;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAMzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadIf.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport {\n UseThreadIfProps,\n useThreadIf,\n} from \"../../primitive-hooks/thread/useThreadIf\";\n\n/**\n * @deprecated Use `ThreadPrimitive.If.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveIfProps = ThreadPrimitiveIf.Props;\n\nexport namespace ThreadPrimitiveIf {\n export type Props = PropsWithChildren<UseThreadIfProps>;\n}\n\nexport const ThreadPrimitiveIf: FC<ThreadPrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useThreadIf(query);\n return result ? children : null;\n};\n\nThreadPrimitiveIf.displayName = \"ThreadPrimitive.If\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,yBAGO;AAWA,IAAM,oBAAiD,CAAC;AAAA,EAC7D;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,aAAS,gCAAY,KAAK;AAChC,SAAO,SAAS,WAAW;AAC7B;AAEA,kBAAkB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadIf.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport {\n UseThreadIfProps,\n useThreadIf,\n} from \"../../primitive-hooks/thread/useThreadIf\";\n\nexport namespace ThreadPrimitiveIf {\n export type Props = PropsWithChildren<UseThreadIfProps>;\n}\n\nexport const ThreadPrimitiveIf: FC<ThreadPrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useThreadIf(query);\n return result ? children : null;\n};\n\nThreadPrimitiveIf.displayName = \"ThreadPrimitive.If\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,yBAGO;AAMA,IAAM,oBAAiD,CAAC;AAAA,EAC7D;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,aAAS,gCAAY,KAAK;AAChC,SAAO,SAAS,WAAW;AAC7B;AAEA,kBAAkB,cAAc;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadIf.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport {\n UseThreadIfProps,\n useThreadIf,\n} from \"../../primitive-hooks/thread/useThreadIf\";\n\n/**\n * @deprecated Use `ThreadPrimitive.If.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveIfProps = ThreadPrimitiveIf.Props;\n\nexport namespace ThreadPrimitiveIf {\n export type Props = PropsWithChildren<UseThreadIfProps>;\n}\n\nexport const ThreadPrimitiveIf: FC<ThreadPrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useThreadIf(query);\n return result ? children : null;\n};\n\nThreadPrimitiveIf.displayName = \"ThreadPrimitive.If\";\n"],"mappings":";;;AAGA;AAAA,EAEE;AAAA,OACK;AAWA,IAAM,oBAAiD,CAAC;AAAA,EAC7D;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,SAAS,YAAY,KAAK;AAChC,SAAO,SAAS,WAAW;AAC7B;AAEA,kBAAkB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadIf.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport {\n UseThreadIfProps,\n useThreadIf,\n} from \"../../primitive-hooks/thread/useThreadIf\";\n\nexport namespace ThreadPrimitiveIf {\n export type Props = PropsWithChildren<UseThreadIfProps>;\n}\n\nexport const ThreadPrimitiveIf: FC<ThreadPrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useThreadIf(query);\n return result ? children : null;\n};\n\nThreadPrimitiveIf.displayName = \"ThreadPrimitive.If\";\n"],"mappings":";;;AAGA;AAAA,EAEE;AAAA,OACK;AAMA,IAAM,oBAAiD,CAAC;AAAA,EAC7D;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,SAAS,YAAY,KAAK;AAChC,SAAO,SAAS,WAAW;AAC7B;AAEA,kBAAkB,cAAc;","names":[]}
@@ -1,8 +1,4 @@
1
1
  import { type ComponentType, type FC } from "react";
2
- /**
3
- * @deprecated Use `ThreadPrimitive.Messages.Props` instead. This will be removed in 0.6.
4
- */
5
- export type ThreadPrimitiveMessagesProps = ThreadPrimitiveMessages.Props;
6
2
  export declare namespace ThreadPrimitiveMessages {
7
3
  type Props = {
8
4
  components: {
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadMessages.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAiB,MAAM,OAAO,CAAC;AAMnE;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,CAAC,KAAK,CAAC;AAEzE,yBAAiB,uBAAuB,CAAC;IACvC,KAAY,KAAK,GAAG;QAClB,UAAU,EACN;YACE,OAAO,EAAE,aAAa,CAAC;YACvB,YAAY,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YACzC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAC7C,qBAAqB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAClD,kBAAkB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAC/C,WAAW,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YACxC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAC7C,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;SAC3C,GACD;YACE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YACpC,YAAY,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YACzC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAC7C,qBAAqB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAClD,kBAAkB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAC/C,WAAW,EAAE,aAAa,CAAC;YAC3B,gBAAgB,EAAE,aAAa,CAAC;YAChC,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;SAC3C,CAAC;KACP,CAAC;CACH;AA8GD,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC,uBAAuB,CAAC,KAAK,CASzE,CAAC;AAIF,eAAO,MAAM,uBAAuB,qEAGnC,CAAC"}
1
+ {"version":3,"file":"ThreadMessages.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAiB,MAAM,OAAO,CAAC;AAMnE,yBAAiB,uBAAuB,CAAC;IACvC,KAAY,KAAK,GAAG;QAClB,UAAU,EACN;YACE,OAAO,EAAE,aAAa,CAAC;YACvB,YAAY,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YACzC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAC7C,qBAAqB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAClD,kBAAkB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAC/C,WAAW,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YACxC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAC7C,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;SAC3C,GACD;YACE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YACpC,YAAY,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YACzC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAC7C,qBAAqB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAClD,kBAAkB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;YAC/C,WAAW,EAAE,aAAa,CAAC;YAC3B,gBAAgB,EAAE,aAAa,CAAC;YAChC,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;SAC3C,CAAC;KACP,CAAC;CACH;AA8GD,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC,uBAAuB,CAAC,KAAK,CASzE,CAAC;AAIF,eAAO,MAAM,uBAAuB,qEAGnC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentType, type FC, memo, useMemo } from \"react\";\nimport { useThread, useThreadRuntime } from \"../../context/react/ThreadContext\";\nimport { MessageRuntimeProvider } from \"../../context/providers/MessageRuntimeProvider\";\nimport { useEditComposer, useMessage } from \"../../context\";\nimport { ThreadMessage as ThreadMessageType } from \"../../types\";\n\n/**\n * @deprecated Use `ThreadPrimitive.Messages.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveMessagesProps = ThreadPrimitiveMessages.Props;\n\nexport namespace ThreadPrimitiveMessages {\n export type Props = {\n components:\n | {\n Message: ComponentType;\n EditComposer?: ComponentType | undefined;\n UserEditComposer?: ComponentType | undefined;\n AssistantEditComposer?: ComponentType | undefined;\n SystemEditComposer?: ComponentType | undefined;\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n SystemMessage?: ComponentType | undefined;\n }\n | {\n Message?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n UserEditComposer?: ComponentType | undefined;\n AssistantEditComposer?: ComponentType | undefined;\n SystemEditComposer?: ComponentType | undefined;\n UserMessage: ComponentType;\n AssistantMessage: ComponentType;\n SystemMessage?: ComponentType | undefined;\n };\n };\n}\n\nconst isComponentsSame = (\n prev: ThreadPrimitiveMessages.Props[\"components\"],\n next: ThreadPrimitiveMessages.Props[\"components\"],\n) => {\n return (\n prev.Message === next.Message &&\n prev.EditComposer === next.EditComposer &&\n prev.UserEditComposer === next.UserEditComposer &&\n prev.AssistantEditComposer === next.AssistantEditComposer &&\n prev.SystemEditComposer === next.SystemEditComposer &&\n prev.UserMessage === next.UserMessage &&\n prev.AssistantMessage === next.AssistantMessage &&\n prev.SystemMessage === next.SystemMessage\n );\n};\n\nconst DEFAULT_SYSTEM_MESSAGE = () => null;\n\nconst getComponent = (\n components: ThreadPrimitiveMessages.Props[\"components\"],\n role: ThreadMessageType[\"role\"],\n isEditing: boolean,\n) => {\n switch (role) {\n case \"user\":\n if (isEditing) {\n return (\n components.UserEditComposer ??\n components.EditComposer ??\n components.UserMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return components.UserMessage ?? (components.Message as ComponentType);\n }\n case \"assistant\":\n if (isEditing) {\n return (\n components.AssistantEditComposer ??\n components.EditComposer ??\n components.AssistantMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return (\n components.AssistantMessage ?? (components.Message as ComponentType)\n );\n }\n case \"system\":\n if (isEditing) {\n return (\n components.SystemEditComposer ??\n components.EditComposer ??\n components.SystemMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return components.SystemMessage ?? DEFAULT_SYSTEM_MESSAGE;\n }\n default:\n const _exhaustiveCheck: never = role;\n throw new Error(`Unknown message role: ${_exhaustiveCheck}`);\n }\n};\n\ntype ThreadMessageComponentProps = {\n components: ThreadPrimitiveMessages.Props[\"components\"];\n};\n\nconst ThreadMessageComponent: FC<ThreadMessageComponentProps> = ({\n components,\n}) => {\n const role = useMessage((m) => m.role);\n const isEditing = useEditComposer((c) => c.isEditing);\n const Component = getComponent(components, role, isEditing);\n\n return <Component />;\n};\n\ntype ThreadMessageProps = {\n messageIndex: number;\n components: ThreadPrimitiveMessages.Props[\"components\"];\n};\n\nconst ThreadMessageImpl: FC<ThreadMessageProps> = ({\n messageIndex,\n components,\n}) => {\n const threadRuntime = useThreadRuntime();\n const runtime = useMemo(\n () => threadRuntime.getMesssageByIndex(messageIndex),\n [threadRuntime, messageIndex],\n );\n\n return (\n <MessageRuntimeProvider runtime={runtime}>\n <ThreadMessageComponent components={components} />\n </MessageRuntimeProvider>\n );\n};\n\nconst ThreadMessage = memo(\n ThreadMessageImpl,\n (prev, next) =>\n prev.messageIndex === next.messageIndex &&\n isComponentsSame(prev.components, next.components),\n);\n\nexport const ThreadPrimitiveMessagesImpl: FC<ThreadPrimitiveMessages.Props> = ({\n components,\n}) => {\n const messagesLength = useThread((t) => t.messages.length);\n if (messagesLength === 0) return null;\n\n return Array.from({ length: messagesLength }, (_, index) => (\n <ThreadMessage key={index} messageIndex={index} components={components} />\n ));\n};\n\nThreadPrimitiveMessagesImpl.displayName = \"ThreadPrimitive.Messages\";\n\nexport const ThreadPrimitiveMessages = memo(\n ThreadPrimitiveMessagesImpl,\n (prev, next) => isComponentsSame(prev.components, next.components),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA2D;AAC3D,2BAA4C;AAC5C,oCAAuC;AACvC,qBAA4C;AA8GnC;AA5ET,IAAM,mBAAmB,CACvB,MACA,SACG;AACH,SACE,KAAK,YAAY,KAAK,WACtB,KAAK,iBAAiB,KAAK,gBAC3B,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,0BAA0B,KAAK,yBACpC,KAAK,uBAAuB,KAAK,sBACjC,KAAK,gBAAgB,KAAK,eAC1B,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,kBAAkB,KAAK;AAEhC;AAEA,IAAM,yBAAyB,MAAM;AAErC,IAAM,eAAe,CACnB,YACA,MACA,cACG;AACH,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,oBACX,WAAW,gBACX,WAAW,eACV,WAAW;AAAA,MAEhB,OAAO;AACL,eAAO,WAAW,eAAgB,WAAW;AAAA,MAC/C;AAAA,IACF,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,yBACX,WAAW,gBACX,WAAW,oBACV,WAAW;AAAA,MAEhB,OAAO;AACL,eACE,WAAW,oBAAqB,WAAW;AAAA,MAE/C;AAAA,IACF,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,sBACX,WAAW,gBACX,WAAW,iBACV,WAAW;AAAA,MAEhB,OAAO;AACL,eAAO,WAAW,iBAAiB;AAAA,MACrC;AAAA,IACF;AACE,YAAM,mBAA0B;AAChC,YAAM,IAAI,MAAM,yBAAyB,gBAAgB,EAAE;AAAA,EAC/D;AACF;AAMA,IAAM,yBAA0D,CAAC;AAAA,EAC/D;AACF,MAAM;AACJ,QAAM,WAAO,2BAAW,CAAC,MAAM,EAAE,IAAI;AACrC,QAAM,gBAAY,gCAAgB,CAAC,MAAM,EAAE,SAAS;AACpD,QAAM,YAAY,aAAa,YAAY,MAAM,SAAS;AAE1D,SAAO,4CAAC,aAAU;AACpB;AAOA,IAAM,oBAA4C,CAAC;AAAA,EACjD;AAAA,EACA;AACF,MAAM;AACJ,QAAM,oBAAgB,uCAAiB;AACvC,QAAM,cAAU;AAAA,IACd,MAAM,cAAc,mBAAmB,YAAY;AAAA,IACnD,CAAC,eAAe,YAAY;AAAA,EAC9B;AAEA,SACE,4CAAC,wDAAuB,SACtB,sDAAC,0BAAuB,YAAwB,GAClD;AAEJ;AAEA,IAAM,oBAAgB;AAAA,EACpB;AAAA,EACA,CAAC,MAAM,SACL,KAAK,iBAAiB,KAAK,gBAC3B,iBAAiB,KAAK,YAAY,KAAK,UAAU;AACrD;AAEO,IAAM,8BAAiE,CAAC;AAAA,EAC7E;AACF,MAAM;AACJ,QAAM,qBAAiB,gCAAU,CAAC,MAAM,EAAE,SAAS,MAAM;AACzD,MAAI,mBAAmB,EAAG,QAAO;AAEjC,SAAO,MAAM,KAAK,EAAE,QAAQ,eAAe,GAAG,CAAC,GAAG,UAChD,4CAAC,iBAA0B,cAAc,OAAO,cAA5B,KAAoD,CACzE;AACH;AAEA,4BAA4B,cAAc;AAEnC,IAAM,8BAA0B;AAAA,EACrC;AAAA,EACA,CAAC,MAAM,SAAS,iBAAiB,KAAK,YAAY,KAAK,UAAU;AACnE;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentType, type FC, memo, useMemo } from \"react\";\nimport { useThread, useThreadRuntime } from \"../../context/react/ThreadContext\";\nimport { MessageRuntimeProvider } from \"../../context/providers/MessageRuntimeProvider\";\nimport { useEditComposer, useMessage } from \"../../context\";\nimport { ThreadMessage as ThreadMessageType } from \"../../types\";\n\nexport namespace ThreadPrimitiveMessages {\n export type Props = {\n components:\n | {\n Message: ComponentType;\n EditComposer?: ComponentType | undefined;\n UserEditComposer?: ComponentType | undefined;\n AssistantEditComposer?: ComponentType | undefined;\n SystemEditComposer?: ComponentType | undefined;\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n SystemMessage?: ComponentType | undefined;\n }\n | {\n Message?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n UserEditComposer?: ComponentType | undefined;\n AssistantEditComposer?: ComponentType | undefined;\n SystemEditComposer?: ComponentType | undefined;\n UserMessage: ComponentType;\n AssistantMessage: ComponentType;\n SystemMessage?: ComponentType | undefined;\n };\n };\n}\n\nconst isComponentsSame = (\n prev: ThreadPrimitiveMessages.Props[\"components\"],\n next: ThreadPrimitiveMessages.Props[\"components\"],\n) => {\n return (\n prev.Message === next.Message &&\n prev.EditComposer === next.EditComposer &&\n prev.UserEditComposer === next.UserEditComposer &&\n prev.AssistantEditComposer === next.AssistantEditComposer &&\n prev.SystemEditComposer === next.SystemEditComposer &&\n prev.UserMessage === next.UserMessage &&\n prev.AssistantMessage === next.AssistantMessage &&\n prev.SystemMessage === next.SystemMessage\n );\n};\n\nconst DEFAULT_SYSTEM_MESSAGE = () => null;\n\nconst getComponent = (\n components: ThreadPrimitiveMessages.Props[\"components\"],\n role: ThreadMessageType[\"role\"],\n isEditing: boolean,\n) => {\n switch (role) {\n case \"user\":\n if (isEditing) {\n return (\n components.UserEditComposer ??\n components.EditComposer ??\n components.UserMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return components.UserMessage ?? (components.Message as ComponentType);\n }\n case \"assistant\":\n if (isEditing) {\n return (\n components.AssistantEditComposer ??\n components.EditComposer ??\n components.AssistantMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return (\n components.AssistantMessage ?? (components.Message as ComponentType)\n );\n }\n case \"system\":\n if (isEditing) {\n return (\n components.SystemEditComposer ??\n components.EditComposer ??\n components.SystemMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return components.SystemMessage ?? DEFAULT_SYSTEM_MESSAGE;\n }\n default:\n const _exhaustiveCheck: never = role;\n throw new Error(`Unknown message role: ${_exhaustiveCheck}`);\n }\n};\n\ntype ThreadMessageComponentProps = {\n components: ThreadPrimitiveMessages.Props[\"components\"];\n};\n\nconst ThreadMessageComponent: FC<ThreadMessageComponentProps> = ({\n components,\n}) => {\n const role = useMessage((m) => m.role);\n const isEditing = useEditComposer((c) => c.isEditing);\n const Component = getComponent(components, role, isEditing);\n\n return <Component />;\n};\n\ntype ThreadMessageProps = {\n messageIndex: number;\n components: ThreadPrimitiveMessages.Props[\"components\"];\n};\n\nconst ThreadMessageImpl: FC<ThreadMessageProps> = ({\n messageIndex,\n components,\n}) => {\n const threadRuntime = useThreadRuntime();\n const runtime = useMemo(\n () => threadRuntime.getMesssageByIndex(messageIndex),\n [threadRuntime, messageIndex],\n );\n\n return (\n <MessageRuntimeProvider runtime={runtime}>\n <ThreadMessageComponent components={components} />\n </MessageRuntimeProvider>\n );\n};\n\nconst ThreadMessage = memo(\n ThreadMessageImpl,\n (prev, next) =>\n prev.messageIndex === next.messageIndex &&\n isComponentsSame(prev.components, next.components),\n);\n\nexport const ThreadPrimitiveMessagesImpl: FC<ThreadPrimitiveMessages.Props> = ({\n components,\n}) => {\n const messagesLength = useThread((t) => t.messages.length);\n if (messagesLength === 0) return null;\n\n return Array.from({ length: messagesLength }, (_, index) => (\n <ThreadMessage key={index} messageIndex={index} components={components} />\n ));\n};\n\nThreadPrimitiveMessagesImpl.displayName = \"ThreadPrimitive.Messages\";\n\nexport const ThreadPrimitiveMessages = memo(\n ThreadPrimitiveMessagesImpl,\n (prev, next) => isComponentsSame(prev.components, next.components),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA2D;AAC3D,2BAA4C;AAC5C,oCAAuC;AACvC,qBAA4C;AAyGnC;AA5ET,IAAM,mBAAmB,CACvB,MACA,SACG;AACH,SACE,KAAK,YAAY,KAAK,WACtB,KAAK,iBAAiB,KAAK,gBAC3B,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,0BAA0B,KAAK,yBACpC,KAAK,uBAAuB,KAAK,sBACjC,KAAK,gBAAgB,KAAK,eAC1B,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,kBAAkB,KAAK;AAEhC;AAEA,IAAM,yBAAyB,MAAM;AAErC,IAAM,eAAe,CACnB,YACA,MACA,cACG;AACH,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,oBACX,WAAW,gBACX,WAAW,eACV,WAAW;AAAA,MAEhB,OAAO;AACL,eAAO,WAAW,eAAgB,WAAW;AAAA,MAC/C;AAAA,IACF,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,yBACX,WAAW,gBACX,WAAW,oBACV,WAAW;AAAA,MAEhB,OAAO;AACL,eACE,WAAW,oBAAqB,WAAW;AAAA,MAE/C;AAAA,IACF,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,sBACX,WAAW,gBACX,WAAW,iBACV,WAAW;AAAA,MAEhB,OAAO;AACL,eAAO,WAAW,iBAAiB;AAAA,MACrC;AAAA,IACF;AACE,YAAM,mBAA0B;AAChC,YAAM,IAAI,MAAM,yBAAyB,gBAAgB,EAAE;AAAA,EAC/D;AACF;AAMA,IAAM,yBAA0D,CAAC;AAAA,EAC/D;AACF,MAAM;AACJ,QAAM,WAAO,2BAAW,CAAC,MAAM,EAAE,IAAI;AACrC,QAAM,gBAAY,gCAAgB,CAAC,MAAM,EAAE,SAAS;AACpD,QAAM,YAAY,aAAa,YAAY,MAAM,SAAS;AAE1D,SAAO,4CAAC,aAAU;AACpB;AAOA,IAAM,oBAA4C,CAAC;AAAA,EACjD;AAAA,EACA;AACF,MAAM;AACJ,QAAM,oBAAgB,uCAAiB;AACvC,QAAM,cAAU;AAAA,IACd,MAAM,cAAc,mBAAmB,YAAY;AAAA,IACnD,CAAC,eAAe,YAAY;AAAA,EAC9B;AAEA,SACE,4CAAC,wDAAuB,SACtB,sDAAC,0BAAuB,YAAwB,GAClD;AAEJ;AAEA,IAAM,oBAAgB;AAAA,EACpB;AAAA,EACA,CAAC,MAAM,SACL,KAAK,iBAAiB,KAAK,gBAC3B,iBAAiB,KAAK,YAAY,KAAK,UAAU;AACrD;AAEO,IAAM,8BAAiE,CAAC;AAAA,EAC7E;AACF,MAAM;AACJ,QAAM,qBAAiB,gCAAU,CAAC,MAAM,EAAE,SAAS,MAAM;AACzD,MAAI,mBAAmB,EAAG,QAAO;AAEjC,SAAO,MAAM,KAAK,EAAE,QAAQ,eAAe,GAAG,CAAC,GAAG,UAChD,4CAAC,iBAA0B,cAAc,OAAO,cAA5B,KAAoD,CACzE;AACH;AAEA,4BAA4B,cAAc;AAEnC,IAAM,8BAA0B;AAAA,EACrC;AAAA,EACA,CAAC,MAAM,SAAS,iBAAiB,KAAK,YAAY,KAAK,UAAU;AACnE;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentType, type FC, memo, useMemo } from \"react\";\nimport { useThread, useThreadRuntime } from \"../../context/react/ThreadContext\";\nimport { MessageRuntimeProvider } from \"../../context/providers/MessageRuntimeProvider\";\nimport { useEditComposer, useMessage } from \"../../context\";\nimport { ThreadMessage as ThreadMessageType } from \"../../types\";\n\n/**\n * @deprecated Use `ThreadPrimitive.Messages.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveMessagesProps = ThreadPrimitiveMessages.Props;\n\nexport namespace ThreadPrimitiveMessages {\n export type Props = {\n components:\n | {\n Message: ComponentType;\n EditComposer?: ComponentType | undefined;\n UserEditComposer?: ComponentType | undefined;\n AssistantEditComposer?: ComponentType | undefined;\n SystemEditComposer?: ComponentType | undefined;\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n SystemMessage?: ComponentType | undefined;\n }\n | {\n Message?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n UserEditComposer?: ComponentType | undefined;\n AssistantEditComposer?: ComponentType | undefined;\n SystemEditComposer?: ComponentType | undefined;\n UserMessage: ComponentType;\n AssistantMessage: ComponentType;\n SystemMessage?: ComponentType | undefined;\n };\n };\n}\n\nconst isComponentsSame = (\n prev: ThreadPrimitiveMessages.Props[\"components\"],\n next: ThreadPrimitiveMessages.Props[\"components\"],\n) => {\n return (\n prev.Message === next.Message &&\n prev.EditComposer === next.EditComposer &&\n prev.UserEditComposer === next.UserEditComposer &&\n prev.AssistantEditComposer === next.AssistantEditComposer &&\n prev.SystemEditComposer === next.SystemEditComposer &&\n prev.UserMessage === next.UserMessage &&\n prev.AssistantMessage === next.AssistantMessage &&\n prev.SystemMessage === next.SystemMessage\n );\n};\n\nconst DEFAULT_SYSTEM_MESSAGE = () => null;\n\nconst getComponent = (\n components: ThreadPrimitiveMessages.Props[\"components\"],\n role: ThreadMessageType[\"role\"],\n isEditing: boolean,\n) => {\n switch (role) {\n case \"user\":\n if (isEditing) {\n return (\n components.UserEditComposer ??\n components.EditComposer ??\n components.UserMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return components.UserMessage ?? (components.Message as ComponentType);\n }\n case \"assistant\":\n if (isEditing) {\n return (\n components.AssistantEditComposer ??\n components.EditComposer ??\n components.AssistantMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return (\n components.AssistantMessage ?? (components.Message as ComponentType)\n );\n }\n case \"system\":\n if (isEditing) {\n return (\n components.SystemEditComposer ??\n components.EditComposer ??\n components.SystemMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return components.SystemMessage ?? DEFAULT_SYSTEM_MESSAGE;\n }\n default:\n const _exhaustiveCheck: never = role;\n throw new Error(`Unknown message role: ${_exhaustiveCheck}`);\n }\n};\n\ntype ThreadMessageComponentProps = {\n components: ThreadPrimitiveMessages.Props[\"components\"];\n};\n\nconst ThreadMessageComponent: FC<ThreadMessageComponentProps> = ({\n components,\n}) => {\n const role = useMessage((m) => m.role);\n const isEditing = useEditComposer((c) => c.isEditing);\n const Component = getComponent(components, role, isEditing);\n\n return <Component />;\n};\n\ntype ThreadMessageProps = {\n messageIndex: number;\n components: ThreadPrimitiveMessages.Props[\"components\"];\n};\n\nconst ThreadMessageImpl: FC<ThreadMessageProps> = ({\n messageIndex,\n components,\n}) => {\n const threadRuntime = useThreadRuntime();\n const runtime = useMemo(\n () => threadRuntime.getMesssageByIndex(messageIndex),\n [threadRuntime, messageIndex],\n );\n\n return (\n <MessageRuntimeProvider runtime={runtime}>\n <ThreadMessageComponent components={components} />\n </MessageRuntimeProvider>\n );\n};\n\nconst ThreadMessage = memo(\n ThreadMessageImpl,\n (prev, next) =>\n prev.messageIndex === next.messageIndex &&\n isComponentsSame(prev.components, next.components),\n);\n\nexport const ThreadPrimitiveMessagesImpl: FC<ThreadPrimitiveMessages.Props> = ({\n components,\n}) => {\n const messagesLength = useThread((t) => t.messages.length);\n if (messagesLength === 0) return null;\n\n return Array.from({ length: messagesLength }, (_, index) => (\n <ThreadMessage key={index} messageIndex={index} components={components} />\n ));\n};\n\nThreadPrimitiveMessagesImpl.displayName = \"ThreadPrimitive.Messages\";\n\nexport const ThreadPrimitiveMessages = memo(\n ThreadPrimitiveMessagesImpl,\n (prev, next) => isComponentsSame(prev.components, next.components),\n);\n"],"mappings":";;;AAEA,SAAsC,MAAM,eAAe;AAC3D,SAAS,WAAW,wBAAwB;AAC5C,SAAS,8BAA8B;AACvC,SAAS,iBAAiB,kBAAkB;AA8GnC;AA5ET,IAAM,mBAAmB,CACvB,MACA,SACG;AACH,SACE,KAAK,YAAY,KAAK,WACtB,KAAK,iBAAiB,KAAK,gBAC3B,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,0BAA0B,KAAK,yBACpC,KAAK,uBAAuB,KAAK,sBACjC,KAAK,gBAAgB,KAAK,eAC1B,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,kBAAkB,KAAK;AAEhC;AAEA,IAAM,yBAAyB,MAAM;AAErC,IAAM,eAAe,CACnB,YACA,MACA,cACG;AACH,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,oBACX,WAAW,gBACX,WAAW,eACV,WAAW;AAAA,MAEhB,OAAO;AACL,eAAO,WAAW,eAAgB,WAAW;AAAA,MAC/C;AAAA,IACF,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,yBACX,WAAW,gBACX,WAAW,oBACV,WAAW;AAAA,MAEhB,OAAO;AACL,eACE,WAAW,oBAAqB,WAAW;AAAA,MAE/C;AAAA,IACF,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,sBACX,WAAW,gBACX,WAAW,iBACV,WAAW;AAAA,MAEhB,OAAO;AACL,eAAO,WAAW,iBAAiB;AAAA,MACrC;AAAA,IACF;AACE,YAAM,mBAA0B;AAChC,YAAM,IAAI,MAAM,yBAAyB,gBAAgB,EAAE;AAAA,EAC/D;AACF;AAMA,IAAM,yBAA0D,CAAC;AAAA,EAC/D;AACF,MAAM;AACJ,QAAM,OAAO,WAAW,CAAC,MAAM,EAAE,IAAI;AACrC,QAAM,YAAY,gBAAgB,CAAC,MAAM,EAAE,SAAS;AACpD,QAAM,YAAY,aAAa,YAAY,MAAM,SAAS;AAE1D,SAAO,oBAAC,aAAU;AACpB;AAOA,IAAM,oBAA4C,CAAC;AAAA,EACjD;AAAA,EACA;AACF,MAAM;AACJ,QAAM,gBAAgB,iBAAiB;AACvC,QAAM,UAAU;AAAA,IACd,MAAM,cAAc,mBAAmB,YAAY;AAAA,IACnD,CAAC,eAAe,YAAY;AAAA,EAC9B;AAEA,SACE,oBAAC,0BAAuB,SACtB,8BAAC,0BAAuB,YAAwB,GAClD;AAEJ;AAEA,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA,CAAC,MAAM,SACL,KAAK,iBAAiB,KAAK,gBAC3B,iBAAiB,KAAK,YAAY,KAAK,UAAU;AACrD;AAEO,IAAM,8BAAiE,CAAC;AAAA,EAC7E;AACF,MAAM;AACJ,QAAM,iBAAiB,UAAU,CAAC,MAAM,EAAE,SAAS,MAAM;AACzD,MAAI,mBAAmB,EAAG,QAAO;AAEjC,SAAO,MAAM,KAAK,EAAE,QAAQ,eAAe,GAAG,CAAC,GAAG,UAChD,oBAAC,iBAA0B,cAAc,OAAO,cAA5B,KAAoD,CACzE;AACH;AAEA,4BAA4B,cAAc;AAEnC,IAAM,0BAA0B;AAAA,EACrC;AAAA,EACA,CAAC,MAAM,SAAS,iBAAiB,KAAK,YAAY,KAAK,UAAU;AACnE;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentType, type FC, memo, useMemo } from \"react\";\nimport { useThread, useThreadRuntime } from \"../../context/react/ThreadContext\";\nimport { MessageRuntimeProvider } from \"../../context/providers/MessageRuntimeProvider\";\nimport { useEditComposer, useMessage } from \"../../context\";\nimport { ThreadMessage as ThreadMessageType } from \"../../types\";\n\nexport namespace ThreadPrimitiveMessages {\n export type Props = {\n components:\n | {\n Message: ComponentType;\n EditComposer?: ComponentType | undefined;\n UserEditComposer?: ComponentType | undefined;\n AssistantEditComposer?: ComponentType | undefined;\n SystemEditComposer?: ComponentType | undefined;\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n SystemMessage?: ComponentType | undefined;\n }\n | {\n Message?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n UserEditComposer?: ComponentType | undefined;\n AssistantEditComposer?: ComponentType | undefined;\n SystemEditComposer?: ComponentType | undefined;\n UserMessage: ComponentType;\n AssistantMessage: ComponentType;\n SystemMessage?: ComponentType | undefined;\n };\n };\n}\n\nconst isComponentsSame = (\n prev: ThreadPrimitiveMessages.Props[\"components\"],\n next: ThreadPrimitiveMessages.Props[\"components\"],\n) => {\n return (\n prev.Message === next.Message &&\n prev.EditComposer === next.EditComposer &&\n prev.UserEditComposer === next.UserEditComposer &&\n prev.AssistantEditComposer === next.AssistantEditComposer &&\n prev.SystemEditComposer === next.SystemEditComposer &&\n prev.UserMessage === next.UserMessage &&\n prev.AssistantMessage === next.AssistantMessage &&\n prev.SystemMessage === next.SystemMessage\n );\n};\n\nconst DEFAULT_SYSTEM_MESSAGE = () => null;\n\nconst getComponent = (\n components: ThreadPrimitiveMessages.Props[\"components\"],\n role: ThreadMessageType[\"role\"],\n isEditing: boolean,\n) => {\n switch (role) {\n case \"user\":\n if (isEditing) {\n return (\n components.UserEditComposer ??\n components.EditComposer ??\n components.UserMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return components.UserMessage ?? (components.Message as ComponentType);\n }\n case \"assistant\":\n if (isEditing) {\n return (\n components.AssistantEditComposer ??\n components.EditComposer ??\n components.AssistantMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return (\n components.AssistantMessage ?? (components.Message as ComponentType)\n );\n }\n case \"system\":\n if (isEditing) {\n return (\n components.SystemEditComposer ??\n components.EditComposer ??\n components.SystemMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return components.SystemMessage ?? DEFAULT_SYSTEM_MESSAGE;\n }\n default:\n const _exhaustiveCheck: never = role;\n throw new Error(`Unknown message role: ${_exhaustiveCheck}`);\n }\n};\n\ntype ThreadMessageComponentProps = {\n components: ThreadPrimitiveMessages.Props[\"components\"];\n};\n\nconst ThreadMessageComponent: FC<ThreadMessageComponentProps> = ({\n components,\n}) => {\n const role = useMessage((m) => m.role);\n const isEditing = useEditComposer((c) => c.isEditing);\n const Component = getComponent(components, role, isEditing);\n\n return <Component />;\n};\n\ntype ThreadMessageProps = {\n messageIndex: number;\n components: ThreadPrimitiveMessages.Props[\"components\"];\n};\n\nconst ThreadMessageImpl: FC<ThreadMessageProps> = ({\n messageIndex,\n components,\n}) => {\n const threadRuntime = useThreadRuntime();\n const runtime = useMemo(\n () => threadRuntime.getMesssageByIndex(messageIndex),\n [threadRuntime, messageIndex],\n );\n\n return (\n <MessageRuntimeProvider runtime={runtime}>\n <ThreadMessageComponent components={components} />\n </MessageRuntimeProvider>\n );\n};\n\nconst ThreadMessage = memo(\n ThreadMessageImpl,\n (prev, next) =>\n prev.messageIndex === next.messageIndex &&\n isComponentsSame(prev.components, next.components),\n);\n\nexport const ThreadPrimitiveMessagesImpl: FC<ThreadPrimitiveMessages.Props> = ({\n components,\n}) => {\n const messagesLength = useThread((t) => t.messages.length);\n if (messagesLength === 0) return null;\n\n return Array.from({ length: messagesLength }, (_, index) => (\n <ThreadMessage key={index} messageIndex={index} components={components} />\n ));\n};\n\nThreadPrimitiveMessagesImpl.displayName = \"ThreadPrimitive.Messages\";\n\nexport const ThreadPrimitiveMessages = memo(\n ThreadPrimitiveMessagesImpl,\n (prev, next) => isComponentsSame(prev.components, next.components),\n);\n"],"mappings":";;;AAEA,SAAsC,MAAM,eAAe;AAC3D,SAAS,WAAW,wBAAwB;AAC5C,SAAS,8BAA8B;AACvC,SAAS,iBAAiB,kBAAkB;AAyGnC;AA5ET,IAAM,mBAAmB,CACvB,MACA,SACG;AACH,SACE,KAAK,YAAY,KAAK,WACtB,KAAK,iBAAiB,KAAK,gBAC3B,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,0BAA0B,KAAK,yBACpC,KAAK,uBAAuB,KAAK,sBACjC,KAAK,gBAAgB,KAAK,eAC1B,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,kBAAkB,KAAK;AAEhC;AAEA,IAAM,yBAAyB,MAAM;AAErC,IAAM,eAAe,CACnB,YACA,MACA,cACG;AACH,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,oBACX,WAAW,gBACX,WAAW,eACV,WAAW;AAAA,MAEhB,OAAO;AACL,eAAO,WAAW,eAAgB,WAAW;AAAA,MAC/C;AAAA,IACF,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,yBACX,WAAW,gBACX,WAAW,oBACV,WAAW;AAAA,MAEhB,OAAO;AACL,eACE,WAAW,oBAAqB,WAAW;AAAA,MAE/C;AAAA,IACF,KAAK;AACH,UAAI,WAAW;AACb,eACE,WAAW,sBACX,WAAW,gBACX,WAAW,iBACV,WAAW;AAAA,MAEhB,OAAO;AACL,eAAO,WAAW,iBAAiB;AAAA,MACrC;AAAA,IACF;AACE,YAAM,mBAA0B;AAChC,YAAM,IAAI,MAAM,yBAAyB,gBAAgB,EAAE;AAAA,EAC/D;AACF;AAMA,IAAM,yBAA0D,CAAC;AAAA,EAC/D;AACF,MAAM;AACJ,QAAM,OAAO,WAAW,CAAC,MAAM,EAAE,IAAI;AACrC,QAAM,YAAY,gBAAgB,CAAC,MAAM,EAAE,SAAS;AACpD,QAAM,YAAY,aAAa,YAAY,MAAM,SAAS;AAE1D,SAAO,oBAAC,aAAU;AACpB;AAOA,IAAM,oBAA4C,CAAC;AAAA,EACjD;AAAA,EACA;AACF,MAAM;AACJ,QAAM,gBAAgB,iBAAiB;AACvC,QAAM,UAAU;AAAA,IACd,MAAM,cAAc,mBAAmB,YAAY;AAAA,IACnD,CAAC,eAAe,YAAY;AAAA,EAC9B;AAEA,SACE,oBAAC,0BAAuB,SACtB,8BAAC,0BAAuB,YAAwB,GAClD;AAEJ;AAEA,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA,CAAC,MAAM,SACL,KAAK,iBAAiB,KAAK,gBAC3B,iBAAiB,KAAK,YAAY,KAAK,UAAU;AACrD;AAEO,IAAM,8BAAiE,CAAC;AAAA,EAC7E;AACF,MAAM;AACJ,QAAM,iBAAiB,UAAU,CAAC,MAAM,EAAE,SAAS,MAAM;AACzD,MAAI,mBAAmB,EAAG,QAAO;AAEjC,SAAO,MAAM,KAAK,EAAE,QAAQ,eAAe,GAAG,CAAC,GAAG,UAChD,oBAAC,iBAA0B,cAAc,OAAO,cAA5B,KAAoD,CACzE;AACH;AAEA,4BAA4B,cAAc;AAEnC,IAAM,0BAA0B;AAAA,EACrC;AAAA,EACA,CAAC,MAAM,SAAS,iBAAiB,KAAK,YAAY,KAAK,UAAU;AACnE;","names":[]}
@@ -1,9 +1,5 @@
1
1
  import { Primitive } from "@radix-ui/react-primitive";
2
2
  import { type ElementRef, ComponentPropsWithoutRef } from "react";
3
- /**
4
- * @deprecated Use `ThreadPrimitive.Root.Props` instead. This will be removed in 0.6.
5
- */
6
- export type ThreadPrimitiveRootProps = ThreadPrimitiveRoot.Props;
7
3
  export declare namespace ThreadPrimitiveRoot {
8
4
  type Element = ElementRef<typeof Primitive.div>;
9
5
  type Props = ComponentPropsWithoutRef<typeof Primitive.div>;
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadRoot.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAc,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,CAAC,KAAK,CAAC;AAEjE,yBAAiB,mBAAmB,CAAC;IACnC,KAAY,OAAO,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACvD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,mBAAmB;;;;0DAK9B,CAAC"}
1
+ {"version":3,"file":"ThreadRoot.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAc,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAE9E,yBAAiB,mBAAmB,CAAC;IACnC,KAAY,OAAO,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACvD,KAAY,KAAK,GAAG,wBAAwB,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,mBAAmB;;;;0DAK9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { type ElementRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\n\n/**\n * @deprecated Use `ThreadPrimitive.Root.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveRootProps = ThreadPrimitiveRoot.Props;\n\nexport namespace ThreadPrimitiveRoot {\n export type Element = ElementRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const ThreadPrimitiveRoot = forwardRef<\n ThreadPrimitiveRoot.Element,\n ThreadPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nThreadPrimitiveRoot.displayName = \"ThreadPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,6BAA0B;AAC1B,mBAAsE;AAgB7D;AAJF,IAAM,0BAAsB,yBAGjC,CAAC,OAAO,QAAQ;AAChB,SAAO,4CAAC,iCAAU,KAAV,EAAe,GAAG,OAAO,KAAU;AAC7C,CAAC;AAED,oBAAoB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { type ElementRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\n\nexport namespace ThreadPrimitiveRoot {\n export type Element = ElementRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const ThreadPrimitiveRoot = forwardRef<\n ThreadPrimitiveRoot.Element,\n ThreadPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nThreadPrimitiveRoot.displayName = \"ThreadPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,6BAA0B;AAC1B,mBAAsE;AAW7D;AAJF,IAAM,0BAAsB,yBAGjC,CAAC,OAAO,QAAQ;AAChB,SAAO,4CAAC,iCAAU,KAAV,EAAe,GAAG,OAAO,KAAU;AAC7C,CAAC;AAED,oBAAoB,cAAc;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { type ElementRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\n\n/**\n * @deprecated Use `ThreadPrimitive.Root.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveRootProps = ThreadPrimitiveRoot.Props;\n\nexport namespace ThreadPrimitiveRoot {\n export type Element = ElementRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const ThreadPrimitiveRoot = forwardRef<\n ThreadPrimitiveRoot.Element,\n ThreadPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nThreadPrimitiveRoot.displayName = \"ThreadPrimitive.Root\";\n"],"mappings":";;;AAEA,SAAS,iBAAiB;AAC1B,SAA0B,kBAA4C;AAgB7D;AAJF,IAAM,sBAAsB,WAGjC,CAAC,OAAO,QAAQ;AAChB,SAAO,oBAAC,UAAU,KAAV,EAAe,GAAG,OAAO,KAAU;AAC7C,CAAC;AAED,oBAAoB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { type ElementRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\n\nexport namespace ThreadPrimitiveRoot {\n export type Element = ElementRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const ThreadPrimitiveRoot = forwardRef<\n ThreadPrimitiveRoot.Element,\n ThreadPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nThreadPrimitiveRoot.displayName = \"ThreadPrimitive.Root\";\n"],"mappings":";;;AAEA,SAAS,iBAAiB;AAC1B,SAA0B,kBAA4C;AAW7D;AAJF,IAAM,sBAAsB,WAGjC,CAAC,OAAO,QAAQ;AAChB,SAAO,oBAAC,UAAU,KAAV,EAAe,GAAG,OAAO,KAAU;AAC7C,CAAC;AAED,oBAAoB,cAAc;","names":[]}
@@ -1,9 +1,5 @@
1
1
  import { ActionButtonElement, ActionButtonProps } from "../../utils/createActionButton";
2
2
  import { useThreadScrollToBottom } from "../../primitive-hooks/thread/useThreadScrollToBottom";
3
- /**
4
- * @deprecated Use `ThreadPrimitive.ScrollToBottom.Props` instead. This will be removed in 0.6.
5
- */
6
- export type ThreadPrimitiveScrollToBottomProps = ThreadPrimitiveScrollToBottom.Props;
7
3
  export declare namespace ThreadPrimitiveScrollToBottom {
8
4
  type Element = ActionButtonElement;
9
5
  type Props = ActionButtonProps<typeof useThreadScrollToBottom>;
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadScrollToBottom.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadScrollToBottom.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAC5C,6BAA6B,CAAC,KAAK,CAAC;AAEtC,yBAAiB,6BAA6B,CAAC;IAC7C,KAAY,OAAO,GAAG,mBAAmB,CAAC;IAC1C,KAAY,KAAK,GAAG,iBAAiB,CAAC,OAAO,uBAAuB,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,6BAA6B;;;;6DAGzC,CAAC"}
1
+ {"version":3,"file":"ThreadScrollToBottom.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadScrollToBottom.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAE/F,yBAAiB,6BAA6B,CAAC;IAC7C,KAAY,OAAO,GAAG,mBAAmB,CAAC;IAC1C,KAAY,KAAK,GAAG,iBAAiB,CAAC,OAAO,uBAAuB,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,6BAA6B;;;;6DAGzC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadScrollToBottom.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadScrollToBottom } from \"../../primitive-hooks/thread/useThreadScrollToBottom\";\n\n/**\n * @deprecated Use `ThreadPrimitive.ScrollToBottom.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveScrollToBottomProps =\n ThreadPrimitiveScrollToBottom.Props;\n\nexport namespace ThreadPrimitiveScrollToBottom {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadScrollToBottom>;\n}\n\nexport const ThreadPrimitiveScrollToBottom = createActionButton(\n \"ThreadPrimitive.ScrollToBottom\",\n useThreadScrollToBottom,\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gCAIO;AACP,qCAAwC;AAajC,IAAM,oCAAgC;AAAA,EAC3C;AAAA,EACA;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadScrollToBottom.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadScrollToBottom } from \"../../primitive-hooks/thread/useThreadScrollToBottom\";\n\nexport namespace ThreadPrimitiveScrollToBottom {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadScrollToBottom>;\n}\n\nexport const ThreadPrimitiveScrollToBottom = createActionButton(\n \"ThreadPrimitive.ScrollToBottom\",\n useThreadScrollToBottom,\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gCAIO;AACP,qCAAwC;AAOjC,IAAM,oCAAgC;AAAA,EAC3C;AAAA,EACA;AACF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadScrollToBottom.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadScrollToBottom } from \"../../primitive-hooks/thread/useThreadScrollToBottom\";\n\n/**\n * @deprecated Use `ThreadPrimitive.ScrollToBottom.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveScrollToBottomProps =\n ThreadPrimitiveScrollToBottom.Props;\n\nexport namespace ThreadPrimitiveScrollToBottom {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadScrollToBottom>;\n}\n\nexport const ThreadPrimitiveScrollToBottom = createActionButton(\n \"ThreadPrimitive.ScrollToBottom\",\n useThreadScrollToBottom,\n);\n"],"mappings":";;;AAEA;AAAA,EAGE;AAAA,OACK;AACP,SAAS,+BAA+B;AAajC,IAAM,gCAAgC;AAAA,EAC3C;AAAA,EACA;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadScrollToBottom.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadScrollToBottom } from \"../../primitive-hooks/thread/useThreadScrollToBottom\";\n\nexport namespace ThreadPrimitiveScrollToBottom {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadScrollToBottom>;\n}\n\nexport const ThreadPrimitiveScrollToBottom = createActionButton(\n \"ThreadPrimitive.ScrollToBottom\",\n useThreadScrollToBottom,\n);\n"],"mappings":";;;AAEA;AAAA,EAGE;AAAA,OACK;AACP,SAAS,+BAA+B;AAOjC,IAAM,gCAAgC;AAAA,EAC3C;AAAA,EACA;AACF;","names":[]}
@@ -1,9 +1,5 @@
1
1
  import { ActionButtonElement, ActionButtonProps } from "../../utils/createActionButton";
2
2
  import { useThreadSuggestion } from "../../primitive-hooks/thread/useThreadSuggestion";
3
- /**
4
- * @deprecated Use `ThreadPrimitive.Suggestion.Props` instead. This will be removed in 0.6.
5
- */
6
- export type ThreadPrimitiveSuggestionProps = ThreadPrimitiveSuggestion.Props;
7
3
  export declare namespace ThreadPrimitiveSuggestion {
8
4
  type Element = ActionButtonElement;
9
5
  type Props = ActionButtonProps<typeof useThreadSuggestion>;
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadSuggestion.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadSuggestion.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,CAAC,KAAK,CAAC;AAE7E,yBAAiB,yBAAyB,CAAC;IACzC,KAAY,OAAO,GAAG,mBAAmB,CAAC;IAC1C,KAAY,KAAK,GAAG,iBAAiB,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACnE;AAED,eAAO,MAAM,yBAAyB;;;;wJAIrC,CAAC"}
1
+ {"version":3,"file":"ThreadSuggestion.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadSuggestion.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AAEvF,yBAAiB,yBAAyB,CAAC;IACzC,KAAY,OAAO,GAAG,mBAAmB,CAAC;IAC1C,KAAY,KAAK,GAAG,iBAAiB,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACnE;AAED,eAAO,MAAM,yBAAyB;;;;wJAIrC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadSuggestion.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadSuggestion } from \"../../primitive-hooks/thread/useThreadSuggestion\";\n\n/**\n * @deprecated Use `ThreadPrimitive.Suggestion.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveSuggestionProps = ThreadPrimitiveSuggestion.Props;\n\nexport namespace ThreadPrimitiveSuggestion {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadSuggestion>;\n}\n\nexport const ThreadPrimitiveSuggestion = createActionButton(\n \"ThreadPrimitive.Suggestion\",\n useThreadSuggestion,\n [\"prompt\", \"autoSend\", \"method\"],\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gCAIO;AACP,iCAAoC;AAY7B,IAAM,gCAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA,CAAC,UAAU,YAAY,QAAQ;AACjC;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadSuggestion.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadSuggestion } from \"../../primitive-hooks/thread/useThreadSuggestion\";\n\nexport namespace ThreadPrimitiveSuggestion {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadSuggestion>;\n}\n\nexport const ThreadPrimitiveSuggestion = createActionButton(\n \"ThreadPrimitive.Suggestion\",\n useThreadSuggestion,\n [\"prompt\", \"autoSend\", \"method\"],\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gCAIO;AACP,iCAAoC;AAO7B,IAAM,gCAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA,CAAC,UAAU,YAAY,QAAQ;AACjC;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/primitives/thread/ThreadSuggestion.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadSuggestion } from \"../../primitive-hooks/thread/useThreadSuggestion\";\n\n/**\n * @deprecated Use `ThreadPrimitive.Suggestion.Props` instead. This will be removed in 0.6.\n */\nexport type ThreadPrimitiveSuggestionProps = ThreadPrimitiveSuggestion.Props;\n\nexport namespace ThreadPrimitiveSuggestion {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadSuggestion>;\n}\n\nexport const ThreadPrimitiveSuggestion = createActionButton(\n \"ThreadPrimitive.Suggestion\",\n useThreadSuggestion,\n [\"prompt\", \"autoSend\", \"method\"],\n);\n"],"mappings":";;;AAEA;AAAA,EAGE;AAAA,OACK;AACP,SAAS,2BAA2B;AAY7B,IAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA,CAAC,UAAU,YAAY,QAAQ;AACjC;","names":[]}
1
+ {"version":3,"sources":["../../../src/primitives/thread/ThreadSuggestion.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadSuggestion } from \"../../primitive-hooks/thread/useThreadSuggestion\";\n\nexport namespace ThreadPrimitiveSuggestion {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadSuggestion>;\n}\n\nexport const ThreadPrimitiveSuggestion = createActionButton(\n \"ThreadPrimitive.Suggestion\",\n useThreadSuggestion,\n [\"prompt\", \"autoSend\", \"method\"],\n);\n"],"mappings":";;;AAEA;AAAA,EAGE;AAAA,OACK;AACP,SAAS,2BAA2B;AAO7B,IAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA,CAAC,UAAU,YAAY,QAAQ;AACjC;","names":[]}
@@ -1,10 +1,6 @@
1
1
  import { Primitive } from "@radix-ui/react-primitive";
2
2
  import { type ElementRef, ComponentPropsWithoutRef } from "react";
3
3
  import { UseThreadViewportAutoScrollProps } from "../../primitive-hooks/thread/useThreadViewportAutoScroll";
4
- /**
5
- * @deprecated Use `ThreadPrimitive.Viewport.Props` instead. This will be removed in 0.6.
6
- */
7
- export type ThreadPrimitiveViewportProps = ThreadPrimitiveViewport.Props;
8
4
  export declare namespace ThreadPrimitiveViewport {
9
5
  type Element = ElementRef<typeof Primitive.div>;
10
6
  type Props = ComponentPropsWithoutRef<typeof Primitive.div> & UseThreadViewportAutoScrollProps;