@burdenoff/microfe-files 2026.1014.11 → 2026.1016.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/config/index.js.map +1 -1
- package/dist/files/FilesRoot.js +17 -10
- package/dist/files/FilesRoot.js.map +1 -1
- package/dist/files/FilesRoutes.d.ts +1 -1
- package/dist/files/FilesRoutes.js.map +1 -1
- package/dist/files/components/ActionMenu.js.map +1 -1
- package/dist/files/components/ConfirmDialog.d.ts +1 -1
- package/dist/files/components/ConfirmDialog.js.map +1 -1
- package/dist/files/components/ContextMenu.d.ts +1 -1
- package/dist/files/components/ContextMenu.js.map +1 -1
- package/dist/files/components/CopyDialog.js.map +1 -1
- package/dist/files/components/EmptyState.d.ts +1 -1
- package/dist/files/components/EmptyState.js.map +1 -1
- package/dist/files/components/FileBrowser.js +2 -1
- package/dist/files/components/FileBrowser.js.map +1 -1
- package/dist/files/components/FileCard.d.ts.map +1 -1
- package/dist/files/components/FileCard.js +150 -142
- package/dist/files/components/FileCard.js.map +1 -1
- package/dist/files/components/FileInfoPanel.d.ts +1 -1
- package/dist/files/components/FileInfoPanel.d.ts.map +1 -1
- package/dist/files/components/FileInfoPanel.js +3 -7
- package/dist/files/components/FileInfoPanel.js.map +1 -1
- package/dist/files/components/FileListItem.d.ts.map +1 -1
- package/dist/files/components/FileListItem.js +1 -1
- package/dist/files/components/FileListItem.js.map +1 -1
- package/dist/files/components/FilePreviewModal.d.ts +1 -1
- package/dist/files/components/FilePreviewModal.d.ts.map +1 -1
- package/dist/files/components/FilePreviewModal.js +5 -0
- package/dist/files/components/FilePreviewModal.js.map +1 -1
- package/dist/files/components/FileVersionPanel.d.ts.map +1 -1
- package/dist/files/components/FileVersionPanel.js +122 -121
- package/dist/files/components/FileVersionPanel.js.map +1 -1
- package/dist/files/components/FolderCard.d.ts.map +1 -1
- package/dist/files/components/FolderCard.js +1 -1
- package/dist/files/components/FolderCard.js.map +1 -1
- package/dist/files/components/MoveDialog.js +2 -2
- package/dist/files/components/MoveDialog.js.map +1 -1
- package/dist/files/components/SearchBar.d.ts +1 -1
- package/dist/files/components/SearchBar.d.ts.map +1 -1
- package/dist/files/components/SearchBar.js +132 -128
- package/dist/files/components/SearchBar.js.map +1 -1
- package/dist/files/components/ShareDialog.d.ts +1 -1
- package/dist/files/components/ShareDialog.js.map +1 -1
- package/dist/files/components/StorageBanner.js.map +1 -1
- package/dist/files/components/TabBar.d.ts +1 -1
- package/dist/files/components/TabBar.js.map +1 -1
- package/dist/files/components/Toast.d.ts +1 -1
- package/dist/files/components/Toast.js.map +1 -1
- package/dist/files/components/UploadQueue.d.ts +1 -1
- package/dist/files/components/UploadQueue.js +1 -1
- package/dist/files/components/UploadQueue.js.map +1 -1
- package/dist/files/components/contextMenuItems.d.ts +4 -4
- package/dist/files/components/contextMenuItems.js.map +1 -1
- package/dist/files/components/viewers/AudioPlayer.d.ts +1 -1
- package/dist/files/components/viewers/AudioPlayer.js.map +1 -1
- package/dist/files/components/viewers/CodeViewer.d.ts +1 -1
- package/dist/files/components/viewers/CodeViewer.js.map +1 -1
- package/dist/files/components/viewers/ImageViewer.d.ts +1 -1
- package/dist/files/components/viewers/ImageViewer.js.map +1 -1
- package/dist/files/components/viewers/PDFViewer.d.ts +1 -1
- package/dist/files/components/viewers/PDFViewer.js.map +1 -1
- package/dist/files/components/viewers/TextViewer.d.ts +1 -1
- package/dist/files/components/viewers/TextViewer.js.map +1 -1
- package/dist/files/components/viewers/VideoPlayer.d.ts +1 -1
- package/dist/files/components/viewers/VideoPlayer.js.map +1 -1
- package/dist/files/graphql-types.d.ts +2 -17
- package/dist/files/graphql-types.d.ts.map +1 -1
- package/dist/files/hooks/useBatchOperations.d.ts +6 -1
- package/dist/files/hooks/useBatchOperations.d.ts.map +1 -1
- package/dist/files/hooks/useBatchOperations.js +8 -7
- package/dist/files/hooks/useBatchOperations.js.map +1 -1
- package/dist/files/hooks/useBinItems.d.ts.map +1 -1
- package/dist/files/hooks/useBinItems.js +14 -12
- package/dist/files/hooks/useBinItems.js.map +1 -1
- package/dist/files/hooks/useBrowsePage.d.ts +131 -8
- package/dist/files/hooks/useBrowsePage.d.ts.map +1 -1
- package/dist/files/hooks/useBrowsePage.js +23 -22
- package/dist/files/hooks/useBrowsePage.js.map +1 -1
- package/dist/files/hooks/useCopyFile.d.ts +22 -1
- package/dist/files/hooks/useCopyFile.d.ts.map +1 -1
- package/dist/files/hooks/useCopyFile.js +9 -8
- package/dist/files/hooks/useCopyFile.js.map +1 -1
- package/dist/files/hooks/useCreateFolder.d.ts +23 -1
- package/dist/files/hooks/useCreateFolder.d.ts.map +1 -1
- package/dist/files/hooks/useCreateFolder.js +16 -9
- package/dist/files/hooks/useCreateFolder.js.map +1 -1
- package/dist/files/hooks/useCreateFolderShare.d.ts +20 -1
- package/dist/files/hooks/useCreateFolderShare.d.ts.map +1 -1
- package/dist/files/hooks/useCreateFolderShare.js +22 -7
- package/dist/files/hooks/useCreateFolderShare.js.map +1 -1
- package/dist/files/hooks/useCreateShare.d.ts +19 -1
- package/dist/files/hooks/useCreateShare.d.ts.map +1 -1
- package/dist/files/hooks/useCreateShare.js +22 -7
- package/dist/files/hooks/useCreateShare.js.map +1 -1
- package/dist/files/hooks/useDeleteFile.d.ts +1 -1
- package/dist/files/hooks/useDeleteFile.d.ts.map +1 -1
- package/dist/files/hooks/useDeleteFile.js +8 -7
- package/dist/files/hooks/useDeleteFile.js.map +1 -1
- package/dist/files/hooks/useDeleteFolder.d.ts +1 -1
- package/dist/files/hooks/useDeleteFolder.d.ts.map +1 -1
- package/dist/files/hooks/useDeleteFolder.js +9 -8
- package/dist/files/hooks/useDeleteFolder.js.map +1 -1
- package/dist/files/hooks/useDragDrop.js.map +1 -1
- package/dist/files/hooks/useFileVersions.d.ts +36 -9
- package/dist/files/hooks/useFileVersions.d.ts.map +1 -1
- package/dist/files/hooks/useFileVersions.js +14 -13
- package/dist/files/hooks/useFileVersions.js.map +1 -1
- package/dist/files/hooks/useFoldersQuery.d.ts +8 -4
- package/dist/files/hooks/useFoldersQuery.d.ts.map +1 -1
- package/dist/files/hooks/useFoldersQuery.js +7 -6
- package/dist/files/hooks/useFoldersQuery.js.map +1 -1
- package/dist/files/hooks/useKeyboardNavigation.js +7 -8
- package/dist/files/hooks/useKeyboardNavigation.js.map +1 -1
- package/dist/files/hooks/useMoveFile.d.ts +22 -1
- package/dist/files/hooks/useMoveFile.d.ts.map +1 -1
- package/dist/files/hooks/useMoveFile.js +9 -8
- package/dist/files/hooks/useMoveFile.js.map +1 -1
- package/dist/files/hooks/useMoveFolder.d.ts +22 -1
- package/dist/files/hooks/useMoveFolder.d.ts.map +1 -1
- package/dist/files/hooks/useMoveFolder.js +9 -8
- package/dist/files/hooks/useMoveFolder.js.map +1 -1
- package/dist/files/hooks/usePermanentlyDeleteFile.d.ts +1 -1
- package/dist/files/hooks/usePermanentlyDeleteFile.d.ts.map +1 -1
- package/dist/files/hooks/usePermanentlyDeleteFile.js +8 -7
- package/dist/files/hooks/usePermanentlyDeleteFile.js.map +1 -1
- package/dist/files/hooks/usePermanentlyDeleteFolder.d.ts +1 -1
- package/dist/files/hooks/usePermanentlyDeleteFolder.d.ts.map +1 -1
- package/dist/files/hooks/usePermanentlyDeleteFolder.js +8 -7
- package/dist/files/hooks/usePermanentlyDeleteFolder.js.map +1 -1
- package/dist/files/hooks/useRecentFiles.d.ts.map +1 -1
- package/dist/files/hooks/useRecentFiles.js +13 -11
- package/dist/files/hooks/useRecentFiles.js.map +1 -1
- package/dist/files/hooks/useRenameFile.d.ts +22 -1
- package/dist/files/hooks/useRenameFile.d.ts.map +1 -1
- package/dist/files/hooks/useRenameFile.js +9 -8
- package/dist/files/hooks/useRenameFile.js.map +1 -1
- package/dist/files/hooks/useRenameFolder.d.ts +22 -1
- package/dist/files/hooks/useRenameFolder.d.ts.map +1 -1
- package/dist/files/hooks/useRenameFolder.js +9 -8
- package/dist/files/hooks/useRenameFolder.js.map +1 -1
- package/dist/files/hooks/useRestoreFile.d.ts +22 -1
- package/dist/files/hooks/useRestoreFile.d.ts.map +1 -1
- package/dist/files/hooks/useRestoreFile.js +8 -7
- package/dist/files/hooks/useRestoreFile.js.map +1 -1
- package/dist/files/hooks/useRestoreFolder.d.ts +22 -1
- package/dist/files/hooks/useRestoreFolder.d.ts.map +1 -1
- package/dist/files/hooks/useRestoreFolder.js +8 -7
- package/dist/files/hooks/useRestoreFolder.js.map +1 -1
- package/dist/files/hooks/useSearch.d.ts +2 -3
- package/dist/files/hooks/useSearch.d.ts.map +1 -1
- package/dist/files/hooks/useSearch.js +14 -12
- package/dist/files/hooks/useSearch.js.map +1 -1
- package/dist/files/hooks/useStarredItems.d.ts +2 -3
- package/dist/files/hooks/useStarredItems.d.ts.map +1 -1
- package/dist/files/hooks/useStarredItems.js +12 -10
- package/dist/files/hooks/useStarredItems.js.map +1 -1
- package/dist/files/hooks/useStorageQuota.d.ts.map +1 -1
- package/dist/files/hooks/useStorageQuota.js +17 -16
- package/dist/files/hooks/useStorageQuota.js.map +1 -1
- package/dist/files/hooks/useToast.js.map +1 -1
- package/dist/files/hooks/useToggleStar.d.ts +43 -1
- package/dist/files/hooks/useToggleStar.d.ts.map +1 -1
- package/dist/files/hooks/useToggleStar.js +9 -8
- package/dist/files/hooks/useToggleStar.js.map +1 -1
- package/dist/files/hooks/useUploadFile.d.ts +23 -1
- package/dist/files/hooks/useUploadFile.d.ts.map +1 -1
- package/dist/files/hooks/useUploadFile.js +28 -27
- package/dist/files/hooks/useUploadFile.js.map +1 -1
- package/dist/files/hooks/useUploadQueueState.d.ts +32 -0
- package/dist/files/hooks/useUploadQueueState.d.ts.map +1 -0
- package/dist/files/hooks/useUploadQueueState.js +61 -0
- package/dist/files/hooks/useUploadQueueState.js.map +1 -0
- package/dist/files/index.js +4 -3
- package/dist/files/pages/BrowserPage.d.ts +1 -1
- package/dist/files/pages/BrowserPage.d.ts.map +1 -1
- package/dist/files/pages/BrowserPage.js +383 -387
- package/dist/files/pages/BrowserPage.js.map +1 -1
- package/dist/files/pages/ShareAccessPage.d.ts +1 -1
- package/dist/files/pages/ShareAccessPage.js.map +1 -1
- package/dist/files/providers/FilesProvider.js.map +1 -1
- package/dist/files/store/filesStore.js.map +1 -1
- package/dist/files/types.d.ts.map +1 -1
- package/dist/files/utils/events.js.map +1 -1
- package/dist/files/utils/fileViewModel.d.ts +7 -0
- package/dist/files/utils/fileViewModel.d.ts.map +1 -0
- package/dist/files/utils/fileViewModel.js +34 -0
- package/dist/files/utils/fileViewModel.js.map +1 -0
- package/dist/files/utils/i18n.js.map +1 -1
- package/dist/files/utils/index.js +19 -19
- package/dist/files/utils/index.js.map +1 -1
- package/dist/files/utils/quotaUtils.js +1 -2
- package/dist/files/utils/thumbnail.js +19 -23
- package/dist/files/utils/thumbnail.js.map +1 -1
- package/dist/files/utils/uploadDigest.js +1 -1
- package/dist/files/utils/uploadDigest.js.map +1 -1
- package/dist/generated/global-operations.d.ts +4 -1
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-types.d.ts +16 -21
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/wspace-operations.d.ts +503 -1784
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +15278 -1110
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +90013 -24889
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +16 -0
- package/dist/generated/wspace-types.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/hooks/useTr.js.map +1 -1
- package/dist/translations/en.js.map +1 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +24 -22
- package/dist/files.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRecentFiles.js","names":[],"sources":["../../../src/files/hooks/useRecentFiles.ts"],"sourcesContent":["/**\n * Recent Files Hook\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"useRecentFiles.js","names":["useRecentFiles","query","useQuery","GetFilesRecentPageDocument","options","allItems","fileViewModel","folderViewModel","dateA","a","b","item"],"sources":["../../../src/files/hooks/useRecentFiles.ts"],"sourcesContent":["import { fileViewModel, folderViewModel } from \"../utils/fileViewModel\";\n/**\n * Recent Files Hook\n */\n\nimport { useQuery } from \"@apollo/client/react\";\nimport { GetFilesRecentPageDocument } from \"../../generated/wspace-operations\";\nimport type { FileItem, FolderItem } from \"../types\";\n\nexport const useRecentFiles = (options?: { skip?: boolean }) => {\n const query = useQuery(GetFilesRecentPageDocument, {\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.map(fileViewModel) || []),\n ...(query.data?.getFolders?.folders.map(folderViewModel) || []),\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":";;;;AASA,IAAaA,KAAkB,MAAiC;CAC9D,IAAMC,IAAQC,EAASC,GAA4B;EACjD,WAAW;GACT,gBAAgB,EAAE,OAAO,IAAI;GAC7B,kBAAkB,EAAE,OAAO,IAAI;EACjC;EACA,MAAMC,GAAS;CACjB,CAAC,GAGKC,IAAsC,CAC1C,GAAIJ,EAAM,MAAM,UAAU,MAAM,IAAIK,CAAa,KAAK,CAAC,GACvD,GAAIL,EAAM,MAAM,YAAY,QAAQ,IAAIM,CAAe,KAAK,CAAC,CAC/D;CAmBA,OAhBAF,EAAS,MAAM,GAAG,MAAM;EACtB,IAAMG,IAAQ,IAAI,KACfC,EAAe,aAAcA,EAAiB,aAAa,CAC9D,CAAC,CAAC,QAAQ;EAIV,OAHc,IAAI,KACfC,EAAe,aAAcA,EAAiB,aAAa,CAC9D,CAAC,CAAC,QACK,IAAQF;CACjB,CAAC,GAQM;EACL,OANYH,EAAS,QAAQ,MAA2B,cAAcM,CAMtE;EACA,SANcN,EAAS,QACtB,MAA6B,EAAE,cAAcM,EAK9C;EACA,WAAWV,EAAM;EACjB,OAAOA,EAAM;CACf;AACF"}
|
|
@@ -3,7 +3,28 @@ export interface RenameFileInput {
|
|
|
3
3
|
newName: string;
|
|
4
4
|
}
|
|
5
5
|
export declare const useRenameFile: () => {
|
|
6
|
-
mutateAsync: ({ fileId, newName }: RenameFileInput) => Promise<
|
|
6
|
+
mutateAsync: ({ fileId, newName }: RenameFileInput) => Promise<{
|
|
7
|
+
id: string;
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
folderId: string | null;
|
|
10
|
+
status: import('../../generated/wspace-types').FileStatus;
|
|
11
|
+
canRead: boolean | null;
|
|
12
|
+
canUpdate: boolean | null;
|
|
13
|
+
canDelete: boolean | null;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
mimeType: string;
|
|
17
|
+
extension: string;
|
|
18
|
+
size: string;
|
|
19
|
+
downloadUrl: string | null;
|
|
20
|
+
visibility: import('../../generated/wspace-types').FileVisibility;
|
|
21
|
+
starred: boolean;
|
|
22
|
+
downloadCount: number;
|
|
23
|
+
viewCount: number;
|
|
24
|
+
uploadedById: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
} | undefined>;
|
|
7
28
|
isPending: boolean;
|
|
8
29
|
error: import('@apollo/client').ErrorLike | undefined;
|
|
9
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRenameFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRenameFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRenameFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRenameFile.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa;uCASmB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;CAY3D,CAAC"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UpdateFileDocument as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { useMutation as t } from "@apollo/client/react";
|
|
2
3
|
//#region src/files/hooks/useRenameFile.ts
|
|
3
|
-
var
|
|
4
|
-
let [
|
|
4
|
+
var n = () => {
|
|
5
|
+
let [n, { loading: r, error: i }] = t(e, { refetchQueries: [
|
|
5
6
|
"GetFiles",
|
|
6
7
|
"GetFolders",
|
|
7
8
|
"GetRecentFiles"
|
|
8
9
|
] });
|
|
9
10
|
return {
|
|
10
|
-
mutateAsync: async ({ fileId: e, newName:
|
|
11
|
+
mutateAsync: async ({ fileId: e, newName: t }) => (await n({ variables: {
|
|
11
12
|
id: e,
|
|
12
|
-
input: { name:
|
|
13
|
+
input: { name: t }
|
|
13
14
|
} })).data?.updateFile,
|
|
14
|
-
isPending:
|
|
15
|
-
error:
|
|
15
|
+
isPending: r,
|
|
16
|
+
error: i
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
//#endregion
|
|
19
|
-
export {
|
|
20
|
+
export { n as useRenameFile };
|
|
20
21
|
|
|
21
22
|
//# sourceMappingURL=useRenameFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRenameFile.js","names":[],"sources":["../../../src/files/hooks/useRenameFile.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useRenameFile.js","names":["useRenameFile","updateFileMutation","useMutation","UpdateFileDocument","fileId","newName","loading"],"sources":["../../../src/files/hooks/useRenameFile.ts"],"sourcesContent":["import { useMutation } from \"@apollo/client/react\";\nimport { UpdateFileDocument } from \"../../generated/wspace-operations\";\n\nexport interface RenameFileInput {\n fileId: string;\n newName: string;\n}\n\nexport const useRenameFile = () => {\n const [updateFileMutation, { loading, error }] = useMutation(\n UpdateFileDocument,\n {\n refetchQueries: [\"GetFiles\", \"GetFolders\", \"GetRecentFiles\"],\n },\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":";;;AAQA,IAAaA,UAAsB;CACjC,IAAM,CAACC,GAAoB,EAAE,YAAS,cAAWC,EAC/CC,GACA,EACE,gBAAgB;EAAC;EAAY;EAAc;CAAgB,EAC7D,CACF;CAEA,OAAO;EACL,aAAa,OAAO,EAAE,WAAQ,kBAOrB,MANcF,EAAmB,EACtC,WAAW;GACT,IAAIG;GACJ,OAAO,EAAE,MAAMC,EAAQ;EACzB,EACF,CAAC,EAAA,CACa,MAAM;EAEtB,WAAWC;EACX;CACF;AACF"}
|
|
@@ -3,7 +3,28 @@ export interface RenameFolderInput {
|
|
|
3
3
|
newName: string;
|
|
4
4
|
}
|
|
5
5
|
export declare const useRenameFolder: () => {
|
|
6
|
-
mutateAsync: ({ folderId, newName }: RenameFolderInput) => Promise<
|
|
6
|
+
mutateAsync: ({ folderId, newName }: RenameFolderInput) => Promise<{
|
|
7
|
+
id: string;
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
parentFolderId: string | null;
|
|
10
|
+
status: import('../../generated/wspace-types').FolderStatus;
|
|
11
|
+
canRead: boolean | null;
|
|
12
|
+
canUpdate: boolean | null;
|
|
13
|
+
canDelete: boolean | null;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
path: string;
|
|
17
|
+
level: number;
|
|
18
|
+
visibility: import('../../generated/wspace-types').FileVisibility;
|
|
19
|
+
color: string | null;
|
|
20
|
+
icon: string | null;
|
|
21
|
+
starred: boolean;
|
|
22
|
+
filesCount: number | null;
|
|
23
|
+
subfoldersCount: number | null;
|
|
24
|
+
createdById: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
} | undefined>;
|
|
7
28
|
isPending: boolean;
|
|
8
29
|
error: import('@apollo/client').ErrorLike | undefined;
|
|
9
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRenameFolder.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRenameFolder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRenameFolder.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRenameFolder.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,eAAe;yCASmB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;CAY/D,CAAC"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UpdateFolderDocument as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { useMutation as t } from "@apollo/client/react";
|
|
2
3
|
//#region src/files/hooks/useRenameFolder.ts
|
|
3
|
-
var
|
|
4
|
-
let [
|
|
4
|
+
var n = () => {
|
|
5
|
+
let [n, { loading: r, error: i }] = t(e, { refetchQueries: [
|
|
5
6
|
"GetFolders",
|
|
6
7
|
"GetFiles",
|
|
7
8
|
"GetRecentFiles"
|
|
8
9
|
] });
|
|
9
10
|
return {
|
|
10
|
-
mutateAsync: async ({ folderId: e, newName:
|
|
11
|
+
mutateAsync: async ({ folderId: e, newName: t }) => (await n({ variables: {
|
|
11
12
|
id: e,
|
|
12
|
-
input: { name:
|
|
13
|
+
input: { name: t }
|
|
13
14
|
} })).data?.updateFolder,
|
|
14
|
-
isPending:
|
|
15
|
-
error:
|
|
15
|
+
isPending: r,
|
|
16
|
+
error: i
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
//#endregion
|
|
19
|
-
export {
|
|
20
|
+
export { n as useRenameFolder };
|
|
20
21
|
|
|
21
22
|
//# sourceMappingURL=useRenameFolder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRenameFolder.js","names":[],"sources":["../../../src/files/hooks/useRenameFolder.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useRenameFolder.js","names":["useRenameFolder","updateFolderMutation","useMutation","UpdateFolderDocument","folderId","newName","loading"],"sources":["../../../src/files/hooks/useRenameFolder.ts"],"sourcesContent":["import { useMutation } from \"@apollo/client/react\";\nimport { UpdateFolderDocument } from \"../../generated/wspace-operations\";\n\nexport interface RenameFolderInput {\n folderId: string;\n newName: string;\n}\n\nexport const useRenameFolder = () => {\n const [updateFolderMutation, { loading, error }] = useMutation(\n UpdateFolderDocument,\n {\n refetchQueries: [\"GetFolders\", \"GetFiles\", \"GetRecentFiles\"],\n },\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":";;;AAQA,IAAaA,UAAwB;CACnC,IAAM,CAACC,GAAsB,EAAE,YAAS,cAAWC,EACjDC,GACA,EACE,gBAAgB;EAAC;EAAc;EAAY;CAAgB,EAC7D,CACF;CAEA,OAAO;EACL,aAAa,OAAO,EAAE,aAAU,kBAOvB,MANcF,EAAqB,EACxC,WAAW;GACT,IAAIG;GACJ,OAAO,EAAE,MAAMC,EAAQ;EACzB,EACF,CAAC,EAAA,CACa,MAAM;EAEtB,WAAWC;EACX;CACF;AACF"}
|
|
@@ -2,7 +2,28 @@ export interface RestoreFileInput {
|
|
|
2
2
|
id: string;
|
|
3
3
|
}
|
|
4
4
|
export declare const useRestoreFile: () => {
|
|
5
|
-
mutateAsync: ({ id }: RestoreFileInput) => Promise<
|
|
5
|
+
mutateAsync: ({ id }: RestoreFileInput) => Promise<{
|
|
6
|
+
id: string;
|
|
7
|
+
workspaceId: string;
|
|
8
|
+
folderId: string | null;
|
|
9
|
+
status: import('../../generated/wspace-types').FileStatus;
|
|
10
|
+
canRead: boolean | null;
|
|
11
|
+
canUpdate: boolean | null;
|
|
12
|
+
canDelete: boolean | null;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string | null;
|
|
15
|
+
mimeType: string;
|
|
16
|
+
extension: string;
|
|
17
|
+
size: string;
|
|
18
|
+
downloadUrl: string | null;
|
|
19
|
+
visibility: import('../../generated/wspace-types').FileVisibility;
|
|
20
|
+
starred: boolean;
|
|
21
|
+
downloadCount: number;
|
|
22
|
+
viewCount: number;
|
|
23
|
+
uploadedById: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
} | undefined>;
|
|
6
27
|
isPending: boolean;
|
|
7
28
|
error: import('@apollo/client').ErrorLike | undefined;
|
|
8
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRestoreFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRestoreFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRestoreFile.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRestoreFile.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,cAAc;0BAgBK,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;CAS/C,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RestoreFileDocument as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { useMutation as t } from "@apollo/client/react";
|
|
2
3
|
//#region src/files/hooks/useRestoreFile.ts
|
|
3
|
-
var
|
|
4
|
-
let [
|
|
4
|
+
var n = () => {
|
|
5
|
+
let [n, { loading: r, error: i }] = t(e, { refetchQueries: [
|
|
5
6
|
"GetFiles",
|
|
6
7
|
"GetFolders",
|
|
7
8
|
"GetBinFiles",
|
|
@@ -10,12 +11,12 @@ var t = () => {
|
|
|
10
11
|
"GetStarredFiles"
|
|
11
12
|
] });
|
|
12
13
|
return {
|
|
13
|
-
mutateAsync: async ({ id: e }) => (await
|
|
14
|
-
isPending:
|
|
15
|
-
error:
|
|
14
|
+
mutateAsync: async ({ id: e }) => (await n({ variables: { id: e } })).data?.restoreFile,
|
|
15
|
+
isPending: r,
|
|
16
|
+
error: i
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
//#endregion
|
|
19
|
-
export {
|
|
20
|
+
export { n as useRestoreFile };
|
|
20
21
|
|
|
21
22
|
//# sourceMappingURL=useRestoreFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRestoreFile.js","names":[],"sources":["../../../src/files/hooks/useRestoreFile.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useRestoreFile.js","names":["useRestoreFile","restoreFileMutation","useMutation","RestoreFileDocument","loading"],"sources":["../../../src/files/hooks/useRestoreFile.ts"],"sourcesContent":["import { useMutation } from \"@apollo/client/react\";\nimport { RestoreFileDocument } from \"../../generated/wspace-operations\";\n\nexport interface RestoreFileInput {\n id: string;\n}\n\nexport const useRestoreFile = () => {\n const [restoreFileMutation, { loading, error }] = useMutation(\n RestoreFileDocument,\n {\n refetchQueries: [\n \"GetFiles\",\n \"GetFolders\",\n \"GetBinFiles\",\n \"GetBinFolders\",\n \"GetRecentFiles\",\n \"GetStarredFiles\",\n ],\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":";;;AAOA,IAAaA,UAAuB;CAClC,IAAM,CAACC,GAAqB,EAAE,YAAS,cAAWC,EAChDC,GACA,EACE,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACA;CACF,EACF,CACF;CAEA,OAAO;EACL,aAAa,OAAO,EAAE,aAIb,MAHcF,EAAoB,EACvC,WAAW,EAAE,MAAG,EAClB,CAAC,EAAA,CACa,MAAM;EAEtB,WAAWG;EACX;CACF;AACF"}
|
|
@@ -2,7 +2,28 @@ export interface RestoreFolderInput {
|
|
|
2
2
|
id: string;
|
|
3
3
|
}
|
|
4
4
|
export declare const useRestoreFolder: () => {
|
|
5
|
-
mutateAsync: ({ id }: RestoreFolderInput) => Promise<
|
|
5
|
+
mutateAsync: ({ id }: RestoreFolderInput) => Promise<{
|
|
6
|
+
id: string;
|
|
7
|
+
workspaceId: string;
|
|
8
|
+
parentFolderId: string | null;
|
|
9
|
+
status: import('../../generated/wspace-types').FolderStatus;
|
|
10
|
+
canRead: boolean | null;
|
|
11
|
+
canUpdate: boolean | null;
|
|
12
|
+
canDelete: boolean | null;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string | null;
|
|
15
|
+
path: string;
|
|
16
|
+
level: number;
|
|
17
|
+
visibility: import('../../generated/wspace-types').FileVisibility;
|
|
18
|
+
color: string | null;
|
|
19
|
+
icon: string | null;
|
|
20
|
+
starred: boolean;
|
|
21
|
+
filesCount: number | null;
|
|
22
|
+
subfoldersCount: number | null;
|
|
23
|
+
createdById: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
} | undefined>;
|
|
6
27
|
isPending: boolean;
|
|
7
28
|
error: import('@apollo/client').ErrorLike | undefined;
|
|
8
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRestoreFolder.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRestoreFolder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRestoreFolder.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useRestoreFolder.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,gBAAgB;0BAgBG,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;CASjD,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RestoreFolderDocument as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { useMutation as t } from "@apollo/client/react";
|
|
2
3
|
//#region src/files/hooks/useRestoreFolder.ts
|
|
3
|
-
var
|
|
4
|
-
let [
|
|
4
|
+
var n = () => {
|
|
5
|
+
let [n, { loading: r, error: i }] = t(e, { refetchQueries: [
|
|
5
6
|
"GetFiles",
|
|
6
7
|
"GetFolders",
|
|
7
8
|
"GetBinFiles",
|
|
@@ -10,12 +11,12 @@ var t = () => {
|
|
|
10
11
|
"GetStarredFolders"
|
|
11
12
|
] });
|
|
12
13
|
return {
|
|
13
|
-
mutateAsync: async ({ id: e }) => (await
|
|
14
|
-
isPending:
|
|
15
|
-
error:
|
|
14
|
+
mutateAsync: async ({ id: e }) => (await n({ variables: { id: e } })).data?.restoreFolder,
|
|
15
|
+
isPending: r,
|
|
16
|
+
error: i
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
//#endregion
|
|
19
|
-
export {
|
|
20
|
+
export { n as useRestoreFolder };
|
|
20
21
|
|
|
21
22
|
//# sourceMappingURL=useRestoreFolder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRestoreFolder.js","names":[],"sources":["../../../src/files/hooks/useRestoreFolder.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useRestoreFolder.js","names":["useRestoreFolder","restoreFolderMutation","useMutation","RestoreFolderDocument","loading"],"sources":["../../../src/files/hooks/useRestoreFolder.ts"],"sourcesContent":["import { useMutation } from \"@apollo/client/react\";\nimport { RestoreFolderDocument } from \"../../generated/wspace-operations\";\n\nexport interface RestoreFolderInput {\n id: string;\n}\n\nexport const useRestoreFolder = () => {\n const [restoreFolderMutation, { loading, error }] = useMutation(\n RestoreFolderDocument,\n {\n refetchQueries: [\n \"GetFiles\",\n \"GetFolders\",\n \"GetBinFiles\",\n \"GetBinFolders\",\n \"GetRecentFiles\",\n \"GetStarredFolders\",\n ],\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":";;;AAOA,IAAaA,UAAyB;CACpC,IAAM,CAACC,GAAuB,EAAE,YAAS,cAAWC,EAClDC,GACA,EACE,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACA;CACF,EACF,CACF;CAEA,OAAO;EACL,aAAa,OAAO,EAAE,aAIb,MAHcF,EAAsB,EACzC,WAAW,EAAE,MAAG,EAClB,CAAC,EAAA,CACa,MAAM;EAEtB,WAAWG;EACX;CACF;AACF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FileItem, FolderItem } from '../types';
|
|
2
1
|
import { FileFilterInput, FolderFilterInput } from '../graphql-types';
|
|
3
2
|
export interface SearchFilters {
|
|
4
3
|
fileFilter?: FileFilterInput;
|
|
@@ -6,8 +5,8 @@ export interface SearchFilters {
|
|
|
6
5
|
}
|
|
7
6
|
export declare const useSearch: (query: string, enabled?: boolean, filters?: SearchFilters) => {
|
|
8
7
|
data: {
|
|
9
|
-
files: FileItem[];
|
|
10
|
-
folders: FolderItem[];
|
|
8
|
+
files: import('..').FileItem[];
|
|
9
|
+
folders: import('..').FolderItem[];
|
|
11
10
|
};
|
|
12
11
|
isLoading: boolean;
|
|
13
12
|
error: import('@apollo/client').ErrorLike | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useSearch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useSearch.ts"],"names":[],"mappings":"AAIA,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;;;;;;;CAyBxB,CAAC"}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import { useFilesContext as e } from "../providers/FilesProvider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { fileViewModel as t, folderViewModel as n } from "../utils/fileViewModel.js";
|
|
3
|
+
import { SearchFilesPageDocument as r } from "../../generated/wspace-operations.js";
|
|
4
|
+
import { useQuery as i } from "@apollo/client/react";
|
|
3
5
|
//#region src/files/hooks/useSearch.ts
|
|
4
|
-
var
|
|
5
|
-
let { workspaceId:
|
|
6
|
+
var a = (a, o = !0, s) => {
|
|
7
|
+
let { workspaceId: c } = e(), l = !o || !c || a.length < 2, u = i(r, {
|
|
6
8
|
variables: {
|
|
7
|
-
query:
|
|
8
|
-
fileFilter:
|
|
9
|
-
folderFilter:
|
|
9
|
+
query: a,
|
|
10
|
+
fileFilter: s?.fileFilter,
|
|
11
|
+
folderFilter: s?.folderFilter,
|
|
10
12
|
filePagination: { limit: 50 },
|
|
11
13
|
folderPagination: { limit: 50 }
|
|
12
14
|
},
|
|
13
|
-
skip:
|
|
15
|
+
skip: l
|
|
14
16
|
});
|
|
15
17
|
return {
|
|
16
18
|
data: {
|
|
17
|
-
files:
|
|
18
|
-
folders:
|
|
19
|
+
files: u.data?.searchFiles?.files.map(t) || [],
|
|
20
|
+
folders: u.data?.searchFolders?.folders.map(n) || []
|
|
19
21
|
},
|
|
20
|
-
isLoading:
|
|
21
|
-
error:
|
|
22
|
+
isLoading: u.loading,
|
|
23
|
+
error: u.error ?? null
|
|
22
24
|
};
|
|
23
25
|
};
|
|
24
26
|
//#endregion
|
|
25
|
-
export {
|
|
27
|
+
export { a as useSearch };
|
|
26
28
|
|
|
27
29
|
//# sourceMappingURL=useSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.js","names":[],"sources":["../../../src/files/hooks/useSearch.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useSearch.js","names":["useSearch","useFilesContext","skip","enabled","workspaceId","query","queryResult","useQuery","SearchFilesPageDocument","filters","fileViewModel","folderViewModel"],"sources":["../../../src/files/hooks/useSearch.ts"],"sourcesContent":["import { fileViewModel, folderViewModel } from \"../utils/fileViewModel\";\nimport { useQuery } from \"@apollo/client/react\";\nimport { SearchFilesPageDocument } from \"../../generated/wspace-operations\";\nimport { useFilesContext } from \"../providers/FilesProvider\";\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 = useQuery(SearchFilesPageDocument, {\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.map(fileViewModel) || [],\n folders:\n queryResult.data?.searchFolders?.folders.map(folderViewModel) || [],\n },\n isLoading: queryResult.loading,\n error: queryResult.error ?? null,\n };\n};\n"],"mappings":";;;;;AAWA,IAAaA,KACX,GACA,IAAmB,IACnB,MACG;CACH,IAAM,EAAE,mBAAgBC,EAAgB,GAClCC,IAAO,CAACC,KAAW,CAACC,KAAeC,EAAM,SAAS,GAElDC,IAAcC,EAASC,GAAyB;EACpD,WAAW;GACT;GACA,YAAYC,GAAS;GACrB,cAAcA,GAAS;GACvB,gBAAgB,EAAE,OAAO,GAAG;GAC5B,kBAAkB,EAAE,OAAO,GAAG;EAChC;EACA;CACF,CAAC;CAED,OAAO;EACL,MAAM;GACJ,OAAOH,EAAY,MAAM,aAAa,MAAM,IAAII,CAAa,KAAK,CAAC;GACnE,SACEJ,EAAY,MAAM,eAAe,QAAQ,IAAIK,CAAe,KAAK,CAAC;EACtE;EACA,WAAWL,EAAY;EACvB,OAAOA,EAAY,SAAS;CAC9B;AACF"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { FileItem, FolderItem } from '../types';
|
|
2
1
|
export declare const useStarredItems: (options?: {
|
|
3
2
|
skip?: boolean;
|
|
4
3
|
}) => {
|
|
5
|
-
files: FileItem[];
|
|
6
|
-
folders: FolderItem[];
|
|
4
|
+
files: import('..').FileItem[];
|
|
5
|
+
folders: import('..').FolderItem[];
|
|
7
6
|
isLoading: boolean;
|
|
8
7
|
error: import('@apollo/client').ErrorLike | null;
|
|
9
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStarredItems.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useStarredItems.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useStarredItems.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useStarredItems.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE;;;;;CAsB3D,CAAC"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fileViewModel as e, folderViewModel as t } from "../utils/fileViewModel.js";
|
|
2
|
+
import { GetFilesStarredPageDocument as n } from "../../generated/wspace-operations.js";
|
|
3
|
+
import { useQuery as r } from "@apollo/client/react";
|
|
2
4
|
//#region src/files/hooks/useStarredItems.ts
|
|
3
|
-
var
|
|
4
|
-
let
|
|
5
|
+
var i = (i) => {
|
|
6
|
+
let a = r(n, {
|
|
5
7
|
variables: { pagination: { limit: 100 } },
|
|
6
|
-
skip:
|
|
8
|
+
skip: i?.skip,
|
|
7
9
|
errorPolicy: "all"
|
|
8
|
-
}),
|
|
10
|
+
}), o = (a.error?.message ?? "").includes("FEATURE_DISABLED");
|
|
9
11
|
return {
|
|
10
|
-
files:
|
|
11
|
-
folders:
|
|
12
|
-
isLoading:
|
|
13
|
-
error:
|
|
12
|
+
files: a.data?.getStarredFiles?.files.map(e) || [],
|
|
13
|
+
folders: a.data?.getStarredFolders?.folders.map(t) || [],
|
|
14
|
+
isLoading: a.loading,
|
|
15
|
+
error: o ? null : a.error ?? null
|
|
14
16
|
};
|
|
15
17
|
};
|
|
16
18
|
//#endregion
|
|
17
|
-
export {
|
|
19
|
+
export { i as useStarredItems };
|
|
18
20
|
|
|
19
21
|
//# sourceMappingURL=useStarredItems.js.map
|
|
@@ -1 +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 {
|
|
1
|
+
{"version":3,"file":"useStarredItems.js","names":["useStarredItems","query","useQuery","GetFilesStarredPageDocument","options","isFeatureDisabled","fileViewModel","folderViewModel"],"sources":["../../../src/files/hooks/useStarredItems.ts"],"sourcesContent":["import { fileViewModel, folderViewModel } from \"../utils/fileViewModel\";\n/**\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 { useQuery } from \"@apollo/client/react\";\nimport { GetFilesStarredPageDocument } from \"../../generated/wspace-operations\";\n\nexport const useStarredItems = (options?: { skip?: boolean }) => {\n const query = useQuery(GetFilesStarredPageDocument, {\n variables: {\n pagination: { limit: 100 },\n },\n skip: options?.skip,\n errorPolicy: \"all\",\n });\n\n // ApolloError serialises all graphQL error messages into its top-level\n // message, so checking for the code string is a reliable way to detect\n // FEATURE_DISABLED without depending on Apollo 4's restricted ErrorLike type.\n const isFeatureDisabled = (query.error?.message ?? \"\").includes(\n \"FEATURE_DISABLED\",\n );\n\n return {\n files: query.data?.getStarredFiles?.files.map(fileViewModel) || [],\n folders: query.data?.getStarredFolders?.folders.map(folderViewModel) || [],\n isLoading: query.loading,\n error: isFeatureDisabled ? null : (query.error ?? null),\n };\n};\n"],"mappings":";;;;AAWA,IAAaA,KAAmB,MAAiC;CAC/D,IAAMC,IAAQC,EAASC,GAA6B;EAClD,WAAW,EACT,YAAY,EAAE,OAAO,IAAI,EAC3B;EACA,MAAMC,GAAS;EACf,aAAa;CACf,CAAC,GAKKC,KAAqBJ,EAAM,OAAO,WAAW,GAAA,CAAI,SACrD,kBACF;CAEA,OAAO;EACL,OAAOA,EAAM,MAAM,iBAAiB,MAAM,IAAIK,CAAa,KAAK,CAAC;EACjE,SAASL,EAAM,MAAM,mBAAmB,QAAQ,IAAIM,CAAe,KAAK,CAAC;EACzE,WAAWN,EAAM;EACjB,OAAOI,IAAoB,OAAQJ,EAAM,SAAS;CACpD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStorageQuota.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useStorageQuota.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useStorageQuota.d.ts","sourceRoot":"","sources":["../../../src/files/hooks/useStorageQuota.ts"],"names":[],"mappings":"AAMA,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,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetWorkspaceStorageStatusDocument as e } from "../../generated/wspace-operations.js";
|
|
2
2
|
import { useMemo as t } from "react";
|
|
3
|
+
import { useQuery as n } from "@apollo/client/react";
|
|
3
4
|
//#region src/files/hooks/useStorageQuota.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
let { data:
|
|
7
|
-
variables: { workspaceId:
|
|
8
|
-
skip: !
|
|
5
|
+
var r = "platform.files.storage_bytes";
|
|
6
|
+
function i(i) {
|
|
7
|
+
let { data: a, loading: o } = n(e, {
|
|
8
|
+
variables: { workspaceId: i },
|
|
9
|
+
skip: !i,
|
|
9
10
|
pollInterval: 6e4
|
|
10
11
|
});
|
|
11
12
|
return t(() => {
|
|
12
|
-
let e =
|
|
13
|
+
let e = a?.workspaceQuotaStatuses.find((e) => e.quotaName === r);
|
|
13
14
|
if (!e) return {
|
|
14
15
|
usedBytes: 0,
|
|
15
16
|
limitBytes: null,
|
|
@@ -17,21 +18,21 @@ function r(r) {
|
|
|
17
18
|
usedPercent: 0,
|
|
18
19
|
isExhausted: !1,
|
|
19
20
|
isNearLimit: !1,
|
|
20
|
-
loading:
|
|
21
|
+
loading: o
|
|
21
22
|
};
|
|
22
|
-
let t = e.currentValue,
|
|
23
|
+
let t = e.currentValue, n = e.noLimit ? null : e.limit ?? null, i = n && n > 0 ? Math.min(100, t / n * 100) : 0;
|
|
23
24
|
return {
|
|
24
25
|
usedBytes: t,
|
|
25
|
-
limitBytes:
|
|
26
|
+
limitBytes: n,
|
|
26
27
|
noLimit: e.noLimit,
|
|
27
|
-
usedPercent:
|
|
28
|
-
isExhausted: !e.noLimit && t >= (
|
|
29
|
-
isNearLimit: !e.noLimit &&
|
|
30
|
-
loading:
|
|
28
|
+
usedPercent: i,
|
|
29
|
+
isExhausted: !e.noLimit && t >= (n ?? Infinity),
|
|
30
|
+
isNearLimit: !e.noLimit && i >= 80,
|
|
31
|
+
loading: o
|
|
31
32
|
};
|
|
32
|
-
}, [
|
|
33
|
+
}, [a, o]);
|
|
33
34
|
}
|
|
34
35
|
//#endregion
|
|
35
|
-
export {
|
|
36
|
+
export { i as useStorageQuota };
|
|
36
37
|
|
|
37
38
|
//# sourceMappingURL=useStorageQuota.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStorageQuota.js","names":[],"sources":["../../../src/files/hooks/useStorageQuota.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"useStorageQuota.js","names":["STORAGE_QUOTA_NAME","useStorageQuota","useQuery","GetWorkspaceStorageStatusDocument","workspaceId","useMemo","status","data","s","usedBytes","limitBytes","usedPercent","loading"],"sources":["../../../src/files/hooks/useStorageQuota.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useQuery } from \"@apollo/client/react\";\nimport { GetWorkspaceStorageStatusDocument } 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 } = useQuery(GetWorkspaceStorageStatusDocument, {\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":";;;;AAIA,IAAMA,IAAqB;AAY3B,SAAgBC,EAAgB,GAAwC;CACtE,IAAM,EAAE,SAAM,eAAYC,EAASC,GAAmC;EACpE,WAAW,EAAE,eAAY;EACzB,MAAM,CAACC;EACP,cAAc;CAChB,CAAC;CAED,OAAOC,QAAc;EACnB,IAAMC,IAASC,GAAM,uBAAuB,MACzC,MAA6BC,EAAE,cAAcR,CAChD;EAEA,IAAI,CAACM,GACH,OAAO;GACL,WAAW;GACX,YAAY;GACZ,SAAS;GACT,aAAa;GACb,aAAa;GACb,aAAa;GACb;EACF;EAGF,IAAMG,IAAYH,EAAO,cACnBI,IAAaJ,EAAO,UAAU,OAAQA,EAAO,SAAS,MACtDK,IACJD,KAAcA,IAAa,IACvB,KAAK,IAAI,KAAMD,IAAYC,IAAc,GAAG,IAC5C;EAEN,OAAO;GACL;GACA;GACA,SAASJ,EAAO;GAChB;GACA,aAAa,CAACA,EAAO,WAAWG,MAAcC,KAAc;GAC5D,aAAa,CAACJ,EAAO,WAAWK,KAAe;GAC/C;EACF;CACF,GAAG,CAACJ,GAAMK,CAAO,CAAC;AACpB"}
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"useToast.js","names":["useToast","toasts","setToasts","useState","addToast","useCallback","id","toast","prev","message","duration"],"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,SAAgBA,IAAW;CACzB,IAAM,CAACC,GAAQC,KAAaC,EAAkB,CAAC,CAAC,GAE1CC,IAAWC,GACd,GAAiB,GAAiB,MAAsB;EACvD,IAAMC,IAAK,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,GAC3CC,IAAe;GAAE;GAAI;GAAM;GAAS;EAAS;EAEnD,OADAL,GAAW,MAAS,CAAC,GAAGM,GAAMD,CAAK,CAAC,GAC7BD;CACT,GACA,CAAC,CACH;CA6BA,OAAO;EACL;EACA;EACA,aA9BkBD,GAAa,MAAe;GAC9C,GAAW,MAASG,EAAK,QAAQ,MAAUD,EAAM,OAAOD,CAAE,CAAC;EAC7D,GAAG,CAAC,CA4BF;EACA,SA3BcD,GACb,GAAiB,MAChBD,EAAS,WAAWK,GAASC,CAAQ,GACvC,CAACN,CAAQ,CAwBT;EACA,OAtBYC,GACX,GAAiB,MAChBD,EAAS,SAASK,GAASC,CAAQ,GACrC,CAACN,CAAQ,CAmBT;EACA,SAjBcC,GACb,GAAiB,MAChBD,EAAS,WAAWK,GAASC,CAAQ,GACvC,CAACN,CAAQ,CAcT;EACA,MAZWC,GACV,GAAiB,MAAsBD,EAAS,QAAQK,GAASC,CAAQ,GAC1E,CAACN,CAAQ,CAUT;CACF;AACF"}
|
|
@@ -3,7 +3,49 @@ export interface ToggleStarInput {
|
|
|
3
3
|
type: "file" | "folder";
|
|
4
4
|
}
|
|
5
5
|
export declare const useToggleStar: () => {
|
|
6
|
-
mutateAsync: ({ id, type }: ToggleStarInput) => Promise<
|
|
6
|
+
mutateAsync: ({ id, type }: ToggleStarInput) => Promise<{
|
|
7
|
+
id: string;
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
folderId: string | null;
|
|
10
|
+
status: import('../../generated/wspace-types').FileStatus;
|
|
11
|
+
canRead: boolean | null;
|
|
12
|
+
canUpdate: boolean | null;
|
|
13
|
+
canDelete: boolean | null;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
mimeType: string;
|
|
17
|
+
extension: string;
|
|
18
|
+
size: string;
|
|
19
|
+
downloadUrl: string | null;
|
|
20
|
+
visibility: import('../../generated/wspace-types').FileVisibility;
|
|
21
|
+
starred: boolean;
|
|
22
|
+
downloadCount: number;
|
|
23
|
+
viewCount: number;
|
|
24
|
+
uploadedById: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
} | {
|
|
28
|
+
id: string;
|
|
29
|
+
workspaceId: string;
|
|
30
|
+
parentFolderId: string | null;
|
|
31
|
+
status: import('../../generated/wspace-types').FolderStatus;
|
|
32
|
+
canRead: boolean | null;
|
|
33
|
+
canUpdate: boolean | null;
|
|
34
|
+
canDelete: boolean | null;
|
|
35
|
+
name: string;
|
|
36
|
+
description: string | null;
|
|
37
|
+
path: string;
|
|
38
|
+
level: number;
|
|
39
|
+
visibility: import('../../generated/wspace-types').FileVisibility;
|
|
40
|
+
color: string | null;
|
|
41
|
+
icon: string | null;
|
|
42
|
+
starred: boolean;
|
|
43
|
+
filesCount: number | null;
|
|
44
|
+
subfoldersCount: number | null;
|
|
45
|
+
createdById: string;
|
|
46
|
+
createdAt: string;
|
|
47
|
+
updatedAt: string;
|
|
48
|
+
} | undefined>;
|
|
7
49
|
isPending: boolean;
|
|
8
50
|
error: import('@apollo/client').ErrorLike | undefined;
|
|
9
51
|
};
|