@assistant-ui/react 0.7.8 → 0.7.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. package/dist/api/AssistantRuntime.js +3 -3
  2. package/dist/api/ComposerRuntime.d.ts.map +1 -1
  3. package/dist/api/ComposerRuntime.js +4 -4
  4. package/dist/api/MessageRuntime.js +7 -7
  5. package/dist/api/ThreadListRuntime.js +4 -4
  6. package/dist/api/ThreadRuntime.js +6 -6
  7. package/dist/api/subscribable/LazyMemoizeSubject.js +2 -2
  8. package/dist/api/subscribable/NestedSubscriptionSubject.js +1 -1
  9. package/dist/api/subscribable/ShallowMemoizeSubject.js +3 -3
  10. package/dist/context/index.js +6 -6
  11. package/dist/context/index.js.map +1 -1
  12. package/dist/context/providers/AssistantRuntimeProvider.js +4 -4
  13. package/dist/context/providers/AttachmentRuntimeProvider.js +2 -2
  14. package/dist/context/providers/ContentPartRuntimeProvider.js +2 -2
  15. package/dist/context/providers/MessageRuntimeProvider.js +3 -3
  16. package/dist/context/providers/TextContentPartProvider.js +3 -3
  17. package/dist/context/providers/ThreadListItemRuntimeProvider.js +2 -2
  18. package/dist/context/providers/ThreadRuntimeProvider.js +3 -3
  19. package/dist/context/providers/index.js +2 -2
  20. package/dist/context/react/AssistantContext.js +2 -2
  21. package/dist/context/react/AttachmentContext.js +1 -1
  22. package/dist/context/react/ComposerContext.js +3 -3
  23. package/dist/context/react/ContentPartContext.js +2 -2
  24. package/dist/context/react/MessageContext.js +2 -2
  25. package/dist/context/react/ThreadContext.js +2 -2
  26. package/dist/context/react/ThreadListItemContext.js +2 -2
  27. package/dist/context/react/index.js +6 -6
  28. package/dist/context/react/utils/createContextStoreHook.d.ts.map +1 -1
  29. package/dist/edge.js +1 -1
  30. package/dist/index.js +17 -17
  31. package/dist/index.js.map +1 -1
  32. package/dist/internal.js +11 -11
  33. package/dist/internal.js.map +1 -1
  34. package/dist/model-config/index.js +6 -6
  35. package/dist/model-config/makeAssistantTool.js +1 -1
  36. package/dist/model-config/makeAssistantToolUI.js +1 -1
  37. package/dist/model-config/useAssistantInstructions.js +1 -1
  38. package/dist/model-config/useAssistantTool.js +1 -1
  39. package/dist/model-config/useAssistantToolUI.js +1 -1
  40. package/dist/primitive-hooks/actionBar/useActionBarCopy.js +2 -2
  41. package/dist/primitive-hooks/actionBar/useActionBarEdit.js +1 -1
  42. package/dist/primitive-hooks/actionBar/useActionBarFeedbackNegative.js +1 -1
  43. package/dist/primitive-hooks/actionBar/useActionBarFeedbackPositive.js +1 -1
  44. package/dist/primitive-hooks/actionBar/useActionBarReload.js +3 -3
  45. package/dist/primitive-hooks/actionBar/useActionBarSpeak.js +1 -1
  46. package/dist/primitive-hooks/actionBar/useActionBarStopSpeaking.js +1 -1
  47. package/dist/primitive-hooks/attachment/useAttachmentRemove.js +1 -1
  48. package/dist/primitive-hooks/branchPicker/useBranchPickerCount.js +1 -1
  49. package/dist/primitive-hooks/branchPicker/useBranchPickerNext.js +1 -1
  50. package/dist/primitive-hooks/branchPicker/useBranchPickerNumber.js +1 -1
  51. package/dist/primitive-hooks/branchPicker/useBranchPickerPrevious.js +1 -1
  52. package/dist/primitive-hooks/composer/useComposerAddAttachment.js +1 -1
  53. package/dist/primitive-hooks/composer/useComposerCancel.js +1 -1
  54. package/dist/primitive-hooks/composer/useComposerIf.js +1 -1
  55. package/dist/primitive-hooks/composer/useComposerSend.js +3 -3
  56. package/dist/primitive-hooks/contentPart/index.js +3 -3
  57. package/dist/primitive-hooks/contentPart/useContentPartDisplay.js +1 -1
  58. package/dist/primitive-hooks/contentPart/useContentPartImage.js +1 -1
  59. package/dist/primitive-hooks/contentPart/useContentPartText.js +1 -1
  60. package/dist/primitive-hooks/index.js +2 -2
  61. package/dist/primitive-hooks/index.js.map +1 -1
  62. package/dist/primitive-hooks/message/useMessageIf.js +2 -2
  63. package/dist/primitive-hooks/thread/useThreadEmpty.js +1 -1
  64. package/dist/primitive-hooks/thread/useThreadIf.js +1 -1
  65. package/dist/primitive-hooks/thread/useThreadScrollToBottom.js +2 -2
  66. package/dist/primitive-hooks/thread/useThreadSuggestion.js +2 -2
  67. package/dist/primitive-hooks/thread/useThreadViewportAutoScroll.js +5 -5
  68. package/dist/primitives/actionBar/ActionBarCopy.js +2 -2
  69. package/dist/primitives/actionBar/ActionBarEdit.js +2 -2
  70. package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +2 -2
  71. package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +2 -2
  72. package/dist/primitives/actionBar/ActionBarReload.js +2 -2
  73. package/dist/primitives/actionBar/ActionBarRoot.js +1 -1
  74. package/dist/primitives/actionBar/ActionBarSpeak.js +2 -2
  75. package/dist/primitives/actionBar/ActionBarStopSpeaking.js +1 -1
  76. package/dist/primitives/actionBar/index.js +8 -8
  77. package/dist/primitives/actionBar/useActionBarFloatStatus.js +3 -3
  78. package/dist/primitives/assistantModal/AssistantModalAnchor.js +1 -1
  79. package/dist/primitives/assistantModal/AssistantModalContent.js +1 -1
  80. package/dist/primitives/assistantModal/AssistantModalRoot.js +2 -2
  81. package/dist/primitives/assistantModal/AssistantModalTrigger.js +1 -1
  82. package/dist/primitives/assistantModal/index.js +4 -4
  83. package/dist/primitives/attachment/AttachmentName.js +1 -1
  84. package/dist/primitives/attachment/AttachmentRemove.js +2 -2
  85. package/dist/primitives/attachment/AttachmentThumb.js +1 -1
  86. package/dist/primitives/attachment/index.js +4 -4
  87. package/dist/primitives/branchPicker/BranchPickerCount.js +1 -1
  88. package/dist/primitives/branchPicker/BranchPickerNext.js +2 -2
  89. package/dist/primitives/branchPicker/BranchPickerNumber.js +1 -1
  90. package/dist/primitives/branchPicker/BranchPickerPrevious.js +2 -2
  91. package/dist/primitives/branchPicker/BranchPickerRoot.js +1 -1
  92. package/dist/primitives/branchPicker/index.js +5 -5
  93. package/dist/primitives/composer/ComposerAddAttachment.js +2 -2
  94. package/dist/primitives/composer/ComposerAttachments.js +3 -3
  95. package/dist/primitives/composer/ComposerCancel.js +2 -2
  96. package/dist/primitives/composer/ComposerIf.js +1 -1
  97. package/dist/primitives/composer/ComposerInput.js +3 -3
  98. package/dist/primitives/composer/ComposerRoot.js +1 -1
  99. package/dist/primitives/composer/ComposerSend.js +2 -2
  100. package/dist/primitives/composer/index.js +7 -7
  101. package/dist/primitives/contentPart/ContentPartDisplay.js +1 -1
  102. package/dist/primitives/contentPart/ContentPartImage.js +1 -1
  103. package/dist/primitives/contentPart/ContentPartInProgress.js +1 -1
  104. package/dist/primitives/contentPart/ContentPartText.js +2 -2
  105. package/dist/primitives/contentPart/index.js +4 -4
  106. package/dist/primitives/index.js +10 -10
  107. package/dist/primitives/message/MessageAttachments.js +3 -3
  108. package/dist/primitives/message/MessageContent.js +8 -8
  109. package/dist/primitives/message/MessageIf.js +1 -1
  110. package/dist/primitives/message/MessageRoot.js +2 -2
  111. package/dist/primitives/message/index.js +4 -4
  112. package/dist/primitives/thread/ThreadEmpty.js +1 -1
  113. package/dist/primitives/thread/ThreadIf.js +1 -1
  114. package/dist/primitives/thread/ThreadMessages.js +3 -3
  115. package/dist/primitives/thread/ThreadScrollToBottom.js +2 -2
  116. package/dist/primitives/thread/ThreadSuggestion.js +2 -2
  117. package/dist/primitives/thread/ThreadViewport.js +1 -1
  118. package/dist/primitives/thread/index.js +7 -7
  119. package/dist/primitives/threadList/ThreadListItems.js +2 -2
  120. package/dist/primitives/threadList/ThreadListNew.js +2 -2
  121. package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
  122. package/dist/primitives/threadList/ThreadListNew.mjs +1 -1
  123. package/dist/primitives/threadList/ThreadListNew.mjs.map +1 -1
  124. package/dist/primitives/threadList/index.js +2 -2
  125. package/dist/primitives/threadListItem/ThreadListItemArchive.js +2 -2
  126. package/dist/primitives/threadListItem/ThreadListItemDelete.js +2 -2
  127. package/dist/primitives/threadListItem/ThreadListItemRoot.js +2 -2
  128. package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -1
  129. package/dist/primitives/threadListItem/ThreadListItemRoot.mjs +1 -1
  130. package/dist/primitives/threadListItem/ThreadListItemRoot.mjs.map +1 -1
  131. package/dist/primitives/threadListItem/ThreadListItemTitle.js +1 -1
  132. package/dist/primitives/threadListItem/ThreadListItemTrigger.js +2 -2
  133. package/dist/primitives/threadListItem/ThreadListItemUnarchive.js +2 -2
  134. package/dist/primitives/threadListItem/index.js +6 -6
  135. package/dist/runtimes/attachment/index.js +3 -3
  136. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js +2 -2
  137. package/dist/runtimes/composer/DefaultThreadComposerRuntimeCore.js +1 -1
  138. package/dist/runtimes/core/BaseAssistantRuntimeCore.js +1 -1
  139. package/dist/runtimes/core/BaseThreadRuntimeCore.js +4 -4
  140. package/dist/runtimes/dangerous-in-browser/DangerousInBrowserAdapter.js +6 -6
  141. package/dist/runtimes/dangerous-in-browser/index.js +1 -1
  142. package/dist/runtimes/dangerous-in-browser/useDangerousInBrowserRuntime.js +3 -3
  143. package/dist/runtimes/edge/EdgeChatAdapter.js +7 -7
  144. package/dist/runtimes/edge/EdgeRuntimeRequestOptions.js +1 -1
  145. package/dist/runtimes/edge/converters/fromCoreMessage.js +1 -1
  146. package/dist/runtimes/edge/converters/index.js +6 -6
  147. package/dist/runtimes/edge/createEdgeRuntimeAPI.js +9 -9
  148. package/dist/runtimes/edge/index.js +6 -6
  149. package/dist/runtimes/edge/index.js.map +1 -1
  150. package/dist/runtimes/edge/partial-json/parse-partial-json.js +1 -1
  151. package/dist/runtimes/edge/streams/assistantDecoderStream.js +1 -1
  152. package/dist/runtimes/edge/streams/assistantEncoderStream.js +1 -1
  153. package/dist/runtimes/edge/streams/runResultStream.js +1 -1
  154. package/dist/runtimes/edge/streams/utils/index.js +2 -2
  155. package/dist/runtimes/edge/streams/utils/streamPartDecoderStream.js +2 -2
  156. package/dist/runtimes/edge/streams/utils/streamPartEncoderStream.d.ts +1 -1
  157. package/dist/runtimes/edge/streams/utils/streamPartEncoderStream.d.ts.map +1 -1
  158. package/dist/runtimes/edge/streams/utils/streamPartEncoderStream.js +1 -1
  159. package/dist/runtimes/edge/useEdgeRuntime.js +3 -3
  160. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js +3 -3
  161. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.js +7 -7
  162. package/dist/runtimes/external-store/external-message-converter.js +4 -4
  163. package/dist/runtimes/external-store/index.js +3 -3
  164. package/dist/runtimes/external-store/useExternalStoreRuntime.js +3 -3
  165. package/dist/runtimes/index.js +16 -16
  166. package/dist/runtimes/index.js.map +1 -1
  167. package/dist/runtimes/local/LocalRuntimeCore.js +4 -4
  168. package/dist/runtimes/local/LocalThreadListRuntimeCore.js +1 -1
  169. package/dist/runtimes/local/LocalThreadRuntimeCore.js +5 -5
  170. package/dist/runtimes/local/index.js +1 -1
  171. package/dist/runtimes/local/useLocalRuntime.js +3 -3
  172. package/dist/runtimes/speech/index.js +1 -1
  173. package/dist/runtimes/utils/MessageRepository.js +2 -2
  174. package/dist/styles/index.css +12 -0
  175. package/dist/styles/index.css.map +1 -1
  176. package/dist/styles/tailwindcss/thread.css +1 -1
  177. package/dist/styles/tailwindcss/thread.css.json +1 -1
  178. package/dist/ui/assistant-action-bar.js +5 -5
  179. package/dist/ui/assistant-message.js +7 -7
  180. package/dist/ui/assistant-modal.js +5 -5
  181. package/dist/ui/attachment-ui.js +7 -7
  182. package/dist/ui/base/avatar.js +1 -1
  183. package/dist/ui/base/index.js +5 -5
  184. package/dist/ui/base/tooltip-icon-button.js +2 -2
  185. package/dist/ui/base/tooltip.js +1 -1
  186. package/dist/ui/branch-picker.js +5 -5
  187. package/dist/ui/composer.js +7 -7
  188. package/dist/ui/content-part.js +2 -2
  189. package/dist/ui/edit-composer.js +4 -4
  190. package/dist/ui/index.d.ts +4 -4
  191. package/dist/ui/index.d.ts.map +1 -1
  192. package/dist/ui/index.js +15 -15
  193. package/dist/ui/index.js.map +1 -1
  194. package/dist/ui/index.mjs +18 -18
  195. package/dist/ui/index.mjs.map +1 -1
  196. package/dist/ui/thread-config.d.ts +1 -1
  197. package/dist/ui/thread-config.d.ts.map +1 -1
  198. package/dist/ui/thread-config.js +2 -2
  199. package/dist/ui/thread-config.js.map +1 -1
  200. package/dist/ui/thread-config.mjs.map +1 -1
  201. package/dist/ui/thread-list-item.d.ts +2 -11
  202. package/dist/ui/thread-list-item.d.ts.map +1 -1
  203. package/dist/ui/thread-list-item.js +20 -33
  204. package/dist/ui/thread-list-item.js.map +1 -1
  205. package/dist/ui/thread-list-item.mjs +16 -29
  206. package/dist/ui/thread-list-item.mjs.map +1 -1
  207. package/dist/ui/thread-list.d.ts +10 -3
  208. package/dist/ui/thread-list.d.ts.map +1 -1
  209. package/dist/ui/thread-list.js +8 -9
  210. package/dist/ui/thread-list.js.map +1 -1
  211. package/dist/ui/thread-list.mjs +3 -4
  212. package/dist/ui/thread-list.mjs.map +1 -1
  213. package/dist/ui/thread-welcome.js +5 -5
  214. package/dist/ui/thread.js +10 -10
  215. package/dist/ui/user-action-bar.js +5 -5
  216. package/dist/ui/user-message.js +6 -6
  217. package/dist/utils/ProxyConfigProvider.js +1 -1
  218. package/dist/utils/combined/createCombinedStore.d.ts.map +1 -1
  219. package/dist/utils/combined/useCombinedStore.d.ts.map +1 -1
  220. package/dist/utils/combined/useCombinedStore.js +1 -1
  221. package/dist/utils/hooks/useOnResizeContent.js +1 -1
  222. package/dist/utils/hooks/useOnScrollToBottom.js +1 -1
  223. package/dist/utils/smooth/SmoothContext.js +2 -2
  224. package/dist/utils/smooth/index.js +3 -3
  225. package/dist/utils/smooth/useSmooth.js +3 -3
  226. package/package.json +1 -1
  227. package/src/primitives/threadList/ThreadListNew.tsx +1 -1
  228. package/src/primitives/threadListItem/ThreadListItemRoot.tsx +1 -1
  229. package/src/styles/tailwindcss/thread.css +1 -1
  230. package/src/ui/index.ts +6 -6
  231. package/src/ui/thread-config.tsx +1 -1
  232. package/src/ui/thread-list-item.tsx +24 -32
  233. package/src/ui/thread-list.tsx +13 -7
