@burdenoff/microfe-files 2026.510.101
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/README.md +12 -0
- package/dist/config/index.d.ts +33 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +28 -0
- package/dist/config/index.js.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/FilesRoot.js +63 -0
- package/dist/files/FilesRoot.js.map +1 -0
- package/dist/files/FilesRoutes.d.ts +12 -0
- package/dist/files/FilesRoutes.d.ts.map +1 -0
- package/dist/files/FilesRoutes.js +45 -0
- package/dist/files/FilesRoutes.js.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/ActionMenu.js +73 -0
- package/dist/files/components/ActionMenu.js.map +1 -0
- package/dist/files/components/ConfirmDialog.d.ts +14 -0
- package/dist/files/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/files/components/ConfirmDialog.js +85 -0
- package/dist/files/components/ConfirmDialog.js.map +1 -0
- package/dist/files/components/ContextMenu.d.ts +59 -0
- package/dist/files/components/ContextMenu.d.ts.map +1 -0
- package/dist/files/components/ContextMenu.js +136 -0
- package/dist/files/components/ContextMenu.js.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/CopyDialog.js +139 -0
- package/dist/files/components/CopyDialog.js.map +1 -0
- package/dist/files/components/EmptyState.d.ts +8 -0
- package/dist/files/components/EmptyState.d.ts.map +1 -0
- package/dist/files/components/EmptyState.js +66 -0
- package/dist/files/components/EmptyState.js.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/FileBrowser.js +421 -0
- package/dist/files/components/FileBrowser.js.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/FileCard.js +233 -0
- package/dist/files/components/FileCard.js.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/FileInfoPanel.js +224 -0
- package/dist/files/components/FileInfoPanel.js.map +1 -0
- package/dist/files/components/FileListItem.d.ts +46 -0
- package/dist/files/components/FileListItem.d.ts.map +1 -0
- package/dist/files/components/FileListItem.js +235 -0
- package/dist/files/components/FileListItem.js.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/FilePreviewModal.js +175 -0
- package/dist/files/components/FilePreviewModal.js.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/FileVersionPanel.js +227 -0
- package/dist/files/components/FileVersionPanel.js.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/FolderCard.js +225 -0
- package/dist/files/components/FolderCard.js.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/MoveDialog.js +123 -0
- package/dist/files/components/MoveDialog.js.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/SearchBar.js +257 -0
- package/dist/files/components/SearchBar.js.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/ShareDialog.js +201 -0
- package/dist/files/components/ShareDialog.js.map +1 -0
- package/dist/files/components/TabBar.d.ts +14 -0
- package/dist/files/components/TabBar.d.ts.map +1 -0
- package/dist/files/components/TabBar.js +65 -0
- package/dist/files/components/TabBar.js.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/Toast.js +51 -0
- package/dist/files/components/Toast.js.map +1 -0
- package/dist/files/components/UploadQueue.d.ts +21 -0
- package/dist/files/components/UploadQueue.d.ts.map +1 -0
- package/dist/files/components/UploadQueue.js +171 -0
- package/dist/files/components/UploadQueue.js.map +1 -0
- package/dist/files/components/index.d.ts +43 -0
- package/dist/files/components/index.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/AudioPlayer.js +102 -0
- package/dist/files/components/viewers/AudioPlayer.js.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/CodeViewer.js +113 -0
- package/dist/files/components/viewers/CodeViewer.js.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/ImageViewer.js +138 -0
- package/dist/files/components/viewers/ImageViewer.js.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/PDFViewer.js +80 -0
- package/dist/files/components/viewers/PDFViewer.js.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/TextViewer.js +121 -0
- package/dist/files/components/viewers/TextViewer.js.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/components/viewers/VideoPlayer.js +138 -0
- package/dist/files/components/viewers/VideoPlayer.js.map +1 -0
- package/dist/files/components/viewers/index.d.ts +7 -0
- package/dist/files/components/viewers/index.d.ts.map +1 -0
- package/dist/files/components/viewers/index.js +6 -0
- package/dist/files/graphql-types.d.ts +317 -0
- package/dist/files/graphql-types.d.ts.map +1 -0
- package/dist/files/hooks/useBatchOperations.d.ts +32 -0
- package/dist/files/hooks/useBatchOperations.d.ts.map +1 -0
- package/dist/files/hooks/useBatchOperations.js +18 -0
- package/dist/files/hooks/useBatchOperations.js.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/useBinItems.js +27 -0
- package/dist/files/hooks/useBinItems.js.map +1 -0
- package/dist/files/hooks/useBrowsePage.d.ts +18 -0
- package/dist/files/hooks/useBrowsePage.d.ts.map +1 -0
- package/dist/files/hooks/useBrowsePage.js +34 -0
- package/dist/files/hooks/useBrowsePage.js.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/useCopyFile.js +22 -0
- package/dist/files/hooks/useCopyFile.js.map +1 -0
- package/dist/files/hooks/useCreateFolder.d.ts +14 -0
- package/dist/files/hooks/useCreateFolder.d.ts.map +1 -0
- package/dist/files/hooks/useCreateFolder.js +14 -0
- package/dist/files/hooks/useCreateFolder.js.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/useCreateFolderShare.js +14 -0
- package/dist/files/hooks/useCreateFolderShare.js.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/useCreateShare.js +14 -0
- package/dist/files/hooks/useCreateShare.js.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/useDeleteFile.js +20 -0
- package/dist/files/hooks/useDeleteFile.js.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/useDeleteFolder.js +24 -0
- package/dist/files/hooks/useDeleteFolder.js.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/useDragDrop.js +45 -0
- package/dist/files/hooks/useDragDrop.js.map +1 -0
- package/dist/files/hooks/useFileVersions.d.ts +52 -0
- package/dist/files/hooks/useFileVersions.d.ts.map +1 -0
- package/dist/files/hooks/useFileVersions.js +52 -0
- package/dist/files/hooks/useFileVersions.js.map +1 -0
- package/dist/files/hooks/useFiles.d.ts +18 -0
- package/dist/files/hooks/useFiles.d.ts.map +1 -0
- package/dist/files/hooks/useFolder.d.ts +7 -0
- package/dist/files/hooks/useFolder.d.ts.map +1 -0
- package/dist/files/hooks/useFolderPath.d.ts +2 -0
- package/dist/files/hooks/useFolderPath.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/useFoldersQuery.js +13 -0
- package/dist/files/hooks/useFoldersQuery.js.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/useKeyboardNavigation.js +105 -0
- package/dist/files/hooks/useKeyboardNavigation.js.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/useMoveFile.js +21 -0
- package/dist/files/hooks/useMoveFile.js.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/useMoveFolder.js +21 -0
- package/dist/files/hooks/useMoveFolder.js.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/usePermanentlyDeleteFile.js +18 -0
- package/dist/files/hooks/usePermanentlyDeleteFile.js.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/usePermanentlyDeleteFolder.js +18 -0
- package/dist/files/hooks/usePermanentlyDeleteFolder.js.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/useRecentFiles.js +24 -0
- package/dist/files/hooks/useRecentFiles.js.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/useRenameFile.js +21 -0
- package/dist/files/hooks/useRenameFile.js.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/useRenameFolder.js +21 -0
- package/dist/files/hooks/useRenameFolder.js.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/useRestoreFile.js +21 -0
- package/dist/files/hooks/useRestoreFile.js.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/useRestoreFolder.js +21 -0
- package/dist/files/hooks/useRestoreFolder.js.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/useSearch.js +27 -0
- package/dist/files/hooks/useSearch.js.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/useStarredItems.js +18 -0
- package/dist/files/hooks/useStarredItems.js.map +1 -0
- package/dist/files/hooks/useToast.d.ts +11 -0
- package/dist/files/hooks/useToast.d.ts.map +1 -0
- package/dist/files/hooks/useToast.js +28 -0
- package/dist/files/hooks/useToast.js.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/useToggleStar.js +26 -0
- package/dist/files/hooks/useToggleStar.js.map +1 -0
- package/dist/files/hooks/useUploadFile.d.ts +25 -0
- package/dist/files/hooks/useUploadFile.d.ts.map +1 -0
- package/dist/files/hooks/useUploadFile.js +74 -0
- package/dist/files/hooks/useUploadFile.js.map +1 -0
- package/dist/files/index.d.ts +29 -0
- package/dist/files/index.d.ts.map +1 -0
- package/dist/files/index.js +3 -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 +1014 -0
- package/dist/files/pages/BrowserPage.js.map +1 -0
- package/dist/files/pages/ShareAccessPage.d.ts +2 -0
- package/dist/files/pages/ShareAccessPage.d.ts.map +1 -0
- package/dist/files/pages/ShareAccessPage.js +162 -0
- package/dist/files/pages/ShareAccessPage.js.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/providers/FilesProvider.js +18 -0
- package/dist/files/providers/FilesProvider.js.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/store/filesStore.js +129 -0
- package/dist/files/store/filesStore.js.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/events.js +16 -0
- package/dist/files/utils/events.js.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/i18n.js +15 -0
- package/dist/files/utils/i18n.js.map +1 -0
- package/dist/files/utils/index.d.ts +74 -0
- package/dist/files/utils/index.d.ts.map +1 -0
- package/dist/files/utils/index.js +50 -0
- package/dist/files/utils/index.js.map +1 -0
- package/dist/files/utils/thumbnail.d.ts +5 -0
- package/dist/files/utils/thumbnail.d.ts.map +1 -0
- package/dist/files/utils/thumbnail.js +39 -0
- package/dist/files/utils/thumbnail.js.map +1 -0
- package/dist/files.d.ts +2 -0
- package/dist/files.js +6 -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 +21253 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +2706 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-operations.js +1085 -0
- package/dist/generated/wspace-operations.js.map +1 -0
- package/dist/generated/wspace-types.d.ts +55214 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/shared/types/index.d.ts +101 -0
- package/dist/shared/types/index.d.ts.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +126 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMoveFolder.js","names":[],"sources":["../../../src/files/hooks/useMoveFolder.ts"],"sourcesContent":["import { useMoveFolderMutation } from \"../../generated/wspace-operations\";\n\nexport interface MoveFolderInput {\n folderId: string;\n targetParentFolderId: string | null;\n}\n\nexport const useMoveFolder = () => {\n const [moveFolderMutation, { loading, error }] = useMoveFolderMutation({\n refetchQueries: [\"GetFolders\", \"GetFiles\", \"GetRecentFolders\"],\n });\n\n return {\n mutateAsync: async ({\n folderId,\n targetParentFolderId,\n }: MoveFolderInput) => {\n const result = await moveFolderMutation({\n variables: {\n input: {\n folderId,\n targetParentFolderId,\n },\n },\n });\n\n return result.data?.moveFolder;\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;AAOA,IAAa,UAAsB;CACjC,IAAM,CAAC,GAAoB,EAAE,YAAS,cAAW,EAAsB,EACrE,gBAAgB;EAAC;EAAc;EAAY;EAAmB,EAC/D,CAAC;AAEF,QAAO;EACL,aAAa,OAAO,EAClB,aACA,+BAEe,MAAM,EAAmB,EACtC,WAAW,EACT,OAAO;GACL;GACA;GACD,EACF,EACF,CAAC,EAEY,MAAM;EAEtB,WAAW;EACX;EACD"}
|
|
@@ -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,18 @@
|
|
|
1
|
+
import { usePermanentlyDeleteFileMutation as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
//#region src/files/hooks/usePermanentlyDeleteFile.ts
|
|
3
|
+
var t = () => {
|
|
4
|
+
let [t, { loading: n, error: r }] = e({ refetchQueries: [
|
|
5
|
+
"GetBinFiles",
|
|
6
|
+
"GetFiles",
|
|
7
|
+
"GetFolders"
|
|
8
|
+
] });
|
|
9
|
+
return {
|
|
10
|
+
mutateAsync: async ({ id: e }) => (await t({ variables: { id: e } })).data?.permanentlyDeleteFile,
|
|
11
|
+
isPending: n,
|
|
12
|
+
error: r
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as usePermanentlyDeleteFile };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=usePermanentlyDeleteFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermanentlyDeleteFile.js","names":[],"sources":["../../../src/files/hooks/usePermanentlyDeleteFile.ts"],"sourcesContent":["import { usePermanentlyDeleteFileMutation } from \"../../generated/wspace-operations\";\n\nexport interface PermanentlyDeleteFileInput {\n id: string;\n}\n\nexport const usePermanentlyDeleteFile = () => {\n const [permanentlyDeleteFileMutation, { loading, error }] =\n usePermanentlyDeleteFileMutation({\n refetchQueries: [\"GetBinFiles\", \"GetFiles\", \"GetFolders\"],\n });\n\n return {\n mutateAsync: async ({ id }: PermanentlyDeleteFileInput) => {\n const result = await permanentlyDeleteFileMutation({\n variables: { id },\n });\n return result.data?.permanentlyDeleteFile;\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;AAMA,IAAa,UAAiC;CAC5C,IAAM,CAAC,GAA+B,EAAE,YAAS,cAC/C,EAAiC,EAC/B,gBAAgB;EAAC;EAAe;EAAY;EAAa,EAC1D,CAAC;AAEJ,QAAO;EACL,aAAa,OAAO,EAAE,aACL,MAAM,EAA8B,EACjD,WAAW,EAAE,OAAI,EAClB,CAAC,EACY,MAAM;EAEtB,WAAW;EACX;EACD"}
|
|
@@ -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,18 @@
|
|
|
1
|
+
import { usePermanentlyDeleteFolderMutation as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
//#region src/files/hooks/usePermanentlyDeleteFolder.ts
|
|
3
|
+
var t = () => {
|
|
4
|
+
let [t, { loading: n, error: r }] = e({ refetchQueries: [
|
|
5
|
+
"GetBinFolders",
|
|
6
|
+
"GetFolders",
|
|
7
|
+
"GetFiles"
|
|
8
|
+
] });
|
|
9
|
+
return {
|
|
10
|
+
mutateAsync: async ({ id: e }) => (await t({ variables: { id: e } })).data?.permanentlyDeleteFolder,
|
|
11
|
+
isPending: n,
|
|
12
|
+
error: r
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as usePermanentlyDeleteFolder };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=usePermanentlyDeleteFolder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermanentlyDeleteFolder.js","names":[],"sources":["../../../src/files/hooks/usePermanentlyDeleteFolder.ts"],"sourcesContent":["import { usePermanentlyDeleteFolderMutation } from \"../../generated/wspace-operations\";\n\nexport interface PermanentlyDeleteFolderInput {\n id: string;\n}\n\nexport const usePermanentlyDeleteFolder = () => {\n const [permanentlyDeleteFolderMutation, { loading, error }] =\n usePermanentlyDeleteFolderMutation({\n refetchQueries: [\"GetBinFolders\", \"GetFolders\", \"GetFiles\"],\n });\n\n return {\n mutateAsync: async ({ id }: PermanentlyDeleteFolderInput) => {\n const result = await permanentlyDeleteFolderMutation({\n variables: { id },\n });\n return result.data?.permanentlyDeleteFolder;\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;AAMA,IAAa,UAAmC;CAC9C,IAAM,CAAC,GAAiC,EAAE,YAAS,cACjD,EAAmC,EACjC,gBAAgB;EAAC;EAAiB;EAAc;EAAW,EAC5D,CAAC;AAEJ,QAAO;EACL,aAAa,OAAO,EAAE,aACL,MAAM,EAAgC,EACnD,WAAW,EAAE,OAAI,EAClB,CAAC,EACY,MAAM;EAEtB,WAAW;EACX;EACD"}
|
|
@@ -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,24 @@
|
|
|
1
|
+
import { useGetFilesRecentPageQuery as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
//#region src/files/hooks/useRecentFiles.ts
|
|
3
|
+
var t = (t) => {
|
|
4
|
+
let n = e({
|
|
5
|
+
variables: {
|
|
6
|
+
filePagination: { limit: 100 },
|
|
7
|
+
folderPagination: { limit: 100 }
|
|
8
|
+
},
|
|
9
|
+
skip: t?.skip
|
|
10
|
+
}), r = [...n.data?.getFiles?.files || [], ...n.data?.getFolders?.folders || []];
|
|
11
|
+
return r.sort((e, t) => {
|
|
12
|
+
let n = new Date(e.updatedAt || e.updatedAt || 0).getTime();
|
|
13
|
+
return new Date(t.updatedAt || t.updatedAt || 0).getTime() - n;
|
|
14
|
+
}), {
|
|
15
|
+
files: r.filter((e) => "mimeType" in e),
|
|
16
|
+
folders: r.filter((e) => !("mimeType" in e)),
|
|
17
|
+
isLoading: n.loading,
|
|
18
|
+
error: n.error
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as useRecentFiles };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=useRecentFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecentFiles.js","names":[],"sources":["../../../src/files/hooks/useRecentFiles.ts"],"sourcesContent":["/**\n * Recent Files Hook\n */\n\nimport { useGetFilesRecentPageQuery } from \"../../generated/wspace-operations\";\nimport type { FileItem, FolderItem } from \"../types\";\n\nexport const useRecentFiles = (options?: { skip?: boolean }) => {\n const query = useGetFilesRecentPageQuery({\n variables: {\n filePagination: { limit: 100 },\n folderPagination: { limit: 100 },\n },\n skip: options?.skip,\n });\n\n // Combine files and folders and sort by updatedAt (most recent first)\n const allItems: (FileItem | FolderItem)[] = [\n ...(query.data?.getFiles?.files || []),\n ...(query.data?.getFolders?.folders || []),\n ];\n\n // Sort by updatedAt DESC to show recently opened/updated items first\n allItems.sort((a, b) => {\n const dateA = new Date(\n (a as FileItem).updatedAt || (a as FolderItem).updatedAt || 0,\n ).getTime();\n const dateB = new Date(\n (b as FileItem).updatedAt || (b as FolderItem).updatedAt || 0,\n ).getTime();\n return dateB - dateA;\n });\n\n // Split back into files and folders for the return\n const files = allItems.filter((item): item is FileItem => \"mimeType\" in item);\n const folders = allItems.filter(\n (item): item is FolderItem => !(\"mimeType\" in item),\n );\n\n return {\n files,\n folders,\n isLoading: query.loading,\n error: query.error,\n };\n};\n"],"mappings":";;AAOA,IAAa,KAAkB,MAAiC;CAC9D,IAAM,IAAQ,EAA2B;EACvC,WAAW;GACT,gBAAgB,EAAE,OAAO,KAAK;GAC9B,kBAAkB,EAAE,OAAO,KAAK;GACjC;EACD,MAAM,GAAS;EAChB,CAAC,EAGI,IAAsC,CAC1C,GAAI,EAAM,MAAM,UAAU,SAAS,EAAE,EACrC,GAAI,EAAM,MAAM,YAAY,WAAW,EAAE,CAC1C;AAmBD,QAhBA,EAAS,MAAM,GAAG,MAAM;EACtB,IAAM,IAAQ,IAAI,KACf,EAAe,aAAc,EAAiB,aAAa,EAC7D,CAAC,SAAS;AAIX,SAHc,IAAI,KACf,EAAe,aAAc,EAAiB,aAAa,EAC7D,CAAC,SAAS,GACI;GACf,EAQK;EACL,OANY,EAAS,QAAQ,MAA2B,cAAc,EAAK;EAO3E,SANc,EAAS,QACtB,MAA6B,EAAE,cAAc,GAC/C;EAKC,WAAW,EAAM;EACjB,OAAO,EAAM;EACd"}
|
|
@@ -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,21 @@
|
|
|
1
|
+
import { useUpdateFileMutation as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
//#region src/files/hooks/useRenameFile.ts
|
|
3
|
+
var t = () => {
|
|
4
|
+
let [t, { loading: n, error: r }] = e({ refetchQueries: [
|
|
5
|
+
"GetFiles",
|
|
6
|
+
"GetFolders",
|
|
7
|
+
"GetRecentFiles"
|
|
8
|
+
] });
|
|
9
|
+
return {
|
|
10
|
+
mutateAsync: async ({ fileId: e, newName: n }) => (await t({ variables: {
|
|
11
|
+
id: e,
|
|
12
|
+
input: { name: n }
|
|
13
|
+
} })).data?.updateFile,
|
|
14
|
+
isPending: n,
|
|
15
|
+
error: r
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as useRenameFile };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=useRenameFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRenameFile.js","names":[],"sources":["../../../src/files/hooks/useRenameFile.ts"],"sourcesContent":["import { useUpdateFileMutation } from \"../../generated/wspace-operations\";\n\nexport interface RenameFileInput {\n fileId: string;\n newName: string;\n}\n\nexport const useRenameFile = () => {\n const [updateFileMutation, { loading, error }] = useUpdateFileMutation({\n refetchQueries: [\"GetFiles\", \"GetFolders\", \"GetRecentFiles\"],\n });\n\n return {\n mutateAsync: async ({ fileId, newName }: RenameFileInput) => {\n const result = await updateFileMutation({\n variables: {\n id: fileId,\n input: { name: newName },\n },\n });\n return result.data?.updateFile;\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;AAOA,IAAa,UAAsB;CACjC,IAAM,CAAC,GAAoB,EAAE,YAAS,cAAW,EAAsB,EACrE,gBAAgB;EAAC;EAAY;EAAc;EAAiB,EAC7D,CAAC;AAEF,QAAO;EACL,aAAa,OAAO,EAAE,WAAQ,kBACb,MAAM,EAAmB,EACtC,WAAW;GACT,IAAI;GACJ,OAAO,EAAE,MAAM,GAAS;GACzB,EACF,CAAC,EACY,MAAM;EAEtB,WAAW;EACX;EACD"}
|
|
@@ -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,21 @@
|
|
|
1
|
+
import { useUpdateFolderMutation as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
//#region src/files/hooks/useRenameFolder.ts
|
|
3
|
+
var t = () => {
|
|
4
|
+
let [t, { loading: n, error: r }] = e({ refetchQueries: [
|
|
5
|
+
"GetFolders",
|
|
6
|
+
"GetFiles",
|
|
7
|
+
"GetRecentFiles"
|
|
8
|
+
] });
|
|
9
|
+
return {
|
|
10
|
+
mutateAsync: async ({ folderId: e, newName: n }) => (await t({ variables: {
|
|
11
|
+
id: e,
|
|
12
|
+
input: { name: n }
|
|
13
|
+
} })).data?.updateFolder,
|
|
14
|
+
isPending: n,
|
|
15
|
+
error: r
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as useRenameFolder };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=useRenameFolder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRenameFolder.js","names":[],"sources":["../../../src/files/hooks/useRenameFolder.ts"],"sourcesContent":["import { useUpdateFolderMutation } from \"../../generated/wspace-operations\";\n\nexport interface RenameFolderInput {\n folderId: string;\n newName: string;\n}\n\nexport const useRenameFolder = () => {\n const [updateFolderMutation, { loading, error }] = useUpdateFolderMutation({\n refetchQueries: [\"GetFolders\", \"GetFiles\", \"GetRecentFiles\"],\n });\n\n return {\n mutateAsync: async ({ folderId, newName }: RenameFolderInput) => {\n const result = await updateFolderMutation({\n variables: {\n id: folderId,\n input: { name: newName },\n },\n });\n return result.data?.updateFolder;\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;AAOA,IAAa,UAAwB;CACnC,IAAM,CAAC,GAAsB,EAAE,YAAS,cAAW,EAAwB,EACzE,gBAAgB;EAAC;EAAc;EAAY;EAAiB,EAC7D,CAAC;AAEF,QAAO;EACL,aAAa,OAAO,EAAE,aAAU,kBACf,MAAM,EAAqB,EACxC,WAAW;GACT,IAAI;GACJ,OAAO,EAAE,MAAM,GAAS;GACzB,EACF,CAAC,EACY,MAAM;EAEtB,WAAW;EACX;EACD"}
|
|
@@ -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,21 @@
|
|
|
1
|
+
import { useRestoreFileMutation as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
//#region src/files/hooks/useRestoreFile.ts
|
|
3
|
+
var t = () => {
|
|
4
|
+
let [t, { loading: n, error: r }] = e({ refetchQueries: [
|
|
5
|
+
"GetFiles",
|
|
6
|
+
"GetFolders",
|
|
7
|
+
"GetBinFiles",
|
|
8
|
+
"GetBinFolders",
|
|
9
|
+
"GetRecentFiles",
|
|
10
|
+
"GetStarredFiles"
|
|
11
|
+
] });
|
|
12
|
+
return {
|
|
13
|
+
mutateAsync: async ({ id: e }) => (await t({ variables: { id: e } })).data?.restoreFile,
|
|
14
|
+
isPending: n,
|
|
15
|
+
error: r
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as useRestoreFile };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=useRestoreFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRestoreFile.js","names":[],"sources":["../../../src/files/hooks/useRestoreFile.ts"],"sourcesContent":["import { useRestoreFileMutation } from \"../../generated/wspace-operations\";\n\nexport interface RestoreFileInput {\n id: string;\n}\n\nexport const useRestoreFile = () => {\n const [restoreFileMutation, { loading, error }] = useRestoreFileMutation({\n refetchQueries: [\n \"GetFiles\",\n \"GetFolders\",\n \"GetBinFiles\",\n \"GetBinFolders\",\n \"GetRecentFiles\",\n \"GetStarredFiles\",\n ],\n });\n\n return {\n mutateAsync: async ({ id }: RestoreFileInput) => {\n const result = await restoreFileMutation({\n variables: { id },\n });\n return result.data?.restoreFile;\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;AAMA,IAAa,UAAuB;CAClC,IAAM,CAAC,GAAqB,EAAE,YAAS,cAAW,EAAuB,EACvE,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACA;EACD,EACF,CAAC;AAEF,QAAO;EACL,aAAa,OAAO,EAAE,aACL,MAAM,EAAoB,EACvC,WAAW,EAAE,OAAI,EAClB,CAAC,EACY,MAAM;EAEtB,WAAW;EACX;EACD"}
|
|
@@ -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,21 @@
|
|
|
1
|
+
import { useRestoreFolderMutation as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
//#region src/files/hooks/useRestoreFolder.ts
|
|
3
|
+
var t = () => {
|
|
4
|
+
let [t, { loading: n, error: r }] = e({ refetchQueries: [
|
|
5
|
+
"GetFiles",
|
|
6
|
+
"GetFolders",
|
|
7
|
+
"GetBinFiles",
|
|
8
|
+
"GetBinFolders",
|
|
9
|
+
"GetRecentFiles",
|
|
10
|
+
"GetStarredFolders"
|
|
11
|
+
] });
|
|
12
|
+
return {
|
|
13
|
+
mutateAsync: async ({ id: e }) => (await t({ variables: { id: e } })).data?.restoreFolder,
|
|
14
|
+
isPending: n,
|
|
15
|
+
error: r
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as useRestoreFolder };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=useRestoreFolder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRestoreFolder.js","names":[],"sources":["../../../src/files/hooks/useRestoreFolder.ts"],"sourcesContent":["import { useRestoreFolderMutation } from \"../../generated/wspace-operations\";\n\nexport interface RestoreFolderInput {\n id: string;\n}\n\nexport const useRestoreFolder = () => {\n const [restoreFolderMutation, { loading, error }] = useRestoreFolderMutation({\n refetchQueries: [\n \"GetFiles\",\n \"GetFolders\",\n \"GetBinFiles\",\n \"GetBinFolders\",\n \"GetRecentFiles\",\n \"GetStarredFolders\",\n ],\n });\n\n return {\n mutateAsync: async ({ id }: RestoreFolderInput) => {\n const result = await restoreFolderMutation({\n variables: { id },\n });\n return result.data?.restoreFolder;\n },\n isPending: loading,\n error,\n };\n};\n"],"mappings":";;AAMA,IAAa,UAAyB;CACpC,IAAM,CAAC,GAAuB,EAAE,YAAS,cAAW,EAAyB,EAC3E,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACA;EACD,EACF,CAAC;AAEF,QAAO;EACL,aAAa,OAAO,EAAE,aACL,MAAM,EAAsB,EACzC,WAAW,EAAE,OAAI,EAClB,CAAC,EACY,MAAM;EAEtB,WAAW;EACX;EACD"}
|
|
@@ -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,27 @@
|
|
|
1
|
+
import { useFilesContext as e } from "../providers/FilesProvider.js";
|
|
2
|
+
import { useSearchFilesPageQuery as t } from "../../generated/wspace-operations.js";
|
|
3
|
+
//#region src/files/hooks/useSearch.ts
|
|
4
|
+
var n = (n, r = !0, i) => {
|
|
5
|
+
let { workspaceId: a } = e(), o = !r || !a || n.length < 2, s = t({
|
|
6
|
+
variables: {
|
|
7
|
+
query: n,
|
|
8
|
+
fileFilter: i?.fileFilter,
|
|
9
|
+
folderFilter: i?.folderFilter,
|
|
10
|
+
filePagination: { limit: 50 },
|
|
11
|
+
folderPagination: { limit: 50 }
|
|
12
|
+
},
|
|
13
|
+
skip: o
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
data: {
|
|
17
|
+
files: s.data?.searchFiles?.files || [],
|
|
18
|
+
folders: s.data?.searchFolders?.folders || []
|
|
19
|
+
},
|
|
20
|
+
isLoading: s.loading,
|
|
21
|
+
error: s.error ?? null
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { n as useSearch };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=useSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSearch.js","names":[],"sources":["../../../src/files/hooks/useSearch.ts"],"sourcesContent":["import { useSearchFilesPageQuery } from \"../../generated/wspace-operations\";\nimport { useFilesContext } from \"../providers/FilesProvider\";\nimport type { FileItem, FolderItem } from \"../types\";\nimport type { FileFilterInput, FolderFilterInput } from \"../graphql-types\";\n\nexport interface SearchFilters {\n fileFilter?: FileFilterInput;\n folderFilter?: FolderFilterInput;\n}\n\nexport const useSearch = (\n query: string,\n enabled: boolean = true,\n filters?: SearchFilters,\n) => {\n const { workspaceId } = useFilesContext();\n const skip = !enabled || !workspaceId || query.length < 2;\n\n const queryResult = useSearchFilesPageQuery({\n variables: {\n query,\n fileFilter: filters?.fileFilter,\n folderFilter: filters?.folderFilter,\n filePagination: { limit: 50 },\n folderPagination: { limit: 50 },\n },\n skip,\n });\n\n return {\n data: {\n files: (queryResult.data?.searchFiles?.files || []) as FileItem[],\n folders: (queryResult.data?.searchFolders?.folders || []) as FolderItem[],\n },\n isLoading: queryResult.loading,\n error: queryResult.error ?? null,\n };\n};\n"],"mappings":";;;AAUA,IAAa,KACX,GACA,IAAmB,IACnB,MACG;CACH,IAAM,EAAE,mBAAgB,GAAiB,EACnC,IAAO,CAAC,KAAW,CAAC,KAAe,EAAM,SAAS,GAElD,IAAc,EAAwB;EAC1C,WAAW;GACT;GACA,YAAY,GAAS;GACrB,cAAc,GAAS;GACvB,gBAAgB,EAAE,OAAO,IAAI;GAC7B,kBAAkB,EAAE,OAAO,IAAI;GAChC;EACD;EACD,CAAC;AAEF,QAAO;EACL,MAAM;GACJ,OAAQ,EAAY,MAAM,aAAa,SAAS,EAAE;GAClD,SAAU,EAAY,MAAM,eAAe,WAAW,EAAE;GACzD;EACD,WAAW,EAAY;EACvB,OAAO,EAAY,SAAS;EAC7B"}
|
|
@@ -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;WASH,QAAQ,EAAE;aACJ,UAAU,EAAE;;;CAI1E,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useGetFilesStarredPageQuery as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
//#region src/files/hooks/useStarredItems.ts
|
|
3
|
+
var t = (t) => {
|
|
4
|
+
let n = e({
|
|
5
|
+
variables: { pagination: { limit: 100 } },
|
|
6
|
+
skip: t?.skip
|
|
7
|
+
});
|
|
8
|
+
return {
|
|
9
|
+
files: n.data?.getStarredFiles?.files || [],
|
|
10
|
+
folders: n.data?.getStarredFolders?.folders || [],
|
|
11
|
+
isLoading: n.loading,
|
|
12
|
+
error: n.error ?? null
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as useStarredItems };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=useStarredItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStarredItems.js","names":[],"sources":["../../../src/files/hooks/useStarredItems.ts"],"sourcesContent":["/**\n * Starred Items Hook\n *\n * Fetches starred files and folders for the starred view.\n * Uses one page-owned query for both starred files and folders.\n */\n\nimport { useGetFilesStarredPageQuery } from \"../../generated/wspace-operations\";\nimport type { FileItem, FolderItem } from \"../types\";\n\nexport const useStarredItems = (options?: { skip?: boolean }) => {\n const query = useGetFilesStarredPageQuery({\n variables: {\n pagination: { limit: 100 },\n },\n skip: options?.skip,\n });\n\n return {\n files: (query.data?.getStarredFiles?.files || []) as FileItem[],\n folders: (query.data?.getStarredFolders?.folders || []) as FolderItem[],\n isLoading: query.loading,\n error: query.error ?? null,\n };\n};\n"],"mappings":";;AAUA,IAAa,KAAmB,MAAiC;CAC/D,IAAM,IAAQ,EAA4B;EACxC,WAAW,EACT,YAAY,EAAE,OAAO,KAAK,EAC3B;EACD,MAAM,GAAS;EAChB,CAAC;AAEF,QAAO;EACL,OAAQ,EAAM,MAAM,iBAAiB,SAAS,EAAE;EAChD,SAAU,EAAM,MAAM,mBAAmB,WAAW,EAAE;EACtD,WAAW,EAAM;EACjB,OAAO,EAAM,SAAS;EACvB"}
|
|
@@ -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,28 @@
|
|
|
1
|
+
import { useCallback as e, useState as t } from "react";
|
|
2
|
+
//#region src/files/hooks/useToast.ts
|
|
3
|
+
function n() {
|
|
4
|
+
let [n, r] = t([]), i = e((e, t, n) => {
|
|
5
|
+
let i = Math.random().toString(36).substring(7), a = {
|
|
6
|
+
id: i,
|
|
7
|
+
type: e,
|
|
8
|
+
message: t,
|
|
9
|
+
duration: n
|
|
10
|
+
};
|
|
11
|
+
return r((e) => [...e, a]), i;
|
|
12
|
+
}, []);
|
|
13
|
+
return {
|
|
14
|
+
toasts: n,
|
|
15
|
+
addToast: i,
|
|
16
|
+
removeToast: e((e) => {
|
|
17
|
+
r((t) => t.filter((t) => t.id !== e));
|
|
18
|
+
}, []),
|
|
19
|
+
success: e((e, t) => i("success", e, t), [i]),
|
|
20
|
+
error: e((e, t) => i("error", e, t), [i]),
|
|
21
|
+
warning: e((e, t) => i("warning", e, t), [i]),
|
|
22
|
+
info: e((e, t) => i("info", e, t), [i])
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { n as useToast };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=useToast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToast.js","names":[],"sources":["../../../src/files/hooks/useToast.ts"],"sourcesContent":["import { useState, useCallback } from \"react\";\nimport type { Toast, ToastType } from \"../components/Toast\";\n\nexport function useToast() {\n const [toasts, setToasts] = useState<Toast[]>([]);\n\n const addToast = useCallback(\n (type: ToastType, message: string, duration?: number) => {\n const id = Math.random().toString(36).substring(7);\n const toast: Toast = { id, type, message, duration };\n setToasts((prev) => [...prev, toast]);\n return id;\n },\n [],\n );\n\n const removeToast = useCallback((id: string) => {\n setToasts((prev) => prev.filter((toast) => toast.id !== id));\n }, []);\n\n const success = useCallback(\n (message: string, duration?: number) =>\n addToast(\"success\", message, duration),\n [addToast],\n );\n\n const error = useCallback(\n (message: string, duration?: number) =>\n addToast(\"error\", message, duration),\n [addToast],\n );\n\n const warning = useCallback(\n (message: string, duration?: number) =>\n addToast(\"warning\", message, duration),\n [addToast],\n );\n\n const info = useCallback(\n (message: string, duration?: number) => addToast(\"info\", message, duration),\n [addToast],\n );\n\n return {\n toasts,\n addToast,\n removeToast,\n success,\n error,\n warning,\n info,\n };\n}\n"],"mappings":";;AAGA,SAAgB,IAAW;CACzB,IAAM,CAAC,GAAQ,KAAa,EAAkB,EAAE,CAAC,EAE3C,IAAW,GACd,GAAiB,GAAiB,MAAsB;EACvD,IAAM,IAAK,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,UAAU,EAAE,EAC5C,IAAe;GAAE;GAAI;GAAM;GAAS;GAAU;AAEpD,SADA,GAAW,MAAS,CAAC,GAAG,GAAM,EAAM,CAAC,EAC9B;IAET,EAAE,CACH;AA6BD,QAAO;EACL;EACA;EACA,aA9BkB,GAAa,MAAe;AAC9C,MAAW,MAAS,EAAK,QAAQ,MAAU,EAAM,OAAO,EAAG,CAAC;KAC3D,EAAE,CAAC;EA6BJ,SA3Bc,GACb,GAAiB,MAChB,EAAS,WAAW,GAAS,EAAS,EACxC,CAAC,EAAS,CACX;EAwBC,OAtBY,GACX,GAAiB,MAChB,EAAS,SAAS,GAAS,EAAS,EACtC,CAAC,EAAS,CACX;EAmBC,SAjBc,GACb,GAAiB,MAChB,EAAS,WAAW,GAAS,EAAS,EACxC,CAAC,EAAS,CACX;EAcC,MAZW,GACV,GAAiB,MAAsB,EAAS,QAAQ,GAAS,EAAS,EAC3E,CAAC,EAAS,CACX;EAUA"}
|
|
@@ -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
|
+
import { useToggleFileStarredMutation as e, useToggleFolderStarredMutation as t } from "../../generated/wspace-operations.js";
|
|
2
|
+
//#region src/files/hooks/useToggleStar.ts
|
|
3
|
+
var n = () => {
|
|
4
|
+
let [n, { loading: r, error: i }] = e({ refetchQueries: [
|
|
5
|
+
"GetFiles",
|
|
6
|
+
"GetFolders",
|
|
7
|
+
"GetStarredFiles",
|
|
8
|
+
"GetStarredFolders",
|
|
9
|
+
"GetRecentFiles"
|
|
10
|
+
] }), [a, { loading: o, error: s }] = t({ refetchQueries: [
|
|
11
|
+
"GetFiles",
|
|
12
|
+
"GetFolders",
|
|
13
|
+
"GetStarredFiles",
|
|
14
|
+
"GetStarredFolders",
|
|
15
|
+
"GetRecentFiles"
|
|
16
|
+
] });
|
|
17
|
+
return {
|
|
18
|
+
mutateAsync: async ({ id: e, type: t }) => t === "file" ? (await n({ variables: { id: e } })).data?.toggleFileStarred : (await a({ variables: { id: e } })).data?.toggleFolderStarred,
|
|
19
|
+
isPending: r || o,
|
|
20
|
+
error: i || s
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { n as useToggleStar };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=useToggleStar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToggleStar.js","names":[],"sources":["../../../src/files/hooks/useToggleStar.ts"],"sourcesContent":["import {\n useToggleFileStarredMutation,\n useToggleFolderStarredMutation,\n} from \"../../generated/wspace-operations\";\n\nexport interface ToggleStarInput {\n id: string;\n type: \"file\" | \"folder\";\n}\n\nexport const useToggleStar = () => {\n const [\n toggleFileStarredMutation,\n { loading: fileLoading, error: fileError },\n ] = useToggleFileStarredMutation({\n refetchQueries: [\n \"GetFiles\",\n \"GetFolders\",\n \"GetStarredFiles\",\n \"GetStarredFolders\",\n \"GetRecentFiles\",\n ],\n });\n\n const [\n toggleFolderStarredMutation,\n { loading: folderLoading, error: folderError },\n ] = useToggleFolderStarredMutation({\n refetchQueries: [\n \"GetFiles\",\n \"GetFolders\",\n \"GetStarredFiles\",\n \"GetStarredFolders\",\n \"GetRecentFiles\",\n ],\n });\n\n return {\n mutateAsync: async ({ id, type }: ToggleStarInput) => {\n if (type === \"file\") {\n const result = await toggleFileStarredMutation({\n variables: { id },\n });\n return result.data?.toggleFileStarred;\n } else {\n const result = await toggleFolderStarredMutation({\n variables: { id },\n });\n return result.data?.toggleFolderStarred;\n }\n },\n isPending: fileLoading || folderLoading,\n error: fileError || folderError,\n };\n};\n"],"mappings":";;AAUA,IAAa,UAAsB;CACjC,IAAM,CACJ,GACA,EAAE,SAAS,GAAa,OAAO,OAC7B,EAA6B,EAC/B,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACD,EACF,CAAC,EAEI,CACJ,GACA,EAAE,SAAS,GAAe,OAAO,OAC/B,EAA+B,EACjC,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACD,EACF,CAAC;AAEF,QAAO;EACL,aAAa,OAAO,EAAE,OAAI,cACpB,MAAS,UACI,MAAM,EAA0B,EAC7C,WAAW,EAAE,OAAI,EAClB,CAAC,EACY,MAAM,qBAEL,MAAM,EAA4B,EAC/C,WAAW,EAAE,OAAI,EAClB,CAAC,EACY,MAAM;EAGxB,WAAW,KAAe;EAC1B,OAAO,KAAa;EACrB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
}
|
|
10
|
+
export interface UploadController {
|
|
11
|
+
pause: () => void;
|
|
12
|
+
isPaused: () => boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const useUploadFile: () => {
|
|
15
|
+
mutateAsync: (params: {
|
|
16
|
+
file: File;
|
|
17
|
+
folderId?: string;
|
|
18
|
+
onProgress?: (progress: number) => void;
|
|
19
|
+
}) => Promise<any>;
|
|
20
|
+
isPending: boolean;
|
|
21
|
+
error: Error | null;
|
|
22
|
+
pause: () => void;
|
|
23
|
+
isPaused: () => boolean;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=useUploadFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUploadFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useUploadFile.ts"],"names":[],"mappings":"AAOA,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;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,aAAa;0BAuBW;QACjC,IAAI,EAAE,IAAI,CAAC;QACX,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;KACzC;;;;;CAmJF,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useFilesContext as e } from "../providers/FilesProvider.js";
|
|
2
|
+
import { useCompleteUploadMutation as t, useInitiateUploadMutation as n } from "../../generated/wspace-operations.js";
|
|
3
|
+
import { useCallback as r, useRef as i, useState as a } from "react";
|
|
4
|
+
//#region src/files/hooks/useUploadFile.ts
|
|
5
|
+
var o = () => {
|
|
6
|
+
let { workspaceId: o } = e(), [s, c] = a(!1), [l, u] = a(null), d = i(null), f = i(!1), [p] = n(), [m] = t({ refetchQueries: [
|
|
7
|
+
"GetFiles",
|
|
8
|
+
"GetFolders",
|
|
9
|
+
"GetRecentFiles"
|
|
10
|
+
] });
|
|
11
|
+
return {
|
|
12
|
+
mutateAsync: async (e) => {
|
|
13
|
+
let { file: t, folderId: n, onProgress: r } = e, i = t.name.split(".").pop() || "";
|
|
14
|
+
try {
|
|
15
|
+
c(!0), u(null), f.current = !1, r?.(0);
|
|
16
|
+
let e = await p({ variables: { input: {
|
|
17
|
+
fileName: t.name,
|
|
18
|
+
fileSize: t.size.toString(),
|
|
19
|
+
mimeType: t.type || "application/octet-stream",
|
|
20
|
+
extension: i,
|
|
21
|
+
folderId: n || null
|
|
22
|
+
} } }), a = e.data?.initiateUpload, o = a?.session, s = a?.uploadUrl;
|
|
23
|
+
if (!o || !s) throw Error("Failed to initiate upload session");
|
|
24
|
+
if (e.error) throw Error(e.error.message || "Failed to initiate upload");
|
|
25
|
+
if (r?.(10), !(await new Promise((e, n) => {
|
|
26
|
+
let i = new XMLHttpRequest();
|
|
27
|
+
d.current = i, i.upload.addEventListener("progress", (e) => {
|
|
28
|
+
if (e.lengthComputable && !f.current) {
|
|
29
|
+
let t = 10 + Math.round(e.loaded / e.total * 80);
|
|
30
|
+
r?.(t);
|
|
31
|
+
}
|
|
32
|
+
}), i.addEventListener("load", () => {
|
|
33
|
+
i.status >= 200 && i.status < 300 ? (f.current || r?.(90), e(new Response(i.response, {
|
|
34
|
+
status: i.status,
|
|
35
|
+
statusText: i.statusText,
|
|
36
|
+
headers: new Headers(i.getAllResponseHeaders().split("\r\n").reduce((e, t) => {
|
|
37
|
+
let n = t.split(": ");
|
|
38
|
+
return n[0] && (e[n[0]] = n[1] || ""), e;
|
|
39
|
+
}, {}))
|
|
40
|
+
}))) : n(/* @__PURE__ */ Error(`Upload failed with status ${i.status}`));
|
|
41
|
+
}), i.addEventListener("error", () => {
|
|
42
|
+
f.current || n(/* @__PURE__ */ Error("Upload failed"));
|
|
43
|
+
}), i.addEventListener("abort", () => {
|
|
44
|
+
f.current ? n(/* @__PURE__ */ Error("Upload paused")) : n(/* @__PURE__ */ Error("Upload aborted"));
|
|
45
|
+
}), i.open("PUT", s), i.setRequestHeader("Content-Type", t.type), i.send(t);
|
|
46
|
+
})).ok) throw Error("Failed to upload file to S3");
|
|
47
|
+
if (f.current) throw Error("Upload paused");
|
|
48
|
+
let l = await m({ variables: { input: {
|
|
49
|
+
sessionId: o.id,
|
|
50
|
+
folderId: n || null
|
|
51
|
+
} } });
|
|
52
|
+
if (l.error) throw Error(l.error.message || "Failed to complete upload");
|
|
53
|
+
let h = l.data?.completeUpload?.file;
|
|
54
|
+
if (!h) throw Error("Upload completed but file data was not returned. The file may not have been created properly.");
|
|
55
|
+
return r?.(100), h;
|
|
56
|
+
} catch (e) {
|
|
57
|
+
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Upload failed");
|
|
58
|
+
throw u(t), t;
|
|
59
|
+
} finally {
|
|
60
|
+
c(!1), d.current = null;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
isPending: s,
|
|
64
|
+
error: l,
|
|
65
|
+
pause: r(() => {
|
|
66
|
+
d.current && !f.current && (f.current = !0, d.current.abort(), d.current = null);
|
|
67
|
+
}, []),
|
|
68
|
+
isPaused: r(() => f.current, [])
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
//#endregion
|
|
72
|
+
export { o as useUploadFile };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=useUploadFile.js.map
|