@sparkstudio/storage-ui 1.0.28 → 1.0.29
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/index.cjs +990 -275
- package/dist/index.d.cts +84 -18
- package/dist/index.d.ts +84 -18
- package/dist/index.js +981 -264
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import React__default from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
declare enum ContainerType {
|
|
6
6
|
File = 0,
|
|
@@ -110,6 +110,47 @@ declare class SparkStudioStorageSDK {
|
|
|
110
110
|
constructor(baseUrl: string);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
type Props = {
|
|
114
|
+
containerApiBaseUrl: string;
|
|
115
|
+
storageApiBaseUrl: string;
|
|
116
|
+
/** Controlled list of container ids */
|
|
117
|
+
containerIds: string[];
|
|
118
|
+
onContainerIdsChange: React__default.Dispatch<React__default.SetStateAction<string[]>>;
|
|
119
|
+
/** Upload options */
|
|
120
|
+
accept?: string;
|
|
121
|
+
multiple?: boolean;
|
|
122
|
+
/** Selection passthrough */
|
|
123
|
+
selectedId?: string;
|
|
124
|
+
onSelect?: (file: ContainerDTO) => void;
|
|
125
|
+
/** Icon passthrough */
|
|
126
|
+
icon?: React__default.ReactNode;
|
|
127
|
+
iconHtml?: string;
|
|
128
|
+
deleteDisabled?: boolean;
|
|
129
|
+
className?: string;
|
|
130
|
+
};
|
|
131
|
+
declare function ContainerIdGridPanel(props: Props): react_jsx_runtime.JSX.Element;
|
|
132
|
+
|
|
133
|
+
interface UploadContainerProps {
|
|
134
|
+
multiple?: boolean;
|
|
135
|
+
accept?: string;
|
|
136
|
+
onFilesSelected?: (files: FileList) => void;
|
|
137
|
+
existingFiles?: ContainerDTO[];
|
|
138
|
+
existingFilesLoading?: boolean;
|
|
139
|
+
onExistingFileClick?: (file: ContainerDTO) => void;
|
|
140
|
+
/** Called when user chooses "Delete file" from the context menu */
|
|
141
|
+
onDeleteFile?: (file: ContainerDTO) => void;
|
|
142
|
+
autoUpload?: boolean;
|
|
143
|
+
getPresignedUrl?: (file: File) => Promise<AWSPresignedUrlDTO>;
|
|
144
|
+
onUploadComplete?: (file: File, s3Url: string) => void;
|
|
145
|
+
onUploadError?: (file: File, error: Error) => void;
|
|
146
|
+
}
|
|
147
|
+
/** NEW: imperative API so parents can push files in */
|
|
148
|
+
type UploadContainerHandle = {
|
|
149
|
+
enqueueFiles: (files: File[] | FileList) => void;
|
|
150
|
+
openFilePicker: () => void;
|
|
151
|
+
};
|
|
152
|
+
declare const UploadContainer: React__default.ForwardRefExoticComponent<UploadContainerProps & React__default.RefAttributes<UploadContainerHandle>>;
|
|
153
|
+
|
|
113
154
|
interface ContainerUploadPanelProps {
|
|
114
155
|
/** Base URL for the Container API (the SDK you pasted). */
|
|
115
156
|
containerApiBaseUrl: string;
|
|
@@ -117,6 +158,8 @@ interface ContainerUploadPanelProps {
|
|
|
117
158
|
storageApiBaseUrl: string;
|
|
118
159
|
/** Optional parent container – if set, we query children instead of roots. */
|
|
119
160
|
parentContainerId?: string;
|
|
161
|
+
/** NEW: allow parent to enqueue dropped files / open picker */
|
|
162
|
+
uploadRef?: React__default.RefObject<UploadContainerHandle | null>;
|
|
120
163
|
}
|
|
121
164
|
declare const ContainerUploadPanel: React__default.FC<ContainerUploadPanelProps>;
|
|
122
165
|
|
|
@@ -131,6 +174,45 @@ interface DesktopFileIconProps {
|
|
|
131
174
|
}
|
|
132
175
|
declare const DesktopFileIcon: React__default.FC<DesktopFileIconProps>;
|
|
133
176
|
|
|
177
|
+
declare function FileGridUploadPanel(props: {
|
|
178
|
+
containerApiBaseUrl: string;
|
|
179
|
+
storageApiBaseUrl: string;
|
|
180
|
+
parentContainerId?: string;
|
|
181
|
+
accept?: string;
|
|
182
|
+
multiple?: boolean;
|
|
183
|
+
selectedId?: string;
|
|
184
|
+
onSelect?: (file: ContainerDTO) => void;
|
|
185
|
+
icon?: React__default.ReactNode;
|
|
186
|
+
iconHtml?: string;
|
|
187
|
+
deleteDisabled?: boolean;
|
|
188
|
+
}): react_jsx_runtime.JSX.Element;
|
|
189
|
+
|
|
190
|
+
type FileIconCardProps = {
|
|
191
|
+
file: ContainerDTO;
|
|
192
|
+
deleteDisabled?: boolean;
|
|
193
|
+
selected?: boolean;
|
|
194
|
+
onSelect?: (file: ContainerDTO) => void;
|
|
195
|
+
/** Parent performs the delete + updates state */
|
|
196
|
+
onDeleteFile?: (file: ContainerDTO) => Promise<void> | void;
|
|
197
|
+
onClickFile?: (file: ContainerDTO) => void;
|
|
198
|
+
icon?: React__default.ReactNode;
|
|
199
|
+
iconHtml?: string;
|
|
200
|
+
title?: string;
|
|
201
|
+
className?: string;
|
|
202
|
+
};
|
|
203
|
+
declare const FileIconCard: React__default.FC<FileIconCardProps>;
|
|
204
|
+
|
|
205
|
+
declare function FileIconGrid(props: {
|
|
206
|
+
files: ContainerDTO[];
|
|
207
|
+
deleteDisabled?: boolean;
|
|
208
|
+
onDeleted?: (file: ContainerDTO) => void;
|
|
209
|
+
selectedId?: string;
|
|
210
|
+
onSelect?: (file: ContainerDTO) => void;
|
|
211
|
+
icon?: React__default.ReactNode;
|
|
212
|
+
iconHtml?: string;
|
|
213
|
+
className?: string;
|
|
214
|
+
}): react_jsx_runtime.JSX.Element;
|
|
215
|
+
|
|
134
216
|
interface SingleFileProcessUploaderProps {
|
|
135
217
|
getPresignedUrl: (file: File) => Promise<AWSPresignedUrlDTO>;
|
|
136
218
|
onUploadComplete?: (file: File, s3Url: AWSPresignedUrlDTO) => void;
|
|
@@ -147,22 +229,6 @@ interface SingleFileProcessUploaderProps {
|
|
|
147
229
|
}
|
|
148
230
|
declare const SingleFileProcessUploader: React__default.FC<SingleFileProcessUploaderProps>;
|
|
149
231
|
|
|
150
|
-
interface UploadContainerProps {
|
|
151
|
-
multiple?: boolean;
|
|
152
|
-
accept?: string;
|
|
153
|
-
onFilesSelected?: (files: FileList) => void;
|
|
154
|
-
existingFiles?: ContainerDTO[];
|
|
155
|
-
existingFilesLoading?: boolean;
|
|
156
|
-
onExistingFileClick?: (file: ContainerDTO) => void;
|
|
157
|
-
/** Called when user chooses "Delete file" from the context menu */
|
|
158
|
-
onDeleteFile?: (file: ContainerDTO) => void;
|
|
159
|
-
autoUpload?: boolean;
|
|
160
|
-
getPresignedUrl?: (file: File) => Promise<AWSPresignedUrlDTO>;
|
|
161
|
-
onUploadComplete?: (file: File, s3Url: string) => void;
|
|
162
|
-
onUploadError?: (file: File, error: Error) => void;
|
|
163
|
-
}
|
|
164
|
-
declare const UploadContainer: React__default.FC<UploadContainerProps>;
|
|
165
|
-
|
|
166
232
|
interface UploadDropzoneProps {
|
|
167
233
|
isDragging: boolean;
|
|
168
234
|
onDragOver?: (e: React__default.DragEvent<HTMLDivElement>) => void;
|
|
@@ -221,4 +287,4 @@ declare function UseUploadManager({ autoUpload, getPresignedUrl, onUploadComplet
|
|
|
221
287
|
|
|
222
288
|
declare function HomeView(): react_jsx_runtime.JSX.Element;
|
|
223
289
|
|
|
224
|
-
export { AWSPresignedUrlDTO, Container, ContainerDTO, ContainerType, ContainerUploadPanel, DesktopFileIcon, type DesktopFileIconProps, Home, HomeView, type IAWSPresignedUrlDTO, type IContainerDTO, type ITemporaryFileDTO, S3, SingleFileProcessUploader, type SingleFileProcessUploaderProps, SparkStudioStorageSDK, TemporaryFileDTO, UploadContainer, type UploadContainerProps, UploadDropzone, UploadFileToS3, UploadProgressList, type UploadState, type UploadStatus, UseContainers, UseUploadManager };
|
|
290
|
+
export { AWSPresignedUrlDTO, Container, ContainerDTO, ContainerIdGridPanel, ContainerType, ContainerUploadPanel, DesktopFileIcon, type DesktopFileIconProps, FileGridUploadPanel, FileIconCard, type FileIconCardProps, FileIconGrid, Home, HomeView, type IAWSPresignedUrlDTO, type IContainerDTO, type ITemporaryFileDTO, S3, SingleFileProcessUploader, type SingleFileProcessUploaderProps, SparkStudioStorageSDK, TemporaryFileDTO, UploadContainer, type UploadContainerHandle, type UploadContainerProps, UploadDropzone, UploadFileToS3, UploadProgressList, type UploadState, type UploadStatus, UseContainers, UseUploadManager };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import React__default from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
declare enum ContainerType {
|
|
6
6
|
File = 0,
|
|
@@ -110,6 +110,47 @@ declare class SparkStudioStorageSDK {
|
|
|
110
110
|
constructor(baseUrl: string);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
type Props = {
|
|
114
|
+
containerApiBaseUrl: string;
|
|
115
|
+
storageApiBaseUrl: string;
|
|
116
|
+
/** Controlled list of container ids */
|
|
117
|
+
containerIds: string[];
|
|
118
|
+
onContainerIdsChange: React__default.Dispatch<React__default.SetStateAction<string[]>>;
|
|
119
|
+
/** Upload options */
|
|
120
|
+
accept?: string;
|
|
121
|
+
multiple?: boolean;
|
|
122
|
+
/** Selection passthrough */
|
|
123
|
+
selectedId?: string;
|
|
124
|
+
onSelect?: (file: ContainerDTO) => void;
|
|
125
|
+
/** Icon passthrough */
|
|
126
|
+
icon?: React__default.ReactNode;
|
|
127
|
+
iconHtml?: string;
|
|
128
|
+
deleteDisabled?: boolean;
|
|
129
|
+
className?: string;
|
|
130
|
+
};
|
|
131
|
+
declare function ContainerIdGridPanel(props: Props): react_jsx_runtime.JSX.Element;
|
|
132
|
+
|
|
133
|
+
interface UploadContainerProps {
|
|
134
|
+
multiple?: boolean;
|
|
135
|
+
accept?: string;
|
|
136
|
+
onFilesSelected?: (files: FileList) => void;
|
|
137
|
+
existingFiles?: ContainerDTO[];
|
|
138
|
+
existingFilesLoading?: boolean;
|
|
139
|
+
onExistingFileClick?: (file: ContainerDTO) => void;
|
|
140
|
+
/** Called when user chooses "Delete file" from the context menu */
|
|
141
|
+
onDeleteFile?: (file: ContainerDTO) => void;
|
|
142
|
+
autoUpload?: boolean;
|
|
143
|
+
getPresignedUrl?: (file: File) => Promise<AWSPresignedUrlDTO>;
|
|
144
|
+
onUploadComplete?: (file: File, s3Url: string) => void;
|
|
145
|
+
onUploadError?: (file: File, error: Error) => void;
|
|
146
|
+
}
|
|
147
|
+
/** NEW: imperative API so parents can push files in */
|
|
148
|
+
type UploadContainerHandle = {
|
|
149
|
+
enqueueFiles: (files: File[] | FileList) => void;
|
|
150
|
+
openFilePicker: () => void;
|
|
151
|
+
};
|
|
152
|
+
declare const UploadContainer: React__default.ForwardRefExoticComponent<UploadContainerProps & React__default.RefAttributes<UploadContainerHandle>>;
|
|
153
|
+
|
|
113
154
|
interface ContainerUploadPanelProps {
|
|
114
155
|
/** Base URL for the Container API (the SDK you pasted). */
|
|
115
156
|
containerApiBaseUrl: string;
|
|
@@ -117,6 +158,8 @@ interface ContainerUploadPanelProps {
|
|
|
117
158
|
storageApiBaseUrl: string;
|
|
118
159
|
/** Optional parent container – if set, we query children instead of roots. */
|
|
119
160
|
parentContainerId?: string;
|
|
161
|
+
/** NEW: allow parent to enqueue dropped files / open picker */
|
|
162
|
+
uploadRef?: React__default.RefObject<UploadContainerHandle | null>;
|
|
120
163
|
}
|
|
121
164
|
declare const ContainerUploadPanel: React__default.FC<ContainerUploadPanelProps>;
|
|
122
165
|
|
|
@@ -131,6 +174,45 @@ interface DesktopFileIconProps {
|
|
|
131
174
|
}
|
|
132
175
|
declare const DesktopFileIcon: React__default.FC<DesktopFileIconProps>;
|
|
133
176
|
|
|
177
|
+
declare function FileGridUploadPanel(props: {
|
|
178
|
+
containerApiBaseUrl: string;
|
|
179
|
+
storageApiBaseUrl: string;
|
|
180
|
+
parentContainerId?: string;
|
|
181
|
+
accept?: string;
|
|
182
|
+
multiple?: boolean;
|
|
183
|
+
selectedId?: string;
|
|
184
|
+
onSelect?: (file: ContainerDTO) => void;
|
|
185
|
+
icon?: React__default.ReactNode;
|
|
186
|
+
iconHtml?: string;
|
|
187
|
+
deleteDisabled?: boolean;
|
|
188
|
+
}): react_jsx_runtime.JSX.Element;
|
|
189
|
+
|
|
190
|
+
type FileIconCardProps = {
|
|
191
|
+
file: ContainerDTO;
|
|
192
|
+
deleteDisabled?: boolean;
|
|
193
|
+
selected?: boolean;
|
|
194
|
+
onSelect?: (file: ContainerDTO) => void;
|
|
195
|
+
/** Parent performs the delete + updates state */
|
|
196
|
+
onDeleteFile?: (file: ContainerDTO) => Promise<void> | void;
|
|
197
|
+
onClickFile?: (file: ContainerDTO) => void;
|
|
198
|
+
icon?: React__default.ReactNode;
|
|
199
|
+
iconHtml?: string;
|
|
200
|
+
title?: string;
|
|
201
|
+
className?: string;
|
|
202
|
+
};
|
|
203
|
+
declare const FileIconCard: React__default.FC<FileIconCardProps>;
|
|
204
|
+
|
|
205
|
+
declare function FileIconGrid(props: {
|
|
206
|
+
files: ContainerDTO[];
|
|
207
|
+
deleteDisabled?: boolean;
|
|
208
|
+
onDeleted?: (file: ContainerDTO) => void;
|
|
209
|
+
selectedId?: string;
|
|
210
|
+
onSelect?: (file: ContainerDTO) => void;
|
|
211
|
+
icon?: React__default.ReactNode;
|
|
212
|
+
iconHtml?: string;
|
|
213
|
+
className?: string;
|
|
214
|
+
}): react_jsx_runtime.JSX.Element;
|
|
215
|
+
|
|
134
216
|
interface SingleFileProcessUploaderProps {
|
|
135
217
|
getPresignedUrl: (file: File) => Promise<AWSPresignedUrlDTO>;
|
|
136
218
|
onUploadComplete?: (file: File, s3Url: AWSPresignedUrlDTO) => void;
|
|
@@ -147,22 +229,6 @@ interface SingleFileProcessUploaderProps {
|
|
|
147
229
|
}
|
|
148
230
|
declare const SingleFileProcessUploader: React__default.FC<SingleFileProcessUploaderProps>;
|
|
149
231
|
|
|
150
|
-
interface UploadContainerProps {
|
|
151
|
-
multiple?: boolean;
|
|
152
|
-
accept?: string;
|
|
153
|
-
onFilesSelected?: (files: FileList) => void;
|
|
154
|
-
existingFiles?: ContainerDTO[];
|
|
155
|
-
existingFilesLoading?: boolean;
|
|
156
|
-
onExistingFileClick?: (file: ContainerDTO) => void;
|
|
157
|
-
/** Called when user chooses "Delete file" from the context menu */
|
|
158
|
-
onDeleteFile?: (file: ContainerDTO) => void;
|
|
159
|
-
autoUpload?: boolean;
|
|
160
|
-
getPresignedUrl?: (file: File) => Promise<AWSPresignedUrlDTO>;
|
|
161
|
-
onUploadComplete?: (file: File, s3Url: string) => void;
|
|
162
|
-
onUploadError?: (file: File, error: Error) => void;
|
|
163
|
-
}
|
|
164
|
-
declare const UploadContainer: React__default.FC<UploadContainerProps>;
|
|
165
|
-
|
|
166
232
|
interface UploadDropzoneProps {
|
|
167
233
|
isDragging: boolean;
|
|
168
234
|
onDragOver?: (e: React__default.DragEvent<HTMLDivElement>) => void;
|
|
@@ -221,4 +287,4 @@ declare function UseUploadManager({ autoUpload, getPresignedUrl, onUploadComplet
|
|
|
221
287
|
|
|
222
288
|
declare function HomeView(): react_jsx_runtime.JSX.Element;
|
|
223
289
|
|
|
224
|
-
export { AWSPresignedUrlDTO, Container, ContainerDTO, ContainerType, ContainerUploadPanel, DesktopFileIcon, type DesktopFileIconProps, Home, HomeView, type IAWSPresignedUrlDTO, type IContainerDTO, type ITemporaryFileDTO, S3, SingleFileProcessUploader, type SingleFileProcessUploaderProps, SparkStudioStorageSDK, TemporaryFileDTO, UploadContainer, type UploadContainerProps, UploadDropzone, UploadFileToS3, UploadProgressList, type UploadState, type UploadStatus, UseContainers, UseUploadManager };
|
|
290
|
+
export { AWSPresignedUrlDTO, Container, ContainerDTO, ContainerIdGridPanel, ContainerType, ContainerUploadPanel, DesktopFileIcon, type DesktopFileIconProps, FileGridUploadPanel, FileIconCard, type FileIconCardProps, FileIconGrid, Home, HomeView, type IAWSPresignedUrlDTO, type IContainerDTO, type ITemporaryFileDTO, S3, SingleFileProcessUploader, type SingleFileProcessUploaderProps, SparkStudioStorageSDK, TemporaryFileDTO, UploadContainer, type UploadContainerHandle, type UploadContainerProps, UploadDropzone, UploadFileToS3, UploadProgressList, type UploadState, type UploadStatus, UseContainers, UseUploadManager };
|