@assistant-ui/react 0.15.13 → 0.15.15

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 (160) hide show
  1. package/dist/assistant-transport.d.ts +32 -0
  2. package/dist/assistant-transport.d.ts.map +1 -0
  3. package/dist/assistant-transport.js +27 -0
  4. package/dist/assistant-transport.js.map +1 -0
  5. package/dist/context/providers/MessageProvider.js +1 -1
  6. package/dist/hooks/useMessageQuote.js +1 -1
  7. package/dist/hooks/useToolCallElapsed.js +1 -1
  8. package/dist/index.d.ts +5 -8
  9. package/dist/index.js +7 -9
  10. package/dist/legacy-runtime/AssistantRuntimeProvider.js +1 -1
  11. package/dist/mcp-apps/McpAppsRemoteHost.d.ts.map +1 -1
  12. package/dist/mcp-apps/McpAppsRemoteHost.js +18 -2
  13. package/dist/mcp-apps/McpAppsRemoteHost.js.map +1 -1
  14. package/dist/mcp-apps/bridge.js +39 -24
  15. package/dist/mcp-apps/bridge.js.map +1 -1
  16. package/dist/model-context/makeAssistantVisible.js +1 -1
  17. package/dist/primitives/actionBar/ActionBarCopy.js +1 -1
  18. package/dist/primitives/actionBar/ActionBarExportMarkdown.js +1 -1
  19. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +1 -1
  20. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +1 -1
  21. package/dist/primitives/actionBar/ActionBarStopSpeaking.d.ts.map +1 -1
  22. package/dist/primitives/actionBar/ActionBarStopSpeaking.js +24 -37
  23. package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
  24. package/dist/primitives/actionBar/useActionBarFloatStatus.js +1 -1
  25. package/dist/primitives/assistantModal/AssistantModalRoot.js +1 -1
  26. package/dist/primitives/attachment/AttachmentName.js +1 -1
  27. package/dist/primitives/attachment/AttachmentRemove.js +1 -1
  28. package/dist/primitives/attachment/AttachmentThumb.js +1 -1
  29. package/dist/primitives/branchPicker/BranchPickerCount.js +1 -1
  30. package/dist/primitives/branchPicker/BranchPickerNumber.js +1 -1
  31. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js +1 -1
  32. package/dist/primitives/composer/ComposerAddAttachment.js +1 -1
  33. package/dist/primitives/composer/ComposerAttachmentDropzone.js +1 -1
  34. package/dist/primitives/composer/ComposerDictationTranscript.js +1 -1
  35. package/dist/primitives/composer/ComposerInput.js +2 -2
  36. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  37. package/dist/primitives/composer/ComposerQuote.js +1 -1
  38. package/dist/primitives/composer/ComposerRoot.js +1 -1
  39. package/dist/primitives/composer/ComposerStopDictation.js +1 -1
  40. package/dist/primitives/composer/trigger/TriggerPopover.js +1 -1
  41. package/dist/primitives/composer/useComposerInputState.js +1 -1
  42. package/dist/primitives/message/MessageIf.js +1 -1
  43. package/dist/primitives/message/MessagePartsGrouped.js +1 -1
  44. package/dist/primitives/message/MessageRoot.js +1 -1
  45. package/dist/primitives/queueItem/QueueItemRemove.js +1 -1
  46. package/dist/primitives/queueItem/QueueItemSteer.js +1 -1
  47. package/dist/primitives/queueItem/QueueItemText.js +1 -1
  48. package/dist/primitives/selectionToolbar/SelectionToolbarQuote.js +1 -1
  49. package/dist/primitives/suggestion/SuggestionDescription.js +1 -1
  50. package/dist/primitives/suggestion/SuggestionTitle.js +1 -1
  51. package/dist/primitives/suggestion/SuggestionTrigger.js +1 -1
  52. package/dist/primitives/thread/ThreadIf.js +1 -1
  53. package/dist/primitives/thread/ThreadRoot.d.ts.map +1 -1
  54. package/dist/primitives/thread/ThreadRoot.js +41 -9
  55. package/dist/primitives/thread/ThreadRoot.js.map +1 -1
  56. package/dist/primitives/thread/ThreadViewport.d.ts.map +1 -1
  57. package/dist/primitives/thread/ThreadViewport.js +2 -13
  58. package/dist/primitives/thread/ThreadViewport.js.map +1 -1
  59. package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
  60. package/dist/primitives/thread/useThreadViewportAutoScroll.js +23 -8
  61. package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
  62. package/dist/primitives/threadList/ThreadListNew.js +1 -1
  63. package/dist/sandbox-host/SandboxHost.js +2 -0
  64. package/dist/sandbox-host/SandboxHost.js.map +1 -1
  65. package/dist/unstable/useComposerInput.d.ts +2 -2
  66. package/dist/unstable/useComposerInput.js +1 -1
  67. package/dist/unstable/useComposerInput.js.map +1 -1
  68. package/dist/unstable/useComposerInputHistory.js +1 -1
  69. package/dist/unstable/useComposerInputHistory.js.map +1 -1
  70. package/dist/unstable/useLiveCompletionAdapter.d.ts +5 -0
  71. package/dist/unstable/useLiveCompletionAdapter.d.ts.map +1 -1
  72. package/dist/unstable/useLiveCompletionAdapter.js +16 -3
  73. package/dist/unstable/useLiveCompletionAdapter.js.map +1 -1
  74. package/dist/unstable/useMentionAdapter.d.ts +1 -1
  75. package/dist/utils/smooth/SmoothContext.js +1 -1
  76. package/dist/utils/useToolArgsFieldStatus.js +1 -1
  77. package/package.json +9 -9
  78. package/src/assistant-transport.ts +94 -0
  79. package/src/index.ts +9 -4
  80. package/src/mcp-apps/McpAppsRemoteHost.test.ts +29 -3
  81. package/src/mcp-apps/McpAppsRemoteHost.ts +42 -7
  82. package/src/mcp-apps/bridge.test.ts +132 -0
  83. package/src/mcp-apps/bridge.ts +54 -30
  84. package/src/primitives/actionBar/ActionBarStopSpeaking.tsx +0 -9
  85. package/src/primitives/composer/ComposerInput.tsx +1 -1
  86. package/src/primitives/thread/ThreadRoot.test.tsx +251 -0
  87. package/src/primitives/thread/ThreadRoot.tsx +30 -0
  88. package/src/primitives/thread/ThreadViewport.tsx +1 -8
  89. package/src/primitives/thread/useThreadViewportAutoScroll.test.tsx +152 -0
  90. package/src/primitives/thread/useThreadViewportAutoScroll.ts +26 -19
  91. package/src/sandbox-host/SandboxHost.test.tsx +29 -0
  92. package/src/sandbox-host/SandboxHost.tsx +2 -0
  93. package/src/tests/RemoteThreadListRuntime.adapterProvider.test.tsx +24 -3
  94. package/src/tests/RemoteThreadListRuntime.reloadMainThread.test.tsx +1 -2
  95. package/src/tests/augmentations.test.ts +49 -0
  96. package/src/tests/in-memory-thread-list.test.tsx +87 -3
  97. package/src/tests/threadMessageById.test.tsx +61 -1
  98. package/src/unstable/useComposerInput.ts +2 -2
  99. package/src/unstable/useComposerInputHistory.test.tsx +4 -4
  100. package/src/unstable/useComposerInputHistory.ts +1 -1
  101. package/src/unstable/useLiveCompletionAdapter.test.tsx +100 -0
  102. package/src/unstable/useLiveCompletionAdapter.ts +41 -17
  103. package/dist/client/InMemoryThreadList.d.ts +0 -12
  104. package/dist/client/InMemoryThreadList.d.ts.map +0 -1
  105. package/dist/client/InMemoryThreadList.js +0 -365
  106. package/dist/client/InMemoryThreadList.js.map +0 -1
  107. package/dist/legacy-runtime/cloud/auiV0.d.ts +0 -119
  108. package/dist/legacy-runtime/cloud/auiV0.d.ts.map +0 -1
  109. package/dist/legacy-runtime/cloud/auiV0.js +0 -137
  110. package/dist/legacy-runtime/cloud/auiV0.js.map +0 -1
  111. package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.d.ts +0 -16
  112. package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.d.ts.map +0 -1
  113. package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.js +0 -36
  114. package/dist/legacy-runtime/cloud/useCloudThreadListRuntime.js.map +0 -1
  115. package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.d.ts +0 -17
  116. package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.d.ts.map +0 -1
  117. package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.js +0 -55
  118. package/dist/legacy-runtime/runtime-cores/assistant-transport/commandQueue.js.map +0 -1
  119. package/dist/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.d.ts +0 -11
  120. package/dist/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.d.ts.map +0 -1
  121. package/dist/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.js +0 -141
  122. package/dist/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.js.map +0 -1
  123. package/dist/legacy-runtime/runtime-cores/assistant-transport/runManager.d.ts +0 -15
  124. package/dist/legacy-runtime/runtime-cores/assistant-transport/runManager.d.ts.map +0 -1
  125. package/dist/legacy-runtime/runtime-cores/assistant-transport/runManager.js +0 -81
  126. package/dist/legacy-runtime/runtime-cores/assistant-transport/runManager.js.map +0 -1
  127. package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts +0 -126
  128. package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts.map +0 -1
  129. package/dist/legacy-runtime/runtime-cores/assistant-transport/types.js +0 -0
  130. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts +0 -14
  131. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts.map +0 -1
  132. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +0 -290
  133. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +0 -1
  134. package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.d.ts +0 -7
  135. package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.d.ts.map +0 -1
  136. package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.js +0 -25
  137. package/dist/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.js.map +0 -1
  138. package/dist/legacy-runtime/runtime-cores/assistant-transport/useLatestRef.d.ts +0 -7
  139. package/dist/legacy-runtime/runtime-cores/assistant-transport/useLatestRef.d.ts.map +0 -1
  140. package/dist/legacy-runtime/runtime-cores/assistant-transport/useLatestRef.js +0 -27
  141. package/dist/legacy-runtime/runtime-cores/assistant-transport/useLatestRef.js.map +0 -1
  142. package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.d.ts +0 -2
  143. package/dist/legacy-runtime/runtime-cores/assistant-transport/utils.js +0 -2
  144. package/src/client/InMemoryThreadList.ts +0 -241
  145. package/src/legacy-runtime/cloud/auiV0.ts +0 -331
  146. package/src/legacy-runtime/cloud/useCloudThreadListRuntime.ts +0 -31
  147. package/src/legacy-runtime/runtime-cores/assistant-transport/commandQueue.ts +0 -68
  148. package/src/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.test.ts +0 -430
  149. package/src/legacy-runtime/runtime-cores/assistant-transport/replayBoundaryStream.ts +0 -146
  150. package/src/legacy-runtime/runtime-cores/assistant-transport/runManager.ts +0 -113
  151. package/src/legacy-runtime/runtime-cores/assistant-transport/transport-delivery.test.tsx +0 -79
  152. package/src/legacy-runtime/runtime-cores/assistant-transport/transport-parentid.test.tsx +0 -97
  153. package/src/legacy-runtime/runtime-cores/assistant-transport/transport-scheduling.test.ts +0 -307
  154. package/src/legacy-runtime/runtime-cores/assistant-transport/types.ts +0 -170
  155. package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransport.spec.md +0 -141
  156. package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.test.tsx +0 -585
  157. package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.ts +0 -476
  158. package/src/legacy-runtime/runtime-cores/assistant-transport/useConvertedState.ts +0 -20
  159. package/src/legacy-runtime/runtime-cores/assistant-transport/useLatestRef.ts +0 -9
  160. package/src/legacy-runtime/runtime-cores/assistant-transport/utils.ts +0 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
