@assistant-ui/react-native 0.1.44 → 0.1.46

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 (89) hide show
  1. package/LICENSE +1 -1
  2. package/dist/index.d.ts +4 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3 -3
  5. package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
  6. package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
  7. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
  8. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
  9. package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
  10. package/dist/primitives/actionBar/ActionBarSpeak.js.map +1 -1
  11. package/dist/primitives/actionBar/ActionBarStopSpeaking.js.map +1 -1
  12. package/dist/primitives/attachment/AttachmentName.js.map +1 -1
  13. package/dist/primitives/attachment/AttachmentRemove.js.map +1 -1
  14. package/dist/primitives/attachment/AttachmentRoot.js.map +1 -1
  15. package/dist/primitives/attachment/AttachmentThumb.js.map +1 -1
  16. package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
  17. package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
  18. package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
  19. package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
  20. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js.map +1 -1
  21. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.js.map +1 -1
  22. package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
  23. package/dist/primitives/composer/ComposerCancel.js.map +1 -1
  24. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  25. package/dist/primitives/composer/ComposerQuote.js.map +1 -1
  26. package/dist/primitives/composer/ComposerQuoteDismiss.js.map +1 -1
  27. package/dist/primitives/composer/ComposerQuoteText.js.map +1 -1
  28. package/dist/primitives/composer/ComposerRoot.js.map +1 -1
  29. package/dist/primitives/composer/ComposerSend.js.map +1 -1
  30. package/dist/primitives/error/ErrorMessage.js.map +1 -1
  31. package/dist/primitives/error/ErrorRoot.js.map +1 -1
  32. package/dist/primitives/message/MessageContent.d.ts.map +1 -1
  33. package/dist/primitives/message/MessageContent.js +43 -33
  34. package/dist/primitives/message/MessageContent.js.map +1 -1
  35. package/dist/primitives/message/MessageIf.js.map +1 -1
  36. package/dist/primitives/message/MessageParts.js.map +1 -1
  37. package/dist/primitives/message/MessageRoot.js.map +1 -1
  38. package/dist/primitives/message.d.ts +1 -0
  39. package/dist/primitives/message.d.ts.map +1 -1
  40. package/dist/primitives/message.js +3 -2
  41. package/dist/primitives/message.js.map +1 -1
  42. package/dist/primitives/messagePart/MessagePartImage.js.map +1 -1
  43. package/dist/primitives/messagePart/MessagePartText.js.map +1 -1
  44. package/dist/primitives/queueItem/QueueItemRemove.js.map +1 -1
  45. package/dist/primitives/queueItem/QueueItemSteer.js.map +1 -1
  46. package/dist/primitives/queueItem/QueueItemText.js.map +1 -1
  47. package/dist/primitives/suggestion/SuggestionDescription.js.map +1 -1
  48. package/dist/primitives/suggestion/SuggestionTitle.js.map +1 -1
  49. package/dist/primitives/suggestion/SuggestionTrigger.js.map +1 -1
  50. package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
  51. package/dist/primitives/thread/ThreadIf.js.map +1 -1
  52. package/dist/primitives/thread/ThreadMessages.d.ts +7 -5
  53. package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
  54. package/dist/primitives/thread/ThreadMessages.js +109 -376
  55. package/dist/primitives/thread/ThreadMessages.js.map +1 -1
  56. package/dist/primitives/thread/ThreadRoot.js.map +1 -1
  57. package/dist/primitives/thread/ThreadRowsFlatList.d.ts +29 -0
  58. package/dist/primitives/thread/ThreadRowsFlatList.d.ts.map +1 -0
  59. package/dist/primitives/thread/ThreadRowsFlatList.js +226 -0
  60. package/dist/primitives/thread/ThreadRowsFlatList.js.map +1 -0
  61. package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
  62. package/dist/primitives/thread/flatListScroll.d.ts +52 -0
  63. package/dist/primitives/thread/flatListScroll.d.ts.map +1 -0
  64. package/dist/primitives/thread/flatListScroll.js +380 -0
  65. package/dist/primitives/thread/flatListScroll.js.map +1 -0
  66. package/dist/primitives/thread.d.ts +2 -0
  67. package/dist/primitives/thread.d.ts.map +1 -1
  68. package/dist/primitives/thread.js +5 -2
  69. package/dist/primitives/thread.js.map +1 -1
  70. package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
  71. package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
  72. package/dist/primitives/threadList/ThreadListRoot.js.map +1 -1
  73. package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
  74. package/dist/primitives/threadListItem/ThreadListItemDelete.js.map +1 -1
  75. package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
  76. package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -1
  77. package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -1
  78. package/package.json +13 -9
  79. package/src/index.ts +18 -1
  80. package/src/primitives/message/MessageContent.test.tsx +46 -1
  81. package/src/primitives/message/MessageContent.tsx +3 -1
  82. package/src/primitives/message.test.tsx +74 -0
  83. package/src/primitives/message.ts +1 -0
  84. package/src/primitives/thread/ThreadMessages.test.tsx +28 -1
  85. package/src/primitives/thread/ThreadMessages.tsx +49 -343
  86. package/src/primitives/thread/ThreadRowsFlatList.test.tsx +253 -0
  87. package/src/primitives/thread/ThreadRowsFlatList.tsx +159 -0
  88. package/src/primitives/thread/flatListScroll.ts +467 -0
  89. package/src/primitives/thread.ts +5 -0
@@ -3,6 +3,7 @@ import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
3
3
  import { Text } from "react-native";
4
4
  import { Fragment, jsx } from "react/jsx-runtime";
5
5
  import { Fragment as Fragment$1 } from "@assistant-ui/tap/react-shim";
6
+ import { getMessagePartKeys } from "@assistant-ui/core/internal";
6
7
  //#region src/primitives/message/MessageContent.tsx
