@rolder/kit 3.0.0-alpha.14 → 3.0.0-alpha.16

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 (129) hide show
  1. package/dist/TestIcon.d.ts +1 -0
  2. package/dist/TestIcon.js +4 -0
  3. package/dist/index.d.ts +1 -9
  4. package/dist/index.js +2 -0
  5. package/package.json +8 -32
  6. package/dist/ai/ui/conversation/ConversationContext.d.ts +0 -7
  7. package/dist/ai/ui/conversation/ConversationContext.js +0 -8
  8. package/dist/ai/ui/conversation/ConversationProvider.d.ts +0 -2
  9. package/dist/ai/ui/conversation/ConversationProvider.js +0 -14
  10. package/dist/ai/ui/conversation/Empty.d.ts +0 -1
  11. package/dist/ai/ui/conversation/Empty.js +0 -21
  12. package/dist/ai/ui/conversation/File.d.ts +0 -4
  13. package/dist/ai/ui/conversation/File.js +0 -42
  14. package/dist/ai/ui/conversation/FileIcon.d.ts +0 -3
  15. package/dist/ai/ui/conversation/FileIcon.js +0 -225
  16. package/dist/ai/ui/conversation/Loader.d.ts +0 -2
  17. package/dist/ai/ui/conversation/Loader.js +0 -12
  18. package/dist/ai/ui/conversation/Message.d.ts +0 -4
  19. package/dist/ai/ui/conversation/Message.js +0 -25
  20. package/dist/ai/ui/conversation/Root.d.ts +0 -2
  21. package/dist/ai/ui/conversation/Root.js +0 -26
  22. package/dist/ai/ui/conversation/index.d.ts +0 -13
  23. package/dist/ai/ui/conversation/index.js +0 -14
  24. package/dist/ai/ui/conversation/types.d.ts +0 -7
  25. package/dist/ai/ui/conversation/types.js +0 -0
  26. package/dist/ai/ui/conversation/useChatMessage.d.ts +0 -2
  27. package/dist/ai/ui/conversation/useChatMessage.js +0 -12
  28. package/dist/ai/ui/promptInput/File.d.ts +0 -2
  29. package/dist/ai/ui/promptInput/File.js +0 -117
  30. package/dist/ai/ui/promptInput/FileIcon.d.ts +0 -3
  31. package/dist/ai/ui/promptInput/FileIcon.js +0 -225
  32. package/dist/ai/ui/promptInput/Footer.d.ts +0 -2
  33. package/dist/ai/ui/promptInput/Footer.js +0 -8
  34. package/dist/ai/ui/promptInput/PromptInputContext.d.ts +0 -12
  35. package/dist/ai/ui/promptInput/PromptInputContext.js +0 -8
  36. package/dist/ai/ui/promptInput/PromptInputProvider.d.ts +0 -2
  37. package/dist/ai/ui/promptInput/PromptInputProvider.js +0 -50
  38. package/dist/ai/ui/promptInput/Root.d.ts +0 -3
  39. package/dist/ai/ui/promptInput/Root.js +0 -17
  40. package/dist/ai/ui/promptInput/Submit.d.ts +0 -2
  41. package/dist/ai/ui/promptInput/Submit.js +0 -40
  42. package/dist/ai/ui/promptInput/Textarea.d.ts +0 -2
  43. package/dist/ai/ui/promptInput/Textarea.js +0 -33
  44. package/dist/ai/ui/promptInput/index.d.ts +0 -8
  45. package/dist/ai/ui/promptInput/index.js +0 -13
  46. package/dist/ai/ui/promptInput/types.d.ts +0 -11
  47. package/dist/ai/ui/promptInput/types.js +0 -0
  48. package/dist/ai/utils/convertFileUIPartBlobToDataURL.d.ts +0 -5
  49. package/dist/ai/utils/convertFileUIPartBlobToDataURL.js +0 -21
  50. package/dist/ai/utils/parseAiMessagePart.d.ts +0 -2
  51. package/dist/ai/utils/parseAiMessagePart.js +0 -12
  52. package/dist/app/AppDefaults.d.ts +0 -3
  53. package/dist/app/AppDefaults.js +0 -27
  54. package/dist/app/DefaultApp.d.ts +0 -6
  55. package/dist/app/DefaultApp.js +0 -43
  56. package/dist/app/cookieColorSchemeManager.d.ts +0 -6
  57. package/dist/app/cookieColorSchemeManager.js +0 -46
  58. package/dist/app/defaultRequestMiddlewares.d.ts +0 -4
  59. package/dist/app/defaultRequestMiddlewares.js +0 -24
  60. package/dist/app/defaultTheme.d.ts +0 -141
  61. package/dist/app/defaultTheme.js +0 -24
  62. package/dist/functions/getCookie.d.ts +0 -3
  63. package/dist/functions/setCookie.d.ts +0 -10
  64. package/dist/functions/setCookies.d.ts +0 -14
  65. package/dist/hooks/useMutation.d.ts +0 -4
  66. package/dist/hooks/useMutationWithInvalidate.d.ts +0 -4
  67. package/dist/styles.css +0 -74
  68. package/dist/surreal/connection.d.ts +0 -9
  69. package/dist/surreal/deafaultCrud.d.ts +0 -2
  70. package/dist/surreal/deserialize.d.ts +0 -17
  71. package/dist/surreal/encryption.d.ts +0 -6
  72. package/dist/ui/AnimatedChevron.d.ts +0 -6
  73. package/dist/ui/JsonInput.d.ts +0 -2
  74. package/dist/ui/RouterLink.d.ts +0 -16
  75. package/dist/ui/editor/Content.d.ts +0 -3
  76. package/dist/ui/editor/Provider.d.ts +0 -17
  77. package/dist/ui/editor/Root.d.ts +0 -2
  78. package/dist/ui/editor/Toolbar.d.ts +0 -5
  79. package/dist/ui/editor/index.d.ts +0 -12
  80. package/dist/ui/editor/types.d.ts +0 -7
  81. package/dist/ui/error/DefaultError.d.ts +0 -2
  82. package/dist/ui/error/DefaultNotFound.d.ts +0 -1
  83. package/dist/ui/error/Forbidden.d.ts +0 -1
  84. package/dist/ui/error/defaultErrorNotification.d.ts +0 -1
  85. package/dist/ui/error/index.d.ts +0 -4
  86. package/dist/ui/form/blurOnError.d.ts +0 -4
  87. package/dist/ui/form/buttons/CancelButton.d.ts +0 -5
  88. package/dist/ui/form/buttons/SubmitButton.d.ts +0 -5
  89. package/dist/ui/form/buttons/SubscribeActionIcon.d.ts +0 -4
  90. package/dist/ui/form/buttons/SubscribeButton.d.ts +0 -5
  91. package/dist/ui/form/buttons/index.d.ts +0 -4
  92. package/dist/ui/form/context.d.ts +0 -83
  93. package/dist/ui/form/fields/JsonField.d.ts +0 -2
  94. package/dist/ui/form/fields/MultiSelectField.d.ts +0 -2
  95. package/dist/ui/form/fields/NumberField.d.ts +0 -2
  96. package/dist/ui/form/fields/PassowrdField.d.ts +0 -2
  97. package/dist/ui/form/fields/SelectField.d.ts +0 -2
  98. package/dist/ui/form/fields/SwitchField.d.ts +0 -2
  99. package/dist/ui/form/fields/TextField.d.ts +0 -2
  100. package/dist/ui/form/fields/TextPassowrdField.d.ts +0 -2
  101. package/dist/ui/form/fields/TextareaField.d.ts +0 -2
  102. package/dist/ui/form/fields/index.d.ts +0 -9
  103. package/dist/ui/form/fieldsSchema.d.ts +0 -12
  104. package/dist/ui/form/index.d.ts +0 -3
  105. package/dist/ui/hoverPaper/HoverPaper.d.ts +0 -6
  106. package/dist/ui/hoverPaper/index.d.ts +0 -2
  107. package/dist/ui/hoverPaper/usePaperHover.d.ts +0 -4
  108. package/dist/ui/saveInput/JsonInput.d.ts +0 -6
  109. package/dist/ui/saveInput/NumberInput.d.ts +0 -6
  110. package/dist/ui/saveInput/SaveInput.d.ts +0 -36
  111. package/dist/ui/saveInput/Select.d.ts +0 -6
  112. package/dist/ui/saveInput/Switch.d.ts +0 -6
  113. package/dist/ui/saveInput/TextInput.d.ts +0 -6
  114. package/dist/ui/saveInput/Textarea.d.ts +0 -6
  115. package/dist/ui/saveInput/index.d.ts +0 -1
  116. package/dist/ui/scrollArea/ScrollArea.d.ts +0 -62
  117. package/dist/ui/scrollArea/ScrollArea.js +0 -30
  118. package/dist/ui/scrollArea/ScrollAreaButton.d.ts +0 -5
  119. package/dist/ui/scrollArea/ScrollAreaButton.js +0 -51
  120. package/dist/ui/scrollArea/ScrollAreaContent.d.ts +0 -6
  121. package/dist/ui/scrollArea/ScrollAreaContent.js +0 -29
  122. package/dist/ui/scrollArea/context.d.ts +0 -28
  123. package/dist/ui/scrollArea/context.js +0 -10
  124. package/dist/ui/scrollArea/index.d.ts +0 -3
  125. package/dist/ui/scrollArea/index.js +0 -3
  126. package/dist/ui/scrollArea/types.d.ts +0 -65
  127. package/dist/ui/scrollArea/types.js +0 -0
  128. package/dist/ui/scrollArea/useScrollArea.d.ts +0 -9
  129. package/dist/ui/scrollArea/useScrollArea.js +0 -146
