@rolder/kit 3.0.0-alpha.11 → 3.0.0-alpha.112

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 (299) hide show
  1. package/dist/ai/index.d.ts +2 -0
  2. package/dist/ai/index.js +2 -0
  3. package/dist/ai/ui/chat/Root.d.ts +55 -0
  4. package/dist/ai/ui/chat/Root.js +18 -0
  5. package/dist/ai/ui/chat/chatInput/File.js +71 -0
  6. package/dist/ai/ui/chat/chatInput/FileIcon.js +43 -0
  7. package/dist/ai/ui/chat/chatInput/Root.d.ts +9 -0
  8. package/dist/ai/ui/chat/chatInput/Root.js +24 -0
  9. package/dist/ai/ui/chat/chatInput/Submit.js +23 -0
  10. package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.js +8 -7
  11. package/dist/ai/ui/{promptInput → chat/chatInput}/index.d.ts +2 -3
  12. package/dist/ai/ui/{promptInput → chat/chatInput}/index.js +2 -2
  13. package/dist/ai/ui/chat/chatInput/store/file.d.ts +8 -0
  14. package/dist/ai/ui/chat/chatInput/store/file.js +32 -0
  15. package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.d.ts +2 -0
  16. package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.js +21 -0
  17. package/dist/ai/ui/chat/chatInput/store/index.d.ts +2 -0
  18. package/dist/ai/ui/chat/chatInput/store/index.js +2 -0
  19. package/dist/ai/ui/chat/chatInput/store/input.d.ts +13 -0
  20. package/dist/ai/ui/chat/chatInput/store/input.js +81 -0
  21. package/dist/ai/ui/chat/chatInput/store/parseFile.d.ts +2 -0
  22. package/dist/ai/ui/chat/chatInput/store/parseFile.js +23 -0
  23. package/dist/ai/ui/chat/index.d.ts +12 -0
  24. package/dist/ai/ui/chat/index.js +15 -0
  25. package/dist/ai/ui/chat/messages/Empty.d.ts +4 -0
  26. package/dist/ai/ui/chat/messages/Empty.js +11 -0
  27. package/dist/ai/ui/chat/messages/Loader.d.ts +5 -0
  28. package/dist/ai/ui/chat/messages/Loader.js +12 -0
  29. package/dist/ai/ui/chat/messages/Message.d.ts +8 -0
  30. package/dist/ai/ui/chat/messages/Message.js +22 -0
  31. package/dist/ai/ui/chat/messages/Messages.d.ts +3 -0
  32. package/dist/ai/ui/chat/messages/Messages.js +40 -0
  33. package/dist/ai/ui/chat/messages/index.d.ts +2 -0
  34. package/dist/ai/ui/chat/messages/index.js +2 -0
  35. package/dist/ai/ui/chat/parts/File.d.ts +6 -0
  36. package/dist/ai/ui/{conversation → chat/parts}/File.js +10 -10
  37. package/dist/ai/ui/chat/parts/FileIcon.js +43 -0
  38. package/dist/ai/ui/chat/parts/PartPaper.d.ts +8 -0
  39. package/dist/ai/ui/chat/parts/PartPaper.js +14 -0
  40. package/dist/ai/ui/chat/parts/TextPart.d.ts +6 -0
  41. package/dist/ai/ui/chat/parts/TextPart.js +15 -0
  42. package/dist/ai/ui/chat/parts/ToolExecution.d.ts +7 -0
  43. package/dist/ai/ui/chat/parts/ToolExecution.js +56 -0
  44. package/dist/ai/ui/chat/parts/ToolPart.d.ts +10 -0
  45. package/dist/ai/ui/chat/parts/ToolPart.js +24 -0
  46. package/dist/ai/ui/chat/parts/index.d.ts +3 -0
  47. package/dist/ai/ui/chat/parts/index.js +3 -0
  48. package/dist/ai/ui/chat/store/index.d.ts +4 -0
  49. package/dist/ai/ui/chat/store/index.js +4 -0
  50. package/dist/ai/ui/chat/store/messages.d.ts +12 -0
  51. package/dist/ai/ui/chat/store/messages.js +40 -0
  52. package/dist/ai/ui/chat/store/send.d.ts +14 -0
  53. package/dist/ai/ui/chat/store/send.js +16 -0
  54. package/dist/ai/ui/chat/store/states.d.ts +11 -0
  55. package/dist/ai/ui/chat/store/states.js +20 -0
  56. package/dist/ai/ui/chat/store/useInitChat.d.ts +3 -0
  57. package/dist/ai/ui/chat/store/useInitChat.js +40 -0
  58. package/dist/ai/ui/index.d.ts +1 -0
  59. package/dist/ai/ui/index.js +1 -0
  60. package/dist/ai/utils/index.d.ts +2 -0
  61. package/dist/ai/utils/index.js +2 -0
  62. package/dist/app/AppDefaults.js +1 -1
  63. package/dist/app/DefaultApp.js +1 -1
  64. package/dist/app/cookieColorSchemeManager.js +1 -1
  65. package/dist/app/defaultTheme.d.ts +7 -7
  66. package/dist/app/index.d.ts +3 -0
  67. package/dist/app/index.js +3 -0
  68. package/dist/betterAuth/client/getAuthClient.d.ts +3050 -0
  69. package/dist/betterAuth/client/getAuthClient.js +18 -0
  70. package/dist/betterAuth/client/index.d.ts +1 -0
  71. package/dist/betterAuth/client/index.js +1 -0
  72. package/dist/betterAuth/index.d.ts +3 -0
  73. package/dist/betterAuth/index.js +3 -0
  74. package/dist/betterAuth/server/defaultAuthServerConfig.d.ts +452 -0
  75. package/dist/betterAuth/server/defaultAuthServerConfig.js +49 -0
  76. package/dist/betterAuth/server/env.d.ts +1 -0
  77. package/dist/betterAuth/server/env.js +8 -0
  78. package/dist/betterAuth/server/getDBSession.d.ts +2 -0
  79. package/dist/betterAuth/server/getDBSession.js +85 -0
  80. package/dist/betterAuth/server/getSessionToken.d.ts +1 -0
  81. package/dist/betterAuth/server/getSessionToken.js +14 -0
  82. package/dist/betterAuth/server/getSessionUser.d.ts +1 -0
  83. package/dist/betterAuth/server/getSessionUser.js +22 -0
  84. package/dist/betterAuth/server/index.d.ts +10 -0
  85. package/dist/betterAuth/server/index.js +11 -0
  86. package/dist/betterAuth/server/surrealDbAdapter/adapter.d.ts +8 -0
  87. package/dist/betterAuth/server/surrealDbAdapter/adapter.js +64 -0
  88. package/dist/betterAuth/server/surrealDbAdapter/adapter.test.d.ts +1 -0
  89. package/dist/betterAuth/server/surrealDbAdapter/adapter.test.js +84 -0
  90. package/dist/betterAuth/server/surrealDbAdapter/db/getDB.d.ts +2 -0
  91. package/dist/betterAuth/server/surrealDbAdapter/db/getDB.js +26 -0
  92. package/dist/betterAuth/server/surrealDbAdapter/db/index.d.ts +1 -0
  93. package/dist/betterAuth/server/surrealDbAdapter/db/index.js +1 -0
  94. package/dist/betterAuth/server/surrealDbAdapter/db/schema.d.ts +1 -0
  95. package/dist/betterAuth/server/surrealDbAdapter/db/schema.js +97 -0
  96. package/dist/betterAuth/server/surrealDbAdapter/index.d.ts +1 -0
  97. package/dist/betterAuth/server/surrealDbAdapter/index.js +1 -0
  98. package/dist/betterAuth/server/surrealDbAdapter/methods/count.d.ts +2 -0
  99. package/dist/betterAuth/server/surrealDbAdapter/methods/count.js +17 -0
  100. package/dist/betterAuth/server/surrealDbAdapter/methods/create.d.ts +2 -0
  101. package/dist/betterAuth/server/surrealDbAdapter/methods/create.js +21 -0
  102. package/dist/betterAuth/server/surrealDbAdapter/methods/delete.d.ts +2 -0
  103. package/dist/betterAuth/server/surrealDbAdapter/methods/delete.js +18 -0
  104. package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.d.ts +2 -0
  105. package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.js +19 -0
  106. package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.d.ts +2 -0
  107. package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.js +51 -0
  108. package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.d.ts +2 -0
  109. package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.js +42 -0
  110. package/dist/betterAuth/server/surrealDbAdapter/methods/index.d.ts +8 -0
  111. package/dist/betterAuth/server/surrealDbAdapter/methods/index.js +8 -0
  112. package/dist/betterAuth/server/surrealDbAdapter/methods/types.d.ts +56 -0
  113. package/dist/betterAuth/server/surrealDbAdapter/methods/update.d.ts +2 -0
  114. package/dist/betterAuth/server/surrealDbAdapter/methods/update.js +25 -0
  115. package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.d.ts +2 -0
  116. package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.js +21 -0
  117. package/dist/betterAuth/server/surrealDbAdapter/types.d.ts +2 -0
  118. package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.d.ts +2 -0
  119. package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.js +31 -0
  120. package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.d.ts +3 -0
  121. package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.js +58 -0
  122. package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.d.ts +9 -0
  123. package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.js +46 -0
  124. package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.d.ts +1 -0
  125. package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.js +5 -0
  126. package/dist/betterAuth/server/surrealDbAdapter/utils/index.d.ts +6 -0
  127. package/dist/betterAuth/server/surrealDbAdapter/utils/index.js +6 -0
  128. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.d.ts +2 -0
  129. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.js +43 -0
  130. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.d.ts +2 -0
  131. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.js +38 -0
  132. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.d.ts +2 -0
  133. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.js +33 -0
  134. package/dist/betterAuth/server/surrealDbAdapter/utils/types.d.ts +34 -0
  135. package/dist/betterAuth/server/types.d.ts +8 -0
  136. package/dist/betterAuth/useSessionUser.d.ts +1 -0
  137. package/dist/betterAuth/useSessionUser.js +8 -0
  138. package/dist/hooks/index.d.ts +2 -0
  139. package/dist/hooks/index.js +2 -0
  140. package/dist/styles.css +3 -8
  141. package/dist/surrealDB/deafaultCrud.d.ts +2 -0
  142. package/dist/{surreal → surrealDB}/deafaultCrud.js +6 -5
  143. package/dist/surrealDB/getDBInstance.d.ts +3 -0
  144. package/dist/surrealDB/getDBInstance.js +34 -0
  145. package/dist/surrealDB/getDBInstanceTanstack.d.ts +3 -0
  146. package/dist/{surreal/connection.js → surrealDB/getDBInstanceTanstack.js} +2 -2
  147. package/dist/surrealDB/index.d.ts +6 -0
  148. package/dist/surrealDB/index.js +6 -0
  149. package/dist/{surreal/connection.d.ts → surrealDB/types.d.ts} +3 -3
  150. package/dist/surrealDB/types.js +0 -0
  151. package/dist/tanstack/cookie/index.d.ts +3 -0
  152. package/dist/tanstack/cookie/index.js +4 -0
  153. package/dist/{functions → tanstack/cookie}/setCookie.d.ts +1 -1
  154. package/dist/tanstack/index.d.ts +3 -0
  155. package/dist/tanstack/index.js +3 -0
  156. package/dist/tanstack/middlewares/index.d.ts +6 -0
  157. package/dist/tanstack/middlewares/index.js +5 -0
  158. package/dist/tanstack/middlewares/locale.d.ts +4 -0
  159. package/dist/{app/defaultRequestMiddlewares.js → tanstack/middlewares/locale.js} +2 -5
  160. package/dist/tanstack/s3/getS3Client.d.ts +2 -0
  161. package/dist/tanstack/s3/getS3Client.js +18 -0
  162. package/dist/tanstack/s3/getSignedFileUrlFn.d.ts +4 -0
  163. package/dist/tanstack/s3/getSignedFileUrlFn.js +21 -0
  164. package/dist/tanstack/s3/index.d.ts +2 -0
  165. package/dist/tanstack/s3/index.js +2 -0
  166. package/dist/tanstack/s3/uploadRequest.d.ts +3 -0
  167. package/dist/tanstack/s3/uploadRequest.js +21 -0
  168. package/dist/ui/AnimatedChevron.d.ts +3 -4
  169. package/dist/ui/AnimatedChevron.js +6 -25
  170. package/dist/ui/JsonInput.d.ts +1 -1
  171. package/dist/ui/JsonInput.js +1 -1
  172. package/dist/ui/editor/Content.d.ts +2 -2
  173. package/dist/ui/editor/Content.js +2 -2
  174. package/dist/ui/editor/Root.d.ts +7 -1
  175. package/dist/ui/editor/Root.js +42 -5
  176. package/dist/ui/editor/Toolbar.d.ts +3 -2
  177. package/dist/ui/editor/Toolbar.js +7 -25
  178. package/dist/ui/editor/index.d.ts +5 -9
  179. package/dist/ui/editor/index.js +3 -4
  180. package/dist/ui/editor/store.d.ts +6 -0
  181. package/dist/ui/editor/store.js +10 -0
  182. package/dist/ui/error/DefaultError.d.ts +1 -1
  183. package/dist/ui/error/DefaultNotFound.d.ts +1 -1
  184. package/dist/ui/error/Forbidden.d.ts +1 -1
  185. package/dist/ui/form/buttons/CancelButton.d.ts +2 -2
  186. package/dist/ui/form/buttons/CancelButton.js +4 -26
  187. package/dist/ui/form/buttons/SubmitButton.d.ts +2 -2
  188. package/dist/ui/form/buttons/SubmitButton.js +4 -29
  189. package/dist/ui/form/buttons/SubscribeActionIcon.d.ts +2 -2
  190. package/dist/ui/form/buttons/SubscribeButton.d.ts +2 -2
  191. package/dist/ui/form/context.d.ts +55 -55
  192. package/dist/ui/form/context.js +3 -3
  193. package/dist/ui/form/fields/JsonField.d.ts +1 -1
  194. package/dist/ui/form/fields/MultiSelectField.d.ts +1 -1
  195. package/dist/ui/form/fields/NumberField.d.ts +1 -1
  196. package/dist/ui/form/fields/PasswordField.d.ts +2 -0
  197. package/dist/ui/form/fields/{PassowrdField.js → PasswordField.js} +2 -2
  198. package/dist/ui/form/fields/SelectField.d.ts +1 -1
  199. package/dist/ui/form/fields/SwitchField.d.ts +1 -1
  200. package/dist/ui/form/fields/TextField.d.ts +1 -1
  201. package/dist/ui/form/fields/TextPasswordField.d.ts +2 -0
  202. package/dist/ui/form/fields/TextPasswordField.js +29 -0
  203. package/dist/ui/form/fields/TextareaField.d.ts +1 -1
  204. package/dist/ui/form/fields/index.d.ts +2 -2
  205. package/dist/ui/form/fields/index.js +2 -2
  206. package/dist/ui/form/index.d.ts +0 -1
  207. package/dist/ui/form/index.js +1 -2
  208. package/dist/ui/index.d.ts +9 -0
  209. package/dist/ui/index.js +9 -0
  210. package/dist/ui/saveInput/JsonInput.d.ts +2 -2
  211. package/dist/ui/saveInput/NumberInput.d.ts +2 -2
  212. package/dist/ui/saveInput/SaveInput.d.ts +14 -14
  213. package/dist/ui/saveInput/Select.d.ts +2 -2
  214. package/dist/ui/saveInput/Switch.d.ts +2 -2
  215. package/dist/ui/saveInput/TextInput.d.ts +2 -2
  216. package/dist/ui/saveInput/Textarea.d.ts +2 -2
  217. package/dist/ui/scrollArea/Root.d.ts +7 -0
  218. package/dist/ui/scrollArea/Root.js +42 -0
  219. package/dist/ui/scrollArea/ScrollButton.d.ts +7 -0
  220. package/dist/ui/scrollArea/ScrollButton.js +30 -0
  221. package/dist/ui/scrollArea/index.d.ts +6 -3
  222. package/dist/ui/scrollArea/index.js +7 -3
  223. package/dist/ui/scrollArea/methods.d.ts +4 -0
  224. package/dist/ui/scrollArea/methods.js +32 -0
  225. package/dist/ui/scrollArea/store.d.ts +12 -0
  226. package/dist/ui/scrollArea/store.js +25 -0
  227. package/dist/{ui/form/fieldsSchema.d.ts → zodSchemas.d.ts} +1 -1
  228. package/dist/{ui/form/fieldsSchema.js → zodSchemas.js} +2 -2
  229. package/package.json +103 -71
  230. package/dist/ai/ui/conversation/ConversationContext.d.ts +0 -7
  231. package/dist/ai/ui/conversation/ConversationContext.js +0 -8
  232. package/dist/ai/ui/conversation/ConversationProvider.d.ts +0 -2
  233. package/dist/ai/ui/conversation/ConversationProvider.js +0 -14
  234. package/dist/ai/ui/conversation/Empty.d.ts +0 -1
  235. package/dist/ai/ui/conversation/Empty.js +0 -21
  236. package/dist/ai/ui/conversation/File.d.ts +0 -4
  237. package/dist/ai/ui/conversation/FileIcon.js +0 -225
  238. package/dist/ai/ui/conversation/Loader.d.ts +0 -2
  239. package/dist/ai/ui/conversation/Loader.js +0 -12
  240. package/dist/ai/ui/conversation/Message.d.ts +0 -4
  241. package/dist/ai/ui/conversation/Message.js +0 -25
  242. package/dist/ai/ui/conversation/Root.d.ts +0 -2
  243. package/dist/ai/ui/conversation/Root.js +0 -26
  244. package/dist/ai/ui/conversation/index.d.ts +0 -13
  245. package/dist/ai/ui/conversation/index.js +0 -14
  246. package/dist/ai/ui/conversation/types.d.ts +0 -7
  247. package/dist/ai/ui/conversation/useChatMessage.d.ts +0 -2
  248. package/dist/ai/ui/conversation/useChatMessage.js +0 -12
  249. package/dist/ai/ui/promptInput/File.js +0 -117
  250. package/dist/ai/ui/promptInput/FileIcon.js +0 -225
  251. package/dist/ai/ui/promptInput/PromptInputContext.d.ts +0 -12
  252. package/dist/ai/ui/promptInput/PromptInputContext.js +0 -8
  253. package/dist/ai/ui/promptInput/PromptInputProvider.d.ts +0 -2
  254. package/dist/ai/ui/promptInput/PromptInputProvider.js +0 -50
  255. package/dist/ai/ui/promptInput/Root.d.ts +0 -3
  256. package/dist/ai/ui/promptInput/Root.js +0 -17
  257. package/dist/ai/ui/promptInput/Submit.js +0 -40
  258. package/dist/ai/ui/promptInput/types.d.ts +0 -11
  259. package/dist/app/defaultRequestMiddlewares.d.ts +0 -4
  260. package/dist/index.d.ts +0 -26
  261. package/dist/index.js +0 -26
  262. package/dist/surreal/deafaultCrud.d.ts +0 -2
  263. package/dist/ui/editor/Provider.d.ts +0 -17
  264. package/dist/ui/editor/Provider.js +0 -80
  265. package/dist/ui/editor/types.d.ts +0 -7
  266. package/dist/ui/form/fields/PassowrdField.d.ts +0 -2
  267. package/dist/ui/form/fields/TextPassowrdField.d.ts +0 -2
  268. package/dist/ui/form/fields/TextPassowrdField.js +0 -51
  269. package/dist/ui/scrollArea/ScrollArea.d.ts +0 -62
  270. package/dist/ui/scrollArea/ScrollArea.js +0 -30
  271. package/dist/ui/scrollArea/ScrollAreaButton.d.ts +0 -5
  272. package/dist/ui/scrollArea/ScrollAreaButton.js +0 -51
  273. package/dist/ui/scrollArea/ScrollAreaContent.d.ts +0 -6
  274. package/dist/ui/scrollArea/ScrollAreaContent.js +0 -29
  275. package/dist/ui/scrollArea/context.d.ts +0 -28
  276. package/dist/ui/scrollArea/context.js +0 -10
  277. package/dist/ui/scrollArea/types.d.ts +0 -65
  278. package/dist/ui/scrollArea/useScrollArea.d.ts +0 -9
  279. package/dist/ui/scrollArea/useScrollArea.js +0 -146
  280. /package/dist/ai/ui/{promptInput → chat/chatInput}/File.d.ts +0 -0
  281. /package/dist/ai/ui/{conversation → chat/chatInput}/FileIcon.d.ts +0 -0
  282. /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.d.ts +0 -0
  283. /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.js +0 -0
  284. /package/dist/ai/ui/{promptInput → chat/chatInput}/Submit.d.ts +0 -0
  285. /package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.d.ts +0 -0
  286. /package/dist/ai/ui/{promptInput → chat/parts}/FileIcon.d.ts +0 -0
  287. /package/dist/{ai/ui/conversation → betterAuth/server/surrealDbAdapter/methods}/types.js +0 -0
  288. /package/dist/{ai/ui/promptInput → betterAuth/server/surrealDbAdapter}/types.js +0 -0
  289. /package/dist/{ui/editor → betterAuth/server/surrealDbAdapter/utils}/types.js +0 -0
  290. /package/dist/{ui/scrollArea → betterAuth/server}/types.js +0 -0
  291. /package/dist/{surreal → surrealDB}/deserialize.d.ts +0 -0
  292. /package/dist/{surreal → surrealDB}/deserialize.js +0 -0
  293. /package/dist/{surreal → surrealDB}/encryption.d.ts +0 -0
  294. /package/dist/{surreal → surrealDB}/encryption.js +0 -0
  295. /package/dist/{functions → tanstack/cookie}/getCookie.d.ts +0 -0
  296. /package/dist/{functions → tanstack/cookie}/getCookie.js +0 -0
  297. /package/dist/{functions → tanstack/cookie}/setCookie.js +0 -0
  298. /package/dist/{functions → tanstack/cookie}/setCookies.d.ts +0 -0
  299. /package/dist/{functions → tanstack/cookie}/setCookies.js +0 -0
