@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.
Files changed (168) hide show
  1. package/dist/config/index.d.ts +33 -0
  2. package/dist/config/index.d.ts.map +1 -0
  3. package/dist/dev/main.d.ts +1 -0
  4. package/dist/dev/main.d.ts.map +1 -0
  5. package/dist/files/FilesRoot.d.ts +31 -0
  6. package/dist/files/FilesRoot.d.ts.map +1 -0
  7. package/dist/files/FilesRoutes.d.ts +12 -0
  8. package/dist/files/FilesRoutes.d.ts.map +1 -0
  9. package/dist/files/components/ActionMenu.d.ts +19 -0
  10. package/dist/files/components/ActionMenu.d.ts.map +1 -0
  11. package/dist/files/components/ConfirmDialog.d.ts +22 -0
  12. package/dist/files/components/ConfirmDialog.d.ts.map +1 -0
  13. package/dist/files/components/ContextMenu.d.ts +15 -0
  14. package/dist/files/components/ContextMenu.d.ts.map +1 -0
  15. package/dist/files/components/CopyDialog.d.ts +12 -0
  16. package/dist/files/components/CopyDialog.d.ts.map +1 -0
  17. package/dist/files/components/EmptyState.d.ts +15 -0
  18. package/dist/files/components/EmptyState.d.ts.map +1 -0
  19. package/dist/files/components/FileBrowser.d.ts +37 -0
  20. package/dist/files/components/FileBrowser.d.ts.map +1 -0
  21. package/dist/files/components/FileCard.d.ts +30 -0
  22. package/dist/files/components/FileCard.d.ts.map +1 -0
  23. package/dist/files/components/FileInfoPanel.d.ts +9 -0
  24. package/dist/files/components/FileInfoPanel.d.ts.map +1 -0
  25. package/dist/files/components/FileListItem.d.ts +29 -0
  26. package/dist/files/components/FileListItem.d.ts.map +1 -0
  27. package/dist/files/components/FilePreviewModal.d.ts +17 -0
  28. package/dist/files/components/FilePreviewModal.d.ts.map +1 -0
  29. package/dist/files/components/FileVersionPanel.d.ts +9 -0
  30. package/dist/files/components/FileVersionPanel.d.ts.map +1 -0
  31. package/dist/files/components/FolderCard.d.ts +34 -0
  32. package/dist/files/components/FolderCard.d.ts.map +1 -0
  33. package/dist/files/components/MoveDialog.d.ts +12 -0
  34. package/dist/files/components/MoveDialog.d.ts.map +1 -0
  35. package/dist/files/components/SearchBar.d.ts +13 -0
  36. package/dist/files/components/SearchBar.d.ts.map +1 -0
  37. package/dist/files/components/ShareDialog.d.ts +24 -0
  38. package/dist/files/components/ShareDialog.d.ts.map +1 -0
  39. package/dist/files/components/StorageBanner.d.ts +12 -0
  40. package/dist/files/components/StorageBanner.d.ts.map +1 -0
  41. package/dist/files/components/StorageBanner.js +43 -24
  42. package/dist/files/components/StorageBanner.js.map +1 -1
  43. package/dist/files/components/TabBar.d.ts +16 -0
  44. package/dist/files/components/TabBar.d.ts.map +1 -0
  45. package/dist/files/components/Toast.d.ts +14 -0
  46. package/dist/files/components/Toast.d.ts.map +1 -0
  47. package/dist/files/components/UploadQueue.d.ts +13 -0
  48. package/dist/files/components/UploadQueue.d.ts.map +1 -0
  49. package/dist/files/components/contextMenuItems.d.ts +45 -0
  50. package/dist/files/components/contextMenuItems.d.ts.map +1 -0
  51. package/dist/files/components/viewers/AudioPlayer.d.ts +8 -0
  52. package/dist/files/components/viewers/AudioPlayer.d.ts.map +1 -0
  53. package/dist/files/components/viewers/CodeViewer.d.ts +16 -0
  54. package/dist/files/components/viewers/CodeViewer.d.ts.map +1 -0
  55. package/dist/files/components/viewers/ImageViewer.d.ts +8 -0
  56. package/dist/files/components/viewers/ImageViewer.d.ts.map +1 -0
  57. package/dist/files/components/viewers/PDFViewer.d.ts +15 -0
  58. package/dist/files/components/viewers/PDFViewer.d.ts.map +1 -0
  59. package/dist/files/components/viewers/TextViewer.d.ts +8 -0
  60. package/dist/files/components/viewers/TextViewer.d.ts.map +1 -0
  61. package/dist/files/components/viewers/VideoPlayer.d.ts +8 -0
  62. package/dist/files/components/viewers/VideoPlayer.d.ts.map +1 -0
  63. package/dist/files/graphql-types.d.ts +277 -0
  64. package/dist/files/graphql-types.d.ts.map +1 -0
  65. package/dist/files/hooks/useBatchOperations.d.ts +6 -0
  66. package/dist/files/hooks/useBatchOperations.d.ts.map +1 -0
  67. package/dist/files/hooks/useBinItems.d.ts +11 -0
  68. package/dist/files/hooks/useBinItems.d.ts.map +1 -0
  69. package/dist/files/hooks/useBrowsePage.d.ts +21 -0
  70. package/dist/files/hooks/useBrowsePage.d.ts.map +1 -0
  71. package/dist/files/hooks/useCopyFile.d.ts +14 -0
  72. package/dist/files/hooks/useCopyFile.d.ts.map +1 -0
  73. package/dist/files/hooks/useCreateFolder.d.ts +17 -0
  74. package/dist/files/hooks/useCreateFolder.d.ts.map +1 -0
  75. package/dist/files/hooks/useCreateFolderShare.d.ts +16 -0
  76. package/dist/files/hooks/useCreateFolderShare.d.ts.map +1 -0
  77. package/dist/files/hooks/useCreateShare.d.ts +16 -0
  78. package/dist/files/hooks/useCreateShare.d.ts.map +1 -0
  79. package/dist/files/hooks/useDeleteFile.d.ts +9 -0
  80. package/dist/files/hooks/useDeleteFile.d.ts.map +1 -0
  81. package/dist/files/hooks/useDeleteFolder.d.ts +10 -0
  82. package/dist/files/hooks/useDeleteFolder.d.ts.map +1 -0
  83. package/dist/files/hooks/useDragDrop.d.ts +31 -0
  84. package/dist/files/hooks/useDragDrop.d.ts.map +1 -0
  85. package/dist/files/hooks/useFileVersions.d.ts +39 -0
  86. package/dist/files/hooks/useFileVersions.d.ts.map +1 -0
  87. package/dist/files/hooks/useFoldersQuery.d.ts +7 -0
  88. package/dist/files/hooks/useFoldersQuery.d.ts.map +1 -0
  89. package/dist/files/hooks/useKeyboardNavigation.d.ts +17 -0
  90. package/dist/files/hooks/useKeyboardNavigation.d.ts.map +1 -0
  91. package/dist/files/hooks/useMoveFile.d.ts +10 -0
  92. package/dist/files/hooks/useMoveFile.d.ts.map +1 -0
  93. package/dist/files/hooks/useMoveFolder.d.ts +10 -0
  94. package/dist/files/hooks/useMoveFolder.d.ts.map +1 -0
  95. package/dist/files/hooks/usePermanentlyDeleteFile.d.ts +9 -0
  96. package/dist/files/hooks/usePermanentlyDeleteFile.d.ts.map +1 -0
  97. package/dist/files/hooks/usePermanentlyDeleteFolder.d.ts +9 -0
  98. package/dist/files/hooks/usePermanentlyDeleteFolder.d.ts.map +1 -0
  99. package/dist/files/hooks/useRecentFiles.d.ts +10 -0
  100. package/dist/files/hooks/useRecentFiles.d.ts.map +1 -0
  101. package/dist/files/hooks/useRenameFile.d.ts +10 -0
  102. package/dist/files/hooks/useRenameFile.d.ts.map +1 -0
  103. package/dist/files/hooks/useRenameFolder.d.ts +10 -0
  104. package/dist/files/hooks/useRenameFolder.d.ts.map +1 -0
  105. package/dist/files/hooks/useRestoreFile.d.ts +9 -0
  106. package/dist/files/hooks/useRestoreFile.d.ts.map +1 -0
  107. package/dist/files/hooks/useRestoreFolder.d.ts +9 -0
  108. package/dist/files/hooks/useRestoreFolder.d.ts.map +1 -0
  109. package/dist/files/hooks/useSearch.d.ts +15 -0
  110. package/dist/files/hooks/useSearch.d.ts.map +1 -0
  111. package/dist/files/hooks/useStarredItems.d.ts +10 -0
  112. package/dist/files/hooks/useStarredItems.d.ts.map +1 -0
  113. package/dist/files/hooks/useStorageQuota.d.ts +11 -0
  114. package/dist/files/hooks/useStorageQuota.d.ts.map +1 -0
  115. package/dist/files/hooks/useStorageQuota.js +1 -1
  116. package/dist/files/hooks/useStorageQuota.js.map +1 -1
  117. package/dist/files/hooks/useToast.d.ts +11 -0
  118. package/dist/files/hooks/useToast.d.ts.map +1 -0
  119. package/dist/files/hooks/useToggleStar.d.ts +10 -0
  120. package/dist/files/hooks/useToggleStar.d.ts.map +1 -0
  121. package/dist/files/hooks/useUploadFile.d.ts +26 -0
  122. package/dist/files/hooks/useUploadFile.d.ts.map +1 -0
  123. package/dist/files/hooks/useUploadFile.js +43 -44
  124. package/dist/files/hooks/useUploadFile.js.map +1 -1
  125. package/dist/files/index.d.ts +29 -0
  126. package/dist/files/index.d.ts.map +1 -0
  127. package/dist/files/pages/BrowserPage.d.ts +5 -0
  128. package/dist/files/pages/BrowserPage.d.ts.map +1 -0
  129. package/dist/files/pages/BrowserPage.js +361 -351
  130. package/dist/files/pages/BrowserPage.js.map +1 -1
  131. package/dist/files/pages/ShareAccessPage.d.ts +2 -0
  132. package/dist/files/pages/ShareAccessPage.d.ts.map +1 -0
  133. package/dist/files/providers/FilesProvider.d.ts +25 -0
  134. package/dist/files/providers/FilesProvider.d.ts.map +1 -0
  135. package/dist/files/store/filesStore.d.ts +99 -0
  136. package/dist/files/store/filesStore.d.ts.map +1 -0
  137. package/dist/files/types.d.ts +266 -0
  138. package/dist/files/types.d.ts.map +1 -0
  139. package/dist/files/utils/events.d.ts +6 -0
  140. package/dist/files/utils/events.d.ts.map +1 -0
  141. package/dist/files/utils/i18n.d.ts +5 -0
  142. package/dist/files/utils/i18n.d.ts.map +1 -0
  143. package/dist/files/utils/index.d.ts +12 -0
  144. package/dist/files/utils/index.d.ts.map +1 -0
  145. package/dist/files/utils/quotaUtils.d.ts +2 -0
  146. package/dist/files/utils/quotaUtils.d.ts.map +1 -0
  147. package/dist/files/utils/quotaUtils.js +2 -14
  148. package/dist/files/utils/thumbnail.d.ts +3 -0
  149. package/dist/files/utils/thumbnail.d.ts.map +1 -0
  150. package/dist/files.d.ts +2 -0
  151. package/dist/generated/global-operations.d.ts +2 -0
  152. package/dist/generated/global-operations.d.ts.map +1 -0
  153. package/dist/generated/global-types.d.ts +22995 -0
  154. package/dist/generated/global-types.d.ts.map +1 -0
  155. package/dist/generated/wspace-operations.d.ts +2789 -0
  156. package/dist/generated/wspace-operations.d.ts.map +1 -0
  157. package/dist/generated/wspace-types.d.ts +50215 -0
  158. package/dist/generated/wspace-types.d.ts.map +1 -0
  159. package/dist/index.d.ts +31 -0
  160. package/dist/index.d.ts.map +1 -0
  161. package/dist/shared/types/index.d.ts +109 -0
  162. package/dist/shared/types/index.d.ts.map +1 -0
  163. package/dist/translations/en.d.ts +315 -0
  164. package/dist/translations/en.d.ts.map +1 -0
  165. package/dist/utils/nativeBridge.d.ts +3 -0
  166. package/dist/utils/nativeBridge.d.ts.map +1 -0
  167. package/package.json +2 -2
  168. 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 = "vibecontrols.files.storage_bytes";
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 = \"vibecontrols.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"}
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 { useCallback as r, useRef as i, useState as a } from "react";
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 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: [
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: r } = e, i = t.name.split(".").pop() || "";
15
+ let { file: t, folderId: n, onProgress: i } = e, a = t.name.split(".").pop() || "";
15
16
  try {
16
- c(!0), u(null), f.current = !1, r?.(0);
17
- let e = await p({ variables: { input: {
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: i,
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 t.includes("STORAGE_QUOTA_EXCEEDED") || t.includes("quota") || t.toLowerCase().includes("quota exceeded") ? Error("QUOTA_EXHAUSTED") : Error(t || "Failed to initiate upload");
28
+ throw Error(t || "Failed to initiate upload");
27
29
  }
28
- let a = e.data?.initiateUpload, o = a?.session, s = a?.uploadUrl;
29
- if (!o || !s) throw Error("Failed to initiate upload session");
30
- if (r?.(10), !(await new Promise((e, n) => {
31
- let i = new XMLHttpRequest();
32
- d.current = i, i.upload.addEventListener("progress", (e) => {
33
- if (e.lengthComputable && !f.current) {
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
- r?.(t);
37
+ i?.(t);
36
38
  }
37
- }), i.addEventListener("load", () => {
38
- i.status >= 200 && i.status < 300 ? (f.current || r?.(90), e(new Response(i.response, {
39
- status: i.status,
40
- statusText: i.statusText,
41
- headers: new Headers(i.getAllResponseHeaders().split("\r\n").reduce((e, t) => {
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 ${i.status}`));
46
- }), i.addEventListener("error", () => {
47
- f.current || n(/* @__PURE__ */ Error("Upload failed"));
48
- }), i.addEventListener("abort", () => {
49
- f.current ? n(/* @__PURE__ */ Error("Upload paused")) : n(/* @__PURE__ */ Error("Upload aborted"));
50
- }), i.open("PUT", s), i.setRequestHeader("Content-Type", t.type), i.send(t);
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 (f.current) throw Error("Upload paused");
53
- let l = await m({ variables: { input: {
54
- sessionId: o.id,
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 (l.error) {
59
- let e = l.error.message || "";
60
- throw e.includes("STORAGE_QUOTA_EXCEEDED") || e.includes("quota") || e.toLowerCase().includes("quota exceeded") ? Error("QUOTA_EXHAUSTED") : Error(l.error.message || "Failed to complete upload");
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 u(t), t;
66
+ throw d(t), t;
68
67
  } finally {
69
- c(!1), d.current = null;
68
+ l(!1), f.current = null;
70
69
  }
71
70
  },
72
- isPending: s,
73
- error: l,
74
- pause: r(() => {
75
- d.current && !f.current && (f.current = !0, d.current.abort(), d.current = null);
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: r(() => f.current, [])
76
+ isPaused: i(() => p.current, [])
78
77
  };
79
78
  };
80
79
  //#endregion
81
- export { o as useUploadFile };
80
+ export { s as useUploadFile };
82
81
 
83
82
  //# sourceMappingURL=useUploadFile.js.map