@app-studio/web 0.9.3 → 0.9.5
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 +2 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.props.d.ts +28 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.state.d.ts +3 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.type.d.ts +2 -0
- package/dist/components/ChatInput/ChatInput.d.ts +1 -11
- package/dist/components/ChatInput/{FileUploadHandler.d.ts → ChatUploader.d.ts} +3 -2
- package/dist/components/ChatInput/ReferenceImageButton.d.ts +1 -0
- package/dist/components/ChatInput/ReferenceImageModal.d.ts +7 -0
- package/dist/components/ChatInput/index.d.ts +1 -2
- package/dist/components/Icon/Icon.d.ts +1 -3
- package/dist/components/Uploader/Uploader/Uploader.props.d.ts +5 -0
- package/dist/components/Uploader/Uploader/Uploader.state.d.ts +2 -1
- package/dist/web.cjs.development.js +459 -688
- 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 +461 -688
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +459 -688
- 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 +1 -1
|
@@ -4,6 +4,7 @@ interface AttachmentGroupProps {
|
|
|
4
4
|
files: UploadedFile[];
|
|
5
5
|
sandboxId?: string;
|
|
6
6
|
onRemove: (index: number) => void;
|
|
7
|
+
onSetAsReference?: (index: number) => void;
|
|
7
8
|
layout?: 'inline' | 'grid';
|
|
8
9
|
maxHeight?: string;
|
|
9
10
|
showPreviews?: boolean;
|
|
@@ -13,6 +14,7 @@ interface AttachmentGroupProps {
|
|
|
13
14
|
name?: any;
|
|
14
15
|
size?: any;
|
|
15
16
|
removeButton?: any;
|
|
17
|
+
referenceButton?: any;
|
|
16
18
|
};
|
|
17
19
|
}
|
|
18
20
|
export declare const AttachmentGroup: React.FC<AttachmentGroupProps>;
|
|
@@ -5,6 +5,14 @@ import { ChatInputStyles, ModelOption, PromptExample, Shape, Size, UploadedFile,
|
|
|
5
5
|
* Props for the ChatInput component
|
|
6
6
|
*/
|
|
7
7
|
export interface ChatInputProps extends ViewProps {
|
|
8
|
+
/**
|
|
9
|
+
* Get the pending files
|
|
10
|
+
*/
|
|
11
|
+
getPendingFiles: () => File[];
|
|
12
|
+
/**
|
|
13
|
+
* Clear the pending files
|
|
14
|
+
*/
|
|
15
|
+
clearPendingFiles: () => void;
|
|
8
16
|
/**
|
|
9
17
|
* Callback function when the form is submitted
|
|
10
18
|
*/
|
|
@@ -201,4 +209,24 @@ export interface ChatInputViewProps extends ChatInputProps {
|
|
|
201
209
|
* Callback function to handle prompt example selection
|
|
202
210
|
*/
|
|
203
211
|
handlePromptExampleSelect: (example: PromptExample) => void;
|
|
212
|
+
/**
|
|
213
|
+
* Callback function to handle drag over events
|
|
214
|
+
*/
|
|
215
|
+
handleDragOver: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
216
|
+
/**
|
|
217
|
+
* Callback function to handle drag leave events
|
|
218
|
+
*/
|
|
219
|
+
handleDragLeave: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
220
|
+
/**
|
|
221
|
+
* Callback function to handle reference image upload
|
|
222
|
+
*/
|
|
223
|
+
handleReferenceImageUpload: (files: File[]) => void;
|
|
224
|
+
/**
|
|
225
|
+
* Callback function to remove reference image
|
|
226
|
+
*/
|
|
227
|
+
removeReferenceImage: () => void;
|
|
228
|
+
/**
|
|
229
|
+
* Callback function to set a file as reference image
|
|
230
|
+
*/
|
|
231
|
+
setFileAsReference: (fileIndex: number) => void;
|
|
204
232
|
}
|
|
@@ -30,4 +30,7 @@ export declare const useChatInputState: (props: ChatInputProps) => {
|
|
|
30
30
|
isReferenceImageModalShown: boolean;
|
|
31
31
|
toggleReferenceImageModal: () => void;
|
|
32
32
|
handlePromptExampleSelect: (example: PromptExample) => void;
|
|
33
|
+
handleReferenceImageUpload: (files: File[]) => void;
|
|
34
|
+
removeReferenceImage: () => void;
|
|
35
|
+
setFileAsReference: (fileIndex: number) => void;
|
|
33
36
|
};
|
|
@@ -20,6 +20,7 @@ export interface UploadedFile {
|
|
|
20
20
|
size: number;
|
|
21
21
|
type: string;
|
|
22
22
|
localUrl?: string;
|
|
23
|
+
isReferenceImage?: boolean;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Prompt example interface
|
|
@@ -59,6 +60,7 @@ export interface ChatInputStyles {
|
|
|
59
60
|
attachmentName?: ViewProps;
|
|
60
61
|
attachmentSize?: ViewProps;
|
|
61
62
|
attachmentRemove?: ViewProps;
|
|
63
|
+
referenceButton?: ViewProps;
|
|
62
64
|
submitButton?: ViewProps;
|
|
63
65
|
fileButton?: ViewProps;
|
|
64
66
|
modelSelector?: ViewProps;
|
|
@@ -3,19 +3,9 @@ import { ChatInputProps } from './ChatInput/ChatInput.props';
|
|
|
3
3
|
/**
|
|
4
4
|
* Interface for the ChatInput component's imperative handle
|
|
5
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
6
|
/**
|
|
17
7
|
* ChatInput component
|
|
18
8
|
*
|
|
19
9
|
* A customizable chat input component with file upload support
|
|
20
10
|
*/
|
|
21
|
-
export declare const ChatInput: React.ForwardRefExoticComponent<Pick<ChatInputProps, string | number> & React.RefAttributes<
|
|
11
|
+
export declare const ChatInput: React.ForwardRefExoticComponent<Pick<ChatInputProps, string | number> & React.RefAttributes<HTMLElement>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UploadedFile } from './ChatInput/ChatInput.type';
|
|
3
|
-
interface
|
|
3
|
+
interface ChatUploaderProps {
|
|
4
4
|
loading: boolean;
|
|
5
5
|
disabled: boolean;
|
|
6
6
|
isAgentRunning: boolean;
|
|
7
7
|
isUploading: boolean;
|
|
8
|
+
hideAttachments?: boolean;
|
|
8
9
|
sandboxId?: string;
|
|
9
10
|
setPendingFiles: React.Dispatch<React.SetStateAction<File[]>>;
|
|
10
11
|
setUploadedFiles: React.Dispatch<React.SetStateAction<UploadedFile[]>>;
|
|
@@ -16,5 +17,5 @@ interface FileUploadHandlerProps {
|
|
|
16
17
|
tooltip?: any;
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
|
-
export declare const
|
|
20
|
+
export declare const ChatUploader: React.ForwardRefExoticComponent<ChatUploaderProps & React.RefAttributes<HTMLInputElement>>;
|
|
20
21
|
export {};
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { UploadedFile } from './ChatInput/ChatInput.type';
|
|
2
3
|
interface ReferenceImageModalProps {
|
|
3
4
|
isOpen: boolean;
|
|
4
5
|
onClose: () => void;
|
|
6
|
+
referenceImages: UploadedFile[];
|
|
7
|
+
onReferenceImageUpload: (files: File[]) => void;
|
|
8
|
+
onRemoveReferenceImage: () => void;
|
|
5
9
|
views?: {
|
|
6
10
|
container?: any;
|
|
7
11
|
content?: any;
|
|
8
12
|
closeButton?: any;
|
|
13
|
+
uploadArea?: any;
|
|
14
|
+
preview?: any;
|
|
15
|
+
removeButton?: any;
|
|
9
16
|
};
|
|
10
17
|
}
|
|
11
18
|
export declare const ReferenceImageModal: React.FC<ReferenceImageModalProps>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export { ChatInput } from './ChatInput';
|
|
2
|
-
export type { ChatInputHandles } from './ChatInput';
|
|
3
2
|
export { AttachmentGroup } from './AttachmentGroup';
|
|
4
3
|
export { EditableInput } from './EditableInput';
|
|
5
|
-
export {
|
|
4
|
+
export { ChatUploader } from './ChatUploader';
|
|
6
5
|
export { GuideTip } from './GuideTip';
|
|
7
6
|
export { PromptExamples } from './PromptExamples';
|
|
8
7
|
export { ReferenceImageButton } from './ReferenceImageButton';
|
|
@@ -44,7 +44,6 @@ export declare const ShareIcon: React.FC<IconProps>;
|
|
|
44
44
|
export declare const RefreshIcon: React.FC<IconProps>;
|
|
45
45
|
export declare const PrintIcon: React.FC<IconProps>;
|
|
46
46
|
export declare const MagicWandIcon: React.FC<IconProps>;
|
|
47
|
-
export declare const SliderVerticalIcon: React.FC<IconProps>;
|
|
48
47
|
export declare const PanelIcon: React.FC<IconProps>;
|
|
49
48
|
export declare const FilterIcon: React.FC<IconProps>;
|
|
50
49
|
export declare const HomeIcon: React.FC<IconProps>;
|
|
@@ -70,10 +69,9 @@ export declare const StopIcon: React.FC<IconProps>;
|
|
|
70
69
|
export declare const SendIcon: React.FC<IconProps>;
|
|
71
70
|
export declare const LoadingSpinnerIcon: React.FC<IconProps>;
|
|
72
71
|
export declare const DragHandleLinesIcon: React.FC<IconProps>;
|
|
73
|
-
export declare const ChevronDownIcon: React.FC<IconProps>;
|
|
74
|
-
export declare const ChevronRightIcon: React.FC<IconProps>;
|
|
75
72
|
export declare const CloseEyeIcon: React.FC<IconProps>;
|
|
76
73
|
export declare const TrashIcon: React.FC<IconProps>;
|
|
74
|
+
export declare const AttachmentIcon: React.FC<IconProps>;
|
|
77
75
|
export declare const ExternalLinkIcon: React.FC<IconProps>;
|
|
78
76
|
export declare const PlusIcon: React.FC<IconProps>;
|
|
79
77
|
export declare const TickIcon: React.FC<IconProps>;
|
|
@@ -5,13 +5,16 @@ export interface UseUploadProps {
|
|
|
5
5
|
accept?: string;
|
|
6
6
|
maxSize?: number;
|
|
7
7
|
onFileSelect?: (file: File) => void;
|
|
8
|
+
onMultipleFileSelect?: (files: File[]) => void;
|
|
8
9
|
validateFile?: (file: File) => string | null;
|
|
9
10
|
onError?: (error: string) => void;
|
|
10
11
|
thumbnail?: string;
|
|
12
|
+
multiple?: boolean;
|
|
11
13
|
}
|
|
12
14
|
export interface UploadStateProps {
|
|
13
15
|
handleFileChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
16
|
selectedFile: File | null;
|
|
17
|
+
selectedFiles: File[];
|
|
15
18
|
fileInputRef: React.RefObject<HTMLInputElement>;
|
|
16
19
|
videoRef: React.RefObject<HTMLVideoElement>;
|
|
17
20
|
}
|
|
@@ -44,7 +47,9 @@ export interface UploadViewProps {
|
|
|
44
47
|
fileType?: 'video' | 'image' | 'file';
|
|
45
48
|
handleClick?: () => void;
|
|
46
49
|
onFileSelect?: (file: File) => void;
|
|
50
|
+
onMultipleFileSelect?: (files: File[]) => void;
|
|
47
51
|
validateFile?: (file: File) => string | null;
|
|
52
|
+
multiple?: boolean;
|
|
48
53
|
views?: {
|
|
49
54
|
container?: ViewProps;
|
|
50
55
|
view?: ViewProps;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UseUploadProps } from '../Uploader/Uploader.props';
|
|
3
3
|
export declare const generateThumbnail: (videoFile: File, setThumbnailUrl: (url: string) => void) => void;
|
|
4
|
-
export declare const useUpload: ({ maxSize, onFileSelect, validateFile, thumbnail, onError, }: UseUploadProps) => {
|
|
4
|
+
export declare const useUpload: ({ maxSize, onFileSelect, onMultipleFileSelect, validateFile, thumbnail, multiple, onError, }: UseUploadProps) => {
|
|
5
5
|
previewUrl: string | null;
|
|
6
6
|
thumbnailUrl: string | null;
|
|
7
7
|
errorMessage: string | null;
|
|
8
8
|
fileInputRef: React.RefObject<HTMLInputElement>;
|
|
9
9
|
videoRef: React.RefObject<HTMLVideoElement>;
|
|
10
10
|
selectedFile: File | null;
|
|
11
|
+
selectedFiles: File[];
|
|
11
12
|
handleFileChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
13
|
handleClick: () => void | undefined;
|
|
13
14
|
};
|