@assistant-ui/react-native 0.1.29 → 0.1.31

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 (133) hide show
  1. package/dist/index.d.ts +2 -2
  2. package/dist/primitives/actionBar/ActionBarCopy.d.ts +1 -8
  3. package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
  4. package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
  5. package/dist/primitives/actionBar/ActionBarEdit.d.ts +1 -6
  6. package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
  7. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +1 -5
  8. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
  9. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
  10. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +1 -5
  11. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
  12. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
  13. package/dist/primitives/actionBar/ActionBarReload.d.ts +1 -6
  14. package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
  15. package/dist/primitives/actionBar.d.ts +0 -2
  16. package/dist/primitives/attachment/AttachmentName.d.ts +0 -1
  17. package/dist/primitives/attachment/AttachmentName.d.ts.map +1 -1
  18. package/dist/primitives/attachment/AttachmentName.js.map +1 -1
  19. package/dist/primitives/attachment/AttachmentRemove.d.ts +1 -5
  20. package/dist/primitives/attachment/AttachmentRemove.d.ts.map +1 -1
  21. package/dist/primitives/attachment/AttachmentRoot.d.ts +1 -5
  22. package/dist/primitives/attachment/AttachmentRoot.d.ts.map +1 -1
  23. package/dist/primitives/attachment/AttachmentThumb.d.ts +0 -1
  24. package/dist/primitives/attachment/AttachmentThumb.d.ts.map +1 -1
  25. package/dist/primitives/attachment/AttachmentThumb.js.map +1 -1
  26. package/dist/primitives/attachment.d.ts +0 -2
  27. package/dist/primitives/branchPicker/BranchPickerCount.d.ts +0 -1
  28. package/dist/primitives/branchPicker/BranchPickerCount.d.ts.map +1 -1
  29. package/dist/primitives/branchPicker/BranchPickerCount.js.map +1 -1
  30. package/dist/primitives/branchPicker/BranchPickerNext.d.ts +1 -6
  31. package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
  32. package/dist/primitives/branchPicker/BranchPickerNumber.d.ts +0 -1
  33. package/dist/primitives/branchPicker/BranchPickerNumber.d.ts.map +1 -1
  34. package/dist/primitives/branchPicker/BranchPickerNumber.js.map +1 -1
  35. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts +1 -6
  36. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
  37. package/dist/primitives/branchPicker.d.ts +0 -2
  38. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts +1 -5
  39. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts.map +1 -1
  40. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts +1 -5
  41. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts.map +1 -1
  42. package/dist/primitives/chainOfThought.d.ts +0 -2
  43. package/dist/primitives/composer/ComposerAddAttachment.d.ts +1 -6
  44. package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
  45. package/dist/primitives/composer/ComposerAttachments.d.ts +3 -16
  46. package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -1
  47. package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
  48. package/dist/primitives/composer/ComposerCancel.d.ts +1 -6
  49. package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
  50. package/dist/primitives/composer/ComposerInput.d.ts +1 -8
  51. package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
  52. package/dist/primitives/composer/ComposerInput.js +15 -2
  53. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  54. package/dist/primitives/composer/ComposerRoot.d.ts +1 -5
  55. package/dist/primitives/composer/ComposerRoot.d.ts.map +1 -1
  56. package/dist/primitives/composer/ComposerSend.d.ts +1 -6
  57. package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
  58. package/dist/primitives/composer.d.ts +3 -5
  59. package/dist/primitives/composer.js.map +1 -1
  60. package/dist/primitives/error/ErrorMessage.d.ts +1 -5
  61. package/dist/primitives/error/ErrorMessage.d.ts.map +1 -1
  62. package/dist/primitives/error/ErrorMessage.js.map +1 -1
  63. package/dist/primitives/error/ErrorRoot.d.ts +1 -5
  64. package/dist/primitives/error/ErrorRoot.d.ts.map +1 -1
  65. package/dist/primitives/error/index.d.ts +0 -2
  66. package/dist/primitives/message/MessageAttachments.d.ts +2 -9
  67. package/dist/primitives/message/MessageAttachments.d.ts.map +1 -1
  68. package/dist/primitives/message/MessageAttachments.js.map +1 -1
  69. package/dist/primitives/message/MessageContent.d.ts +1 -10
  70. package/dist/primitives/message/MessageContent.d.ts.map +1 -1
  71. package/dist/primitives/message/MessageIf.d.ts +1 -8
  72. package/dist/primitives/message/MessageIf.d.ts.map +1 -1
  73. package/dist/primitives/message/MessageIf.js.map +1 -1
  74. package/dist/primitives/message/MessageParts.d.ts +0 -1
  75. package/dist/primitives/message/MessageParts.d.ts.map +1 -1
  76. package/dist/primitives/message/MessageRoot.d.ts +1 -5
  77. package/dist/primitives/message/MessageRoot.d.ts.map +1 -1
  78. package/dist/primitives/message.d.ts +3 -5
  79. package/dist/primitives/message.js.map +1 -1
  80. package/dist/primitives/suggestion/SuggestionDescription.d.ts +1 -5
  81. package/dist/primitives/suggestion/SuggestionDescription.d.ts.map +1 -1
  82. package/dist/primitives/suggestion/SuggestionDescription.js.map +1 -1
  83. package/dist/primitives/suggestion/SuggestionTitle.d.ts +1 -5
  84. package/dist/primitives/suggestion/SuggestionTitle.d.ts.map +1 -1
  85. package/dist/primitives/suggestion/SuggestionTitle.js.map +1 -1
  86. package/dist/primitives/suggestion/SuggestionTrigger.d.ts +1 -8
  87. package/dist/primitives/suggestion/SuggestionTrigger.d.ts.map +1 -1
  88. package/dist/primitives/suggestion.d.ts +0 -2
  89. package/dist/primitives/thread/ThreadEmpty.d.ts +1 -4
  90. package/dist/primitives/thread/ThreadEmpty.d.ts.map +1 -1
  91. package/dist/primitives/thread/ThreadIf.d.ts +1 -6
  92. package/dist/primitives/thread/ThreadIf.d.ts.map +1 -1
  93. package/dist/primitives/thread/ThreadIf.js.map +1 -1
  94. package/dist/primitives/thread/ThreadMessages.d.ts +14 -12
  95. package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
  96. package/dist/primitives/thread/ThreadMessages.js +376 -33
  97. package/dist/primitives/thread/ThreadMessages.js.map +1 -1
  98. package/dist/primitives/thread/ThreadRoot.d.ts +1 -5
  99. package/dist/primitives/thread/ThreadRoot.d.ts.map +1 -1
  100. package/dist/primitives/thread/ThreadSuggestion.d.ts +3 -10
  101. package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
  102. package/dist/primitives/thread.d.ts +3 -5
  103. package/dist/primitives/thread.js +3 -2
  104. package/dist/primitives/thread.js.map +1 -1
  105. package/dist/primitives/threadList/ThreadListItems.d.ts +1 -5
  106. package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -1
  107. package/dist/primitives/threadList/ThreadListNew.d.ts +1 -5
  108. package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
  109. package/dist/primitives/threadList/ThreadListRoot.d.ts +1 -5
  110. package/dist/primitives/threadList/ThreadListRoot.d.ts.map +1 -1
  111. package/dist/primitives/threadList.d.ts +0 -2
  112. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +1 -5
  113. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
  114. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +1 -5
  115. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts.map +1 -1
  116. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts +1 -5
  117. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -1
  118. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +1 -5
  119. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -1
  120. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +1 -5
  121. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -1
  122. package/dist/primitives/threadListItem.d.ts +0 -2
  123. package/package.json +9 -9
  124. package/src/index.ts +2 -0
  125. package/src/primitives/composer/ComposerAttachments.tsx +3 -15
  126. package/src/primitives/composer/ComposerInput.test.tsx +106 -8
  127. package/src/primitives/composer/ComposerInput.tsx +21 -2
  128. package/src/primitives/composer.ts +2 -0
  129. package/src/primitives/message/MessageAttachments.tsx +3 -8
  130. package/src/primitives/message.ts +2 -0
  131. package/src/primitives/thread/ThreadMessages.test.tsx +444 -10
  132. package/src/primitives/thread/ThreadMessages.tsx +320 -29
  133. package/src/primitives/thread.ts +2 -0
