@muhgholy/next-drive 0.1.1 → 1.0.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 +25 -6
- package/dist/client/index.d.ts +1 -6
- package/dist/client/index.js +405 -571
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.d.ts +33 -1
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/package.json +5 -3
package/dist/client/index.js
CHANGED
|
@@ -413,7 +413,7 @@ var useUpload = (apiEndpoint, activeAccountId, onUploadComplete) => {
|
|
|
413
413
|
};
|
|
414
414
|
|
|
415
415
|
// src/client/file-chooser.tsx
|
|
416
|
-
import { useState as
|
|
416
|
+
import { useState as useState6, useCallback as useCallback4, useMemo as useMemo3, useEffect as useEffect5 } from "react";
|
|
417
417
|
|
|
418
418
|
// src/client/utils.tsx
|
|
419
419
|
import { clsx } from "clsx";
|
|
@@ -459,7 +459,7 @@ var matchesMimeFilter = (mime, isFolder, filter) => {
|
|
|
459
459
|
|
|
460
460
|
// src/client/components/drive/explorer.tsx
|
|
461
461
|
import React7, { useMemo as useMemo2, useEffect as useEffect4, useRef as useRef3 } from "react";
|
|
462
|
-
import { Folder as Folder2, Loader2 as Loader22,
|
|
462
|
+
import { Folder as Folder2, Loader2 as Loader22, RotateCcw, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
463
463
|
import { isToday, isYesterday, startOfWeek, subWeeks, isAfter } from "date-fns";
|
|
464
464
|
|
|
465
465
|
// src/client/components/ui/context-menu.tsx
|
|
@@ -977,195 +977,9 @@ var DialogConfirmation = (props) => {
|
|
|
977
977
|
// src/client/components/drive/explorer.tsx
|
|
978
978
|
import { Pencil, Trash2 as Trash22, FolderPlus } from "lucide-react";
|
|
979
979
|
|
|
980
|
-
// src/client/components/ui/sheet.tsx
|
|
981
|
-
import * as React3 from "react";
|
|
982
|
-
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
983
|
-
import { cva as cva3 } from "class-variance-authority";
|
|
984
|
-
import { X as X2 } from "lucide-react";
|
|
985
|
-
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
986
|
-
var Sheet = SheetPrimitive.Root;
|
|
987
|
-
var SheetTrigger = SheetPrimitive.Trigger;
|
|
988
|
-
var SheetPortal = SheetPrimitive.Portal;
|
|
989
|
-
var SheetOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
990
|
-
SheetPrimitive.Overlay,
|
|
991
|
-
{
|
|
992
|
-
className: cn(
|
|
993
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
994
|
-
className
|
|
995
|
-
),
|
|
996
|
-
...props,
|
|
997
|
-
ref
|
|
998
|
-
}
|
|
999
|
-
));
|
|
1000
|
-
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
1001
|
-
var sheetVariants = cva3(
|
|
1002
|
-
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
1003
|
-
{
|
|
1004
|
-
variants: {
|
|
1005
|
-
side: {
|
|
1006
|
-
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
1007
|
-
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
1008
|
-
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
1009
|
-
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
1010
|
-
}
|
|
1011
|
-
},
|
|
1012
|
-
defaultVariants: {
|
|
1013
|
-
side: "right"
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
);
|
|
1017
|
-
var SheetContent = React3.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs4(SheetPortal, { children: [
|
|
1018
|
-
/* @__PURE__ */ jsx10(SheetOverlay, {}),
|
|
1019
|
-
/* @__PURE__ */ jsxs4(
|
|
1020
|
-
SheetPrimitive.Content,
|
|
1021
|
-
{
|
|
1022
|
-
ref,
|
|
1023
|
-
className: cn(sheetVariants({ side }), className),
|
|
1024
|
-
...props,
|
|
1025
|
-
children: [
|
|
1026
|
-
children,
|
|
1027
|
-
/* @__PURE__ */ jsxs4(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
1028
|
-
/* @__PURE__ */ jsx10(X2, { className: "h-4 w-4" }),
|
|
1029
|
-
/* @__PURE__ */ jsx10("span", { className: "sr-only", children: "Close" })
|
|
1030
|
-
] })
|
|
1031
|
-
]
|
|
1032
|
-
}
|
|
1033
|
-
)
|
|
1034
|
-
] }));
|
|
1035
|
-
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
1036
|
-
var SheetHeader = ({
|
|
1037
|
-
className,
|
|
1038
|
-
...props
|
|
1039
|
-
}) => /* @__PURE__ */ jsx10(
|
|
1040
|
-
"div",
|
|
1041
|
-
{
|
|
1042
|
-
className: cn(
|
|
1043
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
1044
|
-
className
|
|
1045
|
-
),
|
|
1046
|
-
...props
|
|
1047
|
-
}
|
|
1048
|
-
);
|
|
1049
|
-
SheetHeader.displayName = "SheetHeader";
|
|
1050
|
-
var SheetFooter = ({
|
|
1051
|
-
className,
|
|
1052
|
-
...props
|
|
1053
|
-
}) => /* @__PURE__ */ jsx10(
|
|
1054
|
-
"div",
|
|
1055
|
-
{
|
|
1056
|
-
className: cn(
|
|
1057
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
1058
|
-
className
|
|
1059
|
-
),
|
|
1060
|
-
...props
|
|
1061
|
-
}
|
|
1062
|
-
);
|
|
1063
|
-
SheetFooter.displayName = "SheetFooter";
|
|
1064
|
-
var SheetTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
1065
|
-
SheetPrimitive.Title,
|
|
1066
|
-
{
|
|
1067
|
-
ref,
|
|
1068
|
-
className: cn("text-lg font-semibold text-foreground", className),
|
|
1069
|
-
...props
|
|
1070
|
-
}
|
|
1071
|
-
));
|
|
1072
|
-
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
1073
|
-
var SheetDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
1074
|
-
SheetPrimitive.Description,
|
|
1075
|
-
{
|
|
1076
|
-
ref,
|
|
1077
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
1078
|
-
...props
|
|
1079
|
-
}
|
|
1080
|
-
));
|
|
1081
|
-
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
1082
|
-
|
|
1083
|
-
// src/client/components/drive/file/details.tsx
|
|
1084
|
-
import { Copy, FileText as FileText2, Calendar, HardDrive, Hash, Film, Image as ImageIcon } from "lucide-react";
|
|
1085
|
-
|
|
1086
|
-
// src/client/components/ui/separator.tsx
|
|
1087
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
1088
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1089
|
-
function Separator2({
|
|
1090
|
-
className,
|
|
1091
|
-
orientation = "horizontal",
|
|
1092
|
-
decorative = true,
|
|
1093
|
-
...props
|
|
1094
|
-
}) {
|
|
1095
|
-
return /* @__PURE__ */ jsx11(
|
|
1096
|
-
SeparatorPrimitive.Root,
|
|
1097
|
-
{
|
|
1098
|
-
"data-slot": "separator",
|
|
1099
|
-
decorative,
|
|
1100
|
-
orientation,
|
|
1101
|
-
className: cn(
|
|
1102
|
-
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
1103
|
-
className
|
|
1104
|
-
),
|
|
1105
|
-
...props
|
|
1106
|
-
}
|
|
1107
|
-
);
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
// src/client/components/drive/file/details.tsx
|
|
1111
|
-
import { Fragment, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1112
|
-
var DriveFileDetails = (props) => {
|
|
1113
|
-
const { item, isOpen, onClose, apiEndpoint } = props;
|
|
1114
|
-
if (!item) return null;
|
|
1115
|
-
const isFile = item.information.type === "FILE";
|
|
1116
|
-
const isFolder = item.information.type === "FOLDER";
|
|
1117
|
-
const tokenParam = item.token ? `&token=${item.token}` : "";
|
|
1118
|
-
const thumbnailUrl = `${apiEndpoint}?action=thumbnail&id=${item.id}&size=medium${tokenParam}`;
|
|
1119
|
-
const fileUrl = `${apiEndpoint}?action=serve&id=${item.id}${tokenParam}`;
|
|
1120
|
-
const DetailItem = ({ icon: Icon, label, value }) => /* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-3 py-3", children: [
|
|
1121
|
-
/* @__PURE__ */ jsx12(Icon, { className: "size-4 text-muted-foreground mt-0.5" }),
|
|
1122
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex-1 space-y-0.5", children: [
|
|
1123
|
-
/* @__PURE__ */ jsx12("p", { className: "text-xs font-medium text-muted-foreground", children: label }),
|
|
1124
|
-
/* @__PURE__ */ jsx12("div", { className: "text-sm text-foreground break-all", children: value })
|
|
1125
|
-
] })
|
|
1126
|
-
] });
|
|
1127
|
-
return /* @__PURE__ */ jsx12(Sheet, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxs5(SheetContent, { className: "w-[90%] sm:max-w-md overflow-y-auto", children: [
|
|
1128
|
-
/* @__PURE__ */ jsxs5(SheetHeader, { className: "pb-4", children: [
|
|
1129
|
-
/* @__PURE__ */ jsx12(SheetTitle, { children: "Details" }),
|
|
1130
|
-
/* @__PURE__ */ jsx12(SheetDescription, { children: "View information about this item." })
|
|
1131
|
-
] }),
|
|
1132
|
-
/* @__PURE__ */ jsxs5("div", { className: "space-y-6", children: [
|
|
1133
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-center p-6 bg-muted/20 rounded-lg border", children: [
|
|
1134
|
-
item.information.type === "FILE" && (item.information.mime.startsWith("image/") || item.information.mime.startsWith("video/")) ? /* @__PURE__ */ jsx12("div", { className: "aspect-video w-full rounded-md overflow-hidden bg-background border shadow-sm flex items-center justify-center", children: /* @__PURE__ */ jsx12("img", { src: thumbnailUrl, alt: item.name, className: "object-contain size-full" }) }) : /* @__PURE__ */ jsx12("div", { className: "size-20 bg-muted rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx12(FileText2, { className: "size-10 text-muted-foreground" }) }),
|
|
1135
|
-
/* @__PURE__ */ jsx12("h3", { className: "mt-4 font-medium text-center break-all", children: item.name }),
|
|
1136
|
-
/* @__PURE__ */ jsx12("p", { className: "text-xs text-muted-foreground mt-1", children: item.information.type === "FOLDER" ? "Folder" : item.information.mime })
|
|
1137
|
-
] }),
|
|
1138
|
-
/* @__PURE__ */ jsx12(Separator2, {}),
|
|
1139
|
-
/* @__PURE__ */ jsxs5("div", { className: "space-y-1", children: [
|
|
1140
|
-
/* @__PURE__ */ jsx12(DetailItem, { icon: HardDrive, label: "Size", value: item.information.type === "FOLDER" ? "-" : formatBytes(item.information.sizeInBytes) }),
|
|
1141
|
-
/* @__PURE__ */ jsx12(DetailItem, { icon: Calendar, label: "Created", value: new Date(item.createdAt).toLocaleString() }),
|
|
1142
|
-
item.information.type === "FILE" && /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1143
|
-
/* @__PURE__ */ jsx12(DetailItem, { icon: FileText2, label: "Type", value: item.information.mime }),
|
|
1144
|
-
item.information.width && /* @__PURE__ */ jsx12(DetailItem, { icon: ImageIcon, label: "Dimensions", value: `${item.information.width} x ${item.information.height}` }),
|
|
1145
|
-
item.information.duration && /* @__PURE__ */ jsx12(DetailItem, { icon: Film, label: "Duration", value: `${Math.round(item.information.duration)}s` }),
|
|
1146
|
-
item.information.hash && /* @__PURE__ */ jsx12(DetailItem, { icon: Hash, label: "Hash (SHA-256)", value: /* @__PURE__ */ jsxs5("span", { className: "font-mono text-xs", children: [
|
|
1147
|
-
item.information.hash.substring(0, 16),
|
|
1148
|
-
"..."
|
|
1149
|
-
] }) })
|
|
1150
|
-
] })
|
|
1151
|
-
] }),
|
|
1152
|
-
/* @__PURE__ */ jsx12(Separator2, {}),
|
|
1153
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex gap-2", children: [
|
|
1154
|
-
item.information.type === "FILE" && /* @__PURE__ */ jsx12(Button, { className: "w-full", variant: "outline", onClick: () => window.open(fileUrl, "_blank"), children: "Download / View" }),
|
|
1155
|
-
/* @__PURE__ */ jsxs5(Button, { className: "w-full", variant: "secondary", onClick: () => {
|
|
1156
|
-
navigator.clipboard.writeText(item.id);
|
|
1157
|
-
}, children: [
|
|
1158
|
-
/* @__PURE__ */ jsx12(Copy, { className: "mr-2 size-3.5" }),
|
|
1159
|
-
" Copy ID"
|
|
1160
|
-
] })
|
|
1161
|
-
] })
|
|
1162
|
-
] })
|
|
1163
|
-
] }) });
|
|
1164
|
-
};
|
|
1165
|
-
|
|
1166
980
|
// src/client/components/drive/path-bar.tsx
|
|
1167
981
|
import { useDroppable } from "@dnd-kit/core";
|
|
1168
|
-
import { jsx as
|
|
982
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1169
983
|
var DroppablePathItem = (props) => {
|
|
1170
984
|
const { id, name, isLast, onClick } = props;
|
|
1171
985
|
const { currentFolderId } = useDrive();
|
|
@@ -1176,7 +990,7 @@ var DroppablePathItem = (props) => {
|
|
|
1176
990
|
});
|
|
1177
991
|
const isCurrentFolder = id === currentFolderId;
|
|
1178
992
|
if (isLast) {
|
|
1179
|
-
return /* @__PURE__ */
|
|
993
|
+
return /* @__PURE__ */ jsx10(
|
|
1180
994
|
"span",
|
|
1181
995
|
{
|
|
1182
996
|
ref: setNodeRef,
|
|
@@ -1190,7 +1004,7 @@ var DroppablePathItem = (props) => {
|
|
|
1190
1004
|
}
|
|
1191
1005
|
);
|
|
1192
1006
|
}
|
|
1193
|
-
return /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ jsx10(
|
|
1194
1008
|
Button,
|
|
1195
1009
|
{
|
|
1196
1010
|
ref: setNodeRef,
|
|
@@ -1209,11 +1023,11 @@ var DroppablePathItem = (props) => {
|
|
|
1209
1023
|
};
|
|
1210
1024
|
var DrivePathBar = () => {
|
|
1211
1025
|
const { path, navigateToFolder } = useDrive();
|
|
1212
|
-
return /* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ jsx10("ol", { className: "flex items-center gap-1 sm:gap-1.5 text-sm text-muted-foreground bg-muted/30 px-2 sm:px-3 py-1.5 sm:py-2 rounded-md border w-full overflow-x-auto flex-nowrap min-w-0", "aria-label": "Breadcrumb", role: "navigation", children: path.map((item, index) => {
|
|
1213
1027
|
const isLast = index === path.length - 1;
|
|
1214
|
-
return /* @__PURE__ */
|
|
1215
|
-
index > 0 && /* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1028
|
+
return /* @__PURE__ */ jsxs4("li", { className: "flex items-center gap-1 sm:gap-1.5 shrink-0", children: [
|
|
1029
|
+
index > 0 && /* @__PURE__ */ jsx10("span", { className: "text-muted-foreground/50 text-xs", "aria-hidden": "true", children: "/" }),
|
|
1030
|
+
/* @__PURE__ */ jsx10(
|
|
1217
1031
|
DroppablePathItem,
|
|
1218
1032
|
{
|
|
1219
1033
|
id: item.id,
|
|
@@ -1227,19 +1041,19 @@ var DrivePathBar = () => {
|
|
|
1227
1041
|
};
|
|
1228
1042
|
|
|
1229
1043
|
// src/client/components/drive/upload.tsx
|
|
1230
|
-
import
|
|
1231
|
-
import { Upload as UploadIcon, X as
|
|
1044
|
+
import React3, { useState as useState4, useRef as useRef2, useCallback as useCallback3 } from "react";
|
|
1045
|
+
import { Upload as UploadIcon, X as X2, Loader2, CheckCircle2, AlertCircle as AlertCircle2, Clock } from "lucide-react";
|
|
1232
1046
|
|
|
1233
1047
|
// src/client/components/ui/progress.tsx
|
|
1234
1048
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
1235
|
-
import { jsx as
|
|
1049
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1236
1050
|
function Progress({
|
|
1237
1051
|
className,
|
|
1238
1052
|
value,
|
|
1239
1053
|
indicatorClassName,
|
|
1240
1054
|
...props
|
|
1241
1055
|
}) {
|
|
1242
|
-
return /* @__PURE__ */
|
|
1056
|
+
return /* @__PURE__ */ jsx11(
|
|
1243
1057
|
ProgressPrimitive.Root,
|
|
1244
1058
|
{
|
|
1245
1059
|
"data-slot": "progress",
|
|
@@ -1248,7 +1062,7 @@ function Progress({
|
|
|
1248
1062
|
className
|
|
1249
1063
|
),
|
|
1250
1064
|
...props,
|
|
1251
|
-
children: /* @__PURE__ */
|
|
1065
|
+
children: /* @__PURE__ */ jsx11(
|
|
1252
1066
|
ProgressPrimitive.Indicator,
|
|
1253
1067
|
{
|
|
1254
1068
|
"data-slot": "progress-indicator",
|
|
@@ -1261,19 +1075,19 @@ function Progress({
|
|
|
1261
1075
|
}
|
|
1262
1076
|
|
|
1263
1077
|
// src/client/components/drive/upload.tsx
|
|
1264
|
-
import { Fragment
|
|
1078
|
+
import { Fragment, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1265
1079
|
var UploadStatusIcon = ({ status }) => {
|
|
1266
1080
|
switch (status) {
|
|
1267
1081
|
case "complete":
|
|
1268
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ jsx12(CheckCircle2, { className: "size-4 text-emerald-500" });
|
|
1269
1083
|
case "error":
|
|
1270
|
-
return /* @__PURE__ */
|
|
1084
|
+
return /* @__PURE__ */ jsx12(AlertCircle2, { className: "size-4 text-destructive" });
|
|
1271
1085
|
case "cancelled":
|
|
1272
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ jsx12(X2, { className: "size-4 text-muted-foreground" });
|
|
1273
1087
|
case "uploading":
|
|
1274
|
-
return /* @__PURE__ */
|
|
1088
|
+
return /* @__PURE__ */ jsx12(Loader2, { className: "size-4 text-primary animate-spin" });
|
|
1275
1089
|
default:
|
|
1276
|
-
return /* @__PURE__ */
|
|
1090
|
+
return /* @__PURE__ */ jsx12(Clock, { className: "size-4 text-muted-foreground" });
|
|
1277
1091
|
}
|
|
1278
1092
|
};
|
|
1279
1093
|
var DriveUpload = (props) => {
|
|
@@ -1286,7 +1100,7 @@ var DriveUpload = (props) => {
|
|
|
1286
1100
|
refreshItems();
|
|
1287
1101
|
onComplete?.(null);
|
|
1288
1102
|
});
|
|
1289
|
-
|
|
1103
|
+
React3.useEffect(() => {
|
|
1290
1104
|
if (!showUploadsDialog || uploads.length === 0) return;
|
|
1291
1105
|
const allFinished = uploads.every(
|
|
1292
1106
|
(u) => ["complete", "error", "cancelled"].includes(u.status)
|
|
@@ -1316,10 +1130,10 @@ var DriveUpload = (props) => {
|
|
|
1316
1130
|
}, [handleFiles]);
|
|
1317
1131
|
const hasUploadsInProgress = uploads.some((u) => ["uploading", "queued", "pending"].includes(u.status));
|
|
1318
1132
|
const activeUploads = uploads.filter((u) => ["uploading", "queued", "pending"].includes(u.status));
|
|
1319
|
-
const renderDialog = () => /* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
/* @__PURE__ */
|
|
1322
|
-
hasUploadsInProgress && /* @__PURE__ */
|
|
1133
|
+
const renderDialog = () => /* @__PURE__ */ jsx12(Dialog, { open: showUploadsDialog, onOpenChange: setShowUploadsDialog, children: /* @__PURE__ */ jsxs5(DialogContent, { className: "sm:max-w-md p-0 gap-0", children: [
|
|
1134
|
+
/* @__PURE__ */ jsxs5(DialogHeader, { className: "px-4 py-3 border-b flex-row items-center justify-between space-y-0", children: [
|
|
1135
|
+
/* @__PURE__ */ jsx12(DialogTitle, { className: "text-base", children: "Upload Status" }),
|
|
1136
|
+
hasUploadsInProgress && /* @__PURE__ */ jsx12(
|
|
1323
1137
|
Button,
|
|
1324
1138
|
{
|
|
1325
1139
|
type: "button",
|
|
@@ -1331,16 +1145,16 @@ var DriveUpload = (props) => {
|
|
|
1331
1145
|
}
|
|
1332
1146
|
)
|
|
1333
1147
|
] }),
|
|
1334
|
-
/* @__PURE__ */
|
|
1335
|
-
uploads.length === 0 && /* @__PURE__ */
|
|
1148
|
+
/* @__PURE__ */ jsxs5("div", { className: "divide-y max-h-80 overflow-y-auto", children: [
|
|
1149
|
+
uploads.length === 0 && /* @__PURE__ */ jsx12("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "No uploads" }),
|
|
1336
1150
|
uploads.map((upload) => {
|
|
1337
1151
|
const percent = upload.status === "complete" ? 100 : upload.status === "error" || !upload.totalChunks ? 0 : Math.round(upload.currentChunk / upload.totalChunks * 100);
|
|
1338
|
-
return /* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
/* @__PURE__ */
|
|
1341
|
-
/* @__PURE__ */
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1152
|
+
return /* @__PURE__ */ jsxs5("div", { className: "px-4 py-2.5", children: [
|
|
1153
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-2 mb-1.5", children: [
|
|
1154
|
+
/* @__PURE__ */ jsx12(UploadStatusIcon, { status: upload.status }),
|
|
1155
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex-1 min-w-0", children: [
|
|
1156
|
+
/* @__PURE__ */ jsx12("p", { className: "text-sm font-medium truncate", children: upload.name }),
|
|
1157
|
+
/* @__PURE__ */ jsxs5("p", { className: cn(
|
|
1344
1158
|
"text-xs",
|
|
1345
1159
|
upload.status === "error" ? "text-destructive" : "text-muted-foreground"
|
|
1346
1160
|
), children: [
|
|
@@ -1352,7 +1166,7 @@ var DriveUpload = (props) => {
|
|
|
1352
1166
|
upload.status === "cancelled" && "Upload cancelled"
|
|
1353
1167
|
] })
|
|
1354
1168
|
] }),
|
|
1355
|
-
["uploading", "queued", "pending"].includes(upload.status) && /* @__PURE__ */
|
|
1169
|
+
["uploading", "queued", "pending"].includes(upload.status) && /* @__PURE__ */ jsx12(
|
|
1356
1170
|
Button,
|
|
1357
1171
|
{
|
|
1358
1172
|
type: "button",
|
|
@@ -1360,13 +1174,13 @@ var DriveUpload = (props) => {
|
|
|
1360
1174
|
variant: "ghost",
|
|
1361
1175
|
className: "shrink-0 text-muted-foreground hover:text-destructive",
|
|
1362
1176
|
onClick: () => cancelUpload(upload.id),
|
|
1363
|
-
children: /* @__PURE__ */
|
|
1177
|
+
children: /* @__PURE__ */ jsx12(X2, { className: "size-3.5" })
|
|
1364
1178
|
}
|
|
1365
1179
|
)
|
|
1366
1180
|
] }),
|
|
1367
|
-
upload.status === "uploading" && /* @__PURE__ */
|
|
1368
|
-
/* @__PURE__ */
|
|
1369
|
-
/* @__PURE__ */
|
|
1181
|
+
upload.status === "uploading" && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 pl-6", children: [
|
|
1182
|
+
/* @__PURE__ */ jsx12(Progress, { value: percent, className: "flex-1" }),
|
|
1183
|
+
/* @__PURE__ */ jsxs5("span", { className: "text-xs tabular-nums text-muted-foreground w-8", children: [
|
|
1370
1184
|
percent,
|
|
1371
1185
|
"%"
|
|
1372
1186
|
] })
|
|
@@ -1376,13 +1190,13 @@ var DriveUpload = (props) => {
|
|
|
1376
1190
|
] })
|
|
1377
1191
|
] }) });
|
|
1378
1192
|
if (compact) {
|
|
1379
|
-
return /* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1193
|
+
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1194
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
1195
|
+
/* @__PURE__ */ jsx12("input", { ref: inputRef, type: "file", multiple: true, onChange: (e) => {
|
|
1382
1196
|
handleFiles(e.target.files);
|
|
1383
1197
|
e.target.value = "";
|
|
1384
1198
|
}, className: "hidden", "aria-hidden": "true" }),
|
|
1385
|
-
/* @__PURE__ */
|
|
1199
|
+
/* @__PURE__ */ jsxs5(
|
|
1386
1200
|
Button,
|
|
1387
1201
|
{
|
|
1388
1202
|
onClick: () => inputRef.current?.click(),
|
|
@@ -1390,12 +1204,12 @@ var DriveUpload = (props) => {
|
|
|
1390
1204
|
size: "sm",
|
|
1391
1205
|
disabled: hasUploadsInProgress,
|
|
1392
1206
|
children: [
|
|
1393
|
-
/* @__PURE__ */
|
|
1207
|
+
/* @__PURE__ */ jsx12(UploadIcon, { className: "size-4 mr-1.5" }),
|
|
1394
1208
|
" Upload Files"
|
|
1395
1209
|
]
|
|
1396
1210
|
}
|
|
1397
1211
|
),
|
|
1398
|
-
uploads.length > 0 && /* @__PURE__ */
|
|
1212
|
+
uploads.length > 0 && /* @__PURE__ */ jsxs5(
|
|
1399
1213
|
Button,
|
|
1400
1214
|
{
|
|
1401
1215
|
type: "button",
|
|
@@ -1403,7 +1217,7 @@ var DriveUpload = (props) => {
|
|
|
1403
1217
|
size: "sm",
|
|
1404
1218
|
onClick: () => setShowUploadsDialog(true),
|
|
1405
1219
|
children: [
|
|
1406
|
-
activeUploads.length > 0 && /* @__PURE__ */
|
|
1220
|
+
activeUploads.length > 0 && /* @__PURE__ */ jsx12(Loader2, { className: "size-3.5 mr-1.5 animate-spin" }),
|
|
1407
1221
|
activeUploads.length > 0 ? `Uploading (${activeUploads.length})` : "Upload Status"
|
|
1408
1222
|
]
|
|
1409
1223
|
}
|
|
@@ -1412,8 +1226,8 @@ var DriveUpload = (props) => {
|
|
|
1412
1226
|
renderDialog()
|
|
1413
1227
|
] });
|
|
1414
1228
|
}
|
|
1415
|
-
return /* @__PURE__ */
|
|
1416
|
-
/* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ jsxs5("div", { className: "w-full", children: [
|
|
1230
|
+
/* @__PURE__ */ jsxs5(
|
|
1417
1231
|
"div",
|
|
1418
1232
|
{
|
|
1419
1233
|
className: cn(
|
|
@@ -1429,18 +1243,18 @@ var DriveUpload = (props) => {
|
|
|
1429
1243
|
tabIndex: 0,
|
|
1430
1244
|
onKeyDown: (e) => e.key === "Enter" && inputRef.current?.click(),
|
|
1431
1245
|
children: [
|
|
1432
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ jsx12("input", { ref: inputRef, type: "file", multiple: true, onChange: (e) => {
|
|
1433
1247
|
handleFiles(e.target.files);
|
|
1434
1248
|
e.target.value = "";
|
|
1435
1249
|
}, className: "hidden", "aria-hidden": "true" }),
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
/* @__PURE__ */
|
|
1250
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-center gap-2 text-center", children: [
|
|
1251
|
+
/* @__PURE__ */ jsx12("div", { className: "p-3 rounded-full bg-background border shadow-sm", children: /* @__PURE__ */ jsx12(UploadIcon, { className: "size-6 text-muted-foreground" }) }),
|
|
1252
|
+
/* @__PURE__ */ jsx12("div", { className: "text-sm font-medium text-foreground", children: isDragging ? "Drop files here" : "Click or drag files to upload" })
|
|
1439
1253
|
] })
|
|
1440
1254
|
]
|
|
1441
1255
|
}
|
|
1442
1256
|
),
|
|
1443
|
-
hasUploadsInProgress && /* @__PURE__ */
|
|
1257
|
+
hasUploadsInProgress && /* @__PURE__ */ jsx12("div", { className: "mt-4 text-center", children: /* @__PURE__ */ jsx12(Button, { variant: "link", onClick: () => setShowUploadsDialog(true), children: "View Upload Progress" }) }),
|
|
1444
1258
|
renderDialog()
|
|
1445
1259
|
] });
|
|
1446
1260
|
};
|
|
@@ -1448,7 +1262,7 @@ var DriveUpload = (props) => {
|
|
|
1448
1262
|
// src/client/components/drive/sidebar.tsx
|
|
1449
1263
|
import {
|
|
1450
1264
|
Database,
|
|
1451
|
-
HardDrive
|
|
1265
|
+
HardDrive,
|
|
1452
1266
|
Plus,
|
|
1453
1267
|
LogOut,
|
|
1454
1268
|
Check as Check3,
|
|
@@ -1459,14 +1273,14 @@ import {
|
|
|
1459
1273
|
} from "lucide-react";
|
|
1460
1274
|
|
|
1461
1275
|
// src/client/components/ui/dropdown-menu.tsx
|
|
1462
|
-
import * as
|
|
1276
|
+
import * as React4 from "react";
|
|
1463
1277
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1464
1278
|
import { Check as Check2, ChevronRight as ChevronRight2, Circle as Circle2 } from "lucide-react";
|
|
1465
|
-
import { jsx as
|
|
1279
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1466
1280
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1467
1281
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1468
1282
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
1469
|
-
var DropdownMenuSubTrigger =
|
|
1283
|
+
var DropdownMenuSubTrigger = React4.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs6(
|
|
1470
1284
|
DropdownMenuPrimitive.SubTrigger,
|
|
1471
1285
|
{
|
|
1472
1286
|
ref,
|
|
@@ -1478,12 +1292,12 @@ var DropdownMenuSubTrigger = React5.forwardRef(({ className, inset, children, ..
|
|
|
1478
1292
|
...props,
|
|
1479
1293
|
children: [
|
|
1480
1294
|
children,
|
|
1481
|
-
/* @__PURE__ */
|
|
1295
|
+
/* @__PURE__ */ jsx13(ChevronRight2, { className: "ml-auto h-4 w-4" })
|
|
1482
1296
|
]
|
|
1483
1297
|
}
|
|
1484
1298
|
));
|
|
1485
1299
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1486
|
-
var DropdownMenuSubContent =
|
|
1300
|
+
var DropdownMenuSubContent = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1487
1301
|
DropdownMenuPrimitive.SubContent,
|
|
1488
1302
|
{
|
|
1489
1303
|
ref,
|
|
@@ -1495,7 +1309,7 @@ var DropdownMenuSubContent = React5.forwardRef(({ className, ...props }, ref) =>
|
|
|
1495
1309
|
}
|
|
1496
1310
|
));
|
|
1497
1311
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1498
|
-
var DropdownMenuContent =
|
|
1312
|
+
var DropdownMenuContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx13(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx13(
|
|
1499
1313
|
DropdownMenuPrimitive.Content,
|
|
1500
1314
|
{
|
|
1501
1315
|
ref,
|
|
@@ -1508,7 +1322,7 @@ var DropdownMenuContent = React5.forwardRef(({ className, sideOffset = 4, ...pro
|
|
|
1508
1322
|
}
|
|
1509
1323
|
) }));
|
|
1510
1324
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1511
|
-
var DropdownMenuItem =
|
|
1325
|
+
var DropdownMenuItem = React4.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1512
1326
|
DropdownMenuPrimitive.Item,
|
|
1513
1327
|
{
|
|
1514
1328
|
ref,
|
|
@@ -1521,7 +1335,7 @@ var DropdownMenuItem = React5.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
1521
1335
|
}
|
|
1522
1336
|
));
|
|
1523
1337
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1524
|
-
var DropdownMenuCheckboxItem =
|
|
1338
|
+
var DropdownMenuCheckboxItem = React4.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs6(
|
|
1525
1339
|
DropdownMenuPrimitive.CheckboxItem,
|
|
1526
1340
|
{
|
|
1527
1341
|
ref,
|
|
@@ -1532,13 +1346,13 @@ var DropdownMenuCheckboxItem = React5.forwardRef(({ className, children, checked
|
|
|
1532
1346
|
checked,
|
|
1533
1347
|
...props,
|
|
1534
1348
|
children: [
|
|
1535
|
-
/* @__PURE__ */
|
|
1349
|
+
/* @__PURE__ */ jsx13("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx13(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx13(Check2, { className: "h-4 w-4" }) }) }),
|
|
1536
1350
|
children
|
|
1537
1351
|
]
|
|
1538
1352
|
}
|
|
1539
1353
|
));
|
|
1540
1354
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1541
|
-
var DropdownMenuRadioItem =
|
|
1355
|
+
var DropdownMenuRadioItem = React4.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(
|
|
1542
1356
|
DropdownMenuPrimitive.RadioItem,
|
|
1543
1357
|
{
|
|
1544
1358
|
ref,
|
|
@@ -1548,13 +1362,13 @@ var DropdownMenuRadioItem = React5.forwardRef(({ className, children, ...props }
|
|
|
1548
1362
|
),
|
|
1549
1363
|
...props,
|
|
1550
1364
|
children: [
|
|
1551
|
-
/* @__PURE__ */
|
|
1365
|
+
/* @__PURE__ */ jsx13("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx13(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx13(Circle2, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1552
1366
|
children
|
|
1553
1367
|
]
|
|
1554
1368
|
}
|
|
1555
1369
|
));
|
|
1556
1370
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1557
|
-
var DropdownMenuLabel =
|
|
1371
|
+
var DropdownMenuLabel = React4.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1558
1372
|
DropdownMenuPrimitive.Label,
|
|
1559
1373
|
{
|
|
1560
1374
|
ref,
|
|
@@ -1567,7 +1381,7 @@ var DropdownMenuLabel = React5.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1567
1381
|
}
|
|
1568
1382
|
));
|
|
1569
1383
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1570
|
-
var DropdownMenuSeparator =
|
|
1384
|
+
var DropdownMenuSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1571
1385
|
DropdownMenuPrimitive.Separator,
|
|
1572
1386
|
{
|
|
1573
1387
|
ref,
|
|
@@ -1580,7 +1394,7 @@ var DropdownMenuShortcut = ({
|
|
|
1580
1394
|
className,
|
|
1581
1395
|
...props
|
|
1582
1396
|
}) => {
|
|
1583
|
-
return /* @__PURE__ */
|
|
1397
|
+
return /* @__PURE__ */ jsx13(
|
|
1584
1398
|
"span",
|
|
1585
1399
|
{
|
|
1586
1400
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
@@ -1590,10 +1404,113 @@ var DropdownMenuShortcut = ({
|
|
|
1590
1404
|
};
|
|
1591
1405
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1592
1406
|
|
|
1407
|
+
// src/client/components/ui/sheet.tsx
|
|
1408
|
+
import * as React5 from "react";
|
|
1409
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
1410
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
1411
|
+
import { X as X3 } from "lucide-react";
|
|
1412
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1413
|
+
var Sheet = SheetPrimitive.Root;
|
|
1414
|
+
var SheetTrigger = SheetPrimitive.Trigger;
|
|
1415
|
+
var SheetPortal = SheetPrimitive.Portal;
|
|
1416
|
+
var SheetOverlay = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1417
|
+
SheetPrimitive.Overlay,
|
|
1418
|
+
{
|
|
1419
|
+
className: cn(
|
|
1420
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1421
|
+
className
|
|
1422
|
+
),
|
|
1423
|
+
...props,
|
|
1424
|
+
ref
|
|
1425
|
+
}
|
|
1426
|
+
));
|
|
1427
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
1428
|
+
var sheetVariants = cva3(
|
|
1429
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
1430
|
+
{
|
|
1431
|
+
variants: {
|
|
1432
|
+
side: {
|
|
1433
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
1434
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
1435
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
1436
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
defaultVariants: {
|
|
1440
|
+
side: "right"
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
);
|
|
1444
|
+
var SheetContent = React5.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs7(SheetPortal, { children: [
|
|
1445
|
+
/* @__PURE__ */ jsx14(SheetOverlay, {}),
|
|
1446
|
+
/* @__PURE__ */ jsxs7(
|
|
1447
|
+
SheetPrimitive.Content,
|
|
1448
|
+
{
|
|
1449
|
+
ref,
|
|
1450
|
+
className: cn(sheetVariants({ side }), className),
|
|
1451
|
+
...props,
|
|
1452
|
+
children: [
|
|
1453
|
+
children,
|
|
1454
|
+
/* @__PURE__ */ jsxs7(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
1455
|
+
/* @__PURE__ */ jsx14(X3, { className: "h-4 w-4" }),
|
|
1456
|
+
/* @__PURE__ */ jsx14("span", { className: "sr-only", children: "Close" })
|
|
1457
|
+
] })
|
|
1458
|
+
]
|
|
1459
|
+
}
|
|
1460
|
+
)
|
|
1461
|
+
] }));
|
|
1462
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
1463
|
+
var SheetHeader = ({
|
|
1464
|
+
className,
|
|
1465
|
+
...props
|
|
1466
|
+
}) => /* @__PURE__ */ jsx14(
|
|
1467
|
+
"div",
|
|
1468
|
+
{
|
|
1469
|
+
className: cn(
|
|
1470
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
1471
|
+
className
|
|
1472
|
+
),
|
|
1473
|
+
...props
|
|
1474
|
+
}
|
|
1475
|
+
);
|
|
1476
|
+
SheetHeader.displayName = "SheetHeader";
|
|
1477
|
+
var SheetFooter = ({
|
|
1478
|
+
className,
|
|
1479
|
+
...props
|
|
1480
|
+
}) => /* @__PURE__ */ jsx14(
|
|
1481
|
+
"div",
|
|
1482
|
+
{
|
|
1483
|
+
className: cn(
|
|
1484
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
1485
|
+
className
|
|
1486
|
+
),
|
|
1487
|
+
...props
|
|
1488
|
+
}
|
|
1489
|
+
);
|
|
1490
|
+
SheetFooter.displayName = "SheetFooter";
|
|
1491
|
+
var SheetTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1492
|
+
SheetPrimitive.Title,
|
|
1493
|
+
{
|
|
1494
|
+
ref,
|
|
1495
|
+
className: cn("text-lg font-semibold text-foreground", className),
|
|
1496
|
+
...props
|
|
1497
|
+
}
|
|
1498
|
+
));
|
|
1499
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
1500
|
+
var SheetDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1501
|
+
SheetPrimitive.Description,
|
|
1502
|
+
{
|
|
1503
|
+
ref,
|
|
1504
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
1505
|
+
...props
|
|
1506
|
+
}
|
|
1507
|
+
));
|
|
1508
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
1509
|
+
|
|
1593
1510
|
// src/client/components/drive/storage/indicator.tsx
|
|
1594
1511
|
import { useEffect as useEffect3 } from "react";
|
|
1595
1512
|
import { Cloud, AlertCircle as AlertCircle3 } from "lucide-react";
|
|
1596
|
-
import { Fragment as
|
|
1513
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1597
1514
|
var DriveStorageIndicator = (props) => {
|
|
1598
1515
|
const { compact = false, className } = props;
|
|
1599
1516
|
const { quota, refreshQuota } = useDrive();
|
|
@@ -1607,31 +1524,31 @@ var DriveStorageIndicator = (props) => {
|
|
|
1607
1524
|
const stateColor = isFull ? "text-destructive" : isNearFull ? "text-yellow-600 dark:text-yellow-500" : "text-primary";
|
|
1608
1525
|
const solidColor = isFull ? "bg-destructive" : isNearFull ? "bg-yellow-500" : "bg-primary";
|
|
1609
1526
|
if (compact) {
|
|
1610
|
-
return /* @__PURE__ */
|
|
1611
|
-
/* @__PURE__ */
|
|
1612
|
-
/* @__PURE__ */
|
|
1527
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn("flex items-center gap-3 text-xs font-medium text-muted-foreground", className), children: [
|
|
1528
|
+
/* @__PURE__ */ jsxs8("span", { className: "shrink-0 flex items-center gap-1.5", children: [
|
|
1529
|
+
/* @__PURE__ */ jsx15(Cloud, { className: "size-3.5" }),
|
|
1613
1530
|
"Storage"
|
|
1614
1531
|
] }),
|
|
1615
|
-
/* @__PURE__ */
|
|
1616
|
-
/* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ jsx15(Progress, { value: percentage, indicatorClassName: cn("bg-gradient-to-r from-blue-500 to-cyan-500", isNearFull && "from-yellow-500 to-orange-500", isFull && "bg-destructive"), className: "w-24 sm:w-32" }),
|
|
1533
|
+
/* @__PURE__ */ jsxs8("span", { className: "shrink-0 whitespace-nowrap", children: [
|
|
1617
1534
|
formatBytes(usedInBytes),
|
|
1618
1535
|
" / ",
|
|
1619
1536
|
formatBytes(totalInBytes)
|
|
1620
1537
|
] })
|
|
1621
1538
|
] });
|
|
1622
1539
|
}
|
|
1623
|
-
return /* @__PURE__ */
|
|
1624
|
-
/* @__PURE__ */
|
|
1625
|
-
/* @__PURE__ */
|
|
1626
|
-
/* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1540
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1541
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between gap-2 mb-2", children: [
|
|
1542
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
|
|
1543
|
+
/* @__PURE__ */ jsx15(Cloud, { className: cn("size-4", stateColor) }),
|
|
1544
|
+
/* @__PURE__ */ jsx15("span", { className: "text-xs font-medium text-muted-foreground", children: "Storage" })
|
|
1628
1545
|
] }),
|
|
1629
|
-
/* @__PURE__ */
|
|
1546
|
+
/* @__PURE__ */ jsxs8("span", { className: "text-xs font-semibold tabular-nums", children: [
|
|
1630
1547
|
percentage,
|
|
1631
1548
|
"%"
|
|
1632
1549
|
] })
|
|
1633
1550
|
] }),
|
|
1634
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ jsx15(
|
|
1635
1552
|
Progress,
|
|
1636
1553
|
{
|
|
1637
1554
|
value: percentage,
|
|
@@ -1642,22 +1559,22 @@ var DriveStorageIndicator = (props) => {
|
|
|
1642
1559
|
)
|
|
1643
1560
|
}
|
|
1644
1561
|
),
|
|
1645
|
-
/* @__PURE__ */
|
|
1646
|
-
/* @__PURE__ */
|
|
1647
|
-
/* @__PURE__ */
|
|
1562
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex justify-between items-center mt-1.5", children: [
|
|
1563
|
+
/* @__PURE__ */ jsx15("span", { className: "text-[10px] text-muted-foreground tabular-nums", children: formatBytes(usedInBytes) }),
|
|
1564
|
+
/* @__PURE__ */ jsx15("span", { className: "text-[10px] text-muted-foreground tabular-nums", children: formatBytes(totalInBytes) })
|
|
1648
1565
|
] }),
|
|
1649
|
-
isNearFull && /* @__PURE__ */
|
|
1566
|
+
isNearFull && /* @__PURE__ */ jsxs8("div", { className: cn(
|
|
1650
1567
|
"flex items-center gap-1.5 text-[10px] font-medium px-2 py-1 rounded-md mt-2",
|
|
1651
1568
|
isFull ? "bg-destructive/10 text-destructive" : "bg-yellow-500/10 text-yellow-600 dark:text-yellow-500"
|
|
1652
1569
|
), children: [
|
|
1653
|
-
/* @__PURE__ */
|
|
1654
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ jsx15(AlertCircle3, { className: "size-3 shrink-0" }),
|
|
1571
|
+
/* @__PURE__ */ jsx15("span", { children: isFull ? "Storage full" : "Almost full" })
|
|
1655
1572
|
] })
|
|
1656
1573
|
] });
|
|
1657
1574
|
};
|
|
1658
1575
|
|
|
1659
1576
|
// src/client/components/drive/sidebar.tsx
|
|
1660
|
-
import { Fragment as
|
|
1577
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1661
1578
|
var SidebarContent = () => {
|
|
1662
1579
|
const {
|
|
1663
1580
|
accounts,
|
|
@@ -1670,33 +1587,33 @@ var SidebarContent = () => {
|
|
|
1670
1587
|
} = useDrive();
|
|
1671
1588
|
const currentAccountName = activeAccountId ? accounts.find((a) => a.id === activeAccountId)?.name || "Unknown Account" : "Local Storage";
|
|
1672
1589
|
const currentAccountEmail = activeAccountId ? accounts.find((a) => a.id === activeAccountId)?.email : "On this device";
|
|
1673
|
-
return /* @__PURE__ */
|
|
1674
|
-
/* @__PURE__ */
|
|
1675
|
-
/* @__PURE__ */
|
|
1676
|
-
/* @__PURE__ */
|
|
1677
|
-
/* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */
|
|
1590
|
+
return /* @__PURE__ */ jsxs9("div", { className: "w-full h-full flex flex-col bg-muted/10 border-r", children: [
|
|
1591
|
+
/* @__PURE__ */ jsx16("div", { className: "p-3 border-b", children: /* @__PURE__ */ jsxs9(DropdownMenu, { children: [
|
|
1592
|
+
/* @__PURE__ */ jsx16(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs9(Button, { variant: "ghost", className: "w-full justify-between px-2 h-auto min-h-12 py-2 hover:bg-muted/50", children: [
|
|
1593
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2 sm:gap-3 text-left min-w-0 flex-1", children: [
|
|
1594
|
+
/* @__PURE__ */ jsx16("div", { className: "size-8 sm:size-9 rounded-md bg-primary/10 flex items-center justify-center shrink-0", children: activeAccountId ? /* @__PURE__ */ jsx16(Database, { className: "size-4" }) : /* @__PURE__ */ jsx16(HardDrive, { className: "size-4" }) }),
|
|
1595
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col truncate min-w-0", children: [
|
|
1596
|
+
/* @__PURE__ */ jsx16("span", { className: "text-sm font-semibold truncate", children: currentAccountName }),
|
|
1597
|
+
/* @__PURE__ */ jsx16("span", { className: "text-xs text-muted-foreground truncate font-normal", children: currentAccountEmail })
|
|
1681
1598
|
] })
|
|
1682
1599
|
] }),
|
|
1683
|
-
/* @__PURE__ */
|
|
1600
|
+
/* @__PURE__ */ jsx16(ChevronsUpDown, { className: "size-4 text-muted-foreground shrink-0 opacity-50 ml-1" })
|
|
1684
1601
|
] }) }),
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
/* @__PURE__ */
|
|
1687
|
-
/* @__PURE__ */
|
|
1688
|
-
/* @__PURE__ */
|
|
1689
|
-
/* @__PURE__ */
|
|
1690
|
-
activeAccountId === null && /* @__PURE__ */
|
|
1602
|
+
/* @__PURE__ */ jsxs9(DropdownMenuContent, { className: "w-60", align: "start", children: [
|
|
1603
|
+
/* @__PURE__ */ jsx16(DropdownMenuLabel, { className: "text-xs font-normal text-muted-foreground", children: "Switch Account" }),
|
|
1604
|
+
/* @__PURE__ */ jsxs9(DropdownMenuItem, { onClick: () => setActiveAccountId(null), className: "gap-2", children: [
|
|
1605
|
+
/* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center size-6 rounded bg-muted", children: /* @__PURE__ */ jsx16(HardDrive, { className: "size-3.5" }) }),
|
|
1606
|
+
/* @__PURE__ */ jsx16("div", { className: "flex flex-col flex-1", children: /* @__PURE__ */ jsx16("span", { className: "text-sm font-medium", children: "Local Storage" }) }),
|
|
1607
|
+
activeAccountId === null && /* @__PURE__ */ jsx16(Check3, { className: "size-3.5 text-primary" })
|
|
1691
1608
|
] }),
|
|
1692
|
-
accounts.length > 0 && /* @__PURE__ */
|
|
1693
|
-
accounts.map((account) => /* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
1696
|
-
/* @__PURE__ */
|
|
1697
|
-
/* @__PURE__ */
|
|
1609
|
+
accounts.length > 0 && /* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
|
|
1610
|
+
accounts.map((account) => /* @__PURE__ */ jsxs9(DropdownMenuItem, { onClick: () => setActiveAccountId(account.id), className: "gap-2 group", children: [
|
|
1611
|
+
/* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center size-6 rounded bg-muted", children: /* @__PURE__ */ jsx16(Database, { className: "size-3.5" }) }),
|
|
1612
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col flex-1 overflow-hidden", children: [
|
|
1613
|
+
/* @__PURE__ */ jsx16("span", { className: "text-sm font-medium truncate", children: account.name }),
|
|
1614
|
+
/* @__PURE__ */ jsx16("span", { className: "text-xs text-muted-foreground truncate", children: account.email })
|
|
1698
1615
|
] }),
|
|
1699
|
-
activeAccountId === account.id ? /* @__PURE__ */
|
|
1616
|
+
activeAccountId === account.id ? /* @__PURE__ */ jsx16(Check3, { className: "size-3.5 text-primary" }) : /* @__PURE__ */ jsx16(
|
|
1700
1617
|
LogOut,
|
|
1701
1618
|
{
|
|
1702
1619
|
className: "size-3.5 text-destructive transition-opacity hover:bg-destructive/10 rounded-sm",
|
|
@@ -1711,13 +1628,13 @@ var SidebarContent = () => {
|
|
|
1711
1628
|
}
|
|
1712
1629
|
)
|
|
1713
1630
|
] }, account.id)),
|
|
1714
|
-
/* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1716
|
-
/* @__PURE__ */
|
|
1717
|
-
/* @__PURE__ */
|
|
1718
|
-
/* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
|
|
1632
|
+
/* @__PURE__ */ jsxs9(DropdownMenuSub, { children: [
|
|
1633
|
+
/* @__PURE__ */ jsxs9(DropdownMenuSubTrigger, { className: "gap-2 text-primary focus:text-primary", children: [
|
|
1634
|
+
/* @__PURE__ */ jsx16(Plus, { className: "size-4" }),
|
|
1635
|
+
/* @__PURE__ */ jsx16("span", { className: "font-medium", children: "Add Storage Account" })
|
|
1719
1636
|
] }),
|
|
1720
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ jsx16(DropdownMenuSubContent, { children: /* @__PURE__ */ jsx16(DropdownMenuItem, { onClick: async () => {
|
|
1721
1638
|
const res = await callAPI("getAuthUrl", { query: { provider: "GOOGLE" } });
|
|
1722
1639
|
if (res.status !== 200 || !res.data?.url) {
|
|
1723
1640
|
alert(res.message || "Failed to initialize account connection");
|
|
@@ -1745,51 +1662,51 @@ var SidebarContent = () => {
|
|
|
1745
1662
|
] })
|
|
1746
1663
|
] })
|
|
1747
1664
|
] }) }),
|
|
1748
|
-
/* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
1665
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-1 px-3 py-2 space-y-1", children: [
|
|
1666
|
+
/* @__PURE__ */ jsxs9(
|
|
1750
1667
|
Button,
|
|
1751
1668
|
{
|
|
1752
1669
|
variant: currentView !== "TRASH" ? "secondary" : "ghost",
|
|
1753
1670
|
className: cn("w-full justify-start gap-3", currentView !== "TRASH" && "bg-primary/10 text-primary hover:bg-primary/15"),
|
|
1754
1671
|
onClick: () => setCurrentView("BROWSE"),
|
|
1755
1672
|
children: [
|
|
1756
|
-
/* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ jsx16(FolderOpen, { className: "size-4" }),
|
|
1757
1674
|
"My Files"
|
|
1758
1675
|
]
|
|
1759
1676
|
}
|
|
1760
1677
|
),
|
|
1761
|
-
/* @__PURE__ */
|
|
1678
|
+
/* @__PURE__ */ jsxs9(
|
|
1762
1679
|
Button,
|
|
1763
1680
|
{
|
|
1764
1681
|
variant: currentView === "TRASH" ? "secondary" : "ghost",
|
|
1765
1682
|
className: cn("w-full justify-start gap-3", currentView === "TRASH" && "bg-destructive/10 text-destructive hover:bg-destructive/15"),
|
|
1766
1683
|
onClick: () => setCurrentView("TRASH"),
|
|
1767
1684
|
children: [
|
|
1768
|
-
/* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ jsx16(Trash2, { className: "size-4" }),
|
|
1769
1686
|
"Trash"
|
|
1770
1687
|
]
|
|
1771
1688
|
}
|
|
1772
1689
|
)
|
|
1773
1690
|
] }),
|
|
1774
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ jsx16("div", { className: "px-3 py-2.5 mt-auto border-t bg-background/50", children: /* @__PURE__ */ jsx16(DriveStorageIndicator, {}) })
|
|
1775
1692
|
] });
|
|
1776
1693
|
};
|
|
1777
1694
|
var DriveSidebar = () => {
|
|
1778
|
-
return /* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1780
|
-
/* @__PURE__ */
|
|
1695
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
1696
|
+
/* @__PURE__ */ jsx16("div", { className: "lg:hidden", children: /* @__PURE__ */ jsxs9(Sheet, { children: [
|
|
1697
|
+
/* @__PURE__ */ jsx16(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
1781
1698
|
Button,
|
|
1782
1699
|
{
|
|
1783
1700
|
variant: "ghost",
|
|
1784
1701
|
size: "icon",
|
|
1785
1702
|
className: "h-9 w-9",
|
|
1786
1703
|
"aria-label": "Open menu",
|
|
1787
|
-
children: /* @__PURE__ */
|
|
1704
|
+
children: /* @__PURE__ */ jsx16(Menu, { className: "h-5 w-5" })
|
|
1788
1705
|
}
|
|
1789
1706
|
) }),
|
|
1790
|
-
/* @__PURE__ */
|
|
1707
|
+
/* @__PURE__ */ jsx16(SheetContent, { side: "left", className: "w-70 sm:w-80 p-0", children: /* @__PURE__ */ jsx16(SidebarContent, {}) })
|
|
1791
1708
|
] }) }),
|
|
1792
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ jsx16("div", { className: "hidden lg:flex w-full h-full", children: /* @__PURE__ */ jsx16(SidebarContent, {}) })
|
|
1793
1710
|
] });
|
|
1794
1711
|
};
|
|
1795
1712
|
|
|
@@ -1810,7 +1727,7 @@ import {
|
|
|
1810
1727
|
useSortable
|
|
1811
1728
|
} from "@dnd-kit/sortable";
|
|
1812
1729
|
import { CSS } from "@dnd-kit/utilities";
|
|
1813
|
-
import { Fragment as
|
|
1730
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1814
1731
|
var SortableItem = ({ id, children, disabled, isDragOverTarget }) => {
|
|
1815
1732
|
const {
|
|
1816
1733
|
attributes,
|
|
@@ -1827,7 +1744,7 @@ var SortableItem = ({ id, children, disabled, isDragOverTarget }) => {
|
|
|
1827
1744
|
zIndex: isDragging ? 50 : "auto",
|
|
1828
1745
|
position: "relative"
|
|
1829
1746
|
};
|
|
1830
|
-
return /* @__PURE__ */
|
|
1747
|
+
return /* @__PURE__ */ jsx17("div", { ref: setNodeRef, style, ...attributes, ...listeners, children });
|
|
1831
1748
|
};
|
|
1832
1749
|
var DriveExplorer = (props) => {
|
|
1833
1750
|
const { onItemClick, onItemDoubleClick, mimeFilter, className, selectableFolders = false } = props;
|
|
@@ -1862,7 +1779,6 @@ var DriveExplorer = (props) => {
|
|
|
1862
1779
|
});
|
|
1863
1780
|
const [itemToDelete, setItemToDelete] = React7.useState(null);
|
|
1864
1781
|
const [renameItem, setRenameItem] = React7.useState(null);
|
|
1865
|
-
const [detailsItem, setDetailsItem] = React7.useState(null);
|
|
1866
1782
|
const [dragOverFolderId, setDragOverFolderId] = React7.useState(null);
|
|
1867
1783
|
const [draggingItemId, setDraggingItemId] = React7.useState(null);
|
|
1868
1784
|
const sensors = useSensors(
|
|
@@ -2057,46 +1973,46 @@ var DriveExplorer = (props) => {
|
|
|
2057
1973
|
const enableDrag = currentView === "BROWSE";
|
|
2058
1974
|
const stateContent = (() => {
|
|
2059
1975
|
if (isLoading && items.length === 0) {
|
|
2060
|
-
return /* @__PURE__ */
|
|
1976
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center py-12 flex-1", children: /* @__PURE__ */ jsx17(Loader22, { className: "size-6 animate-spin text-muted-foreground" }) });
|
|
2061
1977
|
}
|
|
2062
1978
|
if (error) {
|
|
2063
|
-
return /* @__PURE__ */
|
|
1979
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center p-12 text-destructive bg-destructive/10 rounded-lg flex-1", children: error });
|
|
2064
1980
|
}
|
|
2065
1981
|
if (processedItems.length === 0) {
|
|
2066
|
-
return /* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
2068
|
-
/* @__PURE__ */
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
currentView === "BROWSE" && /* @__PURE__ */
|
|
1982
|
+
return /* @__PURE__ */ jsxs10(ContextMenu, { children: [
|
|
1983
|
+
/* @__PURE__ */ jsx17(ContextMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs10("div", { className: cn("flex flex-col items-center justify-center py-12 text-center flex-1", className), children: [
|
|
1984
|
+
/* @__PURE__ */ jsx17("div", { className: "size-12 rounded-full bg-muted flex items-center justify-center mb-3", children: /* @__PURE__ */ jsx17(Folder2, { className: "size-6 text-muted-foreground" }) }),
|
|
1985
|
+
/* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground", children: currentView === "SEARCH" ? "No files match your search" : currentView === "TRASH" ? "Trash is empty" : "No files found" }),
|
|
1986
|
+
currentView === "BROWSE" && /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground/60 mt-1", children: "Right-click to create a folder" })
|
|
2071
1987
|
] }) }),
|
|
2072
|
-
/* @__PURE__ */
|
|
2073
|
-
/* @__PURE__ */
|
|
1988
|
+
/* @__PURE__ */ jsx17(ContextMenuContent, { children: currentView === "BROWSE" ? /* @__PURE__ */ jsxs10(ContextMenuItem, { onClick: () => setDialogs((prev) => ({ ...prev, newFolder: true })), children: [
|
|
1989
|
+
/* @__PURE__ */ jsx17(FolderPlus, { className: "mr-2 size-4" }),
|
|
2074
1990
|
" New Folder"
|
|
2075
|
-
] }) : /* @__PURE__ */
|
|
1991
|
+
] }) : /* @__PURE__ */ jsx17("div", { className: "px-2 py-6 text-center", children: /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: "No actions available" }) }) })
|
|
2076
1992
|
] });
|
|
2077
1993
|
}
|
|
2078
1994
|
return null;
|
|
2079
1995
|
})();
|
|
2080
|
-
return /* @__PURE__ */
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2083
|
-
/* @__PURE__ */
|
|
2084
|
-
/* @__PURE__ */
|
|
1996
|
+
return /* @__PURE__ */ jsx17(DndContext, { sensors, collisionDetection: closestCenter, onDragStart: handleDragStart, onDragOver: handleDragOver, onDragEnd: handleDragEnd, children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-col h-full w-full overflow-hidden bg-background/50", children: [
|
|
1997
|
+
/* @__PURE__ */ jsxs10("div", { className: "h-14 px-3 sm:px-4 border-b bg-background/95 backdrop-blur-sm shrink-0 flex items-center gap-3", children: [
|
|
1998
|
+
/* @__PURE__ */ jsx17("div", { className: "lg:hidden", children: /* @__PURE__ */ jsx17(DriveSidebar, {}) }),
|
|
1999
|
+
/* @__PURE__ */ jsx17("div", { className: "hidden lg:flex flex-1 min-w-0", children: /* @__PURE__ */ jsx17(DrivePathBar, {}) }),
|
|
2000
|
+
/* @__PURE__ */ jsx17(DriveUpload, { compact: true, onComplete: () => refreshItems() })
|
|
2085
2001
|
] }),
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
stateContent || /* @__PURE__ */
|
|
2088
|
-
/* @__PURE__ */
|
|
2089
|
-
/* @__PURE__ */
|
|
2090
|
-
groupBy !== "NONE" && /* @__PURE__ */
|
|
2002
|
+
/* @__PURE__ */ jsx17("div", { className: "lg:hidden px-3 py-2 border-b bg-background/95 backdrop-blur-sm shrink-0", children: /* @__PURE__ */ jsx17(DrivePathBar, {}) }),
|
|
2003
|
+
stateContent || /* @__PURE__ */ jsxs10(ContextMenu, { children: [
|
|
2004
|
+
/* @__PURE__ */ jsx17(ContextMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs10("div", { className: cn("flex-1 overflow-y-auto min-h-0 container mx-auto p-2 sm:p-3 md:p-4", className), children: [
|
|
2005
|
+
/* @__PURE__ */ jsx17("div", { className: "space-y-4 sm:space-y-6 pb-8 sm:pb-12", children: Object.entries(groupedItems).map(([groupName, groupItems]) => /* @__PURE__ */ jsxs10("div", { className: "space-y-3", children: [
|
|
2006
|
+
groupBy !== "NONE" && /* @__PURE__ */ jsxs10("h3", { className: "text-sm font-medium text-muted-foreground flex items-center gap-2", children: [
|
|
2091
2007
|
groupName,
|
|
2092
2008
|
" ",
|
|
2093
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ jsxs10("span", { className: "text-xs opacity-50", children: [
|
|
2094
2010
|
"(",
|
|
2095
2011
|
groupItems.length,
|
|
2096
2012
|
")"
|
|
2097
2013
|
] })
|
|
2098
2014
|
] }),
|
|
2099
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ jsx17(SortableContext, { items: groupItems.map((i) => i.id), strategy: rectSortingStrategy, disabled: !enableDrag, children: /* @__PURE__ */ jsx17("div", { className: cn(
|
|
2100
2016
|
viewMode === "GRID" ? "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 2xl:grid-cols-7 gap-2 sm:gap-3 md:gap-4" : "flex flex-col gap-1"
|
|
2101
2017
|
), children: groupItems.map((item) => {
|
|
2102
2018
|
const isSelected = selectedFileIds.includes(item.id);
|
|
@@ -2106,8 +2022,8 @@ var DriveExplorer = (props) => {
|
|
|
2106
2022
|
const fileUrl = `${apiEndpoint}?action=serve&id=${item.id}${tokenParam}`;
|
|
2107
2023
|
const thumbnailUrl = `${apiEndpoint}?action=thumbnail&id=${item.id}&size=${viewMode === "GRID" ? "medium" : "small"}${tokenParam}`;
|
|
2108
2024
|
const isThumbnailable = !isFolder && item.information.type === "FILE" && (item.information.mime.startsWith("image/") || item.information.mime.startsWith("video/"));
|
|
2109
|
-
return /* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */
|
|
2025
|
+
return /* @__PURE__ */ jsx17(SortableItem, { id: item.id, disabled: !enableDrag, isDragOverTarget: isDragOver, children: /* @__PURE__ */ jsxs10(ContextMenu, { children: [
|
|
2026
|
+
/* @__PURE__ */ jsx17(ContextMenuTrigger, { children: /* @__PURE__ */ jsx17(
|
|
2111
2027
|
"div",
|
|
2112
2028
|
{
|
|
2113
2029
|
className: cn(
|
|
@@ -2124,78 +2040,65 @@ var DriveExplorer = (props) => {
|
|
|
2124
2040
|
onDoubleClick: (e) => handleItemDoubleClick(e, item),
|
|
2125
2041
|
role: "button",
|
|
2126
2042
|
tabIndex: 0,
|
|
2127
|
-
children: viewMode === "GRID" ? /* @__PURE__ */
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
isThumbnailable ? /* @__PURE__ */
|
|
2130
|
-
isSelected && /* @__PURE__ */
|
|
2131
|
-
isFolder && currentView === "BROWSE" && /* @__PURE__ */
|
|
2043
|
+
children: viewMode === "GRID" ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
2044
|
+
/* @__PURE__ */ jsxs10("div", { className: "aspect-square w-full bg-muted/20 flex items-center justify-center overflow-hidden relative", children: [
|
|
2045
|
+
isThumbnailable ? /* @__PURE__ */ jsx17("img", { src: thumbnailUrl, alt: item.name, className: "size-full object-contain transition-transform group-hover:scale-105 duration-300", loading: "lazy" }) : /* @__PURE__ */ jsx17("div", { className: "transition-transform group-hover:scale-110 duration-200", children: getFileIcon(item.information.type === "FILE" ? item.information.mime : "", isFolder, "size-10 text-muted-foreground/70") }),
|
|
2046
|
+
isSelected && /* @__PURE__ */ jsx17("div", { className: "absolute top-2 right-2 size-5 bg-primary rounded-full flex items-center justify-center shadow-sm animate-in zoom-in-50", children: /* @__PURE__ */ jsx17("div", { className: "size-2 bg-primary-foreground rounded-full" }) }),
|
|
2047
|
+
isFolder && currentView === "BROWSE" && /* @__PURE__ */ jsx17("div", { className: "absolute bottom-2 right-2 lg:hidden size-6 bg-primary/90 rounded-full flex items-center justify-center shadow-md", children: /* @__PURE__ */ jsx17(ChevronRight3, { className: "size-3.5 text-primary-foreground" }) })
|
|
2132
2048
|
] }),
|
|
2133
|
-
/* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */
|
|
2135
|
-
/* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ jsxs10("div", { className: "p-3", children: [
|
|
2050
|
+
/* @__PURE__ */ jsx17("div", { className: "flex items-start justify-between gap-2", children: /* @__PURE__ */ jsx17("span", { className: "text-sm font-medium truncate w-full text-card-foreground", title: item.name, children: item.name }) }),
|
|
2051
|
+
/* @__PURE__ */ jsx17("div", { className: "flex items-center justify-between mt-1 text-xs text-muted-foreground", children: /* @__PURE__ */ jsx17("span", { children: isFolder ? "Folder" : formatBytes(item.information.type === "FILE" ? item.information.sizeInBytes : 0) }) })
|
|
2136
2052
|
] })
|
|
2137
|
-
] }) : /* @__PURE__ */
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
isFolder && currentView === "BROWSE" && /* @__PURE__ */
|
|
2053
|
+
] }) : /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
2054
|
+
/* @__PURE__ */ jsx17("div", { className: "size-9 shrink-0 rounded-md overflow-hidden bg-muted/40 flex items-center justify-center border", children: isThumbnailable ? /* @__PURE__ */ jsx17("img", { src: thumbnailUrl, alt: item.name, className: "size-full object-contain", loading: "lazy" }) : getFileIcon(item.information.type === "FILE" ? item.information.mime : "", isFolder, "size-4 text-muted-foreground") }),
|
|
2055
|
+
/* @__PURE__ */ jsx17("span", { className: "text-sm font-medium truncate flex-1 text-card-foreground", title: item.name, children: item.name }),
|
|
2056
|
+
/* @__PURE__ */ jsx17("span", { className: "text-xs text-muted-foreground w-20 text-right", children: isFolder ? "-" : formatBytes(item.information.type === "FILE" ? item.information.sizeInBytes : 0) }),
|
|
2057
|
+
isFolder && currentView === "BROWSE" && /* @__PURE__ */ jsx17(ChevronRight3, { className: "size-4 text-muted-foreground lg:hidden shrink-0" })
|
|
2142
2058
|
] })
|
|
2143
2059
|
}
|
|
2144
2060
|
) }),
|
|
2145
|
-
/* @__PURE__ */
|
|
2146
|
-
/* @__PURE__ */
|
|
2061
|
+
/* @__PURE__ */ jsx17(ContextMenuContent, { children: currentView === "TRASH" ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
2062
|
+
/* @__PURE__ */ jsxs10(ContextMenuItem, { onClick: async () => {
|
|
2147
2063
|
await callAPI("restore", { method: "POST", query: { id: item.id } });
|
|
2148
2064
|
await refreshItems();
|
|
2149
2065
|
}, children: [
|
|
2150
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ jsx17(RotateCcw, { className: "mr-2 size-4" }),
|
|
2151
2067
|
" Restore"
|
|
2152
2068
|
] }),
|
|
2153
|
-
/* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */
|
|
2069
|
+
/* @__PURE__ */ jsx17(ContextMenuSeparator, {}),
|
|
2070
|
+
/* @__PURE__ */ jsxs10(ContextMenuItem, { className: "text-destructive focus:text-destructive", onClick: () => {
|
|
2155
2071
|
setItemToDelete(item);
|
|
2156
2072
|
setDialogs((prev) => ({ ...prev, delete: true }));
|
|
2157
2073
|
}, children: [
|
|
2158
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ jsx17(Trash22, { className: "mr-2 size-4" }),
|
|
2159
2075
|
" Delete Forever"
|
|
2160
2076
|
] })
|
|
2161
|
-
] }) : /* @__PURE__ */
|
|
2162
|
-
/* @__PURE__ */
|
|
2163
|
-
/* @__PURE__ */ jsx19(Info, { className: "mr-2 size-4" }),
|
|
2164
|
-
" Details"
|
|
2165
|
-
] }),
|
|
2166
|
-
/* @__PURE__ */ jsxs11(ContextMenuItem, { onClick: () => {
|
|
2077
|
+
] }) : /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
2078
|
+
/* @__PURE__ */ jsxs10(ContextMenuItem, { onClick: () => {
|
|
2167
2079
|
setRenameItem(item);
|
|
2168
2080
|
setDialogs((prev) => ({ ...prev, rename: true }));
|
|
2169
2081
|
}, children: [
|
|
2170
|
-
/* @__PURE__ */
|
|
2082
|
+
/* @__PURE__ */ jsx17(Pencil, { className: "mr-2 size-4" }),
|
|
2171
2083
|
" Rename"
|
|
2172
2084
|
] }),
|
|
2173
|
-
/* @__PURE__ */
|
|
2174
|
-
/* @__PURE__ */
|
|
2085
|
+
/* @__PURE__ */ jsx17(ContextMenuSeparator, {}),
|
|
2086
|
+
/* @__PURE__ */ jsxs10(ContextMenuItem, { className: "text-destructive focus:text-destructive", onClick: () => {
|
|
2175
2087
|
setItemToDelete(item);
|
|
2176
2088
|
setDialogs((prev) => ({ ...prev, delete: true }));
|
|
2177
2089
|
}, children: [
|
|
2178
|
-
/* @__PURE__ */
|
|
2090
|
+
/* @__PURE__ */ jsx17(Trash22, { className: "mr-2 size-4" }),
|
|
2179
2091
|
" Delete"
|
|
2180
2092
|
] })
|
|
2181
2093
|
] }) })
|
|
2182
2094
|
] }) }, item.id);
|
|
2183
2095
|
}) }) })
|
|
2184
2096
|
] }, groupName)) }),
|
|
2185
|
-
hasMore && /* @__PURE__ */
|
|
2186
|
-
isLoadingMore && /* @__PURE__ */
|
|
2187
|
-
!isLoadingMore && /* @__PURE__ */
|
|
2097
|
+
hasMore && /* @__PURE__ */ jsxs10("div", { ref: observerTarget, className: "flex justify-center py-4", children: [
|
|
2098
|
+
isLoadingMore && /* @__PURE__ */ jsx17(Loader22, { className: "size-6 animate-spin text-muted-foreground" }),
|
|
2099
|
+
!isLoadingMore && /* @__PURE__ */ jsx17("div", { className: "h-4 w-full" })
|
|
2188
2100
|
] }),
|
|
2189
|
-
/* @__PURE__ */
|
|
2190
|
-
DriveFileDetails,
|
|
2191
|
-
{
|
|
2192
|
-
item: detailsItem,
|
|
2193
|
-
isOpen: !!detailsItem,
|
|
2194
|
-
onClose: () => setDetailsItem(null),
|
|
2195
|
-
apiEndpoint
|
|
2196
|
-
}
|
|
2197
|
-
),
|
|
2198
|
-
/* @__PURE__ */ jsx19(
|
|
2101
|
+
/* @__PURE__ */ jsx17(
|
|
2199
2102
|
DialogConfirmation,
|
|
2200
2103
|
{
|
|
2201
2104
|
open: dialogs.newFolder,
|
|
@@ -2217,7 +2120,7 @@ var DriveExplorer = (props) => {
|
|
|
2217
2120
|
}
|
|
2218
2121
|
}
|
|
2219
2122
|
),
|
|
2220
|
-
/* @__PURE__ */
|
|
2123
|
+
/* @__PURE__ */ jsx17(
|
|
2221
2124
|
DialogConfirmation,
|
|
2222
2125
|
{
|
|
2223
2126
|
open: dialogs.rename,
|
|
@@ -2245,7 +2148,7 @@ var DriveExplorer = (props) => {
|
|
|
2245
2148
|
}
|
|
2246
2149
|
}
|
|
2247
2150
|
),
|
|
2248
|
-
/* @__PURE__ */
|
|
2151
|
+
/* @__PURE__ */ jsx17(
|
|
2249
2152
|
DialogConfirmation,
|
|
2250
2153
|
{
|
|
2251
2154
|
open: dialogs.delete,
|
|
@@ -2269,10 +2172,10 @@ var DriveExplorer = (props) => {
|
|
|
2269
2172
|
}
|
|
2270
2173
|
)
|
|
2271
2174
|
] }) }),
|
|
2272
|
-
/* @__PURE__ */
|
|
2273
|
-
/* @__PURE__ */
|
|
2175
|
+
/* @__PURE__ */ jsx17(ContextMenuContent, { children: currentView === "BROWSE" ? /* @__PURE__ */ jsxs10(ContextMenuItem, { onClick: () => setDialogs((prev) => ({ ...prev, newFolder: true })), children: [
|
|
2176
|
+
/* @__PURE__ */ jsx17(FolderPlus, { className: "mr-2 size-4" }),
|
|
2274
2177
|
" New Folder"
|
|
2275
|
-
] }) : /* @__PURE__ */
|
|
2178
|
+
] }) : /* @__PURE__ */ jsx17("div", { className: "px-2 py-6 text-center", children: /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: "No actions available" }) }) })
|
|
2276
2179
|
] })
|
|
2277
2180
|
] }) });
|
|
2278
2181
|
};
|
|
@@ -2285,7 +2188,7 @@ import {
|
|
|
2285
2188
|
LayoutGrid,
|
|
2286
2189
|
List,
|
|
2287
2190
|
Group as Group3,
|
|
2288
|
-
Calendar
|
|
2191
|
+
Calendar,
|
|
2289
2192
|
ArrowDownAZ,
|
|
2290
2193
|
ArrowUpAZ,
|
|
2291
2194
|
ArrowDown01,
|
|
@@ -2294,7 +2197,7 @@ import {
|
|
|
2294
2197
|
RotateCcw as RotateCcw2,
|
|
2295
2198
|
Menu as Menu2
|
|
2296
2199
|
} from "lucide-react";
|
|
2297
|
-
import { jsx as
|
|
2200
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2298
2201
|
var DriveHeader = () => {
|
|
2299
2202
|
const {
|
|
2300
2203
|
viewMode,
|
|
@@ -2317,20 +2220,20 @@ var DriveHeader = () => {
|
|
|
2317
2220
|
setSearchScope
|
|
2318
2221
|
} = useDrive();
|
|
2319
2222
|
const [dialogs, setDialogs] = useState5({ delete: false, emptyTrash: false });
|
|
2320
|
-
return /* @__PURE__ */
|
|
2321
|
-
(selectedFileIds.length > 0 || currentView === "TRASH") && /* @__PURE__ */
|
|
2322
|
-
/* @__PURE__ */
|
|
2223
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap items-center gap-2 border-b bg-muted/30 p-2", children: [
|
|
2224
|
+
(selectedFileIds.length > 0 || currentView === "TRASH") && /* @__PURE__ */ jsxs11(DropdownMenu, { children: [
|
|
2225
|
+
/* @__PURE__ */ jsx18(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx18(
|
|
2323
2226
|
Button,
|
|
2324
2227
|
{
|
|
2325
2228
|
type: "button",
|
|
2326
2229
|
variant: "outline",
|
|
2327
2230
|
size: "sm",
|
|
2328
2231
|
className: "gap-1.5",
|
|
2329
|
-
children: /* @__PURE__ */
|
|
2232
|
+
children: /* @__PURE__ */ jsx18(Menu2, { className: "size-4" })
|
|
2330
2233
|
}
|
|
2331
2234
|
) }),
|
|
2332
|
-
/* @__PURE__ */
|
|
2333
|
-
selectedFileIds.length > 0 && currentView === "TRASH" && /* @__PURE__ */
|
|
2235
|
+
/* @__PURE__ */ jsxs11(DropdownMenuContent, { align: "start", children: [
|
|
2236
|
+
selectedFileIds.length > 0 && currentView === "TRASH" && /* @__PURE__ */ jsxs11(
|
|
2334
2237
|
DropdownMenuItem,
|
|
2335
2238
|
{
|
|
2336
2239
|
onClick: async () => {
|
|
@@ -2345,20 +2248,20 @@ var DriveHeader = () => {
|
|
|
2345
2248
|
}
|
|
2346
2249
|
},
|
|
2347
2250
|
children: [
|
|
2348
|
-
/* @__PURE__ */
|
|
2251
|
+
/* @__PURE__ */ jsx18(RotateCcw2, { className: "size-3.5 mr-2" }),
|
|
2349
2252
|
"Restore (",
|
|
2350
2253
|
selectedFileIds.length,
|
|
2351
2254
|
")"
|
|
2352
2255
|
]
|
|
2353
2256
|
}
|
|
2354
2257
|
),
|
|
2355
|
-
selectedFileIds.length > 0 && /* @__PURE__ */
|
|
2258
|
+
selectedFileIds.length > 0 && /* @__PURE__ */ jsxs11(
|
|
2356
2259
|
DropdownMenuItem,
|
|
2357
2260
|
{
|
|
2358
2261
|
onClick: () => setDialogs((prev) => ({ ...prev, delete: true })),
|
|
2359
2262
|
className: "text-destructive focus:text-destructive",
|
|
2360
2263
|
children: [
|
|
2361
|
-
/* @__PURE__ */
|
|
2264
|
+
/* @__PURE__ */ jsx18(Trash23, { className: "size-3.5 mr-2" }),
|
|
2362
2265
|
currentView === "TRASH" ? "Delete Forever" : "Delete",
|
|
2363
2266
|
" (",
|
|
2364
2267
|
selectedFileIds.length,
|
|
@@ -2366,21 +2269,21 @@ var DriveHeader = () => {
|
|
|
2366
2269
|
]
|
|
2367
2270
|
}
|
|
2368
2271
|
),
|
|
2369
|
-
currentView === "TRASH" && selectedFileIds.length === 0 && /* @__PURE__ */
|
|
2272
|
+
currentView === "TRASH" && selectedFileIds.length === 0 && /* @__PURE__ */ jsxs11(
|
|
2370
2273
|
DropdownMenuItem,
|
|
2371
2274
|
{
|
|
2372
2275
|
onClick: () => setDialogs((prev) => ({ ...prev, emptyTrash: true })),
|
|
2373
2276
|
className: "text-destructive focus:text-destructive",
|
|
2374
2277
|
children: [
|
|
2375
|
-
/* @__PURE__ */
|
|
2278
|
+
/* @__PURE__ */ jsx18(Trash23, { className: "size-3.5 mr-2" }),
|
|
2376
2279
|
"Empty Trash"
|
|
2377
2280
|
]
|
|
2378
2281
|
}
|
|
2379
2282
|
)
|
|
2380
2283
|
] })
|
|
2381
2284
|
] }),
|
|
2382
|
-
/* @__PURE__ */
|
|
2383
|
-
/* @__PURE__ */
|
|
2285
|
+
/* @__PURE__ */ jsxs11(DropdownMenu, { children: [
|
|
2286
|
+
/* @__PURE__ */ jsx18(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs11(
|
|
2384
2287
|
Button,
|
|
2385
2288
|
{
|
|
2386
2289
|
type: "button",
|
|
@@ -2388,24 +2291,24 @@ var DriveHeader = () => {
|
|
|
2388
2291
|
size: "sm",
|
|
2389
2292
|
className: "gap-1.5",
|
|
2390
2293
|
children: [
|
|
2391
|
-
/* @__PURE__ */
|
|
2392
|
-
/* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ jsx18(Group3, { className: "size-3.5" }),
|
|
2295
|
+
/* @__PURE__ */ jsx18("span", { className: "hidden sm:inline", children: groupBy === "NONE" ? "Group" : "Grouped" })
|
|
2393
2296
|
]
|
|
2394
2297
|
}
|
|
2395
2298
|
) }),
|
|
2396
|
-
/* @__PURE__ */
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
groupBy === "NONE" && /* @__PURE__ */
|
|
2399
|
-
/* @__PURE__ */
|
|
2299
|
+
/* @__PURE__ */ jsxs11(DropdownMenuContent, { align: "start", children: [
|
|
2300
|
+
/* @__PURE__ */ jsxs11(DropdownMenuItem, { onClick: () => setGroupBy("NONE"), children: [
|
|
2301
|
+
groupBy === "NONE" && /* @__PURE__ */ jsx18(Check4, { className: "size-3.5 mr-2" }),
|
|
2302
|
+
/* @__PURE__ */ jsx18("span", { className: cn(groupBy !== "NONE" && "pl-5.5"), children: "No Grouping" })
|
|
2400
2303
|
] }),
|
|
2401
|
-
/* @__PURE__ */
|
|
2402
|
-
groupBy === "CREATED_AT" && /* @__PURE__ */
|
|
2403
|
-
/* @__PURE__ */
|
|
2304
|
+
/* @__PURE__ */ jsxs11(DropdownMenuItem, { onClick: () => setGroupBy("CREATED_AT"), children: [
|
|
2305
|
+
groupBy === "CREATED_AT" && /* @__PURE__ */ jsx18(Check4, { className: "size-3.5 mr-2" }),
|
|
2306
|
+
/* @__PURE__ */ jsx18("span", { className: cn(groupBy !== "CREATED_AT" && "pl-5.5"), children: "Created Date" })
|
|
2404
2307
|
] })
|
|
2405
2308
|
] })
|
|
2406
2309
|
] }),
|
|
2407
|
-
/* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex-1 min-w-0 sm:min-w-50 relative", children: [
|
|
2311
|
+
/* @__PURE__ */ jsx18(
|
|
2409
2312
|
Input,
|
|
2410
2313
|
{
|
|
2411
2314
|
type: "text",
|
|
@@ -2426,11 +2329,11 @@ var DriveHeader = () => {
|
|
|
2426
2329
|
}
|
|
2427
2330
|
}
|
|
2428
2331
|
),
|
|
2429
|
-
/* @__PURE__ */
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
/* @__PURE__ */
|
|
2332
|
+
/* @__PURE__ */ jsx18("div", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none", children: /* @__PURE__ */ jsxs11("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-search", children: [
|
|
2333
|
+
/* @__PURE__ */ jsx18("circle", { cx: "11", cy: "11", r: "8" }),
|
|
2334
|
+
/* @__PURE__ */ jsx18("path", { d: "m21 21-4.3-4.3" })
|
|
2432
2335
|
] }) }),
|
|
2433
|
-
searchQuery && /* @__PURE__ */
|
|
2336
|
+
searchQuery && /* @__PURE__ */ jsx18(
|
|
2434
2337
|
Button,
|
|
2435
2338
|
{
|
|
2436
2339
|
type: "button",
|
|
@@ -2441,65 +2344,65 @@ var DriveHeader = () => {
|
|
|
2441
2344
|
setSearchQuery("");
|
|
2442
2345
|
setCurrentView(searchScope === "TRASH" ? "TRASH" : "BROWSE");
|
|
2443
2346
|
},
|
|
2444
|
-
children: /* @__PURE__ */
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */
|
|
2347
|
+
children: /* @__PURE__ */ jsxs11("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "lucide lucide-x", children: [
|
|
2348
|
+
/* @__PURE__ */ jsx18("path", { d: "M18 6 6 18" }),
|
|
2349
|
+
/* @__PURE__ */ jsx18("path", { d: "m6 6 12 12" })
|
|
2447
2350
|
] })
|
|
2448
2351
|
}
|
|
2449
2352
|
)
|
|
2450
2353
|
] }),
|
|
2451
|
-
/* @__PURE__ */
|
|
2452
|
-
/* @__PURE__ */
|
|
2453
|
-
/* @__PURE__ */
|
|
2454
|
-
/* @__PURE__ */
|
|
2354
|
+
/* @__PURE__ */ jsxs11(DropdownMenu, { children: [
|
|
2355
|
+
/* @__PURE__ */ jsx18(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs11(Button, { type: "button", variant: "ghost", size: "sm", className: "gap-1.5", children: [
|
|
2356
|
+
/* @__PURE__ */ jsx18(ArrowUpDown, { className: "size-3.5" }),
|
|
2357
|
+
/* @__PURE__ */ jsx18("span", { className: "hidden sm:inline max-w-24 truncate", children: sortBy.field === "id" ? "Default" : sortBy.field === "order" ? "Custom" : sortBy.field === "createdAt" ? sortBy.order === -1 ? "Date: Newest" : "Date: Oldest" : sortBy.field === "name" ? sortBy.order === 1 ? "Name: A to Z" : "Name: Z to A" : sortBy.field === "size" ? sortBy.order === -1 ? "Size: Large" : "Size: Small" : "Sort" })
|
|
2455
2358
|
] }) }),
|
|
2456
|
-
/* @__PURE__ */
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
sortBy.field === "order" && /* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2359
|
+
/* @__PURE__ */ jsxs11(DropdownMenuContent, { align: "end", children: [
|
|
2360
|
+
/* @__PURE__ */ jsxs11(DropdownMenuItem, { onClick: () => setSortBy({ field: "order", order: 1 }), children: [
|
|
2361
|
+
sortBy.field === "order" && /* @__PURE__ */ jsx18(Check4, { className: "size-3.5 mr-2" }),
|
|
2362
|
+
/* @__PURE__ */ jsx18("span", { className: cn(sortBy.field !== "order" && "pl-5.5"), children: "Custom Order" })
|
|
2460
2363
|
] }),
|
|
2461
|
-
/* @__PURE__ */
|
|
2462
|
-
sortBy.field === "id" && /* @__PURE__ */
|
|
2463
|
-
/* @__PURE__ */
|
|
2364
|
+
/* @__PURE__ */ jsxs11(DropdownMenuItem, { onClick: () => setSortBy({ field: "id", order: 1 }), children: [
|
|
2365
|
+
sortBy.field === "id" && /* @__PURE__ */ jsx18(Check4, { className: "size-3.5 mr-2" }),
|
|
2366
|
+
/* @__PURE__ */ jsx18("span", { className: cn(sortBy.field !== "id" && "pl-5.5"), children: "Default" })
|
|
2464
2367
|
] }),
|
|
2465
|
-
/* @__PURE__ */
|
|
2466
|
-
/* @__PURE__ */
|
|
2467
|
-
sortBy.field === "createdAt" && sortBy.order === -1 && /* @__PURE__ */
|
|
2468
|
-
/* @__PURE__ */
|
|
2368
|
+
/* @__PURE__ */ jsx18(DropdownMenuSeparator, {}),
|
|
2369
|
+
/* @__PURE__ */ jsxs11(DropdownMenuItem, { onClick: () => setSortBy({ field: "createdAt", order: -1 }), children: [
|
|
2370
|
+
sortBy.field === "createdAt" && sortBy.order === -1 && /* @__PURE__ */ jsx18(Check4, { className: "size-3.5 mr-2" }),
|
|
2371
|
+
/* @__PURE__ */ jsx18(Calendar, { className: cn("size-3.5 mr-2", sortBy.field === "createdAt" && sortBy.order === -1 ? "" : "ml-5.5") }),
|
|
2469
2372
|
"Date: Newest"
|
|
2470
2373
|
] }),
|
|
2471
|
-
/* @__PURE__ */
|
|
2472
|
-
sortBy.field === "createdAt" && sortBy.order === 1 && /* @__PURE__ */
|
|
2473
|
-
/* @__PURE__ */
|
|
2374
|
+
/* @__PURE__ */ jsxs11(DropdownMenuItem, { onClick: () => setSortBy({ field: "createdAt", order: 1 }), children: [
|
|
2375
|
+
sortBy.field === "createdAt" && sortBy.order === 1 && /* @__PURE__ */ jsx18(Check4, { className: "size-3.5 mr-2" }),
|
|
2376
|
+
/* @__PURE__ */ jsx18(Calendar, { className: cn("size-3.5 mr-2", sortBy.field === "createdAt" && sortBy.order === 1 ? "" : "ml-5.5") }),
|
|
2474
2377
|
"Date: Oldest"
|
|
2475
2378
|
] }),
|
|
2476
|
-
/* @__PURE__ */
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
sortBy.field === "name" && sortBy.order === 1 && /* @__PURE__ */
|
|
2479
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ jsx18(DropdownMenuSeparator, {}),
|
|
2380
|
+
/* @__PURE__ */ jsxs11(DropdownMenuItem, { onClick: () => setSortBy({ field: "name", order: 1 }), children: [
|
|
2381
|
+
sortBy.field === "name" && sortBy.order === 1 && /* @__PURE__ */ jsx18(Check4, { className: "size-3.5 mr-2" }),
|
|
2382
|
+
/* @__PURE__ */ jsx18(ArrowDownAZ, { className: cn("size-3.5 mr-2", sortBy.field === "name" && sortBy.order === 1 ? "" : "ml-5.5") }),
|
|
2480
2383
|
"Name: A to Z"
|
|
2481
2384
|
] }),
|
|
2482
|
-
/* @__PURE__ */
|
|
2483
|
-
sortBy.field === "name" && sortBy.order === -1 && /* @__PURE__ */
|
|
2484
|
-
/* @__PURE__ */
|
|
2385
|
+
/* @__PURE__ */ jsxs11(DropdownMenuItem, { onClick: () => setSortBy({ field: "name", order: -1 }), children: [
|
|
2386
|
+
sortBy.field === "name" && sortBy.order === -1 && /* @__PURE__ */ jsx18(Check4, { className: "size-3.5 mr-2" }),
|
|
2387
|
+
/* @__PURE__ */ jsx18(ArrowUpAZ, { className: cn("size-3.5 mr-2", sortBy.field === "name" && sortBy.order === -1 ? "" : "ml-5.5") }),
|
|
2485
2388
|
"Name: Z to A"
|
|
2486
2389
|
] }),
|
|
2487
|
-
/* @__PURE__ */
|
|
2488
|
-
/* @__PURE__ */
|
|
2489
|
-
sortBy.field === "size" && sortBy.order === -1 && /* @__PURE__ */
|
|
2490
|
-
/* @__PURE__ */
|
|
2390
|
+
/* @__PURE__ */ jsx18(DropdownMenuSeparator, {}),
|
|
2391
|
+
/* @__PURE__ */ jsxs11(DropdownMenuItem, { onClick: () => setSortBy({ field: "size", order: -1 }), children: [
|
|
2392
|
+
sortBy.field === "size" && sortBy.order === -1 && /* @__PURE__ */ jsx18(Check4, { className: "size-3.5 mr-2" }),
|
|
2393
|
+
/* @__PURE__ */ jsx18(ArrowDown01, { className: cn("size-3.5 mr-2", sortBy.field === "size" && sortBy.order === -1 ? "" : "ml-5.5") }),
|
|
2491
2394
|
"Size: Large"
|
|
2492
2395
|
] }),
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
sortBy.field === "size" && sortBy.order === 1 && /* @__PURE__ */
|
|
2495
|
-
/* @__PURE__ */
|
|
2396
|
+
/* @__PURE__ */ jsxs11(DropdownMenuItem, { onClick: () => setSortBy({ field: "size", order: 1 }), children: [
|
|
2397
|
+
sortBy.field === "size" && sortBy.order === 1 && /* @__PURE__ */ jsx18(Check4, { className: "size-3.5 mr-2" }),
|
|
2398
|
+
/* @__PURE__ */ jsx18(ArrowUp01, { className: cn("size-3.5 mr-2", sortBy.field === "size" && sortBy.order === 1 ? "" : "ml-5.5") }),
|
|
2496
2399
|
"Size: Small"
|
|
2497
2400
|
] })
|
|
2498
2401
|
] })
|
|
2499
2402
|
] }),
|
|
2500
|
-
/* @__PURE__ */
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */
|
|
2403
|
+
/* @__PURE__ */ jsx18("div", { className: "w-px h-5 bg-border" }),
|
|
2404
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex bg-muted rounded-md p-0.5 gap-0.5", children: [
|
|
2405
|
+
/* @__PURE__ */ jsx18(
|
|
2503
2406
|
Button,
|
|
2504
2407
|
{
|
|
2505
2408
|
type: "button",
|
|
@@ -2509,10 +2412,10 @@ var DriveHeader = () => {
|
|
|
2509
2412
|
onClick: () => setViewMode("GRID"),
|
|
2510
2413
|
"aria-label": "Grid View",
|
|
2511
2414
|
"aria-pressed": viewMode === "GRID",
|
|
2512
|
-
children: /* @__PURE__ */
|
|
2415
|
+
children: /* @__PURE__ */ jsx18(LayoutGrid, { className: "size-4" })
|
|
2513
2416
|
}
|
|
2514
2417
|
),
|
|
2515
|
-
/* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ jsx18(
|
|
2516
2419
|
Button,
|
|
2517
2420
|
{
|
|
2518
2421
|
type: "button",
|
|
@@ -2522,11 +2425,11 @@ var DriveHeader = () => {
|
|
|
2522
2425
|
onClick: () => setViewMode("LIST"),
|
|
2523
2426
|
"aria-label": "List View",
|
|
2524
2427
|
"aria-pressed": viewMode === "LIST",
|
|
2525
|
-
children: /* @__PURE__ */
|
|
2428
|
+
children: /* @__PURE__ */ jsx18(List, { className: "size-4" })
|
|
2526
2429
|
}
|
|
2527
2430
|
)
|
|
2528
2431
|
] }),
|
|
2529
|
-
/* @__PURE__ */
|
|
2432
|
+
/* @__PURE__ */ jsx18(
|
|
2530
2433
|
DialogConfirmation,
|
|
2531
2434
|
{
|
|
2532
2435
|
open: dialogs.delete,
|
|
@@ -2563,7 +2466,7 @@ var DriveHeader = () => {
|
|
|
2563
2466
|
}
|
|
2564
2467
|
}
|
|
2565
2468
|
),
|
|
2566
|
-
/* @__PURE__ */
|
|
2469
|
+
/* @__PURE__ */ jsx18(
|
|
2567
2470
|
DialogConfirmation,
|
|
2568
2471
|
{
|
|
2569
2472
|
open: dialogs.emptyTrash,
|
|
@@ -2584,70 +2487,9 @@ var DriveHeader = () => {
|
|
|
2584
2487
|
] });
|
|
2585
2488
|
};
|
|
2586
2489
|
|
|
2587
|
-
// src/client/components/drive/file/preview.tsx
|
|
2588
|
-
import { useState as useState6 } from "react";
|
|
2589
|
-
import { Document, Page, pdfjs } from "react-pdf";
|
|
2590
|
-
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2591
|
-
if (typeof window !== "undefined") {
|
|
2592
|
-
pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.js`;
|
|
2593
|
-
}
|
|
2594
|
-
var DriveFilePreview = (props) => {
|
|
2595
|
-
const { item, onClose } = props;
|
|
2596
|
-
const { apiEndpoint } = useDrive();
|
|
2597
|
-
const [pdfNumPages, setPdfNumPages] = useState6(null);
|
|
2598
|
-
if (item.information.type === "FOLDER") return null;
|
|
2599
|
-
const mime = item.information.mime;
|
|
2600
|
-
const tokenParam = item.token ? `&token=${item.token}` : "";
|
|
2601
|
-
const fileUrl = `${apiEndpoint}?action=serve&id=${item.id}${tokenParam}`;
|
|
2602
|
-
const renderContent = () => {
|
|
2603
|
-
if (mime.startsWith("image/")) return /* @__PURE__ */ jsx21("img", { src: fileUrl, alt: item.name, className: "max-w-full max-h-[70vh] rounded-md object-contain shadow-sm" });
|
|
2604
|
-
if (mime.startsWith("video/")) return /* @__PURE__ */ jsx21("video", { src: fileUrl, controls: true, autoPlay: true, className: "max-w-full max-h-[70vh] rounded-md shadow-sm bg-black", children: "Your browser does not support video playback." });
|
|
2605
|
-
if (mime.startsWith("audio/")) return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col items-center gap-6 py-8 px-4 w-full", children: [
|
|
2606
|
-
/* @__PURE__ */ jsx21("div", { className: "w-24 h-24 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ jsx21("span", { className: "text-4xl", children: "\u{1F3B5}" }) }),
|
|
2607
|
-
/* @__PURE__ */ jsxs13("div", { className: "text-center space-y-1", children: [
|
|
2608
|
-
/* @__PURE__ */ jsx21("h4", { className: "font-medium text-lg", children: item.name }),
|
|
2609
|
-
/* @__PURE__ */ jsx21("p", { className: "text-sm text-muted-foreground", children: mime })
|
|
2610
|
-
] }),
|
|
2611
|
-
/* @__PURE__ */ jsx21("audio", { src: fileUrl, controls: true, autoPlay: true, className: "w-full max-w-md mt-2", children: "Your browser does not support audio playback." })
|
|
2612
|
-
] });
|
|
2613
|
-
if (mime === "application/pdf") {
|
|
2614
|
-
return /* @__PURE__ */ jsxs13("div", { className: "max-h-[70vh] overflow-y-auto rounded-md border bg-white dark:bg-zinc-900 mx-auto w-full", children: [
|
|
2615
|
-
/* @__PURE__ */ jsx21(Document, { file: fileUrl, onLoadSuccess: ({ numPages }) => setPdfNumPages(numPages), className: "flex flex-col items-center gap-4 p-4", children: pdfNumPages && Array.from(new Array(Math.min(pdfNumPages, 10)), (_, index) => /* @__PURE__ */ jsx21(
|
|
2616
|
-
Page,
|
|
2617
|
-
{
|
|
2618
|
-
pageNumber: index + 1,
|
|
2619
|
-
renderTextLayer: false,
|
|
2620
|
-
renderAnnotationLayer: false,
|
|
2621
|
-
className: "shadow-md",
|
|
2622
|
-
width: 600
|
|
2623
|
-
},
|
|
2624
|
-
`page_${index + 1}`
|
|
2625
|
-
)) }),
|
|
2626
|
-
pdfNumPages && pdfNumPages > 10 && /* @__PURE__ */ jsxs13("div", { className: "p-4 text-center text-sm text-muted-foreground border-t bg-muted/20", children: [
|
|
2627
|
-
"Showing 10 of ",
|
|
2628
|
-
pdfNumPages,
|
|
2629
|
-
" pages (Preview limited)"
|
|
2630
|
-
] })
|
|
2631
|
-
] });
|
|
2632
|
-
}
|
|
2633
|
-
return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col items-center justify-center gap-6 py-12", children: [
|
|
2634
|
-
/* @__PURE__ */ jsx21("div", { className: "p-4 rounded-full bg-muted", children: /* @__PURE__ */ jsx21("span", { className: "text-4xl opacity-50", children: "\u{1F4C4}" }) }),
|
|
2635
|
-
/* @__PURE__ */ jsxs13("div", { className: "text-center space-y-2", children: [
|
|
2636
|
-
/* @__PURE__ */ jsx21("h4", { className: "font-medium", children: "Preview not available" }),
|
|
2637
|
-
/* @__PURE__ */ jsx21("p", { className: "text-sm text-muted-foreground max-w-xs mx-auto", children: "This file type usually cannot be previewed in the browser." })
|
|
2638
|
-
] }),
|
|
2639
|
-
/* @__PURE__ */ jsx21(Button, { asChild: true, children: /* @__PURE__ */ jsx21("a", { href: fileUrl, download: item.name, children: "Download File" }) })
|
|
2640
|
-
] });
|
|
2641
|
-
};
|
|
2642
|
-
return /* @__PURE__ */ jsx21(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs13(DialogContent, { className: "sm:max-w-5xl max-h-[90vh] flex flex-col gap-0 p-0", children: [
|
|
2643
|
-
/* @__PURE__ */ jsx21(DialogHeader, { className: "px-4 py-3 border-b shrink-0 flex flex-row items-center justify-between", children: /* @__PURE__ */ jsx21(DialogTitle, { className: "truncate pr-8", children: item.name }) }),
|
|
2644
|
-
/* @__PURE__ */ jsx21("div", { className: "p-6 overflow-auto flex items-center justify-center bg-muted/5 min-h-75 flex-1", children: renderContent() })
|
|
2645
|
-
] }) });
|
|
2646
|
-
};
|
|
2647
|
-
|
|
2648
2490
|
// src/client/file-chooser.tsx
|
|
2649
2491
|
import { Upload as UploadIcon2, X as X4 } from "lucide-react";
|
|
2650
|
-
import { jsx as
|
|
2492
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2651
2493
|
var DriveFileChooser = (props) => {
|
|
2652
2494
|
const {
|
|
2653
2495
|
value,
|
|
@@ -2667,8 +2509,7 @@ var DriveFileChooser = (props) => {
|
|
|
2667
2509
|
...props
|
|
2668
2510
|
};
|
|
2669
2511
|
const { items, selectedFileIds, setSelectedFileIds } = useDrive();
|
|
2670
|
-
const [isOpen, setIsOpen] =
|
|
2671
|
-
const [previewFile, setPreviewFile] = useState7(null);
|
|
2512
|
+
const [isOpen, setIsOpen] = useState6(false);
|
|
2672
2513
|
useEffect5(() => {
|
|
2673
2514
|
if (isOpen) {
|
|
2674
2515
|
if (!value) setSelectedFileIds([]);
|
|
@@ -2698,8 +2539,8 @@ var DriveFileChooser = (props) => {
|
|
|
2698
2539
|
return Array.isArray(value) ? value : [value];
|
|
2699
2540
|
}, [value]);
|
|
2700
2541
|
const isSingle = !multiple;
|
|
2701
|
-
return /* @__PURE__ */
|
|
2702
|
-
!hasSelection && /* @__PURE__ */
|
|
2542
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn("space-y-1.5", className), children: [
|
|
2543
|
+
!hasSelection && /* @__PURE__ */ jsxs12(
|
|
2703
2544
|
"button",
|
|
2704
2545
|
{
|
|
2705
2546
|
type: "button",
|
|
@@ -2713,29 +2554,29 @@ var DriveFileChooser = (props) => {
|
|
|
2713
2554
|
disabled && "opacity-50 cursor-not-allowed hover:bg-transparent"
|
|
2714
2555
|
),
|
|
2715
2556
|
children: [
|
|
2716
|
-
/* @__PURE__ */
|
|
2557
|
+
/* @__PURE__ */ jsx19("div", { className: cn(
|
|
2717
2558
|
"flex items-center justify-center size-9 rounded-md bg-muted",
|
|
2718
2559
|
error && "bg-destructive/10"
|
|
2719
|
-
), children: /* @__PURE__ */
|
|
2720
|
-
/* @__PURE__ */
|
|
2721
|
-
/* @__PURE__ */
|
|
2722
|
-
/* @__PURE__ */
|
|
2560
|
+
), children: /* @__PURE__ */ jsx19(UploadIcon2, { className: cn("size-4", error ? "text-destructive" : "text-muted-foreground") }) }),
|
|
2561
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex-1 min-w-0", children: [
|
|
2562
|
+
/* @__PURE__ */ jsx19("p", { className: cn("text-sm font-medium", error && "text-destructive"), children: isSingle ? "Select a file" : "Select files" }),
|
|
2563
|
+
/* @__PURE__ */ jsx19("p", { className: "text-xs text-muted-foreground", children: placeholder })
|
|
2723
2564
|
] })
|
|
2724
2565
|
]
|
|
2725
2566
|
}
|
|
2726
2567
|
),
|
|
2727
|
-
hasSelection && isSingle && displayFiles[0] && /* @__PURE__ */
|
|
2568
|
+
hasSelection && isSingle && displayFiles[0] && /* @__PURE__ */ jsxs12("div", { className: cn(
|
|
2728
2569
|
"flex items-center gap-2.5 px-2.5 py-2 rounded-md border bg-muted/30",
|
|
2729
2570
|
error && "border-destructive",
|
|
2730
2571
|
disabled && "opacity-50"
|
|
2731
2572
|
), children: [
|
|
2732
|
-
/* @__PURE__ */
|
|
2733
|
-
/* @__PURE__ */
|
|
2734
|
-
/* @__PURE__ */
|
|
2735
|
-
/* @__PURE__ */
|
|
2573
|
+
/* @__PURE__ */ jsx19("div", { className: "size-10 shrink-0 rounded overflow-hidden bg-muted flex items-center justify-center", children: getFileIcon(displayFiles[0].file.mime, false, "size-5 text-muted-foreground") }),
|
|
2574
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex-1 min-w-0", children: [
|
|
2575
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sm font-medium truncate", children: displayFiles[0].file.name }),
|
|
2576
|
+
/* @__PURE__ */ jsx19("p", { className: "text-xs text-muted-foreground truncate", children: displayFiles[0].file.mime })
|
|
2736
2577
|
] }),
|
|
2737
|
-
/* @__PURE__ */
|
|
2738
|
-
/* @__PURE__ */
|
|
2578
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
2579
|
+
/* @__PURE__ */ jsx19(
|
|
2739
2580
|
Button,
|
|
2740
2581
|
{
|
|
2741
2582
|
type: "button",
|
|
@@ -2746,30 +2587,30 @@ var DriveFileChooser = (props) => {
|
|
|
2746
2587
|
children: "Change"
|
|
2747
2588
|
}
|
|
2748
2589
|
),
|
|
2749
|
-
!disabled && /* @__PURE__ */
|
|
2590
|
+
!disabled && /* @__PURE__ */ jsx19(
|
|
2750
2591
|
Button,
|
|
2751
2592
|
{
|
|
2752
2593
|
type: "button",
|
|
2753
2594
|
variant: "ghost",
|
|
2754
2595
|
size: "icon",
|
|
2755
2596
|
onClick: () => handleRemove(displayFiles[0].id),
|
|
2756
|
-
children: /* @__PURE__ */
|
|
2597
|
+
children: /* @__PURE__ */ jsx19(X4, { className: "size-3.5" })
|
|
2757
2598
|
}
|
|
2758
2599
|
)
|
|
2759
2600
|
] })
|
|
2760
2601
|
] }),
|
|
2761
|
-
hasSelection && !isSingle && /* @__PURE__ */
|
|
2602
|
+
hasSelection && !isSingle && /* @__PURE__ */ jsxs12("div", { className: cn(
|
|
2762
2603
|
"rounded-md border",
|
|
2763
2604
|
error && "border-destructive",
|
|
2764
2605
|
disabled && "opacity-50"
|
|
2765
2606
|
), children: [
|
|
2766
|
-
/* @__PURE__ */
|
|
2767
|
-
/* @__PURE__ */
|
|
2607
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between px-2.5 py-1.5 border-b bg-muted/30", children: [
|
|
2608
|
+
/* @__PURE__ */ jsxs12("span", { className: "text-xs text-muted-foreground", children: [
|
|
2768
2609
|
displayFiles.length,
|
|
2769
2610
|
" files selected"
|
|
2770
2611
|
] }),
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
2612
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1", children: [
|
|
2613
|
+
/* @__PURE__ */ jsx19(
|
|
2773
2614
|
Button,
|
|
2774
2615
|
{
|
|
2775
2616
|
type: "button",
|
|
@@ -2780,7 +2621,7 @@ var DriveFileChooser = (props) => {
|
|
|
2780
2621
|
children: "Add more"
|
|
2781
2622
|
}
|
|
2782
2623
|
),
|
|
2783
|
-
!disabled && /* @__PURE__ */
|
|
2624
|
+
!disabled && /* @__PURE__ */ jsx19(
|
|
2784
2625
|
Button,
|
|
2785
2626
|
{
|
|
2786
2627
|
type: "button",
|
|
@@ -2792,44 +2633,39 @@ var DriveFileChooser = (props) => {
|
|
|
2792
2633
|
)
|
|
2793
2634
|
] })
|
|
2794
2635
|
] }),
|
|
2795
|
-
/* @__PURE__ */
|
|
2796
|
-
/* @__PURE__ */
|
|
2797
|
-
/* @__PURE__ */
|
|
2798
|
-
!disabled && /* @__PURE__ */
|
|
2636
|
+
/* @__PURE__ */ jsx19("div", { className: "divide-y max-h-40 overflow-y-auto", children: displayFiles.map((file) => /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2 px-2.5 py-1.5 hover:bg-muted/30", children: [
|
|
2637
|
+
/* @__PURE__ */ jsx19("div", { className: "size-7 shrink-0 rounded overflow-hidden bg-muted flex items-center justify-center", children: getFileIcon(file.file.mime, false, "size-3.5 text-muted-foreground") }),
|
|
2638
|
+
/* @__PURE__ */ jsx19("span", { className: "flex-1 text-sm truncate", children: file.file.name }),
|
|
2639
|
+
!disabled && /* @__PURE__ */ jsx19(
|
|
2799
2640
|
Button,
|
|
2800
2641
|
{
|
|
2801
2642
|
type: "button",
|
|
2802
2643
|
variant: "ghost",
|
|
2803
2644
|
size: "icon",
|
|
2804
2645
|
onClick: () => handleRemove(file.id),
|
|
2805
|
-
children: /* @__PURE__ */
|
|
2646
|
+
children: /* @__PURE__ */ jsx19(X4, { className: "size-3" })
|
|
2806
2647
|
}
|
|
2807
2648
|
)
|
|
2808
2649
|
] }, file.id)) })
|
|
2809
2650
|
] }),
|
|
2810
|
-
error && helperText && /* @__PURE__ */
|
|
2811
|
-
/* @__PURE__ */
|
|
2812
|
-
/* @__PURE__ */
|
|
2813
|
-
/* @__PURE__ */
|
|
2814
|
-
/* @__PURE__ */
|
|
2815
|
-
/* @__PURE__ */
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
2651
|
+
error && helperText && /* @__PURE__ */ jsx19("p", { className: "text-xs text-destructive", children: helperText }),
|
|
2652
|
+
/* @__PURE__ */ jsx19(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsxs12(DialogContent, { className: "sm:max-w-5xl max-h-[85vh] w-[95vw] flex flex-col gap-0 p-0", children: [
|
|
2653
|
+
/* @__PURE__ */ jsx19(DialogHeader, { className: "px-0 py-0 border-b shrink-0 flex flex-col gap-0", children: /* @__PURE__ */ jsx19("div", { className: "flex items-center justify-between px-3 sm:px-4 py-3 border-b", children: /* @__PURE__ */ jsx19(DialogTitle, { className: "text-sm sm:text-base", children: "File Explorer" }) }) }),
|
|
2654
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex-1 overflow-hidden flex min-h-0 bg-muted/5", children: [
|
|
2655
|
+
/* @__PURE__ */ jsx19("div", { className: "hidden md:flex w-48 lg:w-52 border-r bg-background/50 flex-col", children: /* @__PURE__ */ jsx19(DriveSidebar, {}) }),
|
|
2656
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex-1 flex flex-col min-w-0", children: [
|
|
2657
|
+
/* @__PURE__ */ jsx19(DriveHeader, {}),
|
|
2658
|
+
/* @__PURE__ */ jsx19(
|
|
2818
2659
|
DriveExplorer,
|
|
2819
2660
|
{
|
|
2820
|
-
mimeFilter: accept
|
|
2821
|
-
onItemDoubleClick: (item) => {
|
|
2822
|
-
if (item.information.type === "FILE") {
|
|
2823
|
-
setPreviewFile(item);
|
|
2824
|
-
}
|
|
2825
|
-
}
|
|
2661
|
+
mimeFilter: accept
|
|
2826
2662
|
}
|
|
2827
2663
|
)
|
|
2828
2664
|
] })
|
|
2829
2665
|
] }),
|
|
2830
|
-
/* @__PURE__ */
|
|
2831
|
-
/* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2666
|
+
/* @__PURE__ */ jsxs12(DialogFooter, { className: "px-3 sm:px-4 py-3 border-t bg-background shrink-0 gap-2 flex-row justify-end", children: [
|
|
2667
|
+
/* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setIsOpen(false), children: "Cancel" }),
|
|
2668
|
+
/* @__PURE__ */ jsxs12(
|
|
2833
2669
|
Button,
|
|
2834
2670
|
{
|
|
2835
2671
|
type: "button",
|
|
@@ -2843,14 +2679,12 @@ var DriveFileChooser = (props) => {
|
|
|
2843
2679
|
}
|
|
2844
2680
|
)
|
|
2845
2681
|
] })
|
|
2846
|
-
] }) })
|
|
2847
|
-
previewFile && /* @__PURE__ */ jsx22(DriveFilePreview, { item: previewFile, onClose: () => setPreviewFile(null) })
|
|
2682
|
+
] }) })
|
|
2848
2683
|
] });
|
|
2849
2684
|
};
|
|
2850
2685
|
export {
|
|
2851
2686
|
DriveExplorer,
|
|
2852
2687
|
DriveFileChooser,
|
|
2853
|
-
DriveFilePreview,
|
|
2854
2688
|
DriveHeader,
|
|
2855
2689
|
DrivePathBar,
|
|
2856
2690
|
DriveProvider,
|