@assistant-ui/react 0.15.16 → 0.15.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/README.md +4 -4
  2. package/dist/index.d.ts +8 -4
  3. package/dist/index.js +4 -2
  4. package/dist/mcp-apps/McpAppRenderer.d.ts +36 -9
  5. package/dist/mcp-apps/McpAppRenderer.d.ts.map +1 -1
  6. package/dist/mcp-apps/McpAppRenderer.js +108 -57
  7. package/dist/mcp-apps/McpAppRenderer.js.map +1 -1
  8. package/dist/mcp-apps/McpAppsRemoteHost.d.ts.map +1 -1
  9. package/dist/mcp-apps/McpAppsRemoteHost.js +20 -17
  10. package/dist/mcp-apps/McpAppsRemoteHost.js.map +1 -1
  11. package/dist/mcp-apps/app-frame.d.ts.map +1 -1
  12. package/dist/mcp-apps/app-frame.js +229 -115
  13. package/dist/mcp-apps/app-frame.js.map +1 -1
  14. package/dist/mcp-apps/bridge.js +2 -3
  15. package/dist/mcp-apps/bridge.js.map +1 -1
  16. package/dist/mcp-apps/index.d.ts +3 -3
  17. package/dist/model-context/frame/useAssistantFrameHost.d.ts +1 -1
  18. package/dist/model-context/frame/useAssistantFrameHost.js +10 -11
  19. package/dist/model-context/frame/useAssistantFrameHost.js.map +1 -1
  20. package/dist/model-context/makeAssistantVisible.js +1 -1
  21. package/dist/model-context/makeAssistantVisible.js.map +1 -1
  22. package/dist/primitives/actionBar/ActionBarCopy.js +3 -3
  23. package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
  24. package/dist/primitives/actionBar/ActionBarExportMarkdown.js +3 -3
  25. package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
  26. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +3 -3
  27. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
  28. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +3 -3
  29. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
  30. package/dist/primitives/actionBar/ActionBarRoot.js.map +1 -1
  31. package/dist/primitives/actionBar/ActionBarStopSpeaking.js +3 -3
  32. package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
  33. package/dist/primitives/actionBarMore/ActionBarMoreContent.js.map +1 -1
  34. package/dist/primitives/actionBarMore/ActionBarMoreItem.js.map +1 -1
  35. package/dist/primitives/actionBarMore/ActionBarMoreRoot.js.map +1 -1
  36. package/dist/primitives/actionBarMore/ActionBarMoreSeparator.js.map +1 -1
  37. package/dist/primitives/actionBarMore/ActionBarMoreTrigger.js.map +1 -1
  38. package/dist/primitives/actionBarMore/scope.d.ts +2 -2
  39. package/dist/primitives/actionBarMore/scope.d.ts.map +1 -1
  40. package/dist/primitives/actionBarMore/scope.js.map +1 -1
  41. package/dist/primitives/assistantModal/AssistantModalAnchor.js.map +1 -1
  42. package/dist/primitives/assistantModal/AssistantModalContent.js +1 -1
  43. package/dist/primitives/assistantModal/AssistantModalContent.js.map +1 -1
  44. package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
  45. package/dist/primitives/assistantModal/AssistantModalTrigger.js.map +1 -1
  46. package/dist/primitives/assistantModal/scope.d.ts +2 -2
  47. package/dist/primitives/assistantModal/scope.d.ts.map +1 -1
  48. package/dist/primitives/assistantModal/scope.js.map +1 -1
  49. package/dist/primitives/branchPicker/BranchPickerRoot.js.map +1 -1
  50. package/dist/primitives/composer/ComposerAttachmentDropzone.js +1 -1
  51. package/dist/primitives/composer/ComposerAttachmentDropzone.js.map +1 -1
  52. package/dist/primitives/composer/ComposerDictationTranscript.js.map +1 -1
  53. package/dist/primitives/composer/ComposerInput.js +1 -3
  54. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  55. package/dist/primitives/composer/ComposerInputPluginContext.d.ts +1 -2
  56. package/dist/primitives/composer/ComposerInputPluginContext.d.ts.map +1 -1
  57. package/dist/primitives/composer/ComposerInputPluginContext.js +1 -6
  58. package/dist/primitives/composer/ComposerInputPluginContext.js.map +1 -1
  59. package/dist/primitives/composer/ComposerQuote.js +5 -5
  60. package/dist/primitives/composer/ComposerQuote.js.map +1 -1
  61. package/dist/primitives/composer/ComposerRoot.js +3 -3
  62. package/dist/primitives/composer/ComposerRoot.js.map +1 -1
  63. package/dist/primitives/composer/trigger/TriggerPopover.d.ts +5 -0
  64. package/dist/primitives/composer/trigger/TriggerPopover.d.ts.map +1 -1
  65. package/dist/primitives/composer/trigger/TriggerPopover.js +157 -130
  66. package/dist/primitives/composer/trigger/TriggerPopover.js.map +1 -1
  67. package/dist/primitives/composer/trigger/TriggerPopoverAction.js +46 -15
  68. package/dist/primitives/composer/trigger/TriggerPopoverAction.js.map +1 -1
  69. package/dist/primitives/composer/trigger/TriggerPopoverBack.js +3 -3
  70. package/dist/primitives/composer/trigger/TriggerPopoverBack.js.map +1 -1
  71. package/dist/primitives/composer/trigger/TriggerPopoverCategories.js +4 -4
  72. package/dist/primitives/composer/trigger/TriggerPopoverCategories.js.map +1 -1
  73. package/dist/primitives/composer/trigger/TriggerPopoverDirective.js +40 -10
  74. package/dist/primitives/composer/trigger/TriggerPopoverDirective.js.map +1 -1
  75. package/dist/primitives/composer/trigger/TriggerPopoverItems.js +4 -4
  76. package/dist/primitives/composer/trigger/TriggerPopoverItems.js.map +1 -1
  77. package/dist/primitives/composer/trigger/TriggerPopoverResource.d.ts +2 -0
  78. package/dist/primitives/composer/trigger/TriggerPopoverResource.d.ts.map +1 -1
  79. package/dist/primitives/composer/trigger/TriggerPopoverResource.js +63 -61
  80. package/dist/primitives/composer/trigger/TriggerPopoverResource.js.map +1 -1
  81. package/dist/primitives/composer/trigger/TriggerPopoverRootContext.d.ts +2 -0
  82. package/dist/primitives/composer/trigger/TriggerPopoverRootContext.d.ts.map +1 -1
  83. package/dist/primitives/composer/trigger/TriggerPopoverRootContext.js.map +1 -1
  84. package/dist/primitives/composer/trigger/detectTrigger.d.ts +21 -1
  85. package/dist/primitives/composer/trigger/detectTrigger.d.ts.map +1 -0
  86. package/dist/primitives/composer/trigger/detectTrigger.js +17 -3
  87. package/dist/primitives/composer/trigger/detectTrigger.js.map +1 -1
  88. package/dist/primitives/composer/trigger/index.d.ts +3 -1
  89. package/dist/primitives/composer/trigger/index.d.ts.map +1 -1
  90. package/dist/primitives/composer/trigger/index.js.map +1 -1
  91. package/dist/primitives/composer/trigger/matchesTriggerItemQuery.d.ts +6 -0
  92. package/dist/primitives/composer/trigger/matchesTriggerItemQuery.d.ts.map +1 -0
  93. package/dist/primitives/composer/trigger/matchesTriggerItemQuery.js +9 -0
  94. package/dist/primitives/composer/trigger/matchesTriggerItemQuery.js.map +1 -0
  95. package/dist/primitives/composer/trigger/triggerDetectionResource.d.ts +3 -4
  96. package/dist/primitives/composer/trigger/triggerDetectionResource.d.ts.map +1 -1
  97. package/dist/primitives/composer/trigger/triggerDetectionResource.js +15 -14
  98. package/dist/primitives/composer/trigger/triggerDetectionResource.js.map +1 -1
  99. package/dist/primitives/composer/trigger/triggerNavigationResource.d.ts.map +1 -1
  100. package/dist/primitives/composer/trigger/triggerNavigationResource.js +3 -5
  101. package/dist/primitives/composer/trigger/triggerNavigationResource.js.map +1 -1
  102. package/dist/primitives/composer/trigger/triggerSelectionResource.d.ts.map +1 -1
  103. package/dist/primitives/composer/trigger/triggerSelectionResource.js +18 -19
  104. package/dist/primitives/composer/trigger/triggerSelectionResource.js.map +1 -1
  105. package/dist/primitives/composer.d.ts +3 -2
  106. package/dist/primitives/composer.js.map +1 -1
  107. package/dist/primitives/error/ErrorMessage.js.map +1 -1
  108. package/dist/primitives/message/MessageIf.js.map +1 -1
  109. package/dist/primitives/message/MessageParts.js.map +1 -1
  110. package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
  111. package/dist/primitives/message/MessageRoot.js +4 -4
  112. package/dist/primitives/message/MessageRoot.js.map +1 -1
  113. package/dist/primitives/messagePart/MessagePartText.d.ts +1 -1
  114. package/dist/primitives/messagePart/MessagePartText.js.map +1 -1
  115. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js +3 -3
  116. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js.map +1 -1
  117. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js +3 -3
  118. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js.map +1 -1
  119. package/dist/primitives/thread/ThreadIf.js.map +1 -1
  120. package/dist/primitives/thread/ThreadViewport.js +3 -3
  121. package/dist/primitives/thread/ThreadViewport.js.map +1 -1
  122. package/dist/primitives/thread/ThreadViewportFooter.js +3 -3
  123. package/dist/primitives/thread/ThreadViewportFooter.js.map +1 -1
  124. package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
  125. package/dist/primitives/thread/useThreadViewportAutoScroll.js +4 -4
  126. package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
  127. package/dist/primitives/threadList/ThreadListNew.js +3 -3
  128. package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
  129. package/dist/primitives/threadListFocusGroup.d.ts +2 -1
  130. package/dist/primitives/threadListFocusGroup.d.ts.map +1 -1
  131. package/dist/primitives/threadListFocusGroup.js +2 -2
  132. package/dist/primitives/threadListFocusGroup.js.map +1 -1
  133. package/dist/primitives/threadListItem/ThreadListItemRoot.js +3 -3
  134. package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
  135. package/dist/primitives/threadListItem/ThreadListItemTrigger.js +1 -1
  136. package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -1
  137. package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js +1 -1
  138. package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js.map +1 -1
  139. package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.js.map +1 -1
  140. package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js +1 -1
  141. package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js.map +1 -1
  142. package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.js.map +1 -1
  143. package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js +1 -2
  144. package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js.map +1 -1
  145. package/dist/primitives/threadListItemMore/scope.d.ts +2 -2
  146. package/dist/primitives/threadListItemMore/scope.d.ts.map +1 -1
  147. package/dist/primitives/threadListItemMore/scope.js.map +1 -1
  148. package/dist/sandbox-host/SandboxHost.d.ts.map +1 -1
  149. package/dist/sandbox-host/SandboxHost.js +148 -72
  150. package/dist/sandbox-host/SandboxHost.js.map +1 -1
  151. package/dist/unstable/useLiveCompletionAdapter.js +3 -1
  152. package/dist/unstable/useLiveCompletionAdapter.js.map +1 -1
  153. package/dist/unstable/useMentionAdapter.d.ts +9 -3
  154. package/dist/unstable/useMentionAdapter.d.ts.map +1 -1
  155. package/dist/unstable/useMentionAdapter.js +50 -43
  156. package/dist/unstable/useMentionAdapter.js.map +1 -1
  157. package/dist/unstable/useModelContextSnapshot.d.ts +34 -0
  158. package/dist/unstable/useModelContextSnapshot.d.ts.map +1 -0
  159. package/dist/unstable/useModelContextSnapshot.js +61 -0
  160. package/dist/unstable/useModelContextSnapshot.js.map +1 -0
  161. package/dist/unstable/useSlashCommandAdapter.d.ts.map +1 -1
  162. package/dist/unstable/useSlashCommandAdapter.js +37 -29
  163. package/dist/unstable/useSlashCommandAdapter.js.map +1 -1
  164. package/dist/unstable/webmcp/WebMcpRegistrationResource.d.ts +14 -0
  165. package/dist/unstable/webmcp/WebMcpRegistrationResource.d.ts.map +1 -0
  166. package/dist/unstable/webmcp/WebMcpRegistrationResource.js +85 -0
  167. package/dist/unstable/webmcp/WebMcpRegistrationResource.js.map +1 -0
  168. package/dist/unstable/webmcp/convertTools.d.ts +21 -0
  169. package/dist/unstable/webmcp/convertTools.d.ts.map +1 -0
  170. package/dist/unstable/webmcp/convertTools.js +110 -0
  171. package/dist/unstable/webmcp/convertTools.js.map +1 -0
  172. package/dist/unstable/webmcp/useWebMcpProvider.d.ts +21 -0
  173. package/dist/unstable/webmcp/useWebMcpProvider.d.ts.map +1 -0
  174. package/dist/unstable/webmcp/useWebMcpProvider.js +105 -0
  175. package/dist/unstable/webmcp/useWebMcpProvider.js.map +1 -0
  176. package/dist/unstable/webmcp/webmcp-host.d.ts +39 -0
  177. package/dist/unstable/webmcp/webmcp-host.d.ts.map +1 -0
  178. package/dist/unstable/webmcp/webmcp-host.js +29 -0
  179. package/dist/unstable/webmcp/webmcp-host.js.map +1 -0
  180. package/dist/utils/Primitive.d.ts +6 -6
  181. package/dist/utils/Primitive.js +2 -2
  182. package/dist/utils/Primitive.js.map +1 -1
  183. package/dist/utils/createActionButton.js +3 -3
  184. package/dist/utils/createActionButton.js.map +1 -1
  185. package/dist/utils/hooks/useOnResizeContent.js +1 -1
  186. package/dist/utils/hooks/useOnResizeContent.js.map +1 -1
  187. package/dist/utils/hooks/useOnScrollToBottom.js +1 -1
  188. package/dist/utils/hooks/useOnScrollToBottom.js.map +1 -1
  189. package/dist/utils/smooth/SmoothContext.d.ts +24 -0
  190. package/dist/utils/smooth/SmoothContext.d.ts.map +1 -1
  191. package/dist/utils/smooth/useSmooth.js +1 -1
  192. package/dist/utils/smooth/useSmooth.js.map +1 -1
  193. package/package.json +14 -22
  194. package/src/index.ts +22 -1
  195. package/src/mcp-apps/McpAppRenderer.test.tsx +386 -9
  196. package/src/mcp-apps/McpAppRenderer.tsx +171 -69
  197. package/src/mcp-apps/McpAppsRemoteHost.concurrent.test.tsx +215 -0
  198. package/src/mcp-apps/McpAppsRemoteHost.ts +28 -12
  199. package/src/mcp-apps/app-frame.test.tsx +349 -0
  200. package/src/mcp-apps/app-frame.tsx +68 -9
  201. package/src/mcp-apps/bridge.ts +7 -2
  202. package/src/mcp-apps/index.ts +6 -1
  203. package/src/model-context/frame/AssistantFrame.test.ts +3 -3
  204. package/src/model-context/frame/SPEC_AssistantFrame.md +1 -1
  205. package/src/model-context/frame/useAssistantFrameHost.ts +2 -2
  206. package/src/model-context/makeAssistantVisible.tsx +1 -1
  207. package/src/primitives/actionBar/ActionBarCopy.tsx +1 -1
  208. package/src/primitives/actionBar/ActionBarExportMarkdown.tsx +1 -1
  209. package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +1 -1
  210. package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +1 -1
  211. package/src/primitives/actionBar/ActionBarStopSpeaking.tsx +1 -1
  212. package/src/primitives/actionBarMore/scope.ts +2 -2
  213. package/src/primitives/assistantModal/AssistantModalContent.tsx +1 -1
  214. package/src/primitives/assistantModal/scope.ts +2 -2
  215. package/src/primitives/composer/ComposerAttachmentDropzone.tsx +1 -1
  216. package/src/primitives/composer/ComposerInput.test.tsx +2 -1
  217. package/src/primitives/composer/ComposerInput.tsx +3 -3
  218. package/src/primitives/composer/ComposerInputPluginContext.tsx +0 -10
  219. package/src/primitives/composer/ComposerQuote.tsx +1 -1
  220. package/src/primitives/composer/ComposerRoot.tsx +1 -1
  221. package/src/primitives/composer/trigger/TriggerPopover.tsx +16 -1
  222. package/src/primitives/composer/trigger/TriggerPopoverAction.tsx +4 -2
  223. package/src/primitives/composer/trigger/TriggerPopoverBack.tsx +1 -1
  224. package/src/primitives/composer/trigger/TriggerPopoverBehavior.test.tsx +109 -0
  225. package/src/primitives/composer/trigger/TriggerPopoverCategories.tsx +1 -1
  226. package/src/primitives/composer/trigger/TriggerPopoverDirective.tsx +4 -2
  227. package/src/primitives/composer/trigger/TriggerPopoverItems.tsx +1 -1
  228. package/src/primitives/composer/trigger/TriggerPopoverResource.ts +4 -1
  229. package/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx +2 -0
  230. package/src/primitives/composer/trigger/detectTrigger.test.ts +88 -5
  231. package/src/primitives/composer/trigger/detectTrigger.ts +50 -9
  232. package/src/primitives/composer/trigger/index.ts +1 -0
  233. package/src/primitives/composer/trigger/matchesTriggerItemQuery.test.ts +52 -0
  234. package/src/primitives/composer/trigger/matchesTriggerItemQuery.ts +13 -0
  235. package/src/primitives/composer/trigger/triggerDetectionResource.ts +10 -7
  236. package/src/primitives/composer/trigger/triggerNavigationResource.ts +3 -10
  237. package/src/primitives/composer/trigger/triggerSelectionResource.test.ts +15 -3
  238. package/src/primitives/composer/trigger/triggerSelectionResource.ts +1 -4
  239. package/src/primitives/composer.ts +1 -0
  240. package/src/primitives/message/MessageRoot.tsx +1 -1
  241. package/src/primitives/selectionToolbar/SelectionToolbarQuote.tsx +1 -1
  242. package/src/primitives/selectionToolbar/SelectionToolbarRoot.tsx +1 -1
  243. package/src/primitives/thread/ThreadViewport.tsx +1 -1
  244. package/src/primitives/thread/ThreadViewportFooter.tsx +1 -1
  245. package/src/primitives/thread/useThreadViewportAutoScroll.ts +8 -7
  246. package/src/primitives/threadList/ThreadListNew.tsx +1 -1
  247. package/src/primitives/threadListFocusGroup.ts +2 -2
  248. package/src/primitives/threadListItem/ThreadListItemRoot.tsx +1 -1
  249. package/src/primitives/threadListItem/ThreadListItemTrigger.tsx +1 -1
  250. package/src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx +1 -1
  251. package/src/primitives/threadListItemMore/ThreadListItemMoreRoot.tsx +1 -1
  252. package/src/primitives/threadListItemMore/ThreadListItemMoreTrigger.tsx +2 -2
  253. package/src/primitives/threadListItemMore/scope.ts +2 -2
  254. package/src/sandbox-host/SandboxHost.test.tsx +165 -3
  255. package/src/sandbox-host/SandboxHost.tsx +42 -9
  256. package/src/tests/RemoteThreadListRuntime.adapterProvider.test.tsx +31 -1
  257. package/src/unstable/useComposerInputHistory.test.tsx +2 -1
  258. package/src/unstable/useLiveCompletionAdapter.test.tsx +60 -1
  259. package/src/unstable/useLiveCompletionAdapter.ts +4 -1
  260. package/src/unstable/useMentionAdapter.test.tsx +337 -0
  261. package/src/unstable/useMentionAdapter.ts +94 -57
  262. package/src/unstable/useModelContextSnapshot.test.tsx +132 -0
  263. package/src/unstable/useModelContextSnapshot.ts +67 -0
  264. package/src/unstable/useSlashCommandAdapter.test.tsx +141 -0
  265. package/src/unstable/useSlashCommandAdapter.ts +47 -19
  266. package/src/unstable/webmcp/WebMcpRegistrationResource.ts +92 -0
  267. package/src/unstable/webmcp/__tests__/webmcp.fake.tsx +168 -0
  268. package/src/unstable/webmcp/convertTools.test.ts +393 -0
  269. package/src/unstable/webmcp/convertTools.ts +180 -0
  270. package/src/unstable/webmcp/useWebMcpProvider.test.tsx +466 -0
  271. package/src/unstable/webmcp/useWebMcpProvider.ts +150 -0
  272. package/src/unstable/webmcp/webmcp-host.test.ts +142 -0
  273. package/src/unstable/webmcp/webmcp-host.ts +83 -0
  274. package/src/utils/Primitive.tsx +2 -2
  275. package/src/utils/createActionButton.tsx +1 -1
  276. package/src/utils/hooks/useOnResizeContent.ts +1 -1
  277. package/src/utils/hooks/useOnScrollToBottom.ts +1 -1
  278. package/src/utils/smooth/useSmooth.ts +1 -1
  279. package/dist/legacy-runtime/runtime/MessagePartRuntime.d.ts +0 -3
  280. package/dist/legacy-runtime/runtime/MessagePartRuntime.js +0 -2
  281. package/dist/legacy-runtime/runtime/MessageRuntime.d.ts +0 -3
  282. package/dist/legacy-runtime/runtime/MessageRuntime.js +0 -2
  283. package/dist/legacy-runtime/runtime/ThreadListRuntime.d.ts +0 -3
  284. package/dist/legacy-runtime/runtime/ThreadListRuntime.js +0 -2
  285. package/dist/utils/invokeCallbackSafely.d.ts +0 -5
  286. package/dist/utils/invokeCallbackSafely.d.ts.map +0 -1
  287. package/dist/utils/invokeCallbackSafely.js +0 -15
  288. package/dist/utils/invokeCallbackSafely.js.map +0 -1
  289. package/dist/utils/useToolArgsFieldStatus.d.ts +0 -15
  290. package/dist/utils/useToolArgsFieldStatus.d.ts.map +0 -1
  291. package/dist/utils/useToolArgsFieldStatus.js +0 -23
  292. package/dist/utils/useToolArgsFieldStatus.js.map +0 -1
  293. package/src/legacy-runtime/runtime/MessagePartRuntime.ts +0 -2
  294. package/src/legacy-runtime/runtime/MessageRuntime.ts +0 -3
  295. package/src/legacy-runtime/runtime/ThreadListRuntime.ts +0 -4
  296. package/src/utils/invokeCallbackSafely.ts +0 -11
  297. package/src/utils/useToolArgsFieldStatus.ts +0 -18
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadViewport.js","names":["c","_c","useComposedRefs","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","useCallback","useLayoutEffect","useMemo","useAuiState","useManagedRef","useThreadViewportAutoScroll","ThreadPrimitiveViewportProvider","useSizeHandle","useThreadViewport","useThreadViewportStore","useTopAnchorReserve","getActiveTopAnchorAnchorId","getActiveTopAnchorTargetId","isTopAnchorTurnValid","ThreadPrimitiveViewport","Element","div","Props","autoScroll","turnAnchor","topAnchorMessageClamp","tallerThan","visibleHeight","scrollToBottomOnRunStart","scrollToBottomOnInitialize","scrollToBottomOnThreadSwitch","useViewportSizeRef","register","_temp","getHeight","_temp2","useViewportElementRef","registerViewportElement","_temp3","useTopAnchorTurn","enabled","$","threadViewportStore","t0","s","thread","activeAnchorId","t1","s_0","activeTargetId","topAnchorTurn","_temp4","t2","bb0","t3","anchorId","targetId","activeTurn","s_2","messages","topAnchorTurnIsValid","t4","t5","getState","setTopAnchorTurn","t6","t7","state","current","ThreadPrimitiveViewportScrollable","forwardedRef","children","rest","autoScrollRef","viewportSizeRef","viewportElementRef","topAnchorEnabled","ref","displayName","props","registerViewport","el","clientHeight","s_1"],"sources":["../../../src/primitives/thread/ThreadViewport.tsx"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n useCallback,\n useLayoutEffect,\n useMemo,\n} from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { useThreadViewportAutoScroll } from \"./useThreadViewportAutoScroll\";\nimport { ThreadPrimitiveViewportProvider } from \"../../context/providers/ThreadViewportProvider\";\nimport { useSizeHandle } from \"../../utils/hooks/useSizeHandle\";\nimport {\n useThreadViewport,\n useThreadViewportStore,\n} from \"../../context/react/ThreadViewportContext\";\nimport { useTopAnchorReserve } from \"./topAnchor/useTopAnchorReserve\";\nimport {\n getActiveTopAnchorAnchorId,\n getActiveTopAnchorTargetId,\n isTopAnchorTurnValid,\n} from \"./topAnchor/topAnchorTurn\";\n\nexport namespace ThreadPrimitiveViewport {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n /**\n * Whether to automatically scroll to the bottom when new messages are added.\n * When enabled, the viewport will automatically scroll to show the latest content.\n *\n * Default false if `turnAnchor` is \"top\", otherwise defaults to true.\n */\n autoScroll?: boolean | undefined;\n\n /**\n * Controls scroll anchoring behavior for new messages.\n * - \"bottom\" (default): Messages anchor at the bottom, classic chat behavior.\n * - \"top\": New user messages anchor at the top of the viewport for a focused reading experience.\n */\n turnAnchor?: \"top\" | \"bottom\" | undefined;\n\n /**\n * Clamps tall user messages so the assistant response stays in view.\n *\n * @default { tallerThan: \"10em\", visibleHeight: \"6em\" }\n */\n topAnchorMessageClamp?: {\n /**\n * Clamp messages taller than this. Supports `px`, `em`, and `rem`.\n *\n * @default \"10em\"\n */\n tallerThan?: string;\n /**\n * Visible portion of clamped messages. Supports `px`, `em`, and `rem`.\n *\n * @default \"6em\"\n */\n visibleHeight?: string;\n };\n\n /**\n * Whether to scroll to bottom when a new run starts.\n *\n * Defaults to true.\n */\n scrollToBottomOnRunStart?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when thread history is first loaded.\n *\n * Defaults to true.\n */\n scrollToBottomOnInitialize?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when switching to a different thread.\n *\n * Defaults to true.\n */\n scrollToBottomOnThreadSwitch?: boolean | undefined;\n };\n}\n\nconst useViewportSizeRef = () => {\n const register = useThreadViewport((s) => s.registerViewport);\n const getHeight = useCallback((el: HTMLElement) => el.clientHeight, []);\n return useSizeHandle(register, getHeight);\n};\n\nconst useViewportElementRef = () => {\n const registerViewportElement = useThreadViewport(\n (s) => s.registerViewportElement,\n );\n\n return useManagedRef(registerViewportElement);\n};\n\nconst useTopAnchorTurn = (enabled: boolean) => {\n const threadViewportStore = useThreadViewportStore();\n const activeAnchorId = useAuiState((s) => {\n if (!enabled) return undefined;\n return getActiveTopAnchorAnchorId(s.thread);\n });\n const activeTargetId = useAuiState((s) => {\n if (!enabled) return undefined;\n return getActiveTopAnchorTargetId(s.thread);\n });\n const topAnchorTurn = useThreadViewport((s) => s.topAnchorTurn);\n const activeTurn = useMemo(() => {\n if (!activeAnchorId || !activeTargetId) return null;\n return { anchorId: activeAnchorId, targetId: activeTargetId };\n }, [activeAnchorId, activeTargetId]);\n\n const topAnchorTurnIsValid = useAuiState(\n (s) =>\n enabled &&\n !!topAnchorTurn &&\n isTopAnchorTurnValid(topAnchorTurn, s.thread.messages),\n );\n\n useLayoutEffect(() => {\n if (!topAnchorTurn || topAnchorTurnIsValid) return;\n\n threadViewportStore.getState().setTopAnchorTurn(null);\n }, [threadViewportStore, topAnchorTurn, topAnchorTurnIsValid]);\n\n useLayoutEffect(() => {\n if (!activeTurn) return;\n\n const state = threadViewportStore.getState();\n const current = state.topAnchorTurn;\n if (\n current?.anchorId === activeTurn.anchorId &&\n current.targetId === activeTurn.targetId\n ) {\n return;\n }\n\n state.setTopAnchorTurn(activeTurn);\n }, [activeTurn, threadViewportStore]);\n};\n\nconst ThreadPrimitiveViewportScrollable = forwardRef<\n ThreadPrimitiveViewport.Element,\n ThreadPrimitiveViewport.Props\n>(\n (\n {\n autoScroll,\n scrollToBottomOnRunStart,\n scrollToBottomOnInitialize,\n scrollToBottomOnThreadSwitch,\n children,\n ...rest\n },\n forwardedRef,\n ) => {\n const autoScrollRef = useThreadViewportAutoScroll<HTMLDivElement>({\n autoScroll,\n scrollToBottomOnRunStart,\n scrollToBottomOnInitialize,\n scrollToBottomOnThreadSwitch,\n });\n const viewportSizeRef = useViewportSizeRef();\n const viewportElementRef = useViewportElementRef();\n const threadViewportStore = useThreadViewportStore();\n const turnAnchor = threadViewportStore.getState().turnAnchor;\n const topAnchorEnabled = turnAnchor === \"top\";\n useTopAnchorTurn(topAnchorEnabled);\n useTopAnchorReserve(topAnchorEnabled);\n const ref = useComposedRefs(\n forwardedRef,\n autoScrollRef,\n viewportSizeRef,\n viewportElementRef,\n );\n\n return (\n <Primitive.div {...rest} ref={ref}>\n {children}\n </Primitive.div>\n );\n },\n);\n\nThreadPrimitiveViewportScrollable.displayName =\n \"ThreadPrimitive.ViewportScrollable\";\n\n/**\n * A scrollable viewport container for thread messages.\n *\n * This component provides a scrollable area for displaying thread messages with\n * automatic scrolling capabilities. It manages the viewport state and provides\n * context for child components to access viewport-related functionality.\n *\n * @example\n * ```tsx\n * <ThreadPrimitive.Viewport turnAnchor=\"top\">\n * <ThreadPrimitive.Messages>\n * {() => <MyMessage />}\n * </ThreadPrimitive.Messages>\n * </ThreadPrimitive.Viewport>\n * ```\n */\nexport const ThreadPrimitiveViewport = forwardRef<\n ThreadPrimitiveViewport.Element,\n ThreadPrimitiveViewport.Props\n>(({ turnAnchor, topAnchorMessageClamp, ...props }, ref) => {\n return (\n <ThreadPrimitiveViewportProvider\n options={{ turnAnchor, topAnchorMessageClamp }}\n >\n <ThreadPrimitiveViewportScrollable {...props} ref={ref} />\n </ThreadPrimitiveViewportProvider>\n );\n});\n\nThreadPrimitiveViewport.displayName = \"ThreadPrimitive.Viewport\";\n"],"mappings":";;;;;;;;;;;;;;;AAyFA,MAAMiC,2BAAqB;CACzB,MAAAC,WAAiBnB,kBAAkBoB,KAAyB;CACY,OACjErB,cAAcoB,UAAUE,MAAS;AAAC;AAG3C,MAAME,8BAAwB;CAC5B,MAAAC,0BAAgCxB,kBAC9ByB,MACF;CAAE,OAEK7B,cAAc4B,uBAAuB;AAAC;AAG/C,MAAME,oBAAmBC,YAAA;CAAA,MAAAC,IAAA1C,EAAA,EAAA;CACvB,MAAA2C,sBAA4B5B,uBAAuB;CAAE,IAAA6B;CAA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AAAiB;AADnC,SAAA7C,OAAA8C,IAAA;CAAA,OAE0BA,GAAEC;AAAa;AAItC,SAAA5C,OAAAM,GAAA;CAAA,OAEnBA,EAACP;AAAwB;AAMX,SAAAc,OAAAgC,KAAA;CAAA,OAUwBvC,IAACM;AAAc"}
1
+ {"version":3,"file":"ThreadViewport.js","names":["c","_c","useComposedRefs","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","useCallback","useLayoutEffect","useMemo","useAuiState","useManagedRef","useThreadViewportAutoScroll","ThreadPrimitiveViewportProvider","useSizeHandle","useThreadViewport","useThreadViewportStore","useTopAnchorReserve","getActiveTopAnchorAnchorId","getActiveTopAnchorTargetId","isTopAnchorTurnValid","ThreadPrimitiveViewport","Element","div","Props","autoScroll","turnAnchor","topAnchorMessageClamp","tallerThan","visibleHeight","scrollToBottomOnRunStart","scrollToBottomOnInitialize","scrollToBottomOnThreadSwitch","useViewportSizeRef","register","_temp","getHeight","_temp2","useViewportElementRef","registerViewportElement","_temp3","useTopAnchorTurn","enabled","$","threadViewportStore","t0","s","thread","activeAnchorId","t1","s_0","activeTargetId","topAnchorTurn","_temp4","t2","bb0","t3","anchorId","targetId","activeTurn","s_2","messages","topAnchorTurnIsValid","t4","t5","getState","setTopAnchorTurn","t6","t7","state","current","ThreadPrimitiveViewportScrollable","forwardedRef","children","rest","autoScrollRef","viewportSizeRef","viewportElementRef","topAnchorEnabled","ref","displayName","props","registerViewport","el","clientHeight","s_1"],"sources":["../../../src/primitives/thread/ThreadViewport.tsx"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n useCallback,\n useLayoutEffect,\n useMemo,\n} from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { useThreadViewportAutoScroll } from \"./useThreadViewportAutoScroll\";\nimport { ThreadPrimitiveViewportProvider } from \"../../context/providers/ThreadViewportProvider\";\nimport { useSizeHandle } from \"../../utils/hooks/useSizeHandle\";\nimport {\n useThreadViewport,\n useThreadViewportStore,\n} from \"../../context/react/ThreadViewportContext\";\nimport { useTopAnchorReserve } from \"./topAnchor/useTopAnchorReserve\";\nimport {\n getActiveTopAnchorAnchorId,\n getActiveTopAnchorTargetId,\n isTopAnchorTurnValid,\n} from \"./topAnchor/topAnchorTurn\";\n\nexport namespace ThreadPrimitiveViewport {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n /**\n * Whether to automatically scroll to the bottom when new messages are added.\n * When enabled, the viewport will automatically scroll to show the latest content.\n *\n * Default false if `turnAnchor` is \"top\", otherwise defaults to true.\n */\n autoScroll?: boolean | undefined;\n\n /**\n * Controls scroll anchoring behavior for new messages.\n * - \"bottom\" (default): Messages anchor at the bottom, classic chat behavior.\n * - \"top\": New user messages anchor at the top of the viewport for a focused reading experience.\n */\n turnAnchor?: \"top\" | \"bottom\" | undefined;\n\n /**\n * Clamps tall user messages so the assistant response stays in view.\n *\n * @default { tallerThan: \"10em\", visibleHeight: \"6em\" }\n */\n topAnchorMessageClamp?: {\n /**\n * Clamp messages taller than this. Supports `px`, `em`, and `rem`.\n *\n * @default \"10em\"\n */\n tallerThan?: string;\n /**\n * Visible portion of clamped messages. Supports `px`, `em`, and `rem`.\n *\n * @default \"6em\"\n */\n visibleHeight?: string;\n };\n\n /**\n * Whether to scroll to bottom when a new run starts.\n *\n * Defaults to true.\n */\n scrollToBottomOnRunStart?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when thread history is first loaded.\n *\n * Defaults to true.\n */\n scrollToBottomOnInitialize?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when switching to a different thread.\n *\n * Defaults to true.\n */\n scrollToBottomOnThreadSwitch?: boolean | undefined;\n };\n}\n\nconst useViewportSizeRef = () => {\n const register = useThreadViewport((s) => s.registerViewport);\n const getHeight = useCallback((el: HTMLElement) => el.clientHeight, []);\n return useSizeHandle(register, getHeight);\n};\n\nconst useViewportElementRef = () => {\n const registerViewportElement = useThreadViewport(\n (s) => s.registerViewportElement,\n );\n\n return useManagedRef(registerViewportElement);\n};\n\nconst useTopAnchorTurn = (enabled: boolean) => {\n const threadViewportStore = useThreadViewportStore();\n const activeAnchorId = useAuiState((s) => {\n if (!enabled) return undefined;\n return getActiveTopAnchorAnchorId(s.thread);\n });\n const activeTargetId = useAuiState((s) => {\n if (!enabled) return undefined;\n return getActiveTopAnchorTargetId(s.thread);\n });\n const topAnchorTurn = useThreadViewport((s) => s.topAnchorTurn);\n const activeTurn = useMemo(() => {\n if (!activeAnchorId || !activeTargetId) return null;\n return { anchorId: activeAnchorId, targetId: activeTargetId };\n }, [activeAnchorId, activeTargetId]);\n\n const topAnchorTurnIsValid = useAuiState(\n (s) =>\n enabled &&\n !!topAnchorTurn &&\n isTopAnchorTurnValid(topAnchorTurn, s.thread.messages),\n );\n\n useLayoutEffect(() => {\n if (!topAnchorTurn || topAnchorTurnIsValid) return;\n\n threadViewportStore.getState().setTopAnchorTurn(null);\n }, [threadViewportStore, topAnchorTurn, topAnchorTurnIsValid]);\n\n useLayoutEffect(() => {\n if (!activeTurn) return;\n\n const state = threadViewportStore.getState();\n const current = state.topAnchorTurn;\n if (\n current?.anchorId === activeTurn.anchorId &&\n current.targetId === activeTurn.targetId\n ) {\n return;\n }\n\n state.setTopAnchorTurn(activeTurn);\n }, [activeTurn, threadViewportStore]);\n};\n\nconst ThreadPrimitiveViewportScrollable = forwardRef<\n ThreadPrimitiveViewport.Element,\n ThreadPrimitiveViewport.Props\n>(\n (\n {\n autoScroll,\n scrollToBottomOnRunStart,\n scrollToBottomOnInitialize,\n scrollToBottomOnThreadSwitch,\n children,\n ...rest\n },\n forwardedRef,\n ) => {\n const autoScrollRef = useThreadViewportAutoScroll<HTMLDivElement>({\n autoScroll,\n scrollToBottomOnRunStart,\n scrollToBottomOnInitialize,\n scrollToBottomOnThreadSwitch,\n });\n const viewportSizeRef = useViewportSizeRef();\n const viewportElementRef = useViewportElementRef();\n const threadViewportStore = useThreadViewportStore();\n const turnAnchor = threadViewportStore.getState().turnAnchor;\n const topAnchorEnabled = turnAnchor === \"top\";\n useTopAnchorTurn(topAnchorEnabled);\n useTopAnchorReserve(topAnchorEnabled);\n const ref = useComposedRefs(\n forwardedRef,\n autoScrollRef,\n viewportSizeRef,\n viewportElementRef,\n );\n\n return (\n <Primitive.div {...rest} ref={ref}>\n {children}\n </Primitive.div>\n );\n },\n);\n\nThreadPrimitiveViewportScrollable.displayName =\n \"ThreadPrimitive.ViewportScrollable\";\n\n/**\n * A scrollable viewport container for thread messages.\n *\n * This component provides a scrollable area for displaying thread messages with\n * automatic scrolling capabilities. It manages the viewport state and provides\n * context for child components to access viewport-related functionality.\n *\n * @example\n * ```tsx\n * <ThreadPrimitive.Viewport turnAnchor=\"top\">\n * <ThreadPrimitive.Messages>\n * {() => <MyMessage />}\n * </ThreadPrimitive.Messages>\n * </ThreadPrimitive.Viewport>\n * ```\n */\nexport const ThreadPrimitiveViewport = forwardRef<\n ThreadPrimitiveViewport.Element,\n ThreadPrimitiveViewport.Props\n>(({ turnAnchor, topAnchorMessageClamp, ...props }, ref) => {\n return (\n <ThreadPrimitiveViewportProvider\n options={{ turnAnchor, topAnchorMessageClamp }}\n >\n <ThreadPrimitiveViewportScrollable {...props} ref={ref} />\n </ThreadPrimitiveViewportProvider>\n );\n});\n\nThreadPrimitiveViewport.displayName = \"ThreadPrimitive.Viewport\";\n"],"mappings":";;;;;;;;;;;;;;;AAyFA,MAAMiC,2BAAqB;CACzB,MAAAC,WAAiBnB,kBAAkBoB,KAAyB;CACY,OACjErB,cAAcoB,UAAUE,MAAS;AAAC;AAG3C,MAAME,8BAAwB;CAC5B,MAAAC,0BAAgCxB,kBAC9ByB,MACF;CAAE,OAEK7B,cAAc4B,uBAAuB;AAAC;AAG/C,MAAME,oBAAmBC,Y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CAAA,OAJlCa;AAIkC,CAErC;AAEDnC,wBAAwB2D,cAAc;AAtIX,SAAA7C,MAAAW,GAAA;CAAA,OACiBA,EAACoC;AAAiB;AADnC,SAAA7C,OAAA8C,IAAA;CAAA,OAE0BA,GAAEC;AAAa;AAItC,SAAA5C,OAAAM,GAAA;CAAA,OAEnBA,EAACP;AAAwB;AAMX,SAAAc,OAAAgC,KAAA;CAAA,OAUwBvC,IAACM;AAAc"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { useThreadViewport } from "../../context/react/ThreadViewportContext.js";
3
- import { Primitive } from "../../utils/Primitive.js";
3
+ import { Primitive as Primitive$1 } from "../../utils/Primitive.js";
4
4
  import { useSizeHandle } from "../../utils/hooks/useSizeHandle.js";