@@ -1,5 +1,4 @@
1
1
  import { TextInputProps } from "react-native";
2
-
3
2
  //#region src/primitives/composer/ComposerInput.d.ts
4
3
  type ComposerInputProps = Omit<TextInputProps, "value" | "onChangeText"> & {
5
4
  /**
@@ -10,13 +9,7 @@ type ComposerInputProps = Omit<TextInputProps, "value" | "onChangeText"> & {
10
9
  */
11
10
  submitMode?: "enter" | "none";
12
11
  };
13
- declare const ComposerInput: ({
14
- submitMode,
15
- onKeyPress: onKeyPressProp,
16
- numberOfLines,
17
- style,
18
- ...props
19
- }: ComposerInputProps) => import("react").JSX.Element;
12
+ declare const ComposerInput: ({ submitMode, onKeyPress: onKeyPressProp, numberOfLines, style, ...props }: ComposerInputProps) => import("react").JSX.Element;
20
13
  //#endregion
21
14
  export { ComposerInput, ComposerInputProps };
22
15
  //# sourceMappingURL=ComposerInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInput.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"mappings":";;;KAWY,kBAAA,GAAqB,IAAI,CACnC,cAAA;;AADF;;;;;EAUE,UAAA;AAAA;AAAA,cAeW,aAAA;EAAiB,UAAA;EAAA,UAAA,EAAA,cAAA;EAAA,aAAA;EAAA,KAAA;EAAA,GAAA;AAAA,GAM3B,kBAAA,qBAAkB,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ComposerInput.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"mappings":";;KAWY,qBAAqB,KAC/B;;;;;;;EASA;;cAkCW,kBAAiB,YAAA,YAAA,gBAAA,eAAA,UAAA,SAM3B,uCAAkB,IAAA"}
@@ -5,14 +5,27 @@ import { jsx } from "react/jsx-runtime";
5
5
  import { useEffect, useRef } from "@assistant-ui/tap/react-shim";
6
6
  import { flushTapSync } from "@assistant-ui/tap";
7
7
  //#region src/primitives/composer/ComposerInput.tsx
8
+ const getWebTextareaMaxHeight = (el) => {
9
+ const computedMaxHeight = globalThis.getComputedStyle?.(el).maxHeight;
10
+ const parsedComputedMaxHeight = Number.parseFloat(computedMaxHeight ?? "");
11
+ if (Number.isFinite(parsedComputedMaxHeight)) return parsedComputedMaxHeight;
12
+ const inlineMaxHeight = Number.parseFloat(el.style.maxHeight);
13
+ return Number.isFinite(inlineMaxHeight) ? inlineMaxHeight : null;
14
+ };
8
15
  const adjustWebTextareaHeight = (ref) => {
9
16
  if (Platform.OS !== "web") return;
10
17
  const el = ref.current;
11
18
  if (!el) return;
12
19
  if (el.rows !== 1) el.rows = 1;
13
- el.style.overflow = "hidden";
20
+ el.style.overflowX = "hidden";
21
+ el.style.overflowY = "hidden";
14
22
  el.style.height = "auto";
15
- el.style.height = `${el.scrollHeight}px`;
23
+ const scrollHeight = el.scrollHeight;
24
+ const maxHeight = getWebTextareaMaxHeight(el);
25
+ const needsScrollbar = maxHeight !== null && scrollHeight > maxHeight;
26
+ const nextHeight = maxHeight === null ? scrollHeight : Math.min(scrollHeight, maxHeight);
27
+ el.style.overflowY = needsScrollbar ? "auto" : "hidden";
28
+ el.style.height = `${nextHeight}px`;
16
29
  };