- import { useAui, useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAui, useAuiState } from "@assistant-ui/store";
5
5
  import { forwardRef } from "@assistant-ui/tap/react-shim";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { composeEventHandlers } from "@radix-ui/primitive";
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
- import { useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
5
4
  import { useActionBarFeedbackNegative } from "@assistant-ui/core/react";
5
+ import { useAuiState } from "@assistant-ui/store";
6
6
  import { forwardRef } from "@assistant-ui/tap/react-shim";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  import { composeEventHandlers } from "@radix-ui/primitive";
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
- import { useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
5
4
  import { useActionBarFeedbackPositive } from "@assistant-ui/core/react";
5
+ import { useAuiState } from "@assistant-ui/store";
6
6
  import { forwardRef } from "@assistant-ui/tap/react-shim";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  import { composeEventHandlers } from "@radix-ui/primitive";
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBarStopSpeaking.d.ts","names":[],"sources":["../../../src/primitives/actionBar/ActionBarStopSpeaking.tsx"],"mappings":";;cASM;kBAMW;OACH,UAAU;OACV,QAAQ,yBAAyB;;cAGlC,gDAA8B,0BAAA,KAAA,qBAAA,gBAAA,qCAAA,qBAAA;;;;oBAyBzC,cAAA,6CAAA,cAAA"}
1
+ {"version":3,"file":"ActionBarStopSpeaking.d.ts","names":[],"sources":["../../../src/primitives/actionBar/ActionBarStopSpeaking.tsx"],"mappings":";;cAQM;kBAMW;OACH,UAAU;OACV,QAAQ,yBAAyB;;cAGlC,gDAA8B,0BAAA,KAAA,qBAAA,gBAAA,qCAAA,qBAAA;;;;oBAiBzC,cAAA,6CAAA,cAAA"}
@@ -5,7 +5,6 @@ import { useActionBarStopSpeaking } from "@assistant-ui/core/react";
5
5
  import { forwardRef } from "@assistant-ui/tap/react-shim";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { composeEventHandlers } from "@radix-ui/primitive";
8
- import { useEscapeKeydown } from "@radix-ui/react-use-escape-keydown";
9
8
  //#region src/primitives/actionBar/ActionBarStopSpeaking.tsx
10
9
  const useActionBarStopSpeaking$1 = () => {
11
10
  const { disabled, stopSpeaking } = useActionBarStopSpeaking();
@@ -13,52 +12,40 @@ const useActionBarStopSpeaking$1 = () => {
13
12
  return stopSpeaking;
14
13
  };
15
14
  const ActionBarPrimitiveStopSpeaking = forwardRef((props, ref) => {
16
- const $ = c(12);
15
+ const $ = c(10);
17
16
  const callback = useActionBarStopSpeaking$1();
18
- let t0;
17
+ const t0 = !callback;
18
+ let t1;
19
19
  if ($[0] !== callback) {
20
- t0 = (e) => {
21
- if (callback) {
22
- e.preventDefault();
23
- callback();
24
- }
20
+ t1 = () => {
21
+ callback?.();
25
22
  };
26
23
  $[0] = callback;
27
- $[1] = t0;
28
- } else t0 = $[1];
29
- useEscapeKeydown(t0);
30
- const t1 = !callback;
24
+ $[1] = t1;
25
+ } else t1 = $[1];
31
26
  let t2;
32
- if ($[2] !== callback) {
33
- t2 = () => {
34
- callback?.();
35
- };
36
- $[2] = callback;
37
- $[3] = t2;
38
- } else t2 = $[3];
27
+ if ($[2] !== props.onClick || $[3] !== t1) {
28
+ t2 = composeEventHandlers(props.onClick, t1);
29
+ $[2] = props.onClick;
30
+ $[3] = t1;
31
+ $[4] = t2;
32
+ } else t2 = $[4];
39
33
  let t3;
40
- if ($[4] !== props.onClick || $[5] !== t2) {
41
- t3 = composeEventHandlers(props.onClick, t2);
42
- $[4] = props.onClick;
43
- $[5] = t2;
44
- $[6] = t3;
45
- } else t3 = $[6];
46
- let t4;
47
- if ($[7] !== props || $[8] !== ref || $[9] !== t1 || $[10] !== t3) {
48
- t4 = /* @__PURE__ */ jsx(Primitive.button, {
34
+ if ($[5] !== props || $[6] !== ref || $[7] !== t0 || $[8] !== t2) {
35
+ t3 = /* @__PURE__ */ jsx(Primitive.button, {
49
36
  type: "button",
50
- disabled: t1,
37
+ disabled: t0,
51
38
  ...props,
52
39
  ref,
53
- onClick: t3
40
+ onClick: t2
54
41
  });
55
- $[7] = props;
56
- $[8] = ref;
57
- $[9] = t1;
58
- $[10] = t3;
59
- $[11] = t4;
60
- } else t4 = $[11];
61
- return t4;
42
+ $[5] = props;
43
+ $[6] = ref;
44
+ $[7] = t0;
45
+ $[8] = t2;
46
+ $[9] = t3;
47
+ } else t3 = $[9];
48
+ return t3;
62
49
  });
63
50
  ActionBarPrimitiveStopSpeaking.displayName = "ActionBarPrimitive.StopSpeaking";
64
51
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBarStopSpeaking.js","names":["c","_c","forwardRef","ActionButtonProps","useEscapeKeydown","Primitive","composeEventHandlers","useActionBarStopSpeaking","useActionBarStopSpeakingBehavior","disabled","stopSpeaking","ActionBarPrimitiveStopSpeaking","Element","HTMLButtonElement","Props","props","ref","$","callback","t0","e","preventDefault","t1","t2","t3","onClick","t4","displayName"],"sources":["../../../src/primitives/actionBar/ActionBarStopSpeaking.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ActionButtonProps } from \"../../utils/createActionButton\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useActionBarStopSpeaking as useActionBarStopSpeakingBehavior } from \"@assistant-ui/core/react\";\n\nconst useActionBarStopSpeaking = () => {\n const { disabled, stopSpeaking } = useActionBarStopSpeakingBehavior();\n if (disabled) return null;\n return stopSpeaking;\n};\n\nexport namespace ActionBarPrimitiveStopSpeaking {\n export type Element = HTMLButtonElement;\n export type Props = ActionButtonProps<typeof useActionBarStopSpeaking>;\n}\n\nexport const ActionBarPrimitiveStopSpeaking = forwardRef<\n ActionBarPrimitiveStopSpeaking.Element,\n ActionBarPrimitiveStopSpeaking.Props\n>((props, ref) => {\n const callback = useActionBarStopSpeaking();\n\n // TODO this stops working if the user is not hovering over an older message\n useEscapeKeydown((e) => {\n if (callback) {\n e.preventDefault();\n callback();\n }\n });\n\n return (\n <Primitive.button\n type=\"button\"\n disabled={!callback}\n {...props}\n ref={ref}\n onClick={composeEventHandlers(props.onClick, () => {\n callback?.();\n })}\n />\n );\n});\n\nActionBarPrimitiveStopSpeaking.displayName = \"ActionBarPrimitive.StopSpeaking\";\n"],"mappings":";;;;;;;;;AASA,MAAMO,mCAA2B;CAC/B,MAAA,EAAAE,UAAAC,iBAAmCF,yBAAiC;CACpE,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAY;AAQrB,MAAaC,iCAAiCT,YAG5Ca,OAAAC,QAAA;CAAA,MAAAC,IAAAhB,EAAA,EAAA;CACA,MAAAiB,WAAiBX,2BAAyB;CAAE,IAAAY;CAAA,IAAAF,EAAA,OAAAC,UAAA;EAG3BC,MAAAC,MAAA;GACf,IAAIF,UAAQ;IACVE,EAACC,eAAgB;IACjBH,SAAS;GAAC;EACX;EACFD,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CALDb,iBAAiBe,EAKhB;CAKa,MAAAG,KAAA,CAACJ;CAAQ,IAAAK;CAAA,IAAAN,EAAA,OAAAC,UAAA;EAG0BK,WAAA;GAC3CL,WAAW;EAAC;EACbD,EAAA,KAAAC;EAAAD,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAF,MAAAU,WAAAR,EAAA,OAAAM,IAAA;EAFQC,KAAAlB,qBAAqBS,MAAKU,SAAUF,EAE5C;EAACN,EAAA,KAAAF,MAAAU;EAAAR,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAK,MAAAL,EAAA,QAAAO,IAAA;EAPJE,KAAA,oBAAA,UAAA,QAAA;GACO,MAAA;GACK,UAAAJ;GAAS,GACfP;GACCC;GACI,SAAAQ;EAEP,CAAA;EACFP,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAK;EAAAL,EAAA,MAAAO;EAAAP,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OARFS;AAQE,CAEL;AAEDf,+BAA+BgB,cAAc"}
1
+ {"version":3,"file":"ActionBarStopSpeaking.js","names":["c","_c","forwardRef","ActionButtonProps","Primitive","composeEventHandlers","useActionBarStopSpeaking","useActionBarStopSpeakingBehavior","disabled","stopSpeaking","ActionBarPrimitiveStopSpeaking","Element","HTMLButtonElement","Props","props","ref","$","callback","t0","t1","t2","onClick","t3","displayName"],"sources":["../../../src/primitives/actionBar/ActionBarStopSpeaking.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ActionButtonProps } from \"../../utils/createActionButton\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useActionBarStopSpeaking as useActionBarStopSpeakingBehavior } from \"@assistant-ui/core/react\";\n\nconst useActionBarStopSpeaking = () => {\n const { disabled, stopSpeaking } = useActionBarStopSpeakingBehavior();\n if (disabled) return null;\n return stopSpeaking;\n};\n\nexport namespace ActionBarPrimitiveStopSpeaking {\n export type Element = HTMLButtonElement;\n export type Props = ActionButtonProps<typeof useActionBarStopSpeaking>;\n}\n\nexport const ActionBarPrimitiveStopSpeaking = forwardRef<\n ActionBarPrimitiveStopSpeaking.Element,\n ActionBarPrimitiveStopSpeaking.Props\n>((props, ref) => {\n const callback = useActionBarStopSpeaking();\n\n return (\n <Primitive.button\n type=\"button\"\n disabled={!callback}\n {...props}\n ref={ref}\n onClick={composeEventHandlers(props.onClick, () => {\n callback?.();\n })}\n />\n );\n});\n\nActionBarPrimitiveStopSpeaking.displayName = \"ActionBarPrimitive.StopSpeaking\";\n"],"mappings":";;;;;;;;AAQA,MAAMM,mCAA2B;CAC/B,MAAA,EAAAE,UAAAC,iBAAmCF,yBAAiC;CACpE,IAAIC,UAAQ,OAAS;CAAK,OACnBC;AAAY;AAQrB,MAAaC,iCAAiCR,YAG5CY,OAAAC,QAAA;CAAA,MAAAC,IAAAf,EAAA,EAAA;CACA,MAAAgB,WAAiBX,2BAAyB;CAK5B,MAAAY,KAAA,CAACD;CAAQ,IAAAE;CAAA,IAAAH,EAAA,OAAAC,UAAA;EAG0BE,WAAA;GAC3CF,WAAW;EAAC;EACbD,EAAA,KAAAC;EAAAD,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAF,MAAAO,WAAAL,EAAA,OAAAG,IAAA;EAFQC,KAAAf,qBAAqBS,MAAKO,SAAUF,EAE5C;EAACH,EAAA,KAAAF,MAAAO;EAAAL,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAF,SAAAE,EAAA,OAAAD,OAAAC,EAAA,OAAAE,MAAAF,EAAA,OAAAI,IAAA;EAPJE,KAAA,oBAAA,UAAA,QAAA;GACO,MAAA;GACK,UAAAJ;GAAS,GACfJ;GACCC;GACI,SAAAK;EAEP,CAAA;EACFJ,EAAA,KAAAF;EAAAE,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OARFM;AAQE,CAEL;AAEDZ,+BAA+Ba,cAAc"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { useAuiState } from "@assistant-ui/store";
3
2
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
+ import { useAuiState } from "@assistant-ui/store";
4
4
  //#region src/primitives/actionBar/useActionBarFloatStatus.ts
5
5
  const HideAndFloatStatus = {
6
6
  Hidden: "hidden",
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { usePopoverScope } from "./scope.js";
3
- import { useAui } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAui } from "@assistant-ui/store";
5
5
  import { useEffect, useState } from "@assistant-ui/tap/react-shim";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { Popover } from "radix-ui";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { useAuiState } from "@assistant-ui/store";
3
2
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
+ import { useAuiState } from "@assistant-ui/store";
4
4
  import { Fragment, jsx } from "react/jsx-runtime";
5
5
  //#region src/primitives/attachment/AttachmentName.tsx
6
6
  const AttachmentPrimitiveName = () => {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createActionButton } from "../../utils/createActionButton.js";
3
- import { useAui } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAui } from "@assistant-ui/store";
5
5
  import "@assistant-ui/tap/react-shim";
6
6
  //#region src/primitives/attachment/AttachmentRemove.ts
7
7
  const useAttachmentRemove = () => {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
- import { useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAuiState } from "@assistant-ui/store";
5
5
  import { forwardRef } from "@assistant-ui/tap/react-shim";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  //#region src/primitives/attachment/AttachmentThumb.tsx
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { useAuiState } from "@assistant-ui/store";
3
2
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
+ import { useAuiState } from "@assistant-ui/store";
4
4
  import { Fragment, jsx } from "react/jsx-runtime";
5
5
  //#region src/primitives/branchPicker/BranchPickerCount.tsx
6
6
  const useBranchPickerCount = () => {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { useAuiState } from "@assistant-ui/store";
3
2
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
+ import { useAuiState } from "@assistant-ui/store";
4
4
  import { Fragment, jsx } from "react/jsx-runtime";
5
5
  //#region src/primitives/branchPicker/BranchPickerNumber.tsx
6
6
  const useBranchPickerNumber = () => {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createActionButton } from "../../utils/createActionButton.js";
3
- import { useAui, useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAui, useAuiState } from "@assistant-ui/store";
5
5
  import "@assistant-ui/tap/react-shim";
6
6
  //#region src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.ts
7
7
  const useChainOfThoughtAccordionTrigger = () => {
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { createActionButton } from "../../utils/createActionButton.js";
3
- import { useAui } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
5
4
  import { useComposerAddAttachment } from "@assistant-ui/core/react";
5
+ import { useAui } from "@assistant-ui/store";
6
6
  import "@assistant-ui/tap/react-shim";
7
7
  //#region src/primitives/composer/ComposerAddAttachment.ts
8
8
  const useComposerAddAttachment$1 = (t0) => {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { useAui } from "@assistant-ui/store";
3
2
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
+ import { useAui } from "@assistant-ui/store";
4
4
  import { cloneElement, forwardRef, isValidElement, useState } from "@assistant-ui/tap/react-shim";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { composeEventHandlers } from "@radix-ui/primitive";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
- import { useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAuiState } from "@assistant-ui/store";
5
5
  import { forwardRef } from "@assistant-ui/tap/react-shim";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  //#region src/primitives/composer/ComposerDictationTranscript.tsx
@@ -9,9 +9,9 @@ import { cloneElement, forwardRef, isValidElement, useCallback, useEffect, useRe
9
9
  import { jsx } from "react/jsx-runtime";
10
10
  import { useComposedRefs } from "@radix-ui/react-compose-refs";
11
11
  import { composeEventHandlers } from "@radix-ui/primitive";
12
- import { useEscapeKeydown } from "@radix-ui/react-use-escape-keydown";
13
12
  import { Slot } from "radix-ui";
14
13
  import TextareaAutosize from "react-textarea-autosize";
14
+ import { useEscapeKeydown } from "@radix-ui/react-use-escape-keydown";
15
15
  import { flushTapSync } from "@assistant-ui/tap";
16
16
  //#region src/primitives/composer/ComposerInput.tsx
17
17
  const TOUCH_PRIMARY_QUERY = "(pointer: coarse) and (not (any-pointer: fine))";
@@ -142,7 +142,7 @@ const ComposerPrimitiveInput = forwardRef(({ autoFocus = false, asChild, render,
142
142
  ]);
143
143
  useEffect(() => {
144
144
  if (aui.composer.getState().type !== "thread" || !unstable_focusOnThreadSwitched) return void 0;
145
- return aui.on("threadListItem.switchedTo", focus);
145
+ return aui.on("threads.selectionChanged", focus);
146
146
  }, [
147
147
  unstable_focusOnThreadSwitched,
148
148
  focus,
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInput.js","names":["composeEventHandlers","useComposedRefs","Slot","ClipboardEvent","KeyboardEvent","ReactElement","ReactNode","forwardRef","useCallback","useEffect","useRef","cloneElement","isValidElement","TextareaAutosize","TextareaAutosizeProps","TextareaHeightChangeMeta","useEscapeKeydown","useOnScrollToBottom","useMediaQuery","useAui","flushTapSync","useComposerInputPluginRegistryOptional","useComposerCompactContextOptional","useComposerInputDisabled","useComposerInputValue","useTriggerPopoverAriaProps","TOUCH_PRIMARY_QUERY","ComposerPrimitiveInput","Element","HTMLTextAreaElement","BaseProps","asChild","render","cancelOnEscape","unstable_focusOnRunStart","unstable_focusOnScrollToBottom","unstable_focusOnThreadSwitched","unstable_insertNewlineOnTouchEnter","addAttachmentOnPaste","SubmitModeProps","submitMode","submitOnEnter","Props","autoFocus","disabled","disabledProp","onChange","onKeyDown","onPaste","onSelect","onHeightChange","rest","forwardedRef","aui","pluginRegistry","compactContext","declaredSubmitMode","isTouchPrimary","effectiveSubmitMode","value","isDisabled","textareaRef","ref","compositionRef","e","current","contains","target","Node","isComposing","plugin","getPlugins","handleKeyDown","composer","getState","canCancel","cancel","preventDefault","handleKeyPress","nativeEvent","key","threadState","thread","hasQueue","capabilities","queue","shiftKey","ctrlKey","metaKey","canSend","send","steer","isRunning","shouldSubmit","closest","requestSubmit","handlePaste","threadCapabilities","files","Array","from","clipboardData","attachments","length","Promise","all","map","file","addAttachment","handleHeightChange","height","meta","el","cs","getComputedStyle","contentHeight","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","Math","round","rowHeight","setMultiline","autoFocusEnabled","focus","textarea","preventScroll","setSelectionRange","type","undefined","on","ariaComboboxProps","inputProps","name","const","React","ForwardedRef","ChangeEvent","isEditing","nativeIsComposing","setText","pos","selectionStart","setCursorPosition","onCompositionStart","CompositionEventHandler","onCompositionEnd","CompositionEvent","SyntheticEvent","renderChildren","children","props","Record","Component","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\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 cloneElement,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n type TextareaHeightChangeMeta,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useMediaQuery } from \"../../utils/hooks/useMediaQuery\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\nimport { useComposerInputPluginRegistryOptional } from \"./ComposerInputPluginContext\";\nimport { useComposerCompactContextOptional } from \"./ComposerCompactContext\";\nimport {\n useComposerInputDisabled,\n useComposerInputValue,\n useTriggerPopoverAriaProps,\n} from \"./useComposerInputState\";\n\nconst TOUCH_PRIMARY_QUERY = \"(pointer: coarse) and (not (any-pointer: fine))\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to automatically focus the input when a new run starts.\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether plain Enter on a touch-primary device should insert a newline\n * instead of submitting, detected via\n * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect\n * when `submitMode` resolves to `\"enter\"`.\n * @default false\n */\n unstable_insertNewlineOnTouchEnter?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * When rendered inside `Unstable_TriggerPopoverRoot` and a popover is open, the\n * underlying `<textarea>` automatically receives `aria-controls`,\n * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the\n * combobox relationship. These computed attributes override user-provided\n * values for those four ARIA props while the popover is open.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Insert a newline on Enter on touch-primary devices.\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * unstable_insertNewlineOnTouchEnter\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n unstable_insertNewlineOnTouchEnter = false,\n addAttachmentOnPaste = true,\n onHeightChange,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const pluginRegistry = useComposerInputPluginRegistryOptional();\n const compactContext = useComposerCompactContextOptional();\n\n const declaredSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n const isTouchPrimary = useMediaQuery(\n unstable_insertNewlineOnTouchEnter ? TOUCH_PRIMARY_QUERY : null,\n );\n const effectiveSubmitMode =\n unstable_insertNewlineOnTouchEnter &&\n isTouchPrimary &&\n declaredSubmitMode === \"enter\"\n ? \"none\"\n : declaredSubmitMode;\n\n const value = useComposerInputValue();\n const isDisabled = useComposerInputDisabled(disabledProp);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n // suppress text/cursor broadcasts during IME composition\n const compositionRef = useRef(false);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // ignore IME composition events\n if (e.isComposing) return;\n\n // Let registered plugins (mention, slash command, etc.) handle Escape first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer;\n if (composer.getState().canCancel) {\n composer.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (e.nativeEvent.isComposing) return;\n\n // Let registered plugins (mention, slash command, etc.) handle keyboard events first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread.getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and canSend)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n declaredSubmitMode !== \"none\" &&\n aui.composer.getState().canSend\n ) {\n e.preventDefault();\n aui.composer.send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported\n if (threadState.isRunning && !hasQueue) return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread.getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n e.preventDefault();\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer.addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n }),\n );\n }\n };\n\n const handleHeightChange = (\n height: number,\n meta: TextareaHeightChangeMeta,\n ) => {\n onHeightChange?.(height, meta);\n if (!compactContext) return;\n const el = textareaRef.current;\n if (!el || el.value === \"\") return;\n const cs = getComputedStyle(el);\n const contentHeight =\n cs.boxSizing === \"border-box\"\n ? height -\n parseFloat(cs.paddingTop) -\n parseFloat(cs.paddingBottom) -\n parseFloat(cs.borderTopWidth) -\n parseFloat(cs.borderBottomWidth)\n : height;\n if (Math.round(contentHeight / meta.rowHeight) > 1) {\n compactContext.setMultiline(true);\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer.getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focus);\n }, [unstable_focusOnRunStart, focus, aui]);\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched\n )\n return undefined;\n\n return aui.on(\"threadListItem.switchedTo\", 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 const renderChildren =\n (rest as any).children !== undefined\n ? ((rest as any).children as ReactNode)\n : ((render.props as Record<string, unknown>).children as ReactNode);\n return (\n <Slot.Root {...inputProps}>\n {cloneElement(render, undefined, renderChildren)}\n </Slot.Root>\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,iBAAiBvC,cACrBmB,qCAAqCX,sBAAsB,IAC7D;CACA,MAAMgC,sBACJrB,sCACAoB,kBACAD,uBAAuB,UACnB,SACAA;CAEN,MAAMG,QAAQnC,sBAAsB;CACpC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AAQoG,KAAAA,GAAWoB,cAAc;EACtC,CAAA;CAEf;CAEA,MAAMI,YAAY7H,UAAU7B,KAAK2J,OAAOhJ;CACxC,OAAO,oBAAC,WAAD,EAAW,GAAI0H,WAAW,CAAA;AACnC,CACF;AAEA5G,uBAAuBmI,cAAc"}
1
+ {"version":3,"file":"ComposerInput.js","names":["composeEventHandlers","useComposedRefs","Slot","ClipboardEvent","KeyboardEvent","ReactElement","ReactNode","forwardRef","useCallback","useEffect","useRef","cloneElement","isValidElement","TextareaAutosize","TextareaAutosizeProps","TextareaHeightChangeMeta","useEscapeKeydown","useOnScrollToBottom","useMediaQuery","useAui","flushTapSync","useComposerInputPluginRegistryOptional","useComposerCompactContextOptional","useComposerInputDisabled","useComposerInputValue","useTriggerPopoverAriaProps","TOUCH_PRIMARY_QUERY","ComposerPrimitiveInput","Element","HTMLTextAreaElement","BaseProps","asChild","render","cancelOnEscape","unstable_focusOnRunStart","unstable_focusOnScrollToBottom","unstable_focusOnThreadSwitched","unstable_insertNewlineOnTouchEnter","addAttachmentOnPaste","SubmitModeProps","submitMode","submitOnEnter","Props","autoFocus","disabled","disabledProp","onChange","onKeyDown","onPaste","onSelect","onHeightChange","rest","forwardedRef","aui","pluginRegistry","compactContext","declaredSubmitMode","isTouchPrimary","effectiveSubmitMode","value","isDisabled","textareaRef","ref","compositionRef","e","current","contains","target","Node","isComposing","plugin","getPlugins","handleKeyDown","composer","getState","canCancel","cancel","preventDefault","handleKeyPress","nativeEvent","key","threadState","thread","hasQueue","capabilities","queue","shiftKey","ctrlKey","metaKey","canSend","send","steer","isRunning","shouldSubmit","closest","requestSubmit","handlePaste","threadCapabilities","files","Array","from","clipboardData","attachments","length","Promise","all","map","file","addAttachment","handleHeightChange","height","meta","el","cs","getComputedStyle","contentHeight","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","Math","round","rowHeight","setMultiline","autoFocusEnabled","focus","textarea","preventScroll","setSelectionRange","type","undefined","on","ariaComboboxProps","inputProps","name","const","React","ForwardedRef","ChangeEvent","isEditing","nativeIsComposing","setText","pos","selectionStart","setCursorPosition","onCompositionStart","CompositionEventHandler","onCompositionEnd","CompositionEvent","SyntheticEvent","renderChildren","children","props","Record","Component","Root","displayName"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\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 cloneElement,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n type TextareaHeightChangeMeta,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useMediaQuery } from \"../../utils/hooks/useMediaQuery\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\nimport { useComposerInputPluginRegistryOptional } from \"./ComposerInputPluginContext\";\nimport { useComposerCompactContextOptional } from \"./ComposerCompactContext\";\nimport {\n useComposerInputDisabled,\n useComposerInputValue,\n useTriggerPopoverAriaProps,\n} from \"./useComposerInputState\";\n\nconst TOUCH_PRIMARY_QUERY = \"(pointer: coarse) and (not (any-pointer: fine))\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to automatically focus the input when a new run starts.\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether plain Enter on a touch-primary device should insert a newline\n * instead of submitting, detected via\n * `(pointer: coarse) and (not (any-pointer: fine))`. Only takes effect\n * when `submitMode` resolves to `\"enter\"`.\n * @default false\n */\n unstable_insertNewlineOnTouchEnter?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * When rendered inside `Unstable_TriggerPopoverRoot` and a popover is open, the\n * underlying `<textarea>` automatically receives `aria-controls`,\n * `aria-expanded`, `aria-haspopup`, and `aria-activedescendant` for the\n * combobox relationship. These computed attributes override user-provided\n * values for those four ARIA props while the popover is open.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Insert a newline on Enter on touch-primary devices.\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * unstable_insertNewlineOnTouchEnter\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n unstable_insertNewlineOnTouchEnter = false,\n addAttachmentOnPaste = true,\n onHeightChange,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const pluginRegistry = useComposerInputPluginRegistryOptional();\n const compactContext = useComposerCompactContextOptional();\n\n const declaredSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n const isTouchPrimary = useMediaQuery(\n unstable_insertNewlineOnTouchEnter ? TOUCH_PRIMARY_QUERY : null,\n );\n const effectiveSubmitMode =\n unstable_insertNewlineOnTouchEnter &&\n isTouchPrimary &&\n declaredSubmitMode === \"enter\"\n ? \"none\"\n : declaredSubmitMode;\n\n const value = useComposerInputValue();\n const isDisabled = useComposerInputDisabled(disabledProp);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n // suppress text/cursor broadcasts during IME composition\n const compositionRef = useRef(false);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // ignore IME composition events\n if (e.isComposing) return;\n\n // Let registered plugins (mention, slash command, etc.) handle Escape first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer;\n if (composer.getState().canCancel) {\n composer.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (e.nativeEvent.isComposing) return;\n\n // Let registered plugins (mention, slash command, etc.) handle keyboard events first\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n if (plugin.handleKeyDown(e)) return;\n }\n }\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread.getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and canSend)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n declaredSubmitMode !== \"none\" &&\n aui.composer.getState().canSend\n ) {\n e.preventDefault();\n aui.composer.send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported\n if (threadState.isRunning && !hasQueue) return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread.getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n e.preventDefault();\n await Promise.all(\n files.map(async (file) => {\n try {\n await aui.composer.addAttachment(file);\n } catch {\n // The composer runtime emits composer.attachmentAddError before rejecting.\n }\n }),\n );\n }\n };\n\n const handleHeightChange = (\n height: number,\n meta: TextareaHeightChangeMeta,\n ) => {\n onHeightChange?.(height, meta);\n if (!compactContext) return;\n const el = textareaRef.current;\n if (!el || el.value === \"\") return;\n const cs = getComputedStyle(el);\n const contentHeight =\n cs.boxSizing === \"border-box\"\n ? height -\n parseFloat(cs.paddingTop) -\n parseFloat(cs.paddingBottom) -\n parseFloat(cs.borderTopWidth) -\n parseFloat(cs.borderBottomWidth)\n : height;\n if (Math.round(contentHeight / meta.rowHeight) > 1) {\n compactContext.setMultiline(true);\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer.getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focus);\n }, [unstable_focusOnRunStart, focus, aui]);\n\n useEffect(() => {\n if (\n aui.composer.getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched\n )\n return undefined;\n\n return aui.on(\"threads.selectionChanged\", focus);\n }, [unstable_focusOnThreadSwitched, focus, aui]);\n\n useEffect(() => {\n if (value === \"\") compactContext?.setMultiline(false);\n }, [value, compactContext]);\n\n const ariaComboboxProps = useTriggerPopoverAriaProps();\n\n const inputProps = {\n name: \"input\" as const,\n value,\n ...rest,\n ...ariaComboboxProps,\n ref: ref as React.ForwardedRef<HTMLTextAreaElement>,\n disabled: isDisabled,\n onChange: composeEventHandlers(\n onChange,\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!aui.composer.getState().isEditing) return;\n const nativeIsComposing =\n (e.nativeEvent as { isComposing?: boolean }).isComposing === true;\n // recover stuck compositionRef when the browser drops compositionend\n if (compositionRef.current && !nativeIsComposing) {\n compositionRef.current = false;\n }\n const isComposing = nativeIsComposing || compositionRef.current;\n // keep controlled value in sync mid-IME so react does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer.setText(e.target.value);\n });\n if (isComposing) return;\n const pos = e.target.selectionStart ?? e.target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyPress),\n onCompositionStart: composeEventHandlers(\n (rest as { onCompositionStart?: React.CompositionEventHandler })\n .onCompositionStart,\n () => {\n compositionRef.current = true;\n },\n ),\n onCompositionEnd: composeEventHandlers(\n (rest as { onCompositionEnd?: React.CompositionEventHandler })\n .onCompositionEnd,\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = false;\n if (!aui.composer.getState().isEditing) return;\n const target = e.target as HTMLTextAreaElement;\n flushTapSync(() => {\n aui.composer.setText(target.value);\n });\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onSelect: composeEventHandlers(\n onSelect,\n (e: React.SyntheticEvent<HTMLTextAreaElement>) => {\n if (compositionRef.current) return;\n const target = e.target as HTMLTextAreaElement;\n const pos = target.selectionStart ?? target.value.length;\n if (pluginRegistry) {\n for (const plugin of pluginRegistry.getPlugins()) {\n plugin.setCursorPosition(pos);\n }\n }\n },\n ),\n onPaste: composeEventHandlers(onPaste, handlePaste),\n ...(compactContext\n ? { onHeightChange: handleHeightChange }\n : onHeightChange !== undefined\n ? { onHeightChange }\n : {}),\n };\n\n if (render && isValidElement(render)) {\n const renderChildren =\n (rest as any).children !== undefined\n ? ((rest as any).children as ReactNode)\n : ((render.props as Record<string, unknown>).children as ReactNode);\n return (\n <Slot.Root {...inputProps}>\n {cloneElement(render, undefined, renderChildren)}\n </Slot.Root>\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,iBAAiBvC,cACrBmB,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;CAEnCM,kBAAkBgD,MAAM;EAEtB,IAAI,CAACH,YAAYI,SAASC,SAASF,EAAEG,MAAc,GAAG;EAGtD,IAAIH,EAAEK,aAAa;EAGnB,IAAIf,gBACG;QAAA,MAAMgB,UAAUhB,eAAeiB,WAAW,GAC7C,IAAID,OAAOE,cAAcR,CAAC,GAAG;EAAA;EAIjC,IAAI,CAAC/B,gBAAgB;EAErB,MAAMwC,WAAWpB,IAAIoB;EACrB,IAAIA,SAASC,SAAS,CAAC,CAACC,WAAW;GACjCF,SAASG,OAAO;GAChBZ,EAAEa,eAAe;EACnB;CACF,CAAC;CAED,MA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GAClD,IAAIjD,gBACF,KAAK,MAAMgB,YAAUhB,eAAeiB,WAAW,GAC7CD,SAAO4E,kBAAkBF,KAAG;EAGlC,CACF;EACA/F,UAAUjD,qBACRiD,WACCe,QAAiD;GAChD,IAAID,eAAeE,SAAS;GAC5B,MAAME,WAASH,IAAEG;GACjB,MAAM6E,QAAM7E,SAAO8E,kBAAkB9E,SAAOR,MAAM4C;GAClD,IAAIjD,gBACF,KAAK,MAAMgB,YAAUhB,eAAeiB,WAAW,GAC7CD,SAAO4E,kBAAkBF,KAAG;EAGlC,CACF;EACAhG,SAAShD,qBAAqBgD,SAASgD,WAAW;EAClD,GAAIzC,iBACA,EAAEL,gBAAgB2D,mBAAmB,IACrC3D,mBAAmBkF,KAAAA,IACjB,EAAElF,eAAe,IACjB,CAAC;CACT;CAEA,IAAIlB,UAAUpB,eAAeoB,MAAM,GAAG;EACpC,MAAMwH,iBACHrG,KAAasG,aAAarB,KAAAA,IACrBjF,KAAasG,WACbzH,OAAO0H,MAAkCD;EACjD,OACE,oBAAC,KAAK,MAAN;GAAW,GAAIlB;GACZ5H,UAAAA,aAAaqB,QAAQoG,KAAAA,GAAWoB,cAAc;EACtC,CAAA;CAEf;CAEA,MAAMI,YAAY7H,UAAU7B,KAAK2J,OAAOhJ;CACxC,OAAO,oBAAC,WAAD,EAAW,GAAI0H,WAAW,CAAA;AACnC,CACF;AAEA5G,uBAAuBmI,cAAc"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
- import { useAui, useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAui, useAuiState } from "@assistant-ui/store";
5
5
  import { forwardRef } from "@assistant-ui/tap/react-shim";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { composeEventHandlers } from "@radix-ui/primitive";
@@ -2,8 +2,8 @@
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
3
  import { useComposerSend } from "./ComposerSend.js";
4
4
  import { ComposerCompactContext } from "./ComposerCompactContext.js";
5
- import { useAuiState } from "@assistant-ui/store";
6
5
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
6
+ import { useAuiState } from "@assistant-ui/store";
7
7
  import { forwardRef, useState } from "@assistant-ui/tap/react-shim";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  import { composeEventHandlers } from "@radix-ui/primitive";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createActionButton } from "../../utils/createActionButton.js";
3
- import { useAui, useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAui, useAuiState } from "@assistant-ui/store";
5
5
  import "@assistant-ui/tap/react-shim";
6
6
  //#region src/primitives/composer/ComposerStopDictation.ts
7
7
  const useComposerStopDictation = () => {
@@ -3,8 +3,8 @@ import { Primitive } from "../../../utils/Primitive.js";
3
3
  import { useComposerInputPluginRegistryOptional } from "../ComposerInputPluginContext.js";
4
4
  import { useTriggerPopoverAriaPublish, useTriggerPopoverRootContext } from "./TriggerPopoverRootContext.js";
5
5
  import { TriggerPopoverResource } from "./TriggerPopoverResource.js";
6
- import { useAui, useAuiState } from "@assistant-ui/store";
7
6
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
7
+ import { useAui, useAuiState } from "@assistant-ui/store";
8
8
  import { createContext, forwardRef, useContext, useEffect, useEffectEvent, useId, useRef, useState } from "@assistant-ui/tap/react-shim";
9
9
  import { jsx } from "react/jsx-runtime";
10
10
  import { useResource } from "@assistant-ui/tap";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { useTriggerPopoverActiveAriaOptional } from "./trigger/TriggerPopoverRootContext.js";
3
- import { useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAuiState } from "@assistant-ui/store";
5
5
  //#region src/primitives/composer/useComposerInputState.ts
6
6
  function useComposerInputValue() {
7
7
  return useAuiState(_temp);
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { useAuiState } from "@assistant-ui/store";
3
2
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
+ import { useAuiState } from "@assistant-ui/store";
4
4
  //#region src/primitives/message/MessageIf.ts
5
5
  const useMessageIf = (props) => {
6
6
  const $ = c(12);
@@ -4,8 +4,8 @@ import { TextMessagePartProvider } from "../../context/providers/TextMessagePart
4
4
  import { MessagePartPrimitiveText } from "../messagePart/MessagePartText.js";
5
5
  import { MessagePartPrimitiveImage } from "../messagePart/MessagePartImage.js";
6
6
  import { MessagePartPrimitiveInProgress } from "../messagePart/MessagePartInProgress.js";
7
- import { useAui, useAuiState } from "@assistant-ui/store";
8
7
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
8
+ import { useAui, useAuiState } from "@assistant-ui/store";
9
9
  import { memo } from "@assistant-ui/tap/react-shim";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
11
  //#region src/primitives/message/MessagePartsGrouped.tsx
@@ -3,8 +3,8 @@ import { useThreadViewport, useThreadViewportStore } from "../../context/react/T
3
3
  import { Primitive } from "../../utils/Primitive.js";
4
4
  import { useManagedRef } from "../../utils/hooks/useManagedRef.js";
5
5
  import { parseCssLength } from "../thread/topAnchor/topAnchorUtils.js";
6
- import { useAui, useAuiState } from "@assistant-ui/store";
7
6
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
7
+ import { useAui, useAuiState } from "@assistant-ui/store";
8
8
  import { forwardRef } from "@assistant-ui/tap/react-shim";
9
9
  import { jsx } from "react/jsx-runtime";
10
10
  import { useComposedRefs } from "@radix-ui/react-compose-refs";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createActionButton } from "../../utils/createActionButton.js";
3
- import { useAui } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAui } from "@assistant-ui/store";
5
5
  import "@assistant-ui/tap/react-shim";
6
6
  //#region src/primitives/queueItem/QueueItemRemove.ts
7
7
  const useQueueItemRemove = () => {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createActionButton } from "../../utils/createActionButton.js";
3
- import { useAui } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAui } from "@assistant-ui/store";
5
5
  import "@assistant-ui/tap/react-shim";
6
6
  //#region src/primitives/queueItem/QueueItemSteer.ts
7
7
  const useQueueItemSteer = () => {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
- import { useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAuiState } from "@assistant-ui/store";
5
5
  import { forwardRef } from "@assistant-ui/tap/react-shim";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  //#region src/primitives/queueItem/QueueItemText.tsx
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
3
  import { useSelectionToolbarInfo } from "./SelectionToolbarRoot.js";
4
- import { useAui } from "@assistant-ui/store";
5
4
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
5
+ import { useAui } from "@assistant-ui/store";
6
6
  import { forwardRef } from "@assistant-ui/tap/react-shim";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  import { composeEventHandlers } from "@radix-ui/primitive";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
- import { useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAuiState } from "@assistant-ui/store";
5
5
  import { forwardRef } from "@assistant-ui/tap/react-shim";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  //#region src/primitives/suggestion/SuggestionDescription.tsx
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Primitive } from "../../utils/Primitive.js";
3
- import { useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
4
+ import { useAuiState } from "@assistant-ui/store";
5
5
  import { forwardRef } from "@assistant-ui/tap/react-shim";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  //#region src/primitives/suggestion/SuggestionTitle.tsx
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { createActionButton } from "../../utils/createActionButton.js";
3
- import { useAuiState } from "@assistant-ui/store";
4
3
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
5
4
  import { useSuggestionTrigger } from "@assistant-ui/core/react";
5
+ import { useAuiState } from "@assistant-ui/store";
6
6
  //#region src/primitives/suggestion/SuggestionTrigger.ts
7
7
  const useSuggestionTrigger$1 = (t0) => {
8
8
  const $ = c(4);
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { useAuiState } from "@assistant-ui/store";
3
2
  import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
+ import { useAuiState } from "@assistant-ui/store";
4
4
  //#region src/primitives/thread/ThreadIf.ts
5
5
  const useThreadIf = (props) => {
6
6
  const $ = c(4);
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadRoot.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadRoot.tsx"],"mappings":";;;kBASiB;OACH,UAAU,oBAAoB,UAAU;;;;;OAKxC,QAAQ,gCAAgC,UAAU;;;;;;;;;;;;;;;;;;;cAoBnD,qCAAmB,0BAAA,KAAA,qBAAA,gBAAA,kCAAA,eAAA;;;;oBAK9B,cAAA,0CAAA,cAAA"}
1
+ {"version":3,"file":"ThreadRoot.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadRoot.tsx"],"mappings":";;;kBAWiB;OACH,UAAU,oBAAoB,UAAU;;;;;OAKxC,QAAQ,gCAAgC,UAAU;;;;;;;;;;;;;;;;;;;cAoBnD,qCAAmB,0BAAA,KAAA,qBAAA,gBAAA,kCAAA,eAAA;;;;oBAiC9B,cAAA,0CAAA,cAAA"}