@@ -0,0 +1 @@
1
+ export declare const TestIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { IconBrandAdobeAfterEffect } from "@tabler/icons-react";
3
+ const TestIcon = ()=>/*#__PURE__*/ jsx(IconBrandAdobeAfterEffect, {});
4
+ export { TestIcon };
package/dist/index.d.ts CHANGED
@@ -1,9 +1 @@
1
- /** biome-ignore-all assist/source/organizeImports: <> */
2
- export { Conversation, type ConversationProps, useChatMessage, } from './ai/ui/conversation';
3
- export { type Accept, PromptInput, type PromptInputProps, } from './ai/ui/promptInput';
4
- export { convertFileUIPartBlobToDataURL } from './ai/utils/convertFileUIPartBlobToDataURL';
5
- export { parseAiMessagePart } from './ai/utils/parseAiMessagePart';
6
- export { DefaultApp } from './app/DefaultApp';
7
- export { defaultRequestMiddlewares } from './app/defaultRequestMiddlewares';
8
- export { defaultTheme } from './app/defaultTheme';
9
- export { ScrollArea, useScrollArea, type ScrollAreaContextValue, type ScrollAreaHook, type ScrollAreaProps, type ScrollAreaState, type ScrollButtonProps, type ScrollPosition, } from './ui/scrollArea';
1
+ export { IconBrandAdobeAfterEffect } from '@tabler/icons-react';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import { IconBrandAdobeAfterEffect } from "@tabler/icons-react";
2
+ export { IconBrandAdobeAfterEffect };
package/package.json CHANGED
@@ -1,41 +1,14 @@
1
1
  {
2
2
  "name": "@rolder/kit",
3
- "version": "3.0.0-alpha.14",
3
+ "version": "3.0.0-alpha.16",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
- "./styles.css": "./dist/styles.css",
10
- "./conversation": {
11
- "import": "./dist/ai/ui/conversation/index.js"
12
- },
13
- "./promptInput": {
14
- "import": "./dist/ai/ui/promptInput/index.js"
15
- },
16
- "./convertFileUIPartBlobToDataURL": {
17
- "import": "./dist/ai/utils/convertFileUIPartBlobToDataURL.js"
18
- },
19
- "./parseAiMessagePart": {
20
- "import": "./dist/ai/utils/parseAiMessagePart.js"
21
- },
22
- "./AppDefaults": {
23
- "import": "./dist/app/AppDefaults.js"
24
- },
25
- "./cookieColorSchemeManager": {
26
- "import": "./dist/app/cookieColorSchemeManager.js"
27
- },
28
- "./DefaultApp": {
29
- "import": "./dist/app/DefaultApp.js"
30
- },
31
- "./defaultRequestMiddlewares": {
32
- "import": "./dist/app/defaultRequestMiddlewares.js"
33
- },
34
- "./defaultTheme": {
35
- "import": "./dist/app/defaultTheme.js"
36
- },
37
- "./scrollArea": {
38
- "import": "./dist/ui/scrollArea/index.js"
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
39
12
  }
40
13
  },