17
30
  const ComposerInput = (t0) => {
18
31
  const $ = c(22);
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerInput.js","names":["useCallback","useEffect","useRef","Platform","TextInput","NativeSyntheticEvent","TextInputKeyPressEventData","TextInputProps","useAui","useAuiState","flushTapSync","ComposerInputProps","Omit","submitMode","adjustWebTextareaHeight","ref","React","RefObject","OS","el","current","HTMLTextAreaElement","rows","style","overflow","height","scrollHeight","ComposerInput","t0","$","_c","numberOfLines","onKeyPressProp","props","t1","onKeyPress","undefined","aui","text","_temp","inputRef","t2","value","composer","setText","onChangeText","t3","Symbol","for","t4","t5","e","nativeEvent","shiftKey","isComposing","keyCode","key","Event","preventDefault","send","t6","t7","s"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef } from \"react\";\nimport {\n Platform,\n TextInput,\n type NativeSyntheticEvent,\n type TextInputKeyPressEventData,\n type TextInputProps,\n} from \"react-native\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\n\nexport type ComposerInputProps = Omit<\n TextInputProps,\n \"value\" | \"onChangeText\"\n> & {\n /**\n * Controls how the Enter key submits messages (web only).\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"none\": Enter inserts newline (no keyboard submission)\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"none\";\n};\n\nconst adjustWebTextareaHeight = (ref: React.RefObject<TextInput | null>) => {\n if (Platform.OS !== \"web\") return;\n // On web, the TextInput ref IS the DOM element\n const el = ref.current as unknown as HTMLTextAreaElement | null;\n if (!el) return;\n // Ensure rows=1 so scrollHeight reflects actual content\n if (el.rows !== 1) el.rows = 1;\n el.style.overflow = \"hidden\";\n el.style.height = \"auto\";\n el.style.height = `${el.scrollHeight}px`;\n};\n\nexport const ComposerInput = ({\n submitMode = \"enter\",\n onKeyPress: onKeyPressProp,\n numberOfLines,\n style,\n ...props\n}: ComposerInputProps) => {\n const aui = useAui();\n const text = useAuiState((s) => s.composer.text);\n const inputRef = useRef<TextInput>(null);\n\n const onChangeText = useCallback(\n (value: string) => {\n if (Platform.OS === \"web\") {\n // Keep the controlled value in sync mid-IME so react-dom does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer().setText(value);\n });\n return;\n }\n aui.composer().setText(value);\n },\n [aui],\n );\n\n // Auto-resize textarea on web when text changes\n useEffect(() => {\n void text; // trigger re-run when text changes\n adjustWebTextareaHeight(inputRef);\n }, [text]);\n\n const onKeyPress = useCallback(\n (e: NativeSyntheticEvent<TextInputKeyPressEventData>) => {\n onKeyPressProp?.(e);\n\n if (Platform.OS !== \"web\") return;\n if (submitMode !== \"enter\") return;\n\n const nativeEvent = e.nativeEvent as TextInputKeyPressEventData & {\n shiftKey?: boolean;\n isComposing?: boolean;\n keyCode?: number;\n };\n // react-native-web forwards the raw DOM keydown before its own composition guard, so re-check it here (mirrors isEventComposing)\n if (nativeEvent.isComposing || nativeEvent.keyCode === 229) return;\n if (nativeEvent.key === \"Enter\" && !nativeEvent.shiftKey) {\n (e as unknown as Event).preventDefault?.();\n aui.composer().send();\n }\n },\n [aui, submitMode, onKeyPressProp],\n );\n\n return (\n <TextInput\n ref={inputRef}\n value={text}\n onChangeText={onChangeText}\n onKeyPress={onKeyPress}\n numberOfLines={numberOfLines ?? (Platform.OS === \"web\" ? 1 : undefined)}\n style={style}\n {...props}\n />\n );\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"ComposerInput.js","names":["useCallback","useEffect","useRef","Platform","TextInput","NativeSyntheticEvent","TextInputKeyPressEventData","TextInputProps","useAui","useAuiState","flushTapSync","ComposerInputProps","Omit","submitMode","getWebTextareaMaxHeight","el","HTMLTextAreaElement","computedMaxHeight","globalThis","getComputedStyle","maxHeight","parsedComputedMaxHeight","Number","parseFloat","isFinite","inlineMaxHeight","style","adjustWebTextareaHeight","ref","React","RefObject","OS","current","rows","overflowX","overflowY","height","scrollHeight","needsScrollbar","nextHeight","Math","min","ComposerInput","t0","$","_c","numberOfLines","onKeyPressProp","props","t1","onKeyPress","undefined","aui","text","_temp","inputRef","t2","value","composer","setText","onChangeText","t3","Symbol","for","t4","t5","e","nativeEvent","shiftKey","isComposing","keyCode","key","Event","preventDefault","send","t6","t7","s"],"sources":["../../../src/primitives/composer/ComposerInput.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef } from \"react\";\nimport {\n Platform,\n TextInput,\n type NativeSyntheticEvent,\n type TextInputKeyPressEventData,\n type TextInputProps,\n} from \"react-native\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport { flushTapSync } from \"@assistant-ui/tap\";\n\nexport type ComposerInputProps = Omit<\n TextInputProps,\n \"value\" | \"onChangeText\"\n> & {\n /**\n * Controls how the Enter key submits messages (web only).\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"none\": Enter inserts newline (no keyboard submission)\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"none\";\n};\n\nconst getWebTextareaMaxHeight = (el: HTMLTextAreaElement) => {\n const computedMaxHeight = globalThis.getComputedStyle?.(el).maxHeight;\n const parsedComputedMaxHeight = Number.parseFloat(computedMaxHeight ?? \"\");\n if (Number.isFinite(parsedComputedMaxHeight)) return parsedComputedMaxHeight;\n\n const inlineMaxHeight = Number.parseFloat(el.style.maxHeight);\n return Number.isFinite(inlineMaxHeight) ? inlineMaxHeight : null;\n};\n\nconst adjustWebTextareaHeight = (ref: React.RefObject<TextInput | null>) => {\n if (Platform.OS !== \"web\") return;\n // On web, the TextInput ref IS the DOM element\n const el = ref.current as unknown as HTMLTextAreaElement | null;\n if (!el) return;\n // Ensure rows=1 so scrollHeight reflects actual content\n if (el.rows !== 1) el.rows = 1;\n\n el.style.overflowX = \"hidden\";\n el.style.overflowY = \"hidden\";\n el.style.height = \"auto\";\n\n const scrollHeight = el.scrollHeight;\n const maxHeight = getWebTextareaMaxHeight(el);\n const needsScrollbar = maxHeight !== null && scrollHeight > maxHeight;\n const nextHeight =\n maxHeight === null ? scrollHeight : Math.min(scrollHeight, maxHeight);\n\n el.style.overflowY = needsScrollbar ? \"auto\" : \"hidden\";\n el.style.height = `${nextHeight}px`;\n};\n\nexport const ComposerInput = ({\n submitMode = \"enter\",\n onKeyPress: onKeyPressProp,\n numberOfLines,\n style,\n ...props\n}: ComposerInputProps) => {\n const aui = useAui();\n const text = useAuiState((s) => s.composer.text);\n const inputRef = useRef<TextInput>(null);\n\n const onChangeText = useCallback(\n (value: string) => {\n if (Platform.OS === \"web\") {\n // Keep the controlled value in sync mid-IME so react-dom does not reset the textarea to a stale value\n flushTapSync(() => {\n aui.composer().setText(value);\n });\n return;\n }\n aui.composer().setText(value);\n },\n [aui],\n );\n\n // Auto-resize textarea on web when text changes\n useEffect(() => {\n void text; // trigger re-run when text changes\n adjustWebTextareaHeight(inputRef);\n }, [text]);\n\n const onKeyPress = useCallback(\n (e: NativeSyntheticEvent<TextInputKeyPressEventData>) => {\n onKeyPressProp?.(e);\n\n if (Platform.OS !== \"web\") return;\n if (submitMode !== \"enter\") return;\n\n const nativeEvent = e.nativeEvent as TextInputKeyPressEventData & {\n shiftKey?: boolean;\n isComposing?: boolean;\n keyCode?: number;\n };\n // react-native-web forwards the raw DOM keydown before its own composition guard, so re-check it here (mirrors isEventComposing)\n if (nativeEvent.isComposing || nativeEvent.keyCode === 229) return;\n if (nativeEvent.key === \"Enter\" && !nativeEvent.shiftKey) {\n (e as unknown as Event).preventDefault?.();\n aui.composer().send();\n }\n },\n [aui, submitMode, onKeyPressProp],\n );\n\n return (\n <TextInput\n ref={inputRef}\n value={text}\n onChangeText={onChangeText}\n onKeyPress={onKeyPress}\n numberOfLines={numberOfLines ?? (Platform.OS === \"web\" ? 1 : undefined)}\n style={style}\n {...props}\n />\n );\n};\n"],"mappings":"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"}
@@ -1,14 +1,10 @@
1
1
  import { ViewProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/composer/ComposerRoot.d.ts
5
4
  type ComposerRootProps = ViewProps & {
6
5
  children: ReactNode;
7
6
  };
8
- declare const ComposerRoot: ({
9
- children,
10
- ...viewProps
11
- }: ComposerRootProps) => import("react").JSX.Element;
7
+ declare const ComposerRoot: ({ children, ...viewProps }: ComposerRootProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { ComposerRoot, ComposerRootProps };
14
10
  //# sourceMappingURL=ComposerRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerRoot.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerRoot.tsx"],"mappings":";;;;KAGY,iBAAA,GAAoB,SAAA;EAC9B,QAAA,EAAU,SAAS;AAAA;AAAA,cAGR,YAAA;EAAgB,QAAA;EAAA,GAAA;AAAA,GAA4B,iBAAiB,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ComposerRoot.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerRoot.tsx"],"mappings":";;;KAGY,oBAAoB;EAC9B,UAAU;;cAGC,iBAAgB,aAAA,aAA4B,sCAAiB,IAAA"}
@@ -1,15 +1,10 @@
1
1
  import { PressableProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/composer/ComposerSend.d.ts
5
4
  type ComposerSendProps = Omit<PressableProps, "onPress"> & {
6
5
  children: ReactNode;
7
6
  };
8
- declare const ComposerSend: ({
9
- children,
10
- disabled,
11
- ...pressableProps
12
- }: ComposerSendProps) => import("react").JSX.Element;
7
+ declare const ComposerSend: ({ children, disabled, ...pressableProps }: ComposerSendProps) => import("react").JSX.Element;
13
8
  //#endregion
14
9
  export { ComposerSend, ComposerSendProps };
15
10
  //# sourceMappingURL=ComposerSend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComposerSend.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerSend.tsx"],"mappings":";;;;KAIY,iBAAA,GAAoB,IAAA,CAAK,cAAA;EACnC,QAAA,EAAU,SAAA;AAAA;AAAA,cAGC,YAAA;EAAgB,QAAA;EAAA,QAAA;EAAA,GAAA;AAAA,GAI1B,iBAAA,qBAAiB,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ComposerSend.d.ts","names":[],"sources":["../../../src/primitives/composer/ComposerSend.tsx"],"mappings":";;;KAIY,oBAAoB,KAAK;EACnC,UAAU;;cAGC,iBAAgB,UAAA,aAAA,kBAI1B,sCAAiB,IAAA"}
@@ -1,15 +1,13 @@
1
1
  import { ComposerRoot, ComposerRootProps } from "./composer/ComposerRoot.js";
2
- import { ComposerAttachmentByIndex, ComposerAttachments } from "./composer/ComposerAttachments.js";
2
+ import { ComposerAttachmentByIndex, ComposerAttachmentByIndexProps, ComposerAttachments, ComposerAttachmentsProps } from "./composer/ComposerAttachments.js";
3
3
  import { ComposerInput, ComposerInputProps } from "./composer/ComposerInput.js";
4
4
  import { ComposerSend, ComposerSendProps } from "./composer/ComposerSend.js";
5
5
  import { ComposerCancel, ComposerCancelProps } from "./composer/ComposerCancel.js";
6
6
  import { ComposerAddAttachment, ComposerAddAttachmentProps } from "./composer/ComposerAddAttachment.js";
7
7
  import { ComposerIf } from "./composer/ComposerIf.js";
8
-
9
- //#region src/primitives/composer.d.ts
10
8
  declare namespace composer_d_exports {
11
- export { ComposerAddAttachment as AddAttachment, ComposerAddAttachmentProps as AddAttachmentProps, ComposerAttachmentByIndex as AttachmentByIndex, ComposerAttachments as Attachments, ComposerCancel as Cancel, ComposerCancelProps as CancelProps, ComposerIf as If, ComposerInput as Input, ComposerInputProps as InputProps, ComposerRoot as Root, ComposerRootProps as RootProps, ComposerSend as Send, ComposerSendProps as SendProps };
9
+ export { ComposerAddAttachment as AddAttachment, ComposerAddAttachmentProps as AddAttachmentProps, ComposerAttachmentByIndex as AttachmentByIndex, ComposerAttachmentByIndexProps as AttachmentByIndexProps, ComposerAttachments as Attachments, ComposerAttachmentsProps as AttachmentsProps, ComposerCancel as Cancel, ComposerCancelProps as CancelProps, ComposerIf as If, ComposerInput as Input, ComposerInputProps as InputProps, ComposerRoot as Root, ComposerRootProps as RootProps, ComposerSend as Send, ComposerSendProps as SendProps };
12
10
  }
13
11
  //#endregion
14
- export { ComposerAddAttachment as AddAttachment, type ComposerAddAttachmentProps as AddAttachmentProps, ComposerAttachmentByIndex as AttachmentByIndex, ComposerAttachments as Attachments, ComposerCancel as Cancel, type ComposerCancelProps as CancelProps, ComposerIf as If, ComposerInput as Input, type ComposerInputProps as InputProps, ComposerRoot as Root, type ComposerRootProps as RootProps, ComposerSend as Send, type ComposerSendProps as SendProps, composer_d_exports };
12
+ export { ComposerAddAttachment as AddAttachment, type ComposerAddAttachmentProps as AddAttachmentProps, ComposerAttachmentByIndex as AttachmentByIndex, type ComposerAttachmentByIndexProps as AttachmentByIndexProps, ComposerAttachments as Attachments, type ComposerAttachmentsProps as AttachmentsProps, ComposerCancel as Cancel, type ComposerCancelProps as CancelProps, ComposerIf as If, ComposerInput as Input, type ComposerInputProps as InputProps, ComposerRoot as Root, type ComposerRootProps as RootProps, ComposerSend as Send, type ComposerSendProps as SendProps, composer_d_exports };
15
13
  //# sourceMappingURL=composer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"composer.js","names":["ComposerRoot","Root","ComposerRootProps","RootProps","ComposerAttachments","Attachments","ComposerAttachmentByIndex","AttachmentByIndex","ComposerInput","Input","ComposerInputProps","InputProps","ComposerSend","Send","ComposerSendProps","SendProps","ComposerCancel","Cancel","ComposerCancelProps","CancelProps","ComposerAddAttachment","AddAttachment","ComposerAddAttachmentProps","AddAttachmentProps","ComposerIf","If"],"sources":["../../src/primitives/composer.ts"],"sourcesContent":["export {\n ComposerRoot as Root,\n type ComposerRootProps as RootProps,\n} from \"./composer/ComposerRoot\";\nexport {\n ComposerAttachments as Attachments,\n ComposerAttachmentByIndex as AttachmentByIndex,\n} from \"./composer/ComposerAttachments\";\nexport {\n ComposerInput as Input,\n type ComposerInputProps as InputProps,\n} from \"./composer/ComposerInput\";\nexport {\n ComposerSend as Send,\n type ComposerSendProps as SendProps,\n} from \"./composer/ComposerSend\";\nexport {\n ComposerCancel as Cancel,\n type ComposerCancelProps as CancelProps,\n} from \"./composer/ComposerCancel\";\nexport {\n ComposerAddAttachment as AddAttachment,\n type ComposerAddAttachmentProps as AddAttachmentProps,\n} from \"./composer/ComposerAddAttachment\";\nexport { ComposerIf as If } from \"./composer/ComposerIf\";\n"],"mappings":""}
1
+ {"version":3,"file":"composer.js","names":["ComposerRoot","Root","ComposerRootProps","RootProps","ComposerAttachments","Attachments","ComposerAttachmentsProps","AttachmentsProps","ComposerAttachmentByIndex","AttachmentByIndex","ComposerAttachmentByIndexProps","AttachmentByIndexProps","ComposerInput","Input","ComposerInputProps","InputProps","ComposerSend","Send","ComposerSendProps","SendProps","ComposerCancel","Cancel","ComposerCancelProps","CancelProps","ComposerAddAttachment","AddAttachment","ComposerAddAttachmentProps","AddAttachmentProps","ComposerIf","If"],"sources":["../../src/primitives/composer.ts"],"sourcesContent":["export {\n ComposerRoot as Root,\n type ComposerRootProps as RootProps,\n} from \"./composer/ComposerRoot\";\nexport {\n ComposerAttachments as Attachments,\n type ComposerAttachmentsProps as AttachmentsProps,\n ComposerAttachmentByIndex as AttachmentByIndex,\n type ComposerAttachmentByIndexProps as AttachmentByIndexProps,\n} from \"./composer/ComposerAttachments\";\nexport {\n ComposerInput as Input,\n type ComposerInputProps as InputProps,\n} from \"./composer/ComposerInput\";\nexport {\n ComposerSend as Send,\n type ComposerSendProps as SendProps,\n} from \"./composer/ComposerSend\";\nexport {\n ComposerCancel as Cancel,\n type ComposerCancelProps as CancelProps,\n} from \"./composer/ComposerCancel\";\nexport {\n ComposerAddAttachment as AddAttachment,\n type ComposerAddAttachmentProps as AddAttachmentProps,\n} from \"./composer/ComposerAddAttachment\";\nexport { ComposerIf as If } from \"./composer/ComposerIf\";\n"],"mappings":""}
@@ -1,15 +1,11 @@
1
1
  import { TextProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/error/ErrorMessage.d.ts
5
4
  type ErrorMessageProps = TextProps & {
6
5
  children?: ReactNode;
7
6
  };
8
7
  declare const ErrorMessage: {
9
- ({
10
- children,
11
- ...textProps
12
- }: ErrorMessageProps): import("react").JSX.Element | null;
8
+ ({ children, ...textProps }: ErrorMessageProps): import("react").JSX.Element | null;
13
9
  displayName: string;
14
10
  };
15
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorMessage.d.ts","names":[],"sources":["../../../src/primitives/error/ErrorMessage.tsx"],"mappings":";;;;KAIY,iBAAA,GAAoB,SAAA;EAC9B,QAAA,GAAW,SAAS;AAAA;AAAA,cAGT,YAAA;EAAA;;;KAA4C,iBAAiB,mBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ErrorMessage.d.ts","names":[],"sources":["../../../src/primitives/error/ErrorMessage.tsx"],"mappings":";;;KAIY,oBAAoB;EAC9B,WAAW;;cAGA;KAA4C,aAAA,aAAA,oCAAiB,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorMessage.js","names":["ReactNode","Text","TextProps","useMessageError","ErrorMessageProps","children","ErrorMessage","t0","$","_c","textProps","error","undefined","t1","String","t2","displayName"],"sources":["../../../src/primitives/error/ErrorMessage.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useMessageError } from \"@assistant-ui/core/react\";\n\nexport type ErrorMessageProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const ErrorMessage = ({ children, ...textProps }: ErrorMessageProps) => {\n const error = useMessageError();\n\n if (error === undefined) return null;\n\n return <Text {...textProps}>{children ?? String(error)}</Text>;\n};\n\nErrorMessage.displayName = \"ErrorPrimitive.Message\";\n"],"mappings":";;;;;AAQA,MAAaM,gBAAeC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,aAAAK,aAAAH;EAA6CC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CACxE,MAAAG,QAAcR,gBAAgB;CAE9B,IAAIQ,UAAUC,KAAAA,GAAS,OAAS;CAEH,MAAAC,KAAAR,YAAYS,OAAOH,KAAK;CAAC,IAAAI;CAAA,IAAAP,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAA/CK,KAAA,oBAAC,MAAD;GAAK,GAAKL;aAAYG;EAAjB,CAAA;EAAkDL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAAvDO;AAAuD;AAGhET,aAAaU,cAAc"}
1
+ {"version":3,"file":"ErrorMessage.js","names":["ReactNode","Text","TextProps","useMessageError","ErrorMessageProps","children","ErrorMessage","t0","$","_c","textProps","error","undefined","t1","String","t2","displayName"],"sources":["../../../src/primitives/error/ErrorMessage.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Text, type TextProps } from \"react-native\";\nimport { useMessageError } from \"@assistant-ui/core/react\";\n\nexport type ErrorMessageProps = TextProps & {\n children?: ReactNode;\n};\n\nexport const ErrorMessage = ({ children, ...textProps }: ErrorMessageProps) => {\n const error = useMessageError();\n\n if (error === undefined) return null;\n\n return <Text {...textProps}>{children ?? String(error)}</Text>;\n};\n\nErrorMessage.displayName = \"ErrorPrimitive.Message\";\n"],"mappings":";;;;;AAQA,MAAaM,gBAAeC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAC,CAAA,CAAAF,aAAAK,aAAAH;EAA6CC,EAAA,KAAAD;EAAAC,EAAA,KAAAH;EAAAG,EAAA,KAAAE;CAAA,OAAA;EAAAL,WAAAG,EAAA;EAAAE,YAAAF,EAAA;CAAA;CACxE,MAAAG,QAAcR,gBAAgB;CAE9B,IAAIQ,UAAUC,KAAAA,GAAS,OAAS;CAEH,MAAAC,KAAAR,YAAYS,OAAOH,KAAK;CAAC,IAAAI;CAAA,IAAAP,EAAA,OAAAK,MAAAL,EAAA,OAAAE,WAAA;EAA/CK,KAAA,oBAAC,MAAD;GAAK,GAAKL;GAAYG,UAAAA;EAAjB,CAAA;EAAkDL,EAAA,KAAAK;EAAAL,EAAA,KAAAE;EAAAF,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAAvDO;AAAuD;AAGhET,aAAaU,cAAc"}
@@ -1,15 +1,11 @@
1
1
  import { ViewProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/error/ErrorRoot.d.ts
5
4
  type ErrorRootProps = ViewProps & {
6
5
  children: ReactNode;
7
6
  };
8
7
  declare const ErrorRoot: {
9
- ({
10
- children,
11
- ...viewProps
12
- }: ErrorRootProps): import("react").JSX.Element | null;
8
+ ({ children, ...viewProps }: ErrorRootProps): import("react").JSX.Element | null;
13
9
  displayName: string;
14
10
  };
15
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorRoot.d.ts","names":[],"sources":["../../../src/primitives/error/ErrorRoot.tsx"],"mappings":";;;;KAIY,cAAA,GAAiB,SAAA;EAC3B,QAAA,EAAU,SAAS;AAAA;AAAA,cAGR,SAAA;EAAA;;;KAAyC,cAAc,mBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ErrorRoot.d.ts","names":[],"sources":["../../../src/primitives/error/ErrorRoot.tsx"],"mappings":";;;KAIY,iBAAiB;EAC3B,UAAU;;cAGC;KAAyC,aAAA,aAAA,iCAAc,IAAA"}
@@ -1,7 +1,5 @@
1
1
  import { ErrorRoot, ErrorRootProps } from "./ErrorRoot.js";
2
2
  import { ErrorMessage, ErrorMessageProps } from "./ErrorMessage.js";
3
-
4
- //#region src/primitives/error/index.d.ts
5
3
  declare namespace index_d_exports {
6
4
  export { ErrorMessage as Message, ErrorMessageProps as MessageProps, ErrorRoot as Root, ErrorRootProps as RootProps };
7
5
  }
@@ -1,14 +1,7 @@
1
- import { AttachmentComponents } from "../composer/ComposerAttachments.js";
2
1
  import { MessagePrimitiveAttachmentByIndex, MessagePrimitiveAttachments } from "@assistant-ui/core/react";
3
-
4
2
  //#region src/primitives/message/MessageAttachments.d.ts
5
- type MessageAttachmentsProps = {
6
- components: AttachmentComponents | undefined;
7
- };
8
- type MessageAttachmentByIndexProps = {
9
- index: number;
10
- components?: AttachmentComponents | undefined;
11
- };
3
+ type MessageAttachmentsProps = MessagePrimitiveAttachments.Props;
4
+ type MessageAttachmentByIndexProps = MessagePrimitiveAttachmentByIndex.Props;
12
5
  declare const MessageAttachmentByIndex: import("react").FC<MessagePrimitiveAttachmentByIndex.Props>;
13
6
  declare const MessageAttachments: import("react").FC<MessagePrimitiveAttachments.Props>;
14
7
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"MessageAttachments.d.ts","names":[],"sources":["../../../src/primitives/message/MessageAttachments.tsx"],"mappings":";;;;KAMY,uBAAA;EACV,UAAA,EAAY,oBAAoB;AAAA;AAAA,KAGtB,6BAAA;EACV,KAAA;EACA,UAAA,GAAa,oBAAoB;AAAA;AAAA,cAGtB,wBAAA,kBAAwB,EAAA,CAAA,iCAAA,CAAA,KAAA;AAAA,cAExB,kBAAA,kBAAkB,EAAA,CAAA,2BAAA,CAAA,KAAA"}
1
+ {"version":3,"file":"MessageAttachments.d.ts","names":[],"sources":["../../../src/primitives/message/MessageAttachments.tsx"],"mappings":";;KAKY,0BAA0B,4BAA4B;KAEtD,gCACV,kCAAkC;cAEvB,0CAAwB,GAAA,kCAAA;cAExB,oCAAkB,GAAA,4BAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessageAttachments.js","names":["MessagePrimitiveAttachments","MessagePrimitiveAttachmentByIndex","AttachmentComponents","MessageAttachmentsProps","components","MessageAttachmentByIndexProps","index","MessageAttachmentByIndex","MessageAttachments"],"sources":["../../../src/primitives/message/MessageAttachments.tsx"],"sourcesContent":["import {\n MessagePrimitiveAttachments,\n MessagePrimitiveAttachmentByIndex,\n} from \"@assistant-ui/core/react\";\nimport type { AttachmentComponents } from \"../composer/ComposerAttachments\";\n\nexport type MessageAttachmentsProps = {\n components: AttachmentComponents | undefined;\n};\n\nexport type MessageAttachmentByIndexProps = {\n index: number;\n components?: AttachmentComponents | undefined;\n};\n\nexport const MessageAttachmentByIndex = MessagePrimitiveAttachmentByIndex;\n\nexport const MessageAttachments = MessagePrimitiveAttachments;\n"],"mappings":";;AAeA,MAAaO,2BAA2BN;AAExC,MAAaO,qBAAqBR"}
1
+ {"version":3,"file":"MessageAttachments.js","names":["MessagePrimitiveAttachments","MessagePrimitiveAttachmentByIndex","MessageAttachmentsProps","Props","MessageAttachmentByIndexProps","MessageAttachmentByIndex","MessageAttachments"],"sources":["../../../src/primitives/message/MessageAttachments.tsx"],"sourcesContent":["import {\n MessagePrimitiveAttachments,\n MessagePrimitiveAttachmentByIndex,\n} from \"@assistant-ui/core/react\";\n\nexport type MessageAttachmentsProps = MessagePrimitiveAttachments.Props;\n\nexport type MessageAttachmentByIndexProps =\n MessagePrimitiveAttachmentByIndex.Props;\n\nexport const MessageAttachmentByIndex = MessagePrimitiveAttachmentByIndex;\n\nexport const MessageAttachments = MessagePrimitiveAttachments;\n"],"mappings":";;AAUA,MAAaK,2BAA2BJ;AAExC,MAAaK,qBAAqBN"}
@@ -1,6 +1,5 @@
1
1
  import { ThreadAssistantMessagePart, ThreadUserMessagePart } from "@assistant-ui/core";
2
2
  import { ReactElement } from "react";
3
-
4
3
  //#region src/primitives/message/MessageContent.d.ts
5
4
  type MessageContentPart = ThreadUserMessagePart | ThreadAssistantMessagePart;
6
5
  type MessageContentProps = {
@@ -47,15 +46,7 @@ type MessageContentProps = {
47
46
  index: number;
48
47
  }) => ReactElement;
49
48
  };
