@assistant-ui/react 0.15.23 → 0.15.25

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 (212) hide show
  1. package/README.md +44 -23
  2. package/dist/assistant-transport.js.map +1 -1
  3. package/dist/cloud-renderer/CloudRendererHost.js.map +1 -1
  4. package/dist/context/providers/MessageProvider.js.map +1 -1
  5. package/dist/context/providers/ThreadViewportProvider.js.map +1 -1
  6. package/dist/hooks/useToolCallElapsed.d.ts +3 -1
  7. package/dist/hooks/useToolCallElapsed.d.ts.map +1 -1
  8. package/dist/hooks/useToolCallElapsed.js +7 -8
  9. package/dist/hooks/useToolCallElapsed.js.map +1 -1
  10. package/dist/index.d.ts +10 -4
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +3 -3
  13. package/dist/legacy-runtime/AssistantRuntimeProvider.js.map +1 -1
  14. package/dist/mcp-apps/app-frame.js.map +1 -1
  15. package/dist/model-context/frame/useAssistantFrameHost.js.map +1 -1
  16. package/dist/model-context/makeAssistantVisible.d.ts +1 -0
  17. package/dist/model-context/makeAssistantVisible.d.ts.map +1 -1
  18. package/dist/model-context/makeAssistantVisible.js +31 -12
  19. package/dist/model-context/makeAssistantVisible.js.map +1 -1
  20. package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
  21. package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
  22. package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
  23. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
  24. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
  25. package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
  26. package/dist/primitives/actionBar/ActionBarRoot.js.map +1 -1
  27. package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
  28. package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
  29. package/dist/primitives/actionBar/useActionBarFloatStatus.js.map +1 -1
  30. package/dist/primitives/actionBarMore/ActionBarMoreContent.js.map +1 -1
  31. package/dist/primitives/actionBarMore/ActionBarMoreItem.js.map +1 -1
  32. package/dist/primitives/actionBarMore/ActionBarMoreRoot.js.map +1 -1
  33. package/dist/primitives/actionBarMore/ActionBarMoreSeparator.js.map +1 -1
  34. package/dist/primitives/actionBarMore/ActionBarMoreTrigger.js.map +1 -1
  35. package/dist/primitives/actionBarMore/scope.js.map +1 -1
  36. package/dist/primitives/assistantModal/AssistantModalAnchor.js.map +1 -1
  37. package/dist/primitives/assistantModal/AssistantModalContent.js.map +1 -1
  38. package/dist/primitives/assistantModal/AssistantModalRoot.js.map +1 -1
  39. package/dist/primitives/assistantModal/AssistantModalTrigger.js.map +1 -1
  40. package/dist/primitives/assistantModal/popoverRenderPrimitives.js.map +1 -1
  41. package/dist/primitives/assistantModal/scope.js.map +1 -1
  42. package/dist/primitives/attachment/AttachmentName.js.map +1 -1
  43. package/dist/primitives/attachment/AttachmentRemove.js.map +1 -1
  44. package/dist/primitives/attachment/AttachmentRoot.js.map +1 -1
  45. package/dist/primitives/attachment/AttachmentThumb.js.map +1 -1
  46. package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
  47. package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
  48. package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
  49. package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
  50. package/dist/primitives/branchPicker/BranchPickerRoot.js.map +1 -1
  51. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js.map +1 -1
  52. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.js.map +1 -1
  53. package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
  54. package/dist/primitives/composer/ComposerCancel.js.map +1 -1
  55. package/dist/primitives/composer/ComposerDictate.js.map +1 -1
  56. package/dist/primitives/composer/ComposerDictationTranscript.js.map +1 -1
  57. package/dist/primitives/composer/ComposerInput.d.ts +1 -1
  58. package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
  59. package/dist/primitives/composer/ComposerInput.js +4 -3
  60. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  61. package/dist/primitives/composer/ComposerInputPluginContext.js.map +1 -1
  62. package/dist/primitives/composer/ComposerQuote.js.map +1 -1
  63. package/dist/primitives/composer/ComposerRoot.js.map +1 -1
  64. package/dist/primitives/composer/ComposerSend.js.map +1 -1
  65. package/dist/primitives/composer/ComposerStopDictation.js.map +1 -1
  66. package/dist/primitives/composer/trigger/TriggerPopover.d.ts +11 -11
  67. package/dist/primitives/composer/trigger/TriggerPopover.d.ts.map +1 -1
  68. package/dist/primitives/composer/trigger/TriggerPopover.js +62 -60
  69. package/dist/primitives/composer/trigger/TriggerPopover.js.map +1 -1
  70. package/dist/primitives/composer/trigger/TriggerPopoverAction.d.ts +8 -8
  71. package/dist/primitives/composer/trigger/TriggerPopoverAction.d.ts.map +1 -1
  72. package/dist/primitives/composer/trigger/TriggerPopoverAction.js +6 -6
  73. package/dist/primitives/composer/trigger/TriggerPopoverAction.js.map +1 -1
  74. package/dist/primitives/composer/trigger/TriggerPopoverBack.js.map +1 -1
  75. package/dist/primitives/composer/trigger/TriggerPopoverCategories.d.ts +3 -3
  76. package/dist/primitives/composer/trigger/TriggerPopoverCategories.d.ts.map +1 -1
  77. package/dist/primitives/composer/trigger/TriggerPopoverCategories.js.map +1 -1
  78. package/dist/primitives/composer/trigger/TriggerPopoverDirective.d.ts +9 -9
  79. package/dist/primitives/composer/trigger/TriggerPopoverDirective.d.ts.map +1 -1
  80. package/dist/primitives/composer/trigger/TriggerPopoverDirective.js +7 -7
  81. package/dist/primitives/composer/trigger/TriggerPopoverDirective.js.map +1 -1
  82. package/dist/primitives/composer/trigger/TriggerPopoverItems.d.ts +5 -5
  83. package/dist/primitives/composer/trigger/TriggerPopoverItems.d.ts.map +1 -1
  84. package/dist/primitives/composer/trigger/TriggerPopoverItems.js.map +1 -1
  85. package/dist/primitives/composer/trigger/TriggerPopoverResource.js.map +1 -1
  86. package/dist/primitives/composer/trigger/TriggerPopoverRootContext.d.ts +8 -8
  87. package/dist/primitives/composer/trigger/TriggerPopoverRootContext.js +8 -8
  88. package/dist/primitives/composer/trigger/TriggerPopoverRootContext.js.map +1 -1
  89. package/dist/primitives/composer/trigger/index.d.ts +1 -1
  90. package/dist/primitives/composer/trigger/index.js.map +1 -1
  91. package/dist/primitives/composer/trigger/triggerDetectionResource.js.map +1 -1
  92. package/dist/primitives/composer/trigger/triggerKeyboardResource.js.map +1 -1
  93. package/dist/primitives/composer/trigger/triggerNavigationResource.js.map +1 -1
  94. package/dist/primitives/composer/trigger/triggerSelectionResource.js.map +1 -1
  95. package/dist/primitives/composer/useComposerInputState.js.map +1 -1
  96. package/dist/primitives/composer.d.ts +20 -1
  97. package/dist/primitives/composer.d.ts.map +1 -1
  98. package/dist/primitives/composer.js +8 -1
  99. package/dist/primitives/composer.js.map +1 -1
  100. package/dist/primitives/dropdownMenuRenderPrimitives.js.map +1 -1
  101. package/dist/primitives/error/ErrorMessage.js.map +1 -1
  102. package/dist/primitives/error/ErrorRoot.js.map +1 -1
  103. package/dist/primitives/message/MessageIf.js.map +1 -1
  104. package/dist/primitives/message/MessageParts.js.map +1 -1
  105. package/dist/primitives/message/MessagePartsGrouped.d.ts.map +1 -1
  106. package/dist/primitives/message/MessagePartsGrouped.js +42 -17
  107. package/dist/primitives/message/MessagePartsGrouped.js.map +1 -1
  108. package/dist/primitives/message/MessageRoot.js.map +1 -1
  109. package/dist/primitives/messagePart/MessagePartImage.js.map +1 -1
  110. package/dist/primitives/queueItem/QueueItemRemove.js.map +1 -1
  111. package/dist/primitives/queueItem/QueueItemSteer.js.map +1 -1
  112. package/dist/primitives/queueItem/QueueItemText.js.map +1 -1
  113. package/dist/primitives/reasoning/useScrollLock.js.map +1 -1
  114. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js.map +1 -1
  115. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js.map +1 -1
  116. package/dist/primitives/suggestion/SuggestionDescription.js.map +1 -1
  117. package/dist/primitives/suggestion/SuggestionTitle.js.map +1 -1
  118. package/dist/primitives/suggestion/SuggestionTrigger.js.map +1 -1
  119. package/dist/primitives/thread/ThreadIf.js.map +1 -1
  120. package/dist/primitives/thread/ThreadLoadEarlier.d.ts +19 -0
  121. package/dist/primitives/thread/ThreadLoadEarlier.d.ts.map +1 -0
  122. package/dist/primitives/thread/ThreadLoadEarlier.js +36 -0
  123. package/dist/primitives/thread/ThreadLoadEarlier.js.map +1 -0
  124. package/dist/primitives/thread/ThreadMessages.d.ts +1 -1
  125. package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
  126. package/dist/primitives/thread/ThreadMessages.js +2 -2
  127. package/dist/primitives/thread/ThreadRoot.d.ts.map +1 -1
  128. package/dist/primitives/thread/ThreadRoot.js +2 -0
  129. package/dist/primitives/thread/ThreadRoot.js.map +1 -1
  130. package/dist/primitives/thread/ThreadScrollToBottom.js.map +1 -1
  131. package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
  132. package/dist/primitives/thread/ThreadViewport.js.map +1 -1
  133. package/dist/primitives/thread/ThreadViewportFooter.js.map +1 -1
  134. package/dist/primitives/thread/topAnchor/useTopAnchorReserve.js.map +1 -1
  135. package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
  136. package/dist/primitives/thread/useThreadViewportAutoScroll.js +111 -2
  137. package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
  138. package/dist/primitives/thread.d.ts +2 -0
  139. package/dist/primitives/thread.d.ts.map +1 -1
  140. package/dist/primitives/thread.js +5 -2
  141. package/dist/primitives/thread.js.map +1 -1
  142. package/dist/primitives/threadList/ThreadListLoadMore.js.map +1 -1
  143. package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
  144. package/dist/primitives/threadList/ThreadListRoot.js.map +1 -1
  145. package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
  146. package/dist/primitives/threadListItem/ThreadListItemDelete.js.map +1 -1
  147. package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
  148. package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -1
  149. package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -1
  150. package/dist/primitives/threadListItemMore/ThreadListItemMoreContent.js.map +1 -1
  151. package/dist/primitives/threadListItemMore/ThreadListItemMoreItem.js.map +1 -1
  152. package/dist/primitives/threadListItemMore/ThreadListItemMoreRoot.js.map +1 -1
  153. package/dist/primitives/threadListItemMore/ThreadListItemMoreSeparator.js.map +1 -1
  154. package/dist/primitives/threadListItemMore/ThreadListItemMoreTrigger.js.map +1 -1
  155. package/dist/primitives/threadListItemMore/scope.js.map +1 -1
  156. package/dist/sandbox-host/SandboxHost.d.ts.map +1 -1
  157. package/dist/sandbox-host/SandboxHost.js +6 -1
  158. package/dist/sandbox-host/SandboxHost.js.map +1 -1
  159. package/dist/unstable/useMessageStallDetection.d.ts.map +1 -1
  160. package/dist/unstable/useMessageStallDetection.js +10 -6
  161. package/dist/unstable/useMessageStallDetection.js.map +1 -1
  162. package/dist/unstable/useModelContextSnapshot.js.map +1 -1
  163. package/dist/unstable/webmcp/WebMcpRegistrationResource.js.map +1 -1
  164. package/dist/unstable/webmcp/useWebMcpProvider.js.map +1 -1
  165. package/dist/utils/Primitive.js.map +1 -1
  166. package/dist/utils/createActionButton.js.map +1 -1
  167. package/dist/utils/hooks/useManagedRef.js.map +1 -1
  168. package/dist/utils/hooks/useMediaQuery.js.map +1 -1
  169. package/dist/utils/hooks/useOnResizeContent.js.map +1 -1
  170. package/dist/utils/hooks/useOnScrollToBottom.js.map +1 -1
  171. package/dist/utils/hooks/useSizeHandle.js.map +1 -1
  172. package/dist/utils/isCompositionKey.d.ts +2 -0
  173. package/dist/utils/isCompositionKey.d.ts.map +1 -0
  174. package/dist/utils/isCompositionKey.js +6 -0
  175. package/dist/utils/isCompositionKey.js.map +1 -0
  176. package/dist/utils/smooth/SmoothContext.js.map +1 -1
  177. package/dist/utils/smooth/useSmooth.js +6 -6
  178. package/dist/utils/smooth/useSmooth.js.map +1 -1
  179. package/package.json +12 -11
  180. package/src/hooks/useToolCallElapsed.test.tsx +35 -0
  181. package/src/hooks/useToolCallElapsed.ts +9 -7
  182. package/src/index.ts +28 -3
  183. package/src/model-context/makeAssistantVisible.test.tsx +315 -5
  184. package/src/model-context/makeAssistantVisible.tsx +43 -7
  185. package/src/primitives/composer/ComposerInput.test.tsx +33 -1
  186. package/src/primitives/composer/ComposerInput.tsx +4 -3
  187. package/src/primitives/composer/trigger/TriggerPopover.tsx +11 -11
  188. package/src/primitives/composer/trigger/TriggerPopoverAction.tsx +10 -13
  189. package/src/primitives/composer/trigger/TriggerPopoverCategories.tsx +2 -2
  190. package/src/primitives/composer/trigger/TriggerPopoverDirective.tsx +11 -14
  191. package/src/primitives/composer/trigger/TriggerPopoverExports.test.ts +61 -0
  192. package/src/primitives/composer/trigger/TriggerPopoverItems.tsx +3 -3
  193. package/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx +8 -8
  194. package/src/primitives/composer.ts +21 -1
  195. package/src/primitives/message/MessagePartsGrouped.test.tsx +271 -1
  196. package/src/primitives/message/MessagePartsGrouped.tsx +14 -6
  197. package/src/primitives/message/MessageRoot.test.tsx +125 -2
  198. package/src/primitives/thread/ThreadLoadEarlier.tsx +35 -0
  199. package/src/primitives/thread/ThreadMessages.tsx +1 -0
  200. package/src/primitives/thread/ThreadRoot.test.tsx +33 -0
  201. package/src/primitives/thread/ThreadRoot.tsx +3 -0
  202. package/src/primitives/thread/useThreadViewportAutoScroll.test.tsx +256 -5
  203. package/src/primitives/thread/useThreadViewportAutoScroll.ts +147 -1
  204. package/src/primitives/thread.ts +2 -0
  205. package/src/sandbox-host/SandboxHost.test.tsx +34 -0
  206. package/src/sandbox-host/SandboxHost.tsx +8 -4
  207. package/src/tests/toolCallTiming.test.tsx +19 -2
  208. package/src/unstable/useMessageStallDetection.test.tsx +40 -0
  209. package/src/unstable/useMessageStallDetection.ts +10 -6
  210. package/src/utils/isCompositionKey.ts +5 -0
  211. package/src/utils/smooth/useSmooth.test.tsx +16 -5
  212. package/src/utils/smooth/useSmooth.ts +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBarMoreSeparator.js","names":["c","_c","ComponentRef","forwardRef","DropdownMenu","DropdownMenuPrimitive","WithRenderPropProps","DropdownMenuRenderSeparator","ScopedProps","useDropdownMenuScope","ActionBarMorePrimitiveSeparator","Element","Separator","Props","t0","ref","$","__scopeActionBarMore","rest","scope","t1","displayName"],"sources":["../../../src/primitives/actionBarMore/ActionBarMoreSeparator.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 ActionBarMorePrimitiveSeparator {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Separator>;\n export type Props = WithRenderPropProps<\n typeof DropdownMenuPrimitive.Separator\n >;\n}\n\nexport const ActionBarMorePrimitiveSeparator = forwardRef<\n ActionBarMorePrimitiveSeparator.Element,\n ActionBarMorePrimitiveSeparator.Props\n>(\n (\n {\n __scopeActionBarMore,\n ...rest\n }: ScopedProps<ActionBarMorePrimitiveSeparator.Props>,\n ref,\n ) => {\n const scope = useDropdownMenuScope(__scopeActionBarMore);\n\n return <DropdownMenuRenderSeparator {...scope} {...rest} ref={ref} />;\n },\n);\n\nActionBarMorePrimitiveSeparator.displayName =\n \"ActionBarMorePrimitive.Separator\";\n"],"mappings":";;;;;;;AAeA,MAAaU,kCAAkCP,YAI7CW,IAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,sBAAA,GAAAC,QAAAJ;EAGqDE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,uBAAAD,EAAA;EAAAE,OAAAF,EAAA;CAAA;CAGrD,MAAAG,QAAcV,qBAAqBQ,oBAAoB;CAAE,IAAAG;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAAF,EAAA,OAAAG,OAAA;EAElDC,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,gCAAgCW,cAC9B"}
