@assistant-ui/react-native 0.1.29 → 0.1.30

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 (118) 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/ActionBarEdit.d.ts +1 -6
  5. package/dist/primitives/actionBar/ActionBarEdit.d.ts.map +1 -1
  6. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts +1 -5
  7. package/dist/primitives/actionBar/ActionBarFeedbackNegative.d.ts.map +1 -1
  8. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts +1 -5
  9. package/dist/primitives/actionBar/ActionBarFeedbackPositive.d.ts.map +1 -1
  10. package/dist/primitives/actionBar/ActionBarReload.d.ts +1 -6
  11. package/dist/primitives/actionBar/ActionBarReload.d.ts.map +1 -1
  12. package/dist/primitives/actionBar.d.ts +0 -2
  13. package/dist/primitives/attachment/AttachmentName.d.ts +0 -1
  14. package/dist/primitives/attachment/AttachmentName.d.ts.map +1 -1
  15. package/dist/primitives/attachment/AttachmentRemove.d.ts +1 -5
  16. package/dist/primitives/attachment/AttachmentRemove.d.ts.map +1 -1
  17. package/dist/primitives/attachment/AttachmentRoot.d.ts +1 -5
  18. package/dist/primitives/attachment/AttachmentRoot.d.ts.map +1 -1
  19. package/dist/primitives/attachment/AttachmentThumb.d.ts +0 -1
  20. package/dist/primitives/attachment/AttachmentThumb.d.ts.map +1 -1
  21. package/dist/primitives/attachment.d.ts +0 -2
  22. package/dist/primitives/branchPicker/BranchPickerCount.d.ts +0 -1
  23. package/dist/primitives/branchPicker/BranchPickerCount.d.ts.map +1 -1
  24. package/dist/primitives/branchPicker/BranchPickerNext.d.ts +1 -6
  25. package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
  26. package/dist/primitives/branchPicker/BranchPickerNumber.d.ts +0 -1
  27. package/dist/primitives/branchPicker/BranchPickerNumber.d.ts.map +1 -1
  28. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts +1 -6
  29. package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
  30. package/dist/primitives/branchPicker.d.ts +0 -2
  31. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts +1 -5
  32. package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts.map +1 -1
  33. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts +1 -5
  34. package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts.map +1 -1
  35. package/dist/primitives/chainOfThought.d.ts +0 -2
  36. package/dist/primitives/composer/ComposerAddAttachment.d.ts +1 -6
  37. package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
  38. package/dist/primitives/composer/ComposerAttachments.d.ts +3 -16
  39. package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -1
  40. package/dist/primitives/composer/ComposerAttachments.js.map +1 -1
  41. package/dist/primitives/composer/ComposerCancel.d.ts +1 -6
  42. package/dist/primitives/composer/ComposerCancel.d.ts.map +1 -1
  43. package/dist/primitives/composer/ComposerInput.d.ts +1 -8
  44. package/dist/primitives/composer/ComposerInput.d.ts.map +1 -1
  45. package/dist/primitives/composer/ComposerInput.js +15 -2
  46. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  47. package/dist/primitives/composer/ComposerRoot.d.ts +1 -5
  48. package/dist/primitives/composer/ComposerRoot.d.ts.map +1 -1
  49. package/dist/primitives/composer/ComposerSend.d.ts +1 -6
  50. package/dist/primitives/composer/ComposerSend.d.ts.map +1 -1
  51. package/dist/primitives/composer.d.ts +3 -5
  52. package/dist/primitives/composer.js.map +1 -1
  53. package/dist/primitives/error/ErrorMessage.d.ts +1 -5
  54. package/dist/primitives/error/ErrorMessage.d.ts.map +1 -1
  55. package/dist/primitives/error/ErrorRoot.d.ts +1 -5
  56. package/dist/primitives/error/ErrorRoot.d.ts.map +1 -1
  57. package/dist/primitives/error/index.d.ts +0 -2
  58. package/dist/primitives/message/MessageAttachments.d.ts +2 -9
  59. package/dist/primitives/message/MessageAttachments.d.ts.map +1 -1
  60. package/dist/primitives/message/MessageAttachments.js.map +1 -1
  61. package/dist/primitives/message/MessageContent.d.ts +1 -10
  62. package/dist/primitives/message/MessageContent.d.ts.map +1 -1
  63. package/dist/primitives/message/MessageIf.d.ts +1 -8
  64. package/dist/primitives/message/MessageIf.d.ts.map +1 -1
  65. package/dist/primitives/message/MessageParts.d.ts +0 -1
  66. package/dist/primitives/message/MessageParts.d.ts.map +1 -1
  67. package/dist/primitives/message/MessageRoot.d.ts +1 -5
  68. package/dist/primitives/message/MessageRoot.d.ts.map +1 -1
  69. package/dist/primitives/message.d.ts +3 -5
  70. package/dist/primitives/message.js.map +1 -1
  71. package/dist/primitives/suggestion/SuggestionDescription.d.ts +1 -5
  72. package/dist/primitives/suggestion/SuggestionDescription.d.ts.map +1 -1
  73. package/dist/primitives/suggestion/SuggestionTitle.d.ts +1 -5
  74. package/dist/primitives/suggestion/SuggestionTitle.d.ts.map +1 -1
  75. package/dist/primitives/suggestion/SuggestionTrigger.d.ts +1 -8
  76. package/dist/primitives/suggestion/SuggestionTrigger.d.ts.map +1 -1
  77. package/dist/primitives/suggestion.d.ts +0 -2
  78. package/dist/primitives/thread/ThreadEmpty.d.ts +1 -4
  79. package/dist/primitives/thread/ThreadEmpty.d.ts.map +1 -1
  80. package/dist/primitives/thread/ThreadIf.d.ts +1 -6
  81. package/dist/primitives/thread/ThreadIf.d.ts.map +1 -1
  82. package/dist/primitives/thread/ThreadMessages.d.ts +4 -11
  83. package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
  84. package/dist/primitives/thread/ThreadMessages.js +11 -9
  85. package/dist/primitives/thread/ThreadMessages.js.map +1 -1
  86. package/dist/primitives/thread/ThreadRoot.d.ts +1 -5
  87. package/dist/primitives/thread/ThreadRoot.d.ts.map +1 -1
  88. package/dist/primitives/thread/ThreadSuggestion.d.ts +3 -10
  89. package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
  90. package/dist/primitives/thread.d.ts +0 -2
  91. package/dist/primitives/threadList/ThreadListItems.d.ts +1 -5
  92. package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -1
  93. package/dist/primitives/threadList/ThreadListNew.d.ts +1 -5
  94. package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
  95. package/dist/primitives/threadList/ThreadListRoot.d.ts +1 -5
  96. package/dist/primitives/threadList/ThreadListRoot.d.ts.map +1 -1
  97. package/dist/primitives/threadList.d.ts +0 -2
  98. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +1 -5
  99. package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
  100. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +1 -5
  101. package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts.map +1 -1
  102. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts +1 -5
  103. package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -1
  104. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +1 -5
  105. package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -1
  106. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +1 -5
  107. package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -1
  108. package/dist/primitives/threadListItem.d.ts +0 -2
  109. package/package.json +7 -7
  110. package/src/index.ts +2 -0
  111. package/src/primitives/composer/ComposerAttachments.tsx +3 -15
  112. package/src/primitives/composer/ComposerInput.test.tsx +106 -8
  113. package/src/primitives/composer/ComposerInput.tsx +21 -2
  114. package/src/primitives/composer.ts +2 -0
  115. package/src/primitives/message/MessageAttachments.tsx +3 -8
  116. package/src/primitives/message.ts +2 -0
  117. package/src/primitives/thread/ThreadMessages.test.tsx +21 -1
  118. package/src/primitives/thread/ThreadMessages.tsx +7 -6