package/dist/ui/index.mjs CHANGED
@@ -8,33 +8,33 @@ import { default as default3 } from "./assistant-message.mjs";
8
8
  import { default as default4 } from "./assistant-modal.mjs";
9
9
  import { default as default5 } from "./branch-picker.mjs";
10
10
  import { default as default6 } from "./composer.mjs";
11
+ import { default as default7 } from "./content-part.mjs";
11
12
  import {
12
- default as default7
13
+ default as default8
13
14
  } from "./attachment-ui.mjs";
14
- import { default as default8 } from "./edit-composer.mjs";
15
- import { default as default9 } from "./thread.mjs";
16
- import { default as default10 } from "./user-message.mjs";
17
- import { default as default11 } from "./user-action-bar.mjs";
18
- import { default as default12 } from "./thread-welcome.mjs";
19
- import { default as default13 } from "./content-part.mjs";
20
- import { default as default14 } from "./thread-list.mjs";
21
- import { default as default15 } from "./thread-list-item.mjs";
15
+ import { default as default9 } from "./edit-composer.mjs";
16
+ import { default as default10 } from "./thread.mjs";
17
+ import { default as default11 } from "./thread-list.mjs";
18
+ import { default as default12 } from "./thread-list-item.mjs";
19
+ import { default as default13 } from "./thread-welcome.mjs";
20
+ import { default as default14 } from "./user-message.mjs";
21
+ import { default as default15 } from "./user-action-bar.mjs";
22
22
  export {
23
23
  default2 as AssistantActionBar,
24
24
  default3 as AssistantMessage,
25
25
  default4 as AssistantModal,
26
- default7 as AttachmentUI,
26
+ default8 as AttachmentUI,
27
27
  default5 as BranchPicker,
28
28
  default6 as Composer,
29
- default13 as ContentPart,
30
- default8 as EditComposer,
31
- default9 as Thread,
29
+ default7 as ContentPart,
30
+ default9 as EditComposer,
31
+ default10 as Thread,
32
32
  ThreadConfigProvider,
33
- default14 as ThreadList,
34
- default15 as ThreadListItem,
35
- default12 as ThreadWelcome,
36
- default11 as UserActionBar,
37
- default10 as UserMessage,
33
+ default11 as ThreadList,
34
+ default12 as ThreadListItem,
35
+ default13 as ThreadWelcome,
36
+ default15 as UserActionBar,
37
+ default14 as UserMessage,
38
38
  useThreadConfig
39
39
  };
40
40
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/index.ts"],"sourcesContent":["export {\n ThreadConfigProvider,\n useThreadConfig,\n type ThreadConfig,\n type ThreadWelcomeConfig,\n type UserMessageConfig,\n type AssistantMessageConfig,\n type StringsConfig,\n type SuggestionConfig,\n type ThreadConfigProviderProps,\n} from \"./thread-config\";\n\nexport { default as AssistantActionBar } from \"./assistant-action-bar\";\n\nexport { default as AssistantMessage } from \"./assistant-message\";\n\nexport { default as AssistantModal } from \"./assistant-modal\";\n\nexport { default as BranchPicker } from \"./branch-picker\";\n\nexport { default as Composer } from \"./composer\";\n\nexport {\n default as AttachmentUI, // TODO name collision with Attachment\n} from \"./attachment-ui\";\n\nexport { default as EditComposer } from \"./edit-composer\";\n\nexport { default as Thread } from \"./thread\";\n\nexport { default as UserMessage } from \"./user-message\";\n\nexport { default as UserActionBar } from \"./user-action-bar\";\n\nexport { default as ThreadWelcome } from \"./thread-welcome\";\n\nexport { default as ContentPart } from \"./content-part\";\n\nexport { default as ThreadList } from \"./thread-list\";\n\nexport { default as ThreadListItem } from \"./thread-list-item\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAQK;AAEP,SAAoB,WAAXA,gBAAqC;AAE9C,SAAoB,WAAXA,gBAAmC;AAE5C,SAAoB,WAAXA,gBAAiC;AAE1C,SAAoB,WAAXA,gBAA+B;AAExC,SAAoB,WAAXA,gBAA2B;AAEpC;AAAA,EACa,WAAXA;AAAA,OACK;AAEP,SAAoB,WAAXA,gBAA+B;AAExC,SAAoB,WAAXA,gBAAyB;AAElC,SAAoB,WAAXA,iBAA8B;AAEvC,SAAoB,WAAXA,iBAAgC;AAEzC,SAAoB,WAAXA,iBAAgC;AAEzC,SAAoB,WAAXA,iBAA8B;AAEvC,SAAoB,WAAXA,iBAA6B;AAEtC,SAAoB,WAAXA,iBAAiC;","names":["default"]}
1
+ {"version":3,"sources":["../../src/ui/index.ts"],"sourcesContent":["export {\n ThreadConfigProvider,\n useThreadConfig,\n type ThreadConfig,\n type ThreadWelcomeConfig,\n type UserMessageConfig,\n type AssistantMessageConfig,\n type StringsConfig,\n type SuggestionConfig,\n type ThreadConfigProviderProps,\n} from \"./thread-config\";\n\nexport { default as AssistantActionBar } from \"./assistant-action-bar\";\n\nexport { default as AssistantMessage } from \"./assistant-message\";\n\nexport { default as AssistantModal } from \"./assistant-modal\";\n\nexport { default as BranchPicker } from \"./branch-picker\";\n\nexport { default as Composer } from \"./composer\";\n\nexport { default as ContentPart } from \"./content-part\";\n\nexport {\n default as AttachmentUI, // TODO name collision with Attachment\n} from \"./attachment-ui\";\n\nexport { default as EditComposer } from \"./edit-composer\";\n\nexport { default as Thread } from \"./thread\";\n\nexport { default as ThreadList } from \"./thread-list\";\n\nexport { default as ThreadListItem } from \"./thread-list-item\";\n\nexport { default as ThreadWelcome } from \"./thread-welcome\";\n\nexport { default as UserMessage } from \"./user-message\";\n\nexport { default as UserActionBar } from \"./user-action-bar\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAQK;AAEP,SAAoB,WAAXA,gBAAqC;AAE9C,SAAoB,WAAXA,gBAAmC;AAE5C,SAAoB,WAAXA,gBAAiC;AAE1C,SAAoB,WAAXA,gBAA+B;AAExC,SAAoB,WAAXA,gBAA2B;AAEpC,SAAoB,WAAXA,gBAA8B;AAEvC;AAAA,EACa,WAAXA;AAAA,OACK;AAEP,SAAoB,WAAXA,gBAA+B;AAExC,SAAoB,WAAXA,iBAAyB;AAElC,SAAoB,WAAXA,iBAA6B;AAEtC,SAAoB,WAAXA,iBAAiC;AAE1C,SAAoB,WAAXA,iBAAgC;AAEzC,SAAoB,WAAXA,iBAA8B;AAEvC,SAAoB,WAAXA,iBAAgC;","names":["default"]}
@@ -53,7 +53,7 @@ export type StringsConfig = {
53
53
  fallback?: string | undefined;
54
54
  };
55
55
  archive?: {
56
- label?: string | undefined;
56
+ tooltip?: string | undefined;
57
57
  };
58
58
  };
59
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"thread-config.d.ts","sourceRoot":"","sources":["../../src/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S,CAAC;CACnC,CAAC,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAmC9D,CAAC"}
@@ -26,8 +26,8 @@ __export(thread_config_exports, {
26
26
  });
27
27
  module.exports = __toCommonJS(thread_config_exports);
28
28
  var import_react = require("react");
29
- var import_context = require("../context/index.cjs");
30
- var import_AssistantContext = require("../context/react/AssistantContext.cjs");
29
+ var import_context = require("../context/index.js");
30
+ var import_AssistantContext = require("../context/react/AssistantContext.js");
31
31
  var import_jsx_runtime = require("react/jsx-runtime");
