@sparkstudio/storage-ui 1.0.28 → 1.0.30

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.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,48 @@ 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
+ onDeleted?: (file: ContainerDTO) => void;
131
+ };
132
+ declare function ContainerIdGridPanel(props: Props): react_jsx_runtime.JSX.Element;
133
+
134
+ interface UploadContainerProps {
135
+ multiple?: boolean;
136
+ accept?: string;
137
+ onFilesSelected?: (files: FileList) => void;
138
+ existingFiles?: ContainerDTO[];
139
+ existingFilesLoading?: boolean;
140
+ onExistingFileClick?: (file: ContainerDTO) => void;
141
+ /** Called when user chooses "Delete file" from the context menu */
142
+ onDeleteFile?: (file: ContainerDTO) => void;
143
+ autoUpload?: boolean;
144
+ getPresignedUrl?: (file: File) => Promise<AWSPresignedUrlDTO>;
145
+ onUploadComplete?: (file: File, s3Url: string) => void;
146
+ onUploadError?: (file: File, error: Error) => void;
147
+ }
148
+ /** NEW: imperative API so parents can push files in */
149
+ type UploadContainerHandle = {
150
+ enqueueFiles: (files: File[] | FileList) => void;
151
+ openFilePicker: () => void;
152
+ };
153
+ declare const UploadContainer: React__default.ForwardRefExoticComponent<UploadContainerProps & React__default.RefAttributes<UploadContainerHandle>>;
154
+
113
155
  interface ContainerUploadPanelProps {
114
156
  /** Base URL for the Container API (the SDK you pasted). */
115
157
  containerApiBaseUrl: string;
@@ -117,6 +159,8 @@ interface ContainerUploadPanelProps {
117
159
  storageApiBaseUrl: string;
118
160
  /** Optional parent container – if set, we query children instead of roots. */
119
161
  parentContainerId?: string;
162
+ /** NEW: allow parent to enqueue dropped files / open picker */
163
+ uploadRef?: React__default.RefObject<UploadContainerHandle | null>;
120
164
  }
121
165
  declare const ContainerUploadPanel: React__default.FC<ContainerUploadPanelProps>;
122
166
 
@@ -131,6 +175,45 @@ interface DesktopFileIconProps {
131
175
  }
132
176
  declare const DesktopFileIcon: React__default.FC<DesktopFileIconProps>;
133
177
 
178
+ declare function FileGridUploadPanel(props: {
179
+ containerApiBaseUrl: string;
180
+ storageApiBaseUrl: string;
181
+ parentContainerId?: string;
182
+ accept?: string;
183
+ multiple?: boolean;
184
+ selectedId?: string;
185
+ onSelect?: (file: ContainerDTO) => void;
186
+ icon?: React__default.ReactNode;
187
+ iconHtml?: string;
188
+ deleteDisabled?: boolean;
189
+ }): react_jsx_runtime.JSX.Element;
190
+
191
+ type FileIconCardProps = {
192
+ file: ContainerDTO;
193
+ deleteDisabled?: boolean;
194
+ selected?: boolean;
195
+ onSelect?: (file: ContainerDTO) => void;
196
+ /** Parent performs the delete + updates state */
197
+ onDeleteFile?: (file: ContainerDTO) => Promise<void> | void;
198
+ onClickFile?: (file: ContainerDTO) => void;
199
+ icon?: React__default.ReactNode;
200
+ iconHtml?: string;
201
+ title?: string;
202
+ className?: string;
203
+ };
204
+ declare const FileIconCard: React__default.FC<FileIconCardProps>;
205
+
206
+ declare function FileIconGrid(props: {
207
+ files: ContainerDTO[];
208
+ deleteDisabled?: boolean;
209
+ onDeleted?: (file: ContainerDTO) => void;
210
+ selectedId?: string;
211
+ onSelect?: (file: ContainerDTO) => void;
212
+ icon?: React__default.ReactNode;
213
+ iconHtml?: string;
214
+ className?: string;
215
+ }): react_jsx_runtime.JSX.Element;
216
+
134
217
  interface SingleFileProcessUploaderProps {
135
218
  getPresignedUrl: (file: File) => Promise<AWSPresignedUrlDTO>;
136
219
  onUploadComplete?: (file: File, s3Url: AWSPresignedUrlDTO) => void;
@@ -147,22 +230,6 @@ interface SingleFileProcessUploaderProps {
147
230
  }
148
231
  declare const SingleFileProcessUploader: React__default.FC<SingleFileProcessUploaderProps>;
149
232
 
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
233
  interface UploadDropzoneProps {
167
234
  isDragging: boolean;
168
235
  onDragOver?: (e: React__default.DragEvent<HTMLDivElement>) => void;
@@ -221,4 +288,4 @@ declare function UseUploadManager({ autoUpload, getPresignedUrl, onUploadComplet
221
288
 
222
289
  declare function HomeView(): react_jsx_runtime.JSX.Element;
223
290
 
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 };
291
+ 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,48 @@ 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
+ onDeleted?: (file: ContainerDTO) => void;
131
+ };
132
+ declare function ContainerIdGridPanel(props: Props): react_jsx_runtime.JSX.Element;
133
+
134
+ interface UploadContainerProps {
135
+ multiple?: boolean;
136
+ accept?: string;
137
+ onFilesSelected?: (files: FileList) => void;
138
+ existingFiles?: ContainerDTO[];
139
+ existingFilesLoading?: boolean;
140
+ onExistingFileClick?: (file: ContainerDTO) => void;
141
+ /** Called when user chooses "Delete file" from the context menu */
142
+ onDeleteFile?: (file: ContainerDTO) => void;
143
+ autoUpload?: boolean;
144
+ getPresignedUrl?: (file: File) => Promise<AWSPresignedUrlDTO>;
145
+ onUploadComplete?: (file: File, s3Url: string) => void;
146
+ onUploadError?: (file: File, error: Error) => void;
147
+ }
148
+ /** NEW: imperative API so parents can push files in */
149
+ type UploadContainerHandle = {
150
+ enqueueFiles: (files: File[] | FileList) => void;
151
+ openFilePicker: () => void;
152
+ };
153
+ declare const UploadContainer: React__default.ForwardRefExoticComponent<UploadContainerProps & React__default.RefAttributes<UploadContainerHandle>>;
154
+
113
155
  interface ContainerUploadPanelProps {
114
156
  /** Base URL for the Container API (the SDK you pasted). */
115
157
  containerApiBaseUrl: string;
@@ -117,6 +159,8 @@ interface ContainerUploadPanelProps {
117
159
  storageApiBaseUrl: string;
118
160
  /** Optional parent container – if set, we query children instead of roots. */
119
161
  parentContainerId?: string;
162
+ /** NEW: allow parent to enqueue dropped files / open picker */
163
+ uploadRef?: React__default.RefObject<UploadContainerHandle | null>;
120
164
  }
121
165
  declare const ContainerUploadPanel: React__default.FC<ContainerUploadPanelProps>;
122
166
 
@@ -131,6 +175,45 @@ interface DesktopFileIconProps {
131
175
  }
132
176
  declare const DesktopFileIcon: React__default.FC<DesktopFileIconProps>;
133
177
 
178
+ declare function FileGridUploadPanel(props: {
179
+ containerApiBaseUrl: string;
180
+ storageApiBaseUrl: string;
181
+ parentContainerId?: string;
182
+ accept?: string;
183
+ multiple?: boolean;
184
+ selectedId?: string;
185
+ onSelect?: (file: ContainerDTO) => void;
186
+ icon?: React__default.ReactNode;
187
+ iconHtml?: string;
188
+ deleteDisabled?: boolean;
189
+ }): react_jsx_runtime.JSX.Element;
190
+
191
+ type FileIconCardProps = {
192
+ file: ContainerDTO;
193
+ deleteDisabled?: boolean;
194
+ selected?: boolean;
195
+ onSelect?: (file: ContainerDTO) => void;
196
+ /** Parent performs the delete + updates state */
197
+ onDeleteFile?: (file: ContainerDTO) => Promise<void> | void;
198
+ onClickFile?: (file: ContainerDTO) => void;
199
+ icon?: React__default.ReactNode;
200
+ iconHtml?: string;
201
+ title?: string;
202
+ className?: string;
203
+ };
204
+ declare const FileIconCard: React__default.FC<FileIconCardProps>;
205
+
206
+ declare function FileIconGrid(props: {
207
+ files: ContainerDTO[];
208
+ deleteDisabled?: boolean;
209
+ onDeleted?: (file: ContainerDTO) => void;
210
+ selectedId?: string;
211
+ onSelect?: (file: ContainerDTO) => void;
212
+ icon?: React__default.ReactNode;
213
+ iconHtml?: string;
214
+ className?: string;
215
+ }): react_jsx_runtime.JSX.Element;
216
+
134
217
  interface SingleFileProcessUploaderProps {
135
218
  getPresignedUrl: (file: File) => Promise<AWSPresignedUrlDTO>;
136
219
  onUploadComplete?: (file: File, s3Url: AWSPresignedUrlDTO) => void;
@@ -147,22 +230,6 @@ interface SingleFileProcessUploaderProps {
147
230
  }
148
231
  declare const SingleFileProcessUploader: React__default.FC<SingleFileProcessUploaderProps>;
149
232
 
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
233
  interface UploadDropzoneProps {
167
234
  isDragging: boolean;
168
235
  onDragOver?: (e: React__default.DragEvent<HTMLDivElement>) => void;
@@ -221,4 +288,4 @@ declare function UseUploadManager({ autoUpload, getPresignedUrl, onUploadComplet
221
288
 
222
289
  declare function HomeView(): react_jsx_runtime.JSX.Element;
223
290
 
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 };
291
+ 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 };