7
8
  const DefaultTextRenderer = (t0) => {
8
9
  const $ = c(2);
@@ -117,15 +118,22 @@ const DataUIDisplay = (t0) => {
117
118
  return null;
118
119
  };
119
120
  const MessageContent = (t0) => {
120
- const $ = c(19);
121
+ const $ = c(23);
121
122
  const { renderText, renderToolCall, renderImage, renderReasoning, renderSource, renderFile, renderData } = t0;
122
123
  const content = useAuiState(_temp);
123
124
  let t1;
124
- if ($[0] !== content || $[1] !== renderData || $[2] !== renderFile || $[3] !== renderImage || $[4] !== renderReasoning || $[5] !== renderSource || $[6] !== renderText || $[7] !== renderToolCall) {
125
- let t2;
126
- if ($[9] !== renderData || $[10] !== renderFile || $[11] !== renderImage || $[12] !== renderReasoning || $[13] !== renderSource || $[14] !== renderText || $[15] !== renderToolCall) {
127
- t2 = (part, index) => {
128
- const key = `${part.type}-${index}`;
125
+ if ($[0] !== content) {
126
+ t1 = getMessagePartKeys(content);
127
+ $[0] = content;
128
+ $[1] = t1;
129
+ } else t1 = $[1];
130
+ const partKeys = t1;
131
+ let t2;
132
+ if ($[2] !== content || $[3] !== partKeys || $[4] !== renderData || $[5] !== renderFile || $[6] !== renderImage || $[7] !== renderReasoning || $[8] !== renderSource || $[9] !== renderText || $[10] !== renderToolCall) {
133
+ let t3;
134
+ if ($[12] !== partKeys || $[13] !== renderData || $[14] !== renderFile || $[15] !== renderImage || $[16] !== renderReasoning || $[17] !== renderSource || $[18] !== renderText || $[19] !== renderToolCall) {
135
+ t3 = (part, index) => {
136
+ const key = partKeys[index];
129
137
  switch (part.type) {
130
138
  case "text": return /* @__PURE__ */ jsx(Fragment$1, { children: renderText ? renderText({
131
139
  part,
@@ -168,33 +176,35 @@ const MessageContent = (t0) => {
168
176
  default: return null;
169
177
  }
170
178
  };
171
- $[9] = renderData;
172
- $[10] = renderFile;
173
- $[11] = renderImage;
174
- $[12] = renderReasoning;
175
- $[13] = renderSource;
176
- $[14] = renderText;
177
- $[15] = renderToolCall;
178
- $[16] = t2;
179
- } else t2 = $[16];
180
- t1 = content.map(t2);
181
- $[0] = content;
182
- $[1] = renderData;
183
- $[2] = renderFile;
184
- $[3] = renderImage;
185
- $[4] = renderReasoning;
186
- $[5] = renderSource;
187
- $[6] = renderText;
188
- $[7] = renderToolCall;
189
- $[8] = t1;
190
- } else t1 = $[8];
191
- let t2;
192
- if ($[17] !== t1) {
193
- t2 = /* @__PURE__ */ jsx(Fragment, { children: t1 });
194
- $[17] = t1;
195
- $[18] = t2;
196
- } else t2 = $[18];
197
- return t2;
179
+ $[12] = partKeys;
180
+ $[13] = renderData;
181
+ $[14] = renderFile;
182
+ $[15] = renderImage;
183
+ $[16] = renderReasoning;
184
+ $[17] = renderSource;
185
+ $[18] = renderText;
186
+ $[19] = renderToolCall;
187
+ $[20] = t3;
188
+ } else t3 = $[20];
189
+ t2 = content.map(t3);
190
+ $[2] = content;
191
+ $[3] = partKeys;
192
+ $[4] = renderData;
193
+ $[5] = renderFile;
194
+ $[6] = renderImage;
195
+ $[7] = renderReasoning;
196
+ $[8] = renderSource;
197
+ $[9] = renderText;
198
+ $[10] = renderToolCall;
199
+ $[11] = t2;
200
+ } else t2 = $[11];
201
+ let t3;
202
+ if ($[21] !== t2) {
203
+ t3 = /* @__PURE__ */ jsx(Fragment, { children: t2 });
204
+ $[21] = t2;
205
+ $[22] = t3;
206
+ } else t3 = $[22];
207
+ return t3;
198
208
  };
199
209
  function _temp(s) {
200
210
  return s.message.parts;
@@ -1 +1 @@
1
- {"version":3,"file":"MessageContent.js","names":["ReactElement","Fragment","useMemo","Text","ThreadUserMessagePart","ThreadAssistantMessagePart","MessagePartState","useAui","useAuiState","ToolCallMessagePartProps","DataMessagePartProps","MessageContentPart","MessageContentStatePart","MessageContentProps","renderText","props","part","Extract","type","index","renderToolCall","renderImage","renderReasoning","renderSource","renderFile","renderData","DefaultTextRenderer","t0","$","_c","t1","text","ToolUIDisplay","Fallback","aui","toolName","s","tools","toolUIs","render","Render","t2","message","partMethods","t3","t4","unstable_recordInteraction","t5","addToolResult","respondToToolApproval","resumeToolCall","DataUIDisplay","name","named","dataRenderers","renderers","fallbacks","MessageContent","content","_temp","key","map","parts"],"sources":["../../../src/primitives/message/MessageContent.tsx"],"sourcesContent":["import { type ReactElement, Fragment, useMemo } from \"react\";\nimport { Text } from \"react-native\";\nimport type {\n ThreadUserMessagePart,\n ThreadAssistantMessagePart,\n MessagePartState,\n} from \"@assistant-ui/core\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport type {\n ToolCallMessagePartProps,\n DataMessagePartProps,\n} from \"@assistant-ui/core/react\";\n\ntype MessageContentPart = ThreadUserMessagePart | ThreadAssistantMessagePart;\ntype MessageContentStatePart = MessagePartState;\n\nexport type MessageContentProps = {\n renderText?: (props: {\n part: Extract<MessageContentPart, { type: \"text\" }>;\n index: number;\n }) => ReactElement;\n renderToolCall?: (props: {\n part: Extract<MessageContentPart, { type: \"tool-call\" }>;\n index: number;\n }) => ReactElement;\n renderImage?: (props: {\n part: Extract<MessageContentPart, { type: \"image\" }>;\n index: number;\n }) => ReactElement;\n renderReasoning?: (props: {\n part: Extract<MessageContentPart, { type: \"reasoning\" }>;\n index: number;\n }) => ReactElement;\n renderSource?: (props: {\n part: Extract<MessageContentPart, { type: \"source\" }>;\n index: number;\n }) => ReactElement;\n renderFile?: (props: {\n part: Extract<MessageContentPart, { type: \"file\" }>;\n index: number;\n }) => ReactElement;\n renderData?: (props: {\n part: Extract<MessageContentPart, { type: \"data\" }>;\n index: number;\n }) => ReactElement;\n};\n\nconst DefaultTextRenderer = ({\n part,\n}: {\n part: Extract<MessageContentPart, { type: \"text\" }>;\n}) => {\n return <Text>{part.text}</Text>;\n};\n\nconst ToolUIDisplay = ({\n Fallback,\n part,\n index,\n}: {\n Fallback:\n | ((props: {\n part: Extract<MessageContentPart, { type: \"tool-call\" }>;\n index: number;\n }) => ReactElement)\n | undefined;\n part: Extract<MessageContentStatePart, { type: \"tool-call\" }>;\n index: number;\n}) => {\n const aui = useAui();\n const Render = useAuiState(\n (s) => s.tools.toolUIs[part.toolName]?.[0]?.render,\n );\n\n const partMethods = useMemo(() => aui.message.part({ index }), [aui, index]);\n\n if (Render) {\n return (\n <Render\n {...(part as ToolCallMessagePartProps)}\n addResult={partMethods.addToolResult}\n resume={partMethods.resumeToolCall}\n respondToApproval={partMethods.respondToToolApproval}\n {...(partMethods.unstable_recordInteraction && {\n unstable_recordInteraction: partMethods.unstable_recordInteraction,\n })}\n />\n );\n }\n if (Fallback) return <Fallback part={part} index={index} />;\n return null;\n};\n\nconst DataUIDisplay = ({\n Fallback,\n part,\n index,\n}: {\n Fallback:\n | ((props: {\n part: Extract<MessageContentPart, { type: \"data\" }>;\n index: number;\n }) => ReactElement)\n | undefined;\n part: Extract<MessageContentStatePart, { type: \"data\" }>;\n index: number;\n}) => {\n const Render = useAuiState((s) => {\n const named = s.dataRenderers.renderers[part.name]?.[0];\n return named ?? s.dataRenderers.fallbacks[0];\n });\n if (Render) return <Render {...(part as DataMessagePartProps)} />;\n if (Fallback) return <Fallback part={part} index={index} />;\n return null;\n};\n\nexport const MessageContent = ({\n renderText,\n renderToolCall,\n renderImage,\n renderReasoning,\n renderSource,\n renderFile,\n renderData,\n}: MessageContentProps) => {\n const content = useAuiState((s) => s.message.parts);\n\n return (\n <>\n {content.map((part, index) => {\n const key = `${part.type}-${index}`;\n switch (part.type) {\n case \"text\":\n return (\n <Fragment key={key}>\n {renderText ? (\n renderText({ part, index })\n ) : (\n <DefaultTextRenderer part={part} />\n )}\n </Fragment>\n );\n case \"tool-call\":\n return (\n <Fragment key={key}>\n <ToolUIDisplay\n Fallback={renderToolCall}\n part={part}\n index={index}\n />\n </Fragment>\n );\n case \"image\":\n if (!renderImage) return null;\n return (\n <Fragment key={key}>{renderImage({ part, index })}</Fragment>\n );\n case \"reasoning\":\n if (!renderReasoning) return null;\n return (\n <Fragment key={key}>{renderReasoning({ part, index })}</Fragment>\n );\n case \"source\":\n if (!renderSource) return null;\n return (\n <Fragment key={key}>{renderSource({ part, index })}</Fragment>\n );\n case \"file\":\n if (!renderFile) return null;\n return <Fragment key={key}>{renderFile({ part, index })}</Fragment>;\n case \"data\":\n return (\n <Fragment key={key}>\n <DataUIDisplay\n Fallback={renderData}\n part={part}\n index={index}\n />\n </Fragment>\n );\n default:\n return null;\n }\n })}\n </>\n );\n};\n"],"mappings":";;;;;;AA+CA,MAAM0B,uBAAsBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAb,SAAAW;CAI5B,IAAAG;CAAA,IAAAF,EAAA,OAAAZ,KAAAe,MAAA;EACQD,KAAA,oBAAC,MAAD,EAAA,UAAOd,KAAIe,KAAN,CAAA;EAAmBH,EAAA,KAAAZ,KAAAe;EAAAH,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAAxBE;AAAwB;AAGjC,MAAME,iBAAgBL,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAC,MAAA,EAAAI,UAAAjB,MAAAG,UAAAQ;CAcrB,MAAAO,MAAY3B,OAAO;CAAE,IAAAuB;CAAA,IAAAF,EAAA,OAAAZ,KAAAmB,UAAA;EAEnBL,MAAAM,MAAOA,EAACC,MAAMC,QAAStB,KAAImB,SAAe,GAAA,EAAQ,EAAAI;EAAAX,EAAA,KAAAZ,KAAAmB;EAAAP,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CADpD,MAAAY,SAAehC,YACbsB,EACF;CAAE,IAAAW;CAAA,IAAAb,EAAA,OAAAM,IAAAQ,WAAAd,EAAA,OAAAT,OAAA;EAEgCsB,KAAAP,IAAGQ,QAAQ1B,KAAM,EAAAG,MAAQ,CAAC;EAACS,EAAA,KAAAM,IAAAQ;EAAAd,EAAA,KAAAT;EAAAS,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAA7D,MAAAe,cAAkCF;CAElC,IAAID,QAAM;EAGC,MAAAI,KAAA5B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AAA,MAAAJ;GAAAI,EAAA,MAAAP;GAAAO,EAAA,MAAAN;GAAAM,EAAA,MAAAL;GAAAK,EAAA,MAAAd;GAAAc,EAAA,MAAAR;GAAAQ,EAAA,MAAAa;EAAA,OAAAA,KAAAb,EAAA;EAtDAE,KAAA4B,QAAOG,IAAKpB,EAsDZ;EAACb,EAAA,KAAA8B;EAAA9B,EAAA,KAAAH;EAAAG,EAAA,KAAAJ;EAAAI,EAAA,KAAAP;EAAAO,EAAA,KAAAN;EAAAM,EAAA,KAAAL;EAAAK,EAAA,KAAAd;EAAAc,EAAA,KAAAR;EAAAQ,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,QAAAE,IAAA;EAvDJW,KAAA,oBAAA,UAAA,EAAA,UACGX,GAsDC,CAAA;EACDF,EAAA,MAAAE;EAAAF,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAxDHa;AAwDG;AApEuB,SAAAkB,MAAAvB,GAAA;CAAA,OASOA,EAACM,QAAQoB;AAAM"}
1
+ {"version":3,"file":"MessageContent.js","names":["ReactElement","Fragment","useMemo","Text","getMessagePartKeys","ThreadUserMessagePart","ThreadAssistantMessagePart","MessagePartState","useAui","useAuiState","ToolCallMessagePartProps","DataMessagePartProps","MessageContentPart","MessageContentStatePart","MessageContentProps","renderText","props","part","Extract","type","index","renderToolCall","renderImage","renderReasoning","renderSource","renderFile","renderData","DefaultTextRenderer","t0","$","_c","t1","text","ToolUIDisplay","Fallback","aui","toolName","s","tools","toolUIs","render","Render","t2","message","partMethods","t3","t4","unstable_recordInteraction","t5","addToolResult","respondToToolApproval","resumeToolCall","DataUIDisplay","name","named","dataRenderers","renderers","fallbacks","MessageContent","content","_temp","partKeys","key","map","parts","_c","Fragment"],"sources":["../../../src/primitives/message/MessageContent.tsx"],"sourcesContent":["import { type ReactElement, Fragment, useMemo } from \"react\";\nimport { Text } from \"react-native\";\nimport { getMessagePartKeys } from \"@assistant-ui/core/internal\";\nimport type {\n ThreadUserMessagePart,\n ThreadAssistantMessagePart,\n MessagePartState,\n} from \"@assistant-ui/core\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport type {\n ToolCallMessagePartProps,\n DataMessagePartProps,\n} from \"@assistant-ui/core/react\";\n\ntype MessageContentPart = ThreadUserMessagePart | ThreadAssistantMessagePart;\ntype MessageContentStatePart = MessagePartState;\n\nexport type MessageContentProps = {\n renderText?: (props: {\n part: Extract<MessageContentPart, { type: \"text\" }>;\n index: number;\n }) => ReactElement;\n renderToolCall?: (props: {\n part: Extract<MessageContentPart, { type: \"tool-call\" }>;\n index: number;\n }) => ReactElement;\n renderImage?: (props: {\n part: Extract<MessageContentPart, { type: \"image\" }>;\n index: number;\n }) => ReactElement;\n renderReasoning?: (props: {\n part: Extract<MessageContentPart, { type: \"reasoning\" }>;\n index: number;\n }) => ReactElement;\n renderSource?: (props: {\n part: Extract<MessageContentPart, { type: \"source\" }>;\n index: number;\n }) => ReactElement;\n renderFile?: (props: {\n part: Extract<MessageContentPart, { type: \"file\" }>;\n index: number;\n }) => ReactElement;\n renderData?: (props: {\n part: Extract<MessageContentPart, { type: \"data\" }>;\n index: number;\n }) => ReactElement;\n};\n\nconst DefaultTextRenderer = ({\n part,\n}: {\n part: Extract<MessageContentPart, { type: \"text\" }>;\n}) => {\n return <Text>{part.text}</Text>;\n};\n\nconst ToolUIDisplay = ({\n Fallback,\n part,\n index,\n}: {\n Fallback:\n | ((props: {\n part: Extract<MessageContentPart, { type: \"tool-call\" }>;\n index: number;\n }) => ReactElement)\n | undefined;\n part: Extract<MessageContentStatePart, { type: \"tool-call\" }>;\n index: number;\n}) => {\n const aui = useAui();\n const Render = useAuiState(\n (s) => s.tools.toolUIs[part.toolName]?.[0]?.render,\n );\n\n const partMethods = useMemo(() => aui.message.part({ index }), [aui, index]);\n\n if (Render) {\n return (\n <Render\n {...(part as ToolCallMessagePartProps)}\n addResult={partMethods.addToolResult}\n resume={partMethods.resumeToolCall}\n respondToApproval={partMethods.respondToToolApproval}\n {...(partMethods.unstable_recordInteraction && {\n unstable_recordInteraction: partMethods.unstable_recordInteraction,\n })}\n />\n );\n }\n if (Fallback) return <Fallback part={part} index={index} />;\n return null;\n};\n\nconst DataUIDisplay = ({\n Fallback,\n part,\n index,\n}: {\n Fallback:\n | ((props: {\n part: Extract<MessageContentPart, { type: \"data\" }>;\n index: number;\n }) => ReactElement)\n | undefined;\n part: Extract<MessageContentStatePart, { type: \"data\" }>;\n index: number;\n}) => {\n const Render = useAuiState((s) => {\n const named = s.dataRenderers.renderers[part.name]?.[0];\n return named ?? s.dataRenderers.fallbacks[0];\n });\n if (Render) return <Render {...(part as DataMessagePartProps)} />;\n if (Fallback) return <Fallback part={part} index={index} />;\n return null;\n};\n\nexport const MessageContent = ({\n renderText,\n renderToolCall,\n renderImage,\n renderReasoning,\n renderSource,\n renderFile,\n renderData,\n}: MessageContentProps) => {\n const content = useAuiState((s) => s.message.parts);\n const partKeys = getMessagePartKeys(content);\n\n return (\n <>\n {content.map((part, index) => {\n const key = partKeys[index];\n switch (part.type) {\n case \"text\":\n return (\n <Fragment key={key}>\n {renderText ? (\n renderText({ part, index })\n ) : (\n <DefaultTextRenderer part={part} />\n )}\n </Fragment>\n );\n case \"tool-call\":\n return (\n <Fragment key={key}>\n <ToolUIDisplay\n Fallback={renderToolCall}\n part={part}\n index={index}\n />\n </Fragment>\n );\n case \"image\":\n if (!renderImage) return null;\n return (\n <Fragment key={key}>{renderImage({ part, index })}</Fragment>\n );\n case \"reasoning\":\n if (!renderReasoning) return null;\n return (\n <Fragment key={key}>{renderReasoning({ part, index })}</Fragment>\n );\n case \"source\":\n if (!renderSource) return null;\n return (\n <Fragment key={key}>{renderSource({ part, index })}</Fragment>\n );\n case \"file\":\n if (!renderFile) return null;\n return <Fragment key={key}>{renderFile({ part, index })}</Fragment>;\n case \"data\":\n return (\n <Fragment key={key}>\n <DataUIDisplay\n Fallback={renderData}\n part={part}\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AC;GACFjC,EAAA,MAAAgC;GAAAhC,EAAA,MAAAH;GAAAG,EAAA,MAAAJ;GAAAI,EAAA,MAAAP;GAAAO,EAAA,MAAAN;GAAAM,EAAA,MAAAL;GAAAK,EAAA,MAAAd;GAAAc,EAAA,MAAAR;GAAAQ,EAAA,MAAAgB;EAAA,OAAAA,KAAAhB,EAAA;EAtDAa,KAAAiB,QAAOI,IAAKlB,EAsDZ;EAAChB,EAAA,KAAA8B;EAAA9B,EAAA,KAAAgC;EAAAhC,EAAA,KAAAH;EAAAG,EAAA,KAAAJ;EAAAI,EAAA,KAAAP;EAAAO,EAAA,KAAAN;EAAAM,EAAA,KAAAL;EAAAK,EAAA,KAAAd;EAAAc,EAAA,MAAAR;EAAAQ,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAgB;CAAA,IAAAhB,EAAA,QAAAa,IAAA;EAvDJG,KAAA,oBAAA,UAAA,EAAA,UACGH,GAsDC,CAAA;EACDb,EAAA,MAAAa;EAAAb,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,OAxDHgB;AAwDG;AArEuB,SAAAe,MAAAvB,GAAA;CAAA,OASOA,EAACM,QAAQqB;AAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessageIf.js","names":["ReactNode","useAuiState","MessageIfProps","children","user","assistant","running","last","MessageIf","t0","$","_c","message","_temp","undefined","role","isRunning","status","type","isLast","t1","s"],"sources":["../../../src/primitives/message/MessageIf.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type MessageIfProps = {\n children: ReactNode;\n user?: boolean | undefined;\n assistant?: boolean | undefined;\n running?: boolean | undefined;\n last?: boolean | undefined;\n};\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.message...} />` instead.\n */\nexport const MessageIf = ({\n children,\n user,\n assistant,\n running,\n last,\n}: MessageIfProps) => {\n const message = useAuiState((s) => s.message);\n\n if (user !== undefined) {\n if (user !== (message.role === \"user\")) return null;\n }\n\n if (assistant !== undefined) {\n if (assistant !== (message.role === \"assistant\")) return null;\n }\n\n if (running !== undefined) {\n const isRunning =\n message.role === \"assistant\" && message.status.type === \"running\";\n if (running !== isRunning) return null;\n }\n\n if (last !== undefined) {\n if (last !== message.isLast) return null;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;;;;AAcA,MAAaQ,aAAYC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAR,UAAAC,MAAAC,WAAAC,SAAAC,SAAAE;CAOxB,MAAAG,UAAgBX,YAAYY,KAAgB;CAE5C,IAAIT,SAASU,KAAAA,GACPV;MAAAA,UAAUQ,QAAOG,SAAU,SAAO,OAAS;CAAA;CAGjD,IAAIV,cAAcS,KAAAA,GACZT;MAAAA,eAAeO,QAAOG,SAAU,cAAY,OAAS;CAAA;CAG3D,IAAIT,YAAYQ,KAAAA,GAGVR;MAAAA,aADFM,QAAOG,SAAU,eAAeH,QAAOK,OAAOC,SAAU,YACjC,OAAS;CAAA;CAGpC,IAAIX,SAASO,KAAAA,GACPP;MAAAA,SAASK,QAAOO,QAAO,OAAS;CAAA;CACrC,IAAAC;CAAA,IAAAV,EAAA,OAAAP,UAAA;EAEMiB,KAAA,oBAAA,UAAA,EAAGjB,SAAQ,CAAA;EAAIO,EAAA,KAAAP;EAAAO,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAAfU;AAAe;AA3BC,SAAAP,MAAAQ,GAAA;CAAA,OAOYA,EAACT;AAAQ"}
1
+ {"version":3,"file":"MessageIf.js","names":["ReactNode","useAuiState","MessageIfProps","children","user","assistant","running","last","MessageIf","t0","$","_c","message","_temp","undefined","role","isRunning","status","type","isLast","t1","s","_c"],"sources":["../../../src/primitives/message/MessageIf.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type MessageIfProps = {\n children: ReactNode;\n user?: boolean | undefined;\n assistant?: boolean | undefined;\n running?: boolean | undefined;\n last?: boolean | undefined;\n};\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.message...} />` instead.\n */\nexport const MessageIf = ({\n children,\n user,\n assistant,\n running,\n last,\n}: MessageIfProps) => {\n const message = useAuiState((s) => s.message);\n\n if (user !== undefined) {\n if (user !== (message.role === \"user\")) return null;\n }\n\n if (assistant !== undefined) {\n if (assistant !== (message.role === \"assistant\")) return null;\n }\n\n if (running !== undefined) {\n const isRunning =\n message.role === \"assistant\" && message.status.type === \"running\";\n if (running !== isRunning) return null;\n }\n\n if (last !== undefined) {\n if (last !== message.isLast) return null;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;;;;AAcA,MAAaQ,aAAYC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAR,UAAAC,MAAAC,WAAAC,SAAAC,SAAAE;CAOxB,MAAAG,UAAgBX,YAAYY,KAAgB;CAE5C,IAAIT,SAASU,KAAAA,GACPV;MAAAA,UAAUQ,QAAOG,SAAU,SAAO,OAAS;CAAA;CAGjD,IAAIV,cAAcS,KAAAA,GACZT;MAAAA,eAAeO,QAAOG,SAAU,cAAY,OAAS;CAAA;CAG3D,IAAIT,YAAYQ,KAAAA,GAGVR;MAAAA,aADFM,QAAOG,SAAU,eAAeH,QAAOK,OAAOC,SAAU,YACjC,OAAS;CAAA;CAGpC,IAAIX,SAASO,KAAAA,GACPP;MAAAA,SAASK,QAAOO,QAAO,OAAS;CAAA;CACrC,IAAAC;CAAA,IAAAV,EAAA,OAAAP,UAAA;EAEMiB,KAAA,oBAAA,UAAA,EAAGjB,SAAQ,CAAA;EAAIO,EAAA,KAAAP;EAAAO,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAAfU;AAAe;AA3BC,SAAAP,MAAAQ,GAAA;CAAA,OAOYA,EAACT;AAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessageParts.js","names":["FC","Text","MessagePrimitiveParts","MessagePrimitivePartsBase","MessagePartComponent","MessagePartComponentBase","MessagePrimitivePartByIndex","MessagePrimitivePartByIndexBase","messagePartsDefaultComponents","rnDefaultComponents","text","Props","props","$","_c","t0","children","components","rest","merged","t1","t2","displayName"],"sources":["../../../src/primitives/message/MessageParts.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { Text } from \"react-native\";\nimport {\n MessagePrimitiveParts as MessagePrimitivePartsBase,\n MessagePartComponent as MessagePartComponentBase,\n MessagePrimitivePartByIndex as MessagePrimitivePartByIndexBase,\n messagePartsDefaultComponents,\n} from \"@assistant-ui/core/react\";\n\nconst rnDefaultComponents = {\n ...messagePartsDefaultComponents,\n Text: ({ text }: { text: string }) => <Text>{text}</Text>,\n} satisfies MessagePrimitiveParts.Props[\"components\"];\n\nexport namespace MessagePrimitiveParts {\n export type Props = MessagePrimitivePartsBase.Props;\n}\n\n/**\n * Renders the parts of a message with React Native-specific default components.\n */\nexport const MessagePrimitiveParts: FC<MessagePrimitiveParts.Props> = (\n props,\n) => {\n if (\"children\" in props) {\n return (\n <MessagePrimitivePartsBase>{props.children}</MessagePrimitivePartsBase>\n );\n }\n\n const { components, ...rest } = props;\n const merged = components\n ? { ...components, Text: components.Text ?? rnDefaultComponents.Text }\n : rnDefaultComponents;\n\n return <MessagePrimitivePartsBase components={merged as any} {...rest} />;\n};\n\nMessagePrimitiveParts.displayName = \"MessagePrimitive.Parts\";\n\nexport {\n MessagePartComponentBase as MessagePartComponent,\n MessagePrimitivePartByIndexBase as MessagePrimitivePartByIndex,\n};\n"],"mappings":";;;;;AASA,MAAMS,sBAAsB;CAC1B,GAAGD;CACHP,OAAO,EAAES,WAA6B,oBAAC,MAAD,EAAA,UAAOA,KAAW,CAAA;AAC1D;;;;AASA,MAAaR,yBAAyDU,UAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAGpE,IAAI,cAAcF,OAAK;EAAA,IAAAG;EAAA,IAAAF,EAAA,OAAAD,MAAAI,UAAA;GAEnBD,KAAA,oBAAC,yBAAD,EAAA,UAA4BH,MAAKI,SAAP,CAAA;GAA6CH,EAAA,KAAAD,MAAAI;GAAAH,EAAA,KAAAE;EAAA,OAAAA,KAAAF,EAAA;EAAA,OAAvEE;CAAuE;CAE1E,IAAAE;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,OAAA;EAED,CAAA,CAAAK,YAAA,GAAAC,QAAgCN;EAAMC,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAD,aAAAJ,EAAA;EAAAK,OAAAL,EAAA;CAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAI,YAAA;EACvBF,KAAAE,aAAA;GAAA,GACNA;GAAUhB,MAAQgB,WAAUhB,QAASQ,oBAAmBR;EAC3C,IAFPQ;EAEQI,EAAA,KAAAI;EAAAJ,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAEuB,MAAAO,KAAAD;CAAa,IAAAE;CAAA,IAAAR,EAAA,OAAAK,QAAAL,EAAA,OAAAO,IAAA;EAApDC,KAAA,oBAAC,yBAAD;GAAuC,YAAAD;GAAa,GAAMF;EAAI,CAAA;EAAIL,EAAA,KAAAK;EAAAL,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAAlEQ;AAAkE;AAG3EnB,sBAAsBoB,cAAc"}
1
+ {"version":3,"file":"MessageParts.js","names":["FC","Text","MessagePrimitiveParts","MessagePrimitivePartsBase","MessagePartComponent","MessagePartComponentBase","MessagePrimitivePartByIndex","MessagePrimitivePartByIndexBase","messagePartsDefaultComponents","rnDefaultComponents","text","Props","props","$","_c","t0","children","components","rest","merged","t1","t2","displayName","_c","MessagePrimitivePartsBase","merged"],"sources":["../../../src/primitives/message/MessageParts.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { Text } from \"react-native\";\nimport {\n MessagePrimitiveParts as MessagePrimitivePartsBase,\n MessagePartComponent as MessagePartComponentBase,\n MessagePrimitivePartByIndex as MessagePrimitivePartByIndexBase,\n messagePartsDefaultComponents,\n} from \"@assistant-ui/core/react\";\n\nconst rnDefaultComponents = {\n ...messagePartsDefaultComponents,\n Text: ({ text }: { text: string }) => <Text>{text}</Text>,\n} satisfies MessagePrimitiveParts.Props[\"components\"];\n\nexport namespace MessagePrimitiveParts {\n export type Props = MessagePrimitivePartsBase.Props;\n}\n\n/**\n * Renders the parts of a message with React Native-specific default components.\n */\nexport const MessagePrimitiveParts: FC<MessagePrimitiveParts.Props> = (\n props,\n) => {\n if (\"children\" in props) {\n return (\n <MessagePrimitivePartsBase>{props.children}</MessagePrimitivePartsBase>\n );\n }\n\n const { components, ...rest } = props;\n const merged = components\n ? { ...components, Text: components.Text ?? rnDefaultComponents.Text }\n : rnDefaultComponents;\n\n return <MessagePrimitivePartsBase components={merged as any} {...rest} />;\n};\n\nMessagePrimitiveParts.displayName = \"MessagePrimitive.Parts\";\n\nexport {\n MessagePartComponentBase as MessagePartComponent,\n MessagePrimitivePartByIndexBase as MessagePrimitivePartByIndex,\n};\n"],"mappings":";;;;;AASA,MAAMS,sBAAsB;CAC1B,GAAGD;CACHP,OAAO,EAAES,WAA6B,oBAAC,MAAD,EAAA,UAAOA,KAAW,CAAA;AAC1D;;;;AASA,MAAaR,yBAAyDU,UAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAGpE,IAAI,cAAcF,OAAK;EAAA,IAAAG;EAAA,IAAAF,EAAA,OAAAD,MAAAI,UAAA;GAEnBD,KAAA,oBAACS,yBAAD,EAAA,UAA4BZ,MAAKI,SAAP,CAAA;GAA6CH,EAAA,KAAAD,MAAAI;GAAAH,EAAA,KAAAE;EAAA,OAAAA,KAAAF,EAAA;EAAA,OAAvEE;CAAuE;CAE1E,IAAAE;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,OAAA;EAED,CAAA,CAAAK,YAAA,GAAAC,QAAgCN;EAAMC,EAAA,KAAAD;EAAAC,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAD,aAAAJ,EAAA;EAAAK,OAAAL,EAAA;CAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAI,YAAA;EACvBF,KAAAE,aAAA;GAAA,GACNA;GAAUhB,MAAQgB,WAAUhB,QAASQ,oBAAmBR;EAC3C,IAFPQ;EAEQI,EAAA,KAAAI;EAAAJ,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAEuB,MAAAO,KAAAD;CAAa,IAAAE;CAAA,IAAAR,EAAA,OAAAK,QAAAL,EAAA,OAAAO,IAAA;EAApDC,KAAA,oBAACG,yBAAD;GAAuC,YAAAJ;GAAa,GAAMF;EAAI,CAAA;EAAIL,EAAA,KAAAK;EAAAL,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAAlEQ;AAAkE;AAG3EnB,sBAAsBoB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessageRoot.js","names":["ReactNode","View","ViewProps","MessageRootProps","children","MessageRoot","t0","$","_c","viewProps","t1"],"sources":["../../../src/primitives/message/MessageRoot.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { View, type ViewProps } from \"react-native\";\n\nexport type MessageRootProps = ViewProps & {\n children: ReactNode;\n};\n\nexport const MessageRoot = ({ children, ...viewProps }: MessageRootProps) => {\n return <View {...viewProps}>{children}</View>;\n};\n"],"mappings":";;;;AAOA,MAAaK,eAAcC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,aAAAH;EAA4CC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAH,YAAAG,EAAA,OAAAE,WAAA;EAC/DC,KAAA,oBAAC,MAAD;GAAK,GAAKD;GAAYL;EAAjB,CAAA;EAAiCG,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAAtCG;AAAsC"}
1
+ {"version":3,"file":"MessageRoot.js","names":["ReactNode","View","ViewProps","MessageRootProps","children","MessageRoot","t0","$","_c","viewProps","t1","_c"],"sources":["../../../src/primitives/message/MessageRoot.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { View, type ViewProps } from \"react-native\";\n\nexport type MessageRootProps = ViewProps & {\n children: ReactNode;\n};\n\nexport const MessageRoot = ({ children, ...viewProps }: MessageRootProps) => {\n return <View {...viewProps}>{children}</View>;\n};\n"],"mappings":";;;;AAOA,MAAaK,eAAcC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,aAAAH;EAA4CC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAH,YAAAG,EAAA,OAAAE,WAAA;EAC/DC,KAAA,oBAAC,MAAD;GAAK,GAAKD;GAAYL;EAAjB,CAAA;EAAiCG,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAAtCG;AAAsC"}
@@ -2,6 +2,7 @@ export { MessageRoot as Root, type MessageRootProps as RootProps, } from "./mess
2
2
  export { MessageContent as Content, type MessageContentProps as ContentProps, } from "./message/MessageContent.js";
3
3
  export { MessagePrimitiveParts as Parts, MessagePrimitivePartByIndex as PartByIndex, } from "./message/MessageParts.js";
4
4
  export { MessagePrimitiveGroupedParts as GroupedParts } from "@assistant-ui/core/react";
5
+ export { MessagePrimitiveQuote as Quote } from "@assistant-ui/core/react";
5
6
  export { MessageIf as If, type MessageIfProps as IfProps, } from "./message/MessageIf.js";
6
7
  export { MessageAttachments as Attachments, type MessageAttachmentsProps as AttachmentsProps, MessageAttachmentByIndex as AttachmentByIndex, type MessageAttachmentByIndexProps as AttachmentByIndexProps, } from "./message/MessageAttachments.js";
7
8
  //# sourceMappingURL=message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/primitives/message.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,IAAI,EACnB,KAAK,gBAAgB,IAAI,SAAS,GACnC,iCAA8B;AAC/B,OAAO,EACL,cAAc,IAAI,OAAO,EACzB,KAAK,mBAAmB,IAAI,YAAY,GACzC,oCAAiC;AAClC,OAAO,EACL,qBAAqB,IAAI,KAAK,EAC9B,2BAA2B,IAAI,WAAW,GAC3C,kCAA+B;AAChC,OAAO,EAAE,4BAA4B,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EACL,SAAS,IAAI,EAAE,EACf,KAAK,cAAc,IAAI,OAAO,GAC/B,+BAA4B;AAC7B,OAAO,EACL,kBAAkB,IAAI,WAAW,EACjC,KAAK,uBAAuB,IAAI,gBAAgB,EAChD,wBAAwB,IAAI,iBAAiB,EAC7C,KAAK,6BAA6B,IAAI,sBAAsB,GAC7D,wCAAqC"}
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/primitives/message.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,IAAI,EACnB,KAAK,gBAAgB,IAAI,SAAS,GACnC,iCAA8B;AAC/B,OAAO,EACL,cAAc,IAAI,OAAO,EACzB,KAAK,mBAAmB,IAAI,YAAY,GACzC,oCAAiC;AAClC,OAAO,EACL,qBAAqB,IAAI,KAAK,EAC9B,2BAA2B,IAAI,WAAW,GAC3C,kCAA+B;AAChC,OAAO,EAAE,4BAA4B,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,qBAAqB,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EACL,SAAS,IAAI,EAAE,EACf,KAAK,cAAc,IAAI,OAAO,GAC/B,+BAA4B;AAC7B,OAAO,EACL,kBAAkB,IAAI,WAAW,EACjC,KAAK,uBAAuB,IAAI,gBAAgB,EAChD,wBAAwB,IAAI,iBAAiB,EAC7C,KAAK,6BAA6B,IAAI,sBAAsB,GAC7D,wCAAqC"}
@@ -4,7 +4,7 @@ import { MessageContent } from "./message/MessageContent.js";
4
4
  import { MessagePrimitivePartByIndex as MessagePrimitivePartByIndexBase, MessagePrimitiveParts } from "./message/MessageParts.js";
5
5
  import { MessageIf } from "./message/MessageIf.js";
6
6
  import { MessageAttachmentByIndex, MessageAttachments } from "./message/MessageAttachments.js";
7
- import { MessagePrimitiveGroupedParts as GroupedParts } from "@assistant-ui/core/react";
7
+ import { MessagePrimitiveGroupedParts as GroupedParts, MessagePrimitiveQuote as Quote } from "@assistant-ui/core/react";
8
8
  //#region src/primitives/message.ts
9
9
  var message_exports = /* @__PURE__ */ __exportAll({
10
10
  AttachmentByIndex: () => MessageAttachmentByIndex,
@@ -14,9 +14,10 @@ var message_exports = /* @__PURE__ */ __exportAll({
14
14
  If: () => MessageIf,
15
15
  PartByIndex: () => MessagePrimitivePartByIndexBase,
16
16
  Parts: () => MessagePrimitiveParts,
17
+ Quote: () => Quote,
17
18
  Root: () => MessageRoot
18
19
  });
19
20
  //#endregion
20
- export { MessageAttachmentByIndex as AttachmentByIndex, MessageAttachments as Attachments, MessageContent as Content, GroupedParts, MessageIf as If, MessagePrimitivePartByIndexBase as PartByIndex, MessagePrimitiveParts as Parts, MessageRoot as Root, message_exports };
21
+ export { MessageAttachmentByIndex as AttachmentByIndex, MessageAttachments as Attachments, MessageContent as Content, GroupedParts, MessageIf as If, MessagePrimitivePartByIndexBase as PartByIndex, MessagePrimitiveParts as Parts, Quote, MessageRoot as Root, message_exports };
21
22
 
22
23
  //# sourceMappingURL=message.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.js","names":["MessageRoot","Root","MessageRootProps","RootProps","MessageContent","Content","MessageContentProps","ContentProps","MessagePrimitiveParts","Parts","MessagePrimitivePartByIndex","PartByIndex","MessagePrimitiveGroupedParts","GroupedParts","MessageIf","If","MessageIfProps","IfProps","MessageAttachments","Attachments","MessageAttachmentsProps","AttachmentsProps","MessageAttachmentByIndex","AttachmentByIndex","MessageAttachmentByIndexProps","AttachmentByIndexProps"],"sources":["../../src/primitives/message.ts"],"sourcesContent":["export {\n MessageRoot as Root,\n type MessageRootProps as RootProps,\n} from \"./message/MessageRoot\";\nexport {\n MessageContent as Content,\n type MessageContentProps as ContentProps,\n} from \"./message/MessageContent\";\nexport {\n MessagePrimitiveParts as Parts,\n MessagePrimitivePartByIndex as PartByIndex,\n} from \"./message/MessageParts\";\nexport { MessagePrimitiveGroupedParts as GroupedParts } from \"@assistant-ui/core/react\";\nexport {\n MessageIf as If,\n type MessageIfProps as IfProps,\n} from \"./message/MessageIf\";\nexport {\n MessageAttachments as Attachments,\n type MessageAttachmentsProps as AttachmentsProps,\n MessageAttachmentByIndex as AttachmentByIndex,\n type MessageAttachmentByIndexProps as AttachmentByIndexProps,\n} from \"./message/MessageAttachments\";\n"],"mappings":""}
1
+ {"version":3,"file":"message.js","names":["MessageRoot","Root","MessageRootProps","RootProps","MessageContent","Content","MessageContentProps","ContentProps","MessagePrimitiveParts","Parts","MessagePrimitivePartByIndex","PartByIndex","MessagePrimitiveGroupedParts","GroupedParts","MessagePrimitiveQuote","Quote","MessageIf","If","MessageIfProps","IfProps","MessageAttachments","Attachments","MessageAttachmentsProps","AttachmentsProps","MessageAttachmentByIndex","AttachmentByIndex","MessageAttachmentByIndexProps","AttachmentByIndexProps"],"sources":["../../src/primitives/message.ts"],"sourcesContent":["export {\n MessageRoot as Root,\n type MessageRootProps as RootProps,\n} from \"./message/MessageRoot\";\nexport {\n MessageContent as Content,\n type MessageContentProps as ContentProps,\n} from \"./message/MessageContent\";\nexport {\n MessagePrimitiveParts as Parts,\n MessagePrimitivePartByIndex as PartByIndex,\n} from \"./message/MessageParts\";\nexport { MessagePrimitiveGroupedParts as GroupedParts } from \"@assistant-ui/core/react\";\nexport { MessagePrimitiveQuote as Quote } from \"@assistant-ui/core/react\";\nexport {\n MessageIf as If,\n type MessageIfProps as IfProps,\n} from \"./message/MessageIf\";\nexport {\n MessageAttachments as Attachments,\n type MessageAttachmentsProps as AttachmentsProps,\n MessageAttachmentByIndex as AttachmentByIndex,\n type MessageAttachmentByIndexProps as AttachmentByIndexProps,\n} from \"./message/MessageAttachments\";\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"MessagePartImage.js","names":["ComponentRef","ForwardRefExoticComponent","forwardRef","RefAttributes","Image","ImageProps","useAuiState","MessagePartPrimitiveImage","Element","Props","Omit","props","forwardedRef","$","_c","uri","_temp","undefined","t0","t1","displayName","MessagePartImageProps","s","part","type","image"],"sources":["../../../src/primitives/messagePart/MessagePartImage.tsx"],"sourcesContent":["import {\n type ComponentRef,\n type ForwardRefExoticComponent,\n forwardRef,\n type RefAttributes,\n} from \"react\";\nimport { Image, type ImageProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace MessagePartPrimitiveImage {\n export type Element = ComponentRef<typeof Image>;\n export type Props = Omit<ImageProps, \"source\">;\n}\n\nexport const MessagePartPrimitiveImage: ForwardRefExoticComponent<\n MessagePartPrimitiveImage.Props &\n RefAttributes<MessagePartPrimitiveImage.Element>\n> = forwardRef<\n MessagePartPrimitiveImage.Element,\n MessagePartPrimitiveImage.Props\n>((props, forwardedRef) => {\n const uri = useAuiState((s) => {\n const part = s.part;\n return part.type === \"image\" ? part.image : undefined;\n });\n\n if (uri === undefined) return null;\n return <Image source={{ uri }} {...props} ref={forwardedRef} />;\n});\n\nMessagePartPrimitiveImage.displayName = \"MessagePartPrimitive.Image\";\n\nexport type MessagePartImageProps = MessagePartPrimitiveImage.Props;\n"],"mappings":";;;;;;AAcA,MAAaO,4BAGTL,YAGFS,OAAAC,iBAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,MAAYT,YAAYU,KAGvB;CAED,IAAID,QAAQE,KAAAA,GAAS,OAAS;CAAK,IAAAC;CAAA,IAAAL,EAAA,OAAAE,KAAA;EACbG,KAAA,EAAAH,IAAM;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAD,gBAAAC,EAAA,OAAAF,SAAAE,EAAA,OAAAK,IAAA;EAAtBC,KAAA,oBAAC,OAAD;GAAe,QAAAD;GAAO,GAAMP;GAAYC,KAAAA;EAAY,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAF;EAAAE,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAAxDM;AAAwD,CAChE;AAEDZ,0BAA0Ba,cAAc;AAVtC,SAAAJ,MAAAM,GAAA;CAEE,MAAAC,OAAaD,EAACC;CAAM,OACbA,KAAIC,SAAU,UAAUD,KAAIE,QAA5BR,KAAAA;AAA8C"}
1
+ {"version":3,"file":"MessagePartImage.js","names":["ComponentRef","ForwardRefExoticComponent","forwardRef","RefAttributes","Image","ImageProps","useAuiState","MessagePartPrimitiveImage","Element","Props","Omit","props","forwardedRef","$","_c","uri","_temp","undefined","t0","t1","displayName","MessagePartImageProps","s","part","type","image","_c"],"sources":["../../../src/primitives/messagePart/MessagePartImage.tsx"],"sourcesContent":["import {\n type ComponentRef,\n type ForwardRefExoticComponent,\n forwardRef,\n type RefAttributes,\n} from \"react\";\nimport { Image, type ImageProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace MessagePartPrimitiveImage {\n export type Element = ComponentRef<typeof Image>;\n export type Props = Omit<ImageProps, \"source\">;\n}\n\nexport const MessagePartPrimitiveImage: ForwardRefExoticComponent<\n MessagePartPrimitiveImage.Props &\n RefAttributes<MessagePartPrimitiveImage.Element>\n> = forwardRef<\n MessagePartPrimitiveImage.Element,\n MessagePartPrimitiveImage.Props\n>((props, forwardedRef) => {\n const uri = useAuiState((s) => {\n const part = s.part;\n return part.type === \"image\" ? part.image : undefined;\n });\n\n if (uri === undefined) return null;\n return <Image source={{ uri }} {...props} ref={forwardedRef} />;\n});\n\nMessagePartPrimitiveImage.displayName = \"MessagePartPrimitive.Image\";\n\nexport type MessagePartImageProps = MessagePartPrimitiveImage.Props;\n"],"mappings":";;;;;;AAcA,MAAaO,4BAGTL,YAGFS,OAAAC,iBAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,MAAYT,YAAYU,KAGvB;CAED,IAAID,QAAQE,KAAAA,GAAS,OAAS;CAAK,IAAAC;CAAA,IAAAL,EAAA,OAAAE,KAAA;EACbG,KAAA,EAAAH,IAAM;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAD,gBAAAC,EAAA,OAAAF,SAAAE,EAAA,OAAAK,IAAA;EAAtBC,KAAA,oBAAC,OAAD;GAAe,QAAAD;GAAO,GAAMP;GAAYC,KAAAA;EAAY,CAAA;EAAIC,EAAA,KAAAD;EAAAC,EAAA,KAAAF;EAAAE,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAAxDM;AAAwD,CAChE;AAEDZ,0BAA0Ba,cAAc;AAVtC,SAAAJ,MAAAM,GAAA;CAEE,MAAAC,OAAaD,EAACC;CAAM,OACbA,KAAIC,SAAU,UAAUD,KAAIE,QAA5BR,KAAAA;AAA8C"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessagePartText.js","names":["ComponentRef","ForwardRefExoticComponent","forwardRef","RefAttributes","Text","TextProps","useAuiState","MessagePartPrimitiveText","Element","Props","Omit","props","forwardedRef","$","_c","text","_temp","t0","displayName","MessagePartTextProps","s","part","type"],"sources":["../../../src/primitives/messagePart/MessagePartText.tsx"],"sourcesContent":["import {\n type ComponentRef,\n type ForwardRefExoticComponent,\n forwardRef,\n type RefAttributes,\n} from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace MessagePartPrimitiveText {\n export type Element = ComponentRef<typeof Text>;\n export type Props = Omit<TextProps, \"children\">;\n}\n\nexport const MessagePartPrimitiveText: ForwardRefExoticComponent<\n MessagePartPrimitiveText.Props &\n RefAttributes<MessagePartPrimitiveText.Element>\n> = forwardRef<\n MessagePartPrimitiveText.Element,\n MessagePartPrimitiveText.Props\n>((props, forwardedRef) => {\n const text = useAuiState((s) => {\n const part = s.part;\n return part.type === \"text\" || part.type === \"reasoning\" ? part.text : \"\";\n });\n\n return (\n <Text {...props} ref={forwardedRef}>\n {text}\n </Text>\n );\n});\n\nMessagePartPrimitiveText.displayName = \"MessagePartPrimitive.Text\";\n\nexport type MessagePartTextProps = MessagePartPrimitiveText.Props;\n"],"mappings":";;;;;;AAcA,MAAaO,2BAGTL,YAGFS,OAAAC,iBAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,OAAaT,YAAYU,KAGxB;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,gBAAAC,EAAA,OAAAF,SAAAE,EAAA,OAAAE,MAAA;EAGDE,KAAA,oBAAC,MAAD;GAAK,GAAKN;GAAYC,KAAAA;GACnBG,UAAAA;EADE,CAAA;EAEEF,EAAA,KAAAD;EAAAC,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAFPI;AAEO,CAEV;AAEDV,yBAAyBW,cAAc;AAbrC,SAAAF,MAAAI,GAAA;CAEE,MAAAC,OAAaD,EAACC;CAAM,OACbA,KAAIC,SAAU,UAAUD,KAAIC,SAAU,cAAcD,KAAIN,OAAxD;AAAkE"}
1
+ {"version":3,"file":"MessagePartText.js","names":["ComponentRef","ForwardRefExoticComponent","forwardRef","RefAttributes","Text","TextProps","useAuiState","MessagePartPrimitiveText","Element","Props","Omit","props","forwardedRef","$","_c","text","_temp","t0","displayName","MessagePartTextProps","s","part","type","_c"],"sources":["../../../src/primitives/messagePart/MessagePartText.tsx"],"sourcesContent":["import {\n type ComponentRef,\n type ForwardRefExoticComponent,\n forwardRef,\n type RefAttributes,\n} from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace MessagePartPrimitiveText {\n export type Element = ComponentRef<typeof Text>;\n export type Props = Omit<TextProps, \"children\">;\n}\n\nexport const MessagePartPrimitiveText: ForwardRefExoticComponent<\n MessagePartPrimitiveText.Props &\n RefAttributes<MessagePartPrimitiveText.Element>\n> = forwardRef<\n MessagePartPrimitiveText.Element,\n MessagePartPrimitiveText.Props\n>((props, forwardedRef) => {\n const text = useAuiState((s) => {\n const part = s.part;\n return part.type === \"text\" || part.type === \"reasoning\" ? part.text : \"\";\n });\n\n return (\n <Text {...props} ref={forwardedRef}>\n {text}\n </Text>\n );\n});\n\nMessagePartPrimitiveText.displayName = \"MessagePartPrimitive.Text\";\n\nexport type MessagePartTextProps = MessagePartPrimitiveText.Props;\n"],"mappings":";;;;;;AAcA,MAAaO,2BAGTL,YAGFS,OAAAC,iBAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACA,MAAAC,OAAaT,YAAYU,KAGxB;CAAE,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,gBAAAC,EAAA,OAAAF,SAAAE,EAAA,OAAAE,MAAA;EAGDE,KAAA,oBAAC,MAAD;GAAK,GAAKN;GAAYC,KAAAA;GACnBG,UAAAA;EADE,CAAA;EAEEF,EAAA,KAAAD;EAAAC,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAFPI;AAEO,CAEV;AAEDV,yBAAyBW,cAAc;AAbrC,SAAAF,MAAAI,GAAA;CAEE,MAAAC,OAAaD,EAACC;CAAM,OACbA,KAAIC,SAAU,UAAUD,KAAIC,SAAU,cAAcD,KAAIN,OAAxD;AAAkE"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueueItemRemove.js","names":["useCallback","Pressable","PressableProps","useAui","QueueItemRemoveProps","Omit","children","QueueItemRemove","t0","$","_c","pressableProps","aui","t1","queueItem","remove","handleRemove","t2"],"sources":["../../../src/primitives/queueItem/QueueItemRemove.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { Pressable, type PressableProps } from \"react-native\";\nimport { useAui } from \"@assistant-ui/store\";\n\nexport type QueueItemRemoveProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: PressableProps[\"children\"];\n};\n\nexport const QueueItemRemove = ({\n children,\n ...pressableProps\n}: QueueItemRemoveProps) => {\n const aui = useAui();\n\n const handleRemove = useCallback(() => {\n aui.queueItem.remove();\n }, [aui]);\n\n return (\n <Pressable\n onPress={handleRemove}\n accessibilityRole=\"button\"\n {...pressableProps}\n >\n {children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;;AAWA,MAAaO,mBAAkBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,kBAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,iBAAAF,EAAA;CAAA;CACrB,MAAAG,MAAYT,OAAO;CAAE,IAAAU;CAAA,IAAAJ,EAAA,OAAAG,IAAAE,WAAA;EAEYD,WAAA;GAC/BD,IAAGE,UAAUC,OAAQ;EAAC;EACvBN,EAAA,KAAAG,IAAAE;EAAAL,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAFD,MAAAO,eAAqBH;CAEX,IAAAI;CAAA,IAAAR,EAAA,OAAAH,YAAAG,EAAA,OAAAO,gBAAAP,EAAA,OAAAE,gBAAA;EAGRM,KAAA,oBAAC,WAAD;GACWD,SAAAA;GACS,mBAAA;GAAQ,GACtBL;GAEHL;EALO,CAAA;EAMEG,EAAA,KAAAH;EAAAG,EAAA,KAAAO;EAAAP,EAAA,KAAAE;EAAAF,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OANZQ;AAMY"}
1
+ {"version":3,"file":"QueueItemRemove.js","names":["useCallback","Pressable","PressableProps","useAui","QueueItemRemoveProps","Omit","children","QueueItemRemove","t0","$","_c","pressableProps","aui","t1","queueItem","remove","handleRemove","t2","_c"],"sources":["../../../src/primitives/queueItem/QueueItemRemove.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { Pressable, type PressableProps } from \"react-native\";\nimport { useAui } from \"@assistant-ui/store\";\n\nexport type QueueItemRemoveProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: PressableProps[\"children\"];\n};\n\nexport const QueueItemRemove = ({\n children,\n ...pressableProps\n}: QueueItemRemoveProps) => {\n const aui = useAui();\n\n const handleRemove = useCallback(() => {\n aui.queueItem.remove();\n }, [aui]);\n\n return (\n <Pressable\n onPress={handleRemove}\n accessibilityRole=\"button\"\n {...pressableProps}\n >\n {children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;;AAWA,MAAaO,mBAAkBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,kBAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,iBAAAF,EAAA;CAAA;CACrB,MAAAG,MAAYT,OAAO;CAAE,IAAAU;CAAA,IAAAJ,EAAA,OAAAG,IAAAE,WAAA;EAEYD,WAAA;GAC/BD,IAAGE,UAAUC,OAAQ;EAAC;EACvBN,EAAA,KAAAG,IAAAE;EAAAL,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAFD,MAAAO,eAAqBH;CAEX,IAAAI;CAAA,IAAAR,EAAA,OAAAH,YAAAG,EAAA,OAAAO,gBAAAP,EAAA,OAAAE,gBAAA;EAGRM,KAAA,oBAAC,WAAD;GACWD,SAAAA;GACS,mBAAA;GAAQ,GACtBL;GAEHL;EALO,CAAA;EAMEG,EAAA,KAAAH;EAAAG,EAAA,KAAAO;EAAAP,EAAA,KAAAE;EAAAF,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OANZQ;AAMY"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueueItemSteer.js","names":["useCallback","Pressable","PressableProps","useAui","QueueItemSteerProps","Omit","children","QueueItemSteer","t0","$","_c","pressableProps","aui","t1","queueItem","steer","handleSteer","t2"],"sources":["../../../src/primitives/queueItem/QueueItemSteer.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { Pressable, type PressableProps } from \"react-native\";\nimport { useAui } from \"@assistant-ui/store\";\n\nexport type QueueItemSteerProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: PressableProps[\"children\"];\n};\n\nexport const QueueItemSteer = ({\n children,\n ...pressableProps\n}: QueueItemSteerProps) => {\n const aui = useAui();\n\n const handleSteer = useCallback(() => {\n aui.queueItem.steer();\n }, [aui]);\n\n return (\n <Pressable\n onPress={handleSteer}\n accessibilityRole=\"button\"\n {...pressableProps}\n >\n {children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;;AAWA,MAAaO,kBAAiBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,kBAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,iBAAAF,EAAA;CAAA;CACpB,MAAAG,MAAYT,OAAO;CAAE,IAAAU;CAAA,IAAAJ,EAAA,OAAAG,IAAAE,WAAA;EAEWD,WAAA;GAC9BD,IAAGE,UAAUC,MAAO;EAAC;EACtBN,EAAA,KAAAG,IAAAE;EAAAL,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAFD,MAAAO,cAAoBH;CAEV,IAAAI;CAAA,IAAAR,EAAA,OAAAH,YAAAG,EAAA,OAAAO,eAAAP,EAAA,OAAAE,gBAAA;EAGRM,KAAA,oBAAC,WAAD;GACWD,SAAAA;GACS,mBAAA;GAAQ,GACtBL;GAEHL;EALO,CAAA;EAMEG,EAAA,KAAAH;EAAAG,EAAA,KAAAO;EAAAP,EAAA,KAAAE;EAAAF,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OANZQ;AAMY"}
1
+ {"version":3,"file":"QueueItemSteer.js","names":["useCallback","Pressable","PressableProps","useAui","QueueItemSteerProps","Omit","children","QueueItemSteer","t0","$","_c","pressableProps","aui","t1","queueItem","steer","handleSteer","t2","_c"],"sources":["../../../src/primitives/queueItem/QueueItemSteer.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { Pressable, type PressableProps } from \"react-native\";\nimport { useAui } from \"@assistant-ui/store\";\n\nexport type QueueItemSteerProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: PressableProps[\"children\"];\n};\n\nexport const QueueItemSteer = ({\n children,\n ...pressableProps\n}: QueueItemSteerProps) => {\n const aui = useAui();\n\n const handleSteer = useCallback(() => {\n aui.queueItem.steer();\n }, [aui]);\n\n return (\n <Pressable\n onPress={handleSteer}\n accessibilityRole=\"button\"\n {...pressableProps}\n >\n {children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;;AAWA,MAAaO,kBAAiBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,kBAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,iBAAAF,EAAA;CAAA;CACpB,MAAAG,MAAYT,OAAO;CAAE,IAAAU;CAAA,IAAAJ,EAAA,OAAAG,IAAAE,WAAA;EAEWD,WAAA;GAC9BD,IAAGE,UAAUC,MAAO;EAAC;EACtBN,EAAA,KAAAG,IAAAE;EAAAL,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAFD,MAAAO,cAAoBH;CAEV,IAAAI;CAAA,IAAAR,EAAA,OAAAH,YAAAG,EAAA,OAAAO,eAAAP,EAAA,OAAAE,gBAAA;EAGRM,KAAA,oBAAC,WAAD;GACWD,SAAAA;GACS,mBAAA;GAAQ,GACtBL;GAEHL;EALO,CAAA;EAMEG,EAAA,KAAAH;EAAAG,EAAA,KAAAO;EAAAP,EAAA,KAAAE;EAAAF,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OANZQ;AAMY"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueueItemText.js","names":["ReactNode","Text","TextProps","useAuiState","QueueItemTextProps","children","QueueItemText","t0","$","_c","textProps","text","_temp3","t1","t2","_temp","part","type","_temp2","part_0","s","queueItem","parts","filter","map","join"],"sources":["../../../src/primitives/queueItem/QueueItemText.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type QueueItemTextProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const QueueItemText = ({\n children,\n ...textProps\n}: QueueItemTextProps) => {\n const text = useAuiState((s) =>\n // hosts on the pre-parts adapter shape may omit the field at runtime\n (s.queueItem.parts ?? [])\n .filter((part) => part.type === \"text\")\n .map((part) => part.text)\n .join(\"\\n\\n\"),\n );\n\n return <Text {...textProps}>{children ?? text}</Text>;\n};\n"],"mappings":";;;;;AAQA,MAAaM,iBAAgBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,aAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CACnB,MAAAG,OAAaR,YAAYS,MAMzB;CAE6B,MAAAC,KAAAR,YAAAM;CAAgB,IAAAG;CAAA,IAAAN,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAAtCI,KAAA,oBAAC,MAAD;GAAK,GAAKJ;GAAYG,UAAAA;EAAjB,CAAA;EAAyCL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAA9CM;AAA8C;AAZ1B,SAAAC,MAAAC,MAAA;CAAA,OAOLA,KAAIC,SAAU;AAAM;AAPf,SAAAC,OAAAC,QAAA;CAAA,OAQRH,OAAIL;AAAK;AARD,SAAAC,OAAAQ,GAAA;CAAA,QAMxBA,EAACC,UAAUC,SAAX,CAAA,EAAA,CAAuBC,OACdR,KAA8B,CAAC,CAAAS,IAClCN,MAAmB,CAAC,CAAAO,KACnB,MAAM;AAAC"}
1
+ {"version":3,"file":"QueueItemText.js","names":["ReactNode","Text","TextProps","useAuiState","QueueItemTextProps","children","QueueItemText","t0","$","_c","textProps","text","_temp3","t1","t2","_temp","part","type","_temp2","part_0","s","queueItem","parts","filter","map","join","_c"],"sources":["../../../src/primitives/queueItem/QueueItemText.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type QueueItemTextProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const QueueItemText = ({\n children,\n ...textProps\n}: QueueItemTextProps) => {\n const text = useAuiState((s) =>\n // hosts on the pre-parts adapter shape may omit the field at runtime\n (s.queueItem.parts ?? [])\n .filter((part) => part.type === \"text\")\n .map((part) => part.text)\n .join(\"\\n\\n\"),\n );\n\n return <Text {...textProps}>{children ?? text}</Text>;\n};\n"],"mappings":";;;;;AAQA,MAAaM,iBAAgBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,aAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CACnB,MAAAG,OAAaR,YAAYS,MAMzB;CAE6B,MAAAC,KAAAR,YAAAM;CAAgB,IAAAG;CAAA,IAAAN,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAAtCI,KAAA,oBAAC,MAAD;GAAK,GAAKJ;GAAYG,UAAAA;EAAjB,CAAA;EAAyCL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAA9CM;AAA8C;AAZ1B,SAAAC,MAAAC,MAAA;CAAA,OAOLA,KAAIC,SAAU;AAAM;AAPf,SAAAC,OAAAC,QAAA;CAAA,OAQRH,OAAIL;AAAK;AARD,SAAAC,OAAAQ,GAAA;CAAA,QAMxBA,EAACC,UAAUC,SAAX,CAAA,EAAA,CAAuBC,OACdR,KAA8B,CAAC,CAAAS,IAClCN,MAAmB,CAAC,CAAAO,KACnB,MAAM;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SuggestionDescription.js","names":["ReactNode","Text","TextProps","useAuiState","SuggestionDescriptionProps","children","SuggestionDescription","t0","$","_c","textProps","label","_temp","t1","t2","s","suggestion"],"sources":["../../../src/primitives/suggestion/SuggestionDescription.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type SuggestionDescriptionProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const SuggestionDescription = ({\n children,\n ...textProps\n}: SuggestionDescriptionProps) => {\n const label = useAuiState((s) => s.suggestion.label);\n\n return <Text {...textProps}>{children ?? label}</Text>;\n};\n"],"mappings":";;;;;AAQA,MAAaM,yBAAwBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,aAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CAC3B,MAAAG,QAAcR,YAAYS,KAAyB;CAEtB,MAAAC,KAAAR,YAAAM;CAAiB,IAAAG;CAAA,IAAAN,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAAvCI,KAAA,oBAAC,MAAD;GAAK,GAAKJ;GAAYG,UAAAA;EAAjB,CAAA;EAA0CL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAA/CM;AAA+C;AANnB,SAAAF,MAAAG,GAAA;CAAA,OAIFA,EAACC,WAAWL;AAAM"}
1
+ {"version":3,"file":"SuggestionDescription.js","names":["ReactNode","Text","TextProps","useAuiState","SuggestionDescriptionProps","children","SuggestionDescription","t0","$","_c","textProps","label","_temp","t1","t2","s","suggestion","_c"],"sources":["../../../src/primitives/suggestion/SuggestionDescription.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type SuggestionDescriptionProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const SuggestionDescription = ({\n children,\n ...textProps\n}: SuggestionDescriptionProps) => {\n const label = useAuiState((s) => s.suggestion.label);\n\n return <Text {...textProps}>{children ?? label}</Text>;\n};\n"],"mappings":";;;;;AAQA,MAAaM,yBAAwBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,aAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CAC3B,MAAAG,QAAcR,YAAYS,KAAyB;CAEtB,MAAAC,KAAAR,YAAAM;CAAiB,IAAAG;CAAA,IAAAN,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAAvCI,KAAA,oBAAC,MAAD;GAAK,GAAKJ;GAAYG,UAAAA;EAAjB,CAAA;EAA0CL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAA/CM;AAA+C;AANnB,SAAAF,MAAAG,GAAA;CAAA,OAIFA,EAACC,WAAWL;AAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"SuggestionTitle.js","names":["ReactNode","Text","TextProps","useAuiState","SuggestionTitleProps","children","SuggestionTitle","t0","$","_c","textProps","title","_temp","t1","t2","s","suggestion"],"sources":["../../../src/primitives/suggestion/SuggestionTitle.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type SuggestionTitleProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const SuggestionTitle = ({\n children,\n ...textProps\n}: SuggestionTitleProps) => {\n const title = useAuiState((s) => s.suggestion.title);\n\n return <Text {...textProps}>{children ?? title}</Text>;\n};\n"],"mappings":";;;;;AAQA,MAAaM,mBAAkBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,aAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CACrB,MAAAG,QAAcR,YAAYS,KAAyB;CAEtB,MAAAC,KAAAR,YAAAM;CAAiB,IAAAG;CAAA,IAAAN,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAAvCI,KAAA,oBAAC,MAAD;GAAK,GAAKJ;GAAYG,UAAAA;EAAjB,CAAA;EAA0CL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAA/CM;AAA+C;AANzB,SAAAF,MAAAG,GAAA;CAAA,OAIIA,EAACC,WAAWL;AAAM"}
1
+ {"version":3,"file":"SuggestionTitle.js","names":["ReactNode","Text","TextProps","useAuiState","SuggestionTitleProps","children","SuggestionTitle","t0","$","_c","textProps","title","_temp","t1","t2","s","suggestion","_c"],"sources":["../../../src/primitives/suggestion/SuggestionTitle.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type SuggestionTitleProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const SuggestionTitle = ({\n children,\n ...textProps\n}: SuggestionTitleProps) => {\n const title = useAuiState((s) => s.suggestion.title);\n\n return <Text {...textProps}>{children ?? title}</Text>;\n};\n"],"mappings":";;;;;AAQA,MAAaM,mBAAkBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,UAAA,GAAAK,aAAAH;EAGTC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CACrB,MAAAG,QAAcR,YAAYS,KAAyB;CAEtB,MAAAC,KAAAR,YAAAM;CAAiB,IAAAG;CAAA,IAAAN,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAAvCI,KAAA,oBAAC,MAAD;GAAK,GAAKJ;GAAYG,UAAAA;EAAjB,CAAA;EAA0CL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAA/CM;AAA+C;AANzB,SAAAF,MAAAG,GAAA;CAAA,OAIIA,EAACC,WAAWL;AAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"SuggestionTrigger.js","names":["Pressable","PressableProps","useAuiState","useSuggestionTrigger","SuggestionTriggerProps","Omit","children","send","clearComposer","SuggestionTrigger","t0","$","_c","disabledProp","pressableProps","t1","disabled","undefined","prompt","_temp","t2","trigger","t3","t4","s","suggestion"],"sources":["../../../src/primitives/suggestion/SuggestionTrigger.tsx"],"sourcesContent":["import { Pressable, type PressableProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { useSuggestionTrigger } from \"@assistant-ui/core/react\";\n\nexport type SuggestionTriggerProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: PressableProps[\"children\"];\n /**\n * When true, automatically sends the message.\n * When false, replaces or appends the composer text with the suggestion.\n */\n send?: boolean | undefined;\n /**\n * Whether to clear the composer. When send is false, determines if composer\n * text is replaced (true) or appended (false).\n * @default true\n */\n clearComposer?: boolean | undefined;\n};\n\nexport const SuggestionTrigger = ({\n children,\n send,\n clearComposer = true,\n disabled: disabledProp,\n ...pressableProps\n}: SuggestionTriggerProps) => {\n const prompt = useAuiState((s) => s.suggestion.prompt);\n const { trigger, disabled } = useSuggestionTrigger({\n prompt,\n send,\n clearComposer,\n });\n\n return (\n <Pressable\n onPress={trigger}\n disabled={disabledProp ?? disabled}\n accessibilityRole=\"button\"\n {...pressableProps}\n >\n {children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;;AAsBA,MAAaS,qBAAoBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAQ;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAJ,UAAAC,MAAAC,eAAAO,IAAAC,UAAAH,cAAA,GAAAC,kBAAAJ;EAMTC,EAAA,KAAAD;EAAAC,EAAA,KAAAL;EAAAK,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAJ;EAAAI,EAAA,KAAAI;CAAA,OAAA;EAAAT,WAAAK,EAAA;EAAAE,eAAAF,EAAA;EAAAG,iBAAAH,EAAA;EAAAJ,OAAAI,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAHvB,MAAAH,gBAAAO,OAAAE,KAAAA,IAAA,OAAAF;CAIA,MAAAG,SAAehB,YAAYiB,KAA0B;CAAE,IAAAC;CAAA,IAAAT,EAAA,OAAAH,iBAAAG,EAAA,OAAAO,UAAAP,EAAA,OAAAJ,MAAA;EACJa,KAAA;GAAAF;GAAAX;GAAAC;EAInD;EAACG,EAAA,KAAAH;EAAAG,EAAA,KAAAO;EAAAP,EAAA,KAAAJ;EAAAI,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAJD,MAAA,EAAAU,SAAAL,aAA8Bb,qBAAqBiB,EAIlD;CAKa,MAAAE,KAAAT,gBAAAG;CAAwB,IAAAO;CAAA,IAAAZ,EAAA,QAAAL,YAAAK,EAAA,QAAAG,kBAAAH,EAAA,QAAAW,MAAAX,EAAA,QAAAU,SAAA;EAFpCE,KAAA,oBAAC,WAAD;GACWF,SAAAA;GACC,UAAAC;GACQ,mBAAA;GAAQ,GACtBR;GAEHR;EANO,CAAA;EAOEK,EAAA,MAAAL;EAAAK,EAAA,MAAAG;EAAAH,EAAA,MAAAW;EAAAX,EAAA,MAAAU;EAAAV,EAAA,MAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAPZY;AAOY;AAtBiB,SAAAJ,MAAAK,GAAA;CAAA,OAOGA,EAACC,WAAWP;AAAO"}
1
+ {"version":3,"file":"SuggestionTrigger.js","names":["Pressable","PressableProps","useAuiState","useSuggestionTrigger","SuggestionTriggerProps","Omit","children","send","clearComposer","SuggestionTrigger","t0","$","_c","disabledProp","pressableProps","t1","disabled","undefined","prompt","_temp","t2","trigger","t3","t4","s","suggestion","_c"],"sources":["../../../src/primitives/suggestion/SuggestionTrigger.tsx"],"sourcesContent":["import { Pressable, type PressableProps } from \"react-native\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { useSuggestionTrigger } from \"@assistant-ui/core/react\";\n\nexport type SuggestionTriggerProps = Omit<\n PressableProps,\n \"onPress\" | \"children\"\n> & {\n children: PressableProps[\"children\"];\n /**\n * When true, automatically sends the message.\n * When false, replaces or appends the composer text with the suggestion.\n */\n send?: boolean | undefined;\n /**\n * Whether to clear the composer. When send is false, determines if composer\n * text is replaced (true) or appended (false).\n * @default true\n */\n clearComposer?: boolean | undefined;\n};\n\nexport const SuggestionTrigger = ({\n children,\n send,\n clearComposer = true,\n disabled: disabledProp,\n ...pressableProps\n}: SuggestionTriggerProps) => {\n const prompt = useAuiState((s) => s.suggestion.prompt);\n const { trigger, disabled } = useSuggestionTrigger({\n prompt,\n send,\n clearComposer,\n });\n\n return (\n <Pressable\n onPress={trigger}\n disabled={disabledProp ?? disabled}\n accessibilityRole=\"button\"\n {...pressableProps}\n >\n {children}\n </Pressable>\n );\n};\n"],"mappings":";;;;;;AAsBA,MAAaS,qBAAoBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAQ;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAJ,UAAAC,MAAAC,eAAAO,IAAAC,UAAAH,cAAA,GAAAC,kBAAAJ;EAMTC,EAAA,KAAAD;EAAAC,EAAA,KAAAL;EAAAK,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAJ;EAAAI,EAAA,KAAAI;CAAA,OAAA;EAAAT,WAAAK,EAAA;EAAAE,eAAAF,EAAA;EAAAG,iBAAAH,EAAA;EAAAJ,OAAAI,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAHvB,MAAAH,gBAAAO,OAAAE,KAAAA,IAAA,OAAAF;CAIA,MAAAG,SAAehB,YAAYiB,KAA0B;CAAE,IAAAC;CAAA,IAAAT,EAAA,OAAAH,iBAAAG,EAAA,OAAAO,UAAAP,EAAA,OAAAJ,MAAA;EACJa,KAAA;GAAAF;GAAAX;GAAAC;EAInD;EAACG,EAAA,KAAAH;EAAAG,EAAA,KAAAO;EAAAP,EAAA,KAAAJ;EAAAI,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAJD,MAAA,EAAAU,SAAAL,aAA8Bb,qBAAqBiB,EAIlD;CAKa,MAAAE,KAAAT,gBAAAG;CAAwB,IAAAO;CAAA,IAAAZ,EAAA,QAAAL,YAAAK,EAAA,QAAAG,kBAAAH,EAAA,QAAAW,MAAAX,EAAA,QAAAU,SAAA;EAFpCE,KAAA,oBAAC,WAAD;GACWF,SAAAA;GACC,UAAAC;GACQ,mBAAA;GAAQ,GACtBR;GAEHR;EANO,CAAA;EAOEK,EAAA,MAAAL;EAAAK,EAAA,MAAAG;EAAAH,EAAA,MAAAW;EAAAX,EAAA,MAAAU;EAAAV,EAAA,MAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAPZY;AAOY;AAtBiB,SAAAJ,MAAAK,GAAA;CAAA,OAOGA,EAACC,WAAWP;AAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadEmpty.js","names":["ReactNode","AuiIf","ThreadEmptyProps","children","ThreadEmpty","t0","$","_c","t1","_temp","s","thread","isEmpty"],"sources":["../../../src/primitives/thread/ThreadEmpty.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { AuiIf } from \"@assistant-ui/store\";\n\nexport type ThreadEmptyProps = {\n children: ReactNode;\n};\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.thread.isEmpty} />` instead.\n */\nexport const ThreadEmpty = ({ children }: ThreadEmptyProps) => (\n <AuiIf condition={(s) => s.thread.isEmpty}>{children}</AuiIf>\n);\n"],"mappings":";;;;;;;AAUA,MAAaI,eAAcC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAJ,aAAAE;CAA8B,IAAAG;CAAA,IAAAF,EAAA,OAAAH,UAAA;EACxDK,KAAA,oBAAC,OAAD;GAAkB,WAAAC;GAA0BN;EAAtC,CAAA;EAAuDG,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAA7DE;AAA6D;AADpC,SAAAC,MAAAC,GAAA;CAAA,OACAA,EAACC,OAAOC;AAAQ"}
1
+ {"version":3,"file":"ThreadEmpty.js","names":["ReactNode","AuiIf","ThreadEmptyProps","children","ThreadEmpty","t0","$","_c","t1","_temp","s","thread","isEmpty","_c"],"sources":["../../../src/primitives/thread/ThreadEmpty.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { AuiIf } from \"@assistant-ui/store\";\n\nexport type ThreadEmptyProps = {\n children: ReactNode;\n};\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.thread.isEmpty} />` instead.\n */\nexport const ThreadEmpty = ({ children }: ThreadEmptyProps) => (\n <AuiIf condition={(s) => s.thread.isEmpty}>{children}</AuiIf>\n);\n"],"mappings":";;;;;;;AAUA,MAAaI,eAAcC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAJ,aAAAE;CAA8B,IAAAG;CAAA,IAAAF,EAAA,OAAAH,UAAA;EACxDK,KAAA,oBAAC,OAAD;GAAkB,WAAAC;GAA0BN;EAAtC,CAAA;EAAuDG,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAA7DE;AAA6D;AADpC,SAAAC,MAAAC,GAAA;CAAA,OACAA,EAACC,OAAOC;AAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadIf.js","names":["ReactNode","useAuiState","ThreadIfProps","children","empty","running","ThreadIf","t0","$","_c","thread","_temp","undefined","isEmpty","isRunning","t1","s"],"sources":["../../../src/primitives/thread/ThreadIf.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type ThreadIfProps = {\n children: ReactNode;\n empty?: boolean | undefined;\n running?: boolean | undefined;\n};\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.thread...} />` instead.\n */\nexport const ThreadIf = ({ children, empty, running }: ThreadIfProps) => {\n const thread = useAuiState((s) => s.thread);\n\n if (empty !== undefined && empty !== thread.isEmpty) return null;\n if (running !== undefined && running !== thread.isRunning) return null;\n\n return <>{children}</>;\n};\n"],"mappings":";;;;;;;AAYA,MAAaM,YAAWC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAN,UAAAC,OAAAC,YAAAE;CACvB,MAAAG,SAAeT,YAAYU,KAAe;CAE1C,IAAIP,UAAUQ,KAAAA,KAAaR,UAAUM,OAAMG,SAAQ,OAAS;CAC5D,IAAIR,YAAYO,KAAAA,KAAaP,YAAYK,OAAMI,WAAU,OAAS;CAAK,IAAAC;CAAA,IAAAP,EAAA,OAAAL,UAAA;EAEhEY,KAAA,oBAAA,UAAA,EAAGZ,SAAQ,CAAA;EAAIK,EAAA,KAAAL;EAAAK,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAAfO;AAAe;AANA,SAAAJ,MAAAK,GAAA;CAAA,OACYA,EAACN;AAAO"}
1
+ {"version":3,"file":"ThreadIf.js","names":["ReactNode","useAuiState","ThreadIfProps","children","empty","running","ThreadIf","t0","$","_c","thread","_temp","undefined","isEmpty","isRunning","t1","s","_c"],"sources":["../../../src/primitives/thread/ThreadIf.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport type ThreadIfProps = {\n children: ReactNode;\n empty?: boolean | undefined;\n running?: boolean | undefined;\n};\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.thread...} />` instead.\n */\nexport const ThreadIf = ({ children, empty, running }: ThreadIfProps) => {\n const thread = useAuiState((s) => s.thread);\n\n if (empty !== undefined && empty !== thread.isEmpty) return null;\n if (running !== undefined && running !== thread.isRunning) return null;\n\n return <>{children}</>;\n};\n"],"mappings":";;;;;;;AAYA,MAAaM,YAAWC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAN,UAAAC,OAAAC,YAAAE;CACvB,MAAAG,SAAeT,YAAYU,KAAe;CAE1C,IAAIP,UAAUQ,KAAAA,KAAaR,UAAUM,OAAMG,SAAQ,OAAS;CAC5D,IAAIR,YAAYO,KAAAA,KAAaP,YAAYK,OAAMI,WAAU,OAAS;CAAK,IAAAC;CAAA,IAAAP,EAAA,OAAAL,UAAA;EAEhEY,KAAA,oBAAA,UAAA,EAAGZ,SAAQ,CAAA;EAAIK,EAAA,KAAAL;EAAAK,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAAfO;AAAe;AANA,SAAAJ,MAAAK,GAAA;CAAA,OACYA,EAACN;AAAO"}
@@ -2,6 +2,7 @@ import { type ComponentType, type ReactNode } from "react";
2
2
  import { FlatList, type FlatListProps } from "react-native";
3
3
  import type { ThreadMessage } from "@assistant-ui/core";
4
4
  import type { MessageState } from "@assistant-ui/core/store";
5
+ import { type FlatListHistory } from "./flatListScroll.js";
5
6
  type MessageComponents = {
6
7
  Message: ComponentType;
7
8
  EditComposer?: ComponentType | undefined;
@@ -36,11 +37,12 @@ export type ThreadMessagesFlatListProps = Omit<FlatListProps<ThreadMessage>, "da
36
37
  scrollToBottomOnRunStart?: boolean | undefined;
37
38
  scrollToBottomOnInitialize?: boolean | undefined;
38
39
  scrollToBottomOnThreadSwitch?: boolean | undefined;
39
- history?: {
40
- hasMore: boolean;
41
- isLoadingMore: boolean;
42
- loadMore: () => void;
43
- } | undefined;
40
+ /**
41
+ * Pages older messages in when the list nears its start. Defaults to the
42
+ * runtime's `thread.hasEarlier` / `isLoadingEarlier` / `loadEarlier()`;
43
+ * pass it to drive paging from app state instead.
44
+ */
45
+ history?: FlatListHistory | undefined;
44
46
  };
45
47
  /** @deprecated Use ThreadMessagesFlatListProps instead. */
46
48
  export type ThreadMessagesProps = ThreadMessagesFlatListProps;
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadMessages.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/ThreadMessages.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AACf,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAInB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQ7D,KAAK,iBAAiB,GAClB;IACE,OAAO,EAAE,aAAa,CAAC;IACvB,YAAY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