@@ -0,0 +1,32 @@
1
+ import { getScrollAreaRef } from "./store.js";
2
+ const scrollToBottom = ()=>{
3
+ const ref = getScrollAreaRef();
4
+ if (!ref) return;
5
+ ref.scrollTo({
6
+ top: ref.scrollHeight,
7
+ behavior: 'smooth'
8
+ });
9
+ };
10
+ const scrollToTop = ()=>{
11
+ const ref = getScrollAreaRef();
12
+ if (!ref) return;
13
+ ref.scrollTo({
14
+ top: 0,
15
+ behavior: 'smooth'
16
+ });
17
+ };
18
+ const isAboveCenter = ()=>{
19
+ const ref = getScrollAreaRef();
20
+ if (!ref) return false;
21
+ const { scrollTop, scrollHeight, clientHeight } = ref;
22
+ const viewportCenter = scrollTop + clientHeight / 2;
23
+ const contentCenter = scrollHeight / 2;
24
+ return viewportCenter < contentCenter;
25
+ };
26
+ const hasScrollableContent = ()=>{
27
+ const ref = getScrollAreaRef();
28
+ if (!ref) return false;
29
+ const { scrollHeight, clientHeight } = ref;
30
+ return scrollHeight > clientHeight;
31
+ };
32
+ export { hasScrollableContent, isAboveCenter, scrollToBottom, scrollToTop };
@@ -0,0 +1,12 @@
1
+ export declare const getScrollAreaRef: () => HTMLElement | null;
2
+ export declare const setScrollAreaRef: (scrollAreaRef: HTMLElement | null) => void;
3
+ export declare const getHeight: () => number;
4
+ export declare const setHeight: (height: number) => void;
5
+ export declare const getAutoScroll: () => boolean;
6
+ export declare const setAutoScroll: (autoScroll: boolean) => void;
7
+ export declare const getHasScrollableContent: () => boolean;
8
+ export declare const useHasScrollableContent: () => boolean;
9
+ export declare const setHasScrollableContent: (hasScrollableContent: boolean) => void;
10
+ export declare const getIsAboveCenter: () => boolean;
11
+ export declare const useIsAboveCenter: () => boolean;
12
+ export declare const setIsAboveCenter: (isAboveCenter: boolean) => void;
@@ -0,0 +1,25 @@
1
+ import { useStore } from "@nanostores/react";
2
+ import { atom } from "nanostores";
3
+ import { hasScrollableContent as external_methods_js_hasScrollableContent, scrollToBottom } from "./methods.js";
4
+ const $scrollAreaRef = atom(null);
5
+ const getScrollAreaRef = ()=>$scrollAreaRef.get();
6
+ const setScrollAreaRef = (scrollAreaRef)=>$scrollAreaRef.set(scrollAreaRef);
7
+ const $height = atom(0);
8
+ const getHeight = ()=>$height.get();
9
+ const setHeight = (height)=>$height.set(height);
10
+ const $autoScroll = atom(false);
11
+ const getAutoScroll = ()=>$autoScroll.get();
12
+ const setAutoScroll = (autoScroll)=>$autoScroll.set(autoScroll);
13
+ const $hasScrollableContent = atom(false);
14
+ const getHasScrollableContent = ()=>$hasScrollableContent.get();
15
+ const useHasScrollableContent = ()=>useStore($hasScrollableContent);
16
+ const setHasScrollableContent = (hasScrollableContent)=>$hasScrollableContent.set(hasScrollableContent);
17
+ const $isAboveCenter = atom(false);
18
+ const getIsAboveCenter = ()=>$isAboveCenter.get();
19
+ const useIsAboveCenter = ()=>useStore($isAboveCenter);
20
+ const setIsAboveCenter = (isAboveCenter)=>$isAboveCenter.set(isAboveCenter);
21
+ $height.listen((height)=>{
22
+ if (getAutoScroll() && height) scrollToBottom();
23
+ if (external_methods_js_hasScrollableContent() && !getHasScrollableContent()) setHasScrollableContent(true);
24
+ });
25
+ export { getAutoScroll, getHasScrollableContent, getHeight, getIsAboveCenter, getScrollAreaRef, setAutoScroll, setHasScrollableContent, setHeight, setIsAboveCenter, setScrollAreaRef, useHasScrollableContent, useIsAboveCenter };
@@ -1,5 +1,5 @@
1
1
  import z from 'zod/v4';
