@app-studio/web 0.8.96 → 0.9.0
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.
- package/dist/components/ChatInput/AttachmentGroup.d.ts +19 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.props.d.ts +204 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.state.d.ts +33 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.style.d.ts +112 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.type.d.ts +67 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.view.d.ts +4 -0
- package/dist/components/ChatInput/ChatInput.d.ts +21 -0
- package/dist/components/ChatInput/EditableInput.d.ts +15 -0
- package/dist/components/ChatInput/FileUploadHandler.d.ts +20 -0
- package/dist/components/ChatInput/GuideTip.d.ts +12 -0
- package/dist/components/ChatInput/MessageInput.d.ts +36 -0
- package/dist/components/ChatInput/PromptExamples.d.ts +13 -0
- package/dist/components/ChatInput/ReferenceImageButton.d.ts +11 -0
- package/dist/components/ChatInput/ReferenceImageModal.d.ts +12 -0
- package/dist/components/ChatInput/index.d.ts +9 -0
- package/dist/components/Flow/Flow/Flow.props.d.ts +144 -0
- package/dist/components/Flow/Flow/Flow.state.d.ts +95 -0
- package/dist/components/Flow/Flow/Flow.style.d.ts +40 -0
- package/dist/components/Flow/Flow/Flow.type.d.ts +181 -0
- package/dist/components/Flow/Flow/Flow.view.d.ts +28 -0
- package/dist/components/Flow/Flow.d.ts +2 -0
- package/dist/components/Flow/examples/DragAndDrop.d.ts +2 -0
- package/dist/components/Flow/examples/default.d.ts +2 -0
- package/dist/components/Flow/examples/flowchart.d.ts +2 -0
- package/dist/components/Flow/examples/index.d.ts +2 -0
- package/dist/components/Flow/examples/list.d.ts +2 -0
- package/dist/components/Flow/index.d.ts +2 -0
- package/dist/components/Icon/Icon.d.ts +8 -0
- package/dist/components/TextArea/TextArea.d.ts +22 -0
- package/dist/components/Tree/Tree/Tree.props.d.ts +106 -0
- package/dist/components/Tree/Tree/Tree.state.d.ts +38 -0
- package/dist/components/Tree/Tree/Tree.style.d.ts +41 -0
- package/dist/components/Tree/Tree/Tree.type.d.ts +133 -0
- package/dist/components/Tree/Tree/Tree.view.d.ts +36 -0
- package/dist/components/Tree/Tree.d.ts +2 -0
- package/dist/components/Tree/examples/DragAndDrop.d.ts +2 -0
- package/dist/components/Tree/examples/controlled.d.ts +2 -0
- package/dist/components/Tree/examples/custom-styling.d.ts +2 -0
- package/dist/components/Tree/examples/data-driven.d.ts +2 -0
- package/dist/components/Tree/examples/default.d.ts +2 -0
- package/dist/components/Tree/examples/index.d.ts +6 -0
- package/dist/components/Tree/examples/variants.d.ts +2 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/pages/chat.page.d.ts +2 -2
- package/dist/pages/flow.page.d.ts +3 -0
- package/dist/pages/tree.page.d.ts +3 -0
- package/dist/web.cjs.development.js +3833 -281
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +3825 -284
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +3835 -285
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/Chat/AIResponseDisplay/AIResponseDisplay/AIResponseDisplay.props.d.ts +0 -40
- package/dist/components/Chat/AIResponseDisplay/AIResponseDisplay/AIResponseDisplay.style.d.ts +0 -10
- package/dist/components/Chat/AIResponseDisplay/AIResponseDisplay/AIResponseDisplay.type.d.ts +0 -23
- package/dist/components/Chat/AIResponseDisplay/AIResponseDisplay/AIResponseDisplay.view.d.ts +0 -9
- package/dist/components/Chat/AIResponseDisplay/AIResponseDisplay.d.ts +0 -10
- package/dist/components/Chat/AIResponseDisplay/examples/basic.d.ts +0 -5
- package/dist/components/Chat/AIResponseDisplay/examples/index.d.ts +0 -4
- package/dist/components/Chat/ChatInterface/ChatInterface/ChatInterface.props.d.ts +0 -56
- package/dist/components/Chat/ChatInterface/ChatInterface/ChatInterface.state.d.ts +0 -12
- package/dist/components/Chat/ChatInterface/ChatInterface/ChatInterface.style.d.ts +0 -10
- package/dist/components/Chat/ChatInterface/ChatInterface/ChatInterface.type.d.ts +0 -19
- package/dist/components/Chat/ChatInterface/ChatInterface/ChatInterface.view.d.ts +0 -14
- package/dist/components/Chat/ChatInterface/ChatInterface.d.ts +0 -11
- package/dist/components/Chat/CodeBlock/CodeBlock/CodeBlock.props.d.ts +0 -35
- package/dist/components/Chat/CodeBlock/CodeBlock/CodeBlock.state.d.ts +0 -7
- package/dist/components/Chat/CodeBlock/CodeBlock/CodeBlock.style.d.ts +0 -12
- package/dist/components/Chat/CodeBlock/CodeBlock/CodeBlock.type.d.ts +0 -11
- package/dist/components/Chat/CodeBlock/CodeBlock/CodeBlock.view.d.ts +0 -11
- package/dist/components/Chat/CodeBlock/CodeBlock.d.ts +0 -10
- package/dist/components/Chat/FileUploader/FileUploader/FileUploader.props.d.ts +0 -47
- package/dist/components/Chat/FileUploader/FileUploader/FileUploader.state.d.ts +0 -15
- package/dist/components/Chat/FileUploader/FileUploader/FileUploader.style.d.ts +0 -15
- package/dist/components/Chat/FileUploader/FileUploader/FileUploader.type.d.ts +0 -24
- package/dist/components/Chat/FileUploader/FileUploader/FileUploader.view.d.ts +0 -18
- package/dist/components/Chat/FileUploader/FileUploader.d.ts +0 -11
- package/dist/components/Chat/LoadingIndicator/LoadingIndicator/LoadingIndicator.props.d.ts +0 -27
- package/dist/components/Chat/LoadingIndicator/LoadingIndicator/LoadingIndicator.style.d.ts +0 -13
- package/dist/components/Chat/LoadingIndicator/LoadingIndicator/LoadingIndicator.type.d.ts +0 -11
- package/dist/components/Chat/LoadingIndicator/LoadingIndicator/LoadingIndicator.view.d.ts +0 -6
- package/dist/components/Chat/LoadingIndicator/LoadingIndicator.d.ts +0 -10
- package/dist/components/Chat/MessageBubble/MessageBubble/MessageBubble.props.d.ts +0 -36
- package/dist/components/Chat/MessageBubble/MessageBubble/MessageBubble.state.d.ts +0 -14
- package/dist/components/Chat/MessageBubble/MessageBubble/MessageBubble.style.d.ts +0 -10
- package/dist/components/Chat/MessageBubble/MessageBubble/MessageBubble.type.d.ts +0 -11
- package/dist/components/Chat/MessageBubble/MessageBubble/MessageBubble.view.d.ts +0 -17
- package/dist/components/Chat/MessageBubble/MessageBubble.d.ts +0 -10
- package/dist/components/Chat/ModelSelector/ModelSelector/ModelSelector.props.d.ts +0 -39
- package/dist/components/Chat/ModelSelector/ModelSelector/ModelSelector.state.d.ts +0 -12
- package/dist/components/Chat/ModelSelector/ModelSelector/ModelSelector.style.d.ts +0 -11
- package/dist/components/Chat/ModelSelector/ModelSelector/ModelSelector.type.d.ts +0 -21
- package/dist/components/Chat/ModelSelector/ModelSelector/ModelSelector.view.d.ts +0 -16
- package/dist/components/Chat/ModelSelector/ModelSelector.d.ts +0 -10
- package/dist/components/Chat/PromptInput/PromptInput/PromptInput.props.d.ts +0 -59
- package/dist/components/Chat/PromptInput/PromptInput/PromptInput.state.d.ts +0 -13
- package/dist/components/Chat/PromptInput/PromptInput/PromptInput.style.d.ts +0 -10
- package/dist/components/Chat/PromptInput/PromptInput/PromptInput.type.d.ts +0 -11
- package/dist/components/Chat/PromptInput/PromptInput/PromptInput.view.d.ts +0 -16
- package/dist/components/Chat/PromptInput/PromptInput.d.ts +0 -10
- package/dist/components/Chat/SettingsPanel/SettingsPanel/SettingsPanel.props.d.ts +0 -31
- package/dist/components/Chat/SettingsPanel/SettingsPanel/SettingsPanel.style.d.ts +0 -11
- package/dist/components/Chat/SettingsPanel/SettingsPanel/SettingsPanel.type.d.ts +0 -30
- package/dist/components/Chat/SettingsPanel/SettingsPanel/SettingsPanel.view.d.ts +0 -6
- package/dist/components/Chat/SettingsPanel/SettingsPanel.d.ts +0 -10
- package/dist/components/Chat/ToolSelector/ToolSelector/ToolSelector.props.d.ts +0 -39
- package/dist/components/Chat/ToolSelector/ToolSelector/ToolSelector.style.d.ts +0 -10
- package/dist/components/Chat/ToolSelector/ToolSelector/ToolSelector.type.d.ts +0 -20
- package/dist/components/Chat/ToolSelector/ToolSelector/ToolSelector.view.d.ts +0 -6
- package/dist/components/Chat/ToolSelector/ToolSelector.d.ts +0 -10
- package/dist/components/Chat/index.d.ts +0 -16
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UploadedFile } from './ChatInput/ChatInput.type';
|
|
3
|
+
interface AttachmentGroupProps {
|
|
4
|
+
files: UploadedFile[];
|
|
5
|
+
sandboxId?: string;
|
|
6
|
+
onRemove: (index: number) => void;
|
|
7
|
+
layout?: 'inline' | 'grid';
|
|
8
|
+
maxHeight?: string;
|
|
9
|
+
showPreviews?: boolean;
|
|
10
|
+
views?: {
|
|
11
|
+
container?: any;
|
|
12
|
+
item?: any;
|
|
13
|
+
name?: any;
|
|
14
|
+
size?: any;
|
|
15
|
+
removeButton?: any;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare const AttachmentGroup: React.FC<AttachmentGroupProps>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ViewProps } from 'app-studio';
|
|
3
|
+
import { ChatInputStyles, ModelOption, PromptExample, Shape, Size, UploadedFile, Variant } from './ChatInput.type';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the ChatInput component
|
|
6
|
+
*/
|
|
7
|
+
export interface ChatInputProps extends ViewProps {
|
|
8
|
+
/**
|
|
9
|
+
* Callback function when the form is submitted
|
|
10
|
+
*/
|
|
11
|
+
onSubmit: (message: string, options?: {
|
|
12
|
+
model_name?: string;
|
|
13
|
+
enable_thinking?: boolean;
|
|
14
|
+
}) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Placeholder text for the input
|
|
17
|
+
*/
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the input is in a loading state
|
|
21
|
+
*/
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the input is disabled
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether an agent is currently running
|
|
29
|
+
*/
|
|
30
|
+
isAgentRunning?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Callback function to stop the agent
|
|
33
|
+
*/
|
|
34
|
+
onStopAgent?: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Whether to auto focus the input
|
|
37
|
+
*/
|
|
38
|
+
autoFocus?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Controlled value for the input
|
|
41
|
+
*/
|
|
42
|
+
value?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Callback function when the input value changes
|
|
45
|
+
*/
|
|
46
|
+
onChange?: (value: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Callback function when the file browser is opened
|
|
49
|
+
*/
|
|
50
|
+
onFileBrowse?: () => void;
|
|
51
|
+
/**
|
|
52
|
+
* ID of the sandbox
|
|
53
|
+
*/
|
|
54
|
+
sandboxId?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Whether to hide the attachment button
|
|
57
|
+
*/
|
|
58
|
+
hideAttachments?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Title for the chat input
|
|
61
|
+
*/
|
|
62
|
+
title?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Whether to show the guide tip
|
|
65
|
+
*/
|
|
66
|
+
showGuideTip?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* URL for the guide video
|
|
69
|
+
*/
|
|
70
|
+
guideVideoUrl?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Callback function when the guide tip is closed
|
|
73
|
+
*/
|
|
74
|
+
onGuideClose?: () => void;
|
|
75
|
+
/**
|
|
76
|
+
* List of prompt examples
|
|
77
|
+
*/
|
|
78
|
+
promptExamples?: PromptExample[];
|
|
79
|
+
/**
|
|
80
|
+
* Callback function when a prompt example is selected
|
|
81
|
+
*/
|
|
82
|
+
onPromptExampleSelect?: (example: PromptExample) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Whether to show the reference image button
|
|
85
|
+
*/
|
|
86
|
+
showReferenceImageButton?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Callback function when the reference image button is clicked
|
|
89
|
+
*/
|
|
90
|
+
onReferenceImageClick?: () => void;
|
|
91
|
+
/**
|
|
92
|
+
* Error message to display at the bottom
|
|
93
|
+
*/
|
|
94
|
+
errorMessage?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Size of the input
|
|
97
|
+
*/
|
|
98
|
+
size?: Size;
|
|
99
|
+
/**
|
|
100
|
+
* Shape of the input
|
|
101
|
+
*/
|
|
102
|
+
shape?: Shape;
|
|
103
|
+
/**
|
|
104
|
+
* Variant of the input
|
|
105
|
+
*/
|
|
106
|
+
variant?: Variant;
|
|
107
|
+
/**
|
|
108
|
+
* Style customization
|
|
109
|
+
*/
|
|
110
|
+
views?: ChatInputStyles;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Props for the ChatInput view component
|
|
114
|
+
*/
|
|
115
|
+
export interface ChatInputViewProps extends ChatInputProps {
|
|
116
|
+
/**
|
|
117
|
+
* Current value of the input
|
|
118
|
+
*/
|
|
119
|
+
value?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Callback function when the input value changes
|
|
122
|
+
*/
|
|
123
|
+
handleChange: (value: string) => void;
|
|
124
|
+
/**
|
|
125
|
+
* Callback function when the form is submitted
|
|
126
|
+
*/
|
|
127
|
+
handleSubmit: (e: React.FormEvent) => void;
|
|
128
|
+
/**
|
|
129
|
+
* Reference to the editable div element
|
|
130
|
+
*/
|
|
131
|
+
editableRef: React.RefObject<HTMLDivElement>;
|
|
132
|
+
/**
|
|
133
|
+
* Reference to the file input element
|
|
134
|
+
*/
|
|
135
|
+
fileInputRef: React.RefObject<HTMLInputElement>;
|
|
136
|
+
/**
|
|
137
|
+
* Whether files are being uploaded
|
|
138
|
+
*/
|
|
139
|
+
isUploading: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Whether the user is dragging files over the input
|
|
142
|
+
*/
|
|
143
|
+
isDraggingOver: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* List of uploaded files
|
|
146
|
+
*/
|
|
147
|
+
uploadedFiles: UploadedFile[];
|
|
148
|
+
/**
|
|
149
|
+
* Callback function to remove an uploaded file
|
|
150
|
+
*/
|
|
151
|
+
removeUploadedFile: (index: number) => void;
|
|
152
|
+
/**
|
|
153
|
+
* Callback function to set pending files
|
|
154
|
+
*/
|
|
155
|
+
setPendingFiles: React.Dispatch<React.SetStateAction<File[]>>;
|
|
156
|
+
/**
|
|
157
|
+
* Callback function to set uploaded files
|
|
158
|
+
*/
|
|
159
|
+
setUploadedFiles: React.Dispatch<React.SetStateAction<UploadedFile[]>>;
|
|
160
|
+
/**
|
|
161
|
+
* Callback function to set whether files are being uploaded
|
|
162
|
+
*/
|
|
163
|
+
setIsUploading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
164
|
+
/**
|
|
165
|
+
* Currently selected model
|
|
166
|
+
*/
|
|
167
|
+
selectedModel: string;
|
|
168
|
+
/**
|
|
169
|
+
* Callback function when the model changes
|
|
170
|
+
*/
|
|
171
|
+
handleModelChange: (model: string) => void;
|
|
172
|
+
/**
|
|
173
|
+
* List of available models
|
|
174
|
+
*/
|
|
175
|
+
modelOptions: ModelOption[];
|
|
176
|
+
/**
|
|
177
|
+
* Subscription status
|
|
178
|
+
*/
|
|
179
|
+
subscriptionStatus?: string;
|
|
180
|
+
/**
|
|
181
|
+
* Whether the user can access the selected model
|
|
182
|
+
*/
|
|
183
|
+
canAccessModel: (model: string) => boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Whether the guide tip is shown
|
|
186
|
+
*/
|
|
187
|
+
isGuideTipShown: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Callback function to hide the guide tip
|
|
190
|
+
*/
|
|
191
|
+
hideGuideTip: () => void;
|
|
192
|
+
/**
|
|
193
|
+
* Whether the reference image modal is shown
|
|
194
|
+
*/
|
|
195
|
+
isReferenceImageModalShown: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Callback function to toggle the reference image modal
|
|
198
|
+
*/
|
|
199
|
+
toggleReferenceImageModal: () => void;
|
|
200
|
+
/**
|
|
201
|
+
* Callback function to handle prompt example selection
|
|
202
|
+
*/
|
|
203
|
+
handlePromptExampleSelect: (example: PromptExample) => void;
|
|
204
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ChatInputProps } from './ChatInput.props';
|
|
3
|
+
import { ModelOption, PromptExample, UploadedFile } from './ChatInput.type';
|
|
4
|
+
/**
|
|
5
|
+
* Custom hook for managing ChatInput state
|
|
6
|
+
*/
|
|
7
|
+
export declare const useChatInputState: (props: ChatInputProps) => {
|
|
8
|
+
value: string | undefined;
|
|
9
|
+
handleChange: (newValue: string) => void;
|
|
10
|
+
handleSubmit: (e: React.FormEvent) => void;
|
|
11
|
+
editableRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
12
|
+
fileInputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
13
|
+
isUploading: boolean;
|
|
14
|
+
isDraggingOver: boolean;
|
|
15
|
+
uploadedFiles: UploadedFile[];
|
|
16
|
+
pendingFiles: File[];
|
|
17
|
+
removeUploadedFile: (index: number) => void;
|
|
18
|
+
setPendingFiles: import("react").Dispatch<import("react").SetStateAction<File[]>>;
|
|
19
|
+
setUploadedFiles: import("react").Dispatch<import("react").SetStateAction<UploadedFile[]>>;
|
|
20
|
+
setIsUploading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
21
|
+
selectedModel: string;
|
|
22
|
+
handleModelChange: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
23
|
+
modelOptions: ModelOption[];
|
|
24
|
+
subscriptionStatus: string;
|
|
25
|
+
canAccessModel: (_model: string) => boolean;
|
|
26
|
+
handleDragOver: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
27
|
+
handleDragLeave: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
28
|
+
isGuideTipShown: boolean;
|
|
29
|
+
hideGuideTip: () => void;
|
|
30
|
+
isReferenceImageModalShown: boolean;
|
|
31
|
+
toggleReferenceImageModal: () => void;
|
|
32
|
+
handlePromptExampleSelect: (example: PromptExample) => void;
|
|
33
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ViewProps } from 'app-studio';
|
|
2
|
+
import { Shape, Size, Variant } from './ChatInput.type';
|
|
3
|
+
/**
|
|
4
|
+
* Default styles for the ChatInput component
|
|
5
|
+
*/
|
|
6
|
+
export declare const DefaultChatInputStyles: {
|
|
7
|
+
container: {
|
|
8
|
+
width: string;
|
|
9
|
+
maxWidth: string;
|
|
10
|
+
borderRadius: string;
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
transition: string;
|
|
13
|
+
};
|
|
14
|
+
content: {
|
|
15
|
+
width: string;
|
|
16
|
+
padding: string;
|
|
17
|
+
borderRadius: string;
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
borderWidth: string;
|
|
20
|
+
borderStyle: string;
|
|
21
|
+
borderColor: string;
|
|
22
|
+
};
|
|
23
|
+
textarea: {
|
|
24
|
+
width: string;
|
|
25
|
+
minHeight: string;
|
|
26
|
+
maxHeight: string;
|
|
27
|
+
padding: string;
|
|
28
|
+
fontSize: string;
|
|
29
|
+
lineHeight: string;
|
|
30
|
+
color: string;
|
|
31
|
+
backgroundColor: string;
|
|
32
|
+
border: string;
|
|
33
|
+
outline: string;
|
|
34
|
+
resize: string;
|
|
35
|
+
overflow: string;
|
|
36
|
+
};
|
|
37
|
+
attachments: {
|
|
38
|
+
display: string;
|
|
39
|
+
flexWrap: string;
|
|
40
|
+
gap: string;
|
|
41
|
+
padding: string;
|
|
42
|
+
};
|
|
43
|
+
attachmentItem: {
|
|
44
|
+
display: string;
|
|
45
|
+
alignItems: string;
|
|
46
|
+
gap: string;
|
|
47
|
+
padding: string;
|
|
48
|
+
borderRadius: string;
|
|
49
|
+
backgroundColor: string;
|
|
50
|
+
};
|
|
51
|
+
attachmentName: {
|
|
52
|
+
fontSize: string;
|
|
53
|
+
fontWeight: string;
|
|
54
|
+
color: string;
|
|
55
|
+
};
|
|
56
|
+
attachmentSize: {
|
|
57
|
+
fontSize: string;
|
|
58
|
+
color: string;
|
|
59
|
+
};
|
|
60
|
+
attachmentRemove: {
|
|
61
|
+
padding: string;
|
|
62
|
+
borderRadius: string;
|
|
63
|
+
cursor: string;
|
|
64
|
+
color: string;
|
|
65
|
+
backgroundColor: string;
|
|
66
|
+
transition: string;
|
|
67
|
+
};
|
|
68
|
+
submitButton: {
|
|
69
|
+
height: string;
|
|
70
|
+
minWidth: string;
|
|
71
|
+
padding: string;
|
|
72
|
+
borderRadius: string;
|
|
73
|
+
backgroundColor: string;
|
|
74
|
+
color: string;
|
|
75
|
+
transition: string;
|
|
76
|
+
};
|
|
77
|
+
fileButton: {
|
|
78
|
+
height: string;
|
|
79
|
+
padding: string;
|
|
80
|
+
borderRadius: string;
|
|
81
|
+
backgroundColor: string;
|
|
82
|
+
color: string;
|
|
83
|
+
transition: string;
|
|
84
|
+
};
|
|
85
|
+
modelSelector: {
|
|
86
|
+
height: string;
|
|
87
|
+
padding: string;
|
|
88
|
+
borderRadius: string;
|
|
89
|
+
backgroundColor: string;
|
|
90
|
+
color: string;
|
|
91
|
+
transition: string;
|
|
92
|
+
};
|
|
93
|
+
loadingIndicator: {
|
|
94
|
+
display: string;
|
|
95
|
+
alignItems: string;
|
|
96
|
+
justifyContent: string;
|
|
97
|
+
gap: string;
|
|
98
|
+
padding: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Shape styles for the ChatInput component
|
|
103
|
+
*/
|
|
104
|
+
export declare const Shapes: Record<Shape, ViewProps>;
|
|
105
|
+
/**
|
|
106
|
+
* Size styles for the ChatInput component
|
|
107
|
+
*/
|
|
108
|
+
export declare const Sizes: Record<Size, ViewProps>;
|
|
109
|
+
/**
|
|
110
|
+
* Variant styles for the ChatInput component
|
|
111
|
+
*/
|
|
112
|
+
export declare const Variants: Record<Variant, ViewProps>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ViewProps } from 'app-studio';
|
|
2
|
+
/**
|
|
3
|
+
* Size options for the ChatInput component
|
|
4
|
+
*/
|
|
5
|
+
export declare type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
/**
|
|
7
|
+
* Shape options for the ChatInput component
|
|
8
|
+
*/
|
|
9
|
+
export declare type Shape = 'default' | 'sharp' | 'rounded' | 'pillShaped';
|
|
10
|
+
/**
|
|
11
|
+
* Variant options for the ChatInput component
|
|
12
|
+
*/
|
|
13
|
+
export declare type Variant = 'default' | 'outline' | 'none';
|
|
14
|
+
/**
|
|
15
|
+
* Uploaded file interface
|
|
16
|
+
*/
|
|
17
|
+
export interface UploadedFile {
|
|
18
|
+
name: string;
|
|
19
|
+
path: string;
|
|
20
|
+
size: number;
|
|
21
|
+
type: string;
|
|
22
|
+
localUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Prompt example interface
|
|
26
|
+
*/
|
|
27
|
+
export interface PromptExample {
|
|
28
|
+
id: string;
|
|
29
|
+
text: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Model option interface
|
|
33
|
+
*/
|
|
34
|
+
export interface ModelOption {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
isThinking?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Style customization interface for ChatInput
|
|
42
|
+
*/
|
|
43
|
+
export interface ChatInputStyles {
|
|
44
|
+
textarea?: ViewProps;
|
|
45
|
+
container?: ViewProps;
|
|
46
|
+
content?: ViewProps;
|
|
47
|
+
editableInput?: ViewProps;
|
|
48
|
+
header?: ViewProps;
|
|
49
|
+
title?: ViewProps;
|
|
50
|
+
guideTip?: ViewProps;
|
|
51
|
+
guideTipVideo?: ViewProps;
|
|
52
|
+
guideTipClose?: ViewProps;
|
|
53
|
+
promptExamples?: ViewProps;
|
|
54
|
+
promptExampleItem?: ViewProps;
|
|
55
|
+
referenceImageButton?: ViewProps;
|
|
56
|
+
referenceImageModal?: ViewProps;
|
|
57
|
+
attachments?: ViewProps;
|
|
58
|
+
attachmentItem?: ViewProps;
|
|
59
|
+
attachmentName?: ViewProps;
|
|
60
|
+
attachmentSize?: ViewProps;
|
|
61
|
+
attachmentRemove?: ViewProps;
|
|
62
|
+
submitButton?: ViewProps;
|
|
63
|
+
fileButton?: ViewProps;
|
|
64
|
+
modelSelector?: ViewProps;
|
|
65
|
+
loadingIndicator?: ViewProps;
|
|
66
|
+
bottomTip?: ViewProps;
|
|
67
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChatInputProps } from './ChatInput/ChatInput.props';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for the ChatInput component's imperative handle
|
|
5
|
+
*/
|
|
6
|
+
export interface ChatInputHandles {
|
|
7
|
+
/**
|
|
8
|
+
* Get the pending files
|
|
9
|
+
*/
|
|
10
|
+
getPendingFiles: () => File[];
|
|
11
|
+
/**
|
|
12
|
+
* Clear the pending files
|
|
13
|
+
*/
|
|
14
|
+
clearPendingFiles: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ChatInput component
|
|
18
|
+
*
|
|
19
|
+
* A customizable chat input component with file upload support
|
|
20
|
+
*/
|
|
21
|
+
export declare const ChatInput: React.ForwardRefExoticComponent<Pick<ChatInputProps, string | number> & React.RefAttributes<ChatInputHandles>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface EditableInputProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
onSubmit: (e: React.FormEvent) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
autoFocus?: boolean;
|
|
9
|
+
views?: {
|
|
10
|
+
container?: any;
|
|
11
|
+
input?: any;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare const EditableInput: React.ForwardRefExoticComponent<EditableInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UploadedFile } from './ChatInput/ChatInput.type';
|
|
3
|
+
interface FileUploadHandlerProps {
|
|
4
|
+
loading: boolean;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
isAgentRunning: boolean;
|
|
7
|
+
isUploading: boolean;
|
|
8
|
+
sandboxId?: string;
|
|
9
|
+
setPendingFiles: React.Dispatch<React.SetStateAction<File[]>>;
|
|
10
|
+
setUploadedFiles: React.Dispatch<React.SetStateAction<UploadedFile[]>>;
|
|
11
|
+
setIsUploading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
|
+
views?: {
|
|
13
|
+
button?: any;
|
|
14
|
+
icon?: any;
|
|
15
|
+
text?: any;
|
|
16
|
+
tooltip?: any;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare const FileUploadHandler: React.ForwardRefExoticComponent<FileUploadHandlerProps & React.RefAttributes<HTMLInputElement>>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ModelOption, UploadedFile } from './ChatInput/ChatInput.type';
|
|
3
|
+
interface MessageInputProps {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
6
|
+
onSubmit: (e: React.FormEvent) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
isAgentRunning?: boolean;
|
|
11
|
+
onStopAgent?: () => void;
|
|
12
|
+
isDraggingOver?: boolean;
|
|
13
|
+
uploadedFiles: UploadedFile[];
|
|
14
|
+
fileInputRef: React.RefObject<HTMLInputElement>;
|
|
15
|
+
isUploading: boolean;
|
|
16
|
+
sandboxId?: string;
|
|
17
|
+
setPendingFiles: React.Dispatch<React.SetStateAction<File[]>>;
|
|
18
|
+
setUploadedFiles: React.Dispatch<React.SetStateAction<UploadedFile[]>>;
|
|
19
|
+
setIsUploading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
20
|
+
hideAttachments?: boolean;
|
|
21
|
+
selectedModel: string;
|
|
22
|
+
onModelChange: (model: string) => void;
|
|
23
|
+
modelOptions: ModelOption[];
|
|
24
|
+
subscriptionStatus?: string;
|
|
25
|
+
canAccessModel: (model: string) => boolean;
|
|
26
|
+
views?: {
|
|
27
|
+
container?: any;
|
|
28
|
+
textarea?: any;
|
|
29
|
+
buttonGroup?: any;
|
|
30
|
+
submitButton?: any;
|
|
31
|
+
submitIcon?: any;
|
|
32
|
+
modelSelector?: any;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export declare const MessageInput: React.ForwardRefExoticComponent<MessageInputProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PromptExample } from './ChatInput/ChatInput.type';
|
|
3
|
+
interface PromptExamplesProps {
|
|
4
|
+
examples: PromptExample[];
|
|
5
|
+
onSelect: (example: PromptExample) => void;
|
|
6
|
+
views?: {
|
|
7
|
+
container?: any;
|
|
8
|
+
item?: any;
|
|
9
|
+
text?: any;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare const PromptExamples: React.FC<PromptExamplesProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ReferenceImageModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
views?: {
|
|
6
|
+
container?: any;
|
|
7
|
+
content?: any;
|
|
8
|
+
closeButton?: any;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const ReferenceImageModal: React.FC<ReferenceImageModalProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { ChatInput } from './ChatInput';
|
|
2
|
+
export type { ChatInputHandles } from './ChatInput';
|
|
3
|
+
export { AttachmentGroup } from './AttachmentGroup';
|
|
4
|
+
export { EditableInput } from './EditableInput';
|
|
5
|
+
export { FileUploadHandler } from './FileUploadHandler';
|
|
6
|
+
export { GuideTip } from './GuideTip';
|
|
7
|
+
export { PromptExamples } from './PromptExamples';
|
|
8
|
+
export { ReferenceImageButton } from './ReferenceImageButton';
|
|
9
|
+
export { ReferenceImageModal } from './ReferenceImageModal';
|