5
5
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
6
6
  import { forwardRef } from "@assistant-ui/tap/react-shim";
7
7
  import { jsx } from "react/jsx-runtime";
8
- import { useComposedRefs } from "@radix-ui/react-compose-refs";
8
+ import { useComposedRefs } from "radix-ui/internal";
9
9
  //#region src/primitives/thread/ThreadViewportFooter.tsx
10
10
  /**
11
11
  * A footer container that measures its height for scroll calculations.
@@ -38,7 +38,7 @@ const ThreadPrimitiveViewportFooter = forwardRef((props, forwardedRef) => {
38
38
  const ref = useComposedRefs(forwardedRef, resizeRef);
39
39
  let t0;
40
40
  if ($[0] !== props || $[1] !== ref) {
41
- t0 = /* @__PURE__ */ jsx(Primitive.div, {
41
+ t0 = /* @__PURE__ */ jsx(Primitive$1.div, {
42
42
  ...props,
43
43
  ref
44
44
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadViewportFooter.js","names":["c","_c","useComposedRefs","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","useCallback","useSizeHandle","useThreadViewport","ThreadPrimitiveViewportFooter","Element","div","Props","props","forwardedRef","$","register","_temp","getHeight","_temp2","resizeRef","ref","t0","displayName","s","registerContentInset","el","marginTop","parseFloat","getComputedStyle","offsetHeight"],"sources":["../../../src/primitives/thread/ThreadViewportFooter.tsx"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n useCallback,\n} from \"react\";\nimport { useSizeHandle } from \"../../utils/hooks/useSizeHandle\";\nimport { useThreadViewport } from \"../../context/react/ThreadViewportContext\";\n\nexport namespace ThreadPrimitiveViewportFooter {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\n/**\n * A footer container that measures its height for scroll calculations.\n *\n * This component measures its height and provides it to the viewport context\n * so the auto-scroll system can account for any sticky footer overlapping the\n * message list.\n *\n * Multiple ViewportFooter components can be used - their heights are summed.\n *\n * Typically used with `className=\"sticky bottom-0\"` to keep the footer\n * visible at the bottom of the viewport while scrolling.\n *\n * @example\n * ```tsx\n * <ThreadPrimitive.Viewport>\n * <ThreadPrimitive.Messages>\n * {() => <MyMessage />}\n * </ThreadPrimitive.Messages>\n * <ThreadPrimitive.ViewportFooter className=\"sticky bottom-0\">\n * <Composer />\n * </ThreadPrimitive.ViewportFooter>\n * </ThreadPrimitive.Viewport>\n * ```\n */\nexport const ThreadPrimitiveViewportFooter = forwardRef<\n ThreadPrimitiveViewportFooter.Element,\n ThreadPrimitiveViewportFooter.Props\n>((props, forwardedRef) => {\n const register = useThreadViewport((s) => s.registerContentInset);\n const getHeight = useCallback((el: HTMLElement) => {\n const marginTop = parseFloat(getComputedStyle(el).marginTop) || 0;\n return el.offsetHeight + marginTop;\n }, []);\n\n const resizeRef = useSizeHandle(register, getHeight);\n\n const ref = useComposedRefs(forwardedRef, resizeRef);\n\n return <Primitive.div {...props} ref={ref} />;\n});\n\nThreadPrimitiveViewportFooter.displayName = \"ThreadPrimitive.ViewportFooter\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAaU,gCAAgCL,YAG3CS,OAAAC,iBAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CACA,MAAAgB,WAAiBR,kBAAkBS,KAA6B;CAMhE,MAAAG,YAAkBb,cAAcS,UAAUE,MAAS;CAEnD,MAAAG,MAAYpB,gBAAgBa,cAAcM,SAAS;CAAE,IAAAE;CAAA,IAAAP,EAAA,OAAAF,SAAAE,EAAA,OAAAM,KAAA;EAE9CC,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBT;GAAYQ;EAAG,CAAA;EAAIN,EAAA,KAAAF;EAAAE,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAAtCO;AAAsC,CAC9C;AAEDb,8BAA8Bc,cAAc;AAd1C,SAAAN,MAAAO,GAAA;CAAA,OAC0CA,EAACC;AAAqB;AADhE,SAAAN,OAAAO,IAAA;CAGE,MAAAC,YAAkBC,WAAWC,iBAAiBH,EAAE,CAAC,CAAAC,SAAe,KAA9C;CAAgD,OAC3DD,GAAEI,eAAgBH;AAAS"}
1
+ {"version":3,"file":"ThreadViewportFooter.js","names":["c","_c","useComposedRefs","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","useCallback","useSizeHandle","useThreadViewport","ThreadPrimitiveViewportFooter","Element","div","Props","props","forwardedRef","$","register","_temp","getHeight","_temp2","resizeRef","ref","t0","displayName","s","registerContentInset","el","marginTop","parseFloat","getComputedStyle","offsetHeight"],"sources":["../../../src/primitives/thread/ThreadViewportFooter.tsx"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n useCallback,\n} from \"react\";\nimport { useSizeHandle } from \"../../utils/hooks/useSizeHandle\";\nimport { useThreadViewport } from \"../../context/react/ThreadViewportContext\";\n\nexport namespace ThreadPrimitiveViewportFooter {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\n/**\n * A footer container that measures its height for scroll calculations.\n *\n * This component measures its height and provides it to the viewport context\n * so the auto-scroll system can account for any sticky footer overlapping the\n * message list.\n *\n * Multiple ViewportFooter components can be used - their heights are summed.\n *\n * Typically used with `className=\"sticky bottom-0\"` to keep the footer\n * visible at the bottom of the viewport while scrolling.\n *\n * @example\n * ```tsx\n * <ThreadPrimitive.Viewport>\n * <ThreadPrimitive.Messages>\n * {() => <MyMessage />}\n * </ThreadPrimitive.Messages>\n * <ThreadPrimitive.ViewportFooter className=\"sticky bottom-0\">\n * <Composer />\n * </ThreadPrimitive.ViewportFooter>\n * </ThreadPrimitive.Viewport>\n * ```\n */\nexport const ThreadPrimitiveViewportFooter = forwardRef<\n ThreadPrimitiveViewportFooter.Element,\n ThreadPrimitiveViewportFooter.Props\n>((props, forwardedRef) => {\n const register = useThreadViewport((s) => s.registerContentInset);\n const getHeight = useCallback((el: HTMLElement) => {\n const marginTop = parseFloat(getComputedStyle(el).marginTop) || 0;\n return el.offsetHeight + marginTop;\n }, []);\n\n const resizeRef = useSizeHandle(register, getHeight);\n\n const ref = useComposedRefs(forwardedRef, resizeRef);\n\n return <Primitive.div {...props} ref={ref} />;\n});\n\nThreadPrimitiveViewportFooter.displayName = \"ThreadPrimitive.ViewportFooter\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAaU,gCAAgCL,YAG3CS,OAAAC,iBAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CACA,MAAAgB,WAAiBR,kBAAkBS,KAA6B;CAMhE,MAAAG,YAAkBb,cAAcS,UAAUE,MAAS;CAEnD,MAAAG,MAAYpB,gBAAgBa,cAAcM,SAAS;CAAE,IAAAE;CAAA,IAAAP,EAAA,OAAAF,SAAAE,EAAA,OAAAM,KAAA;EAE9CC,KAAA,oBAAA,YAAA,KAAA;GAAA,GAAmBT;GAAYQ;EAAG,CAAA;EAAIN,EAAA,KAAAF;EAAAE,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAAtCO;AAAsC,CAC9C;AAEDb,8BAA8Bc,cAAc;AAd1C,SAAAN,MAAAO,GAAA;CAAA,OAC0CA,EAACC;AAAqB;AADhE,SAAAN,OAAAO,IAAA;CAGE,MAAAC,YAAkBC,WAAWC,iBAAiBH,EAAE,CAAC,CAAAC,SAAe,KAA9C;CAAgD,OAC3DD,GAAEI,eAAgBH;AAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"useThreadViewportAutoScroll.d.ts","names":[],"sources":["../../../src/primitives/thread/useThreadViewportAutoScroll.ts"],"mappings":";;kBAYiB;OACH;;;;;;;IAOV;;;;;;IAOA;;;;;;IAOA;;;;;;IAOA;;;cAIS,8BAA+B,iBAAiB,eAAa,YAAA,0BAAA,4BAAA,gCAKvE,4BAA4B,YAAU,YAAY"}
1
+ {"version":3,"file":"useThreadViewportAutoScroll.d.ts","names":[],"sources":["../../../src/primitives/thread/useThreadViewportAutoScroll.ts"],"mappings":";;kBAgBiB;OACH;;;;;;;IAOV;;;;;;IAOA;;;;;;IAOA;;;;;;IAOA;;;cAIS,8BAA+B,iBAAiB,eAAa,YAAA,0BAAA,4BAAA,gCAKvE,4BAA4B,YAAU,YAAY"}
@@ -6,8 +6,8 @@ import { useManagedRef } from "../../utils/hooks/useManagedRef.js";
6
6
  import { useOnResizeContent } from "../../utils/hooks/useOnResizeContent.js";
7
7
  import { useAuiEvent, useAuiState } from "@assistant-ui/store";
8
8
  import { useCallback, useLayoutEffect, useRef } from "@assistant-ui/tap/react-shim";
9
- import { useComposedRefs } from "@radix-ui/react-compose-refs";
10
- import { isUserScrollUp } from "@assistant-ui/store/client";
9
+ import { useComposedRefs } from "radix-ui/internal";
10
+ import { isUserScrollUp, isViewportAtBottom, viewportOverflows } from "@assistant-ui/store/client";
11
11
  //#region src/primitives/thread/useThreadViewportAutoScroll.ts
12
12
  const useThreadViewportAutoScroll = ({ autoScroll, scrollToBottomOnRunStart = true, scrollToBottomOnInitialize = true, scrollToBottomOnThreadSwitch = true }) => {
13
13
  const divRef = useRef(null);
@@ -55,14 +55,14 @@ const useThreadViewportAutoScroll = ({ autoScroll, scrollToBottomOnRunStart = tr
55
55
  const div_0 = divRef.current;
56
56
  if (!div_0) return;
57
57
  const isAtBottom = threadViewportStore.getState().isAtBottom;
58
- const newIsAtBottom = Math.abs(div_0.scrollHeight - div_0.scrollTop - div_0.clientHeight) <= 1 || div_0.scrollHeight <= div_0.clientHeight;
58
+ const newIsAtBottom = isViewportAtBottom(div_0);
59
59
  if (!newIsAtBottom && lastScrollTop.current < div_0.scrollTop) {} else {
60
60
  const userScrolledUp = isUserScrollUp({
61
61
  scrollTop: lastScrollTop.current,
62
62
  scrollHeight: lastScrollHeight.current
63
63
  }, div_0);
64
64
  if (newIsAtBottom) {
65
- if (div_0.scrollHeight > div_0.clientHeight + 1) scrollingToBottomBehaviorRef.current = null;
65
+ if (viewportOverflows(div_0)) scrollingToBottomBehaviorRef.current = null;
66
66
  if (autoScroll) followBottomRef.current = true;
67
67
  } else if (userScrolledUp) {
68
68
  cancelScheduledFrame();
@@ -1 +1 @@
1
- {"version":3,"file":"useThreadViewportAutoScroll.js","names":["useComposedRefs","useCallback","useLayoutEffect","useRef","RefCallback","useAuiEvent","useAuiState","isUserScrollUp","useOnResizeContent","useOnScrollToBottom","useManagedRef","writableStore","useThreadViewportStore","useThreadViewportAutoScroll","Options","autoScroll","scrollToBottomOnRunStart","scrollToBottomOnInitialize","scrollToBottomOnThreadSwitch","HTMLElement","TElement","divRef","hasMessages","s","thread","messages","length","isRunning","initializeScrollRequestedRef","scheduledFrameRef","threadViewportStore","undefined","getState","turnAnchor","lastScrollTop","lastScrollHeight","lastObservedScrollHeight","lastObservedClientHeight","scrollingToBottomBehaviorRef","ScrollBehavior","followBottomRef","scrollToBottom","behavior","div","current","scrollTo","top","scrollHeight","cancelScheduledFrame","cancelAnimationFrame","scheduleScrollToBottom","requestAnimationFrame","hasActiveTopAnchor","state","element","viewport","anchor","handleScroll","isAtBottom","newIsAtBottom","Math","abs","scrollTop","clientHeight","isInFlightDownwardScroll","userScrolledUp","viewportOverflows","shouldUpdate","setState","resizeRef","scrollBehavior","scrollRef","el","cancelPendingScrollToBottom","addEventListener","removeEventListener","autoScrollRef"],"sources":["../../../src/primitives/thread/useThreadViewportAutoScroll.ts"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallback, useLayoutEffect, useRef, type RefCallback } from \"react\";\nimport { useAuiEvent, useAuiState } from \"@assistant-ui/store\";\nimport { isUserScrollUp } from \"@assistant-ui/store/client\";\nimport { useOnResizeContent } from \"../../utils/hooks/useOnResizeContent\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { writableStore } from \"../../context/ReadonlyStore\";\nimport { useThreadViewportStore } from \"../../context/react/ThreadViewportContext\";\n\nexport namespace useThreadViewportAutoScroll {\n export type Options = {\n /**\n * Whether to automatically scroll to the bottom when new messages are added.\n * When enabled, the viewport will automatically scroll to show the latest content.\n *\n * Default false if `turnAnchor` is \"top\", otherwise defaults to true.\n */\n autoScroll?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when a new run starts.\n *\n * Defaults to true.\n */\n scrollToBottomOnRunStart?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when messages first appear in the thread.\n *\n * Defaults to true.\n */\n scrollToBottomOnInitialize?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when switching to a different thread.\n *\n * Defaults to true.\n */\n scrollToBottomOnThreadSwitch?: boolean | undefined;\n };\n}\n\nexport const useThreadViewportAutoScroll = <TElement extends HTMLElement>({\n autoScroll,\n scrollToBottomOnRunStart = true,\n scrollToBottomOnInitialize = true,\n scrollToBottomOnThreadSwitch = true,\n}: useThreadViewportAutoScroll.Options): RefCallback<TElement> => {\n const divRef = useRef<TElement>(null);\n const hasMessages = useAuiState((s) => s.thread.messages.length > 0);\n const isRunning = useAuiState((s) => s.thread.isRunning);\n const initializeScrollRequestedRef = useRef(false);\n const scheduledFrameRef = useRef<number | null>(null);\n\n const threadViewportStore = useThreadViewportStore();\n if (autoScroll === undefined) {\n autoScroll = threadViewportStore.getState().turnAnchor !== \"top\";\n }\n\n const lastScrollTop = useRef<number>(0);\n const lastScrollHeight = useRef<number>(0);\n const lastObservedScrollHeight = useRef<number>(0);\n const lastObservedClientHeight = useRef<number>(0);\n\n // Pending bottom-scroll intent. Planted by initialize/run-start/switch/button\n // triggers, cleared when handleScroll confirms we reached bottom, or when the\n // user actively scrolls up while content size is stable.\n const scrollingToBottomBehaviorRef = useRef<ScrollBehavior | null>(null);\n const followBottomRef = useRef(autoScroll);\n\n const scrollToBottom = useCallback((behavior: ScrollBehavior) => {\n const div = divRef.current;\n if (!div) return;\n\n followBottomRef.current = true;\n scrollingToBottomBehaviorRef.current = behavior;\n div.scrollTo({ top: div.scrollHeight, behavior });\n }, []);\n\n const cancelScheduledFrame = useCallback(() => {\n if (scheduledFrameRef.current === null) return;\n cancelAnimationFrame(scheduledFrameRef.current);\n scheduledFrameRef.current = null;\n }, []);\n\n const scheduleScrollToBottom = useCallback(\n (behavior: ScrollBehavior) => {\n scrollingToBottomBehaviorRef.current = behavior;\n cancelScheduledFrame();\n scheduledFrameRef.current = requestAnimationFrame(() => {\n scheduledFrameRef.current = null;\n scrollToBottom(behavior);\n });\n },\n [cancelScheduledFrame, scrollToBottom],\n );\n\n useLayoutEffect(() => () => cancelScheduledFrame(), [cancelScheduledFrame]);\n\n const hasActiveTopAnchor = useCallback(() => {\n const state = threadViewportStore.getState();\n return (\n state.turnAnchor === \"top\" &&\n state.element.viewport === divRef.current &&\n state.element.anchor !== null\n );\n }, [threadViewportStore]);\n\n const handleScroll = () => {\n const div = divRef.current;\n if (!div) return;\n\n const isAtBottom = threadViewportStore.getState().isAtBottom;\n const newIsAtBottom =\n Math.abs(div.scrollHeight - div.scrollTop - div.clientHeight) <= 1 ||\n div.scrollHeight <= div.clientHeight;\n\n const isInFlightDownwardScroll =\n !newIsAtBottom && lastScrollTop.current < div.scrollTop;\n if (isInFlightDownwardScroll) {\n // no-op: a smooth scroll-to-bottom fires many midpoint scroll events\n // before landing, don't flicker isAtBottom or clear intent mid-animation\n } else {\n const userScrolledUp = isUserScrollUp(\n {\n scrollTop: lastScrollTop.current,\n scrollHeight: lastScrollHeight.current,\n },\n div,\n );\n\n if (newIsAtBottom) {\n // newIsAtBottom is ambiguous when the viewport doesn't overflow —\n // keep intent alive until content can actually scroll\n const viewportOverflows = div.scrollHeight > div.clientHeight + 1;\n if (viewportOverflows) {\n scrollingToBottomBehaviorRef.current = null;\n }\n if (autoScroll) followBottomRef.current = true;\n } else if (userScrolledUp) {\n cancelScheduledFrame();\n scrollingToBottomBehaviorRef.current = null;\n followBottomRef.current = false;\n }\n\n const shouldUpdate =\n newIsAtBottom || scrollingToBottomBehaviorRef.current === null;\n\n if (shouldUpdate && newIsAtBottom !== isAtBottom) {\n writableStore(threadViewportStore).setState({\n isAtBottom: newIsAtBottom,\n });\n }\n }\n\n lastScrollTop.current = div.scrollTop;\n lastScrollHeight.current = div.scrollHeight;\n };\n\n const resizeRef = useOnResizeContent(() => {\n const div = divRef.current;\n if (!div) return;\n\n const { scrollHeight, clientHeight } = div;\n if (\n scrollHeight === lastObservedScrollHeight.current &&\n clientHeight === lastObservedClientHeight.current\n ) {\n return;\n }\n lastObservedScrollHeight.current = scrollHeight;\n lastObservedClientHeight.current = clientHeight;\n\n const scrollBehavior = scrollingToBottomBehaviorRef.current;\n if (scrollBehavior && hasActiveTopAnchor()) {\n // Let the top-anchor reserve own scrolling while a run starts to avoid a bottom-scroll race.\n scrollingToBottomBehaviorRef.current = null;\n } else if (scrollBehavior) {\n scrollToBottom(scrollBehavior);\n } else if (\n autoScroll &&\n !(isRunning && hasActiveTopAnchor()) &&\n followBottomRef.current\n ) {\n scrollToBottom(\"instant\");\n }\n\n handleScroll();\n });\n\n const scrollRef = useManagedRef<HTMLElement>((el) => {\n // A pointer gesture invalidates pending bottom-scroll intent; otherwise an\n // intent kept alive by a non-overflowing thread (see handleScroll) hijacks\n // the next content growth, e.g. expanding a collapsible tool call.\n const cancelPendingScrollToBottom = () => {\n scrollingToBottomBehaviorRef.current = null;\n };\n el.addEventListener(\"scroll\", handleScroll);\n el.addEventListener(\"pointerdown\", cancelPendingScrollToBottom);\n return () => {\n el.removeEventListener(\"scroll\", handleScroll);\n el.removeEventListener(\"pointerdown\", cancelPendingScrollToBottom);\n };\n });\n\n useLayoutEffect(() => {\n if (!scrollToBottomOnInitialize) return;\n if (!hasMessages) {\n initializeScrollRequestedRef.current = false;\n return;\n }\n if (initializeScrollRequestedRef.current) return;\n\n initializeScrollRequestedRef.current = true;\n // defer to an in-flight run (e.g. first message on a new thread) that\n // already planted intent — otherwise we'd downgrade its \"auto\" to \"instant\"\n if (scrollingToBottomBehaviorRef.current !== null) return;\n scheduleScrollToBottom(\"instant\");\n }, [hasMessages, scheduleScrollToBottom, scrollToBottomOnInitialize]);\n\n useOnScrollToBottom(({ behavior }) => {\n scrollToBottom(behavior);\n });\n\n useAuiEvent(\"thread.runStart\", () => {\n if (!scrollToBottomOnRunStart) return;\n if (threadViewportStore.getState().turnAnchor === \"top\") return;\n scheduleScrollToBottom(\"auto\");\n });\n\n useAuiEvent(\"threads.selectionChanged\", () => {\n if (!scrollToBottomOnThreadSwitch) return;\n scheduleScrollToBottom(\"instant\");\n });\n\n const autoScrollRef = useComposedRefs<TElement>(resizeRef, scrollRef, divRef);\n return autoScrollRef as RefCallback<TElement>;\n};\n"],"mappings":";;;;;;;;;;;AA6CA,MAAaa,+BAA6D,EACxEE,YACAC,2BAA2B,MAC3BC,6BAA6B,MAC7BC,+BAA+B,WACiC;CAChE,MAAMG,SAASlB,OAAiB,IAAI;CACpC,MAAMmB,cAAchB,aAAaiB,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MAAMO,iBAAiBhC,6BAA6BM;EACpD,IAAI0B,kBAAkBlB,mBAAmB,GAEvCd,6BAA6BM,UAAU;OAClC,IAAI0B,gBACT7B,eAAe6B,cAAc;OACxB,IACLvD,cACA,EAAEY,aAAayB,mBAAmB,MAClCZ,gBAAgBI,SAEhBH,eAAe,SAAS;EAG1BgB,aAAa;CACf,CAAC;CAED,MAAMc,YAAY7D,eAA4B8D,OAAO;EAInD,MAAMC,oCAAoC;GACxCnC,6BAA6BM,UAAU;EACzC;EACA4B,GAAGE,iBAAiB,UAAUjB,YAAY;EAC1Ce,GAAGE,iBAAiB,eAAeD,2BAA2B;EAC9D,aAAa;GACXD,GAAGG,oBAAoB,UAAUlB,YAAY;GAC7Ce,GAAGG,oBAAoB,eAAeF,2BAA2B;EACnE;CACF,CAAC;CAEDvE,sBAAsB;EACpB,IAAI,CAACe,4BAA4B;EACjC,IAAI,CAACK,aAAa;GAChBM,6BAA6BgB,UAAU;GACvC;EACF;EACA,IAAIhB,6BAA6BgB,SAAS;EAE1ChB,6BAA6BgB,UAAU;EAGvC,IAAIN,6BAA6BM,YAAY,MAAM;EACnDM,uBAAuB,SAAS;CAClC,GAAG;EAAC5B;EAAa4B;EAAwBjC;CAA0B,CAAC;CAEpER,qBAAqB,EAAEiC,UAAAA,iBAAe;EACpCD,eAAeC,UAAQ;CACzB,CAAC;CAEDrC,YAAY,yBAAyB;EACnC,IAAI,CAACW,0BAA0B;EAC/B,IAAIc,oBAAoBE,SAAS,CAAC,CAACC,eAAe,OAAO;EACzDiB,uBAAuB,MAAM;CAC/B,CAAC;CAED7C,YAAY,kCAAkC;EAC5C,IAAI,CAACa,8BAA8B;EACnCgC,uBAAuB,SAAS;CAClC,CAAC;CAGD,OADsBlD,gBAA0BqE,WAAWE,WAAWlD,MAC/DuD;AACT"}
1
+ {"version":3,"file":"useThreadViewportAutoScroll.js","names":["useComposedRefs","useCallback","useLayoutEffect","useRef","RefCallback","useAuiEvent","useAuiState","isUserScrollUp","isViewportAtBottom","viewportOverflows","useOnResizeContent","useOnScrollToBottom","useManagedRef","writableStore","useThreadViewportStore","useThreadViewportAutoScroll","Options","autoScroll","scrollToBottomOnRunStart","scrollToBottomOnInitialize","scrollToBottomOnThreadSwitch","HTMLElement","TElement","divRef","hasMessages","s","thread","messages","length","isRunning","initializeScrollRequestedRef","scheduledFrameRef","threadViewportStore","undefined","getState","turnAnchor","lastScrollTop","lastScrollHeight","lastObservedScrollHeight","lastObservedClientHeight","scrollingToBottomBehaviorRef","ScrollBehavior","followBottomRef","scrollToBottom","behavior","div","current","scrollTo","top","scrollHeight","cancelScheduledFrame","cancelAnimationFrame","scheduleScrollToBottom","requestAnimationFrame","hasActiveTopAnchor","state","element","viewport","anchor","handleScroll","isAtBottom","newIsAtBottom","isInFlightDownwardScroll","scrollTop","userScrolledUp","shouldUpdate","setState","resizeRef","clientHeight","scrollBehavior","scrollRef","el","cancelPendingScrollToBottom","addEventListener","removeEventListener","autoScrollRef"],"sources":["../../../src/primitives/thread/useThreadViewportAutoScroll.ts"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { useCallback, useLayoutEffect, useRef, type RefCallback } from \"react\";\nimport { useAuiEvent, useAuiState } from \"@assistant-ui/store\";\nimport {\n isUserScrollUp,\n isViewportAtBottom,\n viewportOverflows,\n} from \"@assistant-ui/store/client\";\nimport { useOnResizeContent } from \"../../utils/hooks/useOnResizeContent\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { writableStore } from \"../../context/ReadonlyStore\";\nimport { useThreadViewportStore } from \"../../context/react/ThreadViewportContext\";\n\nexport namespace useThreadViewportAutoScroll {\n export type Options = {\n /**\n * Whether to automatically scroll to the bottom when new messages are added.\n * When enabled, the viewport will automatically scroll to show the latest content.\n *\n * Default false if `turnAnchor` is \"top\", otherwise defaults to true.\n */\n autoScroll?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when a new run starts.\n *\n * Defaults to true.\n */\n scrollToBottomOnRunStart?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when messages first appear in the thread.\n *\n * Defaults to true.\n */\n scrollToBottomOnInitialize?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when switching to a different thread.\n *\n * Defaults to true.\n */\n scrollToBottomOnThreadSwitch?: boolean | undefined;\n };\n}\n\nexport const useThreadViewportAutoScroll = <TElement extends HTMLElement>({\n autoScroll,\n scrollToBottomOnRunStart = true,\n scrollToBottomOnInitialize = true,\n scrollToBottomOnThreadSwitch = true,\n}: useThreadViewportAutoScroll.Options): RefCallback<TElement> => {\n const divRef = useRef<TElement>(null);\n const hasMessages = useAuiState((s) => s.thread.messages.length > 0);\n const isRunning = useAuiState((s) => s.thread.isRunning);\n const initializeScrollRequestedRef = useRef(false);\n const scheduledFrameRef = useRef<number | null>(null);\n\n const threadViewportStore = useThreadViewportStore();\n if (autoScroll === undefined) {\n autoScroll = threadViewportStore.getState().turnAnchor !== \"top\";\n }\n\n const lastScrollTop = useRef<number>(0);\n const lastScrollHeight = useRef<number>(0);\n const lastObservedScrollHeight = useRef<number>(0);\n const lastObservedClientHeight = useRef<number>(0);\n\n // Pending bottom-scroll intent. Planted by initialize/run-start/switch/button\n // triggers, cleared when handleScroll confirms we reached bottom, or when the\n // user actively scrolls up while content size is stable.\n const scrollingToBottomBehaviorRef = useRef<ScrollBehavior | null>(null);\n const followBottomRef = useRef(autoScroll);\n\n const scrollToBottom = useCallback((behavior: ScrollBehavior) => {\n const div = divRef.current;\n if (!div) return;\n\n followBottomRef.current = true;\n scrollingToBottomBehaviorRef.current = behavior;\n div.scrollTo({ top: div.scrollHeight, behavior });\n }, []);\n\n const cancelScheduledFrame = useCallback(() => {\n if (scheduledFrameRef.current === null) return;\n cancelAnimationFrame(scheduledFrameRef.current);\n scheduledFrameRef.current = null;\n }, []);\n\n const scheduleScrollToBottom = useCallback(\n (behavior: ScrollBehavior) => {\n scrollingToBottomBehaviorRef.current = behavior;\n cancelScheduledFrame();\n scheduledFrameRef.current = requestAnimationFrame(() => {\n scheduledFrameRef.current = null;\n scrollToBottom(behavior);\n });\n },\n [cancelScheduledFrame, scrollToBottom],\n );\n\n useLayoutEffect(() => () => cancelScheduledFrame(), [cancelScheduledFrame]);\n\n const hasActiveTopAnchor = useCallback(() => {\n const state = threadViewportStore.getState();\n return (\n state.turnAnchor === \"top\" &&\n state.element.viewport === divRef.current &&\n state.element.anchor !== null\n );\n }, [threadViewportStore]);\n\n const handleScroll = () => {\n const div = divRef.current;\n if (!div) return;\n\n const isAtBottom = threadViewportStore.getState().isAtBottom;\n const newIsAtBottom = isViewportAtBottom(div);\n\n const isInFlightDownwardScroll =\n !newIsAtBottom && lastScrollTop.current < div.scrollTop;\n if (isInFlightDownwardScroll) {\n // no-op: a smooth scroll-to-bottom fires many midpoint scroll events\n // before landing, don't flicker isAtBottom or clear intent mid-animation\n } else {\n const userScrolledUp = isUserScrollUp(\n {\n scrollTop: lastScrollTop.current,\n scrollHeight: lastScrollHeight.current,\n },\n div,\n );\n\n if (newIsAtBottom) {\n // newIsAtBottom is ambiguous when the viewport doesn't overflow —\n // keep intent alive until content can actually scroll\n if (viewportOverflows(div)) {\n scrollingToBottomBehaviorRef.current = null;\n }\n if (autoScroll) followBottomRef.current = true;\n } else if (userScrolledUp) {\n cancelScheduledFrame();\n scrollingToBottomBehaviorRef.current = null;\n followBottomRef.current = false;\n }\n\n const shouldUpdate =\n newIsAtBottom || scrollingToBottomBehaviorRef.current === null;\n\n if (shouldUpdate && newIsAtBottom !== isAtBottom) {\n writableStore(threadViewportStore).setState({\n isAtBottom: newIsAtBottom,\n });\n }\n }\n\n lastScrollTop.current = div.scrollTop;\n lastScrollHeight.current = div.scrollHeight;\n };\n\n const resizeRef = useOnResizeContent(() => {\n const div = divRef.current;\n if (!div) return;\n\n const { scrollHeight, clientHeight } = div;\n if (\n scrollHeight === lastObservedScrollHeight.current &&\n clientHeight === lastObservedClientHeight.current\n ) {\n return;\n }\n lastObservedScrollHeight.current = scrollHeight;\n lastObservedClientHeight.current = clientHeight;\n\n const scrollBehavior = scrollingToBottomBehaviorRef.current;\n if (scrollBehavior && hasActiveTopAnchor()) {\n // Let the top-anchor reserve own scrolling while a run starts to avoid a bottom-scroll race.\n scrollingToBottomBehaviorRef.current = null;\n } else if (scrollBehavior) {\n scrollToBottom(scrollBehavior);\n } else if (\n autoScroll &&\n !(isRunning && hasActiveTopAnchor()) &&\n followBottomRef.current\n ) {\n scrollToBottom(\"instant\");\n }\n\n handleScroll();\n });\n\n const scrollRef = useManagedRef<HTMLElement>((el) => {\n // A pointer gesture invalidates pending bottom-scroll intent; otherwise an\n // intent kept alive by a non-overflowing thread (see handleScroll) hijacks\n // the next content growth, e.g. expanding a collapsible tool call.\n const cancelPendingScrollToBottom = () => {\n scrollingToBottomBehaviorRef.current = null;\n };\n el.addEventListener(\"scroll\", handleScroll);\n el.addEventListener(\"pointerdown\", cancelPendingScrollToBottom);\n return () => {\n el.removeEventListener(\"scroll\", handleScroll);\n el.removeEventListener(\"pointerdown\", cancelPendingScrollToBottom);\n };\n });\n\n useLayoutEffect(() => {\n if (!scrollToBottomOnInitialize) return;\n if (!hasMessages) {\n initializeScrollRequestedRef.current = false;\n return;\n }\n if (initializeScrollRequestedRef.current) return;\n\n initializeScrollRequestedRef.current = true;\n // defer to an in-flight run (e.g. first message on a new thread) that\n // already planted intent — otherwise we'd downgrade its \"auto\" to \"instant\"\n if (scrollingToBottomBehaviorRef.current !== null) return;\n scheduleScrollToBottom(\"instant\");\n }, [hasMessages, scheduleScrollToBottom, scrollToBottomOnInitialize]);\n\n useOnScrollToBottom(({ behavior }) => {\n scrollToBottom(behavior);\n });\n\n useAuiEvent(\"thread.runStart\", () => {\n if (!scrollToBottomOnRunStart) return;\n if (threadViewportStore.getState().turnAnchor === \"top\") return;\n scheduleScrollToBottom(\"auto\");\n });\n\n useAuiEvent(\"threads.selectionChanged\", () => {\n if (!scrollToBottomOnThreadSwitch) return;\n scheduleScrollToBottom(\"instant\");\n });\n\n const autoScrollRef = useComposedRefs<TElement>(resizeRef, scrollRef, divRef);\n return autoScrollRef as RefCallback<TElement>;\n};\n"],"mappings":";;;;;;;;;;;AAiDA,MAAae,+BAA6D,EACxEE,YACAC,2BAA2B,MAC3BC,6BAA6B,MAC7BC,+BAA+B,WACiC;CAChE,MAAMG,SAASpB,OAAiB,IAAI;CACpC,MAAMqB,cAAclB,aAAamB,MAAMA,EAAEC,OAAOC,SAASC,SAAS,CAAC;CACnE,MAAMC,YAAYvB,aAAamB,QAAMA,IAAEC,OAAOG,SAAS;CACvD,MAAMC,+BAA+B3B,OAAO,KAAK;CACjD,MAAM4B,oBAAoB5B,OAAsB,IAAI;CAEpD,MAAM6B,sBAAsBlB,uBAAuB;CACnD,IAAIG,eAAegB,KAAAA,GACjBhB,aAAae,oBAAoBE,SAAS,CAAC,CAACC,eAAe;CAG7D,MAAMC,gBAAgBjC,OAAe,CAAC;CACtC,MAAMkC,mBAAmBlC,OAAe,CAAC;CACzC,MAAMmC,2BAA2BnC,OAAe,CAAC;CACjD,MAAMoC,2BAA2BpC,OAAe,CAAC;CAKjD,MAAMqC,+BAA+BrC,OAA8B,IAAI;CACvE,MAAMuC,kBAAkBvC,OAAOc,UAAU;CAEzC,MAAM0B,iBAAiB1C,aAAa2C,aAA6B;EAC/D,MAAMC,MAAMtB,OAAOuB;EACnB,IAAI,CAACD,KAAK;EAEVH,gBAAgBI,UAAU;EAC1BN,6BAA6BM,UAAUF;EACvCC,IAAIE,SAAS;GAAEC,KAAKH,IAAII;GAAcL;EAAS,CAAC;CAClD,GAAG,CAAA,CAAE;CAEL,MAAMM,uBAAuBjD,kBAAkB;EAC7C,IAAI8B,kBAAkBe,YAAY,MAAM;EACxCK,qBAAqBpB,kBAAkBe,OAAO;EAC9Cf,kBAAkBe,UAAU;CAC9B,GAAG,CAAA,CAAE;CAEL,MAAMM,yBAAyBnD,aAC5B2C,eAA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;EACnCgC,uBAAuB,SAAS;CAClC,CAAC;CAGD,OADsBpD,gBAA0BmE,WAAWG,WAAW/C,MAC/DoD;AACT"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { Primitive } from "../../utils/Primitive.js";
2
+ import { Primitive as Primitive$1 } from "../../utils/Primitive.js";
3
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
4
  import { useThreadListNew } from "@assistant-ui/core/react";
5
5
  import { useAuiState } from "@assistant-ui/store";
6
6
  import { forwardRef } from "@assistant-ui/tap/react-shim";
7
7
  import { jsx } from "react/jsx-runtime";
8
- import { composeEventHandlers } from "@radix-ui/primitive";
8
+ import { composeEventHandlers } from "radix-ui/internal";
9
9
  //#region src/primitives/threadList/ThreadListNew.tsx
10
10
  const ThreadListPrimitiveNew = forwardRef((t0, forwardedRef) => {
11
11
  const $ = c(15);
@@ -43,7 +43,7 @@ const ThreadListPrimitiveNew = forwardRef((t0, forwardedRef) => {
43
43
  } else t2 = $[8];
44
44
  let t3;
45
45
  if ($[9] !== disabled || $[10] !== forwardedRef || $[11] !== props || $[12] !== t1 || $[13] !== t2) {
46
- t3 = /* @__PURE__ */ jsx(Primitive.button, {
46
+ t3 = /* @__PURE__ */ jsx(Primitive$1.button, {
47
47
  type: "button",
48
48
  ...t1,
49
49
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListNew.js","names":["c","_c","ActionButtonElement","ActionButtonProps","forwardRef","Primitive","composeEventHandlers","useAuiState","useThreadListNew","useThreadListNewBehavior","ThreadListPrimitiveNew","Element","Props","t0","forwardedRef","$","disabled","onClick","props","isMain","_temp","switchToNewThread","t1","t2","t3","displayName","s","threads","newThreadId","mainThreadId"],"sources":["../../../src/primitives/threadList/ThreadListNew.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n ActionButtonElement,\n ActionButtonProps,\n} from \"../../utils/createActionButton\";\nimport { forwardRef } from \"react\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { useThreadListNew as useThreadListNewBehavior } from \"@assistant-ui/core/react\";\n\nexport namespace ThreadListPrimitiveNew {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<() => void>;\n}\n\nexport const ThreadListPrimitiveNew = forwardRef<\n ThreadListPrimitiveNew.Element,\n ThreadListPrimitiveNew.Props\n>(({ onClick, disabled, ...props }, forwardedRef) => {\n const isMain = useAuiState(\n (s) => s.threads.newThreadId === s.threads.mainThreadId,\n );\n\n const { switchToNewThread } = useThreadListNewBehavior();\n\n return (\n <Primitive.button\n type=\"button\"\n {...(isMain ? { \"data-active\": \"true\", \"aria-current\": \"true\" } : null)}\n {...props}\n ref={forwardedRef}\n disabled={disabled}\n onClick={composeEventHandlers(onClick, switchToNewThread)}\n />\n );\n});\n\nThreadListPrimitiveNew.displayName = \"ThreadListPrimitive.New\";\n"],"mappings":";;;;;;;;;AAiBA,MAAaU,yBAAyBN,YAGpCS,IAAAC,iBAAA;CAAA,MAAAC,IAAAd,EAAA,EAAA;CAAA,IAAAe;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAF,IAAA;EAAC,CAAA,CAAAI,SAAAD,aAAAE,SAAAL;EAA+BE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAF,WAAAD,EAAA;EAAAE,UAAAF,EAAA;EAAAG,QAAAH,EAAA;CAAA;CAChC,MAAAI,SAAeZ,YACba,KACF;CAEA,MAAA,EAAAC,sBAA8BZ,iBAAyB;CAAE,IAAAa;CAAA,IAAAP,EAAA,OAAAI,QAAA;EAKhDG,KAAAH,SAAA;GAAA,eAA0B;GAAM,gBAAkB;EAAc,IAAhE;EAAiEJ,EAAA,KAAAI;EAAAJ,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAE,WAAAF,EAAA,OAAAM,mBAAA;EAI7DE,KAAAjB,qBAAqBW,SAASI,iBAAiB;EAACN,EAAA,KAAAE;EAAAF,EAAA,KAAAM;EAAAN,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,OAAAC,YAAAD,EAAA,QAAAD,gBAAAC,EAAA,QAAAG,SAAAH,EAAA,QAAAO,MAAAP,EAAA,QAAAQ,IAAA;EAN3DC,KAAA,oBAAA,UAAA,QAAA;GACO,MAAA;GAAQ,GACRF;GAAiE,GAClEJ;GACCJ,KAAAA;GACKE;GACD,SAAAO;EAAgD,CAAA;EACzDR,EAAA,KAAAC;EAAAD,EAAA,MAAAD;EAAAC,EAAA,MAAAG;EAAAH,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAPFS;AAOE,CAEL;AAEDd,uBAAuBe,cAAc;AAnBnC,SAAAL,MAAAM,GAAA;CAAA,OAESA,EAACC,QAAQC,gBAAiBF,EAACC,QAAQE;AAAa"}
1
+ {"version":3,"file":"ThreadListNew.js","names":["c","_c","ActionButtonElement","ActionButtonProps","forwardRef","Primitive","composeEventHandlers","useAuiState","useThreadListNew","useThreadListNewBehavior","ThreadListPrimitiveNew","Element","Props","t0","forwardedRef","$","disabled","onClick","props","isMain","_temp","switchToNewThread","t1","t2","t3","displayName","s","threads","newThreadId","mainThreadId"],"sources":["../../../src/primitives/threadList/ThreadListNew.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n ActionButtonElement,\n ActionButtonProps,\n} from \"../../utils/createActionButton\";\nimport { forwardRef } from \"react\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { useThreadListNew as useThreadListNewBehavior } from \"@assistant-ui/core/react\";\n\nexport namespace ThreadListPrimitiveNew {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<() => void>;\n}\n\nexport const ThreadListPrimitiveNew = forwardRef<\n ThreadListPrimitiveNew.Element,\n ThreadListPrimitiveNew.Props\n>(({ onClick, disabled, ...props }, forwardedRef) => {\n const isMain = useAuiState(\n (s) => s.threads.newThreadId === s.threads.mainThreadId,\n );\n\n const { switchToNewThread } = useThreadListNewBehavior();\n\n return (\n <Primitive.button\n type=\"button\"\n {...(isMain ? { \"data-active\": \"true\", \"aria-current\": \"true\" } : null)}\n {...props}\n ref={forwardedRef}\n disabled={disabled}\n onClick={composeEventHandlers(onClick, switchToNewThread)}\n />\n );\n});\n\nThreadListPrimitiveNew.displayName = \"ThreadListPrimitive.New\";\n"],"mappings":";;;;;;;;;AAiBA,MAAaU,yBAAyBN,YAGpCS,IAAAC,iBAAA;CAAA,MAAAC,IAAAd,EAAA,EAAA;CAAA,IAAAe;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAF,IAAA;EAAC,CAAA,CAAAI,SAAAD,UAAA,GAAAE,SAAAL;EAA+BE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAF,WAAAD,EAAA;EAAAE,UAAAF,EAAA;EAAAG,QAAAH,EAAA;CAAA;CAChC,MAAAI,SAAeZ,YACba,KACF;CAEA,MAAA,EAAAC,sBAA8BZ,iBAAyB;CAAE,IAAAa;CAAA,IAAAP,EAAA,OAAAI,QAAA;EAKhDG,KAAAH,SAAA;GAAA,eAA0B;GAAM,gBAAkB;EAAc,IAAhE;EAAiEJ,EAAA,KAAAI;EAAAJ,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAE,WAAAF,EAAA,OAAAM,mBAAA;EAI7DE,KAAAjB,qBAAqBW,SAASI,iBAAiB;EAACN,EAAA,KAAAE;EAAAF,EAAA,KAAAM;EAAAN,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,OAAAC,YAAAD,EAAA,QAAAD,gBAAAC,EAAA,QAAAG,SAAAH,EAAA,QAAAO,MAAAP,EAAA,QAAAQ,IAAA;EAN3DC,KAAA,oBAAA,YAAA,QAAA;GACO,MAAA;GAAQ,GACRF;GAAiE,GAClEJ;GACCJ,KAAAA;GACKE;GACD,SAAAO;EAAgD,CAAA;EACzDR,EAAA,KAAAC;EAAAD,EAAA,MAAAD;EAAAC,EAAA,MAAAG;EAAAH,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAPFS;AAOE,CAEL;AAEDd,uBAAuBe,cAAc;AAnBnC,SAAAL,MAAAM,GAAA;CAAA,OAESA,EAACC,QAAQC,gBAAiBF,EAACC,QAAQE;AAAa"}
@@ -1,4 +1,5 @@
1
1
  import { RefObject } from "react";
2
+ import { Collection } from "radix-ui/internal";
2
3
  //#region src/primitives/threadListFocusGroup.d.ts
3
4
  declare const useThreadListCollection: (scope: any) => () => {
4
5
  ref: RefObject<HTMLButtonElement | null>;
@@ -8,7 +9,7 @@ declare const ThreadListCollection: {
8
9
  children?: React.ReactNode;
9
10
  scope: any;
10
11
  }>;
11
- readonly Slot: React.ForwardRefExoticComponent<import("@radix-ui/react-collection").CollectionProps & React.RefAttributes<HTMLElement>>;
12
+ readonly Slot: React.ForwardRefExoticComponent<Collection.CollectionProps & React.RefAttributes<HTMLElement>>;
12
13
  readonly ItemSlot: import("react").ForwardRefExoticComponent<{
13
14
  children: React.ReactNode;
14
15
  scope: any;
@@ -1 +1 @@
1
- {"version":3,"file":"threadListFocusGroup.d.ts","names":[],"sources":["../../src/primitives/threadListFocusGroup.ts"],"mappings":";;cAKmB,0BAAuB;OAAvB,UAAA;;cAGN;;IAKe,WAAC,MAAA;;;;;;;;;KAFxB;EACH,YAAY,UAAU;EACtB,SAAS,UAAU;;cAOR,6CAA2B,SAAA;cAE3B,8BAA6B"}
1
+ {"version":3,"file":"threadListFocusGroup.d.ts","names":[],"sources":["../../src/primitives/threadListFocusGroup.ts"],"mappings":";;;cAKmB,0BAAuB;OAAvB,UAAA;;cAGN;;IAKmB,WAAC,MAAA;;;;;;;;;KAF5B;EACH,YAAY,UAAU;EACtB,SAAS,UAAU;;cAOR,6CAA2B,SAAA;cAE3B,8BAA6B"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { createContext, useContext } from "@assistant-ui/tap/react-shim";
3
- import { createCollection } from "@radix-ui/react-collection";
3
+ import { Collection } from "radix-ui/internal";
4
4
  //#region src/primitives/threadListFocusGroup.ts
5
- const [collection, useThreadListCollection] = createCollection("ThreadList");
5
+ const [collection, useThreadListCollection] = Collection.createCollection("ThreadList");
6
6
  const ThreadListCollection = collection;
7
7
  const ThreadListItemFocusContext = createContext(null);
8
8
  const ThreadListItemFocusProvider = ThreadListItemFocusContext.Provider;
@@ -1 +1 @@
1
- {"version":3,"file":"threadListFocusGroup.js","names":["createCollection","createContext","useContext","RefObject","collection","useThreadListCollection","HTMLButtonElement","ThreadListCollection","ThreadListItemFocus","triggerRef","moreRef","ThreadListItemFocusContext","ThreadListItemFocusProvider","Provider","useThreadListItemFocus"],"sources":["../../src/primitives/threadListFocusGroup.ts"],"sourcesContent":["\"use client\";\n\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { createContext, useContext, type RefObject } from \"react\";\n\nconst [collection, useThreadListCollection] =\n createCollection<HTMLButtonElement>(\"ThreadList\");\n\nexport const ThreadListCollection = collection;\nexport { useThreadListCollection };\n\ntype ThreadListItemFocus = {\n triggerRef: RefObject<HTMLButtonElement | null>;\n moreRef: RefObject<HTMLButtonElement | null>;\n};\n\nconst ThreadListItemFocusContext = createContext<ThreadListItemFocus | null>(\n null,\n);\n\nexport const ThreadListItemFocusProvider = ThreadListItemFocusContext.Provider;\n\nexport const useThreadListItemFocus = (): ThreadListItemFocus | null =>\n useContext(ThreadListItemFocusContext);\n"],"mappings":";;;;AAKA,MAAM,CAACI,YAAYC,2BACjBL,iBAAoC,YAAY;AAElD,MAAaO,uBAAuBH;AAQpC,MAAMO,6BAA6BV,cACjC,IACF;AAEA,MAAaW,8BAA8BD,2BAA2BE;AAEtE,MAAaC,+BAAyB;CAAA,OACpCZ,WAAWS,0BAA0B;AAAC"}
1
+ {"version":3,"file":"threadListFocusGroup.js","names":["Collection","createContext","useContext","RefObject","collection","useThreadListCollection","createCollection","HTMLButtonElement","ThreadListCollection","ThreadListItemFocus","triggerRef","moreRef","ThreadListItemFocusContext","ThreadListItemFocusProvider","Provider","useThreadListItemFocus"],"sources":["../../src/primitives/threadListFocusGroup.ts"],"sourcesContent":["\"use client\";\n\nimport { Collection } from \"radix-ui/internal\";\nimport { createContext, useContext, type RefObject } from \"react\";\n\nconst [collection, useThreadListCollection] =\n Collection.createCollection<HTMLButtonElement>(\"ThreadList\");\n\nexport const ThreadListCollection = collection;\nexport { useThreadListCollection };\n\ntype ThreadListItemFocus = {\n triggerRef: RefObject<HTMLButtonElement | null>;\n moreRef: RefObject<HTMLButtonElement | null>;\n};\n\nconst ThreadListItemFocusContext = createContext<ThreadListItemFocus | null>(\n null,\n);\n\nexport const ThreadListItemFocusProvider = ThreadListItemFocusContext.Provider;\n\nexport const useThreadListItemFocus = (): ThreadListItemFocus | null =>\n useContext(ThreadListItemFocusContext);\n"],"mappings":";;;;AAKA,MAAM,CAACI,YAAYC,2BACjBL,WAAWM,iBAAoC,YAAY;AAE7D,MAAaE,uBAAuBJ;AAQpC,MAAMQ,6BAA6BX,cACjC,IACF;AAEA,MAAaY,8BAA8BD,2BAA2BE;AAEtE,MAAaC,+BAAyB;CAAA,OACpCb,WAAWU,0BAA0B;AAAC"}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { Primitive } from "../../utils/Primitive.js";
2
+ import { Primitive as Primitive$1 } from "../../utils/Primitive.js";
3
3
  import { ThreadListItemFocusProvider, useThreadListCollection } from "../threadListFocusGroup.js";
4
4
  import { useAuiState } from "@assistant-ui/store";
5
5
  import { forwardRef, useMemo, useRef } from "@assistant-ui/tap/react-shim";
6
6
  import { jsx } from "react/jsx-runtime";
7
- import { composeEventHandlers } from "@radix-ui/primitive";
7
+ import { composeEventHandlers } from "radix-ui/internal";
8
8
  import { Direction } from "radix-ui";
9
9
  //#region src/primitives/threadListItem/ThreadListItemRoot.tsx
10
10
  const ThreadListItemPrimitiveRoot = forwardRef((props, ref) => {
@@ -41,7 +41,7 @@ const ThreadListItemPrimitiveRoot = forwardRef((props, ref) => {
41
41
  };
42
42
  return /* @__PURE__ */ jsx(ThreadListItemFocusProvider, {
43
43
  value: focus,
44
- children: /* @__PURE__ */ jsx(Primitive.div, {
44
+ children: /* @__PURE__ */ jsx(Primitive$1.div, {
45
45
  ...isMain ? {
46
46
  "data-active": "true",
47
47
  "aria-current": "true"
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemRoot.js","names":["Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","KeyboardEvent","useMemo","useRef","useAuiState","composeEventHandlers","Direction","ThreadListItemFocusProvider","useThreadListCollection","PrimitiveDivProps","div","ThreadListItemPrimitiveRoot","Element","Props","props","ref","isMain","s","threads","mainThreadId","threadListItem","id","triggerRef","HTMLButtonElement","moreRef","focus","getItems","undefined","direction","useDirection","onKeyDown","event","HTMLDivElement","forwardKey","backKey","trigger","current","more","target","key","triggers","map","item","filter","node","next","indexOf","preventDefault","displayName"],"sources":["../../../src/primitives/threadListItem/ThreadListItemRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n type KeyboardEvent,\n useMemo,\n useRef,\n} from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Direction } from \"radix-ui\";\nimport {\n ThreadListItemFocusProvider,\n useThreadListCollection,\n} from \"../threadListFocusGroup\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace ThreadListItemPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\nexport const ThreadListItemPrimitiveRoot = forwardRef<\n ThreadListItemPrimitiveRoot.Element,\n ThreadListItemPrimitiveRoot.Props\n>((props, ref) => {\n const isMain = useAuiState(\n (s) => s.threads.mainThreadId === s.threadListItem.id,\n );\n\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const moreRef = useRef<HTMLButtonElement | null>(null);\n const focus = useMemo(() => ({ triggerRef, moreRef }), []);\n\n const getItems = useThreadListCollection(undefined);\n const direction = Direction.useDirection();\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const forwardKey = direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n const backKey = direction === \"rtl\" ? \"ArrowRight\" : \"ArrowLeft\";\n const trigger = triggerRef.current;\n const more = moreRef.current;\n\n if (trigger && event.target === trigger) {\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n const triggers = getItems()\n .map((item) => item.ref.current)\n .filter((node): node is HTMLButtonElement => node !== null);\n const next =\n triggers[\n triggers.indexOf(trigger) + (event.key === \"ArrowDown\" ? 1 : -1)\n ];\n if (next) {\n next.focus();\n event.preventDefault();\n }\n } else if (event.key === forwardKey && more) {\n more.focus();\n event.preventDefault();\n }\n } else if (more && event.target === more && event.key === backKey) {\n trigger?.focus();\n event.preventDefault();\n }\n };\n\n return (\n <ThreadListItemFocusProvider value={focus}>\n <Primitive.div\n {...(isMain ? { \"data-active\": \"true\", \"aria-current\": \"true\" } : null)}\n {...props}\n onKeyDown={composeEventHandlers(props.onKeyDown, onKeyDown)}\n ref={ref}\n />\n </ThreadListItemFocusProvider>\n );\n});\n\nThreadListItemPrimitiveRoot.displayName = \"ThreadListItemPrimitive.Root\";\n"],"mappings":";;;;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AClE,GAAIF;GACJ,WAAWT,qBAAqBS,MAAMgB,WAAWA,SAAS;GACrDf;EAAI,CAAA;CAEgB,CAAA;AAEjC,CAAC;AAEDJ,4BAA4BqC,cAAc"}
1
+ {"version":3,"file":"ThreadListItemRoot.js","names":["Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","KeyboardEvent","useMemo","useRef","useAuiState","composeEventHandlers","Direction","ThreadListItemFocusProvider","useThreadListCollection","PrimitiveDivProps","div","ThreadListItemPrimitiveRoot","Element","Props","props","ref","isMain","s","threads","mainThreadId","threadListItem","id","triggerRef","HTMLButtonElement","moreRef","focus","getItems","undefined","direction","useDirection","onKeyDown","event","HTMLDivElement","forwardKey","backKey","trigger","current","more","target","key","triggers","map","item","filter","node","next","indexOf","preventDefault","displayName"],"sources":["../../../src/primitives/threadListItem/ThreadListItemRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n type KeyboardEvent,\n useMemo,\n useRef,\n} from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport { Direction } from \"radix-ui\";\nimport {\n ThreadListItemFocusProvider,\n useThreadListCollection,\n} from \"../threadListFocusGroup\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace ThreadListItemPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\nexport const ThreadListItemPrimitiveRoot = forwardRef<\n ThreadListItemPrimitiveRoot.Element,\n ThreadListItemPrimitiveRoot.Props\n>((props, ref) => {\n const isMain = useAuiState(\n (s) => s.threads.mainThreadId === s.threadListItem.id,\n );\n\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const moreRef = useRef<HTMLButtonElement | null>(null);\n const focus = useMemo(() => ({ triggerRef, moreRef }), []);\n\n const getItems = useThreadListCollection(undefined);\n const direction = Direction.useDirection();\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const forwardKey = direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n const backKey = direction === \"rtl\" ? \"ArrowRight\" : \"ArrowLeft\";\n const trigger = triggerRef.current;\n const more = moreRef.current;\n\n if (trigger && event.target === trigger) {\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n const triggers = getItems()\n .map((item) => item.ref.current)\n .filter((node): node is HTMLButtonElement => node !== null);\n const next =\n triggers[\n triggers.indexOf(trigger) + (event.key === \"ArrowDown\" ? 1 : -1)\n ];\n if (next) {\n next.focus();\n event.preventDefault();\n }\n } else if (event.key === forwardKey && more) {\n more.focus();\n event.preventDefault();\n }\n } else if (more && event.target === more && event.key === backKey) {\n trigger?.focus();\n event.preventDefault();\n }\n };\n\n return (\n <ThreadListItemFocusProvider value={focus}>\n <Primitive.div\n {...(isMain ? { \"data-active\": \"true\", \"aria-current\": \"true\" } : null)}\n {...props}\n onKeyDown={composeEventHandlers(props.onKeyDown, onKeyDown)}\n ref={ref}\n />\n </ThreadListItemFocusProvider>\n );\n});\n\nThreadListItemPrimitiveRoot.displayName = \"ThreadListItemPrimitive.Root\";\n"],"mappings":";;;;;;;;;AA0BA,MAAac,8BAA8BZ,YAGxCe,OAAOC,QAAQ;CAChB,MAAMC,SAASZ,aACZa,MAAMA,EAAEC,QAAQC,iBAAiBF,EAAEG,eAAeC,EACrD;CAEA,MAAMC,aAAanB,OAAiC,IAAI;CACxD,MAAMqB,UAAUrB,OAAiC,IAAI;CACrD,MAAMsB,QAAQvB,eAAe;EAAEoB;EAAYE;CAAQ,IAAI,CAAA,CAAE;CAEzD,MAAME,WAAWlB,wBAAwBmB,KAAAA,CAAS;CAClD,MAAMC,YAAYtB,UAAUuB,aAAa;CAEzC,MAAMC,aAAaC,UAAyC;EAC1D,MAAME,aAAaL,cAAc,QAAQ,cAAc;EACvD,MAAMM,UAAUN,cAAc,QAAQ,eAAe;EACrD,MAAMO,UAAUb,WAAWc;EAC3B,MAAMC,OAAOb,QAAQY;EAErB,IAAID,WAAWJ,MAAMO,WAAWH,SAAS;GACvC,IAAIJ,MAAMQ,QAAQ,eAAeR,MAAMQ,QAAQ,WAAW;IACxD,MAAMC,WAAWd,SAAS,CAAC,CACxBe,KAAKC,SAASA,KAAK3B,IAAIqB,OAAO,CAAC,CAC/BO,QAAQC,SAAoCA,SAAS,IAAI;IAC5D,MAAMC,OACJL,SACEA,SAASM,QAAQX,OAAO,KAAKJ,MAAMQ,QAAQ,cAAc,IAAI;IAEjE,IAAIM,MAAM;KACRA,KAAKpB,MAAM;KACXM,MAAMgB,eAAe;IACvB;GACF,OAAO,IAAIhB,MAAMQ,QAAQN,cAAcI,MAAM;IAC3CA,KAAKZ,MAAM;IACXM,MAAMgB,eAAe;GACvB;EACF,OAAO,IAAIV,QAAQN,MAAMO,WAAWD,QAAQN,MAAMQ,QAAQL,SAAS;GACjEC,SAASV,MAAM;GACfM,MAAMgB,eAAe;EACvB;CACF;CAEA,OACE,oBAAC,6BAAD;EAA6B,OAAOtB;EAClC,UAAA,oBAAC,YAAU,KAAX;GACE,GAAKT,SAAS;IAAE,eAAe;IAAQ,gBAAgB;GAAO,IAAI;GAClE,GAAIF;GACJ,WAAWT,qBAAqBS,MAAMgB,WAAWA,SAAS;GACrDf;EAAI,CAAA;CAEgB,CAAA;AAEjC,CAAC;AAEDJ,4BAA4BqC,cAAc"}
@@ -5,7 +5,7 @@ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
5
5
  import { useThreadListItemTrigger } from "@assistant-ui/core/react";
6
6
  import { forwardRef } from "@assistant-ui/tap/react-shim";
7
7
  import { jsx } from "react/jsx-runtime";
8
- import { useComposedRefs } from "@radix-ui/react-compose-refs";
8
+ import { useComposedRefs } from "radix-ui/internal";
9
9
  //#region src/primitives/threadListItem/ThreadListItemTrigger.tsx
10
10
  const useThreadListItemTrigger$1 = () => {
11
11
  const { switchTo } = useThreadListItemTrigger();
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemTrigger.js","names":["c","_c","forwardRef","useComposedRefs","ActionButtonElement","ActionButtonProps","createActionButton","useThreadListItemTrigger","useThreadListItemTriggerBehavior","ThreadListCollection","useThreadListItemFocus","switchTo","ThreadListItemPrimitiveTrigger","Element","Props","ThreadListItemTriggerButton","props","forwardedRef","$","focus","ref","triggerRef","t0","undefined","displayName"],"sources":["../../../src/primitives/threadListItem/ThreadListItemTrigger.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadListItemTrigger as useThreadListItemTriggerBehavior } from \"@assistant-ui/core/react\";\nimport {\n ThreadListCollection,\n useThreadListItemFocus,\n} from \"../threadListFocusGroup\";\n\nconst useThreadListItemTrigger = () => {\n const { switchTo } = useThreadListItemTriggerBehavior();\n return switchTo;\n};\n\nexport namespace ThreadListItemPrimitiveTrigger {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadListItemTrigger>;\n}\n\nconst ThreadListItemTriggerButton = createActionButton(\n \"ThreadListItemPrimitive.Trigger\",\n useThreadListItemTrigger,\n);\n\nexport const ThreadListItemPrimitiveTrigger = forwardRef<\n ThreadListItemPrimitiveTrigger.Element,\n ThreadListItemPrimitiveTrigger.Props\n>((props, forwardedRef) => {\n const focus = useThreadListItemFocus();\n const ref = useComposedRefs(forwardedRef, focus?.triggerRef);\n\n return (\n <ThreadListCollection.ItemSlot scope={undefined}>\n <ThreadListItemTriggerButton {...props} ref={ref} />\n </ThreadListCollection.ItemSlot>\n );\n});\n\nThreadListItemPrimitiveTrigger.displayName = \"ThreadListItemPrimitive.Trigger\";\n"],"mappings":";;;;;;;;;AAeA,MAAMO,mCAA2B;CAC/B,MAAA,EAAAI,aAAqBH,yBAAiC;CAAE,OACjDG;AAAQ;AAQjB,MAAMI,8BAA8BT,mBAClC,mCACAC,0BACF;AAEA,MAAaK,iCAAiCV,YAG5Cc,OAAAC,iBAAA;CAAA,MAAAC,IAAAjB,EAAA,CAAA;CACA,MAAAkB,QAAcT,uBAAuB;CACrC,MAAAU,MAAYjB,gBAAgBc,cAAcE,OAAKE,UAAY;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAE,KAAA;EAG3DE,KAAA,oBAAA,qBAAA,UAAA;GAAsCC,OAAAA,KAAAA;GACpC,UAAA,oBAAC,6BAAD;IAA4B,GAAKP;IAAYI;GAAG,CAAA;EAClD,CAAA;EAAgCF,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAFhCI;AAEgC,CAEnC;AAEDV,+BAA+BY,cAAc"}
1
+ {"version":3,"file":"ThreadListItemTrigger.js","names":["c","_c","forwardRef","useComposedRefs","ActionButtonElement","ActionButtonProps","createActionButton","useThreadListItemTrigger","useThreadListItemTriggerBehavior","ThreadListCollection","useThreadListItemFocus","switchTo","ThreadListItemPrimitiveTrigger","Element","Props","ThreadListItemTriggerButton","props","forwardedRef","$","focus","ref","triggerRef","t0","undefined","displayName"],"sources":["../../../src/primitives/threadListItem/ThreadListItemTrigger.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useThreadListItemTrigger as useThreadListItemTriggerBehavior } from \"@assistant-ui/core/react\";\nimport {\n ThreadListCollection,\n useThreadListItemFocus,\n} from \"../threadListFocusGroup\";\n\nconst useThreadListItemTrigger = () => {\n const { switchTo } = useThreadListItemTriggerBehavior();\n return switchTo;\n};\n\nexport namespace ThreadListItemPrimitiveTrigger {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadListItemTrigger>;\n}\n\nconst ThreadListItemTriggerButton = createActionButton(\n \"ThreadListItemPrimitive.Trigger\",\n useThreadListItemTrigger,\n);\n\nexport const ThreadListItemPrimitiveTrigger = forwardRef<\n ThreadListItemPrimitiveTrigger.Element,\n ThreadListItemPrimitiveTrigger.Props\n>((props, forwardedRef) => {\n const focus = useThreadListItemFocus();\n const ref = useComposedRefs(forwardedRef, focus?.triggerRef);\n\n return (\n <ThreadListCollection.ItemSlot scope={undefined}>\n <ThreadListItemTriggerButton {...props} ref={ref} />\n </ThreadListCollection.ItemSlot>\n );\n});\n\nThreadListItemPrimitiveTrigger.displayName = \"ThreadListItemPrimitive.Trigger\";\n"],"mappings":";;;;;;;;;AAeA,MAAMO,mCAA2B;CAC/B,MAAA,EAAAI,aAAqBH,yBAAiC;CAAE,OACjDG;AAAQ;AAQjB,MAAMI,8BAA8BT,mBAClC,mCACAC,0BACF;AAEA,MAAaK,iCAAiCV,YAG5Cc,OAAAC,iBAAA;CAAA,MAAAC,IAAAjB,EAAA,CAAA;CACA,MAAAkB,QAAcT,uBAAuB;CACrC,MAAAU,MAAYjB,gBAAgBc,cAAcE,OAAKE,UAAY;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAF,SAAAE,EAAA,OAAAE,KAAA;EAG3DE,KAAA,oBAAA,qBAAA,UAAA;GAAsCC,OAAAA,KAAAA;GACpC,UAAA,oBAAC,6BAAD;IAA4B,GAAKP;IAAYI;GAAG,CAAA;EAClD,CAAA;EAAgCF,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAFhCI;AAEgC,CAEnC;AAEDV,+BAA+BY,cAAc"}
@@ -6,7 +6,7 @@ import { useThreadListItemMoreSetOpen, useThreadListItemMoreSharedFocusGroup } f
6
6
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
7
7
  import { forwardRef } from "@assistant-ui/tap/react-shim";
8
8
  import { jsx } from "react/jsx-runtime";
9
- import { composeEventHandlers } from "@radix-ui/primitive";
9
+ import { composeEventHandlers } from "radix-ui/internal";
10
10
  import { Direction, DropdownMenu } from "radix-ui";
11
11
  //#region src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx
12
12
  const ThreadListItemMorePrimitiveContent = forwardRef((t0, forwardedRef) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemMoreContent.js","names":["c","_c","ComponentPropsWithoutRef","ComponentRef","forwardRef","Direction","DropdownMenu","DropdownMenuPrimitive","composeEventHandlers","WithRenderPropProps","DropdownMenuRenderContent","useThreadListItemFocus","useThreadListItemMoreSharedFocusGroup","useThreadListItemMoreSetOpen","ScopedProps","useDropdownMenuScope","ThreadListItemMorePrimitiveContent","Element","Content","Props","portalProps","Portal","t0","forwardedRef","$","__scopeThreadListItemMore","sideOffset","t1","props","undefined","scope","setOpen","focus","sharedFocusGroup","direction","useDirection","closeKey","t2","T0","t3","moreRef","event","key","preventDefault","current","t4","onKeyDown","t5","t6","onEscapeKeyDown","t7","t8","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Direction, DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { DropdownMenuRenderContent } from \"../dropdownMenuRenderPrimitives\";\nimport { useThreadListItemFocus } from \"../threadListFocusGroup\";\nimport {\n useThreadListItemMoreSharedFocusGroup,\n useThreadListItemMoreSetOpen,\n} from \"./ThreadListItemMoreRoot\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ThreadListItemMorePrimitiveContent {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Content>;\n export type Props = WithRenderPropProps<\n typeof DropdownMenuPrimitive.Content\n > & {\n portalProps?:\n | ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>\n | undefined;\n };\n}\n\nexport const ThreadListItemMorePrimitiveContent = forwardRef<\n ThreadListItemMorePrimitiveContent.Element,\n ThreadListItemMorePrimitiveContent.Props\n>(\n (\n {\n __scopeThreadListItemMore,\n portalProps,\n sideOffset = 4,\n ...props\n }: ScopedProps<ThreadListItemMorePrimitiveContent.Props>,\n forwardedRef,\n ) => {\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n const setOpen = useThreadListItemMoreSetOpen();\n const focus = useThreadListItemFocus();\n const sharedFocusGroup = useThreadListItemMoreSharedFocusGroup();\n const direction = Direction.useDirection();\n const closeKey = direction === \"rtl\" ? \"ArrowRight\" : \"ArrowLeft\";\n\n return (\n <DropdownMenuPrimitive.Portal {...scope} {...portalProps}>\n <DropdownMenuRenderContent\n {...scope}\n {...props}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (!sharedFocusGroup || event.key !== closeKey) return;\n event.preventDefault();\n setOpen(false);\n focus?.moreRef.current?.focus();\n })}\n onEscapeKeyDown={composeEventHandlers(props.onEscapeKeyDown, () => {\n if (!sharedFocusGroup) return;\n focus?.moreRef.current?.focus();\n })}\n ref={forwardedRef}\n sideOffset={sideOffset}\n />\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\n\nThreadListItemMorePrimitiveContent.displayName =\n \"ThreadListItemMorePrimitive.Content\";\n"],"mappings":";;;;;;;;;;;AA6BA,MAAagB,qCAAqCZ,YAIhDkB,IAAAC,iBAAA;CAAA,MAAAC,IAAAvB,EAAA,EAAA;CACE,MAAA,EAAAwB,2BAAAL,aAAAM,YAAAC,IAAA,GAAAC,UAAAN;CAGE,MAAAI,aAAAC,OAAAE,KAAAA,IAAA,IAAAF;CAKF,MAAAG,QAAcf,qBAAqBU,yBAAyB;CAC5D,MAAAM,UAAgBlB,6BAA6B;CAC7C,MAAAmB,QAAcrB,uBAAuB;CACrC,M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AAA,KAAAc;EAAAd,EAAA,KAAAD;EAAAC,EAAA,MAAAI;EAAAJ,EAAA,MAAAM;EAAAN,EAAA,MAAAE;EAAAF,EAAA,MAAAqB;EAAArB,EAAA,MAAAwB;EAAAxB,EAAA,MAAA0B;CAAA,OAAAA,KAAA1B,EAAA;CAAA,IAAA2B;CAAA,IAAA3B,EAAA,QAAAJ,eAAAI,EAAA,QAAAM,SAAAN,EAAA,QAAAa,GAAAhB,UAAAG,EAAA,QAAA0B,IAAA;EAhBJC,KAAA,oBAAA,GAAA,QAAA;GAAA,GAAkCrB;GAAK,GAAMV;GAC3C8B,UAAAA;EAgBF,CAAA;EAA+B1B,EAAA,MAAAJ;EAAAI,EAAA,MAAAM;EAAAN,EAAA,MAAAa,GAAAhB;EAAAG,EAAA,MAAA0B;EAAA1B,EAAA,MAAA2B;CAAA,OAAAA,KAAA3B,EAAA;CAAA,OAjB/B2B;AAiB+B,CAGrC;AAEAnC,mCAAmCoC,cACjC"}
1
+ {"version":3,"file":"ThreadListItemMoreContent.js","names":["c","_c","ComponentPropsWithoutRef","ComponentRef","forwardRef","Direction","DropdownMenu","DropdownMenuPrimitive","composeEventHandlers","WithRenderPropProps","DropdownMenuRenderContent","useThreadListItemFocus","useThreadListItemMoreSharedFocusGroup","useThreadListItemMoreSetOpen","ScopedProps","useDropdownMenuScope","ThreadListItemMorePrimitiveContent","Element","Content","Props","portalProps","Portal","t0","forwardedRef","$","__scopeThreadListItemMore","sideOffset","t1","props","undefined","scope","setOpen","focus","sharedFocusGroup","direction","useDirection","closeKey","t2","T0","t3","moreRef","event","key","preventDefault","current","t4","onKeyDown","t5","t6","onEscapeKeyDown","t7","t8","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreContent.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Direction, DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { DropdownMenuRenderContent } from \"../dropdownMenuRenderPrimitives\";\nimport { useThreadListItemFocus } from \"../threadListFocusGroup\";\nimport {\n useThreadListItemMoreSharedFocusGroup,\n useThreadListItemMoreSetOpen,\n} from \"./ThreadListItemMoreRoot\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ThreadListItemMorePrimitiveContent {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Content>;\n export type Props = WithRenderPropProps<\n typeof DropdownMenuPrimitive.Content\n > & {\n portalProps?:\n | ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>\n | undefined;\n };\n}\n\nexport const ThreadListItemMorePrimitiveContent = forwardRef<\n ThreadListItemMorePrimitiveContent.Element,\n ThreadListItemMorePrimitiveContent.Props\n>(\n (\n {\n __scopeThreadListItemMore,\n portalProps,\n sideOffset = 4,\n ...props\n }: ScopedProps<ThreadListItemMorePrimitiveContent.Props>,\n forwardedRef,\n ) => {\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n const setOpen = useThreadListItemMoreSetOpen();\n const focus = useThreadListItemFocus();\n const sharedFocusGroup = useThreadListItemMoreSharedFocusGroup();\n const direction = Direction.useDirection();\n const closeKey = direction === \"rtl\" ? \"ArrowRight\" : \"ArrowLeft\";\n\n return (\n <DropdownMenuPrimitive.Portal {...scope} {...portalProps}>\n <DropdownMenuRenderContent\n {...scope}\n {...props}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (!sharedFocusGroup || event.key !== closeKey) return;\n event.preventDefault();\n setOpen(false);\n focus?.moreRef.current?.focus();\n })}\n onEscapeKeyDown={composeEventHandlers(props.onEscapeKeyDown, () => {\n if (!sharedFocusGroup) return;\n focus?.moreRef.current?.focus();\n })}\n ref={forwardedRef}\n sideOffset={sideOffset}\n />\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\n\nThreadListItemMorePrimitive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EAAA;CAHgB,MAAAwB,KAAAxC,qBAAqBoB,MAAKqB,iBAAkBF,EAG5D;CAAC,IAAAG;CAAA,IAAA1B,EAAA,OAAAc,MAAAd,EAAA,OAAAD,gBAAAC,EAAA,QAAAI,SAAAJ,EAAA,QAAAM,SAAAN,EAAA,QAAAE,cAAAF,EAAA,QAAAqB,MAAArB,EAAA,QAAAwB,IAAA;EAZJE,KAAA,oBAAC,IAAD;GAA0B,GACpBpB;GAAK,GACLF;GACO,WAAAiB;GAMM,iBAAAG;GAIZzB,KAAAA;GACOG;EAAU,CAAA;EACtBF,EAAA,KAAAc;EAAAd,EAAA,KAAAD;EAAAC,EAAA,MAAAI;EAAAJ,EAAA,MAAAM;EAAAN,EAAA,MAAAE;EAAAF,EAAA,MAAAqB;EAAArB,EAAA,MAAAwB;EAAAxB,EAAA,MAAA0B;CAAA,OAAAA,KAAA1B,EAAA;CAAA,IAAA2B;CAAA,IAAA3B,EAAA,QAAAJ,eAAAI,EAAA,QAAAM,SAAAN,EAAA,QAAAa,GAAAhB,UAAAG,EAAA,QAAA0B,IAAA;EAhBJC,KAAA,oBAAA,GAAA,QAAA;GAAA,GAAkCrB;GAAK,GAAMV;GAC3C8B,UAAAA;EAgBF,CAAA;EAA+B1B,EAAA,MAAAJ;EAAAI,EAAA,MAAAM;EAAAN,EAAA,MAAAa,GAAAhB;EAAAG,EAAA,MAAA0B;EAAA1B,EAAA,MAAA2B;CAAA,OAAAA,KAAA3B,EAAA;CAAA,OAjB/B2B;AAiB+B,CAGrC;AAEAnC,mCAAmCoC,cACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemMoreItem.js","names":["c","_c","ComponentRef","forwardRef","DropdownMenu","DropdownMenuPrimitive","WithRenderPropProps","DropdownMenuRenderItem","ScopedProps","useDropdownMenuScope","ThreadListItemMorePrimitiveItem","Element","Item","Props","t0","ref","$","__scopeThreadListItemMore","rest","scope","t1","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreItem.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentRef, forwardRef } from \"react\";\nimport type { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { DropdownMenuRenderItem } from \"../dropdownMenuRenderPrimitives\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ThreadListItemMorePrimitiveItem {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Item>;\n export type Props = WithRenderPropProps<typeof DropdownMenuPrimitive.Item>;\n}\n\nexport const ThreadListItemMorePrimitiveItem = forwardRef<\n ThreadListItemMorePrimitiveItem.Element,\n ThreadListItemMorePrimitiveItem.Props\n>(\n (\n {\n __scopeThreadListItemMore,\n ...rest\n }: ScopedProps<ThreadListItemMorePrimitiveItem.Props>,\n ref,\n ) => {\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n\n return <DropdownMenuRenderItem {...scope} {...rest} ref={ref} />;\n },\n);\n\nThreadListItemMorePrimitiveItem.displayName =\n \"ThreadListItemMorePrimitive.Item\";\n"],"mappings":";;;;;;;AAaA,MAAaU,kCAAkCP,YAI7CW,IAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,8BAAAC,QAAAJ;EAGqDE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,4BAAAD,EAAA;EAAAE,OAAAF,EAAA;CAAA;CAGrD,MAAAG,QAAcV,qBAAqBQ,yBAAyB;CAAE,IAAAG;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAAF,EAAA,OAAAG,OAAA;EAEvDC,KAAA,oBAAC,wBAAD;GAAuB,GAAKD;GAAK,GAAMD;GAAWH;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAAzDI;AAAyD,CAEpE;AAEAV,gCAAgCW,cAC9B"}
1
+ {"version":3,"file":"ThreadListItemMoreItem.js","names":["c","_c","ComponentRef","forwardRef","DropdownMenu","DropdownMenuPrimitive","WithRenderPropProps","DropdownMenuRenderItem","ScopedProps","useDropdownMenuScope","ThreadListItemMorePrimitiveItem","Element","Item","Props","t0","ref","$","__scopeThreadListItemMore","rest","scope","t1","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreItem.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentRef, forwardRef } from \"react\";\nimport type { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { DropdownMenuRenderItem } from \"../dropdownMenuRenderPrimitives\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ThreadListItemMorePrimitiveItem {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Item>;\n export type Props = WithRenderPropProps<typeof DropdownMenuPrimitive.Item>;\n}\n\nexport const ThreadListItemMorePrimitiveItem = forwardRef<\n ThreadListItemMorePrimitiveItem.Element,\n ThreadListItemMorePrimitiveItem.Props\n>(\n (\n {\n __scopeThreadListItemMore,\n ...rest\n }: ScopedProps<ThreadListItemMorePrimitiveItem.Props>,\n ref,\n ) => {\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n\n return <DropdownMenuRenderItem {...scope} {...rest} ref={ref} />;\n },\n);\n\nThreadListItemMorePrimitiveItem.displayName =\n \"ThreadListItemMorePrimitive.Item\";\n"],"mappings":";;;;;;;AAaA,MAAaU,kCAAkCP,YAI7CW,IAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,2BAAA,GAAAC,QAAAJ;EAGqDE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,4BAAAD,EAAA;EAAAE,OAAAF,EAAA;CAAA;CAGrD,MAAAG,QAAcV,qBAAqBQ,yBAAyB;CAAE,IAAAG;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAAF,EAAA,OAAAG,OAAA;EAEvDC,KAAA,oBAAC,wBAAD;GAAuB,GAAKD;GAAK,GAAMD;GAAWH;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAAzDI;AAAyD,CAEpE;AAEAV,gCAAgCW,cAC9B"}
@@ -3,8 +3,8 @@ import { useDropdownMenuScope } from "./scope.js";
3
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
4
  import { createContext, useContext } from "@assistant-ui/tap/react-shim";
5
5
  import { jsx } from "react/jsx-runtime";
6
+ import { useControllableState } from "radix-ui/internal";
6
7
  import { DropdownMenu } from "radix-ui";
7
- import { useControllableState } from "@radix-ui/react-use-controllable-state";
8
8
  //#region src/primitives/threadListItemMore/ThreadListItemMoreRoot.tsx
9
9
  const ThreadListItemMoreSetOpenContext = createContext(() => {});
10
10
  const useThreadListItemMoreSetOpen = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemMoreRoot.js","names":["c","_c","createContext","Dispatch","FC","SetStateAction","useContext","DropdownMenu","DropdownMenuPrimitive","useControllableState","ScopedProps","useDropdownMenuScope","ThreadListItemMoreSetOpenContext","useThreadListItemMoreSetOpen","ThreadListItemMoreSharedFocusGroupContext","useThreadListItemMoreSharedFocusGroup","ThreadListItemMorePrimitiveRoot","Props","DropdownMenuProps","sharedFocusGroup","t0","$","__scopeThreadListItemMore","defaultOpen","modalProp","onOpenChange","openProp","rest","t1","open","modal","undefined","scope","t2","t3","onChange","t4","prop","defaultProp","caller","setOpen","t5","t6","t7","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n type Dispatch,\n type FC,\n type SetStateAction,\n useContext,\n} from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nconst ThreadListItemMoreSetOpenContext = createContext<\n Dispatch<SetStateAction<boolean>>\n>(() => {});\n\nexport const useThreadListItemMoreSetOpen = (): Dispatch<\n SetStateAction<boolean>\n> => useContext(ThreadListItemMoreSetOpenContext);\n\nconst ThreadListItemMoreSharedFocusGroupContext = createContext(false);\n\nexport const useThreadListItemMoreSharedFocusGroup = (): boolean =>\n useContext(ThreadListItemMoreSharedFocusGroupContext);\n\nexport namespace ThreadListItemMorePrimitiveRoot {\n export type Props = DropdownMenuPrimitive.DropdownMenuProps & {\n /**\n * Join the menu to the thread list's focus group: Right opens it, Left/Escape\n * close it and return focus to the trigger (mirrored in RTL). Forces the menu\n * non-modal, since a focus trap can't let focus cross the trigger/menu\n * boundary. Defaults to a standalone modal dropdown.\n */\n sharedFocusGroup?: boolean | undefined;\n };\n}\n\n/**\n * Root container for the overflow menu, built on Radix DropdownMenu.\n *\n * Defaults to a standard, self-contained modal dropdown. Pass\n * {@link ThreadListItemMorePrimitiveRoot.Props.sharedFocusGroup} to fold it into\n * the thread list's keyboard navigation instead.\n */\nexport const ThreadListItemMorePrimitiveRoot: FC<\n ThreadListItemMorePrimitiveRoot.Props\n> = ({\n __scopeThreadListItemMore,\n open: openProp,\n defaultOpen,\n onOpenChange,\n sharedFocusGroup = false,\n modal: modalProp,\n ...rest\n}: ScopedProps<ThreadListItemMorePrimitiveRoot.Props>) => {\n const modal = sharedFocusGroup ? false : (modalProp ?? true);\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n caller: \"ThreadListItemMorePrimitive.Root\",\n ...(onOpenChange ? { onChange: onOpenChange } : {}),\n });\n\n return (\n <ThreadListItemMoreSharedFocusGroupContext.Provider\n value={sharedFocusGroup}\n >\n <ThreadListItemMoreSetOpenContext.Provider value={setOpen}>\n <DropdownMenuPrimitive.Root\n {...scope}\n {...rest}\n modal={modal}\n open={open}\n onOpenChange={setOpen}\n />\n </ThreadListItemMoreSetOpenContext.Provider>\n </ThreadListItemMoreSharedFocusGroupContext.Provider>\n );\n};\n\nThreadListItemMorePrimitiveRoot.displayName =\n \"ThreadListItemMorePrimitive.Root\";\n"],"mappings":";;;;;;;;AAaA,MAAMY,mCAAmCV,oBAEjC,CAAC,CAAC;AAEV,MAAaW,qCAA+B;CAAA,OAEvCP,WAAWM,gCAAgC;AAAC;AAEjD,MAAME,4CAA4CZ,cAAc,KAAK;AAErE,MAAaa,8CAAwC;CAAA,OACnDT,WAAWQ,yCAAyC;AAAC;;;;;;;;AAqBvD,MAAaE,mCAETI,OAAA;CAAA,MAAAC,IAAApB,EAAA,EAAA;CAAA,IAAAqB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAE,2BAAAO,MAAAH,UAAAH,aAAAE,cAAAN,kBAAAS,IAAAE,OAAAN,cAAAG,QAAAP;EAQgDC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAA;EAAAN,4BAAAD,EAAA;EAAAE,cAAAF,EAAA;EAAAG,YAAAH,EAAA;EAAAI,eAAAJ,EAAA;EAAAK,WAAAL,EAAA;EAAAM,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CpB,EAAA,MAAAmB;EAAAnB,EAAA,MAAAoB;EAAApB,EAAA,MAAAqB;CAAA,OAAAA,KAAArB,EAAA;CAAA,IAAAsB;CAAA,IAAAtB,EAAA,QAAAF,oBAAAE,EAAA,QAAAqB,IAAA;EAX9CC,KAAA,oBAAA,0CAAA,UAAA;GACSxB,OAAAA;GAEPuB,UAAAA;EASF,CAAA;EAAqDrB,EAAA,MAAAF;EAAAE,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;CAAA,OAAAA,KAAAtB,EAAA;CAAA,OAZrDsB;AAYqD;AAIzD3B,gCAAgC4B,cAC9B"}
1
+ {"version":3,"file":"ThreadListItemMoreRoot.js","names":["c","_c","createContext","Dispatch","FC","SetStateAction","useContext","DropdownMenu","DropdownMenuPrimitive","useControllableState","ScopedProps","useDropdownMenuScope","ThreadListItemMoreSetOpenContext","useThreadListItemMoreSetOpen","ThreadListItemMoreSharedFocusGroupContext","useThreadListItemMoreSharedFocusGroup","ThreadListItemMorePrimitiveRoot","Props","DropdownMenuProps","sharedFocusGroup","t0","$","__scopeThreadListItemMore","defaultOpen","modalProp","onOpenChange","openProp","rest","t1","open","modal","undefined","scope","t2","t3","onChange","t4","prop","defaultProp","caller","setOpen","t5","t6","t7","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n type Dispatch,\n type FC,\n type SetStateAction,\n useContext,\n} from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { useControllableState } from \"radix-ui/internal\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nconst ThreadListItemMoreSetOpenContext = createContext<\n Dispatch<SetStateAction<boolean>>\n>(() => {});\n\nexport const useThreadListItemMoreSetOpen = (): Dispatch<\n SetStateAction<boolean>\n> => useContext(ThreadListItemMoreSetOpenContext);\n\nconst ThreadListItemMoreSharedFocusGroupContext = createContext(false);\n\nexport const useThreadListItemMoreSharedFocusGroup = (): boolean =>\n useContext(ThreadListItemMoreSharedFocusGroupContext);\n\nexport namespace ThreadListItemMorePrimitiveRoot {\n export type Props = DropdownMenuPrimitive.DropdownMenuProps & {\n /**\n * Join the menu to the thread list's focus group: Right opens it, Left/Escape\n * close it and return focus to the trigger (mirrored in RTL). Forces the menu\n * non-modal, since a focus trap can't let focus cross the trigger/menu\n * boundary. Defaults to a standalone modal dropdown.\n */\n sharedFocusGroup?: boolean | undefined;\n };\n}\n\n/**\n * Root container for the overflow menu, built on Radix DropdownMenu.\n *\n * Defaults to a standard, self-contained modal dropdown. Pass\n * {@link ThreadListItemMorePrimitiveRoot.Props.sharedFocusGroup} to fold it into\n * the thread list's keyboard navigation instead.\n */\nexport const ThreadListItemMorePrimitiveRoot: FC<\n ThreadListItemMorePrimitiveRoot.Props\n> = ({\n __scopeThreadListItemMore,\n open: openProp,\n defaultOpen,\n onOpenChange,\n sharedFocusGroup = false,\n modal: modalProp,\n ...rest\n}: ScopedProps<ThreadListItemMorePrimitiveRoot.Props>) => {\n const modal = sharedFocusGroup ? false : (modalProp ?? true);\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n caller: \"ThreadListItemMorePrimitive.Root\",\n ...(onOpenChange ? { onChange: onOpenChange } : {}),\n });\n\n return (\n <ThreadListItemMoreSharedFocusGroupContext.Provider\n value={sharedFocusGroup}\n >\n <ThreadListItemMoreSetOpenContext.Provider value={setOpen}>\n <DropdownMenuPrimitive.Root\n {...scope}\n {...rest}\n modal={modal}\n open={open}\n onOpenChange={setOpen}\n />\n </ThreadListItemMoreSetOpenContext.Provider>\n </ThreadListItemMoreSharedFocusGroupContext.Provider>\n );\n};\n\nThreadListItemMorePrimitiveRoot.displayName =\n \"ThreadListItemMorePrimitive.Root\";\n"],"mappings":";;;;;;;;AAaA,MAAMY,mCAAmCV,oBAEjC,CAAC,CAAC;AAEV,MAAaW,qCA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M,QACzB;GAAkC,GACtCL;EACN;EAACb,EAAA,MAAAK;EAAAL,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CALD,MAAA,CAAAQ,MAAAW,WAAwB/B,qBAAqB2B,EAK5C;CAAE,IAAAK;CAAA,IAAApB,EAAA,QAAAS,SAAAT,EAAA,QAAAQ,QAAAR,EAAA,QAAAM,QAAAN,EAAA,QAAAW,SAAAX,EAAA,QAAAmB,SAAA;EAOGC,KAAA,oBAAA,aAAA,MAAA;GAAA,GACMT;GAAK,GACLL;GACGG;GACDD;GACQW,cAAAA;EAAO,CAAA;EACrBnB,EAAA,MAAAS;EAAAT,EAAA,MAAAQ;EAAAR,EAAA,MAAAM;EAAAN,EAAA,MAAAW;EAAAX,EAAA,MAAAmB;EAAAnB,EAAA,MAAAoB;CAAA,OAAAA,KAAApB,EAAA;CAAA,IAAAqB;CAAA,IAAArB,EAAA,QAAAmB,WAAAnB,EAAA,QAAAoB,IAAA;EAPJC,KAAA,oBAAA,iCAAA,UAAA;GAAkDF,OAAAA;GAChDC,UAAAA;EAOF,CAAA;EAA4CpB,EAAA,MAAAmB;EAAAnB,EAAA,MAAAoB;EAAApB,EAAA,MAAAqB;CAAA,OAAAA,KAAArB,EAAA;CAAA,IAAAsB;CAAA,IAAAtB,EAAA,QAAAF,oBAAAE,EAAA,QAAAqB,IAAA;EAX9CC,KAAA,oBAAA,0CAAA,UAAA;GACSxB,OAAAA;GAEPuB,UAAAA;EASF,CAAA;EAAqDrB,EAAA,MAAAF;EAAAE,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;CAAA,OAAAA,KAAAtB,EAAA;CAAA,OAZrDsB;AAYqD;AAIzD3B,gCAAgC4B,cAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemMoreSeparator.js","names":["c","_c","ComponentRef","forwardRef","DropdownMenu","DropdownMenuPrimitive","WithRenderPropProps","DropdownMenuRenderSeparator","ScopedProps","useDropdownMenuScope","ThreadListItemMorePrimitiveSeparator","Element","Separator","Props","t0","ref","$","__scopeThreadListItemMore","rest","scope","t1","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreSeparator.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentRef, forwardRef } from \"react\";\nimport type { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { DropdownMenuRenderSeparator } from \"../dropdownMenuRenderPrimitives\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ThreadListItemMorePrimitiveSeparator {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Separator>;\n export type Props = WithRenderPropProps<\n typeof DropdownMenuPrimitive.Separator\n >;\n}\n\nexport const ThreadListItemMorePrimitiveSeparator = forwardRef<\n ThreadListItemMorePrimitiveSeparator.Element,\n ThreadListItemMorePrimitiveSeparator.Props\n>(\n (\n {\n __scopeThreadListItemMore,\n ...rest\n }: ScopedProps<ThreadListItemMorePrimitiveSeparator.Props>,\n ref,\n ) => {\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n\n return <DropdownMenuRenderSeparator {...scope} {...rest} ref={ref} />;\n },\n);\n\nThreadListItemMorePrimitiveSeparator.displayName =\n \"ThreadListItemMorePrimitive.Separator\";\n"],"mappings":";;;;;;;AAeA,MAAaU,uCAAuCP,YAIlDW,IAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,8BAAAC,QAAAJ;EAG0DE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,4BAAAD,EAAA;EAAAE,OAAAF,EAAA;CAAA;CAG1D,MAAAG,QAAcV,qBAAqBQ,yBAAyB;CAAE,IAAAG;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAAF,EAAA,OAAAG,OAAA;EAEvDC,KAAA,oBAAC,6BAAD;GAA4B,GAAKD;GAAK,GAAMD;GAAWH;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAA9DI;AAA8D,CAEzE;AAEAV,qCAAqCW,cACnC"}
1
+ {"version":3,"file":"ThreadListItemMoreSeparator.js","names":["c","_c","ComponentRef","forwardRef","DropdownMenu","DropdownMenuPrimitive","WithRenderPropProps","DropdownMenuRenderSeparator","ScopedProps","useDropdownMenuScope","ThreadListItemMorePrimitiveSeparator","Element","Separator","Props","t0","ref","$","__scopeThreadListItemMore","rest","scope","t1","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreSeparator.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentRef, forwardRef } from \"react\";\nimport type { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { DropdownMenuRenderSeparator } from \"../dropdownMenuRenderPrimitives\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ThreadListItemMorePrimitiveSeparator {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Separator>;\n export type Props = WithRenderPropProps<\n typeof DropdownMenuPrimitive.Separator\n >;\n}\n\nexport const ThreadListItemMorePrimitiveSeparator = forwardRef<\n ThreadListItemMorePrimitiveSeparator.Element,\n ThreadListItemMorePrimitiveSeparator.Props\n>(\n (\n {\n __scopeThreadListItemMore,\n ...rest\n }: ScopedProps<ThreadListItemMorePrimitiveSeparator.Props>,\n ref,\n ) => {\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n\n return <DropdownMenuRenderSeparator {...scope} {...rest} ref={ref} />;\n },\n);\n\nThreadListItemMorePrimitiveSeparator.displayName =\n \"ThreadListItemMorePrimitive.Separator\";\n"],"mappings":";;;;;;;AAeA,MAAaU,uCAAuCP,YAIlDW,IAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,2BAAA,GAAAC,QAAAJ;EAG0DE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,4BAAAD,EAAA;EAAAE,OAAAF,EAAA;CAAA;CAG1D,MAAAG,QAAcV,qBAAqBQ,yBAAyB;CAAE,IAAAG;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAAF,EAAA,OAAAG,OAAA;EAEvDC,KAAA,oBAAC,6BAAD;GAA4B,GAAKD;GAAK,GAAMD;GAAWH;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAA9DI;AAA8D,CAEzE;AAEAV,qCAAqCW,cACnC"}
@@ -6,8 +6,7 @@ import { useThreadListItemMoreSetOpen, useThreadListItemMoreSharedFocusGroup } f
6
6
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
7
7
  import { forwardRef } from "@assistant-ui/tap/react-shim";
8
8
  import { jsx } from "react/jsx-runtime";
9
- import { useComposedRefs } from "@radix-ui/react-compose-refs";
10
- import { composeEventHandlers } from "@radix-ui/primitive";
9
+ import { composeEventHandlers, useComposedRefs } from "radix-ui/internal";
11
10
  import { Direction } from "radix-ui";
12
11
  //#region src/primitives/threadListItemMore/ThreadListItemMoreTrigger.tsx
13
12
  const ThreadListItemMorePrimitiveTrigger = forwardRef((t0, ref) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemMoreTrigger.js","names":["c","_c","ComponentRef","forwardRef","Direction","DropdownMenu","DropdownMenuPrimitive","useComposedRefs","composeEventHandlers","WithRenderPropProps","DropdownMenuRenderTrigger","useThreadListItemFocus","useThreadListItemMoreSharedFocusGroup","useThreadListItemMoreSetOpen","ScopedProps","useDropdownMenuScope","ThreadListItemMorePrimitiveTrigger","Element","Trigger","Props","t0","ref","$","__scopeThreadListItemMore","rest","scope","focus","setOpen","sharedFocusGroup","composedRef","moreRef","direction","useDirection","openKey","T0","t1","event","key","preventDefault","t2","onKeyDown","t3","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreTrigger.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentRef, forwardRef } from \"react\";\nimport {\n Direction,\n type DropdownMenu as DropdownMenuPrimitive,\n} from \"radix-ui\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { DropdownMenuRenderTrigger } from \"../dropdownMenuRenderPrimitives\";\nimport { useThreadListItemFocus } from \"../threadListFocusGroup\";\nimport {\n useThreadListItemMoreSharedFocusGroup,\n useThreadListItemMoreSetOpen,\n} from \"./ThreadListItemMoreRoot\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ThreadListItemMorePrimitiveTrigger {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Trigger>;\n export type Props = WithRenderPropProps<typeof DropdownMenuPrimitive.Trigger>;\n}\n\nexport const ThreadListItemMorePrimitiveTrigger = forwardRef<\n ThreadListItemMorePrimitiveTrigger.Element,\n ThreadListItemMorePrimitiveTrigger.Props\n>(\n (\n {\n __scopeThreadListItemMore,\n ...rest\n }: ScopedProps<ThreadListItemMorePrimitiveTrigger.Props>,\n ref,\n ) => {\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n const focus = useThreadListItemFocus();\n const setOpen = useThreadListItemMoreSetOpen();\n const sharedFocusGroup = useThreadListItemMoreSharedFocusGroup();\n const composedRef = useComposedRefs(ref, focus?.moreRef);\n const direction = Direction.useDirection();\n const openKey = direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n\n return (\n <DropdownMenuRenderTrigger\n {...scope}\n {...rest}\n onKeyDown={composeEventHandlers(rest.onKeyDown, (event) => {\n if (!sharedFocusGroup || event.key !== openKey) return;\n event.preventDefault();\n setOpen(true);\n })}\n ref={composedRef}\n />\n );\n },\n);\n\nThreadListItemMorePrimitiveTrigger.displayName =\n \"ThreadListItemMorePrimitive.Trigger\";\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAagB,qCAAqCb,YAIhDiB,IAAAC,QAAA;CAAA,MAAAC,IAAArB,EAAA,EAAA;CACE,MAAA,EAAAsB,2BAAA,GAAAC,SAAAJ;CAMA,MAAAK,QAAcV,qBAAqBQ,yBAAyB;CAC5D,MAAAG,QAAcf,uBAAuB;CACrC,MAAAgB,UAAgBd,6BAA6B;CAC7C,MAAAe,mBAAyBhB,sCAAsC;CAC/D,MAAAiB,cAAoBtB,gBAAgBc,KAAKK,OAAKI,OAAS;CAEvD,MAAAG,UADkB7B,UAAS4B,aACXD,MAAc,QAAd,cAAA;CAGb,MAAAG,KAAAxB;CAAyB,IAAAyB;CAAA,IAAAb,EAAA,OAAAW,WAAAX,EAAA,OAAAK,WAAAL,EAAA,OAAAM,kBAAA;EAGwBO,MAAAC,UAAA;GAC9C,IAAI,CAACR,oBAAoBQ,MAAKC,QAASJ,SAAO;GAC9CG,MAAKE,eAAgB;GACrBX,QAAQ,IAAI;EAAC;EACdL,EAAA,KAAAW;EAAAX,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAJU,MAAAiB,KAAA/B,qBAAqBgB,KAAIgB,WAAYL,EAI/C;CAAC,IAAAM;CAAA,IAAAnB,EAAA,OAAAY,MAAAZ,EAAA,OAAAO,eAAAP,EAAA,OAAAE,QAAAF,EAAA,OAAAG,SAAAH,EAAA,OAAAiB,IAAA;EAPJE,KAAA,oBAAC,IAAD;GAA0B,GACpBhB;GAAK,GACLD;GACO,WAAAe;GAKNV,KAAAA;EAAW,CAAA;EAChBP,EAAA,KAAAY;EAAAZ,EAAA,KAAAO;EAAAP,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAiB;EAAAjB,EAAA,KAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OATFmB;AASE,CAGR;AAEAzB,mCAAmC0B,cACjC"}
1
+ {"version":3,"file":"ThreadListItemMoreTrigger.js","names":["c","_c","ComponentRef","forwardRef","Direction","DropdownMenu","DropdownMenuPrimitive","useComposedRefs","composeEventHandlers","WithRenderPropProps","DropdownMenuRenderTrigger","useThreadListItemFocus","useThreadListItemMoreSharedFocusGroup","useThreadListItemMoreSetOpen","ScopedProps","useDropdownMenuScope","ThreadListItemMorePrimitiveTrigger","Element","Trigger","Props","t0","ref","$","__scopeThreadListItemMore","rest","scope","focus","setOpen","sharedFocusGroup","composedRef","moreRef","direction","useDirection","openKey","T0","t1","event","key","preventDefault","t2","onKeyDown","t3","displayName"],"sources":["../../../src/primitives/threadListItemMore/ThreadListItemMoreTrigger.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentRef, forwardRef } from \"react\";\nimport {\n Direction,\n type DropdownMenu as DropdownMenuPrimitive,\n} from \"radix-ui\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { DropdownMenuRenderTrigger } from \"../dropdownMenuRenderPrimitives\";\nimport { useThreadListItemFocus } from \"../threadListFocusGroup\";\nimport {\n useThreadListItemMoreSharedFocusGroup,\n useThreadListItemMoreSetOpen,\n} from \"./ThreadListItemMoreRoot\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ThreadListItemMorePrimitiveTrigger {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Trigger>;\n export type Props = WithRenderPropProps<typeof DropdownMenuPrimitive.Trigger>;\n}\n\nexport const ThreadListItemMorePrimitiveTrigger = forwardRef<\n ThreadListItemMorePrimitiveTrigger.Element,\n ThreadListItemMorePrimitiveTrigger.Props\n>(\n (\n {\n __scopeThreadListItemMore,\n ...rest\n }: ScopedProps<ThreadListItemMorePrimitiveTrigger.Props>,\n ref,\n ) => {\n const scope = useDropdownMenuScope(__scopeThreadListItemMore);\n const focus = useThreadListItemFocus();\n const setOpen = useThreadListItemMoreSetOpen();\n const sharedFocusGroup = useThreadListItemMoreSharedFocusGroup();\n const composedRef = useComposedRefs(ref, focus?.moreRef);\n const direction = Direction.useDirection();\n const openKey = direction === \"rtl\" ? \"ArrowLeft\" : \"ArrowRight\";\n\n return (\n <DropdownMenuRenderTrigger\n {...scope}\n {...rest}\n onKeyDown={composeEventHandlers(rest.onKeyDown, (event) => {\n if (!sharedFocusGroup || event.key !== openKey) return;\n event.preventDefault();\n setOpen(true);\n })}\n ref={composedRef}\n />\n );\n },\n);\n\nThreadListItemMorePrimitiveTrigger.displayName =\n \"ThreadListItemMorePrimitive.Trigger\";\n"],"mappings":";;;;;;;;;;;AAuBA,MAAagB,qCAAqCb,YAIhDiB,IAAAC,QAAA;CAAA,MAAAC,IAAArB,EAAA,EAAA;CACE,MAAA,EAAAsB,2BAAA,GAAAC,SAAAJ;CAMA,MAAAK,QAAcV,qBAAqBQ,yBAAyB;CAC5D,MAAAG,QAAcf,uBAAuB;CACrC,MAAAgB,UAAgBd,6BAA6B;CAC7C,MAAAe,mBAAyBhB,sCAAsC;CAC/D,MAAAiB,cAAoBtB,gBAAgBc,KAAKK,OAAKI,OAAS;CAEvD,MAAAG,UADkB7B,UAAS4B,aACXD,MAAc,QAAd,cAAA;CAGb,MAAAG,KAAAxB;CAAyB,IAAAyB;CAAA,IAAAb,EAAA,OAAAW,WAAAX,EAAA,OAAAK,WAAAL,EAAA,OAAAM,kBAAA;EAGwBO,MAAAC,UAAA;GAC9C,IAAI,CAACR,oBAAoBQ,MAAKC,QAASJ,SAAO;GAC9CG,MAAKE,eAAgB;GACrBX,QAAQ,IAAI;EAAC;EACdL,EAAA,KAAAW;EAAAX,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAJU,MAAAiB,KAAA/B,qBAAqBgB,KAAIgB,WAAYL,EAI/C;CAAC,IAAAM;CAAA,IAAAnB,EAAA,OAAAY,MAAAZ,EAAA,OAAAO,eAAAP,EAAA,OAAAE,QAAAF,EAAA,OAAAG,SAAAH,EAAA,OAAAiB,IAAA;EAPJE,KAAA,oBAAC,IAAD;GAA0B,GACpBhB;GAAK,GACLD;GACO,WAAAe;GAKNV,KAAAA;EAAW,CAAA;EAChBP,EAAA,KAAAY;EAAAZ,EAAA,KAAAO;EAAAP,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAiB;EAAAjB,EAAA,KAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OATFmB;AASE,CAGR;AAEAzB,mCAAmC0B,cACjC"}
@@ -1,9 +1,9 @@
1
+ import { Context } from "radix-ui/internal";
1
2
  import { DropdownMenu } from "radix-ui";
2
- import { Scope } from "@radix-ui/react-context";
3
3
  //#region src/primitives/threadListItemMore/scope.d.ts
4
4
  declare const useDropdownMenuScope: ReturnType<typeof DropdownMenu.createDropdownMenuScope>;
5
5
  type ScopedProps<P> = P & {
6
- __scopeThreadListItemMore?: Scope;
6
+ __scopeThreadListItemMore?: Context.Scope;
7
7
  };
8
8
  //#endregion
9
9
  export { ScopedProps, useDropdownMenuScope };
@@ -1 +1 @@
1
- {"version":3,"file":"scope.d.ts","names":[],"sources":["../../../src/primitives/threadListItemMore/scope.ts"],"mappings":";;;cAGa,sBAAsB,kBAC1B,aAAsB;KAGnB,YAAY,KAAK;EAAM,4BAA4B"}
1
+ {"version":3,"file":"scope.d.ts","names":[],"sources":["../../../src/primitives/threadListItemMore/scope.ts"],"mappings":";;;cAGa,sBAAsB,kBAC1B,aAAsB;KAGnB,YAAY,KAAK;EAAM,4BAA4B,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"scope.js","names":["DropdownMenu","DropdownMenuPrimitive","Scope","useDropdownMenuScope","ReturnType","createDropdownMenuScope","ScopedProps","P","__scopeThreadListItemMore"],"sources":["../../../src/primitives/threadListItemMore/scope.ts"],"sourcesContent":["import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type { Scope } from \"@radix-ui/react-context\";\n\nexport const useDropdownMenuScope: ReturnType<\n typeof DropdownMenuPrimitive.createDropdownMenuScope\n> = DropdownMenuPrimitive.createDropdownMenuScope();\n\nexport type ScopedProps<P> = P & { __scopeThreadListItemMore?: Scope };\n"],"mappings":";;AAGA,MAAaG,uBAETF,aAAsBI,wBAAwB"}
1
+ {"version":3,"file":"scope.js","names":["DropdownMenu","DropdownMenuPrimitive","Context","useDropdownMenuScope","ReturnType","createDropdownMenuScope","ScopedProps","P","__scopeThreadListItemMore","Scope"],"sources":["../../../src/primitives/threadListItemMore/scope.ts"],"sourcesContent":["import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type { Context } from \"radix-ui/internal\";\n\nexport const useDropdownMenuScope: ReturnType<\n typeof DropdownMenuPrimitive.createDropdownMenuScope\n> = DropdownMenuPrimitive.createDropdownMenuScope();\n\nexport type ScopedProps<P> = P & { __scopeThreadListItemMore?: Context.Scope };\n"],"mappings":";;AAGA,MAAaG,uBAETF,aAAsBI,wBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SandboxHost.d.ts","names":[],"sources":["../../src/sandbox-host/SandboxHost.tsx"],"mappings":";;;KAaY;EACV,UAAU;EACV;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;;KAGU,mBAAmB,KAC7B;KAIU;EACV,YAAY;;KAGF;EACV,YAAY,OAAO;EACnB;;KAGU;EAAmB;;KAEnB;EACV,SAAS;EACT;EACA,UAAU;EACV;EACA,eACE,OAAO,kBACP,MAAM,mBACH;EACL,YAAY,OAAO;EACnB,iBAAiB;;iBAGH,sBACd,OAAO,cACP;EAAS,QAAQ;EAAmB;;iBActB,cACd,SACA,YACA,SACA,WACA,cACA,SACA,kBACC,mCAAgB,IAAA"}
1
+ {"version":3,"file":"SandboxHost.d.ts","names":[],"sources":["../../src/sandbox-host/SandboxHost.tsx"],"mappings":";;;KAqBY;EACV,UAAU;EACV;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;;KAGU,mBAAmB,KAC7B;KAIU;EACV,YAAY;;KAGF;EACV,YAAY,OAAO;EACnB;;KAGU;EAAmB;;KAEnB;EACV,SAAS;EACT;EACA,UAAU;EACV;EACA,eACE,OAAO,kBACP,MAAM,mBACH;EACL,YAAY,OAAO;EACnB,iBAAiB;;iBAGH,sBACd,OAAO,cACP;EAAS,QAAQ;EAAmB;;iBActB,cACd,SACA,YACA,SACA,WACA,cACA,SACA,kBACC,mCAAgB,IAAA"}