41
14
  "sideEffects": false,
@@ -93,5 +66,8 @@
93
66
  "trustedDependencies": [
94
67
  "core-js",
95
68
  "esbuild"
96
- ]
69
+ ],
70
+ "dependencies": {
71
+ "@tabler/icons-react": "^3.36.1"
72
+ }
97
73
  }
@@ -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,42 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Image, Paper } from "@mantine/core";
3
- import { FileIcon } from "./FileIcon.js";
4
- const File = ({ message })=>{
5
- const textFileType = message.id.split('-')[1];
6
- const fileParts = message.parts?.filter((i)=>'file' === i.type);
7
- const lastFilePart = fileParts[fileParts.length - 1];
8
- const FileComponent = ()=>{
9
- switch(textFileType){
10
- case 'excel':
11
- return /*#__PURE__*/ jsx(FileIcon, {
12
- mimeType: "excel"
13
- });
14
- case 'word':
15
- return /*#__PURE__*/ jsx(FileIcon, {
16
- mimeType: "word"
17
- });
18
- case 'powerpoint':
19
- return /*#__PURE__*/ jsx(FileIcon, {
20
- mimeType: "powerpoint"
21
- });
22
- }
23
- if (lastFilePart.mediaType.includes('image/')) return /*#__PURE__*/ jsx(Image, {
24
- radius: "md",
25
- h: 128,
26
- src: lastFilePart.url,
27
- alt: "Image Preview"
28
- });
29
- return /*#__PURE__*/ jsx(FileIcon, {
30
- mimeType: lastFilePart.mediaType
31
- });
32
- };
33
- return textFileType || lastFilePart ? /*#__PURE__*/ jsx(Paper, {
34
- radius: "md",
35
- px: "md",
36
- py: "sm",
37
- ml: "auto",
38
- bg: "var(--mantine-color-default-hover)",
39
- children: /*#__PURE__*/ jsx(FileComponent, {})
40
- }) : null;
41
- };
42
- export { File };
@@ -1,3 +0,0 @@
1
- export declare const FileIcon: ({ mimeType }: {
2
- mimeType: string;
3
- }) => import("react/jsx-runtime").JSX.Element;
@@ -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 };
@@ -1,13 +0,0 @@
1
- export type { ConversationProps } from './types';
2
- export { useChatMessage } from './useChatMessage';
3
- export declare const Conversation: {
4
- Root: ({ children, loading, streaming, empty, ...props }: import("./types").ConversationProps) => import("react/jsx-runtime").JSX.Element;
5
- Message: <T extends import("ai").UIMessage>({ message }: {
6
- message: T;
7
- }) => import("react/jsx-runtime").JSX.Element | null;
8
- File: <T extends import("ai").UIMessage>({ message }: {
9
- message: T;
10
- }) => import("react/jsx-runtime").JSX.Element | null;
11
- Loader: (props: import("@mantine/core").LoaderProps) => import("react/jsx-runtime").JSX.Element | null;
12
- Empty: () => import("react/jsx-runtime").JSX.Element | null;
13
- };
@@ -1,14 +0,0 @@
1
- import { Empty } from "./Empty.js";
2
- import { File } from "./File.js";
3
- import { Loader } from "./Loader.js";
4
- import { Message } from "./Message.js";
5
- import { Root } from "./Root.js";
6
- import { useChatMessage } from "./useChatMessage.js";
7
- const Conversation = {
8
- Root: Root,
9
- Message: Message,
10
- File: File,
11
- Loader: Loader,
12
- Empty: Empty
13
- };
14
- export { Conversation, useChatMessage };
@@ -1,7 +0,0 @@
1
- import type { PaperProps } from '@mantine/core';
2
- export interface ConversationProps extends PaperProps {
3
- children?: React.ReactNode;
4
- loading: boolean;
5
- streaming: boolean;
6
- empty: boolean;
7
- }
File without changes
@@ -1,2 +0,0 @@
1
- import type { TextUIPart } from 'ai';
2
- export declare const useChatMessage: (part: TextUIPart) => string;
@@ -1,12 +0,0 @@
1
- import { useEffect, useState } from "react";
2
- import { parseAiMessagePart } from "../../utils/parseAiMessagePart.js";
3
- const useChatMessage = (part)=>{
4
- const [parsedText, setParsedText] = useState('');
5
- useEffect(()=>{
6
- parseAiMessagePart(part).then((i)=>setParsedText(i.text));
7
- }, [
8
- part
9
- ]);
10
- return parsedText;
11
- };
12
- export { useChatMessage };
@@ -1,2 +0,0 @@
1
- import { type FileButtonProps } from '@mantine/core';
2
- export declare const File: (props: Omit<FileButtonProps, "onChange" | "children">) => import("react/jsx-runtime").JSX.Element;