32
32
  var ThreadConfigContext = (0, import_react.createContext)({});
33
33
  var useThreadConfig = () => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/thread-config.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComponentType,\n FC,\n PropsWithChildren,\n ReactNode,\n createContext,\n useContext,\n} from \"react\";\n\nimport { AssistantRuntime } from \"../api/AssistantRuntime\";\nimport { AvatarProps } from \"./base/avatar\";\nimport { TextContentPartComponent, ToolCallContentPartProps } from \"../types\";\nimport { AssistantRuntimeProvider } from \"../context\";\nimport { AssistantToolUI } from \"../model-config\";\nimport { useAssistantRuntime } from \"../context/react/AssistantContext\";\n\nexport type SuggestionConfig = {\n text?: ReactNode | undefined;\n prompt: string;\n};\n\nexport type ThreadWelcomeConfig = {\n message?: string | null | undefined;\n suggestions?: SuggestionConfig[] | undefined;\n};\n\nexport type UserMessageConfig = {\n allowEdit?: boolean | undefined;\n};\n\nexport type AssistantMessageConfig = {\n allowReload?: boolean | undefined;\n allowCopy?: boolean | undefined;\n allowSpeak?: boolean | undefined;\n allowFeedbackPositive?: boolean | undefined;\n allowFeedbackNegative?: boolean | undefined;\n components?:\n | {\n Text?: TextContentPartComponent | undefined;\n ToolFallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n};\n\nexport type BranchPickerConfig = {\n allowBranchPicker?: boolean | undefined;\n};\n\nexport type ComposerConfig = {\n allowAttachments?: boolean | undefined;\n};\n\nexport type StringsConfig = {\n assistantModal?: {\n open: {\n button: {\n tooltip?: string | undefined;\n };\n };\n closed: {\n button: {\n tooltip?: string | undefined;\n };\n };\n };\n threadList?: {\n new?: {\n label?: string | undefined;\n };\n item?: {\n title?: {\n fallback?: string | undefined;\n };\n archive?: {\n label?: string | undefined;\n };\n };\n };\n thread?: {\n scrollToBottom?: {\n tooltip?: string | undefined;\n };\n };\n welcome?: {\n message?: string | undefined;\n };\n userMessage?: {\n edit?: {\n tooltip?: string | undefined;\n };\n };\n assistantMessage?: {\n reload?: {\n tooltip?: string | undefined;\n };\n copy?: {\n tooltip?: string | undefined;\n };\n speak?: {\n tooltip?: string | undefined;\n stop?: {\n tooltip?: string | undefined;\n };\n };\n feedback?: {\n positive?: {\n tooltip?: string | undefined;\n };\n negative?: {\n tooltip?: string | undefined;\n };\n };\n };\n branchPicker?: {\n previous?: {\n tooltip?: string | undefined;\n };\n next?: {\n tooltip?: string | undefined;\n };\n };\n composer?: {\n send?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n cancel?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n addAttachment?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n removeAttachment?: {\n tooltip?: string | undefined;\n };\n input?: {\n placeholder?: string | undefined;\n };\n };\n editComposer?: {\n send?: {\n label?: string | undefined;\n };\n cancel?: {\n label?: string | undefined;\n };\n };\n code?: {\n header?: {\n copy?: {\n tooltip?: string | undefined;\n };\n };\n };\n};\n\nconst ThreadConfigContext = createContext<ThreadConfig>({});\n\nexport type ThreadConfig = {\n runtime?: AssistantRuntime | undefined;\n\n assistantAvatar?: AvatarProps | undefined;\n\n welcome?: ThreadWelcomeConfig | undefined;\n assistantMessage?: AssistantMessageConfig | undefined;\n userMessage?: UserMessageConfig | undefined;\n\n branchPicker?: BranchPickerConfig | undefined;\n\n composer?: ComposerConfig | undefined;\n\n strings?: StringsConfig | undefined;\n\n tools?: AssistantToolUI[] | undefined; // TODO add AssistantTool support\n\n components?:\n | {\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n Composer?: ComponentType | undefined;\n ThreadWelcome?: ComponentType | undefined;\n }\n | undefined;\n};\n\nexport const useThreadConfig = (): Omit<ThreadConfig, \"runtime\"> => {\n return useContext(ThreadConfigContext);\n};\n\nexport type ThreadConfigProviderProps = PropsWithChildren<{\n config?: ThreadConfig | undefined;\n}>;\n\nexport const ThreadConfigProvider: FC<ThreadConfigProviderProps> = ({\n children,\n config,\n}) => {\n const hasAssistant = !!useAssistantRuntime({ optional: true });\n\n const hasConfig = config && Object.keys(config).length > 0;\n const outerConfig = useThreadConfig();\n\n if (hasConfig && Object.keys(outerConfig).length > 0) {\n throw new Error(\n \"You are providing ThreadConfig to several nested components. Please provide all configuration to the same component.\",\n );\n }\n\n const configProvider = hasConfig ? (\n <ThreadConfigContext.Provider value={config}>\n {children}\n </ThreadConfigContext.Provider>\n ) : (\n <>{children}</>\n );\n\n if (!config?.runtime) return configProvider;\n\n if (hasAssistant) {\n throw new Error(\n \"You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed.\",\n );\n }\n return (\n <AssistantRuntimeProvider runtime={config.runtime}>\n {configProvider}\n </AssistantRuntimeProvider>\n );\n};\n\nThreadConfigProvider.displayName = \"ThreadConfigProvider\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAOO;AAKP,qBAAyC;AAEzC,8BAAoC;AAyMhC;AAtDJ,IAAM,0BAAsB,4BAA4B,CAAC,CAAC;AA8BnD,IAAM,kBAAkB,MAAqC;AAClE,aAAO,yBAAW,mBAAmB;AACvC;AAMO,IAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,CAAC,KAAC,6CAAoB,EAAE,UAAU,KAAK,CAAC;AAE7D,QAAM,YAAY,UAAU,OAAO,KAAK,MAAM,EAAE,SAAS;AACzD,QAAM,cAAc,gBAAgB;AAEpC,MAAI,aAAa,OAAO,KAAK,WAAW,EAAE,SAAS,GAAG;AACpD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,iBAAiB,YACrB,4CAAC,oBAAoB,UAApB,EAA6B,OAAO,QAClC,UACH,IAEA,2EAAG,UAAS;AAGd,MAAI,CAAC,QAAQ,QAAS,QAAO;AAE7B,MAAI,cAAc;AAChB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SACE,4CAAC,2CAAyB,SAAS,OAAO,SACvC,0BACH;AAEJ;AAEA,qBAAqB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/ui/thread-config.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComponentType,\n FC,\n PropsWithChildren,\n ReactNode,\n createContext,\n useContext,\n} from \"react\";\n\nimport { AssistantRuntime } from \"../api/AssistantRuntime\";\nimport { AvatarProps } from \"./base/avatar\";\nimport { TextContentPartComponent, ToolCallContentPartProps } from \"../types\";\nimport { AssistantRuntimeProvider } from \"../context\";\nimport { AssistantToolUI } from \"../model-config\";\nimport { useAssistantRuntime } from \"../context/react/AssistantContext\";\n\nexport type SuggestionConfig = {\n text?: ReactNode | undefined;\n prompt: string;\n};\n\nexport type ThreadWelcomeConfig = {\n message?: string | null | undefined;\n suggestions?: SuggestionConfig[] | undefined;\n};\n\nexport type UserMessageConfig = {\n allowEdit?: boolean | undefined;\n};\n\nexport type AssistantMessageConfig = {\n allowReload?: boolean | undefined;\n allowCopy?: boolean | undefined;\n allowSpeak?: boolean | undefined;\n allowFeedbackPositive?: boolean | undefined;\n allowFeedbackNegative?: boolean | undefined;\n components?:\n | {\n Text?: TextContentPartComponent | undefined;\n ToolFallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n};\n\nexport type BranchPickerConfig = {\n allowBranchPicker?: boolean | undefined;\n};\n\nexport type ComposerConfig = {\n allowAttachments?: boolean | undefined;\n};\n\nexport type StringsConfig = {\n assistantModal?: {\n open: {\n button: {\n tooltip?: string | undefined;\n };\n };\n closed: {\n button: {\n tooltip?: string | undefined;\n };\n };\n };\n threadList?: {\n new?: {\n label?: string | undefined;\n };\n item?: {\n title?: {\n fallback?: string | undefined;\n };\n archive?: {\n tooltip?: string | undefined;\n };\n };\n };\n thread?: {\n scrollToBottom?: {\n tooltip?: string | undefined;\n };\n };\n welcome?: {\n message?: string | undefined;\n };\n userMessage?: {\n edit?: {\n tooltip?: string | undefined;\n };\n };\n assistantMessage?: {\n reload?: {\n tooltip?: string | undefined;\n };\n copy?: {\n tooltip?: string | undefined;\n };\n speak?: {\n tooltip?: string | undefined;\n stop?: {\n tooltip?: string | undefined;\n };\n };\n feedback?: {\n positive?: {\n tooltip?: string | undefined;\n };\n negative?: {\n tooltip?: string | undefined;\n };\n };\n };\n branchPicker?: {\n previous?: {\n tooltip?: string | undefined;\n };\n next?: {\n tooltip?: string | undefined;\n };\n };\n composer?: {\n send?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n cancel?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n addAttachment?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n removeAttachment?: {\n tooltip?: string | undefined;\n };\n input?: {\n placeholder?: string | undefined;\n };\n };\n editComposer?: {\n send?: {\n label?: string | undefined;\n };\n cancel?: {\n label?: string | undefined;\n };\n };\n code?: {\n header?: {\n copy?: {\n tooltip?: string | undefined;\n };\n };\n };\n};\n\nconst ThreadConfigContext = createContext<ThreadConfig>({});\n\nexport type ThreadConfig = {\n runtime?: AssistantRuntime | undefined;\n\n assistantAvatar?: AvatarProps | undefined;\n\n welcome?: ThreadWelcomeConfig | undefined;\n assistantMessage?: AssistantMessageConfig | undefined;\n userMessage?: UserMessageConfig | undefined;\n\n branchPicker?: BranchPickerConfig | undefined;\n\n composer?: ComposerConfig | undefined;\n\n strings?: StringsConfig | undefined;\n\n tools?: AssistantToolUI[] | undefined; // TODO add AssistantTool support\n\n components?:\n | {\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n Composer?: ComponentType | undefined;\n ThreadWelcome?: ComponentType | undefined;\n }\n | undefined;\n};\n\nexport const useThreadConfig = (): Omit<ThreadConfig, \"runtime\"> => {\n return useContext(ThreadConfigContext);\n};\n\nexport type ThreadConfigProviderProps = PropsWithChildren<{\n config?: ThreadConfig | undefined;\n}>;\n\nexport const ThreadConfigProvider: FC<ThreadConfigProviderProps> = ({\n children,\n config,\n}) => {\n const hasAssistant = !!useAssistantRuntime({ optional: true });\n\n const hasConfig = config && Object.keys(config).length > 0;\n const outerConfig = useThreadConfig();\n\n if (hasConfig && Object.keys(outerConfig).length > 0) {\n throw new Error(\n \"You are providing ThreadConfig to several nested components. Please provide all configuration to the same component.\",\n );\n }\n\n const configProvider = hasConfig ? (\n <ThreadConfigContext.Provider value={config}>\n {children}\n </ThreadConfigContext.Provider>\n ) : (\n <>{children}</>\n );\n\n if (!config?.runtime) return configProvider;\n\n if (hasAssistant) {\n throw new Error(\n \"You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed.\",\n );\n }\n return (\n <AssistantRuntimeProvider runtime={config.runtime}>\n {configProvider}\n </AssistantRuntimeProvider>\n );\n};\n\nThreadConfigProvider.displayName = \"ThreadConfigProvider\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAOO;AAKP,qBAAyC;AAEzC,8BAAoC;AAyMhC;AAtDJ,IAAM,0BAAsB,4BAA4B,CAAC,CAAC;AA8BnD,IAAM,kBAAkB,MAAqC;AAClE,aAAO,yBAAW,mBAAmB;AACvC;AAMO,IAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,CAAC,KAAC,6CAAoB,EAAE,UAAU,KAAK,CAAC;AAE7D,QAAM,YAAY,UAAU,OAAO,KAAK,MAAM,EAAE,SAAS;AACzD,QAAM,cAAc,gBAAgB;AAEpC,MAAI,aAAa,OAAO,KAAK,WAAW,EAAE,SAAS,GAAG;AACpD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,iBAAiB,YACrB,4CAAC,oBAAoB,UAApB,EAA6B,OAAO,QAClC,UACH,IAEA,2EAAG,UAAS;AAGd,MAAI,CAAC,QAAQ,QAAS,QAAO;AAE7B,MAAI,cAAc;AAChB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SACE,4CAAC,2CAAyB,SAAS,OAAO,SACvC,0BACH;AAEJ;AAEA,qBAAqB,cAAc;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/thread-config.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComponentType,\n FC,\n PropsWithChildren,\n ReactNode,\n createContext,\n useContext,\n} from \"react\";\n\nimport { AssistantRuntime } from \"../api/AssistantRuntime\";\nimport { AvatarProps } from \"./base/avatar\";\nimport { TextContentPartComponent, ToolCallContentPartProps } from \"../types\";\nimport { AssistantRuntimeProvider } from \"../context\";\nimport { AssistantToolUI } from \"../model-config\";\nimport { useAssistantRuntime } from \"../context/react/AssistantContext\";\n\nexport type SuggestionConfig = {\n text?: ReactNode | undefined;\n prompt: string;\n};\n\nexport type ThreadWelcomeConfig = {\n message?: string | null | undefined;\n suggestions?: SuggestionConfig[] | undefined;\n};\n\nexport type UserMessageConfig = {\n allowEdit?: boolean | undefined;\n};\n\nexport type AssistantMessageConfig = {\n allowReload?: boolean | undefined;\n allowCopy?: boolean | undefined;\n allowSpeak?: boolean | undefined;\n allowFeedbackPositive?: boolean | undefined;\n allowFeedbackNegative?: boolean | undefined;\n components?:\n | {\n Text?: TextContentPartComponent | undefined;\n ToolFallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n};\n\nexport type BranchPickerConfig = {\n allowBranchPicker?: boolean | undefined;\n};\n\nexport type ComposerConfig = {\n allowAttachments?: boolean | undefined;\n};\n\nexport type StringsConfig = {\n assistantModal?: {\n open: {\n button: {\n tooltip?: string | undefined;\n };\n };\n closed: {\n button: {\n tooltip?: string | undefined;\n };\n };\n };\n threadList?: {\n new?: {\n label?: string | undefined;\n };\n item?: {\n title?: {\n fallback?: string | undefined;\n };\n archive?: {\n label?: string | undefined;\n };\n };\n };\n thread?: {\n scrollToBottom?: {\n tooltip?: string | undefined;\n };\n };\n welcome?: {\n message?: string | undefined;\n };\n userMessage?: {\n edit?: {\n tooltip?: string | undefined;\n };\n };\n assistantMessage?: {\n reload?: {\n tooltip?: string | undefined;\n };\n copy?: {\n tooltip?: string | undefined;\n };\n speak?: {\n tooltip?: string | undefined;\n stop?: {\n tooltip?: string | undefined;\n };\n };\n feedback?: {\n positive?: {\n tooltip?: string | undefined;\n };\n negative?: {\n tooltip?: string | undefined;\n };\n };\n };\n branchPicker?: {\n previous?: {\n tooltip?: string | undefined;\n };\n next?: {\n tooltip?: string | undefined;\n };\n };\n composer?: {\n send?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n cancel?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n addAttachment?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n removeAttachment?: {\n tooltip?: string | undefined;\n };\n input?: {\n placeholder?: string | undefined;\n };\n };\n editComposer?: {\n send?: {\n label?: string | undefined;\n };\n cancel?: {\n label?: string | undefined;\n };\n };\n code?: {\n header?: {\n copy?: {\n tooltip?: string | undefined;\n };\n };\n };\n};\n\nconst ThreadConfigContext = createContext<ThreadConfig>({});\n\nexport type ThreadConfig = {\n runtime?: AssistantRuntime | undefined;\n\n assistantAvatar?: AvatarProps | undefined;\n\n welcome?: ThreadWelcomeConfig | undefined;\n assistantMessage?: AssistantMessageConfig | undefined;\n userMessage?: UserMessageConfig | undefined;\n\n branchPicker?: BranchPickerConfig | undefined;\n\n composer?: ComposerConfig | undefined;\n\n strings?: StringsConfig | undefined;\n\n tools?: AssistantToolUI[] | undefined; // TODO add AssistantTool support\n\n components?:\n | {\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n Composer?: ComponentType | undefined;\n ThreadWelcome?: ComponentType | undefined;\n }\n | undefined;\n};\n\nexport const useThreadConfig = (): Omit<ThreadConfig, \"runtime\"> => {\n return useContext(ThreadConfigContext);\n};\n\nexport type ThreadConfigProviderProps = PropsWithChildren<{\n config?: ThreadConfig | undefined;\n}>;\n\nexport const ThreadConfigProvider: FC<ThreadConfigProviderProps> = ({\n children,\n config,\n}) => {\n const hasAssistant = !!useAssistantRuntime({ optional: true });\n\n const hasConfig = config && Object.keys(config).length > 0;\n const outerConfig = useThreadConfig();\n\n if (hasConfig && Object.keys(outerConfig).length > 0) {\n throw new Error(\n \"You are providing ThreadConfig to several nested components. Please provide all configuration to the same component.\",\n );\n }\n\n const configProvider = hasConfig ? (\n <ThreadConfigContext.Provider value={config}>\n {children}\n </ThreadConfigContext.Provider>\n ) : (\n <>{children}</>\n );\n\n if (!config?.runtime) return configProvider;\n\n if (hasAssistant) {\n throw new Error(\n \"You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed.\",\n );\n }\n return (\n <AssistantRuntimeProvider runtime={config.runtime}>\n {configProvider}\n </AssistantRuntimeProvider>\n );\n};\n\nThreadConfigProvider.displayName = \"ThreadConfigProvider\";\n"],"mappings":";;;AAEA;AAAA,EAKE;AAAA,EACA;AAAA,OACK;AAKP,SAAS,gCAAgC;AAEzC,SAAS,2BAA2B;AAyMhC,SAIA,UAJA;AAtDJ,IAAM,sBAAsB,cAA4B,CAAC,CAAC;AA8BnD,IAAM,kBAAkB,MAAqC;AAClE,SAAO,WAAW,mBAAmB;AACvC;AAMO,IAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,CAAC,CAAC,oBAAoB,EAAE,UAAU,KAAK,CAAC;AAE7D,QAAM,YAAY,UAAU,OAAO,KAAK,MAAM,EAAE,SAAS;AACzD,QAAM,cAAc,gBAAgB;AAEpC,MAAI,aAAa,OAAO,KAAK,WAAW,EAAE,SAAS,GAAG;AACpD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,iBAAiB,YACrB,oBAAC,oBAAoB,UAApB,EAA6B,OAAO,QAClC,UACH,IAEA,gCAAG,UAAS;AAGd,MAAI,CAAC,QAAQ,QAAS,QAAO;AAE7B,MAAI,cAAc;AAChB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SACE,oBAAC,4BAAyB,SAAS,OAAO,SACvC,0BACH;AAEJ;AAEA,qBAAqB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/ui/thread-config.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComponentType,\n FC,\n PropsWithChildren,\n ReactNode,\n createContext,\n useContext,\n} from \"react\";\n\nimport { AssistantRuntime } from \"../api/AssistantRuntime\";\nimport { AvatarProps } from \"./base/avatar\";\nimport { TextContentPartComponent, ToolCallContentPartProps } from \"../types\";\nimport { AssistantRuntimeProvider } from \"../context\";\nimport { AssistantToolUI } from \"../model-config\";\nimport { useAssistantRuntime } from \"../context/react/AssistantContext\";\n\nexport type SuggestionConfig = {\n text?: ReactNode | undefined;\n prompt: string;\n};\n\nexport type ThreadWelcomeConfig = {\n message?: string | null | undefined;\n suggestions?: SuggestionConfig[] | undefined;\n};\n\nexport type UserMessageConfig = {\n allowEdit?: boolean | undefined;\n};\n\nexport type AssistantMessageConfig = {\n allowReload?: boolean | undefined;\n allowCopy?: boolean | undefined;\n allowSpeak?: boolean | undefined;\n allowFeedbackPositive?: boolean | undefined;\n allowFeedbackNegative?: boolean | undefined;\n components?:\n | {\n Text?: TextContentPartComponent | undefined;\n ToolFallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n};\n\nexport type BranchPickerConfig = {\n allowBranchPicker?: boolean | undefined;\n};\n\nexport type ComposerConfig = {\n allowAttachments?: boolean | undefined;\n};\n\nexport type StringsConfig = {\n assistantModal?: {\n open: {\n button: {\n tooltip?: string | undefined;\n };\n };\n closed: {\n button: {\n tooltip?: string | undefined;\n };\n };\n };\n threadList?: {\n new?: {\n label?: string | undefined;\n };\n item?: {\n title?: {\n fallback?: string | undefined;\n };\n archive?: {\n tooltip?: string | undefined;\n };\n };\n };\n thread?: {\n scrollToBottom?: {\n tooltip?: string | undefined;\n };\n };\n welcome?: {\n message?: string | undefined;\n };\n userMessage?: {\n edit?: {\n tooltip?: string | undefined;\n };\n };\n assistantMessage?: {\n reload?: {\n tooltip?: string | undefined;\n };\n copy?: {\n tooltip?: string | undefined;\n };\n speak?: {\n tooltip?: string | undefined;\n stop?: {\n tooltip?: string | undefined;\n };\n };\n feedback?: {\n positive?: {\n tooltip?: string | undefined;\n };\n negative?: {\n tooltip?: string | undefined;\n };\n };\n };\n branchPicker?: {\n previous?: {\n tooltip?: string | undefined;\n };\n next?: {\n tooltip?: string | undefined;\n };\n };\n composer?: {\n send?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n cancel?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n addAttachment?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n removeAttachment?: {\n tooltip?: string | undefined;\n };\n input?: {\n placeholder?: string | undefined;\n };\n };\n editComposer?: {\n send?: {\n label?: string | undefined;\n };\n cancel?: {\n label?: string | undefined;\n };\n };\n code?: {\n header?: {\n copy?: {\n tooltip?: string | undefined;\n };\n };\n };\n};\n\nconst ThreadConfigContext = createContext<ThreadConfig>({});\n\nexport type ThreadConfig = {\n runtime?: AssistantRuntime | undefined;\n\n assistantAvatar?: AvatarProps | undefined;\n\n welcome?: ThreadWelcomeConfig | undefined;\n assistantMessage?: AssistantMessageConfig | undefined;\n userMessage?: UserMessageConfig | undefined;\n\n branchPicker?: BranchPickerConfig | undefined;\n\n composer?: ComposerConfig | undefined;\n\n strings?: StringsConfig | undefined;\n\n tools?: AssistantToolUI[] | undefined; // TODO add AssistantTool support\n\n components?:\n | {\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n Composer?: ComponentType | undefined;\n ThreadWelcome?: ComponentType | undefined;\n }\n | undefined;\n};\n\nexport const useThreadConfig = (): Omit<ThreadConfig, \"runtime\"> => {\n return useContext(ThreadConfigContext);\n};\n\nexport type ThreadConfigProviderProps = PropsWithChildren<{\n config?: ThreadConfig | undefined;\n}>;\n\nexport const ThreadConfigProvider: FC<ThreadConfigProviderProps> = ({\n children,\n config,\n}) => {\n const hasAssistant = !!useAssistantRuntime({ optional: true });\n\n const hasConfig = config && Object.keys(config).length > 0;\n const outerConfig = useThreadConfig();\n\n if (hasConfig && Object.keys(outerConfig).length > 0) {\n throw new Error(\n \"You are providing ThreadConfig to several nested components. Please provide all configuration to the same component.\",\n );\n }\n\n const configProvider = hasConfig ? (\n <ThreadConfigContext.Provider value={config}>\n {children}\n </ThreadConfigContext.Provider>\n ) : (\n <>{children}</>\n );\n\n if (!config?.runtime) return configProvider;\n\n if (hasAssistant) {\n throw new Error(\n \"You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed.\",\n );\n }\n return (\n <AssistantRuntimeProvider runtime={config.runtime}>\n {configProvider}\n </AssistantRuntimeProvider>\n );\n};\n\nThreadConfigProvider.displayName = \"ThreadConfigProvider\";\n"],"mappings":";;;AAEA;AAAA,EAKE;AAAA,EACA;AAAA,OACK;AAKP,SAAS,gCAAgC;AAEzC,SAAS,2BAA2B;AAyMhC,SAIA,UAJA;AAtDJ,IAAM,sBAAsB,cAA4B,CAAC,CAAC;AA8BnD,IAAM,kBAAkB,MAAqC;AAClE,SAAO,WAAW,mBAAmB;AACvC;AAMO,IAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,CAAC,CAAC,oBAAoB,EAAE,UAAU,KAAK,CAAC;AAE7D,QAAM,YAAY,UAAU,OAAO,KAAK,MAAM,EAAE,SAAS;AACzD,QAAM,cAAc,gBAAgB;AAEpC,MAAI,aAAa,OAAO,KAAK,WAAW,EAAE,SAAS,GAAG;AACpD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,iBAAiB,YACrB,oBAAC,oBAAoB,UAApB,EAA6B,OAAO,QAClC,UACH,IAEA,gCAAG,UAAS;AAGd,MAAI,CAAC,QAAQ,QAAS,QAAO;AAE7B,MAAI,cAAc;AAChB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SACE,oBAAC,4BAAyB,SAAS,OAAO,SACvC,0BACH;AAEJ;AAEA,qBAAqB,cAAc;","names":[]}
