@burdenoff/microfe-files 2026.626.2 → 2026.715.1
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/config/index.d.ts +33 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/dev/main.d.ts +1 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/files/FilesRoot.d.ts +31 -0
- package/dist/files/FilesRoot.d.ts.map +1 -0
- package/dist/files/FilesRoutes.d.ts +12 -0
- package/dist/files/FilesRoutes.d.ts.map +1 -0
- package/dist/files/components/ActionMenu.d.ts +19 -0
- package/dist/files/components/ActionMenu.d.ts.map +1 -0
- package/dist/files/components/ConfirmDialog.d.ts +22 -0
- package/dist/files/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/files/components/ContextMenu.d.ts +15 -0
- package/dist/files/components/ContextMenu.d.ts.map +1 -0
- package/dist/files/components/CopyDialog.d.ts +12 -0
- package/dist/files/components/CopyDialog.d.ts.map +1 -0
- package/dist/files/components/EmptyState.d.ts +15 -0
- package/dist/files/components/EmptyState.d.ts.map +1 -0
- package/dist/files/components/FileBrowser.d.ts +37 -0
- package/dist/files/components/FileBrowser.d.ts.map +1 -0
- package/dist/files/components/FileCard.d.ts +30 -0
- package/dist/files/components/FileCard.d.ts.map +1 -0
- package/dist/files/components/FileInfoPanel.d.ts +9 -0
- package/dist/files/components/FileInfoPanel.d.ts.map +1 -0
- package/dist/files/components/FileListItem.d.ts +29 -0
- package/dist/files/components/FileListItem.d.ts.map +1 -0
- package/dist/files/components/FilePreviewModal.d.ts +17 -0
- package/dist/files/components/FilePreviewModal.d.ts.map +1 -0
- package/dist/files/components/FileVersionPanel.d.ts +9 -0
- package/dist/files/components/FileVersionPanel.d.ts.map +1 -0
- package/dist/files/components/FolderCard.d.ts +34 -0
- package/dist/files/components/FolderCard.d.ts.map +1 -0
- package/dist/files/components/MoveDialog.d.ts +12 -0
- package/dist/files/components/MoveDialog.d.ts.map +1 -0
- package/dist/files/components/SearchBar.d.ts +13 -0
- package/dist/files/components/SearchBar.d.ts.map +1 -0
- package/dist/files/components/ShareDialog.d.ts +24 -0
- package/dist/files/components/ShareDialog.d.ts.map +1 -0
- package/dist/files/components/StorageBanner.d.ts +12 -0
- package/dist/files/components/StorageBanner.d.ts.map +1 -0
- package/dist/files/components/StorageBanner.js +43 -24
- package/dist/files/components/StorageBanner.js.map +1 -1
- package/dist/files/components/TabBar.d.ts +16 -0
- package/dist/files/components/TabBar.d.ts.map +1 -0
- package/dist/files/components/Toast.d.ts +14 -0
- package/dist/files/components/Toast.d.ts.map +1 -0
- package/dist/files/components/UploadQueue.d.ts +13 -0
- package/dist/files/components/UploadQueue.d.ts.map +1 -0
- package/dist/files/components/contextMenuItems.d.ts +45 -0
- package/dist/files/components/contextMenuItems.d.ts.map +1 -0
- package/dist/files/components/viewers/AudioPlayer.d.ts +8 -0
- package/dist/files/components/viewers/AudioPlayer.d.ts.map +1 -0
- package/dist/files/components/viewers/CodeViewer.d.ts +16 -0
- package/dist/files/components/viewers/CodeViewer.d.ts.map +1 -0
- package/dist/files/components/viewers/ImageViewer.d.ts +8 -0
- package/dist/files/components/viewers/ImageViewer.d.ts.map +1 -0
- package/dist/files/components/viewers/PDFViewer.d.ts +15 -0
- package/dist/files/components/viewers/PDFViewer.d.ts.map +1 -0
- package/dist/files/components/viewers/TextViewer.d.ts +8 -0
- package/dist/files/components/viewers/TextViewer.d.ts.map +1 -0
- package/dist/files/components/viewers/VideoPlayer.d.ts +8 -0
- package/dist/files/components/viewers/VideoPlayer.d.ts.map +1 -0
- package/dist/files/graphql-types.d.ts +277 -0
- package/dist/files/graphql-types.d.ts.map +1 -0
- package/dist/files/hooks/useBatchOperations.d.ts +6 -0
- package/dist/files/hooks/useBatchOperations.d.ts.map +1 -0
- package/dist/files/hooks/useBinItems.d.ts +11 -0
- package/dist/files/hooks/useBinItems.d.ts.map +1 -0
- package/dist/files/hooks/useBrowsePage.d.ts +21 -0
- package/dist/files/hooks/useBrowsePage.d.ts.map +1 -0
- package/dist/files/hooks/useCopyFile.d.ts +14 -0
- package/dist/files/hooks/useCopyFile.d.ts.map +1 -0
- package/dist/files/hooks/useCreateFolder.d.ts +17 -0
- package/dist/files/hooks/useCreateFolder.d.ts.map +1 -0
- package/dist/files/hooks/useCreateFolderShare.d.ts +16 -0
- package/dist/files/hooks/useCreateFolderShare.d.ts.map +1 -0
- package/dist/files/hooks/useCreateShare.d.ts +16 -0
- package/dist/files/hooks/useCreateShare.d.ts.map +1 -0
- package/dist/files/hooks/useDeleteFile.d.ts +9 -0
- package/dist/files/hooks/useDeleteFile.d.ts.map +1 -0
- package/dist/files/hooks/useDeleteFolder.d.ts +10 -0
- package/dist/files/hooks/useDeleteFolder.d.ts.map +1 -0
- package/dist/files/hooks/useDragDrop.d.ts +31 -0
- package/dist/files/hooks/useDragDrop.d.ts.map +1 -0
- package/dist/files/hooks/useFileVersions.d.ts +39 -0
- package/dist/files/hooks/useFileVersions.d.ts.map +1 -0
- package/dist/files/hooks/useFoldersQuery.d.ts +7 -0
- package/dist/files/hooks/useFoldersQuery.d.ts.map +1 -0
- package/dist/files/hooks/useKeyboardNavigation.d.ts +17 -0
- package/dist/files/hooks/useKeyboardNavigation.d.ts.map +1 -0
- package/dist/files/hooks/useMoveFile.d.ts +10 -0
- package/dist/files/hooks/useMoveFile.d.ts.map +1 -0
- package/dist/files/hooks/useMoveFolder.d.ts +10 -0
- package/dist/files/hooks/useMoveFolder.d.ts.map +1 -0
- package/dist/files/hooks/usePermanentlyDeleteFile.d.ts +9 -0
- package/dist/files/hooks/usePermanentlyDeleteFile.d.ts.map +1 -0
- package/dist/files/hooks/usePermanentlyDeleteFolder.d.ts +9 -0
- package/dist/files/hooks/usePermanentlyDeleteFolder.d.ts.map +1 -0
- package/dist/files/hooks/useRecentFiles.d.ts +10 -0
- package/dist/files/hooks/useRecentFiles.d.ts.map +1 -0
- package/dist/files/hooks/useRenameFile.d.ts +10 -0
- package/dist/files/hooks/useRenameFile.d.ts.map +1 -0
- package/dist/files/hooks/useRenameFolder.d.ts +10 -0
- package/dist/files/hooks/useRenameFolder.d.ts.map +1 -0
- package/dist/files/hooks/useRestoreFile.d.ts +9 -0
- package/dist/files/hooks/useRestoreFile.d.ts.map +1 -0
- package/dist/files/hooks/useRestoreFolder.d.ts +9 -0
- package/dist/files/hooks/useRestoreFolder.d.ts.map +1 -0
- package/dist/files/hooks/useSearch.d.ts +15 -0
- package/dist/files/hooks/useSearch.d.ts.map +1 -0
- package/dist/files/hooks/useStarredItems.d.ts +10 -0
- package/dist/files/hooks/useStarredItems.d.ts.map +1 -0
- package/dist/files/hooks/useStorageQuota.d.ts +11 -0
- package/dist/files/hooks/useStorageQuota.d.ts.map +1 -0
- package/dist/files/hooks/useStorageQuota.js +1 -1
- package/dist/files/hooks/useStorageQuota.js.map +1 -1
- package/dist/files/hooks/useToast.d.ts +11 -0
- package/dist/files/hooks/useToast.d.ts.map +1 -0
- package/dist/files/hooks/useToggleStar.d.ts +10 -0
- package/dist/files/hooks/useToggleStar.d.ts.map +1 -0
- package/dist/files/hooks/useUploadFile.d.ts +26 -0
- package/dist/files/hooks/useUploadFile.d.ts.map +1 -0
- package/dist/files/hooks/useUploadFile.js +43 -44
- package/dist/files/hooks/useUploadFile.js.map +1 -1
- package/dist/files/index.d.ts +29 -0
- package/dist/files/index.d.ts.map +1 -0
- package/dist/files/pages/BrowserPage.d.ts +5 -0
- package/dist/files/pages/BrowserPage.d.ts.map +1 -0
- package/dist/files/pages/BrowserPage.js +361 -351
- package/dist/files/pages/BrowserPage.js.map +1 -1
- package/dist/files/pages/ShareAccessPage.d.ts +2 -0
- package/dist/files/pages/ShareAccessPage.d.ts.map +1 -0
- package/dist/files/providers/FilesProvider.d.ts +25 -0
- package/dist/files/providers/FilesProvider.d.ts.map +1 -0
- package/dist/files/store/filesStore.d.ts +99 -0
- package/dist/files/store/filesStore.d.ts.map +1 -0
- package/dist/files/types.d.ts +266 -0
- package/dist/files/types.d.ts.map +1 -0
- package/dist/files/utils/events.d.ts +6 -0
- package/dist/files/utils/events.d.ts.map +1 -0
- package/dist/files/utils/i18n.d.ts +5 -0
- package/dist/files/utils/i18n.d.ts.map +1 -0
- package/dist/files/utils/index.d.ts +12 -0
- package/dist/files/utils/index.d.ts.map +1 -0
- package/dist/files/utils/quotaUtils.d.ts +2 -0
- package/dist/files/utils/quotaUtils.d.ts.map +1 -0
- package/dist/files/utils/quotaUtils.js +2 -14
- package/dist/files/utils/thumbnail.d.ts +3 -0
- package/dist/files/utils/thumbnail.d.ts.map +1 -0
- package/dist/files.d.ts +2 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +22995 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +2789 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-types.d.ts +50215 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/shared/types/index.d.ts +109 -0
- package/dist/shared/types/index.d.ts.map +1 -0
- package/dist/translations/en.d.ts +315 -0
- package/dist/translations/en.d.ts.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/files/utils/quotaUtils.js.map +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface CreateShareInput {
|
|
2
|
+
fileId: string;
|
|
3
|
+
shareType: "PUBLIC_LINK" | "EMAIL_INVITE" | "GROUP_SHARE";
|
|
4
|
+
accessLevel: "VIEW" | "COMMENT" | "DOWNLOAD" | "EDIT";
|
|
5
|
+
expiresAt?: string;
|
|
6
|
+
password?: string;
|
|
7
|
+
maxDownloads?: number;
|
|
8
|
+
invitedEmail?: string;
|
|
9
|
+
invitedUserIds?: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare const useCreateShare: () => {
|
|
12
|
+
mutateAsync: (input: CreateShareInput) => Promise<any>;
|
|
13
|
+
isPending: boolean;
|
|
14
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useCreateShare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateShare.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useCreateShare.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,aAAa,GAAG,cAAc,GAAG,aAAa,CAAC;IAC1D,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc;yBAMI,gBAAgB;;;CAU9C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface DeleteFileInput {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const useDeleteFile: () => {
|
|
5
|
+
mutateAsync: ({ id }: DeleteFileInput) => Promise<any>;
|
|
6
|
+
isPending: boolean;
|
|
7
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useDeleteFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useDeleteFile.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,aAAa;0BAYM,eAAe;;;CAS9C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface DeleteFolderInput {
|
|
2
|
+
id: string;
|
|
3
|
+
recursive?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const useDeleteFolder: () => {
|
|
6
|
+
mutateAsync: ({ id, recursive }: DeleteFolderInput) => Promise<any>;
|
|
7
|
+
isPending: boolean;
|
|
8
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useDeleteFolder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteFolder.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useDeleteFolder.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,eAAe;qCAasB,iBAAiB;;;CASlE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FileItem, FolderItem } from '../types';
|
|
2
|
+
export type DragOperation = "move" | "copy";
|
|
3
|
+
export interface DragData {
|
|
4
|
+
type: "file" | "folder";
|
|
5
|
+
item: FileItem | FolderItem;
|
|
6
|
+
operation: DragOperation;
|
|
7
|
+
}
|
|
8
|
+
export interface DropData {
|
|
9
|
+
type: "file" | "folder";
|
|
10
|
+
item: FileItem | FolderItem;
|
|
11
|
+
}
|
|
12
|
+
export interface UseDragDropOptions {
|
|
13
|
+
onMoveFile?: (fileId: string, targetFolderId: string) => Promise<void>;
|
|
14
|
+
onMoveFolder?: (folderId: string, targetFolderId: string) => Promise<void>;
|
|
15
|
+
onCopyFile?: (fileId: string, targetFolderId: string) => Promise<void>;
|
|
16
|
+
onCopyFolder?: (folderId: string, targetFolderId: string) => Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface UseDragDropReturn {
|
|
19
|
+
draggedItem: DragData | null;
|
|
20
|
+
dropTarget: DropData | null;
|
|
21
|
+
isDragging: boolean;
|
|
22
|
+
isDropTargetActive: boolean;
|
|
23
|
+
startDrag: (data: DragData) => void;
|
|
24
|
+
endDrag: () => void;
|
|
25
|
+
setDropTarget: (data: DropData | null) => void;
|
|
26
|
+
handleDrop: (targetFolderId: string) => Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export declare const useDragDrop: (options?: UseDragDropOptions) => UseDragDropReturn;
|
|
29
|
+
export declare const getDragOperation: (event: React.DragEvent) => DragOperation;
|
|
30
|
+
export declare const canDropOnFolder: (draggedItem: DragData | null, targetFolder: FolderItem) => boolean;
|
|
31
|
+
//# sourceMappingURL=useDragDrop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDragDrop.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useDragDrop.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC5B,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD;AAED,eAAO,MAAM,WAAW,GACtB,UAAS,kBAAuB,KAC/B,iBAqDF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,KAAK,CAAC,SAAS,KAAG,aAEzD,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,aAAa,QAAQ,GAAG,IAAI,EAC5B,cAAc,UAAU,KACvB,OAUF,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const useFileVersions: (_fileId: string, _enabled?: boolean) => {
|
|
2
|
+
data: any;
|
|
3
|
+
isLoading: boolean;
|
|
4
|
+
error: Error | null;
|
|
5
|
+
refetch: (variables?: any) => Promise<{
|
|
6
|
+
data: any;
|
|
7
|
+
error?: import('@apollo/client').ErrorLike;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Hook to restore a previous version
|
|
12
|
+
*/
|
|
13
|
+
export declare const useRestoreFileVersion: () => {
|
|
14
|
+
mutateAsync: (input: {
|
|
15
|
+
versionId: string;
|
|
16
|
+
createNewVersion?: boolean;
|
|
17
|
+
changeMessage?: string;
|
|
18
|
+
}) => Promise<any>;
|
|
19
|
+
isPending: boolean;
|
|
20
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Hook to delete a specific version
|
|
24
|
+
*/
|
|
25
|
+
export declare const useDeleteFileVersion: () => {
|
|
26
|
+
mutateAsync: (versionId: string) => Promise<any>;
|
|
27
|
+
isPending: boolean;
|
|
28
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Hook to get download URL for a specific version
|
|
32
|
+
*/
|
|
33
|
+
export declare const useVersionDownloadUrl: (_versionId?: string, _expiresIn?: number) => {
|
|
34
|
+
data: any;
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
37
|
+
getDownloadUrl: (versionId?: string | undefined, expiresIn?: number | undefined) => Promise<any>;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=useFileVersions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFileVersions.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useFileVersions.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,EAAE,WAAU,OAAc;;;;;;;;CAexE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;yBAOH;QACzB,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;;;CAgBJ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;6BAOE,MAAM;;;CAUxC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,EACnB,aAAa,MAAM;;;;;CAqBpB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Folders Query Hook
|
|
3
|
+
*/
|
|
4
|
+
export declare const useFoldersQuery: (parentFolderId?: string | null, options?: {
|
|
5
|
+
skip?: boolean;
|
|
6
|
+
}) => import("@apollo/client/react").useQuery.Result<Types.GetFoldersQuery, Types.GetFoldersQueryVariables, "empty" | "complete" | "streaming", Types.GetFoldersQueryVariables>;
|
|
7
|
+
//# sourceMappingURL=useFoldersQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFoldersQuery.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useFoldersQuery.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,eAAe,GAC1B,iBAAiB,MAAM,GAAG,IAAI,EAC9B,UAAU;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,8KAc7B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FileItem, FolderItem } from '../types';
|
|
2
|
+
interface UseKeyboardNavigationOptions {
|
|
3
|
+
files: FileItem[];
|
|
4
|
+
folders: FolderItem[];
|
|
5
|
+
onFilePreview?: (file: FileItem) => void;
|
|
6
|
+
onFileDelete?: (file: FileItem) => void;
|
|
7
|
+
onFolderOpen?: (folder: FolderItem) => void;
|
|
8
|
+
onFolderDelete?: (folder: FolderItem) => void;
|
|
9
|
+
activeTab: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function useKeyboardNavigation({ files, folders, onFilePreview, onFileDelete, onFolderOpen, onFolderDelete, activeTab, }: UseKeyboardNavigationOptions): {
|
|
12
|
+
focusedIndex: number;
|
|
13
|
+
setFocusedIndex: (index: number) => void;
|
|
14
|
+
getFocusedItem: () => FileItem | FolderItem | null;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=useKeyboardNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useKeyboardNavigation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGrD,UAAU,4BAA4B;IACpC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACzC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,SAAS,GACV,EAAE,4BAA4B;;6BAkBnB,MAAM;;EA4KjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface MoveFileInput {
|
|
2
|
+
fileId: string;
|
|
3
|
+
targetFolderId: string | null;
|
|
4
|
+
}
|
|
5
|
+
export declare const useMoveFile: () => {
|
|
6
|
+
mutateAsync: ({ fileId, targetFolderId }: MoveFileInput) => Promise<any>;
|
|
7
|
+
isPending: boolean;
|
|
8
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useMoveFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMoveFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useMoveFile.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,eAAO,MAAM,WAAW;8CAU4B,aAAa;;;CAchE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface MoveFolderInput {
|
|
2
|
+
folderId: string;
|
|
3
|
+
targetParentFolderId: string | null;
|
|
4
|
+
}
|
|
5
|
+
export declare const useMoveFolder: () => {
|
|
6
|
+
mutateAsync: ({ folderId, targetParentFolderId, }: MoveFolderInput) => Promise<any>;
|
|
7
|
+
isPending: boolean;
|
|
8
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useMoveFolder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMoveFolder.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useMoveFolder.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,aAAa;uDAcnB,eAAe;;;CAerB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface PermanentlyDeleteFileInput {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const usePermanentlyDeleteFile: () => {
|
|
5
|
+
mutateAsync: ({ id }: PermanentlyDeleteFileInput) => Promise<any>;
|
|
6
|
+
isPending: boolean;
|
|
7
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=usePermanentlyDeleteFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermanentlyDeleteFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/usePermanentlyDeleteFile.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,wBAAwB;0BAOL,0BAA0B;;;CASzD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface PermanentlyDeleteFolderInput {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const usePermanentlyDeleteFolder: () => {
|
|
5
|
+
mutateAsync: ({ id }: PermanentlyDeleteFolderInput) => Promise<any>;
|
|
6
|
+
isPending: boolean;
|
|
7
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=usePermanentlyDeleteFolder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermanentlyDeleteFolder.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/usePermanentlyDeleteFolder.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,0BAA0B;0BAOP,4BAA4B;;;CAS3D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileItem, FolderItem } from '../types';
|
|
2
|
+
export declare const useRecentFiles: (options?: {
|
|
3
|
+
skip?: boolean;
|
|
4
|
+
}) => {
|
|
5
|
+
files: FileItem[];
|
|
6
|
+
folders: FolderItem[];
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useRecentFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecentFiles.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRecentFiles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAErD,eAAO,MAAM,cAAc,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE;;;;;CAsC1D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface RenameFileInput {
|
|
2
|
+
fileId: string;
|
|
3
|
+
newName: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const useRenameFile: () => {
|
|
6
|
+
mutateAsync: ({ fileId, newName }: RenameFileInput) => Promise<any>;
|
|
7
|
+
isPending: boolean;
|
|
8
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useRenameFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRenameFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRenameFile.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa;uCAMmB,eAAe;;;CAY3D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface RenameFolderInput {
|
|
2
|
+
folderId: string;
|
|
3
|
+
newName: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const useRenameFolder: () => {
|
|
6
|
+
mutateAsync: ({ folderId, newName }: RenameFolderInput) => Promise<any>;
|
|
7
|
+
isPending: boolean;
|
|
8
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useRenameFolder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRenameFolder.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRenameFolder.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,eAAe;yCAMmB,iBAAiB;;;CAY/D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface RestoreFileInput {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const useRestoreFile: () => {
|
|
5
|
+
mutateAsync: ({ id }: RestoreFileInput) => Promise<any>;
|
|
6
|
+
isPending: boolean;
|
|
7
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useRestoreFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRestoreFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRestoreFile.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,cAAc;0BAaK,gBAAgB;;;CAS/C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface RestoreFolderInput {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const useRestoreFolder: () => {
|
|
5
|
+
mutateAsync: ({ id }: RestoreFolderInput) => Promise<any>;
|
|
6
|
+
isPending: boolean;
|
|
7
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useRestoreFolder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRestoreFolder.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRestoreFolder.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,gBAAgB;0BAaG,kBAAkB;;;CASjD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FileItem, FolderItem } from '../types';
|
|
2
|
+
import { FileFilterInput, FolderFilterInput } from '../graphql-types';
|
|
3
|
+
export interface SearchFilters {
|
|
4
|
+
fileFilter?: FileFilterInput;
|
|
5
|
+
folderFilter?: FolderFilterInput;
|
|
6
|
+
}
|
|
7
|
+
export declare const useSearch: (query: string, enabled?: boolean, filters?: SearchFilters) => {
|
|
8
|
+
data: {
|
|
9
|
+
files: FileItem[];
|
|
10
|
+
folders: FolderItem[];
|
|
11
|
+
};
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
error: import('@apollo/client').ErrorLike | null;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useSearch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAClC;AAED,eAAO,MAAM,SAAS,GACpB,OAAO,MAAM,EACb,UAAS,OAAc,EACvB,UAAU,aAAa;;eAkBoC,QAAQ,EAAE;iBACJ,UAAU,EAAE;;;;CAK9E,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileItem, FolderItem } from '../types';
|
|
2
|
+
export declare const useStarredItems: (options?: {
|
|
3
|
+
skip?: boolean;
|
|
4
|
+
}) => {
|
|
5
|
+
files: FileItem[];
|
|
6
|
+
folders: FolderItem[];
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
error: import('@apollo/client').ErrorLike | null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useStarredItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStarredItems.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useStarredItems.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAErD,eAAO,MAAM,eAAe,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE;WAiBH,QAAQ,EAAE;aACJ,UAAU,EAAE;;;CAI1E,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface StorageQuotaState {
|
|
2
|
+
usedBytes: number;
|
|
3
|
+
limitBytes: number | null;
|
|
4
|
+
noLimit: boolean;
|
|
5
|
+
usedPercent: number;
|
|
6
|
+
isExhausted: boolean;
|
|
7
|
+
isNearLimit: boolean;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function useStorageQuota(workspaceId: string): StorageQuotaState;
|
|
11
|
+
//# sourceMappingURL=useStorageQuota.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStorageQuota.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useStorageQuota.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB,CAyCtE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useGetWorkspaceStorageStatusQuery as e } from "../../generated/wspace-operations.js";
|
|
2
2
|
import { useMemo as t } from "react";
|
|
3
3
|
//#region src/files/hooks/useStorageQuota.ts
|
|
4
|
-
var n = "
|
|
4
|
+
var n = "platform.files.storage_bytes";
|
|
5
5
|
function r(r) {
|
|
6
6
|
let { data: i, loading: a } = e({
|
|
7
7
|
variables: { workspaceId: r },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStorageQuota.js","names":[],"sources":["../../../src/files/hooks/useStorageQuota.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useGetWorkspaceStorageStatusQuery } from \"../../generated/wspace-operations\";\n\nconst STORAGE_QUOTA_NAME = \"
|
|
1
|
+
{"version":3,"file":"useStorageQuota.js","names":[],"sources":["../../../src/files/hooks/useStorageQuota.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useGetWorkspaceStorageStatusQuery } from \"../../generated/wspace-operations\";\n\nconst STORAGE_QUOTA_NAME = \"platform.files.storage_bytes\";\n\nexport interface StorageQuotaState {\n usedBytes: number;\n limitBytes: number | null;\n noLimit: boolean;\n usedPercent: number;\n isExhausted: boolean;\n isNearLimit: boolean;\n loading: boolean;\n}\n\nexport function useStorageQuota(workspaceId: string): StorageQuotaState {\n const { data, loading } = useGetWorkspaceStorageStatusQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n pollInterval: 60_000,\n });\n\n return useMemo(() => {\n const status = data?.workspaceQuotaStatuses.find(\n (s: { quotaName: string }) => s.quotaName === STORAGE_QUOTA_NAME,\n );\n\n if (!status) {\n return {\n usedBytes: 0,\n limitBytes: null,\n noLimit: true,\n usedPercent: 0,\n isExhausted: false,\n isNearLimit: false,\n loading,\n };\n }\n\n const usedBytes = status.currentValue;\n const limitBytes = status.noLimit ? null : (status.limit ?? null);\n const usedPercent =\n limitBytes && limitBytes > 0\n ? Math.min(100, (usedBytes / limitBytes) * 100)\n : 0;\n\n return {\n usedBytes,\n limitBytes,\n noLimit: status.noLimit,\n usedPercent,\n isExhausted: !status.noLimit && usedBytes >= (limitBytes ?? Infinity),\n isNearLimit: !status.noLimit && usedPercent >= 80,\n loading,\n };\n }, [data, loading]);\n}\n"],"mappings":";;;AAGA,IAAM,IAAqB;AAY3B,SAAgB,EAAgB,GAAwC;CACtE,IAAM,EAAE,SAAM,eAAY,EAAkC;EAC1D,WAAW,EAAE,gBAAa;EAC1B,MAAM,CAAC;EACP,cAAc;EACf,CAAC;AAEF,QAAO,QAAc;EACnB,IAAM,IAAS,GAAM,uBAAuB,MACzC,MAA6B,EAAE,cAAc,EAC/C;AAED,MAAI,CAAC,EACH,QAAO;GACL,WAAW;GACX,YAAY;GACZ,SAAS;GACT,aAAa;GACb,aAAa;GACb,aAAa;GACb;GACD;EAGH,IAAM,IAAY,EAAO,cACnB,IAAa,EAAO,UAAU,OAAQ,EAAO,SAAS,MACtD,IACJ,KAAc,IAAa,IACvB,KAAK,IAAI,KAAM,IAAY,IAAc,IAAI,GAC7C;AAEN,SAAO;GACL;GACA;GACA,SAAS,EAAO;GAChB;GACA,aAAa,CAAC,EAAO,WAAW,MAAc,KAAc;GAC5D,aAAa,CAAC,EAAO,WAAW,KAAe;GAC/C;GACD;IACA,CAAC,GAAM,EAAQ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Toast, ToastType } from '../components/Toast';
|
|
2
|
+
export declare function useToast(): {
|
|
3
|
+
toasts: Toast[];
|
|
4
|
+
addToast: (type: ToastType, message: string, duration?: number) => string;
|
|
5
|
+
removeToast: (id: string) => void;
|
|
6
|
+
success: (message: string, duration?: number) => string;
|
|
7
|
+
error: (message: string, duration?: number) => string;
|
|
8
|
+
warning: (message: string, duration?: number) => string;
|
|
9
|
+
info: (message: string, duration?: number) => string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useToast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useToast.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAgB,QAAQ;;qBAIb,SAAS,WAAW,MAAM,aAAa,MAAM;sBASjB,MAAM;uBAK/B,MAAM,aAAa,MAAM;qBAMzB,MAAM,aAAa,MAAM;uBAMzB,MAAM,aAAa,MAAM;oBAMzB,MAAM,aAAa,MAAM;EAatC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ToggleStarInput {
|
|
2
|
+
id: string;
|
|
3
|
+
type: "file" | "folder";
|
|
4
|
+
}
|
|
5
|
+
export declare const useToggleStar: () => {
|
|
6
|
+
mutateAsync: ({ id, type }: ToggleStarInput) => Promise<any>;
|
|
7
|
+
isPending: boolean;
|
|
8
|
+
error: import('@apollo/client').ErrorLike | undefined;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useToggleStar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToggleStar.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useToggleStar.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;CACzB;AAED,eAAO,MAAM,aAAa;gCA4BY,eAAe;;;CAgBpD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface InitiateUploadInput {
|
|
2
|
+
fileName: string;
|
|
3
|
+
fileSize: number;
|
|
4
|
+
mimeType: string;
|
|
5
|
+
folderId?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CompleteUploadInput {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
fileSize: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UploadController {
|
|
12
|
+
pause: () => void;
|
|
13
|
+
isPaused: () => boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const useUploadFile: () => {
|
|
16
|
+
mutateAsync: (params: {
|
|
17
|
+
file: File;
|
|
18
|
+
folderId?: string;
|
|
19
|
+
onProgress?: (progress: number) => void;
|
|
20
|
+
}) => Promise<any>;
|
|
21
|
+
isPending: boolean;
|
|
22
|
+
error: Error | null;
|
|
23
|
+
pause: () => void;
|
|
24
|
+
isPaused: () => boolean;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useUploadFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUploadFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useUploadFile.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,aAAa;0BA4BW;QACjC,IAAI,EAAE,IAAI,CAAC;QACX,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;KACzC;;;;;CA4JF,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useFilesContext as e } from "../providers/FilesProvider.js";
|
|
2
2
|
import { useCompleteUploadMutation as t, useInitiateUploadMutation as n } from "../../generated/wspace-operations.js";
|
|
3
|
-
import {
|
|
3
|
+
import { isQuotaExhaustedError as r } from "../utils/quotaUtils.js";
|
|
4
|
+
import { useCallback as i, useRef as a, useState as o } from "react";
|
|
4
5
|
//#region src/files/hooks/useUploadFile.ts
|
|
5
|
-
var
|
|
6
|
-
let { workspaceId:
|
|
6
|
+
var s = () => {
|
|
7
|
+
let { workspaceId: s } = e(), [c, l] = o(!1), [u, d] = o(null), f = a(null), p = a(!1), [m] = n(), [h] = t({ refetchQueries: [
|
|
7
8
|
"GetFilesRootBrowsePage",
|
|
8
9
|
"GetFilesFolderBrowsePage",
|
|
9
10
|
"GetFilesRecentPage",
|
|
@@ -11,73 +12,71 @@ var o = () => {
|
|
|
11
12
|
] });
|
|
12
13
|
return {
|
|
13
14
|
mutateAsync: async (e) => {
|
|
14
|
-
let { file: t, folderId: n, onProgress:
|
|
15
|
+
let { file: t, folderId: n, onProgress: i } = e, a = t.name.split(".").pop() || "";
|
|
15
16
|
try {
|
|
16
|
-
|
|
17
|
-
let e = await
|
|
17
|
+
l(!0), d(null), p.current = !1, i?.(0);
|
|
18
|
+
let e = await m({ variables: { input: {
|
|
18
19
|
fileName: t.name,
|
|
19
20
|
fileSize: t.size.toString(),
|
|
20
21
|
mimeType: t.type || "application/octet-stream",
|
|
21
|
-
extension:
|
|
22
|
+
extension: a,
|
|
22
23
|
folderId: n || null
|
|
23
24
|
} } });
|
|
24
25
|
if (e.error) {
|
|
26
|
+
if (r(e.error)) throw e.error;
|
|
25
27
|
let t = e.error.message || "";
|
|
26
|
-
throw
|
|
28
|
+
throw Error(t || "Failed to initiate upload");
|
|
27
29
|
}
|
|
28
|
-
let
|
|
29
|
-
if (!
|
|
30
|
-
if (
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
if (e.lengthComputable && !
|
|
30
|
+
let o = e.data?.initiateUpload, s = o?.session, c = o?.uploadUrl;
|
|
31
|
+
if (!s || !c) throw Error("Failed to initiate upload session");
|
|
32
|
+
if (i?.(10), !(await new Promise((e, n) => {
|
|
33
|
+
let r = new XMLHttpRequest();
|
|
34
|
+
f.current = r, r.upload.addEventListener("progress", (e) => {
|
|
35
|
+
if (e.lengthComputable && !p.current) {
|
|
34
36
|
let t = 10 + Math.round(e.loaded / e.total * 80);
|
|
35
|
-
|
|
37
|
+
i?.(t);
|
|
36
38
|
}
|
|
37
|
-
}),
|
|
38
|
-
|
|
39
|
-
status:
|
|
40
|
-
statusText:
|
|
41
|
-
headers: new Headers(
|
|
39
|
+
}), r.addEventListener("load", () => {
|
|
40
|
+
r.status >= 200 && r.status < 300 ? (p.current || i?.(90), e(new Response(r.response, {
|
|
41
|
+
status: r.status,
|
|
42
|
+
statusText: r.statusText,
|
|
43
|
+
headers: new Headers(r.getAllResponseHeaders().split("\r\n").reduce((e, t) => {
|
|
42
44
|
let n = t.split(": ");
|
|
43
45
|
return n[0] && (e[n[0]] = n[1] || ""), e;
|
|
44
46
|
}, {}))
|
|
45
|
-
}))) : n(/* @__PURE__ */ Error(`Upload failed with status ${
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
}),
|
|
49
|
-
|
|
50
|
-
}),
|
|
47
|
+
}))) : n(/* @__PURE__ */ Error(`Upload failed with status ${r.status}`));
|
|
48
|
+
}), r.addEventListener("error", () => {
|
|
49
|
+
p.current || n(/* @__PURE__ */ Error("Upload failed"));
|
|
50
|
+
}), r.addEventListener("abort", () => {
|
|
51
|
+
p.current ? n(/* @__PURE__ */ Error("Upload paused")) : n(/* @__PURE__ */ Error("Upload aborted"));
|
|
52
|
+
}), r.open("PUT", c), r.setRequestHeader("Content-Type", t.type), r.send(t);
|
|
51
53
|
})).ok) throw Error("Failed to upload file to S3");
|
|
52
|
-
if (
|
|
53
|
-
let
|
|
54
|
-
sessionId:
|
|
54
|
+
if (p.current) throw Error("Upload paused");
|
|
55
|
+
let u = await h({ variables: { input: {
|
|
56
|
+
sessionId: s.id,
|
|
55
57
|
fileSize: t.size.toString(),
|
|
56
58
|
folderId: n || null
|
|
57
59
|
} } });
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
let h = l.data?.completeUpload?.file;
|
|
63
|
-
if (!h) throw Error("Upload completed but file data was not returned. The file may not have been created properly.");
|
|
64
|
-
return r?.(100), h;
|
|
60
|
+
if (u.error) throw r(u.error) ? u.error : (u.error.message, Error(u.error.message || "Failed to complete upload"));
|
|
61
|
+
let g = u.data?.completeUpload?.file;
|
|
62
|
+
if (!g) throw Error("Upload completed but file data was not returned. The file may not have been created properly.");
|
|
63
|
+
return i?.(100), g;
|
|
65
64
|
} catch (e) {
|
|
66
65
|
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Upload failed");
|
|
67
|
-
throw
|
|
66
|
+
throw d(t), t;
|
|
68
67
|
} finally {
|
|
69
|
-
|
|
68
|
+
l(!1), f.current = null;
|
|
70
69
|
}
|
|
71
70
|
},
|
|
72
|
-
isPending:
|
|
73
|
-
error:
|
|
74
|
-
pause:
|
|
75
|
-
|
|
71
|
+
isPending: c,
|
|
72
|
+
error: u,
|
|
73
|
+
pause: i(() => {
|
|
74
|
+
f.current && !p.current && (p.current = !0, f.current.abort(), f.current = null);
|
|
76
75
|
}, []),
|
|
77
|
-
isPaused:
|
|
76
|
+
isPaused: i(() => p.current, [])
|
|
78
77
|
};
|
|
79
78
|
};
|
|
80
79
|
//#endregion
|
|
81
|
-
export {
|
|
80
|
+
export { s as useUploadFile };
|
|
82
81
|
|
|
83
82
|
//# sourceMappingURL=useUploadFile.js.map
|