50
- declare const MessageContent: ({
51
- renderText,
52
- renderToolCall,
53
- renderImage,
54
- renderReasoning,
55
- renderSource,
56
- renderFile,
57
- renderData
58
- }: MessageContentProps) => import("react").JSX.Element;
49
+ declare const MessageContent: ({ renderText, renderToolCall, renderImage, renderReasoning, renderSource, renderFile, renderData }: MessageContentProps) => import("react").JSX.Element;
59
50
  //#endregion
60
51
  export { MessageContent, MessageContentProps };
61
52
  //# sourceMappingURL=MessageContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageContent.d.ts","names":[],"sources":["../../../src/primitives/message/MessageContent.tsx"],"mappings":";;;;KAcK,kBAAA,GAAqB,qBAAA,GAAwB,0BAA0B;AAAA,KAEhE,mBAAA;EACV,UAAA,IAAc,KAAA;IACZ,IAAA,EAAM,OAAA,CAAQ,kBAAA;MAAsB,IAAA;IAAA;IACpC,KAAA;EAAA,MACI,YAAA;EACN,cAAA,IAAkB,KAAA;IAChB,IAAA,EAAM,OAAA,CAAQ,kBAAA;MAAsB,IAAA;IAAA;IACpC,KAAA;EAAA,MACI,YAAA;EACN,WAAA,IAAe,KAAA;IACb,IAAA,EAAM,OAAA,CAAQ,kBAAA;MAAsB,IAAA;IAAA;IACpC,KAAA;EAAA,MACI,YAAA;EACN,eAAA,IAAmB,KAAA;IACjB,IAAA,EAAM,OAAA,CAAQ,kBAAA;MAAsB,IAAA;IAAA;IACpC,KAAA;EAAA,MACI,YAAA;EACN,YAAA,IAAgB,KAAA;IACd,IAAA,EAAM,OAAA,CAAQ,kBAAA;MAAsB,IAAA;IAAA;IACpC,KAAA;EAAA,MACI,YAAA;EACN,UAAA,IAAc,KAAA;IACZ,IAAA,EAAM,OAAA,CAAQ,kBAAA;MAAsB,IAAA;IAAA;IACpC,KAAA;EAAA,MACI,YAAA;EACN,UAAA,IAAc,KAAA;IACZ,IAAA,EAAM,OAAA,CAAQ,kBAAA;MAAsB,IAAA;IAAA;IACpC,KAAA;EAAA,MACI,YAAA;AAAA;AAAA,cAqEK,cAAA;EAAkB,UAAA;EAAA,cAAA;EAAA,WAAA;EAAA,eAAA;EAAA,YAAA;EAAA,UAAA;EAAA;AAAA,GAQ5B,mBAAA,qBAAmB,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"MessageContent.d.ts","names":[],"sources":["../../../src/primitives/message/MessageContent.tsx"],"mappings":";;;KAcK,qBAAqB,wBAAwB;KAEtC;EACV,cAAc;IACZ,MAAM,QAAQ;MAAsB;;IACpC;QACI;EACN,kBAAkB;IAChB,MAAM,QAAQ;MAAsB;;IACpC;QACI;EACN,eAAe;IACb,MAAM,QAAQ;MAAsB;;IACpC;QACI;EACN,mBAAmB;IACjB,MAAM,QAAQ;MAAsB;;IACpC;QACI;EACN,gBAAgB;IACd,MAAM,QAAQ;MAAsB;;IACpC;QACI;EACN,cAAc;IACZ,MAAM,QAAQ;MAAsB;;IACpC;QACI;EACN,cAAc;IACZ,MAAM,QAAQ;MAAsB;;IACpC;QACI;;cAqEK,mBAAkB,YAAA,gBAAA,aAAA,iBAAA,cAAA,YAAA,cAQ5B,wCAAmB,IAAA"}