@@ -1,4 +1,5 @@
1
1
  import { type FC } from "react";
2
+ import { TooltipIconButton } from "./base/tooltip-icon-button";
2
3
  declare const ThreadListItem: FC;
3
4
  declare const exports: {
4
5
  Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
@@ -7,17 +8,7 @@ declare const exports: {
7
8
  asChild?: boolean;
8
9
  }, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
9
10
  Title: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
10
- Archive: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
11
- ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
12
- } & {
13
- asChild?: boolean;
14
- }, "ref"> & import("class-variance-authority").VariantProps<(props?: ({
15
- variant?: "default" | "outline" | "ghost" | null | undefined;
16
- size?: "default" | "icon" | null | undefined;
17
- } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
18
- tooltip: string;
19
- side?: "top" | "bottom" | "left" | "right";
20
- } & import("react").RefAttributes<HTMLButtonElement>, "ref">> & import("react").RefAttributes<HTMLButtonElement>>;
11
+ Archive: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
21
12
  };
22
13
  declare const _default: typeof ThreadListItem & typeof exports;
23
14
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"thread-list-item.d.ts","sourceRoot":"","sources":["../../src/ui/thread-list-item.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAStE,QAAA,MAAM,cAAc,EAAE,EASrB,CAAC;AAuEF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAIZ,CAAC;wBAEuD,OAAO,cAAc,GAC5E,OAAO,OAAO;AADhB,wBACiB"}
1
+ {"version":3,"file":"thread-list-item.d.ts","sourceRoot":"","sources":["../../src/ui/thread-list-item.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAItE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAK/D,QAAA,MAAM,cAAc,EAAE,EASrB,CAAC;AA+DF,QAAA,MAAM,OAAO;;;;;;;;CAIZ,CAAC;wBAEuD,OAAO,cAAc,GAC5E,OAAO,OAAO;AADhB,wBACiB"}
@@ -36,10 +36,10 @@ __export(thread_list_item_exports, {
36
36
  module.exports = __toCommonJS(thread_list_item_exports);
37
37
  var import_react = require("react");
38
38
  var import_lucide_react = require("lucide-react");
39
- var import_withDefaults = require("./utils/withDefaults.cjs");
40
- var import_tooltip_icon_button = require("./base/tooltip-icon-button.cjs");
41
- var import_primitives = require("../primitives/index.cjs");
42
- var import_thread_config = require("./thread-config.cjs");
39
+ var import_withDefaults = require("./utils/withDefaults.js");
40
+ var import_tooltip_icon_button = require("./base/tooltip-icon-button.js");
41
+ var import_primitives = require("../primitives/index.js");
42
+ var import_thread_config = require("./thread-config.js");
43
43
  var import_classnames = __toESM(require("classnames"));
44
44
  var import_jsx_runtime = require("react/jsx-runtime");
45
45
  var ThreadListItem = () => {
@@ -56,11 +56,8 @@ var ThreadListItemTrigger = (0, import_withDefaults.withDefaults)(import_primiti
56
56
  className: "aui-thread-list-item-trigger"
57
57
  });
58
58
  var ThreadListItemTitle = (0, import_react.forwardRef)(({ className, ...props }, ref) => {
59
- const {
60
- strings: {
61
- threadList: { item: { title: { fallback = "New Chat" } = {} } = {} } = {}
62
- } = {}
63
- } = (0, import_thread_config.useThreadConfig)();
59
+ const config = (0, import_thread_config.useThreadConfig)();
60
+ const fallback = config.strings?.threadList?.item?.title?.fallback ?? "New Chat";
64
61
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
62
  "p",
66
63
  {
@@ -72,31 +69,21 @@ var ThreadListItemTitle = (0, import_react.forwardRef)(({ className, ...props },
72
69
  );
73
70
  });
74
71
  ThreadListItemTitle.displayName = "ThreadListItemTitle";
75
- var ThreadListItemArchive = (0, import_withDefaults.withDefaults)(
76
- (0, import_react.forwardRef)(
77
- ({ className, ...props }, ref) => {
78
- const {
79
- strings: {
80
- threadList: {
81
- item: { archive: { label = "Archive thread" } = {} } = {}
82
- } = {}
83
- } = {}
84
- } = (0, import_thread_config.useThreadConfig)();
85
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ThreadListItemPrimitive.Archive, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
- import_tooltip_icon_button.TooltipIconButton,
87
- {
88
- ...props,
89
- ref,
90
- className: (0, import_classnames.default)("aui-thread-list-item-archive", className),
91
- variant: "ghost",
92
- tooltip: label,
93
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArchiveIcon, {})
94
- }
95
- ) });
72
+ var ThreadListItemArchive = (0, import_react.forwardRef)(({ className, ...props }, ref) => {
73
+ const config = (0, import_thread_config.useThreadConfig)();
74
+ const tooltip = config.strings?.threadList?.item?.archive?.tooltip ?? "Archive thread";
75
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ThreadListItemPrimitive.Archive, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
+ import_tooltip_icon_button.TooltipIconButton,
77
+ {
78
+ ref,
79
+ className: (0, import_classnames.default)("aui-thread-list-item-archive", className),
80
+ variant: "ghost",
81
+ tooltip,
82
+ ...props,
83
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArchiveIcon, {})
96
84
  }
97
- ),
98
- {}
99
- );
85
+ ) });
86
+ });
100
87
  ThreadListItemArchive.displayName = "ThreadListItemArchive";
