@vryzel/file-next-ui 0.4.5 → 0.5.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/index.cjs +595 -152
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -4
- package/dist/index.d.ts +22 -4
- package/dist/index.js +597 -154
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestUploadResult, ViewMode } from '@vryzel/file-next-headless';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { RefObject, ReactNode } from 'react';
|
|
3
3
|
import { FileNode, Result } from '@vryzel/file-next';
|
|
4
4
|
export { FileNode, Result } from '@vryzel/file-next';
|
|
5
5
|
import { LucideIcon } from 'lucide-react';
|
|
@@ -35,6 +35,10 @@ interface ExplorerListViewProps {
|
|
|
35
35
|
readonly onRenameCommit?: (name: string) => void;
|
|
36
36
|
readonly onRenameCancel?: () => void;
|
|
37
37
|
readonly className?: string;
|
|
38
|
+
readonly scrollRef?: RefObject<HTMLDivElement>;
|
|
39
|
+
readonly hasMore?: boolean;
|
|
40
|
+
readonly loadingMore?: boolean;
|
|
41
|
+
readonly onLoadMore?: () => void;
|
|
38
42
|
}
|
|
39
43
|
declare function ExplorerListView(props: ExplorerListViewProps): React.ReactElement;
|
|
40
44
|
|
|
@@ -90,11 +94,17 @@ type ExplorerLabels = {
|
|
|
90
94
|
clearClipboard: string;
|
|
91
95
|
uploadStatus: string;
|
|
92
96
|
dismissUploads: string;
|
|
97
|
+
cancelQueue: string;
|
|
98
|
+
removeUpload: string;
|
|
93
99
|
uploadQueued: string;
|
|
94
100
|
uploadDone: string;
|
|
95
101
|
uploadFailed: string;
|
|
96
102
|
unknownType: string;
|
|
97
103
|
previewUnavailable: string;
|
|
104
|
+
closePreview: string;
|
|
105
|
+
zoomIn: string;
|
|
106
|
+
zoomOut: string;
|
|
107
|
+
zoomFit: string;
|
|
98
108
|
};
|
|
99
109
|
declare const defaultLabels: ExplorerLabels;
|
|
100
110
|
declare function ExplorerLabelsProvider({ labels, children, }: {
|
|
@@ -233,6 +243,10 @@ interface ExplorerGridViewProps {
|
|
|
233
243
|
readonly onRenameCommit?: (name: string) => void;
|
|
234
244
|
readonly onRenameCancel?: () => void;
|
|
235
245
|
readonly className?: string;
|
|
246
|
+
readonly scrollRef?: RefObject<HTMLDivElement>;
|
|
247
|
+
readonly hasMore?: boolean;
|
|
248
|
+
readonly loadingMore?: boolean;
|
|
249
|
+
readonly onLoadMore?: () => void;
|
|
236
250
|
}
|
|
237
251
|
declare function ExplorerGridView(props: ExplorerGridViewProps): React.ReactElement;
|
|
238
252
|
|
|
@@ -386,23 +400,27 @@ declare function useUploadQueue(options: {
|
|
|
386
400
|
type: string;
|
|
387
401
|
content: Blob;
|
|
388
402
|
parentId: string | null;
|
|
389
|
-
}) => Promise<RequestUploadResult>;
|
|
403
|
+
}, signal?: AbortSignal) => Promise<RequestUploadResult>;
|
|
390
404
|
readonly confirmUpload?: (file: {
|
|
391
405
|
name: string;
|
|
392
406
|
size: number;
|
|
393
407
|
type: string;
|
|
394
408
|
content: Blob;
|
|
395
|
-
}) => Promise<void> | void;
|
|
409
|
+
}, signal?: AbortSignal) => Promise<void> | void;
|
|
396
410
|
}): {
|
|
397
411
|
readonly items: ReadonlyArray<UploadQueueItem>;
|
|
398
412
|
readonly enqueue: (files: ReadonlyArray<File>, parentId: string | null) => void;
|
|
399
413
|
readonly dismiss: () => void;
|
|
414
|
+
readonly cancel: () => void;
|
|
415
|
+
readonly remove: (id: string) => void;
|
|
400
416
|
readonly active: boolean;
|
|
401
417
|
};
|
|
402
418
|
|
|
403
|
-
declare function ExplorerUploadStatus({ items, onDismiss, className, }: {
|
|
419
|
+
declare function ExplorerUploadStatus({ items, onDismiss, onCancel, onRemove, className, }: {
|
|
404
420
|
readonly items: ReadonlyArray<UploadQueueItem>;
|
|
405
421
|
readonly onDismiss: () => void;
|
|
422
|
+
readonly onCancel?: () => void;
|
|
423
|
+
readonly onRemove?: (id: string) => void;
|
|
406
424
|
readonly className?: string;
|
|
407
425
|
}): React.ReactElement | null;
|
|
408
426
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestUploadResult, ViewMode } from '@vryzel/file-next-headless';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { RefObject, ReactNode } from 'react';
|
|
3
3
|
import { FileNode, Result } from '@vryzel/file-next';
|
|
4
4
|
export { FileNode, Result } from '@vryzel/file-next';
|
|
5
5
|
import { LucideIcon } from 'lucide-react';
|
|
@@ -35,6 +35,10 @@ interface ExplorerListViewProps {
|
|
|
35
35
|
readonly onRenameCommit?: (name: string) => void;
|
|
36
36
|
readonly onRenameCancel?: () => void;
|
|
37
37
|
readonly className?: string;
|
|
38
|
+
readonly scrollRef?: RefObject<HTMLDivElement>;
|
|
39
|
+
readonly hasMore?: boolean;
|
|
40
|
+
readonly loadingMore?: boolean;
|
|
41
|
+
readonly onLoadMore?: () => void;
|
|
38
42
|
}
|
|
39
43
|
declare function ExplorerListView(props: ExplorerListViewProps): React.ReactElement;
|
|
40
44
|
|
|
@@ -90,11 +94,17 @@ type ExplorerLabels = {
|
|
|
90
94
|
clearClipboard: string;
|
|
91
95
|
uploadStatus: string;
|
|
92
96
|
dismissUploads: string;
|
|
97
|
+
cancelQueue: string;
|
|
98
|
+
removeUpload: string;
|
|
93
99
|
uploadQueued: string;
|
|
94
100
|
uploadDone: string;
|
|
95
101
|
uploadFailed: string;
|
|
96
102
|
unknownType: string;
|
|
97
103
|
previewUnavailable: string;
|
|
104
|
+
closePreview: string;
|
|
105
|
+
zoomIn: string;
|
|
106
|
+
zoomOut: string;
|
|
107
|
+
zoomFit: string;
|
|
98
108
|
};
|
|
99
109
|
declare const defaultLabels: ExplorerLabels;
|
|
100
110
|
declare function ExplorerLabelsProvider({ labels, children, }: {
|
|
@@ -233,6 +243,10 @@ interface ExplorerGridViewProps {
|
|
|
233
243
|
readonly onRenameCommit?: (name: string) => void;
|
|
234
244
|
readonly onRenameCancel?: () => void;
|
|
235
245
|
readonly className?: string;
|
|
246
|
+
readonly scrollRef?: RefObject<HTMLDivElement>;
|
|
247
|
+
readonly hasMore?: boolean;
|
|
248
|
+
readonly loadingMore?: boolean;
|
|
249
|
+
readonly onLoadMore?: () => void;
|
|
236
250
|
}
|
|
237
251
|
declare function ExplorerGridView(props: ExplorerGridViewProps): React.ReactElement;
|
|
238
252
|
|
|
@@ -386,23 +400,27 @@ declare function useUploadQueue(options: {
|
|
|
386
400
|
type: string;
|
|
387
401
|
content: Blob;
|
|
388
402
|
parentId: string | null;
|
|
389
|
-
}) => Promise<RequestUploadResult>;
|
|
403
|
+
}, signal?: AbortSignal) => Promise<RequestUploadResult>;
|
|
390
404
|
readonly confirmUpload?: (file: {
|
|
391
405
|
name: string;
|
|
392
406
|
size: number;
|
|
393
407
|
type: string;
|
|
394
408
|
content: Blob;
|
|
395
|
-
}) => Promise<void> | void;
|
|
409
|
+
}, signal?: AbortSignal) => Promise<void> | void;
|
|
396
410
|
}): {
|
|
397
411
|
readonly items: ReadonlyArray<UploadQueueItem>;
|
|
398
412
|
readonly enqueue: (files: ReadonlyArray<File>, parentId: string | null) => void;
|
|
399
413
|
readonly dismiss: () => void;
|
|
414
|
+
readonly cancel: () => void;
|
|
415
|
+
readonly remove: (id: string) => void;
|
|
400
416
|
readonly active: boolean;
|
|
401
417
|
};
|
|
402
418
|
|
|
403
|
-
declare function ExplorerUploadStatus({ items, onDismiss, className, }: {
|
|
419
|
+
declare function ExplorerUploadStatus({ items, onDismiss, onCancel, onRemove, className, }: {
|
|
404
420
|
readonly items: ReadonlyArray<UploadQueueItem>;
|
|
405
421
|
readonly onDismiss: () => void;
|
|
422
|
+
readonly onCancel?: () => void;
|
|
423
|
+
readonly onRemove?: (id: string) => void;
|
|
406
424
|
readonly className?: string;
|
|
407
425
|
}): React.ReactElement | null;
|
|
408
426
|
|