@@ -1,5 +1,4 @@
1
1
  import { ReactNode } from "react";
2
-
3
2
  //#region src/primitives/message/MessageIf.d.ts
4
3
  type MessageIfProps = {
5
4
  children: ReactNode;
@@ -8,13 +7,7 @@ type MessageIfProps = {
8
7
  running?: boolean | undefined;
9
8
  last?: boolean | undefined;
10
9
  };
11
- declare const MessageIf: ({
12
- children,
13
- user,
14
- assistant,
15
- running,
16
- last
17
- }: MessageIfProps) => import("react").JSX.Element | null;
10
+ declare const MessageIf: ({ children, user, assistant, running, last }: MessageIfProps) => import("react").JSX.Element | null;
18
11
  //#endregion
19
12
  export { MessageIf, MessageIfProps };
20
13
  //# sourceMappingURL=MessageIf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageIf.d.ts","names":[],"sources":["../../../src/primitives/message/MessageIf.tsx"],"mappings":";;;KAGY,cAAA;EACV,QAAA,EAAU,SAAS;EACnB,IAAA;EACA,SAAA;EACA,OAAA;EACA,IAAA;AAAA;AAAA,cAGW,SAAA;EAAa,QAAA;EAAA,IAAA;EAAA,SAAA;EAAA,OAAA;EAAA;AAAA,GAMvB,cAAA,qBAAc,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"MessageIf.d.ts","names":[],"sources":["../../../src/primitives/message/MessageIf.tsx"],"mappings":";;KAGY;EACV,UAAU;EACV;EACA;EACA;EACA;;cAGW,cAAa,UAAA,MAAA,WAAA,SAAA,QAMvB,mCAAc,IAAA"}
@@ -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\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":";;;;AAWA,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;MACPV,UAAUQ,QAAOG,SAAU,SAAO,OAAS;CAAA;CAGjD,IAAIV,cAAcS,KAAAA;MACZT,eAAeO,QAAOG,SAAU,cAAY,OAAS;CAAA;CAG3D,IAAIT,YAAYQ,KAAAA;MAGVR,aADFM,QAAOG,SAAU,eAAeH,QAAOK,OAAOC,SAAU,YACjC,OAAS;CAAA;CAGpC,IAAIX,SAASO,KAAAA;MACPP,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"],"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\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":";;;;AAWA,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,6 +1,5 @@
1
1
  import { MessagePartComponent as MessagePartComponentBase, MessagePrimitivePartByIndex as MessagePrimitivePartByIndexBase, MessagePrimitiveParts as MessagePrimitiveParts$1 } from "@assistant-ui/core/react";
2
2
  import { FC } from "react";
3
-
4
3
  //#region src/primitives/message/MessageParts.d.ts
5
4
  declare namespace MessagePrimitiveParts {
6
5
  type Props = MessagePrimitiveParts$1.Props;
@@ -1 +1 @@
1
- {"version":3,"file":"MessageParts.d.ts","names":[],"sources":["../../../src/primitives/message/MessageParts.tsx"],"mappings":";;;;kBAciB,qBAAA;EAAA,KACH,KAAA,GAAQ,uBAAA,CAA0B,KAAK;AAAA;;;;cAMxC,qBAAA,EAAuB,EAAE,CAAC,qBAAA,CAAsB,KAAA"}
1
+ {"version":3,"file":"MessageParts.d.ts","names":[],"sources":["../../../src/primitives/message/MessageParts.tsx"],"mappings":";;;kBAciB;OACH,QAAQ,wBAA0B;;;;;cAMnC,uBAAuB,GAAG,sBAAsB"}
@@ -1,14 +1,10 @@
1
1
  import { ViewProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/message/MessageRoot.d.ts
5
4
  type MessageRootProps = ViewProps & {
6
5
  children: ReactNode;
7
6
  };
8
- declare const MessageRoot: ({
9
- children,
10
- ...viewProps
11
- }: MessageRootProps) => import("react").JSX.Element;
7
+ declare const MessageRoot: ({ children, ...viewProps }: MessageRootProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { MessageRoot, MessageRootProps };
14
10
  //# sourceMappingURL=MessageRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageRoot.d.ts","names":[],"sources":["../../../src/primitives/message/MessageRoot.tsx"],"mappings":";;;;KAGY,gBAAA,GAAmB,SAAA;EAC7B,QAAA,EAAU,SAAS;AAAA;AAAA,cAGR,WAAA;EAAe,QAAA;EAAA,GAAA;AAAA,GAA4B,gBAAgB,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"MessageRoot.d.ts","names":[],"sources":["../../../src/primitives/message/MessageRoot.tsx"],"mappings":";;;KAGY,mBAAmB;EAC7B,UAAU;;cAGC,gBAAe,aAAA,aAA4B,qCAAgB,IAAA"}
@@ -2,13 +2,11 @@ import { MessageRoot, MessageRootProps } from "./message/MessageRoot.js";
2
2
  import { MessageContent, MessageContentProps } from "./message/MessageContent.js";
3
3
  import { MessagePrimitivePartByIndex as MessagePrimitivePartByIndexBase, MessagePrimitiveParts } from "./message/MessageParts.js";
4
4
  import { MessageIf, MessageIfProps } from "./message/MessageIf.js";
5
- import { MessageAttachmentByIndex, MessageAttachments } from "./message/MessageAttachments.js";
5
+ import { MessageAttachmentByIndex, MessageAttachmentByIndexProps, MessageAttachments, MessageAttachmentsProps } from "./message/MessageAttachments.js";
6
6
  import { MessagePrimitiveGroupedParts as GroupedParts } from "@assistant-ui/core/react";
7
-
8
- //#region src/primitives/message.d.ts
9
7
  declare namespace message_d_exports {
10
- export { MessageAttachmentByIndex as AttachmentByIndex, MessageAttachments as Attachments, MessageContent as Content, MessageContentProps as ContentProps, GroupedParts, MessageIf as If, MessageIfProps as IfProps, MessagePrimitivePartByIndexBase as PartByIndex, MessagePrimitiveParts as Parts, MessageRoot as Root, MessageRootProps as RootProps };
8
+ export { MessageAttachmentByIndex as AttachmentByIndex, MessageAttachmentByIndexProps as AttachmentByIndexProps, MessageAttachments as Attachments, MessageAttachmentsProps as AttachmentsProps, MessageContent as Content, MessageContentProps as ContentProps, GroupedParts, MessageIf as If, MessageIfProps as IfProps, MessagePrimitivePartByIndexBase as PartByIndex, MessagePrimitiveParts as Parts, MessageRoot as Root, MessageRootProps as RootProps };
11
9
  }
12
10
  //#endregion
13
- export { MessageAttachmentByIndex as AttachmentByIndex, MessageAttachments as Attachments, MessageContent as Content, type MessageContentProps as ContentProps, GroupedParts, MessageIf as If, type MessageIfProps as IfProps, MessagePrimitivePartByIndexBase as PartByIndex, MessagePrimitiveParts as Parts, MessageRoot as Root, type MessageRootProps as RootProps, message_d_exports };
11
+ export { MessageAttachmentByIndex as AttachmentByIndex, type MessageAttachmentByIndexProps as AttachmentByIndexProps, MessageAttachments as Attachments, type MessageAttachmentsProps as AttachmentsProps, MessageContent as Content, type MessageContentProps as ContentProps, GroupedParts, MessageIf as If, type MessageIfProps as IfProps, MessagePrimitivePartByIndexBase as PartByIndex, MessagePrimitiveParts as Parts, MessageRoot as Root, type MessageRootProps as RootProps, message_d_exports };
14
12
  //# sourceMappingURL=message.d.ts.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","MessageAttachmentByIndex","AttachmentByIndex"],"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 MessageAttachmentByIndex as AttachmentByIndex,\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","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,14 +1,10 @@
1
1
  import { TextProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/suggestion/SuggestionDescription.d.ts
5
4
  type SuggestionDescriptionProps = TextProps & {
6
5
  children?: ReactNode;
7
6
  };
8
- declare const SuggestionDescription: ({
9
- children,
10
- ...textProps
11
- }: SuggestionDescriptionProps) => import("react").JSX.Element;
7
+ declare const SuggestionDescription: ({ children, ...textProps }: SuggestionDescriptionProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { SuggestionDescription, SuggestionDescriptionProps };
14
10
  //# sourceMappingURL=SuggestionDescription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SuggestionDescription.d.ts","names":[],"sources":["../../../src/primitives/suggestion/SuggestionDescription.tsx"],"mappings":";;;;KAIY,0BAAA,GAA6B,SAAA;EACvC,QAAA,GAAW,SAAS;AAAA;AAAA,cAGT,qBAAA;EAAyB,QAAA;EAAA,GAAA;AAAA,GAGnC,0BAA0B,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"SuggestionDescription.d.ts","names":[],"sources":["../../../src/primitives/suggestion/SuggestionDescription.tsx"],"mappings":";;;KAIY,6BAA6B;EACvC,WAAW;;cAGA,0BAAyB,aAAA,aAGnC,+CAA0B,IAAA"}
@@ -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,aAAAK,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;aAAYG;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"],"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,aAAAK,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,14 +1,10 @@
1
1
  import { TextProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/suggestion/SuggestionTitle.d.ts
5
4
  type SuggestionTitleProps = TextProps & {
6
5
  children?: ReactNode;
7
6
  };
8
- declare const SuggestionTitle: ({
9
- children,
10
- ...textProps
11
- }: SuggestionTitleProps) => import("react").JSX.Element;
7
+ declare const SuggestionTitle: ({ children, ...textProps }: SuggestionTitleProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { SuggestionTitle, SuggestionTitleProps };
14
10
  //# sourceMappingURL=SuggestionTitle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SuggestionTitle.d.ts","names":[],"sources":["../../../src/primitives/suggestion/SuggestionTitle.tsx"],"mappings":";;;;KAIY,oBAAA,GAAuB,SAAA;EACjC,QAAA,GAAW,SAAS;AAAA;AAAA,cAGT,eAAA;EAAmB,QAAA;EAAA,GAAA;AAAA,GAG7B,oBAAoB,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"SuggestionTitle.d.ts","names":[],"sources":["../../../src/primitives/suggestion/SuggestionTitle.tsx"],"mappings":";;;KAIY,uBAAuB;EACjC,WAAW;;cAGA,oBAAmB,aAAA,aAG7B,yCAAoB,IAAA"}
@@ -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,aAAAK,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;aAAYG;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"],"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,aAAAK,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,6 +1,5 @@
1
1
  import { PressableProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/suggestion/SuggestionTrigger.d.ts
5
4
  type SuggestionTriggerProps = Omit<PressableProps, "onPress"> & {
6
5
  children: ReactNode;
@@ -16,13 +15,7 @@ type SuggestionTriggerProps = Omit<PressableProps, "onPress"> & {
16
15
  */
17
16
  clearComposer?: boolean | undefined;
18
17
  };
19
- declare const SuggestionTrigger: ({
20
- children,
21
- send,
22
- clearComposer,
23
- disabled: disabledProp,
24
- ...pressableProps
25
- }: SuggestionTriggerProps) => import("react").JSX.Element;
18
+ declare const SuggestionTrigger: ({ children, send, clearComposer, disabled: disabledProp, ...pressableProps }: SuggestionTriggerProps) => import("react").JSX.Element;
26
19
  //#endregion
27
20
  export { SuggestionTrigger, SuggestionTriggerProps };
28
21
  //# sourceMappingURL=SuggestionTrigger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SuggestionTrigger.d.ts","names":[],"sources":["../../../src/primitives/suggestion/SuggestionTrigger.tsx"],"mappings":";;;;KAKY,sBAAA,GAAyB,IAAA,CAAK,cAAA;EACxC,QAAA,EAAU,SAAA;EADA;;;;EAMV,IAAA;EALU;;;;;EAWV,aAAA;AAAA;AAAA,cAGW,iBAAA;EAAqB,QAAA;EAAA,IAAA;EAAA,aAAA;EAAA,QAAA,EAAA,YAAA;EAAA,GAAA;AAAA,GAM/B,sBAAA,qBAAsB,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"SuggestionTrigger.d.ts","names":[],"sources":["../../../src/primitives/suggestion/SuggestionTrigger.tsx"],"mappings":";;;KAKY,yBAAyB,KAAK;EACxC,UAAU;;;;;EAKV;;;;;;EAMA;;cAGW,sBAAqB,UAAA,MAAA,eAAA,UAAA,iBAAA,kBAM/B,2CAAsB,IAAA"}
@@ -1,8 +1,6 @@
1
1
  import { SuggestionTitle, SuggestionTitleProps } from "./suggestion/SuggestionTitle.js";
2
2
  import { SuggestionDescription, SuggestionDescriptionProps } from "./suggestion/SuggestionDescription.js";
3
3
  import { SuggestionTrigger, SuggestionTriggerProps } from "./suggestion/SuggestionTrigger.js";
4
-
5
- //#region src/primitives/suggestion.d.ts
6
4
  declare namespace suggestion_d_exports {
7
5
  export { SuggestionDescription as Description, SuggestionDescriptionProps as DescriptionProps, SuggestionTitle as Title, SuggestionTitleProps as TitleProps, SuggestionTrigger as Trigger, SuggestionTriggerProps as TriggerProps };
8
6
  }
@@ -1,12 +1,9 @@
1
1
  import { ReactNode } from "react";
2
-
3
2
  //#region src/primitives/thread/ThreadEmpty.d.ts
4
3
  type ThreadEmptyProps = {
5
4
  children: ReactNode;
6
5
  };
7
- declare const ThreadEmpty: ({
8
- children
9
- }: ThreadEmptyProps) => import("react").JSX.Element | null;
6
+ declare const ThreadEmpty: ({ children }: ThreadEmptyProps) => import("react").JSX.Element | null;
10
7
  //#endregion
11
8
  export { ThreadEmpty, ThreadEmptyProps };
12
9
  //# sourceMappingURL=ThreadEmpty.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadEmpty.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadEmpty.tsx"],"mappings":";;;KAGY,gBAAA;EACV,QAAA,EAAU,SAAS;AAAA;AAAA,cAGR,WAAA;EAAe;AAAA,GAAc,gBAAgB,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadEmpty.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadEmpty.tsx"],"mappings":";;KAGY;EACV,UAAU;;cAGC,gBAAe,YAAc,qCAAgB,IAAA"}
@@ -1,16 +1,11 @@
1
1
  import { ReactNode } from "react";
2
-
3
2
  //#region src/primitives/thread/ThreadIf.d.ts
4
3
  type ThreadIfProps = {
5
4
  children: ReactNode;
6
5
  empty?: boolean | undefined;
7
6
  running?: boolean | undefined;
8
7
  };
9
- declare const ThreadIf: ({
10
- children,
11
- empty,
12
- running
13
- }: ThreadIfProps) => import("react").JSX.Element | null;
8
+ declare const ThreadIf: ({ children, empty, running }: ThreadIfProps) => import("react").JSX.Element | null;
14
9
  //#endregion
15
10
  export { ThreadIf, ThreadIfProps };
16
11
  //# sourceMappingURL=ThreadIf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadIf.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadIf.tsx"],"mappings":";;;KAGY,aAAA;EACV,QAAA,EAAU,SAAS;EACnB,KAAA;EACA,OAAA;AAAA;AAAA,cAGW,QAAA;EAAY,QAAA;EAAA,KAAA;EAAA;AAAA,GAA8B,aAAA,qBAAa,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadIf.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadIf.tsx"],"mappings":";;KAGY;EACV,UAAU;EACV;EACA;;cAGW,aAAY,UAAA,OAAA,WAA8B,kCAAa,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadIf.js","names":["ReactNode","useAuiState","ThreadIfProps","children","empty","running","ThreadIf","t0","$","_c","thread","_temp","undefined","isEmpty","messages","length","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\nexport const ThreadIf = ({ children, empty, running }: ThreadIfProps) => {\n const thread = useAuiState((s) => s.thread);\n\n if (empty !== undefined) {\n const isEmpty = thread.messages.length === 0;\n if (empty !== isEmpty) return null;\n }\n\n if (running !== undefined) {\n if (running !== thread.isRunning) return null;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;AASA,MAAaM,YAAWC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAN,UAAAC,OAAAC,YAAAE;CACvB,MAAAG,SAAeT,YAAYU,KAAe;CAE1C,IAAIP,UAAUQ,KAAAA;MAERR,WADYM,OAAMI,SAASC,WAAY,IACtB,OAAS;CAAA;CAGhC,IAAIV,YAAYO,KAAAA;MACVP,YAAYK,OAAMM,WAAU,OAAS;CAAA;CAC1C,IAAAC;CAAA,IAAAT,EAAA,OAAAL,UAAA;EAEMc,KAAA,oBAAA,UAAA,EAAGd,SAAQ,CAAA;EAAIK,EAAA,KAAAL;EAAAK,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAAfS;AAAe;AAZA,SAAAN,MAAAO,GAAA;CAAA,OACYA,EAACR;AAAO"}
1
+ {"version":3,"file":"ThreadIf.js","names":["ReactNode","useAuiState","ThreadIfProps","children","empty","running","ThreadIf","t0","$","_c","thread","_temp","undefined","isEmpty","messages","length","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\nexport const ThreadIf = ({ children, empty, running }: ThreadIfProps) => {\n const thread = useAuiState((s) => s.thread);\n\n if (empty !== undefined) {\n const isEmpty = thread.messages.length === 0;\n if (empty !== isEmpty) return null;\n }\n\n if (running !== undefined) {\n if (running !== thread.isRunning) return null;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;AASA,MAAaM,YAAWC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAN,UAAAC,OAAAC,YAAAE;CACvB,MAAAG,SAAeT,YAAYU,KAAe;CAE1C,IAAIP,UAAUQ,KAAAA,GAERR;MAAAA,WADYM,OAAMI,SAASC,WAAY,IACtB,OAAS;CAAA;CAGhC,IAAIV,YAAYO,KAAAA,GACVP;MAAAA,YAAYK,OAAMM,WAAU,OAAS;CAAA;CAC1C,IAAAC;CAAA,IAAAT,EAAA,OAAAL,UAAA;EAEMc,KAAA,oBAAA,UAAA,EAAGd,SAAQ,CAAA;EAAIK,EAAA,KAAAL;EAAAK,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAAfS;AAAe;AAZA,SAAAN,MAAAO,GAAA;CAAA,OACYA,EAACR;AAAO"}