101
88
  var exports2 = {
102
89
  Root: ThreadListItemRoot,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/thread-list-item.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ArchiveIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { ThreadListItemPrimitive } from \"../primitives\";\nimport { useThreadConfig } from \"./thread-config\";\nimport classNames from \"classnames\";\n\nconst ThreadListItem: FC = () => {\n return (\n <ThreadListItemRoot>\n <ThreadListItemTrigger>\n <ThreadListItemTitle />\n </ThreadListItemTrigger>\n <ThreadListItemArchive />\n </ThreadListItemRoot>\n );\n};\n\nconst ThreadListItemRoot = withDefaults(ThreadListItemPrimitive.Root, {\n className: \"aui-thread-list-item\",\n});\n\nThreadListItemRoot.displayName = \"ThreadListItemRoot\";\n\nconst ThreadListItemTrigger = withDefaults(ThreadListItemPrimitive.Trigger, {\n className: \"aui-thread-list-item-trigger\",\n});\n\nnamespace ThreadListItemPrimitiveTitle {\n export type Element = HTMLParagraphElement;\n export type Props = ComponentPropsWithoutRef<\"p\">;\n}\n\nconst ThreadListItemTitle = forwardRef<\n ThreadListItemPrimitiveTitle.Element,\n ThreadListItemPrimitiveTitle.Props\n>(({ className, ...props }, ref) => {\n const {\n strings: {\n threadList: { item: { title: { fallback = \"New Chat\" } = {} } = {} } = {},\n } = {},\n } = useThreadConfig();\n\n return (\n <p\n ref={ref}\n className={classNames(\"aui-thread-list-item-title\", className)}\n {...props}\n >\n <ThreadListItemPrimitive.Title fallback={fallback} />\n </p>\n );\n});\n\nThreadListItemTitle.displayName = \"ThreadListItemTitle\";\n\nconst ThreadListItemArchive = withDefaults(\n forwardRef<HTMLButtonElement, TooltipIconButton.Props>(\n ({ className, ...props }, ref) => {\n const {\n strings: {\n threadList: {\n item: { archive: { label = \"Archive thread\" } = {} } = {},\n } = {},\n } = {},\n } = useThreadConfig();\n\n return (\n <ThreadListItemPrimitive.Archive asChild>\n <TooltipIconButton\n {...props}\n ref={ref}\n className={classNames(\"aui-thread-list-item-archive\", className)}\n variant=\"ghost\"\n tooltip={label}\n >\n <ArchiveIcon />\n </TooltipIconButton>\n </ThreadListItemPrimitive.Archive>\n );\n },\n ),\n {},\n);\n\nThreadListItemArchive.displayName = \"ThreadListItemArchive\";\n\nconst exports = {\n Root: ThreadListItemRoot,\n Title: ThreadListItemTitle,\n Archive: ThreadListItemArchive,\n};\n\nexport default Object.assign(ThreadListItem, exports) as typeof ThreadListItem &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8D;AAC9D,0BAA4B;AAE5B,0BA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AA,UACA,eAAW,kBAAAA,SAAW,gCAAgC,SAAS;AAAA,UAC/D,SAAQ;AAAA,UACR,SAAS;AAAA,UAET,sDAAC,mCAAY;AAAA;AAAA,MACf,GACF;AAAA,IAEJ;AAAA,EACF;AAAA,EACA,CAAC;AACH;AAEA,sBAAsB,cAAc;AAEpC,IAAMC,WAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACX;AAEA,IAAO,2BAAQ,OAAO,OAAO,gBAAgBA,QAAO;","names":["classNames","exports"]}