2
- export declare const fieldsSchema: {
2
+ export declare const zodSchemas: {
3
3
  id: z.ZodString;
4
4
  str: z.ZodString;
5
5
  strArr: z.ZodArray<z.ZodString>;
@@ -1,5 +1,5 @@
1
1
  import v4 from "zod/v4";
2
- const fieldsSchema = {
2
+ const zodSchemas = {
3
3
  id: v4.string().min(1, 'ID не может быть пустым'),
4
4
  str: v4.string().min(1, 'Значение не может быть пустым'),
5
5
  strArr: v4.array(v4.string().min(1, 'Значение не может быть пустым')),
@@ -10,4 +10,4 @@ const fieldsSchema = {
10
10
  password: v4.string('Пароль не может быть пустым').min(8, 'Пароль должен содержать не менее 8 символов'),
11
11
  kebab: v4.string().min(3, 'Минимум 3 символа').regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, 'Должен быть в формате kebab-case (только строчные буквы, цифры и дефисы)')
12
12
  };
13
- export { fieldsSchema };
13
+ export { zodSchemas };
package/package.json CHANGED
@@ -1,73 +1,105 @@
1
1
  {
2
- "name": "@rolder/kit",
3
- "version": "3.0.0-alpha.11",
4
- "type": "module",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
12
- },
13
- "./styles.css": "./dist/styles.css"
14
- },
15
- "sideEffects": [
16
- "*.css"
17
- ],
18
- "files": [
19
- "dist"
20
- ],
21
- "scripts": {
22
- "build": "rslib build",
23
- "dev": "rslib build --watch",
24
- "check": "biome check --write && tsc --noEmit"
25
- },
26
- "devDependencies": {
27
- "@biomejs/biome": "2.3.11",
28
- "@rsbuild/plugin-react": "^1.4.2",
29
- "@rslib/core": "^0.19.2",
30
- "@types/bun": "^1.3.5",
31
- "@types/js-cookie": "^3.0.6",
32
- "@types/omgopass": "^3.2.3",
33
- "@types/react": "^19.2.8",
34
- "react": "^19.2.3",
35
- "typescript": "^5.9.3"
36
- },
37
- "peerDependencies": {
38
- "react": "^19.x",
39
- "react-dom": "^19.x",
40
- "clsx": "^2.x",
41
- "@tiptap/extension-highlight": "^3.x",
42
- "@tiptap/extension-placeholder": "^3.x",
43
- "@tiptap/extension-table": "^3.x",
44
- "@tiptap/extension-task-item": "^3.x",
45
- "@tiptap/extension-task-list": "^3.x",
46
- "@tiptap/extension-text-align": "^3.x",
47
- "@tiptap/starter-kit": "^3.x",
48
- "@codemirror/lang-json": "^6.x",
49
- "@codemirror/lint": "^6.x",
50
- "@uiw/codemirror-theme-vscode": "^4.x",
51
- "@uiw/react-codemirror": "^4.x",
52
- "@mantine/core": "^8.x",
53
- "@mantine/hooks": "^8.x",
54
- "@mantine/tiptap": "^8.x",
55
- "@mantine/notifications": "^8.x",
56
- "@tanstack/react-router": "^1.x",
57
- "@tanstack/react-form": "^1.x",
58
- "@tanstack/react-start": "^1.x",
59
- "@tanstack/react-query": "^5.x",
60
- "@tanstack/react-router-ssr-query": "^1.x",
61
- "zod": "^4.x",
62
- "js-cookie": "^3.x",
63
- "nanostores": "^1.x",
64
- "surrealdb": "^2.0.0-alpha.16",
65
- "omgopass": "^3.x",
66
- "ai": "^6.x",
67
- "streamdown": "^2.x"
68
- },
69
- "trustedDependencies": [
70
- "core-js",
71
- "esbuild"
72
- ]
2
+ "name": "@rolder/kit",
3
+ "version": "3.0.0-alpha.112",
4
+ "type": "module",
5
+ "exports": {
6
+ "./ai": {
7
+ "types": "./dist/ai/index.d.ts",
8
+ "import": "./dist/ai/index.js"
9
+ },
10
+ "./app": {
11
+ "types": "./dist/app/index.d.ts",
12
+ "import": "./dist/app/index.js"
13
+ },
14
+ "./betterAuth": {
15
+ "types": "./dist/betterAuth/index.d.ts",
16
+ "import": "./dist/betterAuth/index.js"
17
+ },
18
+ "./hooks": {
19
+ "types": "./dist/hooks/index.d.ts",
20
+ "import": "./dist/hooks/index.js"
21
+ },
22
+ "./surrealDB": {
23
+ "types": "./dist/surrealDB/index.d.ts",
24
+ "import": "./dist/surrealDB/index.js"
25
+ },
26
+ "./tanstack": {
27
+ "types": "./dist/tanstack/index.d.ts",
28
+ "import": "./dist/tanstack/index.js"
29
+ },
30
+ "./ui": {
31
+ "types": "./dist/ui/index.d.ts",
32
+ "import": "./dist/ui/index.js"
33
+ },
34
+ "./zodSchemas": {
35
+ "types": "./dist/zodSchemas.d.ts",
36
+ "import": "./dist/zodSchemas.js"
37
+ },
38
+ "./styles.css": "./dist/styles.css"
39
+ },
40
+ "sideEffects": false,
41
+ "files": [
42
+ "dist"
43
+ ],
44
+ "scripts": {
45
+ "build": "rslib build",
46
+ "dev": "rslib build --watch",
47
+ "prepublishOnly": "bun run build",
48
+ "check": "biome check --write && tsc --noEmit"
49
+ },
50
+ "devDependencies": {
51
+ "@rsbuild/plugin-react": "^1.4.5",
52
+ "@rslib/core": "^0.19.5",
53
+ "@types/js-cookie": "^3.0.6",
54
+ "@types/omgopass": "^3.2.3",
55
+ "vitest": "^4.0.18"
56
+ },
57
+ "peerDependencies": {
58
+ "better-auth": "^1.4.18",
59
+ "@ai-sdk/react": "^3.0.88",
60
+ "@better-upload/client": "^3.0.14",
61
+ "@better-upload/server": "^3.0.14",
62
+ "@codemirror/lang-json": "^6.0.2",
63
+ "@codemirror/lint": "^6.9.4",
64
+ "@mantine/core": "^8.3.14",
65
+ "@mantine/hooks": "^8.3.14",
66
+ "@mantine/notifications": "^8.3.14",
67
+ "@mantine/tiptap": "^8.3.14",
68
+ "@nanostores/react": "^1.0.0",
69
+ "@tanstack/react-form": "^1.28.2",
70
+ "@tanstack/react-query": "^5.90.21",
71
+ "@tanstack/react-router": "^1.159.10",
72
+ "@tanstack/react-router-ssr-query": "^1.159.10",
73
+ "@tanstack/react-start": "^1.159.11",
74
+ "@tiptap/extension-highlight": "^3.19.0",
75
+ "@tiptap/extension-placeholder": "^3.19.0",
76
+ "@tiptap/extension-table": "^3.19.0",
77
+ "@tiptap/extension-task-item": "^3.19.0",
78
+ "@tiptap/extension-task-list": "^3.19.0",
79
+ "@tiptap/extension-text-align": "^3.19.0",
80
+ "@tiptap/react": "^3.19.0",
81
+ "@tiptap/starter-kit": "^3.19.0",
82
+ "@uiw/codemirror-theme-vscode": "^4.25.4",
83
+ "@uiw/react-codemirror": "^4.25.4",
84
+ "@codemirror/commands": "^6.10.2",
85
+ "@codemirror/view": "^6.39.14",
86
+ "ai": "^6.0.86",
87
+ "clsx": "^2.1.1",
88
+ "js-cookie": "^3.0.5",
89
+ "mammoth": "^1.11.0",
90
+ "nanoid": "^5.1.6",
91
+ "nanostores": "^1.1.0",
92
+ "omgopass": "^3.2.1",
93
+ "react": "^19.2.4",
94
+ "react-dom": "^19.2.4",
95
+ "streamdown": "^2.2.0",
96
+ "surrealdb": "^2.0.0-alpha.18",
97
+ "xlsx": "^0.18.5",
98
+ "zod": "^4.3.6",
99
+ "@tabler/icons-react": "^3.36.1"
100
+ },
101
+ "trustedDependencies": [
102
+ "core-js",
103
+ "esbuild"
104
+ ]
73
105
  }
@@ -1,7 +0,0 @@
1
- export interface ConversationContext {
2
- loading: boolean;
3
- streaming: boolean;
4
- empty: boolean;
5
- }
6
- export declare const ConversationContext: import("react").Context<ConversationContext | null>;
7
- export declare const useConversation: () => ConversationContext;
@@ -1,8 +0,0 @@
1
- import { createContext, useContext } from "react";
2
- const ConversationContext = createContext(null);
3
- const useConversation = ()=>{
4
- const context = useContext(ConversationContext);
5
- if (!context) throw new Error('useConversation must be used within a ConversationProvider');
6
- return context;
7
- };
8
- export { ConversationContext, useConversation };
@@ -1,2 +0,0 @@
1
- import type { ConversationProps } from './types';
2
- export declare const Provider: ({ children, loading, streaming, empty, }: ConversationProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,14 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { ConversationContext } from "./ConversationContext.js";
3
- const Provider = ({ children, loading, streaming, empty })=>{
4
- const value = {
5
- loading,
6
- streaming,
7
- empty
8
- };
9
- return /*#__PURE__*/ jsx(ConversationContext.Provider, {
10
- value: value,
11
- children: children
12
- });
13
- };
14
- export { Provider };
@@ -1 +0,0 @@
1
- export declare const Empty: () => import("react/jsx-runtime").JSX.Element | null;
@@ -1,21 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Stack, Text } from "@mantine/core";
3
- import { useConversation } from "./ConversationContext.js";
4
- const Empty = ()=>{
5
- const { empty } = useConversation();
6
- return empty ? null : /*#__PURE__*/ jsxs(Stack, {
7
- align: "center",
8
- gap: 0,
9
- children: [
10
- /*#__PURE__*/ jsx(Text, {
11
- children: "Нет сообщений"
12
- }),
13
- /*#__PURE__*/ jsx(Text, {
14
- size: "sm",
15
- c: "dimmed",
16
- children: "Начните общение, чтобы увидеть сообщения здесь"
17
- })
18
- ]
19
- });
20
- };
21
- export { Empty };
@@ -1,4 +0,0 @@
1
- import type { UIMessage } from 'ai';
2
- export declare const File: <T extends UIMessage>({ message }: {
3
- message: T;
4
- }) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,225 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- const FileIcon = ({ mimeType })=>{
3
- switch(true){
4
- case mimeType.includes('image/'):
5
- return /*#__PURE__*/ jsxs("svg", {
6
- xmlns: "http://www.w3.org/2000/svg",
7
- width: "36",
8
- height: "36",
9
- viewBox: "0 0 36 36",
10
- fill: "none",
11
- stroke: "var(--mantine-color-text)",
12
- strokeWidth: "1.5",
13
- strokeLinecap: "round",
14
- strokeLinejoin: "round",
15
- role: "img",
16
- "aria-label": "Image",
17
- children: [
18
- /*#__PURE__*/ jsx("path", {
19
- stroke: "none",
20
- d: "M0 0h24v24H0z",
21
- fill: "none"
22
- }),
23
- /*#__PURE__*/ jsx("path", {
24
- d: "M15 8h.01"
25
- }),
26
- /*#__PURE__*/ jsx("path", {
27
- d: "M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12"
28
- }),
29
- /*#__PURE__*/ jsx("path", {
30
- d: "M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5"
31
- }),
32
- /*#__PURE__*/ jsx("path", {
33
- d: "M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3"
34
- })
35
- ]
36
- });
37
- case mimeType.includes('application/pdf'):
38
- return /*#__PURE__*/ jsxs("svg", {
39
- xmlns: "http://www.w3.org/2000/svg",
40
- width: "36",
41
- height: "36",
42
- viewBox: "0 0 36 36",
43
- fill: "none",
44
- stroke: "var(--mantine-color-text)",
45
- strokeWidth: "1.5",
46
- strokeLinecap: "round",
47
- strokeLinejoin: "round",
48
- role: "img",
49
- "aria-label": "FilePdf",
50
- children: [
51
- /*#__PURE__*/ jsx("path", {
52
- stroke: "none",
53
- d: "M0 0h24v24H0z",
54
- fill: "none"
55
- }),
56
- /*#__PURE__*/ jsx("path", {
57
- d: "M14 3v4a1 1 0 0 0 1 1h4"
58
- }),
59
- /*#__PURE__*/ jsx("path", {
60
- d: "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"
61
- }),
62
- /*#__PURE__*/ jsx("path", {
63
- d: "M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"
64
- }),
65
- /*#__PURE__*/ jsx("path", {
66
- d: "M17 18h2"
67
- }),
68
- /*#__PURE__*/ jsx("path", {
69
- d: "M20 15h-3v6"
70
- }),
71
- /*#__PURE__*/ jsx("path", {
72
- d: "M11 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1"
73
- })
74
- ]
75
- });
76
- case 'word' === mimeType:
77
- return /*#__PURE__*/ jsxs("svg", {
78
- xmlns: "http://www.w3.org/2000/svg",
79
- width: "36",
80
- height: "36",
81
- viewBox: "0 0 36 36",
82
- fill: "none",
83
- stroke: "var(--mantine-color-text)",
84
- strokeWidth: "1.5",
85
- strokeLinecap: "round",
86
- strokeLinejoin: "round",
87
- role: "img",
88
- "aria-label": "FileDoc",
89
- children: [
90
- /*#__PURE__*/ jsx("path", {
91
- stroke: "none",
92
- d: "M0 0h24v24H0z",
93
- fill: "none"
94
- }),
95
- /*#__PURE__*/ jsx("path", {
96
- d: "M14 3v4a1 1 0 0 0 1 1h4"
97
- }),
98
- /*#__PURE__*/ jsx("path", {
99
- d: "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"
100
- }),
101
- /*#__PURE__*/ jsx("path", {
102
- d: "M5 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1"
103
- }),
104
- /*#__PURE__*/ jsx("path", {
105
- d: "M20 16.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0"
106
- }),
107
- /*#__PURE__*/ jsx("path", {
108
- d: "M12.5 15a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1 -3 0v-3a1.5 1.5 0 0 1 1.5 -1.5"
109
- })
110
- ]
111
- });
112
- case 'excel' === mimeType:
113
- return /*#__PURE__*/ jsxs("svg", {
114
- xmlns: "http://www.w3.org/2000/svg",
115
- width: "36",
116
- height: "36",
117
- viewBox: "0 0 36 36",
118
- fill: "none",
119
- stroke: "var(--mantine-color-text)",
120
- strokeWidth: "1.5",
121
- strokeLinecap: "round",
122
- strokeLinejoin: "round",
123
- role: "img",
124
- "aria-label": "FileXls",
125
- children: [
126
- /*#__PURE__*/ jsx("path", {
127
- stroke: "none",
128
- d: "M0 0h24v24H0z",
129
- fill: "none"
130
- }),
131
- /*#__PURE__*/ jsx("path", {
132
- d: "M14 3v4a1 1 0 0 0 1 1h4"
133
- }),
134
- /*#__PURE__*/ jsx("path", {
135
- d: "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"
136
- }),
137
- /*#__PURE__*/ jsx("path", {
138
- d: "M4 15l4 6"
139
- }),
140
- /*#__PURE__*/ jsx("path", {
141
- d: "M4 21l4 -6"
142
- }),
143
- /*#__PURE__*/ jsx("path", {
144
- d: "M17 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"
145
- }),
146
- /*#__PURE__*/ jsx("path", {
147
- d: "M11 15v6h3"
148
- })
149
- ]
150
- });
151
- case 'powerpoint' === mimeType:
152
- return /*#__PURE__*/ jsxs("svg", {
153
- xmlns: "http://www.w3.org/2000/svg",
154
- width: "36",
155
- height: "36",
156
- viewBox: "0 0 36 36",
157
- fill: "none",
158
- stroke: "var(--mantine-color-text)",
159
- strokeWidth: "1.5",
160
- strokeLinecap: "round",
161
- strokeLinejoin: "round",
162
- role: "img",
163
- "aria-label": "FilePpt",
164
- children: [
165
- /*#__PURE__*/ jsx("path", {
166
- stroke: "none",
167
- d: "M0 0h24v24H0z",
168
- fill: "none"
169
- }),
170
- /*#__PURE__*/ jsx("path", {
171
- d: "M14 3v4a1 1 0 0 0 1 1h4"
172
- }),
173
- /*#__PURE__*/ jsx("path", {
174
- d: "M14 3v4a1 1 0 0 0 1 1h4"
175
- }),
176
- /*#__PURE__*/ jsx("path", {
177
- d: "M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"
178
- }),
179
- /*#__PURE__*/ jsx("path", {
180
- d: "M11 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"
181
- }),
182
- /*#__PURE__*/ jsx("path", {
183
- d: "M16.5 15h3"
184
- }),
185
- /*#__PURE__*/ jsx("path", {
186
- d: "M18 15v6"
187
- }),
188
- /*#__PURE__*/ jsx("path", {
189
- d: "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"
190
- })
191
- ]
192
- });
193
- default:
194
- return /*#__PURE__*/ jsxs("svg", {
195
- xmlns: "http://www.w3.org/2000/svg",
196
- width: "36",
197
- height: "36",
198
- viewBox: "0 0 36 36",
199
- fill: "none",
200
- stroke: "var(--mantine-color-text)",
201
- strokeWidth: "1.5",
202
- strokeLinecap: "round",
203
- strokeLinejoin: "round",
204
- role: "img",
205
- "aria-label": "File",
206
- children: [
207
- /*#__PURE__*/ jsx("path", {
208
- stroke: "none",
209
- d: "M0 0h24v24H0z",
210
- fill: "none"
211
- }),
212
- /*#__PURE__*/ jsx("path", {
213
- d: "M15 3v4a1 1 0 0 0 1 1h4"
214
- }),
215
- /*#__PURE__*/ jsx("path", {
216
- d: "M18 17h-7a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h4l5 5v7a2 2 0 0 1 -2 2"
217
- }),
218
- /*#__PURE__*/ jsx("path", {
219
- d: "M16 17v2a2 2 0 0 1 -2 2h-7a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2"
220
- })
221
- ]
222
- });
223
- }
224
- };
225
- export { FileIcon };
@@ -1,2 +0,0 @@
1
- import { type LoaderProps } from '@mantine/core';
2
- export declare const Loader: (props: LoaderProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,12 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Loader } from "@mantine/core";
3
- import { useConversation } from "./ConversationContext.js";
4
- const Loader_Loader = (props)=>{
5
- const { loading } = useConversation();
6
- return loading ? /*#__PURE__*/ jsx(Loader, {
7
- size: 28,
8
- type: "dots",
9
- ...props
10
- }) : null;
11
- };
12
- export { Loader_Loader as Loader };
@@ -1,4 +0,0 @@
1
- import type { UIMessage } from 'ai';
2
- export declare const Message: <T extends UIMessage>({ message }: {
3
- message: T;
4
- }) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,25 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Paper } from "@mantine/core";
3
- import { Streamdown } from "streamdown";
4
- import { useConversation } from "./ConversationContext.js";
5
- import { useChatMessage } from "./useChatMessage.js";
6
- const Message = ({ message })=>{
7
- const textParts = message?.parts?.filter((i)=>'text' === i.type);
8
- const lastTextPart = textParts?.[textParts.length - 1];
9
- const chatMessage = useChatMessage(lastTextPart);
10
- const { streaming } = useConversation();
11
- return chatMessage && 'system' !== message.role ? /*#__PURE__*/ jsx(Paper, {
12
- radius: "md",
13
- px: "md",
14
- py: "sm",
15
- maw: "80%",
16
- ml: 'user' === message.role ? 'auto' : void 0,
17
- bg: 'user' === message.role ? 'var(--mantine-color-default-hover)' : 'var(--mantine-primary-color-light)',
18
- fz: "sm",
19
- children: /*#__PURE__*/ jsx(Streamdown, {
20
- isAnimating: streaming && 'assistant' === message.role,
21
- children: chatMessage
22
- })
23
- }) : null;
24
- };
25
- export { Message };
@@ -1,2 +0,0 @@
1
- import type { ConversationProps } from './types';
2
- export declare const Root: ({ children, loading, streaming, empty, ...props }: ConversationProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,26 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Paper, Stack } from "@mantine/core";
3
- import { ScrollArea } from "../../../ui/scrollArea/index.js";
4
- import { Provider } from "./ConversationProvider.js";
5
- const Root = ({ children, loading, streaming, empty, ...props })=>/*#__PURE__*/ jsx(Provider, {
6
- loading: loading,
7
- streaming: streaming,
8
- empty: empty,
9
- children: /*#__PURE__*/ jsx(Paper, {
10
- withBorder: true,
11
- radius: "md",
12
- ...props,
13
- children: /*#__PURE__*/ jsxs(ScrollArea, {
14
- autoScroll: true,
15
- scrollToBottomOnInit: true,
16
- p: "md",
17
- children: [
18
- /*#__PURE__*/ jsx(Stack, {
19
- children: children
20
- }),
21
- /*#__PURE__*/ jsx(ScrollArea.ScrollButton, {})
22
- ]
23
- })
24
- })
25
- });
26
- export { Root };