@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,102 +1,102 @@
|
|
|
1
1
|
import { useFilesContext as e } from "../providers/FilesProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
2
|
+
import { useUploadQueueState as t } from "../hooks/useUploadQueueState.js";
|
|
3
|
+
import { fileViewModel as n, folderViewModel as r } from "../utils/fileViewModel.js";
|
|
4
|
+
import { useFilesStore as i } from "../store/filesStore.js";
|
|
5
|
+
import { useKeyboardNavigation as ee } from "../hooks/useKeyboardNavigation.js";
|
|
6
|
+
import { useBrowsePage as te } from "../hooks/useBrowsePage.js";
|
|
7
|
+
import { useRecentFiles as ne } from "../hooks/useRecentFiles.js";
|
|
8
|
+
import { useStarredItems as re } from "../hooks/useStarredItems.js";
|
|
9
|
+
import { useBinItems as ie } from "../hooks/useBinItems.js";
|
|
10
|
+
import { useCreateFolder as ae } from "../hooks/useCreateFolder.js";
|
|
11
|
+
import { isQuotaExhaustedError as oe } from "../utils/quotaUtils.js";
|
|
12
|
+
import { useUploadFile as se } from "../hooks/useUploadFile.js";
|
|
13
|
+
import { useDeleteFile as ce } from "../hooks/useDeleteFile.js";
|
|
14
|
+
import { useDeleteFolder as le } from "../hooks/useDeleteFolder.js";
|
|
15
|
+
import { useRestoreFile as ue } from "../hooks/useRestoreFile.js";
|
|
16
|
+
import { useRestoreFolder as de } from "../hooks/useRestoreFolder.js";
|
|
17
|
+
import { usePermanentlyDeleteFile as fe } from "../hooks/usePermanentlyDeleteFile.js";
|
|
18
|
+
import { usePermanentlyDeleteFolder as pe } from "../hooks/usePermanentlyDeleteFolder.js";
|
|
19
|
+
import { useToggleStar as me } from "../hooks/useToggleStar.js";
|
|
20
|
+
import { useRenameFile as he } from "../hooks/useRenameFile.js";
|
|
21
|
+
import { useRenameFolder as ge } from "../hooks/useRenameFolder.js";
|
|
22
|
+
import { useCreateShare as _e } from "../hooks/useCreateShare.js";
|
|
23
|
+
import { useCreateFolderShare as ve } from "../hooks/useCreateFolderShare.js";
|
|
24
|
+
import { useCopyFile as ye } from "../hooks/useCopyFile.js";
|
|
25
|
+
import { useMoveFile as be } from "../hooks/useMoveFile.js";
|
|
26
|
+
import { useMoveFolder as xe } from "../hooks/useMoveFolder.js";
|
|
27
|
+
import { useBulkDelete as Se } from "../hooks/useBatchOperations.js";
|
|
28
|
+
import { useSearch as Ce } from "../hooks/useSearch.js";
|
|
29
|
+
import { useToast as we } from "../hooks/useToast.js";
|
|
30
|
+
import { generateThumbnail as Te } from "../utils/thumbnail.js";
|
|
29
31
|
import "../utils/index.js";
|
|
30
32
|
import { tWithFallback as a } from "../utils/i18n.js";
|
|
31
|
-
import { FileBrowser as
|
|
32
|
-
import { TabBar as
|
|
33
|
-
import { ShareDialog as
|
|
34
|
-
import { FilePreviewModal as
|
|
35
|
-
import { FileInfoPanel as
|
|
36
|
-
import { EmptyState as
|
|
37
|
-
import { ToastContainer as
|
|
38
|
-
import { SearchBar as
|
|
39
|
-
import { MoveDialog as
|
|
40
|
-
import { CopyDialog as
|
|
41
|
-
import { ConfirmDialog as
|
|
42
|
-
import { UploadQueue as
|
|
43
|
-
import { StorageBanner as
|
|
44
|
-
import { useStorageQuota as
|
|
45
|
-
import { nativeImpact as
|
|
46
|
-
import { emitFilesEvent as
|
|
47
|
-
import { useEffect as
|
|
48
|
-
import { FolderPlus as
|
|
49
|
-
import { Fragment as
|
|
50
|
-
import { useNavigate as
|
|
51
|
-
import { useI18n as
|
|
52
|
-
import { AuroraBackground as
|
|
33
|
+
import { FileBrowser as Ee } from "../components/FileBrowser.js";
|
|
34
|
+
import { TabBar as De } from "../components/TabBar.js";
|
|
35
|
+
import { ShareDialog as Oe } from "../components/ShareDialog.js";
|
|
36
|
+
import { FilePreviewModal as ke } from "../components/FilePreviewModal.js";
|
|
37
|
+
import { FileInfoPanel as Ae } from "../components/FileInfoPanel.js";
|
|
38
|
+
import { EmptyState as je } from "../components/EmptyState.js";
|
|
39
|
+
import { ToastContainer as Me } from "../components/Toast.js";
|
|
40
|
+
import { SearchBar as Ne } from "../components/SearchBar.js";
|
|
41
|
+
import { MoveDialog as Pe } from "../components/MoveDialog.js";
|
|
42
|
+
import { CopyDialog as Fe } from "../components/CopyDialog.js";
|
|
43
|
+
import { ConfirmDialog as Ie } from "../components/ConfirmDialog.js";
|
|
44
|
+
import { UploadQueue as Le } from "../components/UploadQueue.js";
|
|
45
|
+
import { StorageBanner as Re } from "../components/StorageBanner.js";
|
|
46
|
+
import { useStorageQuota as ze } from "../hooks/useStorageQuota.js";
|
|
47
|
+
import { nativeImpact as Be, nativeNotify as Ve, nativeOpenUrl as He } from "../../utils/nativeBridge.js";
|
|
48
|
+
import { emitFilesEvent as Ue } from "../utils/events.js";
|
|
49
|
+
import { useEffect as We, useMemo as Ge, useState as o } from "react";
|
|
50
|
+
import { FolderPlus as Ke, FolderUp as qe, FolderX as Je, Grid3x3 as Ye, Home as Xe, List as Ze, Loader2 as s, Star as Qe, Trash2 as $e, Upload as et, X as tt } from "lucide-react";
|
|
51
|
+
import { Fragment as nt, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
52
|
+
import { useNavigate as rt, useParams as it } from "react-router";
|
|
53
|
+
import { useI18n as at } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
54
|
+
import { AuroraBackground as ot, Button as u, CTAOverflowMenu as st, EmphasisPanel as ct, GradientText as lt, IllustratedEmptyState as ut, Input as dt, NextSteps as ft, PagePurpose as pt, ResponsiveDialog as mt, ResponsiveDialogContent as ht, ResponsiveDialogFooter as gt, ResponsiveDialogHeader as _t, ResponsiveDialogTitle as vt } from "@burdenoff/fe-libs/ui";
|
|
53
55
|
//#region src/files/pages/BrowserPage.tsx
|
|
54
56
|
function d() {
|
|
55
|
-
let { t: d } =
|
|
57
|
+
let { t: d } = at(), { folderId: f } = it(), p = rt(), yt = e(), { workspaceId: m } = yt, bt = ze(m ?? ""), { viewMode: xt, setViewMode: St, breadcrumbs: Ct, selectedFiles: h, selectedFolders: g, clearSelection: _ } = i(), [v, y] = o("all"), wt = Ge(() => [
|
|
56
58
|
"all",
|
|
57
59
|
"recent",
|
|
58
60
|
"starred",
|
|
59
61
|
"bin"
|
|
60
62
|
], []);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
-
let [
|
|
63
|
+
We(() => {
|
|
64
|
+
wt.includes(v) || y("all");
|
|
65
|
+
}, [wt, v]);
|
|
66
|
+
let [b, Tt] = o(""), [Et, Dt] = o(), x = b.trim().length >= 2, [Ot, kt] = o(null), [S, At] = o(null), C = we(), w = te({
|
|
65
67
|
folderId: f || void 0,
|
|
66
68
|
pageSize: 100,
|
|
67
|
-
skip:
|
|
68
|
-
}),
|
|
69
|
-
|
|
70
|
-
if (f &&
|
|
71
|
-
let e =
|
|
69
|
+
skip: v !== "all" || x
|
|
70
|
+
}), T = ne({ skip: v !== "recent" || x }), E = re({ skip: v !== "starred" || x }), D = ie({ skip: v !== "bin" || x }), O = Ce(b, x, Et);
|
|
71
|
+
We(() => {
|
|
72
|
+
if (f && w.data?.folderPath && w.data?.currentFolder) {
|
|
73
|
+
let e = w.data.folderPath.folders || [], t = w.data.currentFolder, n = [...e.map((e) => ({
|
|
72
74
|
id: e.id,
|
|
73
75
|
name: e.name
|
|
74
76
|
})), {
|
|
75
|
-
id:
|
|
76
|
-
name:
|
|
77
|
+
id: t.id,
|
|
78
|
+
name: t.name
|
|
77
79
|
}];
|
|
78
|
-
|
|
79
|
-
} else
|
|
80
|
-
}, [f,
|
|
81
|
-
let
|
|
82
|
-
if (
|
|
83
|
-
else switch (
|
|
80
|
+
i.getState().setBreadcrumbs(n);
|
|
81
|
+
} else i.getState().setBreadcrumbs([]);
|
|
82
|
+
}, [f, w.data]);
|
|
83
|
+
let k = [], A = [], j = !1, M = null, N = !1;
|
|
84
|
+
if (x && O.data) k = O.data.files || [], A = O.data.folders || [], j = O.isLoading, M = O.error;
|
|
85
|
+
else switch (v) {
|
|
84
86
|
case "all":
|
|
85
|
-
|
|
87
|
+
k = w.data?.filesList?.files.map(n) || [], A = w.data?.foldersList?.folders.map(r) || [], j = w.loading, M = w.error || null, N = !1;
|
|
86
88
|
break;
|
|
87
89
|
case "recent":
|
|
88
|
-
|
|
90
|
+
k = T.files || [], A = T.folders || [], j = T.isLoading, M = T.error || null, N = !0;
|
|
89
91
|
break;
|
|
90
92
|
case "starred":
|
|
91
|
-
|
|
92
|
-
break;
|
|
93
|
-
case "bin":
|
|
94
|
-
E = w.files, D = w.folders, O = w.isLoading, k = w.error || null, A = !0;
|
|
93
|
+
k = E.files, A = E.folders, j = E.isLoading, M = E.error || null, N = !0;
|
|
95
94
|
break;
|
|
95
|
+
case "bin": k = D.files, A = D.folders, j = D.isLoading, M = D.error || null, N = !0;
|
|
96
96
|
}
|
|
97
|
-
let jt =
|
|
98
|
-
|
|
99
|
-
},
|
|
97
|
+
let jt = v === "all" ? (w.data?.filesList?.total ?? k.length) + (w.data?.foldersList?.total ?? A.length) : null, P = h.size + g.size, [Mt, F] = o(!1), [Nt, Pt] = o(!1), [Ft, It] = o(!1), [Lt, I] = o(!1), [Rt, L] = o(!1), [zt, R] = o(!1), [Bt, Vt] = o(!1), [Ht, Ut] = o(null), [z, Wt] = o(null), [B, Gt] = o(null), [V, H] = o(null), [U, W] = o(""), [G, K] = o(""), { uploading: Kt, uploadQueue: qt, isUploadPanelOpen: Jt, setUploading: Yt, setUploadQueue: q, setIsUploadPanelOpen: Xt, cancelUpload: Zt } = t(), [J, Y] = o(null), X = (e, t) => {
|
|
98
|
+
Ue(yt, e, t);
|
|
99
|
+
}, Qt = async () => {
|
|
100
100
|
if (!J || J.loading) return;
|
|
101
101
|
let e = J.onConfirm;
|
|
102
102
|
Y({
|
|
@@ -114,13 +114,13 @@ function d() {
|
|
|
114
114
|
loading: !1
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
}, Z =
|
|
117
|
+
}, Z = ae(), $t = se(), en = ce(), tn = le(), nn = ue(), rn = de(), an = fe(), on = pe(), sn = me(), Q = he(), $ = ge(), cn = _e(), ln = ve(), un = ye(), dn = be(), fn = xe(), pn = Se(), mn = () => {
|
|
118
118
|
let e = document.createElement("input");
|
|
119
119
|
e.type = "file", e.multiple = !0, e.onchange = async (e) => {
|
|
120
120
|
let t = e.target.files;
|
|
121
121
|
if (t && t.length > 0) {
|
|
122
122
|
let e = await Promise.all(Array.from(t).map(async (e, t) => {
|
|
123
|
-
let n = await
|
|
123
|
+
let n = await Te(e);
|
|
124
124
|
return {
|
|
125
125
|
id: `${Date.now()}-${t}-${e.name}`,
|
|
126
126
|
file: e,
|
|
@@ -130,12 +130,12 @@ function d() {
|
|
|
130
130
|
thumbnailUrl: n ?? void 0
|
|
131
131
|
};
|
|
132
132
|
}));
|
|
133
|
-
q((t) => [...t, ...e]),
|
|
134
|
-
for (let t of e) await
|
|
135
|
-
|
|
133
|
+
q((t) => [...t, ...e]), Xt(!0), Yt(!0);
|
|
134
|
+
for (let t of e) await hn(t);
|
|
135
|
+
Yt(!1);
|
|
136
136
|
}
|
|
137
137
|
}, e.click();
|
|
138
|
-
},
|
|
138
|
+
}, hn = async (e) => {
|
|
139
139
|
let t = (t) => {
|
|
140
140
|
q((n) => n.map((n) => n.id === e.id ? {
|
|
141
141
|
...n,
|
|
@@ -144,7 +144,7 @@ function d() {
|
|
|
144
144
|
};
|
|
145
145
|
t({ status: "uploading" });
|
|
146
146
|
try {
|
|
147
|
-
let n = await
|
|
147
|
+
let n = await $t.mutateAsync({
|
|
148
148
|
file: e.file,
|
|
149
149
|
folderId: e.folderId,
|
|
150
150
|
onProgress: (e) => {
|
|
@@ -161,7 +161,7 @@ function d() {
|
|
|
161
161
|
});
|
|
162
162
|
} catch (n) {
|
|
163
163
|
let r = n instanceof Error ? n.message : a(d, "files.upload.errors.failed", "Upload failed");
|
|
164
|
-
r === "Upload paused" ? t({ status: "paused" }) :
|
|
164
|
+
r === "Upload paused" ? t({ status: "paused" }) : oe(n) ? (t({
|
|
165
165
|
status: "failed",
|
|
166
166
|
error: a(d, "files.upload.errors.quotaExceeded", "Storage quota exceeded")
|
|
167
167
|
}), It(!0)) : (t({
|
|
@@ -173,30 +173,25 @@ function d() {
|
|
|
173
173
|
message: r
|
|
174
174
|
}));
|
|
175
175
|
}
|
|
176
|
-
},
|
|
177
|
-
|
|
176
|
+
}, gn = (e) => {
|
|
177
|
+
$t.pause(), q((t) => t.map((t) => t.id === e ? {
|
|
178
178
|
...t,
|
|
179
179
|
status: "paused"
|
|
180
180
|
} : t));
|
|
181
|
-
},
|
|
182
|
-
let t =
|
|
183
|
-
t &&
|
|
184
|
-
},
|
|
185
|
-
let t =
|
|
181
|
+
}, _n = (e) => {
|
|
182
|
+
let t = qt.find((t) => t.id === e);
|
|
183
|
+
t && hn(t);
|
|
184
|
+
}, vn = (e) => {
|
|
185
|
+
let t = qt.find((t) => t.id === e);
|
|
186
186
|
t && (q((t) => t.map((t) => t.id === e ? {
|
|
187
187
|
...t,
|
|
188
188
|
status: "pending",
|
|
189
189
|
progress: 0,
|
|
190
190
|
error: void 0
|
|
191
|
-
} : t)),
|
|
192
|
-
},
|
|
193
|
-
q((t) => {
|
|
194
|
-
let n = t.filter((t) => t.id !== e);
|
|
195
|
-
return n.length === 0 && (qt(!1), K(!1)), n;
|
|
196
|
-
});
|
|
197
|
-
}, gn = () => {
|
|
191
|
+
} : t)), hn(t));
|
|
192
|
+
}, yn = Zt, bn = () => {
|
|
198
193
|
if (!m) {
|
|
199
|
-
|
|
194
|
+
C.error(a(d, "files.workspace.errors.notSelected", "Workspace not selected"));
|
|
200
195
|
return;
|
|
201
196
|
}
|
|
202
197
|
let e = document.createElement("input");
|
|
@@ -225,7 +220,7 @@ function d() {
|
|
|
225
220
|
for (let [t, r] of e) {
|
|
226
221
|
let e = t ? n.get(t) : f || void 0;
|
|
227
222
|
for (let t of r) {
|
|
228
|
-
let n = await
|
|
223
|
+
let n = await Te(t);
|
|
229
224
|
i.push({
|
|
230
225
|
id: `${Date.now()}-${ee++}-${t.name}`,
|
|
231
226
|
file: t,
|
|
@@ -236,41 +231,41 @@ function d() {
|
|
|
236
231
|
});
|
|
237
232
|
}
|
|
238
233
|
}
|
|
239
|
-
q((e) => [...e, ...i]),
|
|
240
|
-
for (let e of i) await
|
|
241
|
-
|
|
234
|
+
q((e) => [...e, ...i]), Xt(!0), Yt(!0);
|
|
235
|
+
for (let e of i) await hn(e);
|
|
236
|
+
Yt(!1), C.success(a(d, "files.upload.folder.success", "Uploaded {{count}} file{{plural}} from folder", {
|
|
242
237
|
count: i.length,
|
|
243
238
|
plural: i.length > 1 ? "s" : ""
|
|
244
239
|
}));
|
|
245
240
|
}
|
|
246
241
|
}, e.click();
|
|
247
|
-
},
|
|
248
|
-
|
|
249
|
-
},
|
|
250
|
-
if (
|
|
242
|
+
}, xn = () => {
|
|
243
|
+
F(!0);
|
|
244
|
+
}, Sn = async () => {
|
|
245
|
+
if (G.trim() && m) {
|
|
251
246
|
let { data: e, error: t } = await Z.mutateAsync({
|
|
252
|
-
name:
|
|
247
|
+
name: G,
|
|
253
248
|
parentFolderId: f
|
|
254
249
|
});
|
|
255
250
|
if (t) {
|
|
256
|
-
|
|
251
|
+
oe(t) ? (F(!1), K(""), Pt(!0)) : (C.error(t instanceof Error ? t.message : a(d, "files.folder.errors.createFailed", "Folder creation failed")), X("files.api.failed", {
|
|
257
252
|
action: "createFolder",
|
|
258
253
|
message: t instanceof Error ? t.message : "Folder creation failed"
|
|
259
254
|
}));
|
|
260
255
|
return;
|
|
261
256
|
}
|
|
262
|
-
e && (
|
|
263
|
-
folderName:
|
|
257
|
+
e && (K(""), F(!1), X("files.folder.created", {
|
|
258
|
+
folderName: G,
|
|
264
259
|
parentFolderId: f
|
|
265
260
|
}));
|
|
266
261
|
}
|
|
267
|
-
},
|
|
262
|
+
}, Cn = (e) => {
|
|
268
263
|
At(e);
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
},
|
|
264
|
+
}, wn = (e) => {
|
|
265
|
+
Ut(e), L(!0);
|
|
266
|
+
}, Tn = (e) => {
|
|
267
|
+
Ut(e), L(!0);
|
|
268
|
+
}, En = async (e) => {
|
|
274
269
|
if (!e.fileId && !e.folderId) throw Error(a(d, "files.share.errors.targetRequired", "Share requires a file id or folder id"));
|
|
275
270
|
let t = e.invitedEmail ? "EMAIL_INVITE" : "PUBLIC_LINK", n = "";
|
|
276
271
|
if (e.fileId) {
|
|
@@ -283,7 +278,7 @@ function d() {
|
|
|
283
278
|
shareType: t,
|
|
284
279
|
accessLevel: "DOWNLOAD"
|
|
285
280
|
};
|
|
286
|
-
n = (await
|
|
281
|
+
n = (await cn.mutateAsync(r))?.token ?? "", X("files.share.created", {
|
|
287
282
|
entityType: "file",
|
|
288
283
|
fileId: e.fileId,
|
|
289
284
|
shareType: t
|
|
@@ -298,7 +293,7 @@ function d() {
|
|
|
298
293
|
shareType: t,
|
|
299
294
|
accessLevel: "DOWNLOAD"
|
|
300
295
|
};
|
|
301
|
-
n = (await
|
|
296
|
+
n = (await ln.mutateAsync(r))?.token ?? "", X("files.share.created", {
|
|
302
297
|
entityType: "folder",
|
|
303
298
|
folderId: e.folderId,
|
|
304
299
|
shareType: t
|
|
@@ -308,21 +303,21 @@ function d() {
|
|
|
308
303
|
publicUrl: n ? `${window.location.origin}/files/share/${n}` : "",
|
|
309
304
|
token: n
|
|
310
305
|
};
|
|
311
|
-
},
|
|
312
|
-
|
|
306
|
+
}, Dn = async (e) => {
|
|
307
|
+
Be("medium"), Y({
|
|
313
308
|
title: a(d, "files.confirm.deleteFile.title", "Delete file"),
|
|
314
309
|
description: a(d, "files.confirm.deleteFile.description", "Move \"{{name}}\" to the bin?", { name: e.name }),
|
|
315
310
|
confirmLabel: a(d, "files.common.actions.delete", "Delete"),
|
|
316
311
|
variant: "danger",
|
|
317
312
|
onConfirm: async () => {
|
|
318
313
|
try {
|
|
319
|
-
await
|
|
314
|
+
await en.mutateAsync({ id: e.id }), Ve("success"), C.success(a(d, "files.file.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), X("files.file.deleted", {
|
|
320
315
|
fileId: e.id,
|
|
321
316
|
fileName: e.name,
|
|
322
317
|
permanent: !1
|
|
323
318
|
});
|
|
324
319
|
} catch (t) {
|
|
325
|
-
|
|
320
|
+
C.error(t instanceof Error ? t.message : a(d, "files.file.errors.deleteFailed", "Failed to delete \"{{name}}\"", { name: e.name })), Ve("error"), X("files.api.failed", {
|
|
326
321
|
action: "deleteFile",
|
|
327
322
|
fileId: e.id,
|
|
328
323
|
message: t instanceof Error ? t.message : "Failed to delete file"
|
|
@@ -330,36 +325,36 @@ function d() {
|
|
|
330
325
|
}
|
|
331
326
|
}
|
|
332
327
|
});
|
|
333
|
-
},
|
|
328
|
+
}, On = async (e) => {
|
|
334
329
|
try {
|
|
335
|
-
await
|
|
330
|
+
await nn.mutateAsync({ id: e.id }), C.success(a(d, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), X("files.file.restored", {
|
|
336
331
|
fileId: e.id,
|
|
337
332
|
fileName: e.name
|
|
338
333
|
});
|
|
339
334
|
} catch (e) {
|
|
340
|
-
|
|
335
|
+
C.error(e instanceof Error ? e.message : a(d, "files.file.errors.restoreFailed", "Failed to restore file"));
|
|
341
336
|
}
|
|
342
|
-
},
|
|
343
|
-
|
|
337
|
+
}, kn = async (e) => {
|
|
338
|
+
Be("heavy"), Y({
|
|
344
339
|
title: a(d, "files.confirm.permanentDeleteFile.title", "Permanently delete file"),
|
|
345
340
|
description: a(d, "files.confirm.permanentDeleteFile.description", "Permanently delete \"{{name}}\"? This cannot be undone.", { name: e.name }),
|
|
346
341
|
confirmLabel: a(d, "files.common.actions.deletePermanently", "Delete permanently"),
|
|
347
342
|
variant: "danger",
|
|
348
343
|
onConfirm: async () => {
|
|
349
344
|
try {
|
|
350
|
-
await
|
|
345
|
+
await an.mutateAsync({ id: e.id }), C.success(a(d, "files.file.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), X("files.file.deleted", {
|
|
351
346
|
fileId: e.id,
|
|
352
347
|
fileName: e.name,
|
|
353
348
|
permanent: !0
|
|
354
349
|
});
|
|
355
350
|
} catch (e) {
|
|
356
|
-
|
|
351
|
+
C.error(e instanceof Error ? e.message : a(d, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
|
|
357
352
|
}
|
|
358
353
|
}
|
|
359
354
|
});
|
|
360
|
-
},
|
|
355
|
+
}, An = async (e) => {
|
|
361
356
|
try {
|
|
362
|
-
await
|
|
357
|
+
await sn.mutateAsync({
|
|
363
358
|
id: e.id,
|
|
364
359
|
type: "file"
|
|
365
360
|
}), X("files.file.starred", {
|
|
@@ -368,77 +363,77 @@ function d() {
|
|
|
368
363
|
starred: !e.starred
|
|
369
364
|
});
|
|
370
365
|
} catch {
|
|
371
|
-
|
|
366
|
+
C.error(a(d, "files.file.errors.starFailed", "Failed to update starred state")), X("files.api.failed", {
|
|
372
367
|
action: "toggleFileStar",
|
|
373
368
|
fileId: e.id
|
|
374
369
|
});
|
|
375
370
|
}
|
|
376
|
-
},
|
|
377
|
-
|
|
371
|
+
}, jn = (e) => {
|
|
372
|
+
H({
|
|
378
373
|
id: e.id,
|
|
379
374
|
name: e.name,
|
|
380
375
|
type: "file"
|
|
381
|
-
}),
|
|
382
|
-
},
|
|
376
|
+
}), W(e.name), I(!0);
|
|
377
|
+
}, Mn = async (e) => {
|
|
383
378
|
try {
|
|
384
379
|
let t = e.downloadUrl || e.url;
|
|
385
380
|
if (!t) throw Error(a(d, "files.file.errors.downloadUrlUnavailable", "Download URL is unavailable"));
|
|
386
381
|
let n = document.createElement("a");
|
|
387
|
-
n.style.display = "none", n.href = t, n.download = e.name, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n),
|
|
382
|
+
n.style.display = "none", n.href = t, n.download = e.name, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n), C.success(a(d, "files.file.download.success", "Downloaded {{name}}", { name: e.name })), X("files.file.downloaded", {
|
|
388
383
|
fileId: e.id,
|
|
389
384
|
fileName: e.name
|
|
390
385
|
});
|
|
391
386
|
} catch (e) {
|
|
392
|
-
|
|
387
|
+
C.error(e instanceof Error ? e.message : a(d, "files.file.errors.downloadFailed", "Failed to download file"));
|
|
393
388
|
}
|
|
394
|
-
},
|
|
395
|
-
|
|
389
|
+
}, Nn = (e) => {
|
|
390
|
+
Gt({
|
|
396
391
|
item: e,
|
|
397
392
|
type: "file"
|
|
398
393
|
}), Vt(!0);
|
|
399
|
-
},
|
|
400
|
-
|
|
394
|
+
}, Pn = (e) => {
|
|
395
|
+
Wt({
|
|
401
396
|
item: e,
|
|
402
397
|
type: "file"
|
|
403
|
-
}),
|
|
404
|
-
},
|
|
398
|
+
}), R(!0);
|
|
399
|
+
}, Fn = (e) => {
|
|
405
400
|
kt({
|
|
406
401
|
item: e,
|
|
407
402
|
type: "file"
|
|
408
403
|
});
|
|
409
|
-
},
|
|
404
|
+
}, In = (e) => {
|
|
410
405
|
p(`/files/browse/${e.id}`);
|
|
411
|
-
},
|
|
412
|
-
|
|
406
|
+
}, Ln = async (e) => {
|
|
407
|
+
Be("medium"), Y({
|
|
413
408
|
title: a(d, "files.confirm.deleteFolder.title", "Delete folder"),
|
|
414
409
|
description: a(d, "files.confirm.deleteFolder.description", "Move folder \"{{name}}\" and all its contents to the bin?", { name: e.name }),
|
|
415
410
|
confirmLabel: a(d, "files.common.actions.delete", "Delete"),
|
|
416
411
|
variant: "danger",
|
|
417
412
|
onConfirm: async () => {
|
|
418
413
|
try {
|
|
419
|
-
await
|
|
414
|
+
await tn.mutateAsync({
|
|
420
415
|
id: e.id,
|
|
421
416
|
recursive: !0
|
|
422
|
-
}),
|
|
417
|
+
}), C.success(a(d, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), X("files.folder.deleted", {
|
|
423
418
|
folderId: e.id,
|
|
424
419
|
folderName: e.name,
|
|
425
420
|
permanent: !1
|
|
426
421
|
});
|
|
427
422
|
} catch (e) {
|
|
428
|
-
|
|
423
|
+
C.error(e instanceof Error ? e.message : a(d, "files.folder.errors.deleteFailed", "Failed to delete folder"));
|
|
429
424
|
}
|
|
430
425
|
}
|
|
431
426
|
});
|
|
432
|
-
},
|
|
427
|
+
}, Rn = async (e) => {
|
|
433
428
|
try {
|
|
434
|
-
await
|
|
429
|
+
await rn.mutateAsync({ id: e.id }), C.success(a(d, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), X("files.folder.restored", {
|
|
435
430
|
folderId: e.id,
|
|
436
431
|
folderName: e.name
|
|
437
432
|
});
|
|
438
433
|
} catch (e) {
|
|
439
|
-
|
|
434
|
+
C.error(e instanceof Error ? e.message : a(d, "files.folder.errors.restoreFailed", "Failed to restore folder"));
|
|
440
435
|
}
|
|
441
|
-
},
|
|
436
|
+
}, zn = async (e) => {
|
|
442
437
|
Y({
|
|
443
438
|
title: a(d, "files.confirm.permanentDeleteFolder.title", "Permanently delete folder"),
|
|
444
439
|
description: a(d, "files.confirm.permanentDeleteFolder.description", "Permanently delete folder \"{{name}}\" and its contents? This cannot be undone.", { name: e.name }),
|
|
@@ -446,30 +441,30 @@ function d() {
|
|
|
446
441
|
variant: "danger",
|
|
447
442
|
onConfirm: async () => {
|
|
448
443
|
try {
|
|
449
|
-
await
|
|
444
|
+
await on.mutateAsync({ id: e.id }), C.success(a(d, "files.folder.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), X("files.folder.deleted", {
|
|
450
445
|
folderId: e.id,
|
|
451
446
|
folderName: e.name,
|
|
452
447
|
permanent: !0
|
|
453
448
|
});
|
|
454
449
|
} catch (e) {
|
|
455
|
-
|
|
450
|
+
C.error(e instanceof Error ? e.message : a(d, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
|
|
456
451
|
}
|
|
457
452
|
}
|
|
458
453
|
});
|
|
459
|
-
},
|
|
460
|
-
|
|
454
|
+
}, Bn = (e) => {
|
|
455
|
+
H({
|
|
461
456
|
id: e.id,
|
|
462
457
|
name: e.name,
|
|
463
458
|
type: "folder"
|
|
464
|
-
}),
|
|
465
|
-
},
|
|
466
|
-
|
|
459
|
+
}), W(e.name), I(!0);
|
|
460
|
+
}, Vn = (e) => {
|
|
461
|
+
Wt({
|
|
467
462
|
item: e,
|
|
468
463
|
type: "folder"
|
|
469
|
-
}),
|
|
470
|
-
},
|
|
464
|
+
}), R(!0);
|
|
465
|
+
}, Hn = async (e) => {
|
|
471
466
|
try {
|
|
472
|
-
await
|
|
467
|
+
await sn.mutateAsync({
|
|
473
468
|
id: e.id,
|
|
474
469
|
type: "folder"
|
|
475
470
|
}), X("files.folder.starred", {
|
|
@@ -478,95 +473,95 @@ function d() {
|
|
|
478
473
|
starred: !e.starred
|
|
479
474
|
});
|
|
480
475
|
} catch {
|
|
481
|
-
|
|
476
|
+
C.error(a(d, "files.folder.errors.starFailed", "Failed to update starred state")), X("files.api.failed", {
|
|
482
477
|
action: "toggleFolderStar",
|
|
483
478
|
folderId: e.id
|
|
484
479
|
});
|
|
485
480
|
}
|
|
486
|
-
},
|
|
481
|
+
}, Un = (e) => {
|
|
487
482
|
kt({
|
|
488
483
|
item: e,
|
|
489
484
|
type: "folder"
|
|
490
485
|
});
|
|
491
|
-
},
|
|
492
|
-
if (
|
|
493
|
-
|
|
494
|
-
fileId:
|
|
486
|
+
}, Wn = async (e) => {
|
|
487
|
+
if (z) try {
|
|
488
|
+
z.type === "file" ? (await dn.mutateAsync({
|
|
489
|
+
fileId: z.item.id,
|
|
495
490
|
targetFolderId: e || null
|
|
496
|
-
}),
|
|
497
|
-
fileId:
|
|
498
|
-
fileName:
|
|
491
|
+
}), C.success(a(d, "files.file.move.success", "\"{{name}}\" moved", { name: z.item.name })), X("files.file.moved", {
|
|
492
|
+
fileId: z.item.id,
|
|
493
|
+
fileName: z.item.name,
|
|
499
494
|
destinationFolderId: e
|
|
500
|
-
})) : (await
|
|
501
|
-
folderId:
|
|
495
|
+
})) : (await fn.mutateAsync({
|
|
496
|
+
folderId: z.item.id,
|
|
502
497
|
targetParentFolderId: e
|
|
503
|
-
}),
|
|
504
|
-
folderId:
|
|
505
|
-
folderName:
|
|
498
|
+
}), C.success(a(d, "files.folder.move.success", "\"{{name}}\" moved", { name: z.item.name })), X("files.folder.moved", {
|
|
499
|
+
folderId: z.item.id,
|
|
500
|
+
folderName: z.item.name,
|
|
506
501
|
destinationFolderId: e
|
|
507
|
-
})),
|
|
502
|
+
})), R(!1), Wt(null);
|
|
508
503
|
} catch (e) {
|
|
509
|
-
|
|
510
|
-
action:
|
|
511
|
-
itemId:
|
|
512
|
-
itemType:
|
|
504
|
+
C.error(e instanceof Error ? e.message : a(d, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: z.item.name })), X("files.api.failed", {
|
|
505
|
+
action: z.type === "file" ? "moveFile" : "moveFolder",
|
|
506
|
+
itemId: z.item.id,
|
|
507
|
+
itemType: z.type,
|
|
513
508
|
message: e instanceof Error ? e.message : void 0
|
|
514
509
|
});
|
|
515
510
|
}
|
|
516
|
-
},
|
|
517
|
-
if (
|
|
518
|
-
if (
|
|
519
|
-
await
|
|
520
|
-
id:
|
|
521
|
-
newName: t || `Copy of ${
|
|
511
|
+
}, Gn = async (e, t) => {
|
|
512
|
+
if (B) try {
|
|
513
|
+
if (B.type !== "file") throw Error(a(d, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
|
|
514
|
+
await un.mutateAsync({
|
|
515
|
+
id: B.item.id,
|
|
516
|
+
newName: t || `Copy of ${B.item.name}`,
|
|
522
517
|
targetFolderId: e || void 0
|
|
523
|
-
}),
|
|
524
|
-
fileId:
|
|
525
|
-
fileName:
|
|
518
|
+
}), C.success(a(d, "files.file.copy.success", "\"{{name}}\" copied", { name: B.item.name })), X("files.file.copied", {
|
|
519
|
+
fileId: B.item.id,
|
|
520
|
+
fileName: B.item.name,
|
|
526
521
|
destinationFolderId: e
|
|
527
|
-
}), Vt(!1),
|
|
522
|
+
}), Vt(!1), Gt(null);
|
|
528
523
|
} catch (e) {
|
|
529
|
-
|
|
524
|
+
C.error(e instanceof Error ? e.message : a(d, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: B.item.name })), X("files.api.failed", {
|
|
530
525
|
action: "copyFile",
|
|
531
|
-
fileId:
|
|
526
|
+
fileId: B.item.id,
|
|
532
527
|
message: e instanceof Error ? e.message : void 0
|
|
533
528
|
});
|
|
534
529
|
}
|
|
535
|
-
},
|
|
536
|
-
if (
|
|
537
|
-
let e =
|
|
538
|
-
|
|
539
|
-
fileId:
|
|
530
|
+
}, Kn = async () => {
|
|
531
|
+
if (V && U.trim()) try {
|
|
532
|
+
let e = V.name, t = U.trim();
|
|
533
|
+
V.type === "file" ? (await Q.mutateAsync({
|
|
534
|
+
fileId: V.id,
|
|
540
535
|
newName: t
|
|
541
|
-
}),
|
|
542
|
-
fileId:
|
|
536
|
+
}), C.success(a(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.file.renamed", {
|
|
537
|
+
fileId: V.id,
|
|
543
538
|
previousName: e,
|
|
544
539
|
name: t
|
|
545
540
|
})) : (await $.mutateAsync({
|
|
546
|
-
folderId:
|
|
541
|
+
folderId: V.id,
|
|
547
542
|
newName: t
|
|
548
|
-
}),
|
|
549
|
-
folderId:
|
|
543
|
+
}), C.success(a(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.folder.renamed", {
|
|
544
|
+
folderId: V.id,
|
|
550
545
|
previousName: e,
|
|
551
546
|
name: t
|
|
552
|
-
})),
|
|
547
|
+
})), I(!1), H(null), W("");
|
|
553
548
|
} catch (e) {
|
|
554
|
-
|
|
555
|
-
action:
|
|
556
|
-
itemId:
|
|
557
|
-
itemType:
|
|
549
|
+
C.error(e instanceof Error ? e.message : a(d, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: V.type })), X("files.api.failed", {
|
|
550
|
+
action: V.type === "file" ? "renameFile" : "renameFolder",
|
|
551
|
+
itemId: V.id,
|
|
552
|
+
itemType: V.type,
|
|
558
553
|
message: e instanceof Error ? e.message : void 0
|
|
559
554
|
});
|
|
560
555
|
}
|
|
561
556
|
};
|
|
562
|
-
return
|
|
563
|
-
files:
|
|
564
|
-
folders:
|
|
565
|
-
onFilePreview:
|
|
566
|
-
onFileDelete:
|
|
567
|
-
onFolderOpen:
|
|
568
|
-
onFolderDelete:
|
|
569
|
-
activeTab:
|
|
557
|
+
return ee({
|
|
558
|
+
files: k,
|
|
559
|
+
folders: A,
|
|
560
|
+
onFilePreview: Cn,
|
|
561
|
+
onFileDelete: Dn,
|
|
562
|
+
onFolderOpen: In,
|
|
563
|
+
onFolderDelete: Ln,
|
|
564
|
+
activeTab: v
|
|
570
565
|
}), m === void 0 ? /* @__PURE__ */ l("div", {
|
|
571
566
|
className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
|
|
572
567
|
children: [/* @__PURE__ */ c(s, { className: "size-8 animate-spin text-text-tertiary" }), /* @__PURE__ */ c("p", {
|
|
@@ -575,7 +570,7 @@ function d() {
|
|
|
575
570
|
})]
|
|
576
571
|
}) : m === "" ? /* @__PURE__ */ l("div", {
|
|
577
572
|
className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
|
|
578
|
-
children: [/* @__PURE__ */ c(
|
|
573
|
+
children: [/* @__PURE__ */ c(Je, { className: "size-8 text-text-tertiary" }), /* @__PURE__ */ c("p", {
|
|
579
574
|
className: "text-sm text-text-secondary max-w-md",
|
|
580
575
|
children: a(d, "files.browser.workspace.notSelected", "No workspace selected. Please select a workspace to view files.")
|
|
581
576
|
})]
|
|
@@ -586,10 +581,10 @@ function d() {
|
|
|
586
581
|
className: "relative overflow-hidden bg-bg-surface border-b border-border-seam px-4 py-3 sm:px-6 sm:py-4",
|
|
587
582
|
"data-tour": "files-breadcrumb-nav",
|
|
588
583
|
children: [
|
|
589
|
-
/* @__PURE__ */ c(
|
|
584
|
+
/* @__PURE__ */ c(ot, { intensity: "subtle" }),
|
|
590
585
|
/* @__PURE__ */ c("h1", {
|
|
591
586
|
className: "mb-2 text-lg font-semibold tracking-tight sm:text-xl",
|
|
592
|
-
children: /* @__PURE__ */ c(
|
|
587
|
+
children: /* @__PURE__ */ c(lt, { children: a(d, "files.browser.rootLabel", "My Drive") })
|
|
593
588
|
}),
|
|
594
589
|
/* @__PURE__ */ c("div", {
|
|
595
590
|
className: "flex items-center gap-2 sm:gap-4",
|
|
@@ -600,11 +595,11 @@ function d() {
|
|
|
600
595
|
onClick: () => p("/files/browse"),
|
|
601
596
|
className: "flex items-center gap-1 text-text-primary hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap",
|
|
602
597
|
title: a(d, "files.browser.actions.goToRoot", "Go to root"),
|
|
603
|
-
children: [/* @__PURE__ */ c(
|
|
598
|
+
children: [/* @__PURE__ */ c(Xe, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
604
599
|
className: "hidden sm:inline",
|
|
605
600
|
children: a(d, "files.browser.rootLabel", "My Drive")
|
|
606
601
|
})]
|
|
607
|
-
}),
|
|
602
|
+
}), Ct.map((e, t) => /* @__PURE__ */ l("div", {
|
|
608
603
|
className: "flex items-center gap-1 sm:gap-2",
|
|
609
604
|
children: [/* @__PURE__ */ c("span", {
|
|
610
605
|
className: "text-text-tertiary",
|
|
@@ -612,22 +607,22 @@ function d() {
|
|
|
612
607
|
}), /* @__PURE__ */ c("button", {
|
|
613
608
|
type: "button",
|
|
614
609
|
onClick: () => p(`/files/browse/${e.id}`),
|
|
615
|
-
className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t ===
|
|
610
|
+
className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t === Ct.length - 1 ? "text-text-primary font-medium" : "text-text-secondary"}`,
|
|
616
611
|
title: `Go to ${e.name}`,
|
|
617
612
|
children: e.name
|
|
618
613
|
})]
|
|
619
614
|
}, e.id))]
|
|
620
615
|
})
|
|
621
616
|
}),
|
|
622
|
-
/* @__PURE__ */ c(
|
|
617
|
+
/* @__PURE__ */ c(pt, {
|
|
623
618
|
className: "relative mt-2 max-w-3xl",
|
|
624
619
|
children: a(d, "files.browser.purpose", "Your workspace drive: upload, organise and share documents, images, videos and more with your team. Browse folders, star what you use often, search across everything, and recover deleted items from the Bin.")
|
|
625
620
|
})
|
|
626
621
|
]
|
|
627
622
|
}),
|
|
628
|
-
!
|
|
623
|
+
!x && /* @__PURE__ */ c("div", {
|
|
629
624
|
className: "px-4 pt-3 sm:px-6",
|
|
630
|
-
children: /* @__PURE__ */ c(
|
|
625
|
+
children: /* @__PURE__ */ c(ft, {
|
|
631
626
|
storageKey: "files-browser",
|
|
632
627
|
title: a(d, "files.browser.nextSteps.title", "Get started with Files"),
|
|
633
628
|
steps: [
|
|
@@ -635,39 +630,39 @@ function d() {
|
|
|
635
630
|
id: "upload",
|
|
636
631
|
label: a(d, "files.browser.nextSteps.upload.label", "Upload your first files"),
|
|
637
632
|
description: a(d, "files.browser.nextSteps.upload.description", "Add documents, images or videos to this drive."),
|
|
638
|
-
icon: /* @__PURE__ */ c(
|
|
639
|
-
onClick:
|
|
633
|
+
icon: /* @__PURE__ */ c(et, { className: "size-4" }),
|
|
634
|
+
onClick: mn
|
|
640
635
|
},
|
|
641
636
|
{
|
|
642
637
|
id: "new-folder",
|
|
643
638
|
label: a(d, "files.browser.nextSteps.newFolder.label", "Create a folder to organise"),
|
|
644
639
|
description: a(d, "files.browser.nextSteps.newFolder.description", "Group related files so they are easy to find later."),
|
|
645
|
-
icon: /* @__PURE__ */ c(
|
|
646
|
-
onClick:
|
|
640
|
+
icon: /* @__PURE__ */ c(Ke, { className: "size-4" }),
|
|
641
|
+
onClick: xn
|
|
647
642
|
},
|
|
648
643
|
{
|
|
649
644
|
id: "starred",
|
|
650
645
|
label: a(d, "files.browser.nextSteps.starred.label", "Star items you use often"),
|
|
651
646
|
description: a(d, "files.browser.nextSteps.starred.description", "Starred files and folders show up under the Starred tab."),
|
|
652
|
-
icon: /* @__PURE__ */ c(
|
|
653
|
-
onClick: () =>
|
|
647
|
+
icon: /* @__PURE__ */ c(Qe, { className: "size-4" }),
|
|
648
|
+
onClick: () => y("starred")
|
|
654
649
|
},
|
|
655
650
|
{
|
|
656
651
|
id: "bin",
|
|
657
652
|
label: a(d, "files.browser.nextSteps.bin.label", "Recover deleted items from the Bin"),
|
|
658
653
|
description: a(d, "files.browser.nextSteps.bin.description", "Deleted files stay in the Bin so you can restore them."),
|
|
659
|
-
icon: /* @__PURE__ */ c(
|
|
660
|
-
onClick: () =>
|
|
654
|
+
icon: /* @__PURE__ */ c($e, { className: "size-4" }),
|
|
655
|
+
onClick: () => y("bin")
|
|
661
656
|
}
|
|
662
657
|
]
|
|
663
658
|
})
|
|
664
659
|
}),
|
|
665
660
|
/* @__PURE__ */ c("div", {
|
|
666
661
|
"data-tour": "files-tab-bar",
|
|
667
|
-
children: /* @__PURE__ */ c(
|
|
668
|
-
activeTab:
|
|
669
|
-
onTabChange:
|
|
670
|
-
tabs:
|
|
662
|
+
children: /* @__PURE__ */ c(De, {
|
|
663
|
+
activeTab: v,
|
|
664
|
+
onTabChange: y,
|
|
665
|
+
tabs: wt
|
|
671
666
|
})
|
|
672
667
|
}),
|
|
673
668
|
/* @__PURE__ */ l("div", {
|
|
@@ -680,46 +675,46 @@ function d() {
|
|
|
680
675
|
"data-tour": "files-search-bar",
|
|
681
676
|
children: /* @__PURE__ */ c("div", {
|
|
682
677
|
className: "relative w-full max-w-2xl",
|
|
683
|
-
children: /* @__PURE__ */ c(
|
|
678
|
+
children: /* @__PURE__ */ c(Ne, {
|
|
684
679
|
onSearch: (e, t) => {
|
|
685
680
|
Tt(e), Dt(t);
|
|
686
681
|
},
|
|
687
682
|
placeholder: a(d, "files.search.input.placeholder", "Search files and folders..."),
|
|
688
|
-
initialQuery:
|
|
683
|
+
initialQuery: b,
|
|
689
684
|
showFilters: !0
|
|
690
685
|
})
|
|
691
686
|
})
|
|
692
687
|
}), /* @__PURE__ */ l("div", {
|
|
693
688
|
className: "flex items-center gap-2 order-1 sm:order-2 w-full sm:w-auto justify-between sm:justify-end",
|
|
694
|
-
children: [!
|
|
689
|
+
children: [!x && /* @__PURE__ */ l("div", {
|
|
695
690
|
className: "flex items-center gap-2",
|
|
696
691
|
"data-tour": "files-upload-files-button",
|
|
697
692
|
children: [/* @__PURE__ */ l(u, {
|
|
698
693
|
type: "button",
|
|
699
694
|
variant: "default",
|
|
700
|
-
onClick:
|
|
701
|
-
disabled:
|
|
702
|
-
children: [
|
|
695
|
+
onClick: mn,
|
|
696
|
+
disabled: Kt,
|
|
697
|
+
children: [Kt ? /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }) : /* @__PURE__ */ c(et, { className: "size-4" }), Kt ? a(d, "files.browser.upload.uploading", "Uploading...") : a(d, "files.browser.actions.uploadFiles", "Upload Files")]
|
|
703
698
|
}), /* @__PURE__ */ c("div", {
|
|
704
699
|
"data-tour": "files-more-actions-trigger",
|
|
705
|
-
children: /* @__PURE__ */ c(
|
|
700
|
+
children: /* @__PURE__ */ c(st, { actions: [
|
|
706
701
|
{
|
|
707
702
|
label: a(d, "files.browser.actions.newFolder", "New Folder"),
|
|
708
|
-
icon: /* @__PURE__ */ c(
|
|
709
|
-
onSelect:
|
|
703
|
+
icon: /* @__PURE__ */ c(Ke, { className: "size-4" }),
|
|
704
|
+
onSelect: xn,
|
|
710
705
|
dataTour: "files-new-folder-button"
|
|
711
706
|
},
|
|
712
707
|
{
|
|
713
708
|
label: a(d, "files.browser.actions.uploadFolder", "Upload Folder"),
|
|
714
|
-
icon: /* @__PURE__ */ c(
|
|
715
|
-
onSelect:
|
|
716
|
-
disabled:
|
|
709
|
+
icon: /* @__PURE__ */ c(qe, { className: "size-4" }),
|
|
710
|
+
onSelect: bn,
|
|
711
|
+
disabled: Kt
|
|
717
712
|
},
|
|
718
|
-
...
|
|
713
|
+
...k.length > 0 || A.length > 0 ? [{
|
|
719
714
|
label: a(d, "files.browser.actions.selectAll", "Select All"),
|
|
720
715
|
onSelect: () => {
|
|
721
|
-
let e =
|
|
722
|
-
|
|
716
|
+
let e = k.map((e) => e.id), t = A.map((e) => e.id);
|
|
717
|
+
i.getState().selectAllFiles(e), t.forEach((e) => i.getState().selectFolder(e));
|
|
723
718
|
}
|
|
724
719
|
}] : []
|
|
725
720
|
] })
|
|
@@ -729,51 +724,51 @@ function d() {
|
|
|
729
724
|
"data-tour": "files-view-mode-toggle",
|
|
730
725
|
children: [/* @__PURE__ */ c("button", {
|
|
731
726
|
type: "button",
|
|
732
|
-
onClick: () =>
|
|
733
|
-
className: `p-2 transition-colors duration-200 ${
|
|
727
|
+
onClick: () => St("grid"),
|
|
728
|
+
className: `p-2 transition-colors duration-200 ${xt === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
|
|
734
729
|
"aria-label": a(d, "files.browser.view.grid", "Grid view"),
|
|
735
|
-
children: /* @__PURE__ */ c(
|
|
730
|
+
children: /* @__PURE__ */ c(Ye, { className: "size-5" })
|
|
736
731
|
}), /* @__PURE__ */ c("button", {
|
|
737
732
|
type: "button",
|
|
738
|
-
onClick: () =>
|
|
739
|
-
className: `p-2 transition-colors duration-200 ${
|
|
733
|
+
onClick: () => St("list"),
|
|
734
|
+
className: `p-2 transition-colors duration-200 ${xt === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
|
|
740
735
|
"aria-label": a(d, "files.browser.view.list", "List view"),
|
|
741
|
-
children: /* @__PURE__ */ c(
|
|
736
|
+
children: /* @__PURE__ */ c(Ze, { className: "size-5" })
|
|
742
737
|
})]
|
|
743
738
|
})]
|
|
744
739
|
})]
|
|
745
740
|
}),
|
|
746
|
-
|
|
741
|
+
x && /* @__PURE__ */ l("div", {
|
|
747
742
|
className: "mt-3 flex items-center justify-between p-3 bg-status-success-bg-subtle rounded-lg border border-status-success-border transition-all duration-200",
|
|
748
743
|
children: [/* @__PURE__ */ l("span", {
|
|
749
744
|
className: "text-sm font-medium text-status-success-text",
|
|
750
|
-
children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query:
|
|
745
|
+
children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: b }), O.data && ` (${(O.data.files?.length || 0) + (O.data.folders?.length || 0)} items)`]
|
|
751
746
|
}), /* @__PURE__ */ l("button", {
|
|
752
747
|
type: "button",
|
|
753
748
|
onClick: () => Tt(""),
|
|
754
749
|
className: "flex items-center gap-2 text-status-success-text hover:text-status-success-text/80 text-sm font-medium transition-colors duration-200",
|
|
755
|
-
children: [/* @__PURE__ */ c(
|
|
750
|
+
children: [/* @__PURE__ */ c(tt, { className: "size-4" }), a(d, "files.browser.search.clear", "Clear search")]
|
|
756
751
|
})]
|
|
757
752
|
}),
|
|
758
|
-
|
|
753
|
+
P > 0 && /* @__PURE__ */ l(ct, {
|
|
759
754
|
className: "mt-3 flex items-center justify-between p-3",
|
|
760
755
|
children: [/* @__PURE__ */ l("div", {
|
|
761
756
|
className: "flex items-center gap-4",
|
|
762
757
|
children: [/* @__PURE__ */ c("span", {
|
|
763
758
|
className: "text-sm font-medium text-text-primary",
|
|
764
759
|
children: a(d, "files.browser.selection.selectedCount", "{{count}} item{{suffix}} selected", {
|
|
765
|
-
count:
|
|
766
|
-
suffix:
|
|
760
|
+
count: P,
|
|
761
|
+
suffix: P > 1 ? "s" : ""
|
|
767
762
|
})
|
|
768
763
|
}), /* @__PURE__ */ c("div", {
|
|
769
764
|
className: "flex items-center gap-2",
|
|
770
|
-
children:
|
|
765
|
+
children: v === "bin" ? /* @__PURE__ */ l(nt, { children: [/* @__PURE__ */ c("button", {
|
|
771
766
|
type: "button",
|
|
772
767
|
onClick: async () => {
|
|
773
768
|
try {
|
|
774
|
-
await Promise.all([...Array.from(h).map((e) =>
|
|
769
|
+
await Promise.all([...Array.from(h).map((e) => nn.mutateAsync({ id: e })), ...Array.from(g).map((e) => rn.mutateAsync({ id: e }))]), _(), C.success(`${P} item${P > 1 ? "s" : ""} restored`);
|
|
775
770
|
} catch (e) {
|
|
776
|
-
|
|
771
|
+
C.error(e instanceof Error ? e.message : "Failed to restore some items");
|
|
777
772
|
}
|
|
778
773
|
},
|
|
779
774
|
className: "flex items-center gap-1.5 rounded-lg border border-status-success-border bg-bg-surface px-3 py-1.5 text-sm font-medium text-status-success-text transition-colors duration-200 hover:bg-status-success-bg-subtle",
|
|
@@ -784,207 +779,207 @@ function d() {
|
|
|
784
779
|
Y({
|
|
785
780
|
title: a(d, "files.confirm.bulkPermanentDelete.title", "Permanently delete selected items"),
|
|
786
781
|
description: a(d, "files.confirm.bulkPermanentDelete.description", "Permanently delete {{count}} selected item{{plural}}? This cannot be undone.", {
|
|
787
|
-
count:
|
|
788
|
-
plural:
|
|
782
|
+
count: P,
|
|
783
|
+
plural: P > 1 ? "s" : ""
|
|
789
784
|
}),
|
|
790
785
|
confirmLabel: a(d, "files.common.actions.deletePermanently", "Delete permanently"),
|
|
791
786
|
variant: "danger",
|
|
792
787
|
onConfirm: async () => {
|
|
793
788
|
try {
|
|
794
|
-
await Promise.all([...Array.from(h).map((e) =>
|
|
795
|
-
count:
|
|
796
|
-
plural:
|
|
789
|
+
await Promise.all([...Array.from(h).map((e) => an.mutateAsync({ id: e })), ...Array.from(g).map((e) => on.mutateAsync({ id: e }))]), _(), C.success(a(d, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
|
|
790
|
+
count: P,
|
|
791
|
+
plural: P > 1 ? "s" : ""
|
|
797
792
|
}));
|
|
798
793
|
} catch (e) {
|
|
799
|
-
|
|
794
|
+
C.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
|
|
800
795
|
}
|
|
801
796
|
}
|
|
802
797
|
});
|
|
803
798
|
},
|
|
804
799
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-status-error-text bg-bg-surface border border-status-error-border rounded-lg hover:bg-status-error-bg-subtle transition-colors duration-200",
|
|
805
|
-
children: [/* @__PURE__ */ c(
|
|
800
|
+
children: [/* @__PURE__ */ c($e, { className: "size-4" }), a(d, "files.browser.selection.actions.deletePermanently", "Delete permanently")]
|
|
806
801
|
})] }) : /* @__PURE__ */ l("button", {
|
|
807
802
|
type: "button",
|
|
808
803
|
onClick: async () => {
|
|
809
804
|
Y({
|
|
810
805
|
title: a(d, "files.confirm.bulkDelete.title", "Delete selected items"),
|
|
811
806
|
description: a(d, "files.confirm.bulkDelete.description", "Move {{count}} selected item{{plural}} to the bin?", {
|
|
812
|
-
count:
|
|
813
|
-
plural:
|
|
807
|
+
count: P,
|
|
808
|
+
plural: P > 1 ? "s" : ""
|
|
814
809
|
}),
|
|
815
810
|
confirmLabel: a(d, "files.common.actions.delete", "Delete"),
|
|
816
811
|
variant: "danger",
|
|
817
812
|
onConfirm: async () => {
|
|
818
813
|
try {
|
|
819
814
|
let e = Array.from(h), t = Array.from(g);
|
|
820
|
-
e.length > 0 && await
|
|
815
|
+
e.length > 0 && await pn.mutateAsync(e), await Promise.all(t.map((e) => tn.mutateAsync({
|
|
821
816
|
id: e,
|
|
822
817
|
recursive: !0
|
|
823
|
-
}))),
|
|
824
|
-
count:
|
|
825
|
-
plural:
|
|
818
|
+
}))), _(), C.success(a(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
|
|
819
|
+
count: P,
|
|
820
|
+
plural: P > 1 ? "s" : ""
|
|
826
821
|
}));
|
|
827
822
|
} catch (e) {
|
|
828
|
-
|
|
823
|
+
C.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
|
|
829
824
|
}
|
|
830
825
|
}
|
|
831
826
|
});
|
|
832
827
|
},
|
|
833
828
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-status-error-text bg-bg-surface border border-status-error-border rounded-lg hover:bg-status-error-bg-subtle transition-colors duration-200",
|
|
834
|
-
children: [/* @__PURE__ */ c(
|
|
829
|
+
children: [/* @__PURE__ */ c($e, { className: "size-4" }), a(d, "files.browser.selection.actions.delete", "Delete")]
|
|
835
830
|
})
|
|
836
831
|
})]
|
|
837
832
|
}), /* @__PURE__ */ l("button", {
|
|
838
833
|
type: "button",
|
|
839
|
-
onClick:
|
|
834
|
+
onClick: _,
|
|
840
835
|
className: "flex items-center gap-2 text-text-link hover:text-action-primary-bg-hover text-sm font-medium transition-colors duration-200",
|
|
841
|
-
children: [/* @__PURE__ */ c(
|
|
836
|
+
children: [/* @__PURE__ */ c(tt, { className: "size-4" }), a(d, "files.common.actions.clear", "Clear")]
|
|
842
837
|
})]
|
|
843
838
|
})
|
|
844
839
|
]
|
|
845
840
|
}),
|
|
846
|
-
(
|
|
841
|
+
(bt.isExhausted || bt.isNearLimit) && /* @__PURE__ */ c("div", {
|
|
847
842
|
className: "px-4 sm:px-6 pt-3",
|
|
848
|
-
children: /* @__PURE__ */ c(
|
|
843
|
+
children: /* @__PURE__ */ c(Re, { quota: bt })
|
|
849
844
|
}),
|
|
850
845
|
/* @__PURE__ */ l("div", {
|
|
851
846
|
className: "px-2 sm:px-4 md:px-6 py-3 sm:py-4",
|
|
852
847
|
"data-tour": "files-browser-grid",
|
|
853
|
-
children: [/* @__PURE__ */ c(
|
|
854
|
-
files:
|
|
855
|
-
folders:
|
|
856
|
-
loading:
|
|
857
|
-
error:
|
|
858
|
-
preserveSortOrder:
|
|
859
|
-
onFilePreview:
|
|
860
|
-
onFileShare:
|
|
861
|
-
onFileDelete:
|
|
862
|
-
onFileRestore:
|
|
863
|
-
onFileFavorite:
|
|
864
|
-
onFileRename:
|
|
865
|
-
onFileDownload:
|
|
866
|
-
onFileCopy:
|
|
867
|
-
onFileMove:
|
|
868
|
-
onFileInfo:
|
|
869
|
-
onFolderOpen:
|
|
870
|
-
onFolderShare:
|
|
871
|
-
onFolderDelete:
|
|
872
|
-
onFolderRestore:
|
|
873
|
-
onFolderRename:
|
|
874
|
-
onFolderFavorite:
|
|
875
|
-
onFolderMove:
|
|
876
|
-
onFolderInfo:
|
|
877
|
-
}), !
|
|
848
|
+
children: [/* @__PURE__ */ c(Ee, {
|
|
849
|
+
files: k,
|
|
850
|
+
folders: A,
|
|
851
|
+
loading: j,
|
|
852
|
+
error: M,
|
|
853
|
+
preserveSortOrder: N,
|
|
854
|
+
onFilePreview: Cn,
|
|
855
|
+
onFileShare: v === "bin" ? void 0 : wn,
|
|
856
|
+
onFileDelete: v === "bin" ? kn : Dn,
|
|
857
|
+
onFileRestore: v === "bin" ? On : void 0,
|
|
858
|
+
onFileFavorite: v === "bin" ? void 0 : An,
|
|
859
|
+
onFileRename: v === "bin" ? void 0 : jn,
|
|
860
|
+
onFileDownload: Mn,
|
|
861
|
+
onFileCopy: v === "bin" ? void 0 : Nn,
|
|
862
|
+
onFileMove: v === "bin" ? void 0 : Pn,
|
|
863
|
+
onFileInfo: Fn,
|
|
864
|
+
onFolderOpen: In,
|
|
865
|
+
onFolderShare: v === "bin" ? void 0 : Tn,
|
|
866
|
+
onFolderDelete: v === "bin" ? zn : Ln,
|
|
867
|
+
onFolderRestore: v === "bin" ? Rn : void 0,
|
|
868
|
+
onFolderRename: v === "bin" ? void 0 : Bn,
|
|
869
|
+
onFolderFavorite: v === "bin" ? void 0 : Hn,
|
|
870
|
+
onFolderMove: v === "bin" ? void 0 : Vn,
|
|
871
|
+
onFolderInfo: Un
|
|
872
|
+
}), !j && (k.length > 0 || A.length > 0) && /* @__PURE__ */ l("div", {
|
|
878
873
|
className: "mt-4 px-2 text-sm text-text-secondary",
|
|
879
|
-
children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count:
|
|
874
|
+
children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: k.length + A.length }), !x && v === "all" && jt !== null && ` ${a(d, "files.browser.results.ofItems", "of {{count}} items", { count: jt })}`]
|
|
880
875
|
})]
|
|
881
876
|
}),
|
|
882
|
-
Mt && /* @__PURE__ */ c(
|
|
877
|
+
Mt && /* @__PURE__ */ c(mt, {
|
|
883
878
|
open: !0,
|
|
884
879
|
onOpenChange: (e) => {
|
|
885
|
-
!e && !Z.isPending && (
|
|
880
|
+
!e && !Z.isPending && (F(!1), K(""));
|
|
886
881
|
},
|
|
887
|
-
children: /* @__PURE__ */ l(
|
|
882
|
+
children: /* @__PURE__ */ l(ht, {
|
|
888
883
|
className: "w-full max-w-xs",
|
|
889
884
|
children: [
|
|
890
|
-
/* @__PURE__ */ c(
|
|
885
|
+
/* @__PURE__ */ c(_t, {
|
|
891
886
|
className: "text-left",
|
|
892
|
-
children: /* @__PURE__ */ c(
|
|
887
|
+
children: /* @__PURE__ */ c(vt, {
|
|
893
888
|
id: "files-new-folder-title",
|
|
894
889
|
className: "text-base font-semibold text-text-primary",
|
|
895
890
|
children: a(d, "files.browser.newFolderDialog.title", "New folder")
|
|
896
891
|
})
|
|
897
892
|
}),
|
|
898
|
-
/* @__PURE__ */ c(
|
|
893
|
+
/* @__PURE__ */ c(dt, {
|
|
899
894
|
type: "text",
|
|
900
|
-
value:
|
|
901
|
-
onChange: (e) =>
|
|
895
|
+
value: G,
|
|
896
|
+
onChange: (e) => K(e.target.value),
|
|
902
897
|
onKeyDown: (e) => {
|
|
903
|
-
e.key === "Enter" &&
|
|
898
|
+
e.key === "Enter" && Sn();
|
|
904
899
|
},
|
|
905
900
|
"aria-label": a(d, "files.browser.newFolderDialog.title", "New folder"),
|
|
906
901
|
placeholder: a(d, "files.browser.newFolderDialog.placeholder", "Folder name")
|
|
907
902
|
}),
|
|
908
|
-
/* @__PURE__ */ l(
|
|
903
|
+
/* @__PURE__ */ l(gt, { children: [/* @__PURE__ */ c(u, {
|
|
909
904
|
type: "button",
|
|
910
905
|
variant: "outline",
|
|
911
906
|
onClick: () => {
|
|
912
|
-
|
|
907
|
+
F(!1), K("");
|
|
913
908
|
},
|
|
914
909
|
children: a(d, "files.common.actions.cancel", "Cancel")
|
|
915
910
|
}), /* @__PURE__ */ l(u, {
|
|
916
911
|
type: "button",
|
|
917
|
-
onClick:
|
|
918
|
-
disabled: !
|
|
912
|
+
onClick: Sn,
|
|
913
|
+
disabled: !G.trim() || Z.isPending,
|
|
919
914
|
children: [Z.isPending && /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), Z.isPending ? a(d, "files.browser.newFolderDialog.actions.creating", "Creating...") : a(d, "files.common.actions.create", "Create")]
|
|
920
915
|
})] })
|
|
921
916
|
]
|
|
922
917
|
})
|
|
923
918
|
}),
|
|
924
|
-
Lt &&
|
|
919
|
+
Lt && V && /* @__PURE__ */ c(mt, {
|
|
925
920
|
open: !0,
|
|
926
921
|
onOpenChange: (e) => {
|
|
927
|
-
!e && !Q.isPending && !$.isPending && (
|
|
922
|
+
!e && !Q.isPending && !$.isPending && (I(!1), H(null), W(""));
|
|
928
923
|
},
|
|
929
|
-
children: /* @__PURE__ */ l(
|
|
924
|
+
children: /* @__PURE__ */ l(ht, {
|
|
930
925
|
className: "w-full max-w-xs",
|
|
931
926
|
children: [
|
|
932
|
-
/* @__PURE__ */ c(
|
|
927
|
+
/* @__PURE__ */ c(_t, {
|
|
933
928
|
className: "text-left",
|
|
934
|
-
children: /* @__PURE__ */ c(
|
|
929
|
+
children: /* @__PURE__ */ c(vt, {
|
|
935
930
|
id: "files-rename-title",
|
|
936
931
|
className: "text-base font-semibold text-text-primary",
|
|
937
|
-
children: a(d, "files.browser.renameDialog.title", "Rename {{type}}", { type:
|
|
932
|
+
children: a(d, "files.browser.renameDialog.title", "Rename {{type}}", { type: V.type })
|
|
938
933
|
})
|
|
939
934
|
}),
|
|
940
|
-
/* @__PURE__ */ c(
|
|
935
|
+
/* @__PURE__ */ c(dt, {
|
|
941
936
|
type: "text",
|
|
942
|
-
value:
|
|
943
|
-
onChange: (e) =>
|
|
937
|
+
value: U,
|
|
938
|
+
onChange: (e) => W(e.target.value),
|
|
944
939
|
onKeyDown: (e) => {
|
|
945
|
-
e.key === "Enter" &&
|
|
940
|
+
e.key === "Enter" && Kn();
|
|
946
941
|
},
|
|
947
942
|
"aria-label": a(d, "files.browser.renameDialog.title", "Rename"),
|
|
948
943
|
placeholder: a(d, "files.browser.renameDialog.placeholder", "New name")
|
|
949
944
|
}),
|
|
950
|
-
/* @__PURE__ */ l(
|
|
945
|
+
/* @__PURE__ */ l(gt, { children: [/* @__PURE__ */ c(u, {
|
|
951
946
|
type: "button",
|
|
952
947
|
variant: "outline",
|
|
953
948
|
onClick: () => {
|
|
954
|
-
|
|
949
|
+
I(!1), H(null), W("");
|
|
955
950
|
},
|
|
956
951
|
children: a(d, "files.common.actions.cancel", "Cancel")
|
|
957
952
|
}), /* @__PURE__ */ l(u, {
|
|
958
953
|
type: "button",
|
|
959
|
-
onClick:
|
|
960
|
-
disabled: !
|
|
954
|
+
onClick: Kn,
|
|
955
|
+
disabled: !U.trim() || U.trim() === V.name || Q.isPending || $.isPending,
|
|
961
956
|
children: [(Q.isPending || $.isPending) && /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), Q.isPending || $.isPending ? a(d, "files.browser.renameDialog.actions.renaming", "Renaming...") : a(d, "files.common.actions.rename", "Rename")]
|
|
962
957
|
})] })
|
|
963
958
|
]
|
|
964
959
|
})
|
|
965
960
|
}),
|
|
966
|
-
Rt && Ht && /* @__PURE__ */ c(
|
|
961
|
+
Rt && Ht && /* @__PURE__ */ c(Oe, {
|
|
967
962
|
item: Ht,
|
|
968
963
|
itemType: "mimeType" in Ht ? "file" : "folder",
|
|
969
964
|
onClose: () => {
|
|
970
|
-
|
|
965
|
+
L(!1), Ut(null);
|
|
971
966
|
},
|
|
972
|
-
onCreateShare:
|
|
973
|
-
isLoading:
|
|
967
|
+
onCreateShare: En,
|
|
968
|
+
isLoading: cn.isPending
|
|
974
969
|
}),
|
|
975
|
-
J && /* @__PURE__ */ c(
|
|
970
|
+
J && /* @__PURE__ */ c(Ie, {
|
|
976
971
|
title: J.title,
|
|
977
972
|
description: J.description,
|
|
978
973
|
confirmLabel: J.confirmLabel,
|
|
979
974
|
cancelLabel: a(d, "files.common.actions.cancel", "Cancel"),
|
|
980
975
|
variant: J.variant,
|
|
981
976
|
loading: J.loading,
|
|
982
|
-
onConfirm:
|
|
977
|
+
onConfirm: Qt,
|
|
983
978
|
onCancel: () => {
|
|
984
979
|
J.loading || Y(null);
|
|
985
980
|
}
|
|
986
981
|
}),
|
|
987
|
-
Nt && /* @__PURE__ */ c(
|
|
982
|
+
Nt && /* @__PURE__ */ c(Ie, {
|
|
988
983
|
title: a(d, "files.folder.quota.title", "Folder Limit Reached"),
|
|
989
984
|
description: a(d, "files.folder.quota.description", "You've reached the folder limit for your plan. Upgrade your plan or purchase an add-on to create more folders."),
|
|
990
985
|
confirmLabel: a(d, "files.folder.quota.upgrade", "View Billing"),
|
|
@@ -994,7 +989,7 @@ function d() {
|
|
|
994
989
|
},
|
|
995
990
|
onCancel: () => Pt(!1)
|
|
996
991
|
}),
|
|
997
|
-
Ft && /* @__PURE__ */ c(
|
|
992
|
+
Ft && /* @__PURE__ */ c(Ie, {
|
|
998
993
|
title: a(d, "files.storage.quota.title", "Storage Limit Reached"),
|
|
999
994
|
description: a(d, "files.storage.quota.description", "You've reached the storage limit for your plan. Upgrade your plan or delete files to continue uploading."),
|
|
1000
995
|
confirmLabel: a(d, "files.storage.quota.upgrade", "View Billing"),
|
|
@@ -1004,57 +999,58 @@ function d() {
|
|
|
1004
999
|
},
|
|
1005
1000
|
onCancel: () => It(!1)
|
|
1006
1001
|
}),
|
|
1007
|
-
zt &&
|
|
1008
|
-
item:
|
|
1009
|
-
type:
|
|
1002
|
+
zt && z && /* @__PURE__ */ c(Pe, {
|
|
1003
|
+
item: z.item,
|
|
1004
|
+
type: z.type,
|
|
1010
1005
|
onClose: () => {
|
|
1011
|
-
|
|
1006
|
+
R(!1), Wt(null);
|
|
1012
1007
|
},
|
|
1013
|
-
onMove:
|
|
1014
|
-
isLoading:
|
|
1008
|
+
onMove: Wn,
|
|
1009
|
+
isLoading: dn.isPending || fn.isPending
|
|
1015
1010
|
}),
|
|
1016
|
-
Bt &&
|
|
1017
|
-
item:
|
|
1018
|
-
type:
|
|
1011
|
+
Bt && B && /* @__PURE__ */ c(Fe, {
|
|
1012
|
+
item: B.item,
|
|
1013
|
+
type: B.type,
|
|
1019
1014
|
onClose: () => {
|
|
1020
|
-
Vt(!1),
|
|
1015
|
+
Vt(!1), Gt(null);
|
|
1021
1016
|
},
|
|
1022
|
-
onCopy:
|
|
1023
|
-
isLoading:
|
|
1017
|
+
onCopy: Gn,
|
|
1018
|
+
isLoading: un.isPending
|
|
1024
1019
|
}),
|
|
1025
|
-
|
|
1026
|
-
file:
|
|
1020
|
+
S && /* @__PURE__ */ c(ke, {
|
|
1021
|
+
file: S,
|
|
1027
1022
|
onClose: () => At(null),
|
|
1028
1023
|
onDownload: () => {
|
|
1029
|
-
|
|
1024
|
+
let e = S.downloadUrl || S.url;
|
|
1025
|
+
e && He(e);
|
|
1030
1026
|
},
|
|
1031
|
-
onShare:
|
|
1032
|
-
|
|
1027
|
+
onShare: v === "bin" ? void 0 : () => {
|
|
1028
|
+
Ut(S), L(!0);
|
|
1033
1029
|
},
|
|
1034
|
-
onStar:
|
|
1035
|
-
onDelete: () =>
|
|
1030
|
+
onStar: v === "bin" ? void 0 : () => An(S),
|
|
1031
|
+
onDelete: () => v === "bin" ? kn(S) : Dn(S)
|
|
1036
1032
|
}),
|
|
1037
|
-
Ot && /* @__PURE__ */ c(
|
|
1033
|
+
Ot && /* @__PURE__ */ c(Ae, {
|
|
1038
1034
|
item: Ot.item,
|
|
1039
1035
|
type: Ot.type,
|
|
1040
1036
|
onClose: () => kt(null)
|
|
1041
1037
|
}),
|
|
1042
|
-
/* @__PURE__ */ c(
|
|
1043
|
-
items:
|
|
1044
|
-
isOpen:
|
|
1045
|
-
onClose: () =>
|
|
1046
|
-
onPause:
|
|
1047
|
-
onResume:
|
|
1048
|
-
onRetry:
|
|
1049
|
-
onCancel:
|
|
1038
|
+
/* @__PURE__ */ c(Le, {
|
|
1039
|
+
items: qt,
|
|
1040
|
+
isOpen: Jt,
|
|
1041
|
+
onClose: () => Xt(!1),
|
|
1042
|
+
onPause: gn,
|
|
1043
|
+
onResume: _n,
|
|
1044
|
+
onRetry: vn,
|
|
1045
|
+
onCancel: yn
|
|
1050
1046
|
}),
|
|
1051
|
-
/* @__PURE__ */ c(
|
|
1052
|
-
toasts:
|
|
1053
|
-
onClose:
|
|
1047
|
+
/* @__PURE__ */ c(Me, {
|
|
1048
|
+
toasts: C.toasts,
|
|
1049
|
+
onClose: C.removeToast
|
|
1054
1050
|
}),
|
|
1055
|
-
!
|
|
1051
|
+
!j && k.length === 0 && A.length === 0 && /* @__PURE__ */ c("div", {
|
|
1056
1052
|
className: "px-6 py-12",
|
|
1057
|
-
children:
|
|
1053
|
+
children: x ? /* @__PURE__ */ c(ut, {
|
|
1058
1054
|
illustration: "empty-search",
|
|
1059
1055
|
title: a(d, "files.browser.empty.search.title", "No results found"),
|
|
1060
1056
|
description: a(d, "files.browser.empty.search.description", "Try adjusting your search query or filters"),
|
|
@@ -1065,10 +1061,10 @@ function d() {
|
|
|
1065
1061
|
},
|
|
1066
1062
|
children: a(d, "files.browser.search.clear", "Clear search")
|
|
1067
1063
|
})
|
|
1068
|
-
}) : /* @__PURE__ */ c(
|
|
1069
|
-
type:
|
|
1070
|
-
onUpload:
|
|
1071
|
-
onNewFolder:
|
|
1064
|
+
}) : /* @__PURE__ */ c(je, {
|
|
1065
|
+
type: v,
|
|
1066
|
+
onUpload: v === "all" ? mn : void 0,
|
|
1067
|
+
onNewFolder: v === "all" ? xn : void 0
|
|
1072
1068
|
})
|
|
1073
1069
|
})
|
|
1074
1070
|
]
|