1
+ {"version":3,"sources":["../../src/ui/thread-list-item.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ArchiveIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { ThreadListItemPrimitive } from \"../primitives\";\nimport { useThreadConfig } from \"./thread-config\";\nimport classNames from \"classnames\";\n\nconst ThreadListItem: FC = () => {\n return (\n <ThreadListItemRoot>\n <ThreadListItemTrigger>\n <ThreadListItemTitle />\n </ThreadListItemTrigger>\n <ThreadListItemArchive />\n </ThreadListItemRoot>\n );\n};\n\nconst ThreadListItemRoot = withDefaults(ThreadListItemPrimitive.Root, {\n className: \"aui-thread-list-item\",\n});\n\nThreadListItemRoot.displayName = \"ThreadListItemRoot\";\n\nconst ThreadListItemTrigger = withDefaults(ThreadListItemPrimitive.Trigger, {\n className: \"aui-thread-list-item-trigger\",\n});\n\nnamespace ThreadListItemPrimitiveTitle {\n export type Element = HTMLParagraphElement;\n export type Props = ComponentPropsWithoutRef<\"p\">;\n}\n\nconst ThreadListItemTitle = forwardRef<\n ThreadListItemPrimitiveTitle.Element,\n ThreadListItemPrimitiveTitle.Props\n>(({ className, ...props }, ref) => {\n const config = useThreadConfig();\n const fallback =\n config.strings?.threadList?.item?.title?.fallback ?? \"New Chat\";\n\n return (\n <p\n ref={ref}\n className={classNames(\"aui-thread-list-item-title\", className)}\n {...props}\n >\n <ThreadListItemPrimitive.Title fallback={fallback} />\n </p>\n );\n});\n\nThreadListItemTitle.displayName = \"ThreadListItemTitle\";\n\nconst ThreadListItemArchive = forwardRef<\n HTMLButtonElement,\n Partial<TooltipIconButton.Props>\n>(({ className, ...props }, ref) => {\n const config = useThreadConfig();\n const tooltip =\n config.strings?.threadList?.item?.archive?.tooltip ?? \"Archive thread\";\n\n return (\n <ThreadListItemPrimitive.Archive asChild>\n <TooltipIconButton\n ref={ref}\n className={classNames(\"aui-thread-list-item-archive\", className)}\n variant=\"ghost\"\n tooltip={tooltip}\n {...props}\n >\n <ArchiveIcon />\n </TooltipIconButton>\n </ThreadListItemPrimitive.Archive>\n );\n});\n\nThreadListItemArchive.displayName = \"ThreadListItemArchive\";\n\nconst exports = {\n Root: ThreadListItemRoot,\n Title: ThreadListItemTitle,\n Archive: ThreadListItemArchive,\n};\n\nexport default Object.assign(ThreadListItem, exports) as typeof ThreadListItem &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8D;AAC9D,0BAA4B;AAE5B,0BAA6B;AAC7B,iCAAkC;AAClC,wBAAwC;AACxC,2BAAgC;AAChC,wBAAuB;AAInB;AAFJ,IAAM,iBAAqB,MAAM;AAC/B,SACE,6CAAC,sBACC;AAAA,gDAAC,yBACC,sDAAC,uBAAoB,GACvB;AAAA,IACA,4CAAC,yBAAsB;AAAA,KACzB;AAEJ;AAEA,IAAM,yBAAqB,kCAAa,0CAAwB,MAAM;AAAA,EACpE,WAAW;AACb,CAAC;AAED,mBAAmB,cAAc;AAEjC,IAAM,4BAAwB,kCAAa,0CAAwB,SAAS;AAAA,EAC1E,WAAW;AACb,CAAC;AAOD,IAAM,0BAAsB,yBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,aAAS,sCAAgB;AAC/B,QAAM,WACJ,OAAO,SAAS,YAAY,MAAM,OAAO,YAAY;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,kBAAAA,SAAW,8BAA8B,SAAS;AAAA,MAC5D,GAAG;AAAA,MAEJ,sDAAC,0CAAwB,OAAxB,EAA8B,UAAoB;AAAA;AAAA,EACrD;AAEJ,CAAC;AAED,oBAAoB,cAAc;AAElC,IAAM,4BAAwB,yBAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,aAAS,sCAAgB;AAC/B,QAAM,UACJ,OAAO,SAAS,YAAY,MAAM,SAAS,WAAW;AAExD,SACE,4CAAC,0CAAwB,SAAxB,EAAgC,SAAO,MACtC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,kBAAAA,SAAW,gCAAgC,SAAS;AAAA,MAC/D,SAAQ;AAAA,MACR;AAAA,MACC,GAAG;AAAA,MAEJ,sDAAC,mCAAY;AAAA;AAAA,EACf,GACF;AAEJ,CAAC;AAED,sBAAsB,cAAc;AAEpC,IAAMC,WAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACX;AAEA,IAAO,2BAAQ,OAAO,OAAO,gBAAgBA,QAAO;","names":["classNames","exports"]}
@@ -23,11 +23,8 @@ var ThreadListItemTrigger = withDefaults(ThreadListItemPrimitive.Trigger, {
23
23
  className: "aui-thread-list-item-trigger"
24
24
  });
25
25
  var ThreadListItemTitle = forwardRef(({ className, ...props }, ref) => {
26
- const {
27
- strings: {
28
- threadList: { item: { title: { fallback = "New Chat" } = {} } = {} } = {}
29
- } = {}
30
- } = useThreadConfig();
26
+ const config = useThreadConfig();
27
+ const fallback = config.strings?.threadList?.item?.title?.fallback ?? "New Chat";
31
28
  return /* @__PURE__ */ jsx(
32
29
  "p",
33
30
  {
@@ -39,31 +36,21 @@ var ThreadListItemTitle = forwardRef(({ className, ...props }, ref) => {
39
36
  );
40
37
  });
41
38
  ThreadListItemTitle.displayName = "ThreadListItemTitle";
42
- var ThreadListItemArchive = withDefaults(
43
- forwardRef(
44
- ({ className, ...props }, ref) => {
45
- const {
46
- strings: {
47
- threadList: {
48
- item: { archive: { label = "Archive thread" } = {} } = {}
49
- } = {}
50
- } = {}
51
- } = useThreadConfig();
52
- return /* @__PURE__ */ jsx(ThreadListItemPrimitive.Archive, { asChild: true, children: /* @__PURE__ */ jsx(
53
- TooltipIconButton,
54
- {
55
- ...props,
56
- ref,
57
- className: classNames("aui-thread-list-item-archive", className),
58
- variant: "ghost",
59
- tooltip: label,
60
- children: /* @__PURE__ */ jsx(ArchiveIcon, {})
61
- }
62
- ) });
39
+ var ThreadListItemArchive = forwardRef(({ className, ...props }, ref) => {
40
+ const config = useThreadConfig();
41
+ const tooltip = config.strings?.threadList?.item?.archive?.tooltip ?? "Archive thread";
42
+ return /* @__PURE__ */ jsx(ThreadListItemPrimitive.Archive, { asChild: true, children: /* @__PURE__ */ jsx(
43
+ TooltipIconButton,
44
+ {
45
+ ref,
46
+ className: classNames("aui-thread-list-item-archive", className),
47
+ variant: "ghost",
48
+ tooltip,
49
+ ...props,
50
+ children: /* @__PURE__ */ jsx(ArchiveIcon, {})
63
51
  }
64
- ),
65
- {}
66
- );
52
+ ) });
53
+ });
67
54
  ThreadListItemArchive.displayName = "ThreadListItemArchive";
68
55
  var exports = {
69
56
  Root: ThreadListItemRoot,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/thread-list-item.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ArchiveIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { ThreadListItemPrimitive } from \"../primitives\";\nimport { useThreadConfig } from \"./thread-config\";\nimport classNames from \"classnames\";\n\nconst ThreadListItem: FC = () => {\n return (\n <ThreadListItemRoot>\n <ThreadListItemTrigger>\n <ThreadListItemTitle />\n </ThreadListItemTrigger>\n <ThreadListItemArchive />\n </ThreadListItemRoot>\n );\n};\n\nconst ThreadListItemRoot = withDefaults(ThreadListItemPrimitive.Root, {\n className: \"aui-thread-list-item\",\n});\n\nThreadListItemRoot.displayName = \"ThreadListItemRoot\";\n\nconst ThreadListItemTrigger = withDefaults(ThreadListItemPrimitive.Trigger, {\n className: \"aui-thread-list-item-trigger\",\n});\n\nnamespace ThreadListItemPrimitiveTitle {\n export type Element = HTMLParagraphElement;\n export type Props = ComponentPropsWithoutRef<\"p\">;\n}\n\nconst ThreadListItemTitle = forwardRef<\n ThreadListItemPrimitiveTitle.Element,\n ThreadListItemPrimitiveTitle.Props\n>(({ className, ...props }, ref) => {\n const {\n strings: {\n threadList: { item: { title: { fallback = \"New Chat\" } = {} } = {} } = {},\n } = {},\n } = useThreadConfig();\n\n return (\n <p\n ref={ref}\n className={classNames(\"aui-thread-list-item-title\", className)}\n {...props}\n >\n <ThreadListItemPrimitive.Title fallback={fallback} />\n </p>\n );\n});\n\nThreadListItemTitle.displayName = \"ThreadListItemTitle\";\n\nconst ThreadListItemArchive = withDefaults(\n forwardRef<HTMLButtonElement, TooltipIconButton.Props>(\n ({ className, ...props }, ref) => {\n const {\n strings: {\n threadList: {\n item: { archive: { label = \"Archive thread\" } = {} } = {},\n } = {},\n } = {},\n } = useThreadConfig();\n\n return (\n <ThreadListItemPrimitive.Archive asChild>\n <TooltipIconButton\n {...props}\n ref={ref}\n className={classNames(\"aui-thread-list-item-archive\", className)}\n variant=\"ghost\"\n tooltip={label}\n >\n <ArchiveIcon />\n </TooltipIconButton>\n </ThreadListItemPrimitive.Archive>\n );\n },\n ),\n {},\n);\n\nThreadListItemArchive.displayName = \"ThreadListItemArchive\";\n\nconst exports = {\n Root: ThreadListItemRoot,\n Title: ThreadListItemTitle,\n Archive: ThreadListItemArchive,\n};\n\nexport default Object.assign(ThreadListItem, exports) as typeof ThreadListItem &\n typeof exports;\n"],"mappings":";;;AAEA,SA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,SAAxB,EAAgC,SAAO,MACtC;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,UACA,WAAW,WAAW,gCAAgC,SAAS;AAAA,UAC/D,SAAQ;AAAA,UACR,SAAS;AAAA,UAET,8BAAC,eAAY;AAAA;AAAA,MACf,GACF;AAAA,IAEJ;AAAA,EACF;AAAA,EACA,CAAC;AACH;AAEA,sBAAsB,cAAc;AAEpC,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACX;AAEA,IAAO,2BAAQ,OAAO,OAAO,gBAAgB,OAAO;","names":[]}
1
+ {"version":3,"sources":["../../src/ui/thread-list-item.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ArchiveIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { ThreadListItemPrimitive } from \"../primitives\";\nimport { useThreadConfig } from \"./thread-config\";\nimport classNames from \"classnames\";\n\nconst ThreadListItem: FC = () => {\n return (\n <ThreadListItemRoot>\n <ThreadListItemTrigger>\n <ThreadListItemTitle />\n </ThreadListItemTrigger>\n <ThreadListItemArchive />\n </ThreadListItemRoot>\n );\n};\n\nconst ThreadListItemRoot = withDefaults(ThreadListItemPrimitive.Root, {\n className: \"aui-thread-list-item\",\n});\n\nThreadListItemRoot.displayName = \"ThreadListItemRoot\";\n\nconst ThreadListItemTrigger = withDefaults(ThreadListItemPrimitive.Trigger, {\n className: \"aui-thread-list-item-trigger\",\n});\n\nnamespace ThreadListItemPrimitiveTitle {\n export type Element = HTMLParagraphElement;\n export type Props = ComponentPropsWithoutRef<\"p\">;\n}\n\nconst ThreadListItemTitle = forwardRef<\n ThreadListItemPrimitiveTitle.Element,\n ThreadListItemPrimitiveTitle.Props\n>(({ className, ...props }, ref) => {\n const config = useThreadConfig();\n const fallback =\n config.strings?.threadList?.item?.title?.fallback ?? \"New Chat\";\n\n return (\n <p\n ref={ref}\n className={classNames(\"aui-thread-list-item-title\", className)}\n {...props}\n >\n <ThreadListItemPrimitive.Title fallback={fallback} />\n </p>\n );\n});\n\nThreadListItemTitle.displayName = \"ThreadListItemTitle\";\n\nconst ThreadListItemArchive = forwardRef<\n HTMLButtonElement,\n Partial<TooltipIconButton.Props>\n>(({ className, ...props }, ref) => {\n const config = useThreadConfig();\n const tooltip =\n config.strings?.threadList?.item?.archive?.tooltip ?? \"Archive thread\";\n\n return (\n <ThreadListItemPrimitive.Archive asChild>\n <TooltipIconButton\n ref={ref}\n className={classNames(\"aui-thread-list-item-archive\", className)}\n variant=\"ghost\"\n tooltip={tooltip}\n {...props}\n >\n <ArchiveIcon />\n </TooltipIconButton>\n </ThreadListItemPrimitive.Archive>\n );\n});\n\nThreadListItemArchive.displayName = \"ThreadListItemArchive\";\n\nconst exports = {\n Root: ThreadListItemRoot,\n Title: ThreadListItemTitle,\n Archive: ThreadListItemArchive,\n};\n\nexport default Object.assign(ThreadListItem, exports) as typeof ThreadListItem &\n typeof exports;\n"],"mappings":";;;AAEA,SAAmC,kBAA2B;AAC9D,SAAS,mBAAmB;AAE5B,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAClC,SAAS,+BAA+B;AACxC,SAAS,uBAAuB;AAChC,OAAO,gBAAgB;AAInB,SAEI,KAFJ;AAFJ,IAAM,iBAAqB,MAAM;AAC/B,SACE,qBAAC,sBACC;AAAA,wBAAC,yBACC,8BAAC,uBAAoB,GACvB;AAAA,IACA,oBAAC,yBAAsB;AAAA,KACzB;AAEJ;AAEA,IAAM,qBAAqB,aAAa,wBAAwB,MAAM;AAAA,EACpE,WAAW;AACb,CAAC;AAED,mBAAmB,cAAc;AAEjC,IAAM,wBAAwB,aAAa,wBAAwB,SAAS;AAAA,EAC1E,WAAW;AACb,CAAC;AAOD,IAAM,sBAAsB,WAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,SAAS,gBAAgB;AAC/B,QAAM,WACJ,OAAO,SAAS,YAAY,MAAM,OAAO,YAAY;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,WAAW,8BAA8B,SAAS;AAAA,MAC5D,GAAG;AAAA,MAEJ,8BAAC,wBAAwB,OAAxB,EAA8B,UAAoB;AAAA;AAAA,EACrD;AAEJ,CAAC;AAED,oBAAoB,cAAc;AAElC,IAAM,wBAAwB,WAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,SAAS,gBAAgB;AAC/B,QAAM,UACJ,OAAO,SAAS,YAAY,MAAM,SAAS,WAAW;AAExD,SACE,oBAAC,wBAAwB,SAAxB,EAAgC,SAAO,MACtC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,WAAW,gCAAgC,SAAS;AAAA,MAC/D,SAAQ;AAAA,MACR;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAC,eAAY;AAAA;AAAA,EACf,GACF;AAEJ,CAAC;AAED,sBAAsB,cAAc;AAEpC,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACX;AAEA,IAAO,2BAAQ,OAAO,OAAO,gBAAgB,OAAO;","names":[]}
@@ -1,6 +1,15 @@
1
1
  import { type FC } from "react";
2
2
  import { ThreadListPrimitive } from "../primitives";
3
3
  declare const ThreadList: FC;
4
+ declare namespace ThreadListItems {
5
+ type Props = {
6
+ /**
7
+ * Optional custom components to override default thread list items
8
+ */
9
+ components?: Partial<ThreadListPrimitive.Items.Props["components"]>;
10
+ };
11
+ }
12
+ declare const ThreadListItems: FC<ThreadListItems.Props>;
4
13
  declare const exports: {
5
14
  Root: import("react").ForwardRefExoticComponent<Partial<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
6
15
  New: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
@@ -11,9 +20,7 @@ declare const exports: {
11
20
  variant?: "default" | "outline" | "ghost" | null | undefined;
12
21
  size?: "default" | "icon" | null | undefined;
13
22
  } & import("class-variance-authority/types").ClassProp) | undefined) => string> & import("react").RefAttributes<HTMLButtonElement>>;
14
- Items: FC<{
15
- components?: Partial<ThreadListPrimitive.Items.Props["components"]>;
16
- }>;
23
+ Items: FC<ThreadListItems.Props>;
17
24
  };
18
25
  declare const _default: typeof ThreadList & typeof exports;
19
26
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"thread-list.d.ts","sourceRoot":"","sources":["../../src/ui/thread-list.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAKpD,QAAA,MAAM,UAAU,EAAE,EAOjB,CAAC;AA8CF,QAAA,MAAM,OAAO;;;;;;;;;;;qBAdE,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;;CAkBpE,CAAC;wBAEmD,OAAO,UAAU,GACpE,OAAO,OAAO;AADhB,wBACiB"}
1
+ {"version":3,"file":"thread-list.d.ts","sourceRoot":"","sources":["../../src/ui/thread-list.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAKpD,QAAA,MAAM,UAAU,EAAE,EAOjB,CAAC;AA8BF,kBAAU,eAAe,CAAC;IACxB,KAAY,KAAK,GAAG;QAClB;;WAEG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;KACrE,CAAC;CACH;AAED,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAS9C,CAAC;AAIF,QAAA,MAAM,OAAO;;;;;;;;;;;CAIZ,CAAC;wBAEmD,OAAO,UAAU,GACpE,OAAO,OAAO;AADhB,wBACiB"}
@@ -36,11 +36,11 @@ __export(thread_list_exports, {
36
36
  module.exports = __toCommonJS(thread_list_exports);
37
37
  var import_react = require("react");
38
38
  var import_lucide_react = require("lucide-react");
39
- var import_withDefaults = require("./utils/withDefaults.cjs");
40
- var import_primitives = require("../primitives/index.cjs");
41
- var import_thread_list_item = __toESM(require("./thread-list-item.cjs"));
42
- var import_thread_config = require("./thread-config.cjs");
43
- var import_base = require("./base/index.cjs");
39
+ var import_withDefaults = require("./utils/withDefaults.js");
40
+ var import_primitives = require("../primitives/index.js");
41
+ var import_thread_list_item = __toESM(require("./thread-list-item.js"));
42
+ var import_thread_config = require("./thread-config.js");
43
+ var import_base = require("./base/index.js");
44
44
  var import_jsx_runtime = require("react/jsx-runtime");
45
45
  var ThreadList = () => {
46
46
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ThreadListRoot, { children: [
@@ -53,16 +53,15 @@ var ThreadListRoot = (0, import_withDefaults.withDefaults)("div", {
53
53
  });
54
54
  ThreadListRoot.displayName = "ThreadListRoot";
55
55
  var ThreadListNew = (0, import_react.forwardRef)((props, ref) => {
56
- const {
57
- strings: { threadList: { new: { label = "New Thread" } = {} } = {} } = {}
58
- } = (0, import_thread_config.useThreadConfig)();
56
+ const config = (0, import_thread_config.useThreadConfig)();
57
+ const label = config.strings?.threadList?.new?.label ?? "New Thread";
59
58
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ThreadListPrimitive.New, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
60
59
  import_base.Button,
61
60
  {
62
- ...props,
63
61
  ref,
64
62
  className: "aui-thread-list-new",
65
63
  variant: "ghost",
64
+ ...props,
66
65
  children: [
67
66
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.PlusIcon, {}),
68
67
  label
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/thread-list.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { ThreadListPrimitive } from \"../primitives\";\nimport ThreadListItem from \"./thread-list-item\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { Button, ButtonProps } from \"./base\";\n\nconst ThreadList: FC = () => {\n return (\n <ThreadListRoot>\n <ThreadListNew />\n <ThreadListItems />\n </ThreadListRoot>\n );\n};\n\nconst ThreadListRoot = withDefaults(\"div\", {\n className: \"aui-root aui-thread-list-root\",\n});\nThreadListRoot.displayName = \"ThreadListRoot\";\n\nconst ThreadListNew = forwardRef<\n HTMLButtonElement,\n ThreadListPrimitive.New.Props & ButtonProps\n>((props, ref) => {\n const {\n strings: { threadList: { new: { label = \"New Thread\" } = {} } = {} } = {},\n } = useThreadConfig();\n\n return (\n <ThreadListPrimitive.New asChild>\n <Button\n {...props}\n ref={ref}\n className=\"aui-thread-list-new\"\n variant=\"ghost\"\n >\n <PlusIcon />\n {label}\n </Button>\n </ThreadListPrimitive.New>\n );\n});\nThreadListNew.displayName = \"ThreadListNew\";\n\nconst ThreadListItems: FC<{\n components?: Partial<ThreadListPrimitive.Items.Props[\"components\"]>;\n}> = ({ components }) => {\n return (\n <ThreadListPrimitive.Items\n components={{\n ...components,\n ThreadListItem: components?.ThreadListItem ?? ThreadListItem,\n }}\n />\n );\n};\n\nThreadListItems.displayName = \"ThreadListItems\";\n\nconst exports = {\n Root: ThreadListRoot,\n New: ThreadListNew,\n Items: ThreadListItems,\n};\n\nexport default Object.assign(ThreadList, exports) as typeof ThreadList &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAoC;AACpC,0BAAyB;AAEzB,0BAA6B;AAC7B,wBAAoC;AACpC,8BAA2B;AAC3B,2BAAgC;AAChC,kBAAoC;AAIhC;AAFJ,IAAM,aAAiB,MAAM;AAC3B,SACE,6CAAC,kBACC;AAAA,gDAAC,iBAAc;AAAA,IACf,4CAAC,mBAAgB;AAAA,KACnB;AAEJ;AAEA,IAAM,qBAAiB,kCAAa,OAAO;AAAA,EACzC,WAAW;AACb,CAAC;AACD,eAAe,cAAc;AAE7B,IAAM,oBAAgB,yBAGpB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,aAAa,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EAC1E,QAAI,sCAAgB;AAEpB,SACE,4CAAC,sCAAoB,KAApB,EAAwB,SAAO,MAC9B;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,WAAU;AAAA,MACV,SAAQ;AAAA,MAER;AAAA,oDAAC,gCAAS;AAAA,QACT;AAAA;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AACD,cAAc,cAAc;AAE5B,IAAM,kBAED,CAAC,EAAE,WAAW,MAAM;AACvB,SACE;AAAA,IAAC,sCAAoB;AAAA,IAApB;AAAA,MACC,YAAY;AAAA,QACV,GAAG;AAAA,QACH,gBAAgB,YAAY,kBAAkB,wBAAAA;AAAA,MAChD;AAAA;AAAA,EACF;AAEJ;AAEA,gBAAgB,cAAc;AAE9B,IAAMC,WAAU;AAAA,EACd,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AACT;AAEA,IAAO,sBAAQ,OAAO,OAAO,YAAYA,QAAO;","names":["ThreadListItem","exports"]}
1
+ {"version":3,"sources":["../../src/ui/thread-list.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { ThreadListPrimitive } from \"../primitives\";\nimport ThreadListItem from \"./thread-list-item\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { Button, ButtonProps } from \"./base\";\n\nconst ThreadList: FC = () => {\n return (\n <ThreadListRoot>\n <ThreadListNew />\n <ThreadListItems />\n </ThreadListRoot>\n );\n};\n\nconst ThreadListRoot = withDefaults(\"div\", {\n className: \"aui-root aui-thread-list-root\",\n});\nThreadListRoot.displayName = \"ThreadListRoot\";\n\nconst ThreadListNew = forwardRef<\n HTMLButtonElement,\n ThreadListPrimitive.New.Props & ButtonProps\n>((props, ref) => {\n const config = useThreadConfig();\n const label = config.strings?.threadList?.new?.label ?? \"New Thread\";\n\n return (\n <ThreadListPrimitive.New asChild>\n <Button\n ref={ref}\n className=\"aui-thread-list-new\"\n variant=\"ghost\"\n {...props}\n >\n <PlusIcon />\n {label}\n </Button>\n </ThreadListPrimitive.New>\n );\n});\nThreadListNew.displayName = \"ThreadListNew\";\n\nnamespace ThreadListItems {\n export type Props = {\n /**\n * Optional custom components to override default thread list items\n */\n components?: Partial<ThreadListPrimitive.Items.Props[\"components\"]>;\n };\n}\n\nconst ThreadListItems: FC<ThreadListItems.Props> = ({ components }) => {\n return (\n <ThreadListPrimitive.Items\n components={{\n ...components,\n ThreadListItem: components?.ThreadListItem ?? ThreadListItem,\n }}\n />\n );\n};\n\nThreadListItems.displayName = \"ThreadListItems\";\n\nconst exports = {\n Root: ThreadListRoot,\n New: ThreadListNew,\n Items: ThreadListItems,\n};\n\nexport default Object.assign(ThreadList, exports) as typeof ThreadList &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAoC;AACpC,0BAAyB;AAEzB,0BAA6B;AAC7B,wBAAoC;AACpC,8BAA2B;AAC3B,2BAAgC;AAChC,kBAAoC;AAIhC;AAFJ,IAAM,aAAiB,MAAM;AAC3B,SACE,6CAAC,kBACC;AAAA,gDAAC,iBAAc;AAAA,IACf,4CAAC,mBAAgB;AAAA,KACnB;AAEJ;AAEA,IAAM,qBAAiB,kCAAa,OAAO;AAAA,EACzC,WAAW;AACb,CAAC;AACD,eAAe,cAAc;AAE7B,IAAM,oBAAgB,yBAGpB,CAAC,OAAO,QAAQ;AAChB,QAAM,aAAS,sCAAgB;AAC/B,QAAM,QAAQ,OAAO,SAAS,YAAY,KAAK,SAAS;AAExD,SACE,4CAAC,sCAAoB,KAApB,EAAwB,SAAO,MAC9B;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAU;AAAA,MACV,SAAQ;AAAA,MACP,GAAG;AAAA,MAEJ;AAAA,oDAAC,gCAAS;AAAA,QACT;AAAA;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AACD,cAAc,cAAc;AAW5B,IAAM,kBAA6C,CAAC,EAAE,WAAW,MAAM;AACrE,SACE;AAAA,IAAC,sCAAoB;AAAA,IAApB;AAAA,MACC,YAAY;AAAA,QACV,GAAG;AAAA,QACH,gBAAgB,YAAY,kBAAkB,wBAAAA;AAAA,MAChD;AAAA;AAAA,EACF;AAEJ;AAEA,gBAAgB,cAAc;AAE9B,IAAMC,WAAU;AAAA,EACd,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AACT;AAEA,IAAO,sBAAQ,OAAO,OAAO,YAAYA,QAAO;","names":["ThreadListItem","exports"]}
@@ -20,16 +20,15 @@ var ThreadListRoot = withDefaults("div", {
20
20
  });
21
21
  ThreadListRoot.displayName = "ThreadListRoot";
22
22
  var ThreadListNew = forwardRef((props, ref) => {
23
- const {
24
- strings: { threadList: { new: { label = "New Thread" } = {} } = {} } = {}
25
- } = useThreadConfig();
23
+ const config = useThreadConfig();
24
+ const label = config.strings?.threadList?.new?.label ?? "New Thread";
26
25
  return /* @__PURE__ */ jsx(ThreadListPrimitive.New, { asChild: true, children: /* @__PURE__ */ jsxs(
27
26
  Button,
28
27
  {
29
- ...props,
30
28
  ref,
31
29
  className: "aui-thread-list-new",
32
30
  variant: "ghost",
31
+ ...props,
33
32
  children: [
34
33
  /* @__PURE__ */ jsx(PlusIcon, {}),
35
34
  label
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/thread-list.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { ThreadListPrimitive } from \"../primitives\";\nimport ThreadListItem from \"./thread-list-item\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { Button, ButtonProps } from \"./base\";\n\nconst ThreadList: FC = () => {\n return (\n <ThreadListRoot>\n <ThreadListNew />\n <ThreadListItems />\n </ThreadListRoot>\n );\n};\n\nconst ThreadListRoot = withDefaults(\"div\", {\n className: \"aui-root aui-thread-list-root\",\n});\nThreadListRoot.displayName = \"ThreadListRoot\";\n\nconst ThreadListNew = forwardRef<\n HTMLButtonElement,\n ThreadListPrimitive.New.Props & ButtonProps\n>((props, ref) => {\n const {\n strings: { threadList: { new: { label = \"New Thread\" } = {} } = {} } = {},\n } = useThreadConfig();\n\n return (\n <ThreadListPrimitive.New asChild>\n <Button\n {...props}\n ref={ref}\n className=\"aui-thread-list-new\"\n variant=\"ghost\"\n >\n <PlusIcon />\n {label}\n </Button>\n </ThreadListPrimitive.New>\n );\n});\nThreadListNew.displayName = \"ThreadListNew\";\n\nconst ThreadListItems: FC<{\n components?: Partial<ThreadListPrimitive.Items.Props[\"components\"]>;\n}> = ({ components }) => {\n return (\n <ThreadListPrimitive.Items\n components={{\n ...components,\n ThreadListItem: components?.ThreadListItem ?? ThreadListItem,\n }}\n />\n );\n};\n\nThreadListItems.displayName = \"ThreadListItems\";\n\nconst exports = {\n Root: ThreadListRoot,\n New: ThreadListNew,\n Items: ThreadListItems,\n};\n\nexport default Object.assign(ThreadList, exports) as typeof ThreadList &\n typeof exports;\n"],"mappings":";;;AAEA,SAAS,kBAA2B;AACpC,SAAS,gBAAgB;AAEzB,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AACpC,OAAO,oBAAoB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,cAA2B;AAIhC,SACE,KADF;AAFJ,IAAM,aAAiB,MAAM;AAC3B,SACE,qBAAC,kBACC;AAAA,wBAAC,iBAAc;AAAA,IACf,oBAAC,mBAAgB;AAAA,KACnB;AAEJ;AAEA,IAAM,iBAAiB,aAAa,OAAO;AAAA,EACzC,WAAW;AACb,CAAC;AACD,eAAe,cAAc;AAE7B,IAAM,gBAAgB,WAGpB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,aAAa,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EAC1E,IAAI,gBAAgB;AAEpB,SACE,oBAAC,oBAAoB,KAApB,EAAwB,SAAO,MAC9B;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,WAAU;AAAA,MACV,SAAQ;AAAA,MAER;AAAA,4BAAC,YAAS;AAAA,QACT;AAAA;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AACD,cAAc,cAAc;AAE5B,IAAM,kBAED,CAAC,EAAE,WAAW,MAAM;AACvB,SACE;AAAA,IAAC,oBAAoB;AAAA,IAApB;AAAA,MACC,YAAY;AAAA,QACV,GAAG;AAAA,QACH,gBAAgB,YAAY,kBAAkB;AAAA,MAChD;AAAA;AAAA,EACF;AAEJ;AAEA,gBAAgB,cAAc;AAE9B,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AACT;AAEA,IAAO,sBAAQ,OAAO,OAAO,YAAY,OAAO;","names":[]}
1
+ {"version":3,"sources":["../../src/ui/thread-list.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { ThreadListPrimitive } from \"../primitives\";\nimport ThreadListItem from \"./thread-list-item\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { Button, ButtonProps } from \"./base\";\n\nconst ThreadList: FC = () => {\n return (\n <ThreadListRoot>\n <ThreadListNew />\n <ThreadListItems />\n </ThreadListRoot>\n );\n};\n\nconst ThreadListRoot = withDefaults(\"div\", {\n className: \"aui-root aui-thread-list-root\",\n});\nThreadListRoot.displayName = \"ThreadListRoot\";\n\nconst ThreadListNew = forwardRef<\n HTMLButtonElement,\n ThreadListPrimitive.New.Props & ButtonProps\n>((props, ref) => {\n const config = useThreadConfig();\n const label = config.strings?.threadList?.new?.label ?? \"New Thread\";\n\n return (\n <ThreadListPrimitive.New asChild>\n <Button\n ref={ref}\n className=\"aui-thread-list-new\"\n variant=\"ghost\"\n {...props}\n >\n <PlusIcon />\n {label}\n </Button>\n </ThreadListPrimitive.New>\n );\n});\nThreadListNew.displayName = \"ThreadListNew\";\n\nnamespace ThreadListItems {\n export type Props = {\n /**\n * Optional custom components to override default thread list items\n */\n components?: Partial<ThreadListPrimitive.Items.Props[\"components\"]>;\n };\n}\n\nconst ThreadListItems: FC<ThreadListItems.Props> = ({ components }) => {\n return (\n <ThreadListPrimitive.Items\n components={{\n ...components,\n ThreadListItem: components?.ThreadListItem ?? ThreadListItem,\n }}\n />\n );\n};\n\nThreadListItems.displayName = \"ThreadListItems\";\n\nconst exports = {\n Root: ThreadListRoot,\n New: ThreadListNew,\n Items: ThreadListItems,\n};\n\nexport default Object.assign(ThreadList, exports) as typeof ThreadList &\n typeof exports;\n"],"mappings":";;;AAEA,SAAS,kBAA2B;AACpC,SAAS,gBAAgB;AAEzB,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AACpC,OAAO,oBAAoB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,cAA2B;AAIhC,SACE,KADF;AAFJ,IAAM,aAAiB,MAAM;AAC3B,SACE,qBAAC,kBACC;AAAA,wBAAC,iBAAc;AAAA,IACf,oBAAC,mBAAgB;AAAA,KACnB;AAEJ;AAEA,IAAM,iBAAiB,aAAa,OAAO;AAAA,EACzC,WAAW;AACb,CAAC;AACD,eAAe,cAAc;AAE7B,IAAM,gBAAgB,WAGpB,CAAC,OAAO,QAAQ;AAChB,QAAM,SAAS,gBAAgB;AAC/B,QAAM,QAAQ,OAAO,SAAS,YAAY,KAAK,SAAS;AAExD,SACE,oBAAC,oBAAoB,KAApB,EAAwB,SAAO,MAC9B;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAU;AAAA,MACV,SAAQ;AAAA,MACP,GAAG;AAAA,MAEJ;AAAA,4BAAC,YAAS;AAAA,QACT;AAAA;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AACD,cAAc,cAAc;AAW5B,IAAM,kBAA6C,CAAC,EAAE,WAAW,MAAM;AACrE,SACE;AAAA,IAAC,oBAAoB;AAAA,IAApB;AAAA,MACC,YAAY;AAAA,QACV,GAAG;AAAA,QACH,gBAAgB,YAAY,kBAAkB;AAAA,MAChD;AAAA;AAAA,EACF;AAEJ;AAEA,gBAAgB,cAAc;AAE9B,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AACT;AAEA,IAAO,sBAAQ,OAAO,OAAO,YAAY,OAAO;","names":[]}
@@ -25,11 +25,11 @@ __export(thread_welcome_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(thread_welcome_exports);
27
27
  var import_react = require("react");
28
- var import_withDefaults = require("./utils/withDefaults.cjs");
29
- var import_avatar = require("./base/avatar.cjs");
30
- var import_thread_config = require("./thread-config.cjs");
31
- var import_primitives = require("../primitives/index.cjs");
32
- var import_context = require("../context/index.cjs");
28
+ var import_withDefaults = require("./utils/withDefaults.js");
29
+ var import_avatar = require("./base/avatar.js");
30
+ var import_thread_config = require("./thread-config.js");
31
+ var import_primitives = require("../primitives/index.js");
32
+ var import_context = require("../context/index.js");
33
33
  var import_jsx_runtime = require("react/jsx-runtime");
34
34
  var ThreadWelcome = () => {
35
35
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ThreadWelcomeRoot, { children: [
package/dist/ui/thread.js CHANGED
@@ -36,16 +36,16 @@ __export(thread_exports, {
36
36
  module.exports = __toCommonJS(thread_exports);
37
37
  var import_react = require("react");
38
38
  var import_lucide_react = require("lucide-react");
39
- var import_withDefaults = require("./utils/withDefaults.cjs");
40
- var import_composer = __toESM(require("./composer.cjs"));
41
- var import_thread_welcome = __toESM(require("./thread-welcome.cjs"));
42
- var import_tooltip_icon_button = require("./base/tooltip-icon-button.cjs");
43
- var import_assistant_message = __toESM(require("./assistant-message.cjs"));
44
- var import_user_message = __toESM(require("./user-message.cjs"));
45
- var import_edit_composer = __toESM(require("./edit-composer.cjs"));
46
- var import_thread_config = require("./thread-config.cjs");
47
- var import_primitives = require("../primitives/index.cjs");
48
- var import_context = require("../context/index.cjs");
39
+ var import_withDefaults = require("./utils/withDefaults.js");
40
+ var import_composer = __toESM(require("./composer.js"));
41
+ var import_thread_welcome = __toESM(require("./thread-welcome.js"));
42
+ var import_tooltip_icon_button = require("./base/tooltip-icon-button.js");
43
+ var import_assistant_message = __toESM(require("./assistant-message.js"));
44
+ var import_user_message = __toESM(require("./user-message.js"));
45
+ var import_edit_composer = __toESM(require("./edit-composer.js"));
46
+ var import_thread_config = require("./thread-config.js");
47
+ var import_primitives = require("../primitives/index.js");
48
+ var import_context = require("../context/index.js");
49
49
  var import_jsx_runtime = require("react/jsx-runtime");
50
50
  var Thread = (config) => {
51
51
  const {
@@ -26,11 +26,11 @@ __export(user_action_bar_exports, {
26
26
  module.exports = __toCommonJS(user_action_bar_exports);
27
27
  var import_react = require("react");
28
28
  var import_lucide_react = require("lucide-react");
29
- var import_tooltip_icon_button = require("./base/tooltip-icon-button.cjs");
30
- var import_withDefaults = require("./utils/withDefaults.cjs");
31
- var import_thread_config = require("./thread-config.cjs");
32
- var import_context = require("../context/index.cjs");
33
- var import_primitives = require("../primitives/index.cjs");
29
+ var import_tooltip_icon_button = require("./base/tooltip-icon-button.js");
30
+ var import_withDefaults = require("./utils/withDefaults.js");
31
+ var import_thread_config = require("./thread-config.js");
32
+ var import_context = require("../context/index.js");
33
+ var import_primitives = require("../primitives/index.js");
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var useAllowEdit = (ensureCapability = false) => {
36
36
  const { userMessage: { allowEdit = true } = {} } = (0, import_thread_config.useThreadConfig)();