@@ -1,9 +1,9 @@
1
1
  import { PressableProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/thread/ThreadSuggestion.d.ts
5
4
  type ThreadSuggestionProps = Omit<PressableProps, "onPress"> & {
6
- children: ReactNode; /** The suggestion prompt. */
5
+ children: ReactNode;
6
+ /** The suggestion prompt. */
7
7
  prompt: string;
8
8
  /**
9
9
  * When true, automatically sends the message.
@@ -17,14 +17,7 @@ type ThreadSuggestionProps = Omit<PressableProps, "onPress"> & {
17
17
  */
18
18
  clearComposer?: boolean | undefined;
19
19
  };
20
- declare const ThreadSuggestion: ({
21
- children,
22
- prompt,
23
- send,
24
- clearComposer,
25
- disabled: disabledProp,
26
- ...pressableProps
27
- }: ThreadSuggestionProps) => import("react").JSX.Element;
20
+ declare const ThreadSuggestion: ({ children, prompt, send, clearComposer, disabled: disabledProp, ...pressableProps }: ThreadSuggestionProps) => import("react").JSX.Element;
28
21
  //#endregion
29
22
  export { ThreadSuggestion, ThreadSuggestionProps };
30
23
  //# sourceMappingURL=ThreadSuggestion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadSuggestion.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadSuggestion.tsx"],"mappings":";;;;KAIY,qBAAA,GAAwB,IAAA,CAAK,cAAA;EACvC,QAAA,EAAU,SAAA,EADA;EAGV,MAAA;;;;;EAKA,IAAA;EAPmB;;;;;EAanB,aAAA;AAAA;AAAA,cAGW,gBAAA;EAAoB,QAAA;EAAA,MAAA;EAAA,IAAA;EAAA,aAAA;EAAA,QAAA,EAAA,YAAA;EAAA,GAAA;AAAA,GAO9B,qBAAA,qBAAqB,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadSuggestion.d.ts","names":[],"sources":["../../../src/primitives/thread/ThreadSuggestion.tsx"],"mappings":";;;KAIY,wBAAwB,KAAK;EACvC,UAAU;;EAEV;;;;;EAKA;;;;;;EAMA;;cAGW,qBAAoB,UAAA,QAAA,MAAA,eAAA,UAAA,iBAAA,kBAO9B,0CAAqB,IAAA"}
@@ -4,8 +4,6 @@ import { ThreadEmpty, ThreadEmptyProps } from "./thread/ThreadEmpty.js";
4
4
  import { ThreadIf, ThreadIfProps } from "./thread/ThreadIf.js";
5
5
  import { ThreadSuggestion, ThreadSuggestionProps } from "./thread/ThreadSuggestion.js";
6
6
  import { ThreadPrimitiveMessageByIndex as MessageByIndex, ThreadPrimitiveSuggestionByIndex as SuggestionByIndex, ThreadPrimitiveSuggestions as Suggestions, ThreadPrimitiveUnstable_MessageById as Unstable_MessageById } from "@assistant-ui/core/react";
7
-
8
- //#region src/primitives/thread.d.ts
9
7
  declare namespace thread_d_exports {
10
8
  export { ThreadEmpty as Empty, ThreadEmptyProps as EmptyProps, ThreadIf as If, ThreadIfProps as IfProps, MessageByIndex, ThreadMessages as Messages, ThreadMessagesProps as MessagesProps, ThreadRoot as Root, ThreadRootProps as RootProps, ThreadSuggestion as Suggestion, SuggestionByIndex, ThreadSuggestionProps as SuggestionProps, Suggestions, Unstable_MessageById };
11
9
  }
@@ -1,6 +1,5 @@
1
1
  import { FlatListProps } from "react-native";
2
2
  import { ReactElement } from "react";
3
-
4
3
  //#region src/primitives/threadList/ThreadListItems.d.ts
5
4
  type ThreadListItemsProps = Omit<FlatListProps<string>, "data" | "renderItem"> & {
6
5
  renderItem: (props: {
@@ -8,10 +7,7 @@ type ThreadListItemsProps = Omit<FlatListProps<string>, "data" | "renderItem"> &
8
7
  index: number;
9
8
  }) => ReactElement;
10
9
  };
11
- declare const ThreadListItems: ({
12
- renderItem,
13
- ...flatListProps
14
- }: ThreadListItemsProps) => import("react").JSX.Element;
10
+ declare const ThreadListItems: ({ renderItem, ...flatListProps }: ThreadListItemsProps) => import("react").JSX.Element;
15
11
  //#endregion
16
12
  export { ThreadListItems, ThreadListItemsProps };
17
13
  //# sourceMappingURL=ThreadListItems.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItems.d.ts","names":[],"sources":["../../../src/primitives/threadList/ThreadListItems.tsx"],"mappings":";;;;KAIY,oBAAA,GAAuB,IAAA,CACjC,aAAA;EAGA,UAAA,GAAa,KAAA;IAAS,QAAA;IAAkB,KAAA;EAAA,MAAoB,YAAA;AAAA;AAAA,cAGjD,eAAA;EAAmB,UAAA;EAAA,GAAA;AAAA,GAG7B,oBAAoB,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadListItems.d.ts","names":[],"sources":["../../../src/primitives/threadList/ThreadListItems.tsx"],"mappings":";;;KAIY,uBAAuB,KACjC;EAGA,aAAa;IAAS;IAAkB;QAAoB;;cAGjD,oBAAmB,eAAA,iBAG7B,yCAAoB,IAAA"}
@@ -1,14 +1,10 @@
1
1
  import { PressableProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/threadList/ThreadListNew.d.ts
5
4
  type ThreadListNewProps = Omit<PressableProps, "onPress"> & {
6
5
  children: ReactNode;
7
6
  };
8
- declare const ThreadListNew: ({
9
- children,
10
- ...pressableProps
11
- }: ThreadListNewProps) => import("react").JSX.Element;
7
+ declare const ThreadListNew: ({ children, ...pressableProps }: ThreadListNewProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { ThreadListNew, ThreadListNewProps };
14
10
  //# sourceMappingURL=ThreadListNew.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListNew.d.ts","names":[],"sources":["../../../src/primitives/threadList/ThreadListNew.tsx"],"mappings":";;;;KAIY,kBAAA,GAAqB,IAAA,CAAK,cAAA;EACpC,QAAA,EAAU,SAAA;AAAA;AAAA,cAGC,aAAA;EAAiB,QAAA;EAAA,GAAA;AAAA,GAG3B,kBAAkB,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadListNew.d.ts","names":[],"sources":["../../../src/primitives/threadList/ThreadListNew.tsx"],"mappings":";;;KAIY,qBAAqB,KAAK;EACpC,UAAU;;cAGC,kBAAiB,aAAA,kBAG3B,uCAAkB,IAAA"}
@@ -1,14 +1,10 @@
1
1
  import { ViewProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/threadList/ThreadListRoot.d.ts
5
4
  type ThreadListRootProps = ViewProps & {
6
5
  children: ReactNode;
7
6
  };
8
- declare const ThreadListRoot: ({
9
- children,
10
- ...viewProps
11
- }: ThreadListRootProps) => import("react").JSX.Element;
7
+ declare const ThreadListRoot: ({ children, ...viewProps }: ThreadListRootProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { ThreadListRoot, ThreadListRootProps };
14
10
  //# sourceMappingURL=ThreadListRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListRoot.d.ts","names":[],"sources":["../../../src/primitives/threadList/ThreadListRoot.tsx"],"mappings":";;;;KAGY,mBAAA,GAAsB,SAAA;EAChC,QAAA,EAAU,SAAS;AAAA;AAAA,cAGR,cAAA;EAAkB,QAAA;EAAA,GAAA;AAAA,GAG5B,mBAAmB,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadListRoot.d.ts","names":[],"sources":["../../../src/primitives/threadList/ThreadListRoot.tsx"],"mappings":";;;KAGY,sBAAsB;EAChC,UAAU;;cAGC,mBAAkB,aAAA,aAG5B,wCAAmB,IAAA"}
@@ -1,8 +1,6 @@
1
1
  import { ThreadListRoot, ThreadListRootProps } from "./threadList/ThreadListRoot.js";
2
2
  import { ThreadListItems, ThreadListItemsProps } from "./threadList/ThreadListItems.js";
3
3
  import { ThreadListNew, ThreadListNewProps } from "./threadList/ThreadListNew.js";
4
-
5
- //#region src/primitives/threadList.d.ts
6
4
  declare namespace threadList_d_exports {
7
5
  export { ThreadListItems as Items, ThreadListItemsProps as ItemsProps, ThreadListNew as New, ThreadListNewProps as NewProps, ThreadListRoot as Root, ThreadListRootProps as RootProps };
8
6
  }
@@ -1,14 +1,10 @@
1
1
  import { PressableProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/threadListItem/ThreadListItemArchive.d.ts
5
4
  type ThreadListItemArchiveProps = Omit<PressableProps, "onPress"> & {
6
5
  children: ReactNode;
7
6
  };
8
- declare const ThreadListItemArchive: ({
9
- children,
10
- ...pressableProps
11
- }: ThreadListItemArchiveProps) => import("react").JSX.Element;
7
+ declare const ThreadListItemArchive: ({ children, ...pressableProps }: ThreadListItemArchiveProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { ThreadListItemArchive, ThreadListItemArchiveProps };
14
10
  //# sourceMappingURL=ThreadListItemArchive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemArchive.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemArchive.tsx"],"mappings":";;;;KAIY,0BAAA,GAA6B,IAAA,CAAK,cAAA;EAC5C,QAAA,EAAU,SAAA;AAAA;AAAA,cAGC,qBAAA;EAAyB,QAAA;EAAA,GAAA;AAAA,GAGnC,0BAA0B,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadListItemArchive.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemArchive.tsx"],"mappings":";;;KAIY,6BAA6B,KAAK;EAC5C,UAAU;;cAGC,0BAAyB,aAAA,kBAGnC,+CAA0B,IAAA"}
@@ -1,14 +1,10 @@
1
1
  import { PressableProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/threadListItem/ThreadListItemDelete.d.ts
5
4
  type ThreadListItemDeleteProps = Omit<PressableProps, "onPress"> & {
6
5
  children: ReactNode;
7
6
  };
8
- declare const ThreadListItemDelete: ({
9
- children,
10
- ...pressableProps
11
- }: ThreadListItemDeleteProps) => import("react").JSX.Element;
7
+ declare const ThreadListItemDelete: ({ children, ...pressableProps }: ThreadListItemDeleteProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { ThreadListItemDelete, ThreadListItemDeleteProps };
14
10
  //# sourceMappingURL=ThreadListItemDelete.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemDelete.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemDelete.tsx"],"mappings":";;;;KAIY,yBAAA,GAA4B,IAAA,CAAK,cAAA;EAC3C,QAAA,EAAU,SAAA;AAAA;AAAA,cAGC,oBAAA;EAAwB,QAAA;EAAA,GAAA;AAAA,GAGlC,yBAAyB,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadListItemDelete.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemDelete.tsx"],"mappings":";;;KAIY,4BAA4B,KAAK;EAC3C,UAAU;;cAGC,yBAAwB,aAAA,kBAGlC,8CAAyB,IAAA"}
@@ -1,14 +1,10 @@
1
1
  import { ViewProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/threadListItem/ThreadListItemRoot.d.ts
5
4
  type ThreadListItemRootProps = ViewProps & {
6
5
  children: ReactNode;
7
6
  };
8
- declare const ThreadListItemRoot: ({
9
- children,
10
- ...viewProps
11
- }: ThreadListItemRootProps) => import("react").JSX.Element;
7
+ declare const ThreadListItemRoot: ({ children, ...viewProps }: ThreadListItemRootProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { ThreadListItemRoot, ThreadListItemRootProps };
14
10
  //# sourceMappingURL=ThreadListItemRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemRoot.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemRoot.tsx"],"mappings":";;;;KAGY,uBAAA,GAA0B,SAAA;EACpC,QAAA,EAAU,SAAS;AAAA;AAAA,cAGR,kBAAA;EAAsB,QAAA;EAAA,GAAA;AAAA,GAGhC,uBAAuB,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadListItemRoot.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemRoot.tsx"],"mappings":";;;KAGY,0BAA0B;EACpC,UAAU;;cAGC,uBAAsB,aAAA,aAGhC,4CAAuB,IAAA"}
@@ -1,14 +1,10 @@
1
1
  import { PressableProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/threadListItem/ThreadListItemTrigger.d.ts
5
4
  type ThreadListItemTriggerProps = Omit<PressableProps, "onPress"> & {
6
5
  children: ReactNode;
7
6
  };
8
- declare const ThreadListItemTrigger: ({
9
- children,
10
- ...pressableProps
11
- }: ThreadListItemTriggerProps) => import("react").JSX.Element;
7
+ declare const ThreadListItemTrigger: ({ children, ...pressableProps }: ThreadListItemTriggerProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { ThreadListItemTrigger, ThreadListItemTriggerProps };
14
10
  //# sourceMappingURL=ThreadListItemTrigger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemTrigger.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemTrigger.tsx"],"mappings":";;;;KAIY,0BAAA,GAA6B,IAAA,CAAK,cAAA;EAC5C,QAAA,EAAU,SAAA;AAAA;AAAA,cAGC,qBAAA;EAAyB,QAAA;EAAA,GAAA;AAAA,GAGnC,0BAA0B,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadListItemTrigger.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemTrigger.tsx"],"mappings":";;;KAIY,6BAA6B,KAAK;EAC5C,UAAU;;cAGC,0BAAyB,aAAA,kBAGnC,+CAA0B,IAAA"}
@@ -1,14 +1,10 @@
1
1
  import { PressableProps } from "react-native";
2
2
  import { ReactNode } from "react";
3
-
4
3
  //#region src/primitives/threadListItem/ThreadListItemUnarchive.d.ts
5
4
  type ThreadListItemUnarchiveProps = Omit<PressableProps, "onPress"> & {
6
5
  children: ReactNode;
7
6
  };
8
- declare const ThreadListItemUnarchive: ({
9
- children,
10
- ...pressableProps
11
- }: ThreadListItemUnarchiveProps) => import("react").JSX.Element;
7
+ declare const ThreadListItemUnarchive: ({ children, ...pressableProps }: ThreadListItemUnarchiveProps) => import("react").JSX.Element;
12
8
  //#endregion
13
9
  export { ThreadListItemUnarchive, ThreadListItemUnarchiveProps };
14
10
  //# sourceMappingURL=ThreadListItemUnarchive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadListItemUnarchive.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemUnarchive.tsx"],"mappings":";;;;KAIY,4BAAA,GAA+B,IAAA,CAAK,cAAA;EAC9C,QAAA,EAAU,SAAA;AAAA;AAAA,cAGC,uBAAA;EAA2B,QAAA;EAAA,GAAA;AAAA,GAGrC,4BAA4B,qBAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ThreadListItemUnarchive.d.ts","names":[],"sources":["../../../src/primitives/threadListItem/ThreadListItemUnarchive.tsx"],"mappings":";;;KAIY,+BAA+B,KAAK;EAC9C,UAAU;;cAGC,4BAA2B,aAAA,kBAGrC,iDAA4B,IAAA"}
@@ -4,8 +4,6 @@ import { ThreadListItemDelete, ThreadListItemDeleteProps } from "./threadListIte
4
4
  import { ThreadListItemArchive, ThreadListItemArchiveProps } from "./threadListItem/ThreadListItemArchive.js";
5
5
  import { ThreadListItemUnarchive, ThreadListItemUnarchiveProps } from "./threadListItem/ThreadListItemUnarchive.js";
6
6
  import { ThreadListItemPrimitiveTitle as Title } from "@assistant-ui/core/react";
7
-
8
- //#region src/primitives/threadListItem.d.ts
9
7
  declare namespace threadListItem_d_exports {
10
8
  export { ThreadListItemArchive as Archive, ThreadListItemArchiveProps as ArchiveProps, ThreadListItemDelete as Delete, ThreadListItemDeleteProps as DeleteProps, ThreadListItemRoot as Root, ThreadListItemRootProps as RootProps, Title, ThreadListItemTrigger as Trigger, ThreadListItemTriggerProps as TriggerProps, ThreadListItemUnarchive as Unarchive, ThreadListItemUnarchiveProps as UnarchiveProps };
11
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/react-native",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "React Native bindings for assistant-ui",
5
5
  "keywords": [
6
6
  "assistant",
@@ -31,10 +31,10 @@
31
31
  ],
32
32
  "sideEffects": false,
33
33
  "dependencies": {
34
- "@assistant-ui/core": "^0.2.19",
35
- "@assistant-ui/store": "^0.2.19",
36
- "@assistant-ui/tap": "^0.9.3",
37
- "assistant-stream": "^0.3.24",
34
+ "@assistant-ui/core": "^0.2.21",
35
+ "@assistant-ui/store": "^0.2.20",
36
+ "@assistant-ui/tap": "^0.9.4",
37
+ "assistant-stream": "^0.3.26",
38
38
  "zustand": "^5.0.14"
39
39
  },
40
40
  "peerDependencies": {
@@ -55,8 +55,8 @@
55
55
  "react-dom": "^19.2.7",
56
56
  "react-native": "^0.86.0",
57
57
  "react-native-web": "^0.21.2",
58
- "vitest": "^4.1.9",
59
- "@assistant-ui/x-buildutils": "0.0.17"
58
+ "vitest": "^4.1.10",
59
+ "@assistant-ui/x-buildutils": "0.0.18"
60
60
  },
61
61
  "publishConfig": {
62
62
  "access": "public",
package/src/index.ts CHANGED
@@ -181,7 +181,9 @@ export {
181
181
  providerTool,
182
182
  type ProviderToolConfig,
183
183
  defineMcpToolkit,
184
+ type McpToolkitEntry,
184
185
  type McpToolkitDefinition,
186
+ type McpToolkitToolConfig,
185
187
  Tools,
186
188
  DataRenderers,
187
189
  Interactables,
@@ -1,24 +1,12 @@
1
- import type { ComponentType } from "react";
2
1
  import {
3
2
  ComposerPrimitiveAttachments,
4
3
  ComposerPrimitiveAttachmentByIndex,
5
4
  } from "@assistant-ui/core/react";
6
5
 
7
- export type AttachmentComponents = {
8
- Image?: ComponentType | undefined;
9
- Document?: ComponentType | undefined;
10
- File?: ComponentType | undefined;
11
- Attachment?: ComponentType | undefined;
12
- };
6
+ export type ComposerAttachmentsProps = ComposerPrimitiveAttachments.Props;
13
7
 
14
- export type ComposerAttachmentsProps = {
15
- components: AttachmentComponents | undefined;
16
- };
17
-
18
- export type ComposerAttachmentByIndexProps = {
19
- index: number;
20
- components?: AttachmentComponents | undefined;
21
- };
8
+ export type ComposerAttachmentByIndexProps =
9
+ ComposerPrimitiveAttachmentByIndex.Props;
22
10
 
23
11
  export const ComposerAttachmentByIndex = ComposerPrimitiveAttachmentByIndex;
24
12
 
@@ -49,21 +49,28 @@ vi.mock("react-native", async (importOriginal) => {
49
49
 
50
50
  (globalThis as Record<string, unknown>).IS_REACT_ACT_ENVIRONMENT = true;
51
51
 
52
- const setNativeValue = (input: HTMLInputElement, value: string) => {
53
- const setter = Object.getOwnPropertyDescriptor(
54
- HTMLInputElement.prototype,
55
- "value",
56
- )?.set;
52
+ const setNativeValue = (
53
+ input: HTMLInputElement | HTMLTextAreaElement,
54
+ value: string,
55
+ ) => {
56
+ const prototype =
57
+ input instanceof HTMLTextAreaElement
58
+ ? HTMLTextAreaElement.prototype
59
+ : HTMLInputElement.prototype;
60
+ const setter = Object.getOwnPropertyDescriptor(prototype, "value")?.set;
57
61
  setter?.call(input, value);
58
62
  };
59
63
 
60
- const fireInput = (input: HTMLInputElement, value: string) => {
64
+ const fireInput = (
65
+ input: HTMLInputElement | HTMLTextAreaElement,
66
+ value: string,
67
+ ) => {
61
68
  setNativeValue(input, value);
62
69
  input.dispatchEvent(new InputEvent("input", { bubbles: true }));
63
70
  };
64
71
 
65
72
  const fireKeyDown = (
66
- input: HTMLInputElement,
73
+ input: HTMLInputElement | HTMLTextAreaElement,
67
74
  opts: {
68
75
  key?: string;
69
76
  shiftKey?: boolean;
@@ -114,7 +121,9 @@ describe("ComposerInput", () => {
114
121
  await act(async () => {
115
122
  root.render(<ComposerInput {...props} />);
116
123
  });
117
- const input = container.querySelector("input") as HTMLInputElement;
124
+ const input = container.querySelector("textarea, input") as
125
+ | HTMLInputElement
126
+ | HTMLTextAreaElement;
118
127
  expect(input).not.toBeNull();
119
128
  return input;
120
129
  };
@@ -207,6 +216,95 @@ describe("ComposerInput", () => {
207
216
  expect(event.defaultPrevented).toBe(false);
208
217
  });
209
218
 
219
+ it("shows a scrollbar when multiline content exceeds the maximum height", async () => {
220
+ h.composerState.text = "line 1";
221
+ const input = await mount({
222
+ multiline: true,
223
+ style: { maxHeight: 40 },
224
+ });
225
+ expect(input.tagName).toBe("TEXTAREA");
226
+
227
+ Object.defineProperty(input, "scrollHeight", {
228
+ configurable: true,
229
+ value: 120,
230
+ });
231
+
232
+ h.composerState.text = "line 1\nline 2\nline 3";
233
+ await act(async () => {
234
+ root.render(<ComposerInput multiline style={{ maxHeight: 40 }} />);
235
+ });
236
+
237
+ expect(input.style.height).toBe("40px");
238
+ expect(input.style.overflowY).toBe("auto");
239
+ expect(input.style.overflowX).toBe("hidden");
240
+ });
241
+
242
+ it("shrinks back below max height after content is deleted", async () => {
243
+ h.composerState.text = "line 1";
244
+ const input = await mount({
245
+ multiline: true,
246
+ style: { maxHeight: 40 },
247
+ });
248
+ expect(input.tagName).toBe("TEXTAREA");
249
+
250
+ let scrollHeight = 120;
251
+ Object.defineProperty(input, "scrollHeight", {
252
+ configurable: true,
253
+ get: () => scrollHeight,
254
+ });
255
+
256
+ h.composerState.text = "line 1\nline 2\nline 3";
257
+ await act(async () => {
258
+ root.render(<ComposerInput multiline style={{ maxHeight: 40 }} />);
259
+ });
260
+
261
+ expect(input.style.height).toBe("40px");
262
+ expect(input.style.overflowY).toBe("auto");
263
+
264
+ scrollHeight = 24;
265
+ h.composerState.text = "line 1";
266
+ await act(async () => {
267
+ root.render(<ComposerInput multiline style={{ maxHeight: 40 }} />);
268
+ });
269
+
270
+ expect(input.style.height).toBe("24px");
271
+ expect(input.style.overflowY).toBe("hidden");
272
+ });
273
+
274
+ it("prefers computed maxHeight over raw CSS unit parsing", async () => {
275
+ h.composerState.text = "line 1";
276
+ const computedStyleSpy = vi
277
+ .spyOn(globalThis, "getComputedStyle")
278
+ .mockImplementation((() => ({
279
+ maxHeight: "64px",
280
+ })) as unknown as typeof getComputedStyle);
281
+
282
+ try {
283
+ const input = await mount({
284
+ multiline: true,
285
+ style: { maxHeight: "4rem" as never },
286
+ });
287
+ expect(input.tagName).toBe("TEXTAREA");
288
+
289
+ Object.defineProperty(input, "scrollHeight", {
290
+ configurable: true,
291
+ value: 80,
292
+ });
293
+
294
+ h.composerState.text = "line 1\nline 2\nline 3";
295
+ await act(async () => {
296
+ root.render(
297
+ <ComposerInput multiline style={{ maxHeight: "4rem" as never }} />,
298
+ );
299
+ });
300
+
301
+ expect(input.style.height).toBe("64px");
302
+ expect(input.style.overflowY).toBe("auto");
303
+ } finally {
304
+ computedStyleSpy.mockRestore();
305
+ }
306
+ });
307
+
210
308
  it("forwards keydown events to a consumer onKeyPress handler", async () => {
211
309
  const onKeyPress = vi.fn();
212
310
  const input = await mount({ onKeyPress });
@@ -22,6 +22,15 @@ export type ComposerInputProps = Omit<
22
22
  submitMode?: "enter" | "none";
23
23
  };
24
24
 
25
+ const getWebTextareaMaxHeight = (el: HTMLTextAreaElement) => {
26
+ const computedMaxHeight = globalThis.getComputedStyle?.(el).maxHeight;
27
+ const parsedComputedMaxHeight = Number.parseFloat(computedMaxHeight ?? "");
28
+ if (Number.isFinite(parsedComputedMaxHeight)) return parsedComputedMaxHeight;
29
+
30
+ const inlineMaxHeight = Number.parseFloat(el.style.maxHeight);
31
+ return Number.isFinite(inlineMaxHeight) ? inlineMaxHeight : null;
32
+ };
33
+
25
34
  const adjustWebTextareaHeight = (ref: React.RefObject<TextInput | null>) => {
26
35
  if (Platform.OS !== "web") return;
27
36
  // On web, the TextInput ref IS the DOM element
@@ -29,9 +38,19 @@ const adjustWebTextareaHeight = (ref: React.RefObject<TextInput | null>) => {
29
38
  if (!el) return;
30
39
  // Ensure rows=1 so scrollHeight reflects actual content
31
40
  if (el.rows !== 1) el.rows = 1;
32
- el.style.overflow = "hidden";
41
+
42
+ el.style.overflowX = "hidden";
43
+ el.style.overflowY = "hidden";
33
44
  el.style.height = "auto";
34
- el.style.height = `${el.scrollHeight}px`;
45
+
46
+ const scrollHeight = el.scrollHeight;
47
+ const maxHeight = getWebTextareaMaxHeight(el);
48
+ const needsScrollbar = maxHeight !== null && scrollHeight > maxHeight;
49
+ const nextHeight =
50
+ maxHeight === null ? scrollHeight : Math.min(scrollHeight, maxHeight);
51
+
52
+ el.style.overflowY = needsScrollbar ? "auto" : "hidden";
53
+ el.style.height = `${nextHeight}px`;
35
54
  };
36
55
 
37
56
  export const ComposerInput = ({
@@ -4,7 +4,9 @@ export {
4
4
  } from "./composer/ComposerRoot";
5
5
  export {
6
6
  ComposerAttachments as Attachments,
7
+ type ComposerAttachmentsProps as AttachmentsProps,
7
8
  ComposerAttachmentByIndex as AttachmentByIndex,
9
+ type ComposerAttachmentByIndexProps as AttachmentByIndexProps,
8
10
  } from "./composer/ComposerAttachments";
9
11
  export {
10
12
  ComposerInput as Input,
@@ -2,16 +2,11 @@ import {
2
2
  MessagePrimitiveAttachments,
3
3
  MessagePrimitiveAttachmentByIndex,
4
4
  } from "@assistant-ui/core/react";
5
- import type { AttachmentComponents } from "../composer/ComposerAttachments";
6
5
 
7
- export type MessageAttachmentsProps = {
8
- components: AttachmentComponents | undefined;
9
- };
6
+ export type MessageAttachmentsProps = MessagePrimitiveAttachments.Props;
10
7
 
11
- export type MessageAttachmentByIndexProps = {
12
- index: number;
13
- components?: AttachmentComponents | undefined;
14
- };
8
+ export type MessageAttachmentByIndexProps =
9
+ MessagePrimitiveAttachmentByIndex.Props;
15
10
 
16
11
  export const MessageAttachmentByIndex = MessagePrimitiveAttachmentByIndex;
17
12
 
@@ -17,5 +17,7 @@ export {
17
17
  } from "./message/MessageIf";
18
18
  export {
19
19
  MessageAttachments as Attachments,
20
+ type MessageAttachmentsProps as AttachmentsProps,
20
21
  MessageAttachmentByIndex as AttachmentByIndex,
22
+ type MessageAttachmentByIndexProps as AttachmentByIndexProps,
21
23
  } from "./message/MessageAttachments";
@@ -1,6 +1,8 @@
1
- import { act } from "react";
1
+ import { act, createRef } from "react";
2
2
  import { createRoot, type Root } from "react-dom/client";
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
4
+ import type { FlatList } from "react-native";
5
+ import type { ThreadMessage } from "@assistant-ui/core";
4
6
  import { ThreadMessages } from "./ThreadMessages";
5
7
 
6
8
  type Msg = { id: string; role: string };
@@ -189,4 +191,22 @@ describe("ThreadMessages", () => {
189
191
  });
190
192
  expect(container.querySelector('[data-testid="c-message"]')).toBeNull();
191
193
  });
194
+
195
+ it("forwards refs to the underlying FlatList", async () => {
196
+ h.state.thread.messages = [{ id: "1", role: "user" }];
197
+ const ref = createRef<FlatList<ThreadMessage>>();
198
+
199
+ await act(async () => {
200
+ root.render(
201
+ <ThreadMessages
202
+ ref={ref}
203
+ components={{
204
+ Message: () => <span data-testid="c-message">message</span>,
205
+ }}
206
+ />,
207
+ );
208
+ });
209
+
210
+ expect(ref.current).not.toBeNull();
211
+ });
192
212
  });
@@ -2,6 +2,7 @@ import {
2
2
  type ComponentType,
3
3
  type FC,
4
4
  type ReactNode,
5
+ forwardRef,
5
6
  memo,
6
7
  useCallback,
7
8
  } from "react";
@@ -154,11 +155,10 @@ const ThreadMessageByChildren = memo(
154
155
  );
155
156
  ThreadMessageByChildren.displayName = "ThreadPrimitive.MessageByChildren";
156
157
 
157
- export const ThreadMessages = ({
158
- components,
159
- children,
160
- ...flatListProps
161
- }: ThreadMessagesProps) => {
158
+ export const ThreadMessages = forwardRef<
159
+ FlatList<ThreadMessage>,
160
+ ThreadMessagesProps
161
+ >(({ components, children, ...flatListProps }, ref) => {
162
162
  const messages = useAuiState((s) => s.thread.messages);
163
163
 
164
164
  const renderItem = useCallback(
@@ -179,11 +179,12 @@ export const ThreadMessages = ({
179
179
 
180
180
  return (
181
181
  <FlatList
182
+ ref={ref}
182
183
  data={messages as unknown as ThreadMessage[]}
183
184
  renderItem={renderItem}
184
185
  keyExtractor={keyExtractor}
185
186
  {...flatListProps}
186
187
  />
187
188
  );
188
- };
189
+ });
189
190
  ThreadMessages.displayName = "ThreadPrimitive.Messages";