1
+ {"version":3,"file":"ActionBarMoreSeparator.js","names":["c","_c","ComponentRef","forwardRef","DropdownMenu","DropdownMenuPrimitive","WithRenderPropProps","DropdownMenuRenderSeparator","ScopedProps","useDropdownMenuScope","ActionBarMorePrimitiveSeparator","Element","Separator","Props","t0","ref","$","__scopeActionBarMore","rest","scope","t1","displayName","_c"],"sources":["../../../src/primitives/actionBarMore/ActionBarMoreSeparator.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 ActionBarMorePrimitiveSeparator {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Separator>;\n export type Props = WithRenderPropProps<\n typeof DropdownMenuPrimitive.Separator\n >;\n}\n\nexport const ActionBarMorePrimitiveSeparator = forwardRef<\n ActionBarMorePrimitiveSeparator.Element,\n ActionBarMorePrimitiveSeparator.Props\n>(\n (\n {\n __scopeActionBarMore,\n ...rest\n }: ScopedProps<ActionBarMorePrimitiveSeparator.Props>,\n ref,\n ) => {\n const scope = useDropdownMenuScope(__scopeActionBarMore);\n\n return <DropdownMenuRenderSeparator {...scope} {...rest} ref={ref} />;\n },\n);\n\nActionBarMorePrimitiveSeparator.displayName =\n \"ActionBarMorePrimitive.Separator\";\n"],"mappings":";;;;;;;AAeA,MAAaU,kCAAkCP,YAI7CW,IAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,sBAAA,GAAAC,QAAAJ;EAGqDE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,uBAAAD,EAAA;EAAAE,OAAAF,EAAA;CAAA;CAGrD,MAAAG,QAAcV,qBAAqBQ,oBAAoB;CAAE,IAAAG;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAAF,EAAA,OAAAG,OAAA;EAElDC,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,gCAAgCW,cAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBarMoreTrigger.js","names":["c","_c","ComponentRef","forwardRef","DropdownMenu","DropdownMenuPrimitive","WithRenderPropProps","DropdownMenuRenderTrigger","ScopedProps","useDropdownMenuScope","ActionBarMorePrimitiveTrigger","Element","Trigger","Props","t0","ref","$","__scopeActionBarMore","rest","scope","t1","displayName"],"sources":["../../../src/primitives/actionBarMore/ActionBarMoreTrigger.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 { DropdownMenuRenderTrigger } from \"../dropdownMenuRenderPrimitives\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ActionBarMorePrimitiveTrigger {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Trigger>;\n export type Props = WithRenderPropProps<typeof DropdownMenuPrimitive.Trigger>;\n}\n\nexport const ActionBarMorePrimitiveTrigger = forwardRef<\n ActionBarMorePrimitiveTrigger.Element,\n ActionBarMorePrimitiveTrigger.Props\n>(\n (\n {\n __scopeActionBarMore,\n ...rest\n }: ScopedProps<ActionBarMorePrimitiveTrigger.Props>,\n ref,\n ) => {\n const scope = useDropdownMenuScope(__scopeActionBarMore);\n\n return <DropdownMenuRenderTrigger {...scope} {...rest} ref={ref} />;\n },\n);\n\nActionBarMorePrimitiveTrigger.displayName = \"ActionBarMorePrimitive.Trigger\";\n"],"mappings":";;;;;;;AAaA,MAAaU,gCAAgCP,YAI3CW,IAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,sBAAA,GAAAC,QAAAJ;EAGmDE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,uBAAAD,EAAA;EAAAE,OAAAF,EAAA;CAAA;CAGnD,MAAAG,QAAcV,qBAAqBQ,oBAAoB;CAAE,IAAAG;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAAF,EAAA,OAAAG,OAAA;EAElDC,KAAA,oBAAC,2BAAD;GAA0B,GAAKD;GAAK,GAAMD;GAAWH;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAA5DI;AAA4D,CAEvE;AAEAV,8BAA8BW,cAAc"}
1
+ {"version":3,"file":"ActionBarMoreTrigger.js","names":["c","_c","ComponentRef","forwardRef","DropdownMenu","DropdownMenuPrimitive","WithRenderPropProps","DropdownMenuRenderTrigger","ScopedProps","useDropdownMenuScope","ActionBarMorePrimitiveTrigger","Element","Trigger","Props","t0","ref","$","__scopeActionBarMore","rest","scope","t1","displayName","_c"],"sources":["../../../src/primitives/actionBarMore/ActionBarMoreTrigger.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 { DropdownMenuRenderTrigger } from \"../dropdownMenuRenderPrimitives\";\nimport { type ScopedProps, useDropdownMenuScope } from \"./scope\";\n\nexport namespace ActionBarMorePrimitiveTrigger {\n export type Element = ComponentRef<typeof DropdownMenuPrimitive.Trigger>;\n export type Props = WithRenderPropProps<typeof DropdownMenuPrimitive.Trigger>;\n}\n\nexport const ActionBarMorePrimitiveTrigger = forwardRef<\n ActionBarMorePrimitiveTrigger.Element,\n ActionBarMorePrimitiveTrigger.Props\n>(\n (\n {\n __scopeActionBarMore,\n ...rest\n }: ScopedProps<ActionBarMorePrimitiveTrigger.Props>,\n ref,\n ) => {\n const scope = useDropdownMenuScope(__scopeActionBarMore);\n\n return <DropdownMenuRenderTrigger {...scope} {...rest} ref={ref} />;\n },\n);\n\nActionBarMorePrimitiveTrigger.displayName = \"ActionBarMorePrimitive.Trigger\";\n"],"mappings":";;;;;;;AAaA,MAAaU,gCAAgCP,YAI3CW,IAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,sBAAA,GAAAC,QAAAJ;EAGmDE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,uBAAAD,EAAA;EAAAE,OAAAF,EAAA;CAAA;CAGnD,MAAAG,QAAcV,qBAAqBQ,oBAAoB;CAAE,IAAAG;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAAF,EAAA,OAAAG,OAAA;EAElDC,KAAA,oBAAC,2BAAD;GAA0B,GAAKD;GAAK,GAAMD;GAAWH;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAA5DI;AAA4D,CAEvE;AAEAV,8BAA8BW,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"scope.js","names":["DropdownMenu","DropdownMenuPrimitive","Context","useDropdownMenuScope","ReturnType","createDropdownMenuScope","ScopedProps","P","__scopeActionBarMore","Scope"],"sources":["../../../src/primitives/actionBarMore/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 & { __scopeActionBarMore?: Context.Scope };\n"],"mappings":";;AAGA,MAAaG,uBAETF,aAAsBI,wBAAwB"}
1
+ {"version":3,"file":"scope.js","names":["DropdownMenu","DropdownMenuPrimitive","Context","useDropdownMenuScope","ReturnType","createDropdownMenuScope","ScopedProps","P","__scopeActionBarMore","Scope","DropdownMenuPrimitive"],"sources":["../../../src/primitives/actionBarMore/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 & { __scopeActionBarMore?: Context.Scope };\n"],"mappings":";;AAGA,MAAaG,uBAETF,aAAsBI,wBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantModalAnchor.js","names":["c","_c","ComponentRef","forwardRef","Popover","PopoverPrimitive","WithRenderPropProps","PopoverRenderAnchor","ScopedProps","usePopoverScope","AssistantModalPrimitiveAnchor","Element","Anchor","Props","t0","ref","$","__scopeAssistantModal","rest","scope","t1","displayName"],"sources":["../../../src/primitives/assistantModal/AssistantModalAnchor.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentRef, forwardRef } from \"react\";\nimport type { Popover as PopoverPrimitive } from \"radix-ui\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { PopoverRenderAnchor } from \"./popoverRenderPrimitives\";\nimport { type ScopedProps, usePopoverScope } from \"./scope\";\n\nexport namespace AssistantModalPrimitiveAnchor {\n export type Element = ComponentRef<typeof PopoverPrimitive.Anchor>;\n export type Props = WithRenderPropProps<typeof PopoverPrimitive.Anchor>;\n}\n\nexport const AssistantModalPrimitiveAnchor = forwardRef<\n AssistantModalPrimitiveAnchor.Element,\n AssistantModalPrimitiveAnchor.Props\n>(\n (\n {\n __scopeAssistantModal,\n ...rest\n }: ScopedProps<AssistantModalPrimitiveAnchor.Props>,\n ref,\n ) => {\n const scope = usePopoverScope(__scopeAssistantModal);\n\n return <PopoverRenderAnchor {...scope} {...rest} ref={ref} />;\n },\n);\nAssistantModalPrimitiveAnchor.displayName = \"AssistantModalPrimitive.Anchor\";\n"],"mappings":";;;;;;;AAaA,MAAaU,gCAAgCP,YAI3CW,IAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,uBAAA,GAAAC,QAAAJ;EAGmDE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,wBAAAD,EAAA;EAAAE,OAAAF,EAAA;CAAA;CAGnD,MAAAG,QAAcV,gBAAgBQ,qBAAqB;CAAE,IAAAG;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAAF,EAAA,OAAAG,OAAA;EAE9CC,KAAA,oBAAC,qBAAD;GAAoB,GAAKD;GAAK,GAAMD;GAAWH;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAAtDI;AAAsD,CAEjE;AACAV,8BAA8BW,cAAc"}
1
+ {"version":3,"file":"AssistantModalAnchor.js","names":["c","_c","ComponentRef","forwardRef","Popover","PopoverPrimitive","WithRenderPropProps","PopoverRenderAnchor","ScopedProps","usePopoverScope","AssistantModalPrimitiveAnchor","Element","Anchor","Props","t0","ref","$","__scopeAssistantModal","rest","scope","t1","displayName","_c"],"sources":["../../../src/primitives/assistantModal/AssistantModalAnchor.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentRef, forwardRef } from \"react\";\nimport type { Popover as PopoverPrimitive } from \"radix-ui\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { PopoverRenderAnchor } from \"./popoverRenderPrimitives\";\nimport { type ScopedProps, usePopoverScope } from \"./scope\";\n\nexport namespace AssistantModalPrimitiveAnchor {\n export type Element = ComponentRef<typeof PopoverPrimitive.Anchor>;\n export type Props = WithRenderPropProps<typeof PopoverPrimitive.Anchor>;\n}\n\nexport const AssistantModalPrimitiveAnchor = forwardRef<\n AssistantModalPrimitiveAnchor.Element,\n AssistantModalPrimitiveAnchor.Props\n>(\n (\n {\n __scopeAssistantModal,\n ...rest\n }: ScopedProps<AssistantModalPrimitiveAnchor.Props>,\n ref,\n ) => {\n const scope = usePopoverScope(__scopeAssistantModal);\n\n return <PopoverRenderAnchor {...scope} {...rest} ref={ref} />;\n },\n);\nAssistantModalPrimitiveAnchor.displayName = \"AssistantModalPrimitive.Anchor\";\n"],"mappings":";;;;;;;AAaA,MAAaU,gCAAgCP,YAI3CW,IAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,uBAAA,GAAAC,QAAAJ;EAGmDE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,wBAAAD,EAAA;EAAAE,OAAAF,EAAA;CAAA;CAGnD,MAAAG,QAAcV,gBAAgBQ,qBAAqB;CAAE,IAAAG;CAAA,IAAAJ,EAAA,OAAAD,OAAAC,EAAA,OAAAE,QAAAF,EAAA,OAAAG,OAAA;EAE9CC,KAAA,oBAAC,qBAAD;GAAoB,GAAKD;GAAK,GAAMD;GAAWH;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAAtDI;AAAsD,CAEjE;AACAV,8BAA8BW,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantModalContent.js","names":["c","_c","ComponentPropsWithoutRef","ComponentRef","forwardRef","Popover","PopoverPrimitive","composeEventHandlers","WithRenderPropProps","PopoverRenderContent","ScopedProps","usePopoverScope","AssistantModalPrimitiveContent","Element","Content","Props","portalProps","Portal","dissmissOnInteractOutside","t0","forwardedRef","$","__scopeAssistantModal","align","onInteractOutside","props","side","t1","undefined","scope","t2","t3","t4","_temp","t5","t6","t7","displayName","e","preventDefault"],"sources":["../../../src/primitives/assistantModal/AssistantModalContent.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Popover as PopoverPrimitive } from \"radix-ui\";\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { PopoverRenderContent } from \"./popoverRenderPrimitives\";\nimport { type ScopedProps, usePopoverScope } from \"./scope\";\n\nexport namespace AssistantModalPrimitiveContent {\n export type Element = ComponentRef<typeof PopoverPrimitive.Content>;\n export type Props = WithRenderPropProps<typeof PopoverPrimitive.Content> & {\n portalProps?:\n | ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>\n | undefined;\n dissmissOnInteractOutside?: boolean | undefined;\n };\n}\n\nexport const AssistantModalPrimitiveContent = forwardRef<\n AssistantModalPrimitiveContent.Element,\n AssistantModalPrimitiveContent.Props\n>(\n (\n {\n __scopeAssistantModal,\n side,\n align,\n onInteractOutside,\n dissmissOnInteractOutside = false,\n portalProps,\n ...props\n }: ScopedProps<AssistantModalPrimitiveContent.Props>,\n forwardedRef,\n ) => {\n const scope = usePopoverScope(__scopeAssistantModal);\n\n return (\n <PopoverPrimitive.Portal {...scope} {...portalProps}>\n <PopoverRenderContent\n {...scope}\n {...props}\n ref={forwardedRef}\n side={side ?? \"top\"}\n align={align ?? \"end\"}\n onInteractOutside={composeEventHandlers(\n onInteractOutside,\n dissmissOnInteractOutside ? undefined : (e) => e.preventDefault(),\n )}\n />\n </PopoverPrimitive.Portal>\n );\n },\n);\n\nAssistantModalPrimitiveContent.displayName = \"AssistantModalPrimitive.Content\";\n"],"mappings":";;;;;;;;;AAuBA,MAAaY,iCAAiCR,YAI5Ce,IAAAC,iBAAA;CAAA,MAAAC,IAAApB,EAAA,EAAA;CAAA,IAAAqB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAR;CAAA,IAAAS;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,uBAAAI,MAAAH,OAAAC,mBAAAN,2BAAAS,IAAAX,aAAA,GAAAS,SAAAN;EAQoDE,EAAA,KAAAF;EAAAE,EAAA,KA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AA;GAAA,GAA6BP;GAAK,GAAMb;GACtCmB,UAAAA;EAWF,CAAA;EAA0Bd,EAAA,MAAAL;EAAAK,EAAA,MAAAQ;EAAAR,EAAA,MAAAc;EAAAd,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAZ1Be;AAY0B,CAGhC;AAEAxB,+BAA+ByB,cAAc;AAhC3C,SAAAJ,MAAAK,GAAA;CAAA,OAwByDA,EAACC,eAAgB;AAAC"}
1
+ {"version":3,"file":"AssistantModalContent.js","names":["c","_c","ComponentPropsWithoutRef","ComponentRef","forwardRef","Popover","PopoverPrimitive","composeEventHandlers","WithRenderPropProps","PopoverRenderContent","ScopedProps","usePopoverScope","AssistantModalPrimitiveContent","Element","Content","Props","portalProps","Portal","dissmissOnInteractOutside","t0","forwardedRef","$","__scopeAssistantModal","align","onInteractOutside","props","side","t1","undefined","scope","t2","t3","t4","_temp","t5","t6","t7","displayName","e","preventDefault","_c","PopoverPrimitive"],"sources":["../../../src/primitives/assistantModal/AssistantModalContent.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Popover as PopoverPrimitive } from \"radix-ui\";\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { PopoverRenderContent } from \"./popoverRenderPrimitives\";\nimport { type ScopedProps, usePopoverScope } from \"./scope\";\n\nexport namespace AssistantModalPrimitiveContent {\n export type Element = ComponentRef<typeof PopoverPrimitive.Content>;\n export type Props = WithRenderPropProps<typeof PopoverPrimitive.Content> & {\n portalProps?:\n | ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>\n | undefined;\n dissmissOnInteractOutside?: boolean | undefined;\n };\n}\n\nexport const AssistantModalPrimitiveContent = forwardRef<\n AssistantModalPrimitiveContent.Element,\n AssistantModalPrimitiveContent.Props\n>(\n (\n {\n __scopeAssistantModal,\n side,\n align,\n onInteractOutside,\n dissmissOnInteractOutside = false,\n portalProps,\n ...props\n }: ScopedProps<AssistantModalPrimitiveContent.Props>,\n forwardedRef,\n ) => {\n const scope = usePopoverScope(__scopeAssistantModal);\n\n return (\n <PopoverPrimitive.Portal {...scope} {...portalProps}>\n <PopoverRenderContent\n {...scope}\n {...props}\n ref={forwardedRef}\n side={side ?? \"top\"}\n align={align ?? \"end\"}\n onInteractOutside={composeEventHandlers(\n onInteractOutside,\n dissmissOnInteractOutside ? undefined : (e) => e.preventDefault(),\n )}\n />\n </PopoverPrimitive.Portal>\n );\n },\n);\n\nAssistantModalPrimitiveContent.displayName = \"AssistantModalPrimitive.Content\";\n"],"mappings":";;;;;;;;;AAuBA,MAAaY,iCAAiCR,YAI5Ce,IAAAC,iBAAA;CAAA,MAAAC,IAAApB,EAAA,EAAA;CAAA,IAAAqB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAR;CAAA,IAAAS;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAG,uBAAAI,MAAAH,OAAAC,mBAAAN,2BAAAS,IAAAX,aAAA,GAAAS,SAAAN;EAQoDE,EAAA,KAAAF;EAAAE,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAL;EAAAK,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAA;EAAAL,wBAAAD,EAAA;EAAAE,QAAAF,EAAA;EAAAG,oBAAAH,EAAA;EAAAL,cAAAK,EAAA;EAAAI,QAAAJ,EAAA;EAAAK,OAAAL,EAAA;EAAAM,KAAAN,EAAA;CAAA;CAHlD,MAAAH,4BAAAS,OAAAC,KAAAA,IAAA,QAAAD;CAMF,MAAAE,QAAclB,gBAAgBW,qBAAqB;CAQvC,MAAAQ,KAAAJ,QAAA;CACC,MAAAK,KAAAR,SAAA;CAGL,MAAAS,KAAAd,4BAAAU,KAAAA,IAAAK;CAAiE,IAAAC;CAAA,IAAAb,EAAA,OAAAG,qBAAAH,EAAA,OAAAW,IAAA;EAFhDE,KAAA3B,qBACjBiB,mBACAQ,EACF;EAACX,EAAA,KAAAG;EAAAH,EAAA,KAAAW;EAAAX,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,QAAAD,gBAAAC,EAAA,QAAAI,SAAAJ,EAAA,QAAAQ,SAAAR,EAAA,QAAAS,MAAAT,EAAA,QAAAU,MAAAV,EAAA,QAAAa,IAAA;EATHC,KAAA,oBAAC,sBAAD;GAAqB,GACfN;GAAK,GACLJ;GACCL,KAAAA;GACC,MAAAU;GACC,OAAAC;GACY,mBAAAG;EAGlB,CAAA;EACDb,EAAA,MAAAD;EAAAC,EAAA,MAAAI;EAAAJ,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAa;EAAAb,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,QAAAL,eAAAK,EAAA,QAAAQ,SAAAR,EAAA,QAAAc,IAAA;EAXJC,KAAA,oBAAAK,QAAA,QAAA;GAAA,GAA6BZ;GAAK,GAAMb;GACtCmB,UAAAA;EAWF,CAAA;EAA0Bd,EAAA,MAAAL;EAAAK,EAAA,MAAAQ;EAAAR,EAAA,MAAAc;EAAAd,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAZ1Be;AAY0B,CAGhC;AAEAxB,+BAA+ByB,cAAc;AAhC3C,SAAAJ,MAAAK,GAAA;CAAA,OAwByDA,EAACC,eAAgB;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantModalRoot.js","names":["c","_c","FC","useState","Popover","PopoverPrimitive","ScopedProps","usePopoverScope","useAuiEvent","AssistantModalPrimitiveRoot","Props","PopoverProps","unstable_openOnRunStart","t0","$","__scopeAssistantModal","onOpenChange","open","rest","t1","t2","defaultOpen","undefined","scope","modalOpen","setOpen","isOpen","t3","open_0","openChangeHandler","t4","t5","displayName"],"sources":["../../../src/primitives/assistantModal/AssistantModalRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { type FC, useState } from \"react\";\nimport { Popover as PopoverPrimitive } from \"radix-ui\";\nimport { type ScopedProps, usePopoverScope } from \"./scope\";\nimport { useAuiEvent } from \"@assistant-ui/store\";\n\nexport namespace AssistantModalPrimitiveRoot {\n export type Props = PopoverPrimitive.PopoverProps & {\n unstable_openOnRunStart?: boolean | undefined;\n };\n}\n\nexport const AssistantModalPrimitiveRoot: FC<\n AssistantModalPrimitiveRoot.Props\n> = ({\n __scopeAssistantModal,\n defaultOpen = false,\n unstable_openOnRunStart = true,\n open,\n onOpenChange,\n ...rest\n}: ScopedProps<AssistantModalPrimitiveRoot.Props>) => {\n const scope = usePopoverScope(__scopeAssistantModal);\n\n const [modalOpen, setOpen] = useState(defaultOpen);\n const isOpen = open ?? modalOpen;\n\n const openChangeHandler = (open: boolean) => {\n onOpenChange?.(open);\n setOpen(open);\n };\n\n useAuiEvent(\"thread.runStart\", () => {\n if (unstable_openOnRunStart && !isOpen) openChangeHandler(true);\n });\n\n return (\n <PopoverPrimitive.Root\n {...scope}\n open={isOpen}\n onOpenChange={openChangeHandler}\n {...rest}\n />\n );\n};\n\nAssistantModalPrimitiveRoot.displayName = \"AssistantModalPrimitive.Root\";\n"],"mappings":";;;;;;;;AAaA,MAAaS,+BAETI,OAAA;CAAA,MAAAC,IAAAb,EAAA,EAAA;CAAA,IAAAc;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAE,uBAAAM,aAAAF,IAAAP,yBAAAQ,IAAAH,MAAAD,cAAA,GAAAE,QAAAL;EAO4CC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,E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,EAAA,MAAAS;EAAAT,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OALFiB;AAKE;AAINtB,4BAA4BuB,cAAc"}
1
+ {"version":3,"file":"AssistantModalRoot.js","names":["c","_c","FC","useState","Popover","PopoverPrimitive","ScopedProps","usePopoverScope","useAuiEvent","AssistantModalPrimitiveRoot","Props","PopoverProps","unstable_openOnRunStart","t0","$","__scopeAssistantModal","onOpenChange","open","rest","t1","t2","defaultOpen","undefined","scope","modalOpen","setOpen","isOpen","t3","open_0","openChangeHandler","t4","t5","displayName","_c","PopoverPrimitive"],"sources":["../../../src/primitives/assistantModal/AssistantModalRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { type FC, useState } from \"react\";\nimport { Popover as PopoverPrimitive } from \"radix-ui\";\nimport { type ScopedProps, usePopoverScope } from \"./scope\";\nimport { useAuiEvent } from \"@assistant-ui/store\";\n\nexport namespace AssistantModalPrimitiveRoot {\n export type Props = PopoverPrimitive.PopoverProps & {\n unstable_openOnRunStart?: boolean | undefined;\n };\n}\n\nexport const AssistantModalPrimitiveRoot: FC<\n AssistantModalPrimitiveRoot.Props\n> = ({\n __scopeAssistantModal,\n defaultOpen = false,\n unstable_openOnRunStart = true,\n open,\n onOpenChange,\n ...rest\n}: ScopedProps<AssistantModalPrimitiveRoot.Props>) => {\n const scope = usePopoverScope(__scopeAssistantModal);\n\n const [modalOpen, setOpen] = useState(defaultOpen);\n const isOpen = open ?? modalOpen;\n\n const openChangeHandler = (open: boolean) => {\n onOpenChange?.(open);\n setOpen(open);\n };\n\n useAuiEvent(\"thread.runStart\", () => {\n if (unstable_openOnRunStart && !isOpen) openChangeHandler(true);\n });\n\n return (\n <PopoverPrimitive.Root\n {...scope}\n open={isOpen}\n onOpenChange={openChangeHandler}\n {...rest}\n />\n );\n};\n\nAssistantModalPrimitiveRoot.displayName = \"AssistantModalPrimitive.Root\";\n"],"mappings":";;;;;;;;AAaA,MAAaS,+BAETI,OAAA;CAAA,MA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mBsB,EAE9B;CAAC,IAAAC;CAAA,IAAAjB,EAAA,QAAAY,UAAAZ,EAAA,QAAAe,qBAAAf,EAAA,QAAAI,QAAAJ,EAAA,QAAAS,OAAA;EAGAQ,KAAA,oBAAAG,QAAA,MAAA;GAAA,GACMX;GACEG,MAAAA;GACQG,cAAAA;GAAiB,GAC3BX;EAAI,CAAA;EACRJ,EAAA,MAAAY;EAAAZ,EAAA,MAAAe;EAAAf,EAAA,MAAAI;EAAAJ,EAAA,MAAAS;EAAAT,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OALFiB;AAKE;AAINtB,4BAA4BuB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantModalTrigger.js","names":["ComponentRef","forwardRef","Popover","PopoverPrimitive","WithRenderPropProps","PopoverRenderTrigger","ScopedProps","usePopoverScope","AssistantModalPrimitiveTrigger","Element","Trigger","Props","t0","ref","$","_c","__scopeAssistantModal","rest","scope","t1","displayName"],"sources":["../../../src/primitives/assistantModal/AssistantModalTrigger.tsx"],"sourcesContent":["import { type ComponentRef, forwardRef } from \"react\";\nimport type { Popover as PopoverPrimitive } from \"radix-ui\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { PopoverRenderTrigger } from \"./popoverRenderPrimitives\";\nimport { type ScopedProps, usePopoverScope } from \"./scope\";\n\nexport namespace AssistantModalPrimitiveTrigger {\n export type Element = ComponentRef<typeof PopoverPrimitive.Trigger>;\n export type Props = WithRenderPropProps<typeof PopoverPrimitive.Trigger>;\n}\n\nexport const AssistantModalPrimitiveTrigger = forwardRef<\n AssistantModalPrimitiveTrigger.Element,\n AssistantModalPrimitiveTrigger.Props\n>(\n (\n {\n __scopeAssistantModal,\n ...rest\n }: ScopedProps<AssistantModalPrimitiveTrigger.Props>,\n ref,\n ) => {\n const scope = usePopoverScope(__scopeAssistantModal);\n\n return <PopoverRenderTrigger {...scope} {...rest} ref={ref} />;\n },\n);\n\nAssistantModalPrimitiveTrigger.displayName = \"AssistantModalPrimitive.Trigger\";\n"],"mappings":";;;;;;AAWA,MAAaQ,iCAAiCP,YAI5CW,IAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAI,uBAAA,GAAAC,QAAAL;EAGoDE,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAD,wBAAAF,EAAA;EAAAG,OAAAH,EAAA;CAAA;CAGpD,MAAAI,QAAcX,gBAAgBS,qBAAqB;CAAE,IAAAG;CAAA,IAAAL,EAAA,OAAAD,OAAAC,EAAA,OAAAG,QAAAH,EAAA,OAAAI,OAAA;EAE9CC,KAAA,oBAAC,sBAAD;GAAqB,GAAKD;GAAK,GAAMD;GAAWJ;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAAvDK;AAAuD,CAElE;AAEAX,+BAA+BY,cAAc"}
1
+ {"version":3,"file":"AssistantModalTrigger.js","names":["ComponentRef","forwardRef","Popover","PopoverPrimitive","WithRenderPropProps","PopoverRenderTrigger","ScopedProps","usePopoverScope","AssistantModalPrimitiveTrigger","Element","Trigger","Props","t0","ref","$","_c","__scopeAssistantModal","rest","scope","t1","displayName","_c"],"sources":["../../../src/primitives/assistantModal/AssistantModalTrigger.tsx"],"sourcesContent":["import { type ComponentRef, forwardRef } from \"react\";\nimport type { Popover as PopoverPrimitive } from \"radix-ui\";\nimport type { WithRenderPropProps } from \"../../utils/Primitive\";\nimport { PopoverRenderTrigger } from \"./popoverRenderPrimitives\";\nimport { type ScopedProps, usePopoverScope } from \"./scope\";\n\nexport namespace AssistantModalPrimitiveTrigger {\n export type Element = ComponentRef<typeof PopoverPrimitive.Trigger>;\n export type Props = WithRenderPropProps<typeof PopoverPrimitive.Trigger>;\n}\n\nexport const AssistantModalPrimitiveTrigger = forwardRef<\n AssistantModalPrimitiveTrigger.Element,\n AssistantModalPrimitiveTrigger.Props\n>(\n (\n {\n __scopeAssistantModal,\n ...rest\n }: ScopedProps<AssistantModalPrimitiveTrigger.Props>,\n ref,\n ) => {\n const scope = usePopoverScope(__scopeAssistantModal);\n\n return <PopoverRenderTrigger {...scope} {...rest} ref={ref} />;\n },\n);\n\nAssistantModalPrimitiveTrigger.displayName = \"AssistantModalPrimitive.Trigger\";\n"],"mappings":";;;;;;AAWA,MAAaQ,iCAAiCP,YAI5CW,IAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAF,IAAA;EACE,CAAA,CAAAI,uBAAA,GAAAC,QAAAL;EAGoDE,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAD,wBAAAF,EAAA;EAAAG,OAAAH,EAAA;CAAA;CAGpD,MAAAI,QAAcX,gBAAgBS,qBAAqB;CAAE,IAAAG;CAAA,IAAAL,EAAA,OAAAD,OAAAC,EAAA,OAAAG,QAAAH,EAAA,OAAAI,OAAA;EAE9CC,KAAA,oBAAC,sBAAD;GAAqB,GAAKD;GAAK,GAAMD;GAAWJ;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAAvDK;AAAuD,CAElE;AAEAX,+BAA+BY,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"popoverRenderPrimitives.js","names":["Popover","PopoverPrimitive","withRenderProp","PopoverRenderTrigger","Trigger","PopoverRenderAnchor","Anchor","PopoverRenderContent","Content"],"sources":["../../../src/primitives/assistantModal/popoverRenderPrimitives.ts"],"sourcesContent":["import { Popover as PopoverPrimitive } from \"radix-ui\";\nimport { withRenderProp } from \"../../utils/Primitive\";\n\nexport const PopoverRenderTrigger = withRenderProp(PopoverPrimitive.Trigger);\nexport const PopoverRenderAnchor = withRenderProp(PopoverPrimitive.Anchor);\nexport const PopoverRenderContent = withRenderProp(PopoverPrimitive.Content);\n"],"mappings":";;;AAGA,MAAaG,uBAAuBD,eAAeD,QAAiBG,OAAO;AAC3E,MAAaC,sBAAsBH,eAAeD,QAAiBK,MAAM;AACzE,MAAaC,uBAAuBL,eAAeD,QAAiBO,OAAO"}
1
+ {"version":3,"file":"popoverRenderPrimitives.js","names":["Popover","PopoverPrimitive","withRenderProp","PopoverRenderTrigger","Trigger","PopoverRenderAnchor","Anchor","PopoverRenderContent","Content","PopoverPrimitive"],"sources":["../../../src/primitives/assistantModal/popoverRenderPrimitives.ts"],"sourcesContent":["import { Popover as PopoverPrimitive } from \"radix-ui\";\nimport { withRenderProp } from \"../../utils/Primitive\";\n\nexport const PopoverRenderTrigger = withRenderProp(PopoverPrimitive.Trigger);\nexport const PopoverRenderAnchor = withRenderProp(PopoverPrimitive.Anchor);\nexport const PopoverRenderContent = withRenderProp(PopoverPrimitive.Content);\n"],"mappings":";;;AAGA,MAAaG,uBAAuBD,eAAeD,QAAiBG,OAAO;AAC3E,MAAaC,sBAAsBH,eAAeD,QAAiBK,MAAM;AACzE,MAAaC,uBAAuBL,eAAeD,QAAiBO,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"scope.js","names":["Popover","PopoverPrimitive","Context","usePopoverScope","ReturnType","createPopoverScope","ScopedProps","P","__scopeAssistantModal","Scope"],"sources":["../../../src/primitives/assistantModal/scope.ts"],"sourcesContent":["import { Popover as PopoverPrimitive } from \"radix-ui\";\nimport type { Context } from \"radix-ui/internal\";\n\nexport const usePopoverScope: ReturnType<\n typeof PopoverPrimitive.createPopoverScope\n> = PopoverPrimitive.createPopoverScope();\nexport type ScopedProps<P> = P & { __scopeAssistantModal?: Context.Scope };\n"],"mappings":";;AAGA,MAAaG,kBAETF,QAAiBI,mBAAmB"}
1
+ {"version":3,"file":"scope.js","names":["Popover","PopoverPrimitive","Context","usePopoverScope","ReturnType","createPopoverScope","ScopedProps","P","__scopeAssistantModal","Scope","PopoverPrimitive"],"sources":["../../../src/primitives/assistantModal/scope.ts"],"sourcesContent":["import { Popover as PopoverPrimitive } from \"radix-ui\";\nimport type { Context } from \"radix-ui/internal\";\n\nexport const usePopoverScope: ReturnType<\n typeof PopoverPrimitive.createPopoverScope\n> = PopoverPrimitive.createPopoverScope();\nexport type ScopedProps<P> = P & { __scopeAssistantModal?: Context.Scope };\n"],"mappings":";;AAGA,MAAaG,kBAETF,QAAiBI,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentName.js","names":["c","_c","FC","useAuiState","AttachmentPrimitiveName","Props","Record","$","name","_temp","t0","displayName","s","attachment"],"sources":["../../../src/primitives/attachment/AttachmentName.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace AttachmentPrimitiveName {\n export type Props = Record<string, never>;\n}\n\nexport const AttachmentPrimitiveName: FC<\n AttachmentPrimitiveName.Props\n> = () => {\n const name = useAuiState((s) => s.attachment.name);\n return <>{name}</>;\n};\n\nAttachmentPrimitiveName.displayName = \"AttachmentPrimitive.Name\";\n"],"mappings":";;;;;AASA,MAAaI,gCAET;CAAA,MAAAG,IAAAN,EAAA,CAAA;CACF,MAAAO,OAAaL,YAAYM,KAAwB;CAAE,IAAAC;CAAA,IAAAH,EAAA,OAAAC,MAAA;EAC5CE,KAAA,oBAAA,UAAA,EAAA,UAAGF,KAAI,CAAA;EAAID,EAAA,KAAAC;EAAAD,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAAXG;AAAW;AAGpBN,wBAAwBO,cAAc;AALlC,SAAAF,MAAAG,GAAA;CAAA,OAC8BA,EAACC,WAAWL;AAAK"}
1
+ {"version":3,"file":"AttachmentName.js","names":["c","_c","FC","useAuiState","AttachmentPrimitiveName","Props","Record","$","name","_temp","t0","displayName","s","attachment","_c"],"sources":["../../../src/primitives/attachment/AttachmentName.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace AttachmentPrimitiveName {\n export type Props = Record<string, never>;\n}\n\nexport const AttachmentPrimitiveName: FC<\n AttachmentPrimitiveName.Props\n> = () => {\n const name = useAuiState((s) => s.attachment.name);\n return <>{name}</>;\n};\n\nAttachmentPrimitiveName.displayName = \"AttachmentPrimitive.Name\";\n"],"mappings":";;;;;AASA,MAAaI,gCAET;CAAA,MAAAG,IAAAN,EAAA,CAAA;CACF,MAAAO,OAAaL,YAAYM,KAAwB;CAAE,IAAAC;CAAA,IAAAH,EAAA,OAAAC,MAAA;EAC5CE,KAAA,oBAAA,UAAA,EAAA,UAAGF,KAAI,CAAA;EAAID,EAAA,KAAAC;EAAAD,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAAXG;AAAW;AAGpBN,wBAAwBO,cAAc;AALlC,SAAAF,MAAAG,GAAA;CAAA,OAC8BA,EAACC,WAAWL;AAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentRemove.js","names":["c","_c","ActionButtonElement","ActionButtonProps","createActionButton","useCallback","useAui","useAttachmentRemove","$","aui","t0","attachment","remove","handleRemoveAttachment","AttachmentPrimitiveRemove","Element","Props"],"sources":["../../../src/primitives/attachment/AttachmentRemove.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\n\nconst useAttachmentRemove = () => {\n const aui = useAui();\n\n const handleRemoveAttachment = useCallback(() => {\n aui.attachment.remove();\n }, [aui]);\n\n return handleRemoveAttachment;\n};\n\nexport namespace AttachmentPrimitiveRemove {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useAttachmentRemove>;\n}\n\nexport const AttachmentPrimitiveRemove = createActionButton(\n \"AttachmentPrimitive.Remove\",\n useAttachmentRemove,\n);\n"],"mappings":";;;;;;AAUA,MAAMO,4BAAsB;CAAA,MAAAC,IAAAP,EAAA,CAAA;CAC1B,MAAAQ,MAAYH,OAAO;CAAE,IAAAI;CAAA,IAAAF,EAAA,OAAAC,IAAAE,YAAA;EAEsBD,WAAA;GACzCD,IAAGE,WAAWC,OAAQ;EAAC;EACxBJ,EAAA,KAAAC,IAAAE;EAAAH,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAS,OAEHK;AAAsB;AAQ/B,MAAaC,4BAA4BV,mBACvC,8BACAG,mBACF"}
1
+ {"version":3,"file":"AttachmentRemove.js","names":["c","_c","ActionButtonElement","ActionButtonProps","createActionButton","useCallback","useAui","useAttachmentRemove","$","aui","t0","attachment","remove","handleRemoveAttachment","AttachmentPrimitiveRemove","Element","Props","_c","handleRemoveAttachment"],"sources":["../../../src/primitives/attachment/AttachmentRemove.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\n\nconst useAttachmentRemove = () => {\n const aui = useAui();\n\n const handleRemoveAttachment = useCallback(() => {\n aui.attachment.remove();\n }, [aui]);\n\n return handleRemoveAttachment;\n};\n\nexport namespace AttachmentPrimitiveRemove {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useAttachmentRemove>;\n}\n\nexport const AttachmentPrimitiveRemove = createActionButton(\n \"AttachmentPrimitive.Remove\",\n useAttachmentRemove,\n);\n"],"mappings":";;;;;;AAUA,MAAMO,4BAAsB;CAAA,MAAAC,IAAAP,EAAA,CAAA;CAC1B,MAAAQ,MAAYH,OAAO;CAAE,IAAAI;CAAA,IAAAF,EAAA,OAAAC,IAAAE,YAAA;EAEsBD,WAAA;GACzCD,IAAGE,WAAWC,OAAQ;EAAC;EACxBJ,EAAA,KAAAC,IAAAE;EAAAH,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAS,OAEHK;AAAsB;AAQ/B,MAAaC,4BAA4BV,mBACvC,8BACAG,mBACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentRoot.js","names":["c","_c","Primitive","ComponentPropsWithoutRef","ComponentRef","forwardRef","PrimitiveDivProps","div","AttachmentPrimitiveRoot","Element","Props","props","ref","$","t0","displayName"],"sources":["../../../src/primitives/attachment/AttachmentRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace AttachmentPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n /**\n * Props for the AttachmentPrimitive.Root component.\n * Accepts all standard div element props.\n */\n export type Props = PrimitiveDivProps;\n}\n\n/**\n * The root container component for an attachment.\n *\n * This component provides the foundational wrapper for attachment-related components\n * and content. It serves as the context provider for attachment state and actions.\n *\n * @example\n * ```tsx\n * <AttachmentPrimitive.Root>\n * <AttachmentPrimitive.Name />\n * <AttachmentPrimitive.Remove />\n * </AttachmentPrimitive.Root>\n * ```\n */\nexport const AttachmentPrimitiveRoot = forwardRef<\n AttachmentPrimitiveRoot.Element,\n AttachmentPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nAttachmentPrimitiveRoot.displayName = \"AttachmentPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,MAAaQ,0BAA0BH,YAGrCM,OAAAC,QAAA;CAAA,MAAAC,IAAAZ,EAAA,CAAA;CAAA,IAAAa;CAAA,IAAAD,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EACOE,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBH;GAAYC;EAAG,CAAA;EAAIC,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAAtCC;AAAsC,CAC9C;AAEDN,wBAAwBO,cAAc"}
1
+ {"version":3,"file":"AttachmentRoot.js","names":["c","_c","Primitive","ComponentPropsWithoutRef","ComponentRef","forwardRef","PrimitiveDivProps","div","AttachmentPrimitiveRoot","Element","Props","props","ref","$","t0","displayName","_c"],"sources":["../../../src/primitives/attachment/AttachmentRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace AttachmentPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n /**\n * Props for the AttachmentPrimitive.Root component.\n * Accepts all standard div element props.\n */\n export type Props = PrimitiveDivProps;\n}\n\n/**\n * The root container component for an attachment.\n *\n * This component provides the foundational wrapper for attachment-related components\n * and content. It serves as the context provider for attachment state and actions.\n *\n * @example\n * ```tsx\n * <AttachmentPrimitive.Root>\n * <AttachmentPrimitive.Name />\n * <AttachmentPrimitive.Remove />\n * </AttachmentPrimitive.Root>\n * ```\n */\nexport const AttachmentPrimitiveRoot = forwardRef<\n AttachmentPrimitiveRoot.Element,\n AttachmentPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nAttachmentPrimitiveRoot.displayName = \"AttachmentPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,MAAaQ,0BAA0BH,YAGrCM,OAAAC,QAAA;CAAA,MAAAC,IAAAZ,EAAA,CAAA;CAAA,IAAAa;CAAA,IAAAD,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EACOE,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBH;GAAYC;EAAG,CAAA;EAAIC,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAAtCC;AAAsC,CAC9C;AAEDN,wBAAwBO,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentThumb.js","names":["c","_c","ComponentPropsWithoutRef","forwardRef","ComponentRef","useAuiState","Primitive","PrimitiveDivProps","div","AttachmentPrimitiveThumb","Element","Props","props","ref","$","label","_temp","t0","children","t1","displayName","s","name","attachment","dot","lastIndexOf","length","slice","type"],"sources":["../../../src/primitives/attachment/AttachmentThumb.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type ComponentRef,\n} from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { Primitive } from \"../../utils/Primitive\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace AttachmentPrimitiveThumb {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\nexport const AttachmentPrimitiveThumb = forwardRef<\n AttachmentPrimitiveThumb.Element,\n AttachmentPrimitiveThumb.Props\n>((props, ref) => {\n const label = useAuiState((s) => {\n const name = s.attachment.name;\n const dot = name.lastIndexOf(\".\");\n if (dot > 0 && dot < name.length - 1) {\n return `.${name.slice(dot + 1)}`;\n }\n return s.attachment.type;\n });\n return (\n <Primitive.div {...props} ref={ref}>\n {props.children ?? label}\n </Primitive.div>\n );\n});\n\nAttachmentPrimitiveThumb.displayName = \"AttachmentPrimitive.unstable_Thumb\";\n"],"mappings":";;;;;;;AAiBA,MAAaS,2BAA2BN,YAGtCS,OAAAC,QAAA;CAAA,MAAAC,IAAAb,EAAA,CAAA;CACA,MAAAc,QAAcV,YAAYW,KAOzB;CAGI,MAAAC,KAAAL,MAAKM,YAALH;CAAuB,IAAAI;CAAA,IAAAL,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,IAAA;EAD1BE,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBP;GAAYC;GAC5BI,UAAAA;EACH,CAAA;EAAgBH,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFhBK;AAEgB,CAEnB;AAEDV,yBAAyBW,cAAc;AAhBrC,SAAAJ,MAAAK,GAAA;CAEE,MAAAC,OAAaD,EAACE,WAAWD;CACzB,MAAAE,MAAYF,KAAIG,YAAa,GAAG;CAChC,IAAID,MAAM,KAAKA,MAAMF,KAAII,SAAU,GAAC,OAC3B,IAAIJ,KAAIK,MAAOH,MAAM,CAAC;CAC9B,OACMH,EAACE,WAAWK;AAAK"}
1
+ {"version":3,"file":"AttachmentThumb.js","names":["c","_c","ComponentPropsWithoutRef","forwardRef","ComponentRef","useAuiState","Primitive","PrimitiveDivProps","div","AttachmentPrimitiveThumb","Element","Props","props","ref","$","label","_temp","t0","children","t1","displayName","s","name","attachment","dot","lastIndexOf","length","slice","type","_c"],"sources":["../../../src/primitives/attachment/AttachmentThumb.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type ComponentRef,\n} from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { Primitive } from \"../../utils/Primitive\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace AttachmentPrimitiveThumb {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\nexport const AttachmentPrimitiveThumb = forwardRef<\n AttachmentPrimitiveThumb.Element,\n AttachmentPrimitiveThumb.Props\n>((props, ref) => {\n const label = useAuiState((s) => {\n const name = s.attachment.name;\n const dot = name.lastIndexOf(\".\");\n if (dot > 0 && dot < name.length - 1) {\n return `.${name.slice(dot + 1)}`;\n }\n return s.attachment.type;\n });\n return (\n <Primitive.div {...props} ref={ref}>\n {props.children ?? label}\n </Primitive.div>\n );\n});\n\nAttachmentPrimitiveThumb.displayName = \"AttachmentPrimitive.unstable_Thumb\";\n"],"mappings":";;;;;;;AAiBA,MAAaS,2BAA2BN,YAGtCS,OAAAC,QAAA;CAAA,MAAAC,IAAAb,EAAA,CAAA;CACA,MAAAc,QAAcV,YAAYW,KAOzB;CAGI,MAAAC,KAAAL,MAAKM,YAALH;CAAuB,IAAAI;CAAA,IAAAL,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAG,IAAA;EAD1BE,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBP;GAAYC;GAC5BI,UAAAA;EACH,CAAA;EAAgBH,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFhBK;AAEgB,CAEnB;AAEDV,yBAAyBW,cAAc;AAhBrC,SAAAJ,MAAAK,GAAA;CAEE,MAAAC,OAAaD,EAACE,WAAWD;CACzB,MAAAE,MAAYF,KAAIG,YAAa,GAAG;CAChC,IAAID,MAAM,KAAKA,MAAMF,KAAII,SAAU,GAAC,OAC3B,IAAIJ,KAAIK,MAAOH,MAAM,CAAC;CAC9B,OACMH,EAACE,WAAWK;AAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"BranchPickerCount.js","names":["c","_c","FC","useAuiState","useBranchPickerCount","branchCount","_temp","BranchPickerPrimitiveCount","Props","Record","$","t0","displayName","s","message"],"sources":["../../../src/primitives/branchPicker/BranchPickerCount.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nconst useBranchPickerCount = () => {\n const branchCount = useAuiState((s) => s.message.branchCount);\n return branchCount;\n};\n\nexport namespace BranchPickerPrimitiveCount {\n /**\n * Props for the BranchPickerPrimitive.Count component.\n * This component takes no props.\n */\n export type Props = Record<string, never>;\n}\n\n/**\n * A component that displays the total number of branches for the current message.\n *\n * This component renders the branch count as plain text, useful for showing\n * users how many alternative responses are available.\n *\n * @example\n * ```tsx\n * <div>\n * Branch <BranchPickerPrimitive.Count /> of {totalBranches}\n * </div>\n * ```\n */\nexport const BranchPickerPrimitiveCount: FC<\n BranchPickerPrimitiveCount.Props\n> = () => {\n const branchCount = useBranchPickerCount();\n return <>{branchCount}</>;\n};\n\nBranchPickerPrimitiveCount.displayName = \"BranchPickerPrimitive.Count\";\n"],"mappings":";;;;;AAKA,MAAMI,6BAAuB;CACmC,OAA1CD,YAAYG,KACzBD;AAAW;;;;;;;;;;;;;;AAwBpB,MAAaE,mCAET;CAAA,MAAAG,IAAAT,EAAA,CAAA;CACF,MAAAI,cAAoBD,qBAAqB;CAAE,IAAAO;CAAA,IAAAD,EAAA,OAAAL,aAAA;EACpCM,KAAA,oBAAA,UAAA,EAAA,UAAGN,YAAW,CAAA;EAAIK,EAAA,KAAAL;EAAAK,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAAlBC;AAAkB;AAG3BJ,2BAA2BK,cAAc;AAjCZ,SAAAN,MAAAO,GAAA;CAAA,OACYA,EAACC,QAAQT;AAAY"}
1
+ {"version":3,"file":"BranchPickerCount.js","names":["c","_c","FC","useAuiState","useBranchPickerCount","branchCount","_temp","BranchPickerPrimitiveCount","Props","Record","$","t0","displayName","s","message","_c"],"sources":["../../../src/primitives/branchPicker/BranchPickerCount.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nconst useBranchPickerCount = () => {\n const branchCount = useAuiState((s) => s.message.branchCount);\n return branchCount;\n};\n\nexport namespace BranchPickerPrimitiveCount {\n /**\n * Props for the BranchPickerPrimitive.Count component.\n * This component takes no props.\n */\n export type Props = Record<string, never>;\n}\n\n/**\n * A component that displays the total number of branches for the current message.\n *\n * This component renders the branch count as plain text, useful for showing\n * users how many alternative responses are available.\n *\n * @example\n * ```tsx\n * <div>\n * Branch <BranchPickerPrimitive.Count /> of {totalBranches}\n * </div>\n * ```\n */\nexport const BranchPickerPrimitiveCount: FC<\n BranchPickerPrimitiveCount.Props\n> = () => {\n const branchCount = useBranchPickerCount();\n return <>{branchCount}</>;\n};\n\nBranchPickerPrimitiveCount.displayName = \"BranchPickerPrimitive.Count\";\n"],"mappings":";;;;;AAKA,MAAMI,6BAAuB;CACmC,OAA1CD,YAAYG,KACzBD;AAAW;;;;;;;;;;;;;;AAwBpB,MAAaE,mCAET;CAAA,MAAAG,IAAAT,EAAA,CAAA;CACF,MAAAI,cAAoBD,qBAAqB;CAAE,IAAAO;CAAA,IAAAD,EAAA,OAAAL,aAAA;EACpCM,KAAA,oBAAA,UAAA,EAAA,UAAGN,YAAW,CAAA;EAAIK,EAAA,KAAAL;EAAAK,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAAlBC;AAAkB;AAG3BJ,2BAA2BK,cAAc;AAjCZ,SAAAN,MAAAO,GAAA;CAAA,OACYA,EAACC,QAAQT;AAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"BranchPickerNext.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useBranchPickerNext","useBranchPickerNextBehavior","disabled","next","BranchPickerPrimitiveNext","Element","Props"],"sources":["../../../src/primitives/branchPicker/BranchPickerNext.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useBranchPickerNext as useBranchPickerNextBehavior } from \"@assistant-ui/core/react\";\n\nconst useBranchPickerNext = () => {\n const { disabled, next } = useBranchPickerNextBehavior();\n if (disabled) return null;\n return next;\n};\n\nexport namespace BranchPickerPrimitiveNext {\n export type Element = ActionButtonElement;\n /**\n * Props for the BranchPickerPrimitive.Next component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useBranchPickerNext>;\n}\n\n/**\n * A button component that navigates to the next branch in the message tree.\n *\n * This component automatically handles switching to the next available branch\n * and is disabled when there are no more branches to navigate to.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Next>\n * Next →\n * </BranchPickerPrimitive.Next>\n * ```\n */\nexport const BranchPickerPrimitiveNext = createActionButton(\n \"BranchPickerPrimitive.Next\",\n useBranchPickerNext,\n);\n"],"mappings":";;;;AASA,MAAMG,8BAAsB;CAC1B,MAAA,EAAAE,UAAAC,SAA2BF,oBAA4B;CACvD,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAI;;;;;;;;;;;;;;AAyBb,MAAaC,4BAA4BL,mBACvC,8BACAC,qBACF"}
1
+ {"version":3,"file":"BranchPickerNext.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useBranchPickerNext","useBranchPickerNextBehavior","disabled","next","BranchPickerPrimitiveNext","Element","Props","useBranchPickerNext","useBranchPickerNextBehavior"],"sources":["../../../src/primitives/branchPicker/BranchPickerNext.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useBranchPickerNext as useBranchPickerNextBehavior } from \"@assistant-ui/core/react\";\n\nconst useBranchPickerNext = () => {\n const { disabled, next } = useBranchPickerNextBehavior();\n if (disabled) return null;\n return next;\n};\n\nexport namespace BranchPickerPrimitiveNext {\n export type Element = ActionButtonElement;\n /**\n * Props for the BranchPickerPrimitive.Next component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useBranchPickerNext>;\n}\n\n/**\n * A button component that navigates to the next branch in the message tree.\n *\n * This component automatically handles switching to the next available branch\n * and is disabled when there are no more branches to navigate to.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Next>\n * Next →\n * </BranchPickerPrimitive.Next>\n * ```\n */\nexport const BranchPickerPrimitiveNext = createActionButton(\n \"BranchPickerPrimitive.Next\",\n useBranchPickerNext,\n);\n"],"mappings":";;;;AASA,MAAMG,8BAAsB;CAC1B,MAAA,EAAAE,UAAAC,SAA2BF,oBAA4B;CACvD,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAI;;;;;;;;;;;;;;AAyBb,MAAaC,4BAA4BL,mBACvC,8BACAC,qBACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"BranchPickerNumber.js","names":["c","_c","FC","useAuiState","useBranchPickerNumber","branchNumber","_temp","BranchPickerPrimitiveNumber","Props","Record","$","t0","displayName","s","message"],"sources":["../../../src/primitives/branchPicker/BranchPickerNumber.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nconst useBranchPickerNumber = () => {\n const branchNumber = useAuiState((s) => s.message.branchNumber);\n return branchNumber;\n};\n\nexport namespace BranchPickerPrimitiveNumber {\n export type Props = Record<string, never>;\n}\n\nexport const BranchPickerPrimitiveNumber: FC<\n BranchPickerPrimitiveNumber.Props\n> = () => {\n const branchNumber = useBranchPickerNumber();\n return <>{branchNumber}</>;\n};\n\nBranchPickerPrimitiveNumber.displayName = \"BranchPickerPrimitive.Number\";\n"],"mappings":";;;;;AAKA,MAAMI,8BAAwB;CACoC,OAA3CD,YAAYG,KAC1BD;AAAY;AAOrB,MAAaE,oCAET;CAAA,MAAAG,IAAAT,EAAA,CAAA;CACF,MAAAI,eAAqBD,sBAAsB;CAAE,IAAAO;CAAA,IAAAD,EAAA,OAAAL,cAAA;EACtCM,KAAA,oBAAA,UAAA,EAAA,UAAGN,aAAY,CAAA;EAAIK,EAAA,KAAAL;EAAAK,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAAnBC;AAAmB;AAG5BJ,4BAA4BK,cAAc;AAhBZ,SAAAN,MAAAO,GAAA;CAAA,OACYA,EAACC,QAAQT;AAAa"}
1
+ {"version":3,"file":"BranchPickerNumber.js","names":["c","_c","FC","useAuiState","useBranchPickerNumber","branchNumber","_temp","BranchPickerPrimitiveNumber","Props","Record","$","t0","displayName","s","message","_c"],"sources":["../../../src/primitives/branchPicker/BranchPickerNumber.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nconst useBranchPickerNumber = () => {\n const branchNumber = useAuiState((s) => s.message.branchNumber);\n return branchNumber;\n};\n\nexport namespace BranchPickerPrimitiveNumber {\n export type Props = Record<string, never>;\n}\n\nexport const BranchPickerPrimitiveNumber: FC<\n BranchPickerPrimitiveNumber.Props\n> = () => {\n const branchNumber = useBranchPickerNumber();\n return <>{branchNumber}</>;\n};\n\nBranchPickerPrimitiveNumber.displayName = \"BranchPickerPrimitive.Number\";\n"],"mappings":";;;;;AAKA,MAAMI,8BAAwB;CACoC,OAA3CD,YAAYG,KAC1BD;AAAY;AAOrB,MAAaE,oCAET;CAAA,MAAAG,IAAAT,EAAA,CAAA;CACF,MAAAI,eAAqBD,sBAAsB;CAAE,IAAAO;CAAA,IAAAD,EAAA,OAAAL,cAAA;EACtCM,KAAA,oBAAA,UAAA,EAAA,UAAGN,aAAY,CAAA;EAAIK,EAAA,KAAAL;EAAAK,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAAnBC;AAAmB;AAG5BJ,4BAA4BK,cAAc;AAhBZ,SAAAN,MAAAO,GAAA;CAAA,OACYA,EAACC,QAAQT;AAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"BranchPickerPrevious.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useBranchPickerPrevious","useBranchPickerPreviousBehavior","disabled","previous","BranchPickerPrimitivePrevious","Element","Props"],"sources":["../../../src/primitives/branchPicker/BranchPickerPrevious.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useBranchPickerPrevious as useBranchPickerPreviousBehavior } from \"@assistant-ui/core/react\";\n\nconst useBranchPickerPrevious = () => {\n const { disabled, previous } = useBranchPickerPreviousBehavior();\n if (disabled) return null;\n return previous;\n};\n\nexport namespace BranchPickerPrimitivePrevious {\n export type Element = ActionButtonElement;\n /**\n * Props for the BranchPickerPrimitive.Previous component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useBranchPickerPrevious>;\n}\n\n/**\n * A button component that navigates to the previous branch in the message tree.\n *\n * This component automatically handles switching to the previous available branch\n * and is disabled when there are no previous branches to navigate to.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Previous>\n * ← Previous\n * </BranchPickerPrimitive.Previous>\n * ```\n */\nexport const BranchPickerPrimitivePrevious = createActionButton(\n \"BranchPickerPrimitive.Previous\",\n useBranchPickerPrevious,\n);\n"],"mappings":";;;;AASA,MAAMG,kCAA0B;CAC9B,MAAA,EAAAE,UAAAC,aAA+BF,wBAAgC;CAC/D,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAQ;;;;;;;;;;;;;;AAyBjB,MAAaC,gCAAgCL,mBAC3C,kCACAC,yBACF"}
1
+ {"version":3,"file":"BranchPickerPrevious.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useBranchPickerPrevious","useBranchPickerPreviousBehavior","disabled","previous","BranchPickerPrimitivePrevious","Element","Props","useBranchPickerPrevious","useBranchPickerPreviousBehavior"],"sources":["../../../src/primitives/branchPicker/BranchPickerPrevious.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useBranchPickerPrevious as useBranchPickerPreviousBehavior } from \"@assistant-ui/core/react\";\n\nconst useBranchPickerPrevious = () => {\n const { disabled, previous } = useBranchPickerPreviousBehavior();\n if (disabled) return null;\n return previous;\n};\n\nexport namespace BranchPickerPrimitivePrevious {\n export type Element = ActionButtonElement;\n /**\n * Props for the BranchPickerPrimitive.Previous component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useBranchPickerPrevious>;\n}\n\n/**\n * A button component that navigates to the previous branch in the message tree.\n *\n * This component automatically handles switching to the previous available branch\n * and is disabled when there are no previous branches to navigate to.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Previous>\n * ← Previous\n * </BranchPickerPrimitive.Previous>\n * ```\n */\nexport const BranchPickerPrimitivePrevious = createActionButton(\n \"BranchPickerPrimitive.Previous\",\n useBranchPickerPrevious,\n);\n"],"mappings":";;;;AASA,MAAMG,kCAA0B;CAC9B,MAAA,EAAAE,UAAAC,aAA+BF,wBAAgC;CAC/D,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAQ;;;;;;;;;;;;;;AAyBjB,MAAaC,gCAAgCL,mBAC3C,kCACAC,yBACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"BranchPickerRoot.js","names":["c","_c","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","AuiIf","BranchPickerPrimitiveRoot","Element","div","Props","hideWhenSingleBranch","t0","ref","$","rest","t1","s","message","branchCount","t2","t3","displayName"],"sources":["../../../src/primitives/branchPicker/BranchPickerRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n} from \"react\";\nimport { AuiIf } from \"@assistant-ui/store\";\n\nexport namespace BranchPickerPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n /**\n * Whether to hide the branch picker when there's only one branch available.\n * When true, the component will only render when multiple branches exist.\n * @default false\n */\n hideWhenSingleBranch?: boolean | undefined;\n };\n}\n\n/**\n * The root container for branch picker components.\n *\n * This component provides a container for branch navigation controls,\n * with optional conditional rendering based on the number of available branches.\n * It integrates with the message branching system to allow users to navigate\n * between different response variations.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Root hideWhenSingleBranch={true}>\n * <BranchPickerPrimitive.Previous />\n * <BranchPickerPrimitive.Count />\n * <BranchPickerPrimitive.Next />\n * </BranchPickerPrimitive.Root>\n * ```\n */\nexport const BranchPickerPrimitiveRoot = forwardRef<\n BranchPickerPrimitiveRoot.Element,\n BranchPickerPrimitiveRoot.Props\n>(({ hideWhenSingleBranch, ...rest }, ref) => {\n return (\n <AuiIf\n condition={(s) => !hideWhenSingleBranch || s.message.branchCount >= 2}\n >\n <Primitive.div {...rest} ref={ref} />\n </AuiIf>\n );\n});\n\nBranchPickerPrimitiveRoot.displayName = \"BranchPickerPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAaO,4BAA4BH,YAGvCQ,IAAAC,QAAA;CAAA,MAAAC,IAAAb,EAAA,EAAA;CAAA,IAAAU;CAAA,IAAAI;CAAA,IAAAD,EAAA,OAAAF,IAAA;EAAC,CAAA,CAAAD,sBAAA,GAAAI,QAAAH;EAAiCE,EAAA,KAAAF;EAAAE,EAAA,KAAAH;EAAAG,EAAA,KAAAC;CAAA,OAAA;EAAAJ,uBAAAG,EAAA;EAAAC,OAAAD,EAAA;CAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAH,sBAAA;EAGnBK,MAAAC,MAAO,CAACN,wBAAwBM,EAACC,QAAQC,eAAgB;EAACL,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAD,OAAAC,EAAA,OAAAC,MAAA;EAErEK,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBL;GAAWF;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAE,MAAAF,EAAA,OAAAM,IAAA;EAHvCC,KAAA,oBAAC,OAAD;GACa,WAAAL;GAEXI,UAAAA;EAHI,CAAA;EAIEN,EAAA,KAAAE;EAAAF,EAAA,KAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAJRO;AAIQ,CAEX;AAEDd,0BAA0Be,cAAc"}
1
+ {"version":3,"file":"BranchPickerRoot.js","names":["c","_c","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","AuiIf","BranchPickerPrimitiveRoot","Element","div","Props","hideWhenSingleBranch","t0","ref","$","rest","t1","s","message","branchCount","t2","t3","displayName","_c"],"sources":["../../../src/primitives/branchPicker/BranchPickerRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n} from \"react\";\nimport { AuiIf } from \"@assistant-ui/store\";\n\nexport namespace BranchPickerPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n /**\n * Whether to hide the branch picker when there's only one branch available.\n * When true, the component will only render when multiple branches exist.\n * @default false\n */\n hideWhenSingleBranch?: boolean | undefined;\n };\n}\n\n/**\n * The root container for branch picker components.\n *\n * This component provides a container for branch navigation controls,\n * with optional conditional rendering based on the number of available branches.\n * It integrates with the message branching system to allow users to navigate\n * between different response variations.\n *\n * @example\n * ```tsx\n * <BranchPickerPrimitive.Root hideWhenSingleBranch={true}>\n * <BranchPickerPrimitive.Previous />\n * <BranchPickerPrimitive.Count />\n * <BranchPickerPrimitive.Next />\n * </BranchPickerPrimitive.Root>\n * ```\n */\nexport const BranchPickerPrimitiveRoot = forwardRef<\n BranchPickerPrimitiveRoot.Element,\n BranchPickerPrimitiveRoot.Props\n>(({ hideWhenSingleBranch, ...rest }, ref) => {\n return (\n <AuiIf\n condition={(s) => !hideWhenSingleBranch || s.message.branchCount >= 2}\n >\n <Primitive.div {...rest} ref={ref} />\n </AuiIf>\n );\n});\n\nBranchPickerPrimitiveRoot.displayName = \"BranchPickerPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAaO,4BAA4BH,YAGvCQ,IAAAC,QAAA;CAAA,MAAAC,IAAAb,EAAA,EAAA;CAAA,IAAAU;CAAA,IAAAI;CAAA,IAAAD,EAAA,OAAAF,IAAA;EAAC,CAAA,CAAAD,sBAAA,GAAAI,QAAAH;EAAiCE,EAAA,KAAAF;EAAAE,EAAA,KAAAH;EAAAG,EAAA,KAAAC;CAAA,OAAA;EAAAJ,uBAAAG,EAAA;EAAAC,OAAAD,EAAA;CAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAH,sBAAA;EAGnBK,MAAAC,MAAO,CAACN,wBAAwBM,EAACC,QAAQC,eAAgB;EAACL,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAD,OAAAC,EAAA,OAAAC,MAAA;EAErEK,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBL;GAAWF;EAAG,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAE,MAAAF,EAAA,OAAAM,IAAA;EAHvCC,KAAA,oBAAC,OAAD;GACa,WAAAL;GAEXI,UAAAA;EAHI,CAAA;EAIEN,EAAA,KAAAE;EAAAF,EAAA,KAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAJRO;AAIQ,CAEX;AAEDd,0BAA0Be,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChainOfThoughtAccordionTrigger.js","names":["c","_c","ActionButtonElement","ActionButtonProps","createActionButton","useCallback","useAuiState","useAui","useChainOfThoughtAccordionTrigger","$","aui","collapsed","_temp","t0","chainOfThought","setCollapsed","callback","ChainOfThoughtPrimitiveAccordionTrigger","Element","Props","s"],"sources":["../../../src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAuiState, useAui } from \"@assistant-ui/store\";\n\nconst useChainOfThoughtAccordionTrigger = () => {\n const aui = useAui();\n const collapsed = useAuiState((s) => s.chainOfThought.collapsed);\n\n const callback = useCallback(() => {\n aui.chainOfThought.setCollapsed(!collapsed);\n }, [aui, collapsed]);\n\n return callback;\n};\n\nexport namespace ChainOfThoughtPrimitiveAccordionTrigger {\n export type Element = ActionButtonElement;\n /**\n * Props for the ChainOfThoughtPrimitive.AccordionTrigger component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<\n typeof useChainOfThoughtAccordionTrigger\n >;\n}\n\n/**\n * A button component that toggles the collapsed state of the chain of thought accordion.\n *\n * This component automatically handles the toggle functionality, expanding or collapsing\n * the chain of thought parts when clicked.\n *\n * @example\n * ```tsx\n * <ChainOfThoughtPrimitive.AccordionTrigger>\n * Toggle Reasoning\n * </ChainOfThoughtPrimitive.AccordionTrigger>\n * ```\n */\nexport const ChainOfThoughtPrimitiveAccordionTrigger = createActionButton(\n \"ChainOfThoughtPrimitive.AccordionTrigger\",\n useChainOfThoughtAccordionTrigger,\n);\n"],"mappings":";;;;;;AAUA,MAAMQ,0CAAoC;CAAA,MAAAC,IAAAR,EAAA,CAAA;CACxC,MAAAS,MAAYH,OAAO;CACnB,MAAAI,YAAkBL,YAAYM,KAAiC;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAC,IAAAI,kBAAAL,EAAA,OAAAE,WAAA;EAEpCE,WAAA;GAC3BH,IAAGI,eAAeC,aAAc,CAACJ,SAAS;EAAC;EAC5CF,EAAA,KAAAC,IAAAI;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAoB,OAEdO;AAAQ;;;;;;;;;;;;;;AA2BjB,MAAaC,0CAA0Cb,mBACrD,4CACAI,iCACF;AAtC0C,SAAAI,MAAAQ,GAAA;CAAA,OAEHA,EAACN,eAAeH;AAAU"}
1
+ {"version":3,"file":"ChainOfThoughtAccordionTrigger.js","names":["c","_c","ActionButtonElement","ActionButtonProps","createActionButton","useCallback","useAuiState","useAui","useChainOfThoughtAccordionTrigger","$","aui","collapsed","_temp","t0","chainOfThought","setCollapsed","callback","ChainOfThoughtPrimitiveAccordionTrigger","Element","Props","s","_c","callback"],"sources":["../../../src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAuiState, useAui } from \"@assistant-ui/store\";\n\nconst useChainOfThoughtAccordionTrigger = () => {\n const aui = useAui();\n const collapsed = useAuiState((s) => s.chainOfThought.collapsed);\n\n const callback = useCallback(() => {\n aui.chainOfThought.setCollapsed(!collapsed);\n }, [aui, collapsed]);\n\n return callback;\n};\n\nexport namespace ChainOfThoughtPrimitiveAccordionTrigger {\n export type Element = ActionButtonElement;\n /**\n * Props for the ChainOfThoughtPrimitive.AccordionTrigger component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<\n typeof useChainOfThoughtAccordionTrigger\n >;\n}\n\n/**\n * A button component that toggles the collapsed state of the chain of thought accordion.\n *\n * This component automatically handles the toggle functionality, expanding or collapsing\n * the chain of thought parts when clicked.\n *\n * @example\n * ```tsx\n * <ChainOfThoughtPrimitive.AccordionTrigger>\n * Toggle Reasoning\n * </ChainOfThoughtPrimitive.AccordionTrigger>\n * ```\n */\nexport const ChainOfThoughtPrimitiveAccordionTrigger = createActionButton(\n \"ChainOfThoughtPrimitive.AccordionTrigger\",\n useChainOfThoughtAccordionTrigger,\n);\n"],"mappings":";;;;;;AAUA,MAAMQ,0CAAoC;CAAA,MAAAC,IAAAR,EAAA,CAAA;CACxC,MAAAS,MAAYH,OAAO;CACnB,MAAAI,YAAkBL,YAAYM,KAAiC;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAC,IAAAI,kBAAAL,EAAA,OAAAE,WAAA;EAEpCE,WAAA;GAC3BH,IAAGI,eAAeC,aAAc,CAACJ,SAAS;EAAC;EAC5CF,EAAA,KAAAC,IAAAI;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAoB,OAEdO;AAAQ;;;;;;;;;;;;;;AA2BjB,MAAaC,0CAA0Cb,mBACrD,4CACAI,iCACF;AAtC0C,SAAAI,MAAAQ,GAAA;CAAA,OAEHA,EAACN,eAAeH;AAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChainOfThoughtRoot.js","names":["c","_c","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","PrimitiveDivProps","div","ChainOfThoughtPrimitiveRoot","Element","Props","props","ref","$","t0","displayName"],"sources":["../../../src/primitives/chainOfThought/ChainOfThoughtRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n} from \"react\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace ChainOfThoughtPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\n/**\n * The root container for chain of thought components.\n *\n * This component provides a wrapper for chain of thought content,\n * including reasoning and tool-call parts that can be collapsed in an accordion.\n *\n * @example\n * ```tsx\n * <ChainOfThoughtPrimitive.Root>\n * <ChainOfThoughtPrimitive.AccordionTrigger>\n * Toggle reasoning\n * </ChainOfThoughtPrimitive.AccordionTrigger>\n * <ChainOfThoughtPrimitive.Parts />\n * </ChainOfThoughtPrimitive.Root>\n * ```\n */\nexport const ChainOfThoughtPrimitiveRoot = forwardRef<\n ChainOfThoughtPrimitiveRoot.Element,\n ChainOfThoughtPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nChainOfThoughtPrimitiveRoot.displayName = \"ChainOfThoughtPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAaQ,8BAA8BJ,YAGzCO,OAAAC,QAAA;CAAA,MAAAC,IAAAZ,EAAA,CAAA;CAAA,IAAAa;CAAA,IAAAD,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EACOE,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBH;GAAYC;EAAG,CAAA;EAAIC,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAAtCC;AAAsC,CAC9C;AAEDN,4BAA4BO,cAAc"}
1
+ {"version":3,"file":"ChainOfThoughtRoot.js","names":["c","_c","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","PrimitiveDivProps","div","ChainOfThoughtPrimitiveRoot","Element","Props","props","ref","$","t0","displayName","_c"],"sources":["../../../src/primitives/chainOfThought/ChainOfThoughtRoot.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n} from \"react\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace ChainOfThoughtPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps;\n}\n\n/**\n * The root container for chain of thought components.\n *\n * This component provides a wrapper for chain of thought content,\n * including reasoning and tool-call parts that can be collapsed in an accordion.\n *\n * @example\n * ```tsx\n * <ChainOfThoughtPrimitive.Root>\n * <ChainOfThoughtPrimitive.AccordionTrigger>\n * Toggle reasoning\n * </ChainOfThoughtPrimitive.AccordionTrigger>\n * <ChainOfThoughtPrimitive.Parts />\n * </ChainOfThoughtPrimitive.Root>\n * ```\n */\nexport const ChainOfThoughtPrimitiveRoot = forwardRef<\n ChainOfThoughtPrimitiveRoot.Element,\n ChainOfThoughtPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nChainOfThoughtPrimitiveRoot.displayName = \"ChainOfThoughtPrimitive.Root\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAaQ,8BAA8BJ,YAGzCO,OAAAC,QAAA;CAAA,MAAAC,IAAAZ,EAAA,CAAA;CAAA,IAAAa;CAAA,IAAAD,EAAA,OAAAF,SAAAE,EAAA,OAAAD,KAAA;EACOE,KAAA,oBAAA,UAAA,KAAA;GAAA,GAAmBH;GAAYC;EAAG,CAAA;EAAIC,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,OAAtCC;AAAsC,CAC9C;AAEDN,4BAA4BO,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerAddAttachment.js","names":["c","_c","ActionButtonElement","ActionButtonProps","createActionButton","useCallback","useAui","useComposerAddAttachment","useComposerAddAttachmentBehavior","t0","$","t1","undefined","multiple","t2","disabled","addAttachment","aui","t3","composer","input","document","createElement","type","hidden","attachmentAccept","getState","accept","body","appendChild","onchange","e","fileList","target","HTMLInputElement","files","attachmentPromises","Array","from","file","removeChild","Promise","all","oncancel","length","click","callback","ComposerPrimitiveAddAttachment","Element","Props"],"sources":["../../../src/primitives/composer/ComposerAddAttachment.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useComposerAddAttachment as useComposerAddAttachmentBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerAddAttachment = ({\n multiple = true,\n}: {\n /** allow selecting multiple files */\n multiple?: boolean | undefined;\n} = {}) => {\n const { disabled, addAttachment } = useComposerAddAttachmentBehavior();\n const aui = useAui();\n\n const callback = useCallback(() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.multiple = multiple;\n input.hidden = true;\n\n const attachmentAccept = aui.composer.getState().attachmentAccept;\n if (attachmentAccept !== \"*\") {\n input.accept = attachmentAccept;\n }\n\n document.body.appendChild(input);\n\n input.onchange = async (e) => {\n const fileList = (e.target as HTMLInputElement).files;\n if (!fileList) return;\n\n const attachmentPromises = Array.from(fileList, async (file) => {\n try {\n await addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n });\n\n document.body.removeChild(input);\n await Promise.all(attachmentPromises);\n };\n\n input.oncancel = () => {\n if (!input.files || input.files.length === 0) {\n document.body.removeChild(input);\n }\n };\n\n input.click();\n }, [aui, multiple, addAttachment]);\n\n if (disabled) return null;\n return callback;\n};\n\nexport namespace ComposerPrimitiveAddAttachment {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerAddAttachment>;\n}\n\nexport const ComposerPrimitiveAddAttachment = createActionButton(\n \"ComposerPrimitive.AddAttachment\",\n useComposerAddAttachment,\n [\"multiple\"],\n);\n"],"mappings":";;;;;;;AAWA,MAAMO,8BAA2BE,OAAA;CAAA,MAAAC,IAAAT,EAAA,CAAA;CAAA,IAAAU;CAAA,IAAAD,EAAA,OAAAD,IAAA;EAACE,KAAAF,OAAAG,KAAAA,IAAA,CAK7B,IAL6BH;EAK5BC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAL4B,MAAA,EAAAG,UAAAC,OAAAH;CAChC,MAAAE,WAAAC,OAAAF,KAAAA,IAAA,OAAAE;CAKA,MAAA,EAAAC,UAAAC,kBAAoCR,yBAAiC;CACrE,MAAAS,MAAYX,OAAO;CAAE,IAAAY;CAAA,IAAAR,EAAA,OAAAM,iBAAAN,EAAA,OAAAO,IAAAE,YAAAT,EAAA,OAAAG,UAAA;EAEQK,WAAA;GAC3B,MAAAE,QAAcC,SAAQC,cAAe,OAAO;GAC5CF,MAAKG,OAAQ;GACbH,MAAKP,WAAYA;GACjBO,MAAKI,SAAU;GAEf,MAAAC,mBAAyBR,IAAGE,SAASO,SAAU,CAAC,CAAAD;GAChD,IAAIA,qBAAqB,KACvBL,MAAKO,SAAUF;GAGjBJ,SAAQO,KAAKC,YAAaT,KAAK;GAE/BA,MAAKU,WAAY,OAAAC,MAAA;IACf,MAAAC,WAAkBD,EAACE,OAA2BE;IAC9C,IAAI,CAACH,UAAQ;IAEb,MAAAI,qBAA2BC,MAAKC,KAAMN,UAAU,OAAAO,SAAA;KAC9C,IAAA;MACE,MAAMvB,cAAcuB,IAAI;KAAC,QAAA,CAAA;IAG1B,CACF;IAEDlB,SAAQO,KAAKY,YAAapB,KAAK;IAC/B,MAAMqB,QAAOC,IAAKN,kBAAkB;GAAC;GAGvChB,MAAKuB,iBAAY;IACf,IAAI,CAACvB,MAAKe,SAAUf,MAAKe,MAAMS,WAAY,GACzCvB,SAAQO,KAAKY,YAAapB,KAAK;GAChC;GAGHA,MAAKyB,MAAO;EAAC;EACdnC,EAAA,KAAAM;EAAAN,EAAA,KAAAO,IAAAE;EAAAT,EAAA,KAAAG;EAAAH,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CApCD,MAAAoC,WAAiB5B;CAsCjB,IAAIH,UAAQ,OAAS;CAAK,OACnB+B;AAAQ;AAQjB,MAAaC,iCAAiC3C,mBAC5C,mCACAG,4BACA,CAAC,UAAU,CACb"}
1
+ {"version":3,"file":"ComposerAddAttachment.js","names":["c","_c","ActionButtonElement","ActionButtonProps","createActionButton","useCallback","useAui","useComposerAddAttachment","useComposerAddAttachmentBehavior","t0","$","t1","undefined","multiple","t2","disabled","addAttachment","aui","t3","composer","input","document","createElement","type","hidden","attachmentAccept","getState","accept","body","appendChild","onchange","e","fileList","target","HTMLInputElement","files","attachmentPromises","Array","from","file","removeChild","Promise","all","oncancel","length","click","callback","ComposerPrimitiveAddAttachment","Element","Props","useComposerAddAttachment","_c","useComposerAddAttachmentBehavior"],"sources":["../../../src/primitives/composer/ComposerAddAttachment.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useComposerAddAttachment as useComposerAddAttachmentBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerAddAttachment = ({\n multiple = true,\n}: {\n /** allow selecting multiple files */\n multiple?: boolean | undefined;\n} = {}) => {\n const { disabled, addAttachment } = useComposerAddAttachmentBehavior();\n const aui = useAui();\n\n const callback = useCallback(() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.multiple = multiple;\n input.hidden = true;\n\n const attachmentAccept = aui.composer.getState().attachmentAccept;\n if (attachmentAccept !== \"*\") {\n input.accept = attachmentAccept;\n }\n\n document.body.appendChild(input);\n\n input.onchange = async (e) => {\n const fileList = (e.target as HTMLInputElement).files;\n if (!fileList) return;\n\n const attachmentPromises = Array.from(fileList, async (file) => {\n try {\n await addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n });\n\n document.body.removeChild(input);\n await Promise.all(attachmentPromises);\n };\n\n input.oncancel = () => {\n if (!input.files || input.files.length === 0) {\n document.body.removeChild(input);\n }\n };\n\n input.click();\n }, [aui, multiple, addAttachment]);\n\n if (disabled) return null;\n return callback;\n};\n\nexport namespace ComposerPrimitiveAddAttachment {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerAddAttachment>;\n}\n\nexport const ComposerPrimitiveAddAttachment = createActionButton(\n \"ComposerPrimitive.AddAttachment\",\n useComposerAddAttachment,\n [\"multiple\"],\n);\n"],"mappings":";;;;;;;AAWA,MAAMO,8BAA2BE,OAAA;CAAA,MAAAC,IAAAT,EAAA,CAAA;CAAA,IAAAU;CAAA,IAAAD,EAAA,OA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IAAIH,UAAQ,OAAS;CAAK,OACnB+B;AAAQ;AAQjB,MAAaC,iCAAiC3C,mBAC5C,mCACAG,4BACA,CAAC,UAAU,CACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerCancel.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useComposerCancel","useComposerCancelBehavior","disabled","cancel","ComposerPrimitiveCancel","Element","Props"],"sources":["../../../src/primitives/composer/ComposerCancel.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useComposerCancel as useComposerCancelBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerCancel = () => {\n const { disabled, cancel } = useComposerCancelBehavior();\n if (disabled) return null;\n return cancel;\n};\n\nexport namespace ComposerPrimitiveCancel {\n export type Element = ActionButtonElement;\n /**\n * Props for the ComposerPrimitive.Cancel component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useComposerCancel>;\n}\n\n/**\n * A button component that cancels the current message composition.\n *\n * This component automatically handles the cancel functionality and is disabled\n * when canceling is not available.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Cancel>\n * Cancel\n * </ComposerPrimitive.Cancel>\n * ```\n */\nexport const ComposerPrimitiveCancel = createActionButton(\n \"ComposerPrimitive.Cancel\",\n useComposerCancel,\n);\n"],"mappings":";;;;AASA,MAAMG,4BAAoB;CACxB,MAAA,EAAAE,UAAAC,WAA6BF,kBAA0B;CACvD,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAM;;;;;;;;;;;;;;AAyBf,MAAaC,0BAA0BL,mBACrC,4BACAC,mBACF"}
1
+ {"version":3,"file":"ComposerCancel.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useComposerCancel","useComposerCancelBehavior","disabled","cancel","ComposerPrimitiveCancel","Element","Props","useComposerCancel","useComposerCancelBehavior"],"sources":["../../../src/primitives/composer/ComposerCancel.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type ActionButtonElement,\n type ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useComposerCancel as useComposerCancelBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerCancel = () => {\n const { disabled, cancel } = useComposerCancelBehavior();\n if (disabled) return null;\n return cancel;\n};\n\nexport namespace ComposerPrimitiveCancel {\n export type Element = ActionButtonElement;\n /**\n * Props for the ComposerPrimitive.Cancel component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useComposerCancel>;\n}\n\n/**\n * A button component that cancels the current message composition.\n *\n * This component automatically handles the cancel functionality and is disabled\n * when canceling is not available.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Cancel>\n * Cancel\n * </ComposerPrimitive.Cancel>\n * ```\n */\nexport const ComposerPrimitiveCancel = createActionButton(\n \"ComposerPrimitive.Cancel\",\n useComposerCancel,\n);\n"],"mappings":";;;;AASA,MAAMG,4BAAoB;CACxB,MAAA,EAAAE,UAAAC,WAA6BF,kBAA0B;CACvD,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAM;;;;;;;;;;;;;;AAyBf,MAAaC,0BAA0BL,mBACrC,4BACAC,mBACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerDictate.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useComposerDictate","useComposerDictateBehavior","disabled","startDictation","ComposerPrimitiveDictate","Element","Props"],"sources":["../../../src/primitives/composer/ComposerDictate.ts"],"sourcesContent":["\"use client\";\n\nimport type {\n ActionButtonElement,\n ActionButtonProps,\n} from \"../../utils/createActionButton\";\nimport { createActionButton } from \"../../utils/createActionButton\";\nimport { useComposerDictate as useComposerDictateBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerDictate = () => {\n const { disabled, startDictation } = useComposerDictateBehavior();\n if (disabled) return null;\n return startDictation;\n};\n\nexport namespace ComposerPrimitiveDictate {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerDictate>;\n}\n\n/**\n * A button that starts dictation to convert voice to text.\n *\n * Requires a DictationAdapter to be configured in the runtime.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Dictate>\n * <MicIcon />\n * </ComposerPrimitive.Dictate>\n * ```\n */\nexport const ComposerPrimitiveDictate = createActionButton(\n \"ComposerPrimitive.Dictate\",\n useComposerDictate,\n);\n"],"mappings":";;;;AASA,MAAMG,6BAAqB;CACzB,MAAA,EAAAE,UAAAC,mBAAqCF,mBAA2B;CAChE,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAc;;;;;;;;;;;;;AAoBvB,MAAaC,2BAA2BL,mBACtC,6BACAC,oBACF"}
1
+ {"version":3,"file":"ComposerDictate.js","names":["ActionButtonElement","ActionButtonProps","createActionButton","useComposerDictate","useComposerDictateBehavior","disabled","startDictation","ComposerPrimitiveDictate","Element","Props","useComposerDictate","useComposerDictateBehavior"],"sources":["../../../src/primitives/composer/ComposerDictate.ts"],"sourcesContent":["\"use client\";\n\nimport type {\n ActionButtonElement,\n ActionButtonProps,\n} from \"../../utils/createActionButton\";\nimport { createActionButton } from \"../../utils/createActionButton\";\nimport { useComposerDictate as useComposerDictateBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerDictate = () => {\n const { disabled, startDictation } = useComposerDictateBehavior();\n if (disabled) return null;\n return startDictation;\n};\n\nexport namespace ComposerPrimitiveDictate {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerDictate>;\n}\n\n/**\n * A button that starts dictation to convert voice to text.\n *\n * Requires a DictationAdapter to be configured in the runtime.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Dictate>\n * <MicIcon />\n * </ComposerPrimitive.Dictate>\n * ```\n */\nexport const ComposerPrimitiveDictate = createActionButton(\n \"ComposerPrimitive.Dictate\",\n useComposerDictate,\n);\n"],"mappings":";;;;AASA,MAAMG,6BAAqB;CACzB,MAAA,EAAAE,UAAAC,mBAAqCF,mBAA2B;CAChE,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAc;;;;;;;;;;;;;AAoBvB,MAAaC,2BAA2BL,mBACtC,6BACAC,oBACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerDictationTranscript.js","names":["c","_c","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","useAuiState","ComposerPrimitiveDictationTranscript","Element","span","Props","t0","$","children","props","transcript","_temp","t1","t2","displayName","s","composer","dictation"],"sources":["../../../src/primitives/composer/ComposerDictationTranscript.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n} from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace ComposerPrimitiveDictationTranscript {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\n/**\n * Renders the current interim (partial) transcript while dictation is active.\n *\n * This component displays real-time feedback of what the user is saying before\n * the transcription is finalized and committed to the composer input.\n *\n * @example\n * ```tsx\n * <AuiIf condition={(s) => s.composer.dictation != null}>\n * <div className=\"dictation-preview\">\n * <ComposerPrimitive.DictationTranscript />\n * </div>\n * </AuiIf>\n * ```\n */\nexport const ComposerPrimitiveDictationTranscript = forwardRef<\n ComposerPrimitiveDictationTranscript.Element,\n ComposerPrimitiveDictationTranscript.Props\n>(({ children, ...props }, forwardRef) => {\n const transcript = useAuiState((s) => s.composer.dictation?.transcript);\n\n if (!transcript) return null;\n\n return (\n <Primitive.span {...props} ref={forwardRef}>\n {children ?? transcript}\n </Primitive.span>\n );\n});\n\nComposerPrimitiveDictationTranscript.displayName =\n \"ComposerPrimitive.DictationTranscript\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAaO,uCAAuCH,YAGlDO,IAAAP,eAAA;CAAA,MAAAQ,IAAAX,EAAA,CAAA;CAAA,IAAAY;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAE,UAAA,GAAAC,SAAAH;EAAsBC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,WAAAD,EAAA;EAAAE,QAAAF,EAAA;CAAA;CACvB,MAAAG,aAAmBT,YAAYU,KAAuC;CAEtE,IAAI,CAACD,YAAU,OAAS;CAInB,MAAAE,KAAAJ,YAAAE;CAAsB,IAAAG;CAAA,IAAAN,EAAA,OAAAR,cAAAQ,EAAA,OAAAE,SAAAF,EAAA,OAAAK,IAAA;EADzBC,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBJ;GAAYV,KAAAA;GAC7Ba,UAAAA;EACH,CAAA;EAAiBL,EAAA,KAAAR;EAAAQ,EAAA,KAAAE;EAAAF,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDX,qCAAqCY,cACnC;AAbA,SAAAH,MAAAI,GAAA;CAAA,OACsCA,EAACC,SAASC,WAAsBP;AAAA"}
1
+ {"version":3,"file":"ComposerDictationTranscript.js","names":["c","_c","Primitive","ComponentRef","forwardRef","ComponentPropsWithoutRef","useAuiState","ComposerPrimitiveDictationTranscript","Element","span","Props","t0","$","children","props","transcript","_temp","t1","t2","displayName","s","composer","dictation","_c"],"sources":["../../../src/primitives/composer/ComposerDictationTranscript.tsx"],"sourcesContent":["\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n type ComponentPropsWithoutRef,\n} from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace ComposerPrimitiveDictationTranscript {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\n/**\n * Renders the current interim (partial) transcript while dictation is active.\n *\n * This component displays real-time feedback of what the user is saying before\n * the transcription is finalized and committed to the composer input.\n *\n * @example\n * ```tsx\n * <AuiIf condition={(s) => s.composer.dictation != null}>\n * <div className=\"dictation-preview\">\n * <ComposerPrimitive.DictationTranscript />\n * </div>\n * </AuiIf>\n * ```\n */\nexport const ComposerPrimitiveDictationTranscript = forwardRef<\n ComposerPrimitiveDictationTranscript.Element,\n ComposerPrimitiveDictationTranscript.Props\n>(({ children, ...props }, forwardRef) => {\n const transcript = useAuiState((s) => s.composer.dictation?.transcript);\n\n if (!transcript) return null;\n\n return (\n <Primitive.span {...props} ref={forwardRef}>\n {children ?? transcript}\n </Primitive.span>\n );\n});\n\nComposerPrimitiveDictationTranscript.displayName =\n \"ComposerPrimitive.DictationTranscript\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAaO,uCAAuCH,YAGlDO,IAAAP,eAAA;CAAA,MAAAQ,IAAAX,EAAA,CAAA;CAAA,IAAAY;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAE,UAAA,GAAAC,SAAAH;EAAsBC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,WAAAD,EAAA;EAAAE,QAAAF,EAAA;CAAA;CACvB,MAAAG,aAAmBT,YAAYU,KAAuC;CAEtE,IAAI,CAACD,YAAU,OAAS;CAInB,MAAAE,KAAAJ,YAAAE;CAAsB,IAAAG;CAAA,IAAAN,EAAA,OAAAR,cAAAQ,EAAA,OAAAE,SAAAF,EAAA,OAAAK,IAAA;EADzBC,KAAA,oBAAA,UAAA,MAAA;GAAA,GAAoBJ;GAAYV,KAAAA;GAC7Ba,UAAAA;EACH,CAAA;EAAiBL,EAAA,KAAAR;EAAAQ,EAAA,KAAAE;EAAAF,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFjBM;AAEiB,CAEpB;AAEDX,qCAAqCY,cACnC;AAbA,SAAAH,MAAAI,GAAA;CAAA,OACsCA,EAACC,SAASC,WAAsBP;AAAA"}
@@ -79,7 +79,7 @@ export declare namespace ComposerPrimitiveInput {
79
79
  * keyboard shortcuts, file paste support, and intelligent focus management.
80
80
  * It integrates with the composer context to manage message state and submission.
81
81
  *
82
- * When rendered inside `Unstable_TriggerPopoverRoot` and a popover is open, the
82
+ * When rendered inside `TriggerPopoverRoot` and a popover is open, the
83
83
  * underlying `<textarea>` automatically receives `aria-controls`,
84
84
  * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the
85
85
  * combobox relationship. These computed attributes override user-provided
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInput.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,YAAY,EAOlB,MAAM,OAAO,CAAC;AACf,OAAyB,EACvB,KAAK,qBAAqB,EAE3B,MAAM,yBAAyB,CAAC;AAiBjC,yBAAiB,sBAAsB,CAAC;IACtC,MAAM,MAAM,OAAO,GAAG,mBAAmB,CAAC;IAE1C,KAAK,SAAS,GAAG;QACf;;;WAGG;QACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC9B;;WAEG;QACH,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;QAClC;;;WAGG;QACH,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrC;;;WAGG;QACH,wBAAwB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC/C;;;WAGG;QACH,8BAA8B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrD;;;WAGG;QACH,8BAA8B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrD;;;;;;WAMG;QACH,kCAAkC,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACzD;;;WAGG;QACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC5C,CAAC;IAEF,KAAK,eAAe,GAChB;QACE;;;;;;WAMG;QACH,UAAU,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;QACxD;;;WAGG;QACH,aAAa,CAAC,EAAE,KAAK,CAAC;KACvB,GACD;QACE,UAAU,CAAC,EAAE,KAAK,CAAC;QACnB;;;;WAIG;QACH,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KACrC,CAAC;IAEN,MAAM,MAAM,KAAK,GAAG,qBAAqB,GAAG,SAAS,GAAG,eAAe,CAAC;;CACzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,sBAAsB,8HAiTlC,CAAC"}
1
+ {"version":3,"file":"ComposerInput.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,YAAY,EAOlB,MAAM,OAAO,CAAC;AACf,OAAyB,EACvB,KAAK,qBAAqB,EAE3B,MAAM,yBAAyB,CAAC;AAkBjC,yBAAiB,sBAAsB,CAAC;IACtC,MAAM,MAAM,OAAO,GAAG,mBAAmB,CAAC;IAE1C,KAAK,SAAS,GAAG;QACf;;;WAGG;QACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC9B;;WAEG;QACH,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;QAClC;;;WAGG;QACH,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrC;;;WAGG;QACH,wBAAwB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC/C;;;WAGG;QACH,8BAA8B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrD;;;WAGG;QACH,8BAA8B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACrD;;;;;;WAMG;QACH,kCAAkC,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACzD;;;WAGG;QACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC5C,CAAC;IAEF,KAAK,eAAe,GAChB;QACE;;;;;;WAMG;QACH,UAAU,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;QACxD;;;WAGG;QACH,aAAa,CAAC,EAAE,KAAK,CAAC;KACvB,GACD;QACE,UAAU,CAAC,EAAE,KAAK,CAAC;QACnB;;;;WAIG;QACH,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KACrC,CAAC;IAEN,MAAM,MAAM,KAAK,GAAG,qBAAqB,GAAG,SAAS,GAAG,eAAe,CAAC;;CACzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,sBAAsB,8HAiTlC,CAAC"}
@@ -3,6 +3,7 @@ import { renderSlot } from "../../utils/Primitive.js";
3
3
  import { useComposerCompactContextOptional } from "./ComposerCompactContext.js";
4
4
  import { useOnScrollToBottom } from "../../utils/hooks/useOnScrollToBottom.js";
5
5
  import { useMediaQuery } from "../../utils/hooks/useMediaQuery.js";
6
+ import { isCompositionKey } from "../../utils/isCompositionKey.js";
6
7
  import { useComposerInputPluginRegistryOptional } from "./ComposerInputPluginContext.js";
7
8
  import { useComposerInputDisabled, useComposerInputValue, useTriggerPopoverAriaProps } from "./useComposerInputState.js";
8
9
  import { forwardRef, isValidElement, useCallback, useEffect, useRef } from "@assistant-ui/tap/react-shim";
@@ -21,7 +22,7 @@ const TOUCH_PRIMARY_QUERY = "(pointer: coarse) and (not (any-pointer: fine))";
21
22
  * keyboard shortcuts, file paste support, and intelligent focus management.
22
23
  * It integrates with the composer context to manage message state and submission.
23
24
  *
24
- * When rendered inside `Unstable_TriggerPopoverRoot` and a popover is open, the
25
+ * When rendered inside `TriggerPopoverRoot` and a popover is open, the
25
26
  * underlying `<textarea>` automatically receives `aria-controls`,
26
27
  * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the
27
28
  * combobox relationship. These computed attributes override user-provided
@@ -62,7 +63,7 @@ const ComposerPrimitiveInput = forwardRef(({ autoFocus = false, asChild, render,
62
63
  const compositionRef = useRef(false);
63
64
  useEscapeKeydown((e) => {
64
65
  if (!textareaRef.current?.contains(e.target)) return;
65
- if (e.isComposing) return;
66
+ if (isCompositionKey(e)) return;
66
67
  if (pluginRegistry) {
67
68
  for (const plugin of pluginRegistry.getPlugins()) if (plugin.handleKeyDown(e)) return;
68
69
  }
@@ -75,7 +76,7 @@ const ComposerPrimitiveInput = forwardRef(({ autoFocus = false, asChild, render,
75
76
  });
76
77
  const handleKeyPress = (e_0) => {
77
78
  if (isDisabled) return;
78
- if (e_0.nativeEvent.isComposing) return;
79
+ if (isCompositionKey(e_0.nativeEvent)) return;
79
80
  if (pluginRegistry) {
80
81
  for (const plugin_0 of pluginRegistry.getPlugins()) if (plugin_0.handleKeyDown(e_0)) return;
81
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInput.js","names":["composeEventHandlers","useComposedRefs","Slot","ClipboardEvent","KeyboardEvent","ReactElement","ReactNode","forwardRef","useCallback","useEffect","useRef","isValidElement","TextareaAutosize","TextareaAutosizeProps","TextareaHeightChangeMeta","useEscapeKeydown","useOnScrollToBottom","useMediaQuery","renderSlot","useAui","flushTapSync","useComposerInputPluginRegistryOptional","useComposerCompactContextOptional","useComposerInputDisabled","useComposerInputValue","useTriggerPopoverAriaProps","TOUCH_PRIMARY_QUERY","ComposerPrimitiveInput","Element","HTMLTextAreaElement","BaseProps","asChild","render","cancelOnEscape","unstable_focusOnRunStart","unstable_focusOnScrollToBottom","unstable_focusOnThreadSwitched","unstable_insertNewlineOnTouchEnter","addAttachmentOnPaste","SubmitModeProps","submitMode","submitOnEnter","Props","autoFocus","disabled","disabledProp","onChange","onKeyDown","onPaste","onSelect","onHeightChange","rest","forwardedRef","aui","pluginRegistry","compactContext","declaredSubmitMode","isTouchPrimary","effectiveSubmitMode","value","isDisabled","textareaRef","ref","compositionRef","e","current","contains","target","Node","isComposing","plugin","getPlugins","handleKeyDown","composer","getState","canCancel","cancel","preventDefault","handleKeyPress","nativeEvent","key","threadState","thread","hasQueue","capabilities","queue","shiftKey","ctrlKey","metaKey","canSend","send","steer","isRunning","voice","undefined","shouldSubmit","closest","requestSubmit","handlePaste","threadCapabilities","files","Array","from","clipboardData","attachments","length","Promise","all","map","file","addAttachment","handleHeightChange","height","meta","el","cs","getComputedStyle","contentHeight","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","Math","round","rowHeight","setMultiline","autoFocusEnabled","focus","textarea","preventScroll","setSelectionRange","type","on","ariaComboboxProps","inputProps","name","const","React","ForwardedRef","ChangeEvent","isEditing","nativeIsComposing","setText","pos","selectionStart","setCursorPosition","onCompositionStart","CompositionEventHandler","onCompositionEnd","CompositionEvent","SyntheticEvent","children","Component","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Slot } from \"radix-ui\";\nimport {\n type ClipboardEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n type TextareaHeightChangeMeta,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"radix-ui/internal\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useMediaQuery } from \"../../utils/hooks/useMediaQuery\";\nimport { renderSlot } from \"../../utils/Primitive\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\nimport { useComposerInputPluginRegistryOptional } from \"./ComposerInputPluginContext\";\nimport { useComposerCompactContextOptional } from \"./ComposerCompactContext\";\nimport {\n useComposerInputDisabled,\n useComposerInputValue,\n useTriggerPopoverAriaProps,\n} from \"./useComposerInputState\";\n\nconst TOUCH_PRIMARY_QUERY = \"(pointer: coarse) and (not (any-pointer: fine))\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to automatically focus the input when a new run starts.\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether plain Enter on a touch-primary device should insert a newline\n * instead of submitting, detected via\n * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect\n * when `submitMode` resolves to `\"enter\"`.\n * @default false\n */\n unstable_insertNewlineOnTouchEnter?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * When rendered inside `Unstable_TriggerPopoverRoot` and a popover is open, the\n * underlying `<textarea>` automatically receives `aria-controls`,\n * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the\n * combobox relationship. These computed attributes override user-provided\n * values for those four ARIA props while the popover is open.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Insert a newline on Enter on touch-primary devices.\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * unstable_insertNewlineOnTouchEnter\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n unstable_insertNewlineOnTouchEnter = false,\n addAttachmentOnPaste = true,\n onHeightChange,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const pluginRegistry = useComposerInputPluginRegistryOptional();\n const compactContext = useComposerCompactContextOptional();\n\n const declaredSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n const isTouchPrimary = useMediaQuery(\n unstable_insertNewlineOnTouchEnter ? TOUCH_PRIMARY_QUERY : null,\n );\n const effectiveSubmitMode =\n unstable_insertNewlineOnTouchEnter &&\n isTouchPrimary &&\n declaredSubmitMode === \"enter\"\n ? \"none\"\n : declaredSubmitMode;\n\n const value = useComposerInputValue();\n const isDisabled = useComposerInputDisabled(disabledProp);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n // suppress text/cursor broadcasts during IME composition\n const compositionRef = useRef(false);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // ignore IME composition events\n if (e.isComposing) return;\n\n // Let registered plugins (mention, slash command, etc.) handle Escape first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer;\n if (composer.getState().canCancel) {\n composer.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (e.nativeEvent.isComposing) return;\n\n // Let registered plugins (mention, slash command, etc.) handle keyboard events first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread.getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and canSend)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n declaredSubmitMode !== \"none\" &&\n aui.composer.getState().canSend\n ) {\n e.preventDefault();\n aui.composer.send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported; a voice\n // session leaves the decision to canSend\n if (\n threadState.isRunning &&\n !hasQueue &&\n threadState.voice === undefined\n )\n return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread.getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n e.preventDefault();\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer.addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n }),\n );\n }\n };\n\n const handleHeightChange = (\n height: number,\n meta: TextareaHeightChangeMeta,\n ) => {\n onHeightChange?.(height, meta);\n if (!compactContext) return;\n const el = textareaRef.current;\n if (!el || el.value === \"\") return;\n const cs = getComputedStyle(el);\n const contentHeight =\n cs.boxSizing === \"border-box\"\n ? height -\n parseFloat(cs.paddingTop) -\n parseFloat(cs.paddingBottom) -\n parseFloat(cs.borderTopWidth) -\n parseFloat(cs.borderBottomWidth)\n : height;\n if (Math.round(contentHeight / meta.rowHeight) > 1) {\n compactContext.setMultiline(true);\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer.getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focus);\n }, [unstable_focusOnRunStart, focus, aui]);\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched\n )\n return undefined;\n\n return aui.on(\"threads.selectionChanged\", focus);\n }, [unstable_focusOnThreadSwitched, focus, aui]);\n\n useEffect(() => {\n if (value === \"\") compactContext?.setMultiline(false);\n }, [value, compactContext]);\n\n const ariaComboboxProps = useTriggerPopoverAriaProps();\n\n const inputProps = {\n name: \"input\" as const,\n value,\n ...rest,\n ...ariaComboboxProps,\n ref: ref as React.ForwardedRef<HTMLTextAreaElement>,\n disabled: isDisabled,\n onChange: composeEventHandlers(\n onChange,\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!aui.composer.getState().isEditing) return;\n const nativeIsComposing =\n (e.nativeEvent as { isComposing?: boolean }).isComposing === true;\n // recover stuck compositionRef when the browser drops compositionend\n if (compositionRef.current && !nativeIsComposing) {\n compositionRef.current = false;\n }\n const isComposing = nativeIsComposing || compositionRef.current;\n // keep controlled value in sync mid-IME so react does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer.setText(e.target.value);\n });\n if (isComposing) return;\n const pos = e.target.selectionStart ?? e.target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyPress),\n onCompositionStart: composeEventHandlers(\n (rest as { onCompositionStart?: React.CompositionEventHandler })\n .onCompositionStart,\n () => {\n compositionRef.current = true;\n },\n ),\n onCompositionEnd: composeEventHandlers(\n (rest as { onCompositionEnd?: React.CompositionEventHandler })\n .onCompositionEnd,\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = false;\n if (!aui.composer.getState().isEditing) return;\n const target = e.target as HTMLTextAreaElement;\n flushTapSync(() => {\n aui.composer.setText(target.value);\n });\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onSelect: composeEventHandlers(\n onSelect,\n (e: React.SyntheticEvent<HTMLTextAreaElement>) => {\n if (compositionRef.current) return;\n const target = e.target as HTMLTextAreaElement;\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onPaste: composeEventHandlers(onPaste, handlePaste),\n ...(compactContext\n ? { onHeightChange: handleHeightChange }\n : onHeightChange !== undefined\n ? { onHeightChange }\n : {}),\n };\n\n if (render && isValidElement(render)) {\n return renderSlot(\n render,\n (rest as { children?: ReactNode }).children,\n inputProps,\n );\n }\n\n const Component = asChild ? Slot.Root : TextareaAutosize;\n return <Component {...inputProps} />;\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,MAAM0B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiH5B,MAAaC,yBAAyBpB,YAKlC,EACEoC,YAAY,OACZZ,SACAC,QACAY,UAAUC,cACVC,UACAC,WACAC,SACAC,UACAR,eACAD,YACAP,iBAAiB,MACjBC,2BAA2B,MAC3BC,iCAAiC,MACjCC,iCAAiC,MACjCC,qCAAqC,OACrCC,uBAAuB,MACvBY,gBACA,GAAGC,QAELC,iBACG;CACH,MAAMC,MAAMlC,OAAO;CACnB,MAAMmC,iBAAiBjC,uCAAuC;CAC9D,MAAMkC,iBAAiBjC,kCAAkC;CAEzD,MAAMkC,qBACJhB,eAAeC,kBAAkB,QAAQ,SAAS;CACpD,MAAMgB,iBAAiBxC,cACrBoB,qCAAqCX,sBAAsB,IAC7D;CACA,MAAMgC,sBACJrB,sCACAoB,kBACAD,uBAAuB,UACnB,SACAA;CAEN,MAAMG,QAAQnC,sBAAsB;CACpC,MAAMoC,aAAarC,yBAAyBsB,YAAY;CACxD,MAAMgB,cAAcnD,OAA4B,IAAI;CACpD,MAAMoD,MAAM7D,gBAAgBmD,cAAcS,WAAW;CAErD,MAAME,iBAAiBrD,OAAO,KAAK;CAEnCK,kBAAkBiD,MAAM;EAEtB,IAAI,CAACH,YAAYI,SAASC,SAASF,EAAEG,MAAc,GAAG;EAGtD,IAAIH,EAAEK,aAAa;EAGn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3B,CACF;EACAqF,kBAAkBtJ,qBACfmD,KACEmG,mBACFtF,QAAmD;GAClDD,eAAeE,UAAU;GACzB,IAAI,CAACZ,IAAIoB,SAASC,SAAS,CAAC,CAACoE,WAAW;GACxC,MAAM3E,SAASH,IAAEG;GACjB/C,mBAAmB;IACjBiC,IAAIoB,SAASuE,QAAQ7E,OAAOR,KAAK;GACnC,CAAC;GACD,MAAMsF,QAAM9E,OAAO+E,kBAAkB/E,OAAOR,MAAM8C;GAClD,IAAInD,gBACF,KAAK,MAAMgB,YAAUhB,eAAeiB,WAAW,GAC7CD,SAAO6E,kBAAkBF,KAAG;EAGlC,CACF;EACAhG,UAAUjD,qBACRiD,WACCe,QAAiD;GAChD,IAAID,eAAeE,SAAS;GAC5B,MAAME,WAASH,IAAEG;GACjB,MAAM8E,QAAM9E,SAAO+E,kBAAkB/E,SAAOR,MAAM8C;GAClD,IAAInD,gBACF,KAAK,MAAMgB,YAAUhB,eAAeiB,WAAW,GAC7CD,SAAO6E,kBAAkBF,KAAG;EAGlC,CACF;EACAjG,SAAShD,qBAAqBgD,SAASkD,WAAW;EAClD,GAAI3C,iBACA,EAAEL,gBAAgB6D,mBAAmB,IACrC7D,mBAAmB4C,KAAAA,IACjB,EAAE5C,eAAe,IACjB,CAAC;CACT;CAEA,IAAIlB,UAAUrB,eAAeqB,MAAM,GACjC,OAAOd,WACLc,QACCmB,KAAkCsG,UACnCjB,UACF;CAGF,MAAMkB,YAAY3H,UAAU7B,KAAKyJ,OAAO/I;CACxC,OAAO,oBAAC,WAAD,EAAW,GAAI4H,WAAW,CAAA;AACnC,CACF;AAEA7G,uBAAuBiI,cAAc"}
1
+ {"version":3,"file":"ComposerInput.js","names":["composeEventHandlers","useComposedRefs","Slot","ClipboardEvent","KeyboardEvent","ReactElement","ReactNode","forwardRef","useCallback","useEffect","useRef","isValidElement","TextareaAutosize","TextareaAutosizeProps","TextareaHeightChangeMeta","useEscapeKeydown","useOnScrollToBottom","useMediaQuery","renderSlot","isCompositionKey","useAui","flushTapSync","useComposerInputPluginRegistryOptional","useComposerCompactContextOptional","useComposerInputDisabled","useComposerInputValue","useTriggerPopoverAriaProps","TOUCH_PRIMARY_QUERY","ComposerPrimitiveInput","Element","HTMLTextAreaElement","BaseProps","asChild","render","cancelOnEscape","unstable_focusOnRunStart","unstable_focusOnScrollToBottom","unstable_focusOnThreadSwitched","unstable_insertNewlineOnTouchEnter","addAttachmentOnPaste","SubmitModeProps","submitMode","submitOnEnter","Props","autoFocus","disabled","disabledProp","onChange","onKeyDown","onPaste","onSelect","onHeightChange","rest","forwardedRef","aui","pluginRegistry","compactContext","declaredSubmitMode","isTouchPrimary","effectiveSubmitMode","value","isDisabled","textareaRef","ref","compositionRef","e","current","contains","target","Node","plugin","getPlugins","handleKeyDown","composer","getState","canCancel","cancel","preventDefault","handleKeyPress","nativeEvent","key","threadState","thread","hasQueue","capabilities","queue","shiftKey","ctrlKey","metaKey","canSend","send","steer","isRunning","voice","undefined","shouldSubmit","closest","requestSubmit","handlePaste","threadCapabilities","files","Array","from","clipboardData","attachments","length","Promise","all","map","file","addAttachment","handleHeightChange","height","meta","el","cs","getComputedStyle","contentHeight","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","Math","round","rowHeight","setMultiline","autoFocusEnabled","focus","textarea","preventScroll","setSelectionRange","type","on","ariaComboboxProps","inputProps","name","const","React","ForwardedRef","ChangeEvent","isEditing","nativeIsComposing","isComposing","setText","pos","selectionStart","setCursorPosition","onCompositionStart","CompositionEventHandler","onCompositionEnd","CompositionEvent","SyntheticEvent","children","Component","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"radix-ui/internal\";\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Slot } from \"radix-ui\";\nimport {\n type ClipboardEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n type TextareaHeightChangeMeta,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"radix-ui/internal\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useMediaQuery } from \"../../utils/hooks/useMediaQuery\";\nimport { renderSlot } from \"../../utils/Primitive\";\nimport { isCompositionKey } from \"../../utils/isCompositionKey\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\nimport { useComposerInputPluginRegistryOptional } from \"./ComposerInputPluginContext\";\nimport { useComposerCompactContextOptional } from \"./ComposerCompactContext\";\nimport {\n useComposerInputDisabled,\n useComposerInputValue,\n useTriggerPopoverAriaProps,\n} from \"./useComposerInputState\";\n\nconst TOUCH_PRIMARY_QUERY = \"(pointer: coarse) and (not (any-pointer: fine))\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to automatically focus the input when a new run starts.\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether plain Enter on a touch-primary device should insert a newline\n * instead of submitting, detected via\n * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect\n * when `submitMode` resolves to `\"enter\"`.\n * @default false\n */\n unstable_insertNewlineOnTouchEnter?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * When rendered inside `TriggerPopoverRoot` and a popover is open, the\n * underlying `<textarea>` automatically receives `aria-controls`,\n * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the\n * combobox relationship. These computed attributes override user-provided\n * values for those four ARIA props while the popover is open.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Insert a newline on Enter on touch-primary devices.\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * unstable_insertNewlineOnTouchEnter\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n unstable_insertNewlineOnTouchEnter = false,\n addAttachmentOnPaste = true,\n onHeightChange,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const pluginRegistry = useComposerInputPluginRegistryOptional();\n const compactContext = useComposerCompactContextOptional();\n\n const declaredSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n const isTouchPrimary = useMediaQuery(\n unstable_insertNewlineOnTouchEnter ? TOUCH_PRIMARY_QUERY : null,\n );\n const effectiveSubmitMode =\n unstable_insertNewlineOnTouchEnter &&\n isTouchPrimary &&\n declaredSubmitMode === \"enter\"\n ? \"none\"\n : declaredSubmitMode;\n\n const value = useComposerInputValue();\n const isDisabled = useComposerInputDisabled(disabledProp);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n // suppress text/cursor broadcasts during IME composition\n const compositionRef = useRef(false);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // ignore IME composition events\n if (isCompositionKey(e)) return;\n\n // Let registered plugins (mention, slash command, etc.) handle Escape first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer;\n if (composer.getState().canCancel) {\n composer.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (isCompositionKey(e.nativeEvent)) return;\n\n // Let registered plugins (mention, slash command, etc.) handle keyboard events first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread.getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and canSend)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n declaredSubmitMode !== \"none\" &&\n aui.composer.getState().canSend\n ) {\n e.preventDefault();\n aui.composer.send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported; a voice\n // session leaves the decision to canSend\n if (\n threadState.isRunning &&\n !hasQueue &&\n threadState.voice === undefined\n )\n return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread.getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n e.preventDefault();\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer.addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n }),\n );\n }\n };\n\n const handleHeightChange = (\n height: number,\n meta: TextareaHeightChangeMeta,\n ) => {\n onHeightChange?.(height, meta);\n if (!compactContext) return;\n const el = textareaRef.current;\n if (!el || el.value === \"\") return;\n const cs = getComputedStyle(el);\n const contentHeight =\n cs.boxSizing === \"border-box\"\n ? height -\n parseFloat(cs.paddingTop) -\n parseFloat(cs.paddingBottom) -\n parseFloat(cs.borderTopWidth) -\n parseFloat(cs.borderBottomWidth)\n : height;\n if (Math.round(contentHeight / meta.rowHeight) > 1) {\n compactContext.setMultiline(true);\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer.getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focus);\n }, [unstable_focusOnRunStart, focus, aui]);\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched\n )\n return undefined;\n\n return aui.on(\"threads.selectionChanged\", focus);\n }, [unstable_focusOnThreadSwitched, focus, aui]);\n\n useEffect(() => {\n if (value === \"\") compactContext?.setMultiline(false);\n }, [value, compactContext]);\n\n const ariaComboboxProps = useTriggerPopoverAriaProps();\n\n const inputProps = {\n name: \"input\" as const,\n value,\n ...rest,\n ...ariaComboboxProps,\n ref: ref as React.ForwardedRef<HTMLTextAreaElement>,\n disabled: isDisabled,\n onChange: composeEventHandlers(\n onChange,\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!aui.composer.getState().isEditing) return;\n const nativeIsComposing =\n (e.nativeEvent as { isComposing?: boolean }).isComposing === true;\n // recover stuck compositionRef when the browser drops compositionend\n if (compositionRef.current && !nativeIsComposing) {\n compositionRef.current = false;\n }\n const isComposing = nativeIsComposing || compositionRef.current;\n // keep controlled value in sync mid-IME so react does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer.setText(e.target.value);\n });\n if (isComposing) return;\n const pos = e.target.selectionStart ?? e.target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyPress),\n onCompositionStart: composeEventHandlers(\n (rest as { onCompositionStart?: React.CompositionEventHandler })\n .onCompositionStart,\n () => {\n compositionRef.current = true;\n },\n ),\n onCompositionEnd: composeEventHandlers(\n (rest as { onCompositionEnd?: React.CompositionEventHandler })\n .onCompositionEnd,\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = false;\n if (!aui.composer.getState().isEditing) return;\n const target = e.target as HTMLTextAreaElement;\n flushTapSync(() => {\n aui.composer.setText(target.value);\n });\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onSelect: composeEventHandlers(\n onSelect,\n (e: React.SyntheticEvent<HTMLTextAreaElement>) => {\n if (compositionRef.current) return;\n const target = e.target as HTMLTextAreaElement;\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onPaste: composeEventHandlers(onPaste, handlePaste),\n ...(compactContext\n ? { onHeightChange: handleHeightChange }\n : onHeightChange !== undefined\n ? { onHeightChange }\n : {}),\n };\n\n if (render && isValidElement(render)) {\n return renderSlot(\n render,\n (rest as { children?: ReactNode }).children,\n inputProps,\n );\n }\n\n const Component = asChild ? Slot.Root : TextareaAutosize;\n return <Component {...inputProps} />;\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n"],"mappings":";;;;;;;;;;;;;;;;AAmCA,MAAM2B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiH5B,MAAaC,yBAAyBrB,YAKlC,EACEqC,YAAY,OACZZ,SACAC,QACAY,UAAUC,cACVC,UACAC,WACAC,SACAC,UACAR,eACAD,YACAP,iBAAiB,MACjBC,2BAA2B,MAC3BC,iCAAiC,MACjCC,iCAAiC,MACjCC,qCAAqC,OACrCC,uBAAuB,MACvBY,gBACA,GAAGC,QAELC,iBACG;CACH,MAA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WAAW;EAClD,GAAI1C,iBACA,EAAEL,gBAAgB4D,mBAAmB,IACrC5D,mBAAmB2C,KAAAA,IACjB,EAAE3C,eAAe,IACjB,CAAC;CACT;CAEA,IAAIlB,UAAUtB,eAAesB,MAAM,GACjC,OAAOf,WACLe,QACCmB,KAAkCsG,UACnClB,UACF;CAGF,MAAMmB,YAAY3H,UAAU9B,KAAK0J,OAAOhJ;CACxC,OAAO,oBAAC,WAAD,EAAW,GAAI4H,WAAW,CAAA;AACnC,CACF;AAEA5G,uBAAuBiI,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInputPluginContext.js","names":["c","_c","createContext","useContext","useRef","useCallback","useMemo","ReactNode","FC","ComposerInputPlugin","handleKeyDown","e","key","shiftKey","ctrlKey","metaKey","nativeEvent","isComposing","preventDefault","setCursorPosition","pos","ComposerInputPluginRegisterOptions","priority","ComposerInputPluginRegistry","register","plugin","opts","getPlugins","ComposerInputPluginRegistryContext","useComposerInputPluginRegistryOptional","ComposerInputPluginProvider","children","t0","$","t1","Symbol","for","Map","pluginsRef","t2","snapshotRef","t3","entries","Array","from","current","sort","_temp","map","_temp2","refreshSnapshot","t4","plugin_0","set","delete","t5","t6","registry","t7","a","b"],"sources":["../../../src/primitives/composer/ComposerInputPluginContext.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n useContext,\n useRef,\n useCallback,\n useMemo,\n type ReactNode,\n type FC,\n} from \"react\";\n\n/**\n * A plugin that intercepts keyboard events and cursor changes in the composer\n * input. Used by trigger popover declarations to handle popover navigation\n * without ComposerInput knowing about specific triggers.\n */\nexport type ComposerInputPlugin = {\n /** Handle a key event. Return true if consumed (stops propagation to other plugins and default behavior). */\n handleKeyDown(e: {\n readonly key: string;\n readonly shiftKey: boolean;\n readonly ctrlKey?: boolean;\n readonly metaKey?: boolean;\n readonly nativeEvent?: { isComposing?: boolean };\n preventDefault(): void;\n }): boolean;\n\n /** Called on every cursor position change (selection change / text change). */\n setCursorPosition(pos: number): void;\n};\n\n/** Options for registering a plugin. */\nexport type ComposerInputPluginRegisterOptions = {\n /**\n * Relative priority. Plugins with higher priority receive events first.\n * @default 0\n */\n priority?: number;\n};\n\n// Ref-based registry: plugins are read imperatively at event time, so register/unregister does not trigger re-renders.\nexport type ComposerInputPluginRegistry = {\n register(\n plugin: ComposerInputPlugin,\n opts?: ComposerInputPluginRegisterOptions,\n ): () => void;\n getPlugins(): readonly ComposerInputPlugin[];\n};\n\nconst ComposerInputPluginRegistryContext =\n createContext<ComposerInputPluginRegistry | null>(null);\n\nexport const useComposerInputPluginRegistryOptional =\n (): ComposerInputPluginRegistry | null => {\n return useContext(ComposerInputPluginRegistryContext);\n };\n\nexport const ComposerInputPluginProvider: FC<{ children: ReactNode }> = ({\n children,\n}) => {\n const pluginsRef = useRef<Map<ComposerInputPlugin, number>>(new Map());\n const snapshotRef = useRef<readonly ComposerInputPlugin[]>([]);\n\n const refreshSnapshot = useCallback(() => {\n const entries = Array.from(pluginsRef.current.entries());\n // Sort by priority descending; stable insertion order for equal priorities.\n entries.sort((a, b) => b[1] - a[1]);\n snapshotRef.current = entries.map(([plugin]) => plugin);\n }, []);\n\n const register = useCallback(\n (\n plugin: ComposerInputPlugin,\n opts?: ComposerInputPluginRegisterOptions,\n ) => {\n const priority = opts?.priority ?? 0;\n pluginsRef.current.set(plugin, priority);\n refreshSnapshot();\n return () => {\n pluginsRef.current.delete(plugin);\n refreshSnapshot();\n };\n },\n [refreshSnapshot],\n );\n\n const getPlugins = useCallback(\n (): readonly ComposerInputPlugin[] => snapshotRef.current,\n [],\n );\n\n const registry = useMemo<ComposerInputPluginRegistry>(\n () => ({ register, getPlugins }),\n [register, getPlugins],\n );\n\n return (\n <ComposerInputPluginRegistryContext.Provider value={registry}>\n {children}\n </ComposerInputPluginRegistryContext.Provider>\n );\n};\n"],"mappings":";;;;;AAkDA,MAAM4B,qCACJ1B,cAAkD,IAAI;AAExD,MAAa2B,+CACX;CAAA,OACS1B,WAAWyB,kCA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B,EAAA;CAD3D,MAAAN,aAAmB4B;CAGjB,IAAAC;CAAA,IAAAvB,EAAA,OAAAE,OAAAC,IAAA,2BAAA,GAAA;EAGOoB,KAAA;GAAAhC;GAAAG;EAAuB;EAACM,EAAA,KAAAuB;CAAA,OAAAA,KAAAvB,EAAA;CADjC,MAAAwB,WACSD;CAEP,IAAAE;CAAA,IAAAzB,EAAA,OAAAF,UAAA;EAGA2B,KAAA,oBAAA,mCAAA,UAAA;GAAoDD,OAAAA;GACjD1B;EACH,CAAA;EAA8CE,EAAA,KAAAF;EAAAE,EAAA,KAAAyB;CAAA,OAAAA,KAAAzB,EAAA;CAAA,OAF9CyB;AAE8C;AA1CsB,SAAAX,MAAAY,GAAAC,GAAA;CAAA,OAS7CA,EAAC,KAAMD,EAAC;AAAG;AATkC,SAAAV,OAAAjB,IAAA;CAUjC,MAAA,CAAAP,UAAAO;CAAQ,OAAKP;AAAM"}
1
+ {"version":3,"file":"ComposerInputPluginContext.js","names":["c","_c","createContext","useContext","useRef","useCallback","useMemo","ReactNode","FC","ComposerInputPlugin","handleKeyDown","e","key","shiftKey","ctrlKey","metaKey","nativeEvent","isComposing","preventDefault","setCursorPosition","pos","ComposerInputPluginRegisterOptions","priority","ComposerInputPluginRegistry","register","plugin","opts","getPlugins","ComposerInputPluginRegistryContext","useComposerInputPluginRegistryOptional","ComposerInputPluginProvider","children","t0","$","t1","Symbol","for","Map","pluginsRef","t2","snapshotRef","t3","entries","Array","from","current","sort","_temp","map","_temp2","refreshSnapshot","t4","plugin_0","set","delete","t5","t6","registry","t7","a","b","_c"],"sources":["../../../src/primitives/composer/ComposerInputPluginContext.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n useContext,\n useRef,\n useCallback,\n useMemo,\n type ReactNode,\n type FC,\n} from \"react\";\n\n/**\n * A plugin that intercepts keyboard events and cursor changes in the composer\n * input. Used by trigger popover declarations to handle popover navigation\n * without ComposerInput knowing about specific triggers.\n */\nexport type ComposerInputPlugin = {\n /** Handle a key event. Return true if consumed (stops propagation to other plugins and default behavior). */\n handleKeyDown(e: {\n readonly key: string;\n readonly shiftKey: boolean;\n readonly ctrlKey?: boolean;\n readonly metaKey?: boolean;\n readonly nativeEvent?: { isComposing?: boolean };\n preventDefault(): void;\n }): boolean;\n\n /** Called on every cursor position change (selection change / text change). */\n setCursorPosition(pos: number): void;\n};\n\n/** Options for registering a plugin. */\nexport type ComposerInputPluginRegisterOptions = {\n /**\n * Relative priority. Plugins with higher priority receive events first.\n * @default 0\n */\n priority?: number;\n};\n\n// Ref-based registry: plugins are read imperatively at event time, so register/unregister does not trigger re-renders.\nexport type ComposerInputPluginRegistry = {\n register(\n plugin: ComposerInputPlugin,\n opts?: ComposerInputPluginRegisterOptions,\n ): () => void;\n getPlugins(): readonly ComposerInputPlugin[];\n};\n\nconst ComposerInputPluginRegistryContext =\n createContext<ComposerInputPluginRegistry | null>(null);\n\nexport const useComposerInputPluginRegistryOptional =\n (): ComposerInputPluginRegistry | null => {\n return useContext(ComposerInputPluginRegistryContext);\n };\n\nexport const ComposerInputPluginProvider: FC<{ children: ReactNode }> = ({\n children,\n}) => {\n const pluginsRef = useRef<Map<ComposerInputPlugin, number>>(new Map());\n const snapshotRef = useRef<readonly ComposerInputPlugin[]>([]);\n\n const refreshSnapshot = useCallback(() => {\n const entries = Array.from(pluginsRef.current.entries());\n // Sort by priority descending; stable insertion order for equal priorities.\n entries.sort((a, b) => b[1] - a[1]);\n snapshotRef.current = entries.map(([plugin]) => plugin);\n }, []);\n\n const register = useCallback(\n (\n plugin: ComposerInputPlugin,\n opts?: ComposerInputPluginRegisterOptions,\n ) => {\n const priority = opts?.priority ?? 0;\n pluginsRef.current.set(plugin, priority);\n refreshSnapshot();\n return () => {\n pluginsRef.current.delete(plugin);\n refreshSnapshot();\n };\n },\n [refreshSnapshot],\n );\n\n const getPlugins = useCallback(\n (): readonly ComposerInputPlugin[] => snapshotRef.current,\n [],\n );\n\n const registry = useMemo<ComposerInputPluginRegistry>(\n () => ({ register, getPlugins }),\n [register, getPlugins],\n );\n\n return (\n <ComposerInputPluginRegistryContext.Provider value={registry}>\n {children}\n </ComposerInputPluginRegistryContext.Provider>\n );\n};\n"],"mappings":";;;;;AAkDA,MAAM4B,qCACJ1B,cAAkD,IAAI;AAExD,MAAa2B,+CACX;CAAA,OACS1B,WAAWyB,kCAAkC;AAAC;AAGzD,MAAaE,+BAA2DE,OAAA;CAAA,MAAAC,IAAAhC,EAAA,CAAA;CAAC,MAAA,EAAA8B,aAAAC;CAExE,IAAAE;CAAA,IAAAD,EAAA,OAAAE,OAAAC,IAAA,2BAAA,GAAA;EAC6DF,qBAAA,IAAIG,IAAI;EAACJ,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAArE,MAAAK,aAAmBlC,OAAyC8B,EAAS;CAAE,IAAAK;CAAA,IAAAN,EAAA,OAAAE,OAAAC,IAAA,2BAAA,GAAA;EACZG,KAAA,CAAA;EAAEN,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAA7D,MAAAO,cAAoBpC,OAAuCmC,EAAE;CAAE,IAAAE;CAAA,IAAAR,EAAA,OAAAE,OAAAC,IAAA,2BAAA,GAAA;EAE3BK,WAAA;GAClC,MAAAC,UAAgBC,MAAKC,KAAMN,WAAUO,QAAQH,QAAS,CAAC;GAEvDA,QAAOI,KAAMC,KAAqB;GAClCP,YAAWK,UAAWH,QAAOM,IAAKC,MAAoB;EAAnC;EACpBhB,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CALD,MAAAiB,kBAAwBT;CAKjB,IAAAU;CAAA,IAAAlB,EAAA,OAAAE,OAAAC,IAAA,2BAAA,GAAA;EAGLe,MAAAC,UAAA1B,SAAA;GAIE,MAAAJ,WAAiBI,MAAIJ,YAAJ;GACjBgB,WAAUO,QAAQQ,IAAK5B,UAAQH,QAAQ;GACvC4B,gBAAgB;GAAC,aACV;IACLZ,WAAUO,QAAQS,OAAQ7B,QAAM;IAChCyB,gBAA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