@retinalabsllc/zairusjs 1.3.1 → 1.3.2
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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -9
- package/dist/index.mjs +13 -10
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -895,6 +895,7 @@ interface UniversalDriveViewProps {
|
|
|
895
895
|
onMoveToTrash: (ids: string[]) => Promise<void>;
|
|
896
896
|
onClearUploadQueue?: () => void;
|
|
897
897
|
onPageChange: (page: number) => void;
|
|
898
|
+
onRefresh: () => void;
|
|
898
899
|
onFetchFoldersForExplorer: (folderId: string | null) => Promise<{
|
|
899
900
|
folders: DriveItem[];
|
|
900
901
|
breadcrumbs: any[];
|
package/dist/index.d.ts
CHANGED
|
@@ -895,6 +895,7 @@ interface UniversalDriveViewProps {
|
|
|
895
895
|
onMoveToTrash: (ids: string[]) => Promise<void>;
|
|
896
896
|
onClearUploadQueue?: () => void;
|
|
897
897
|
onPageChange: (page: number) => void;
|
|
898
|
+
onRefresh: () => void;
|
|
898
899
|
onFetchFoldersForExplorer: (folderId: string | null) => Promise<{
|
|
899
900
|
folders: DriveItem[];
|
|
900
901
|
breadcrumbs: any[];
|
package/dist/index.js
CHANGED
|
@@ -3370,6 +3370,7 @@ var UniversalDriveView = ({
|
|
|
3370
3370
|
onMoveToTrash,
|
|
3371
3371
|
onClearUploadQueue,
|
|
3372
3372
|
onPageChange,
|
|
3373
|
+
onRefresh,
|
|
3373
3374
|
onFetchFoldersForExplorer,
|
|
3374
3375
|
onExecuteMoveCopy,
|
|
3375
3376
|
onOpenFile,
|
|
@@ -3406,11 +3407,7 @@ var UniversalDriveView = ({
|
|
|
3406
3407
|
return parseFloat((num / Math.pow(k, i)).toFixed(1)) + " " + sizes[i];
|
|
3407
3408
|
};
|
|
3408
3409
|
const formatDate3 = (dateString) => {
|
|
3409
|
-
return new Date(dateString).toLocaleDateString("en-US", {
|
|
3410
|
-
month: "short",
|
|
3411
|
-
day: "numeric",
|
|
3412
|
-
year: "numeric"
|
|
3413
|
-
});
|
|
3410
|
+
return new Date(dateString).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
3414
3411
|
};
|
|
3415
3412
|
const handleRowClick = (id, e) => {
|
|
3416
3413
|
if (e.ctrlKey || e.metaKey) {
|
|
@@ -3419,6 +3416,10 @@ var UniversalDriveView = ({
|
|
|
3419
3416
|
setSelectedIds([id]);
|
|
3420
3417
|
}
|
|
3421
3418
|
};
|
|
3419
|
+
const handleSelectAll = () => {
|
|
3420
|
+
if (selectedIds.length === items.length && items.length > 0) setSelectedIds([]);
|
|
3421
|
+
else setSelectedIds(items.map((i) => i.id));
|
|
3422
|
+
};
|
|
3422
3423
|
const handleItemDoubleClick = (item) => {
|
|
3423
3424
|
if (item.type === "FOLDER") {
|
|
3424
3425
|
setSelectedIds([]);
|
|
@@ -3448,7 +3449,7 @@ var UniversalDriveView = ({
|
|
|
3448
3449
|
const globalProgress = uploadQueue.length > 0 ? Math.round(uploadQueue.reduce((acc, job) => acc + job.progress, 0) / (uploadQueue.length * 100) * 100) : 0;
|
|
3449
3450
|
const isUILocked = isLoading || isSubmitting;
|
|
3450
3451
|
const lockClass = isUILocked ? "pointer-events-none opacity-60" : "";
|
|
3451
|
-
return /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-6 max-w-5xl w-full mx-auto p-6 bg-white rounded-2xl animate-in fade-in duration-300 relative" }, /* @__PURE__ */ import_react65.default.createElement(ManagedToaster, null), /* @__PURE__ */ import_react65.default.createElement("div", { className: `flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-4 border-b border-neutral-100 transition-opacity ${lockClass}` }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("h1", { className: "text-xl text-black tracking-tight mb-1" }, "Drive"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500" }, "Secure cloud storage optimized for your workspace.")), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2 shrink-0" }, selectedIds.length > 0 && /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, selectedIds.length === 1 && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => {
|
|
3452
|
+
return /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col gap-6 max-w-5xl w-full mx-auto p-6 bg-white rounded-2xl animate-in fade-in duration-300 relative" }, /* @__PURE__ */ import_react65.default.createElement(ManagedToaster, null), /* @__PURE__ */ import_react65.default.createElement("div", { className: `flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-4 border-b border-neutral-100 transition-opacity ${lockClass}` }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("h1", { className: "text-xl text-black tracking-tight mb-1" }, "Drive"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-500" }, "Secure cloud storage optimized for your workspace.")), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: onRefresh, title: "Refresh Directory", className: "p-2.5 bg-neutral-50 text-neutral-500 hover:text-black hover:bg-neutral-100 rounded-full transition-all outline-none" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.ReloadIcon, size: 18 })), /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-px h-6 bg-neutral-200 mx-1" }), selectedIds.length > 0 && /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, selectedIds.length === 1 && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => {
|
|
3452
3453
|
const item = items.find((i) => i.id === selectedIds[0]);
|
|
3453
3454
|
if (item) setRenameModal({ isOpen: true, id: item.id, name: item.name });
|
|
3454
3455
|
setFolderInputVal(item?.name || "");
|
|
@@ -3461,13 +3462,13 @@ var UniversalDriveView = ({
|
|
|
3461
3462
|
}, className: "text-neutral-500 hover:text-red-600 p-1 flex items-center gap-1.5 text-xs outline-none" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.Delete02Icon, size: 14 }), " Move to Trash"))), /* @__PURE__ */ import_react65.default.createElement("div", { className: `flex items-center gap-1.5 overflow-x-auto text-xs py-1 border-b border-neutral-50 text-neutral-400 whitespace-nowrap ${lockClass}` }, folderBreadcrumbs.map((crumb, idx) => /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, { key: idx }, idx > 0 && /* @__PURE__ */ import_react65.default.createElement("span", null, "/"), /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => {
|
|
3462
3463
|
setSelectedIds([]);
|
|
3463
3464
|
onNavigateFolder(crumb.id);
|
|
3464
|
-
}, className: `hover:text-black transition-colors outline-none ${idx === folderBreadcrumbs.length - 1 ? "text-black font-medium" : ""}` }, crumb.name)))), /* @__PURE__ */ import_react65.default.createElement("div", { className: `w-full overflow-x-auto select-none flex-1 relative min-h-
|
|
3465
|
+
}, className: `hover:text-black transition-colors outline-none ${idx === folderBreadcrumbs.length - 1 ? "text-black font-medium" : ""}` }, crumb.name)))), /* @__PURE__ */ import_react65.default.createElement("div", { className: `w-full overflow-x-auto select-none flex-1 relative min-h-[300px] ${lockClass}` }, /* @__PURE__ */ import_react65.default.createElement("table", { className: "w-full text-left border-collapse min-w-full relative z-10" }, /* @__PURE__ */ import_react65.default.createElement("thead", null, /* @__PURE__ */ import_react65.default.createElement("tr", { className: "border-b border-neutral-100 bg-white" }, /* @__PURE__ */ import_react65.default.createElement("th", { className: "w-10 p-3" }, /* @__PURE__ */ import_react65.default.createElement("input", { type: "checkbox", checked: selectedIds.length === items.length && items.length > 0, onChange: () => items.length > 0 && (selectedIds.length === items.length ? setSelectedIds([]) : setSelectedIds(items.map((i) => i.id))), className: "rounded border-neutral-300 w-4 h-4 text-black focus:ring-black accent-black cursor-pointer" })), /* @__PURE__ */ import_react65.default.createElement("th", { className: "text-[11px] uppercase tracking-[0.2em] text-neutral-400 p-3" }, "Name"), /* @__PURE__ */ import_react65.default.createElement("th", { className: "text-[11px] uppercase tracking-[0.2em] text-neutral-400 p-3" }, "Modified"), /* @__PURE__ */ import_react65.default.createElement("th", { className: "text-[11px] uppercase tracking-[0.2em] text-neutral-400 p-3 text-right" }, "Size"))), /* @__PURE__ */ import_react65.default.createElement("tbody", { className: "divide-y divide-neutral-50" }, items.length === 0 && !isLoading && /* @__PURE__ */ import_react65.default.createElement("tr", null, /* @__PURE__ */ import_react65.default.createElement("td", { colSpan: 4, className: "py-24 text-center" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex flex-col items-center justify-center" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.FolderIcon, size: 40, className: "text-neutral-200 mb-3" }), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-xs text-neutral-400" }, "This directory is empty.")))), items.map((item) => {
|
|
3465
3466
|
const isChecked = selectedIds.includes(item.id);
|
|
3466
3467
|
return /* @__PURE__ */ import_react65.default.createElement("tr", { key: item.id, onClick: (e) => handleRowClick(item.id, e), onDoubleClick: () => handleItemDoubleClick(item), onContextMenu: (e) => {
|
|
3467
3468
|
e.preventDefault();
|
|
3468
3469
|
setSelectedIds([item.id]);
|
|
3469
3470
|
}, className: `hover:bg-neutral-50/70 transition-colors cursor-pointer group ${isChecked ? "bg-neutral-50" : ""}` }, /* @__PURE__ */ import_react65.default.createElement("td", { className: "p-3", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react65.default.createElement("input", { type: "checkbox", checked: isChecked, onChange: () => handleRowClick(item.id, { ctrlKey: true }), className: "rounded border-neutral-300 w-4 h-4 text-black focus:ring-black accent-black cursor-pointer" })), /* @__PURE__ */ import_react65.default.createElement("td", { className: "p-3 flex items-center gap-3 min-w-0" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-8 h-8 shrink-0 bg-neutral-100 rounded-lg flex items-center justify-center relative" }, /* @__PURE__ */ import_react65.default.createElement(FileIconMapper, { type: item.type, mimeType: item.mimeType })), /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-xs text-black truncate pr-4" }, item.name)), /* @__PURE__ */ import_react65.default.createElement("td", { className: "p-3 text-xs text-neutral-500 whitespace-nowrap" }, formatDate3(item.updatedAt)), /* @__PURE__ */ import_react65.default.createElement("td", { className: "p-3 text-xs text-neutral-500 text-right whitespace-nowrap" }, formatBytes(item.size)));
|
|
3470
|
-
})))), /* @__PURE__ */ import_react65.default.createElement("div", { className: `flex items-center justify-between pt-4 border-t border-neutral-100 ${lockClass}` }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em] uppercase" }, "Page ", currentPage, " of ", Math.max(1, totalPages)), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => onPageChange(currentPage - 1), disabled: currentPage <= 1, className: "p-2 border border-neutral-100 rounded-full bg-white text-neutral-500 hover:text-black disabled:opacity-30 transition-all outline-none" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.ArrowLeft01Icon, size: 14 })), /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => onPageChange(currentPage + 1), disabled: currentPage >= totalPages, className: "p-2 border border-neutral-100 rounded-full bg-white text-neutral-500 hover:text-black disabled:opacity-30 transition-all outline-none" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.ArrowRight01Icon, size: 14 })))), activeJobs.length > 0 && /* @__PURE__ */ import_react65.default.createElement("div", { className: "fixed bottom-6 right-6 w-80 bg-white border border-neutral-200 shadow-2xl rounded-xl z-100 overflow-hidden flex flex-col animate-in slide-in-from-bottom-4 duration-300" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "p-4 border-b border-neutral-100 bg-neutral-50 flex items-center justify-between" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("h4", { className: "text-xs text-black font-medium" }, "Uploading Elements"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-[10px] text-neutral-500 mt-0.5" }, "Processing ", activeJobs.length, " streams"))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-full h-1 bg-neutral-100 relative" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "h-full transition-all duration-500 ease-out", style: { width: `${globalProgress}%`, background: "linear-gradient(to right, #f64b4d, #ffa360)" } })), /* @__PURE__ */ import_react65.default.createElement("div", { className: "max-h-40 overflow-y-auto divide-y divide-neutral-50 p-2" }, uploadQueue.map((job) => /* @__PURE__ */ import_react65.default.createElement("div", { key: job.id, className: "flex items-center justify-between p-2 text-[11px] gap-4" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-black truncate flex-1 pr-2" }, job.name), /* @__PURE__ */ import_react65.default.createElement("div", { className: "shrink-0 whitespace-nowrap flex items-center gap-2" }, job.status === "COMPLETED" ? /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.Tick01Icon, size: 12, className: "text-green-600" }) : job.status === "FAILED" ? /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-red-600 text-[10px]" }, "Failed") : /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-neutral-500 text-[10px]" }, job.progress, "%")))))), (isNewFolderModalOpen || renameModal.isOpen) && /* @__PURE__ */ import_react65.default.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "absolute inset-0 bg-black/30 backdrop-blur-sm", onClick: () => !isSubmitting && (setIsNewFolderModalOpen(false), setRenameModal({ isOpen: false, id: "", name: "" })) }), /* @__PURE__ */ import_react65.default.createElement("form", { onSubmit: async (e) => {
|
|
3471
|
+
}))), isLoading && /* @__PURE__ */ import_react65.default.createElement("div", { className: "absolute inset-0 top-12 z-20 bg-white/60 backdrop-blur-[1px] flex items-start justify-center pt-20" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.Loading03Icon, className: "animate-spin text-neutral-400", size: 24 }))), /* @__PURE__ */ import_react65.default.createElement("div", { className: `flex items-center justify-between pt-4 border-t border-neutral-100 ${lockClass}` }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em] uppercase" }, "Page ", currentPage, " of ", Math.max(1, totalPages)), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => onPageChange(currentPage - 1), disabled: currentPage <= 1, className: "p-2 border border-neutral-100 rounded-full bg-white text-neutral-500 hover:text-black disabled:opacity-30 transition-all outline-none" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.ArrowLeft01Icon, size: 14 })), /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => onPageChange(currentPage + 1), disabled: currentPage >= totalPages, className: "p-2 border border-neutral-100 rounded-full bg-white text-neutral-500 hover:text-black disabled:opacity-30 transition-all outline-none" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.ArrowRight01Icon, size: 14 })))), activeJobs.length > 0 && /* @__PURE__ */ import_react65.default.createElement("div", { className: "fixed bottom-6 right-6 w-80 bg-white border border-neutral-200 shadow-2xl rounded-xl z-[100] overflow-hidden flex flex-col animate-in slide-in-from-bottom-4 duration-300" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "p-4 border-b border-neutral-100 bg-neutral-50 flex items-center justify-between" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("h4", { className: "text-xs text-black font-medium" }, "Uploading Elements"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-[10px] text-neutral-500 mt-0.5" }, "Processing ", activeJobs.length, " streams")), onClearUploadQueue && activeJobs.length === 0 && /* @__PURE__ */ import_react65.default.createElement("button", { onClick: onClearUploadQueue, className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.Cancel01Icon, size: 14 }))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "w-full h-1 bg-neutral-100 relative" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "h-full transition-all duration-500 ease-out", style: { width: `${globalProgress}%`, background: "linear-gradient(to right, #f64b4d, #ffa360)" } })), /* @__PURE__ */ import_react65.default.createElement("div", { className: "max-h-40 overflow-y-auto divide-y divide-neutral-50 p-2" }, uploadQueue.map((job) => /* @__PURE__ */ import_react65.default.createElement("div", { key: job.id, className: "flex items-center justify-between p-2 text-[11px] gap-4" }, /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-black truncate flex-1 pr-2" }, job.name), /* @__PURE__ */ import_react65.default.createElement("div", { className: "shrink-0 whitespace-nowrap flex items-center gap-2" }, job.status === "COMPLETED" ? /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.Tick01Icon, size: 12, className: "text-green-600" }) : job.status === "FAILED" ? /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-red-600 text-[10px]" }, "Failed") : /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-neutral-500 text-[10px]" }, job.progress, "%")))))), (isNewFolderModalOpen || renameModal.isOpen) && /* @__PURE__ */ import_react65.default.createElement("div", { className: "fixed inset-0 z-[110] flex items-center justify-center p-4" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "absolute inset-0 bg-black/30 backdrop-blur-sm", onClick: () => !isSubmitting && (setIsNewFolderModalOpen(false), setRenameModal({ isOpen: false, id: "", name: "" })) }), /* @__PURE__ */ import_react65.default.createElement("form", { onSubmit: async (e) => {
|
|
3471
3472
|
e.preventDefault();
|
|
3472
3473
|
if (!folderInputVal.trim() || isSubmitting) return;
|
|
3473
3474
|
setIsSubmitting(true);
|
|
@@ -3480,7 +3481,7 @@ var UniversalDriveView = ({
|
|
|
3480
3481
|
}, className: "relative w-full max-w-sm bg-white shadow-2xl rounded-2xl p-8 flex flex-col gap-6 animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-lg text-black tracking-tight mb-1" }, isNewFolderModalOpen ? "Create Directory" : "Rename Element"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-[11px] text-neutral-400" }, "Please provide a valid alphanumeric name.")), /* @__PURE__ */ import_react65.default.createElement(TextInput, { placeholder: "Name (e.g., Q3 Invoices)", value: folderInputVal, onChange: setFolderInputVal }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-end gap-3 mt-2" }, /* @__PURE__ */ import_react65.default.createElement("button", { type: "button", onClick: () => {
|
|
3481
3482
|
setIsNewFolderModalOpen(false);
|
|
3482
3483
|
setRenameModal({ isOpen: false, id: "", name: "" });
|
|
3483
|
-
}, disabled: isSubmitting, className: "px-6 py-2.5 text-xs text-neutral-500 hover:bg-neutral-50 rounded-full outline-none disabled:opacity-50 transition-colors" }, "Cancel"), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { type: "submit", isLoading: isSubmitting, disabled: !folderInputVal.trim() }, isNewFolderModalOpen ? "Create" : "Rename")))), explorer.isOpen && /* @__PURE__ */ import_react65.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-sm", onClick: () => !isSubmitting && setExplorer((p) => ({ ...p, isOpen: false })) }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "relative w-full max-w-md bg-white shadow-2xl rounded-2xl p-6 flex flex-col gap-4 animate-in zoom-in-95 duration-200 min-h-
|
|
3484
|
+
}, disabled: isSubmitting, className: "px-6 py-2.5 text-xs text-neutral-500 hover:bg-neutral-50 rounded-full outline-none disabled:opacity-50 transition-colors" }, "Cancel"), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { type: "submit", isLoading: isSubmitting, disabled: !folderInputVal.trim() }, isNewFolderModalOpen ? "Create" : "Rename")))), explorer.isOpen && /* @__PURE__ */ import_react65.default.createElement("div", { className: "fixed inset-0 z-[120] flex items-center justify-center p-4" }, /* @__PURE__ */ import_react65.default.createElement("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-sm", onClick: () => !isSubmitting && setExplorer((p) => ({ ...p, isOpen: false })) }), /* @__PURE__ */ import_react65.default.createElement("div", { className: "relative w-full max-w-md bg-white shadow-2xl rounded-2xl p-6 flex flex-col gap-4 animate-in zoom-in-95 duration-200 min-h-[400px]" }, /* @__PURE__ */ import_react65.default.createElement("div", null, /* @__PURE__ */ import_react65.default.createElement("h3", { className: "text-lg text-black tracking-tight mb-1 capitalize" }, explorer.action, " Items"), /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-[11px] text-neutral-400" }, "Select destination directory.")), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center gap-1.5 overflow-x-auto text-xs py-2 border-b border-neutral-100 text-neutral-400 whitespace-nowrap bg-neutral-50 px-3 rounded-lg" }, explorer.breadcrumbs.map((crumb, idx) => /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, { key: idx }, idx > 0 && /* @__PURE__ */ import_react65.default.createElement("span", null, "/"), /* @__PURE__ */ import_react65.default.createElement("button", { disabled: explorer.loading, onClick: () => navigateExplorer(crumb.id), className: `hover:text-black outline-none ${idx === explorer.breadcrumbs.length - 1 ? "text-black font-medium" : ""}` }, crumb.name)))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex-1 overflow-y-auto border border-neutral-100 rounded-xl" }, explorer.loading ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "h-full flex items-center justify-center p-10" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.Loading03Icon, className: "animate-spin text-neutral-400", size: 20 })) : explorer.folders.length === 0 ? /* @__PURE__ */ import_react65.default.createElement("div", { className: "h-full flex items-center justify-center p-10 text-xs text-neutral-400" }, "No sub-directories.") : /* @__PURE__ */ import_react65.default.createElement("div", { className: "divide-y divide-neutral-50" }, explorer.folders.map((f) => /* @__PURE__ */ import_react65.default.createElement("div", { key: f.id, onClick: () => navigateExplorer(f.id), className: "flex items-center gap-3 p-3 hover:bg-neutral-50 cursor-pointer transition-colors" }, /* @__PURE__ */ import_react65.default.createElement(import_react66.HugeiconsIcon, { icon: import_core_free_icons22.FolderIcon, size: 16, className: "text-black" }), /* @__PURE__ */ import_react65.default.createElement("span", { className: "text-sm text-black truncate" }, f.name))))), /* @__PURE__ */ import_react65.default.createElement("div", { className: "flex items-center justify-end gap-3 mt-2" }, /* @__PURE__ */ import_react65.default.createElement("button", { onClick: () => setExplorer((p) => ({ ...p, isOpen: false })), disabled: isSubmitting, className: "px-6 py-2.5 text-xs text-neutral-500 hover:bg-neutral-50 rounded-full outline-none disabled:opacity-50 transition-colors" }, "Cancel"), /* @__PURE__ */ import_react65.default.createElement(ThreeDActionButton, { onClick: executeExplorerAction, isLoading: isSubmitting }, "Paste Here")))));
|
|
3484
3485
|
};
|
|
3485
3486
|
|
|
3486
3487
|
// src/components/DriveItemOpener.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -3282,7 +3282,9 @@ import {
|
|
|
3282
3282
|
Share01Icon,
|
|
3283
3283
|
Tick01Icon,
|
|
3284
3284
|
FileEditIcon,
|
|
3285
|
-
ArrowRight02Icon
|
|
3285
|
+
ArrowRight02Icon,
|
|
3286
|
+
Cancel01Icon as Cancel01Icon3,
|
|
3287
|
+
ReloadIcon
|
|
3286
3288
|
} from "@hugeicons/core-free-icons";
|
|
3287
3289
|
|
|
3288
3290
|
// src/components/FileIconMapper.tsx
|
|
@@ -3353,6 +3355,7 @@ var UniversalDriveView = ({
|
|
|
3353
3355
|
onMoveToTrash,
|
|
3354
3356
|
onClearUploadQueue,
|
|
3355
3357
|
onPageChange,
|
|
3358
|
+
onRefresh,
|
|
3356
3359
|
onFetchFoldersForExplorer,
|
|
3357
3360
|
onExecuteMoveCopy,
|
|
3358
3361
|
onOpenFile,
|
|
@@ -3389,11 +3392,7 @@ var UniversalDriveView = ({
|
|
|
3389
3392
|
return parseFloat((num / Math.pow(k, i)).toFixed(1)) + " " + sizes[i];
|
|
3390
3393
|
};
|
|
3391
3394
|
const formatDate3 = (dateString) => {
|
|
3392
|
-
return new Date(dateString).toLocaleDateString("en-US", {
|
|
3393
|
-
month: "short",
|
|
3394
|
-
day: "numeric",
|
|
3395
|
-
year: "numeric"
|
|
3396
|
-
});
|
|
3395
|
+
return new Date(dateString).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
3397
3396
|
};
|
|
3398
3397
|
const handleRowClick = (id, e) => {
|
|
3399
3398
|
if (e.ctrlKey || e.metaKey) {
|
|
@@ -3402,6 +3401,10 @@ var UniversalDriveView = ({
|
|
|
3402
3401
|
setSelectedIds([id]);
|
|
3403
3402
|
}
|
|
3404
3403
|
};
|
|
3404
|
+
const handleSelectAll = () => {
|
|
3405
|
+
if (selectedIds.length === items.length && items.length > 0) setSelectedIds([]);
|
|
3406
|
+
else setSelectedIds(items.map((i) => i.id));
|
|
3407
|
+
};
|
|
3405
3408
|
const handleItemDoubleClick = (item) => {
|
|
3406
3409
|
if (item.type === "FOLDER") {
|
|
3407
3410
|
setSelectedIds([]);
|
|
@@ -3431,7 +3434,7 @@ var UniversalDriveView = ({
|
|
|
3431
3434
|
const globalProgress = uploadQueue.length > 0 ? Math.round(uploadQueue.reduce((acc, job) => acc + job.progress, 0) / (uploadQueue.length * 100) * 100) : 0;
|
|
3432
3435
|
const isUILocked = isLoading || isSubmitting;
|
|
3433
3436
|
const lockClass = isUILocked ? "pointer-events-none opacity-60" : "";
|
|
3434
|
-
return /* @__PURE__ */ React40.createElement("div", { className: "flex flex-col gap-6 max-w-5xl w-full mx-auto p-6 bg-white rounded-2xl animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React40.createElement(ManagedToaster, null), /* @__PURE__ */ React40.createElement("div", { className: `flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-4 border-b border-neutral-100 transition-opacity ${lockClass}` }, /* @__PURE__ */ React40.createElement("div", null, /* @__PURE__ */ React40.createElement("h1", { className: "text-xl text-black tracking-tight mb-1" }, "Drive"), /* @__PURE__ */ React40.createElement("p", { className: "text-xs text-neutral-500" }, "Secure cloud storage optimized for your workspace.")), /* @__PURE__ */ React40.createElement("div", { className: "flex items-center gap-2 shrink-0" }, selectedIds.length > 0 && /* @__PURE__ */ React40.createElement(React40.Fragment, null, selectedIds.length === 1 && /* @__PURE__ */ React40.createElement("button", { onClick: () => {
|
|
3437
|
+
return /* @__PURE__ */ React40.createElement("div", { className: "flex flex-col gap-6 max-w-5xl w-full mx-auto p-6 bg-white rounded-2xl animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React40.createElement(ManagedToaster, null), /* @__PURE__ */ React40.createElement("div", { className: `flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-4 border-b border-neutral-100 transition-opacity ${lockClass}` }, /* @__PURE__ */ React40.createElement("div", null, /* @__PURE__ */ React40.createElement("h1", { className: "text-xl text-black tracking-tight mb-1" }, "Drive"), /* @__PURE__ */ React40.createElement("p", { className: "text-xs text-neutral-500" }, "Secure cloud storage optimized for your workspace.")), /* @__PURE__ */ React40.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ React40.createElement("button", { onClick: onRefresh, title: "Refresh Directory", className: "p-2.5 bg-neutral-50 text-neutral-500 hover:text-black hover:bg-neutral-100 rounded-full transition-all outline-none" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: ReloadIcon, size: 18 })), /* @__PURE__ */ React40.createElement("div", { className: "w-px h-6 bg-neutral-200 mx-1" }), selectedIds.length > 0 && /* @__PURE__ */ React40.createElement(React40.Fragment, null, selectedIds.length === 1 && /* @__PURE__ */ React40.createElement("button", { onClick: () => {
|
|
3435
3438
|
const item = items.find((i) => i.id === selectedIds[0]);
|
|
3436
3439
|
if (item) setRenameModal({ isOpen: true, id: item.id, name: item.name });
|
|
3437
3440
|
setFolderInputVal(item?.name || "");
|
|
@@ -3444,13 +3447,13 @@ var UniversalDriveView = ({
|
|
|
3444
3447
|
}, className: "text-neutral-500 hover:text-red-600 p-1 flex items-center gap-1.5 text-xs outline-none" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: Delete02Icon2, size: 14 }), " Move to Trash"))), /* @__PURE__ */ React40.createElement("div", { className: `flex items-center gap-1.5 overflow-x-auto text-xs py-1 border-b border-neutral-50 text-neutral-400 whitespace-nowrap ${lockClass}` }, folderBreadcrumbs.map((crumb, idx) => /* @__PURE__ */ React40.createElement(React40.Fragment, { key: idx }, idx > 0 && /* @__PURE__ */ React40.createElement("span", null, "/"), /* @__PURE__ */ React40.createElement("button", { onClick: () => {
|
|
3445
3448
|
setSelectedIds([]);
|
|
3446
3449
|
onNavigateFolder(crumb.id);
|
|
3447
|
-
}, className: `hover:text-black transition-colors outline-none ${idx === folderBreadcrumbs.length - 1 ? "text-black font-medium" : ""}` }, crumb.name)))), /* @__PURE__ */ React40.createElement("div", { className: `w-full overflow-x-auto select-none flex-1 relative min-h-
|
|
3450
|
+
}, className: `hover:text-black transition-colors outline-none ${idx === folderBreadcrumbs.length - 1 ? "text-black font-medium" : ""}` }, crumb.name)))), /* @__PURE__ */ React40.createElement("div", { className: `w-full overflow-x-auto select-none flex-1 relative min-h-[300px] ${lockClass}` }, /* @__PURE__ */ React40.createElement("table", { className: "w-full text-left border-collapse min-w-full relative z-10" }, /* @__PURE__ */ React40.createElement("thead", null, /* @__PURE__ */ React40.createElement("tr", { className: "border-b border-neutral-100 bg-white" }, /* @__PURE__ */ React40.createElement("th", { className: "w-10 p-3" }, /* @__PURE__ */ React40.createElement("input", { type: "checkbox", checked: selectedIds.length === items.length && items.length > 0, onChange: () => items.length > 0 && (selectedIds.length === items.length ? setSelectedIds([]) : setSelectedIds(items.map((i) => i.id))), className: "rounded border-neutral-300 w-4 h-4 text-black focus:ring-black accent-black cursor-pointer" })), /* @__PURE__ */ React40.createElement("th", { className: "text-[11px] uppercase tracking-[0.2em] text-neutral-400 p-3" }, "Name"), /* @__PURE__ */ React40.createElement("th", { className: "text-[11px] uppercase tracking-[0.2em] text-neutral-400 p-3" }, "Modified"), /* @__PURE__ */ React40.createElement("th", { className: "text-[11px] uppercase tracking-[0.2em] text-neutral-400 p-3 text-right" }, "Size"))), /* @__PURE__ */ React40.createElement("tbody", { className: "divide-y divide-neutral-50" }, items.length === 0 && !isLoading && /* @__PURE__ */ React40.createElement("tr", null, /* @__PURE__ */ React40.createElement("td", { colSpan: 4, className: "py-24 text-center" }, /* @__PURE__ */ React40.createElement("div", { className: "flex flex-col items-center justify-center" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: FolderIcon2, size: 40, className: "text-neutral-200 mb-3" }), /* @__PURE__ */ React40.createElement("p", { className: "text-xs text-neutral-400" }, "This directory is empty.")))), items.map((item) => {
|
|
3448
3451
|
const isChecked = selectedIds.includes(item.id);
|
|
3449
3452
|
return /* @__PURE__ */ React40.createElement("tr", { key: item.id, onClick: (e) => handleRowClick(item.id, e), onDoubleClick: () => handleItemDoubleClick(item), onContextMenu: (e) => {
|
|
3450
3453
|
e.preventDefault();
|
|
3451
3454
|
setSelectedIds([item.id]);
|
|
3452
3455
|
}, className: `hover:bg-neutral-50/70 transition-colors cursor-pointer group ${isChecked ? "bg-neutral-50" : ""}` }, /* @__PURE__ */ React40.createElement("td", { className: "p-3", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React40.createElement("input", { type: "checkbox", checked: isChecked, onChange: () => handleRowClick(item.id, { ctrlKey: true }), className: "rounded border-neutral-300 w-4 h-4 text-black focus:ring-black accent-black cursor-pointer" })), /* @__PURE__ */ React40.createElement("td", { className: "p-3 flex items-center gap-3 min-w-0" }, /* @__PURE__ */ React40.createElement("div", { className: "w-8 h-8 shrink-0 bg-neutral-100 rounded-lg flex items-center justify-center relative" }, /* @__PURE__ */ React40.createElement(FileIconMapper, { type: item.type, mimeType: item.mimeType })), /* @__PURE__ */ React40.createElement("span", { className: "text-xs text-black truncate pr-4" }, item.name)), /* @__PURE__ */ React40.createElement("td", { className: "p-3 text-xs text-neutral-500 whitespace-nowrap" }, formatDate3(item.updatedAt)), /* @__PURE__ */ React40.createElement("td", { className: "p-3 text-xs text-neutral-500 text-right whitespace-nowrap" }, formatBytes(item.size)));
|
|
3453
|
-
})))), /* @__PURE__ */ React40.createElement("div", { className: `flex items-center justify-between pt-4 border-t border-neutral-100 ${lockClass}` }, /* @__PURE__ */ React40.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em] uppercase" }, "Page ", currentPage, " of ", Math.max(1, totalPages)), /* @__PURE__ */ React40.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React40.createElement("button", { onClick: () => onPageChange(currentPage - 1), disabled: currentPage <= 1, className: "p-2 border border-neutral-100 rounded-full bg-white text-neutral-500 hover:text-black disabled:opacity-30 transition-all outline-none" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: ArrowLeft01Icon8, size: 14 })), /* @__PURE__ */ React40.createElement("button", { onClick: () => onPageChange(currentPage + 1), disabled: currentPage >= totalPages, className: "p-2 border border-neutral-100 rounded-full bg-white text-neutral-500 hover:text-black disabled:opacity-30 transition-all outline-none" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: ArrowRight01Icon7, size: 14 })))), activeJobs.length > 0 && /* @__PURE__ */ React40.createElement("div", { className: "fixed bottom-6 right-6 w-80 bg-white border border-neutral-200 shadow-2xl rounded-xl z-100 overflow-hidden flex flex-col animate-in slide-in-from-bottom-4 duration-300" }, /* @__PURE__ */ React40.createElement("div", { className: "p-4 border-b border-neutral-100 bg-neutral-50 flex items-center justify-between" }, /* @__PURE__ */ React40.createElement("div", null, /* @__PURE__ */ React40.createElement("h4", { className: "text-xs text-black font-medium" }, "Uploading Elements"), /* @__PURE__ */ React40.createElement("p", { className: "text-[10px] text-neutral-500 mt-0.5" }, "Processing ", activeJobs.length, " streams"))), /* @__PURE__ */ React40.createElement("div", { className: "w-full h-1 bg-neutral-100 relative" }, /* @__PURE__ */ React40.createElement("div", { className: "h-full transition-all duration-500 ease-out", style: { width: `${globalProgress}%`, background: "linear-gradient(to right, #f64b4d, #ffa360)" } })), /* @__PURE__ */ React40.createElement("div", { className: "max-h-40 overflow-y-auto divide-y divide-neutral-50 p-2" }, uploadQueue.map((job) => /* @__PURE__ */ React40.createElement("div", { key: job.id, className: "flex items-center justify-between p-2 text-[11px] gap-4" }, /* @__PURE__ */ React40.createElement("span", { className: "text-black truncate flex-1 pr-2" }, job.name), /* @__PURE__ */ React40.createElement("div", { className: "shrink-0 whitespace-nowrap flex items-center gap-2" }, job.status === "COMPLETED" ? /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: Tick01Icon, size: 12, className: "text-green-600" }) : job.status === "FAILED" ? /* @__PURE__ */ React40.createElement("span", { className: "text-red-600 text-[10px]" }, "Failed") : /* @__PURE__ */ React40.createElement("span", { className: "text-neutral-500 text-[10px]" }, job.progress, "%")))))), (isNewFolderModalOpen || renameModal.isOpen) && /* @__PURE__ */ React40.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ React40.createElement("div", { className: "absolute inset-0 bg-black/30 backdrop-blur-sm", onClick: () => !isSubmitting && (setIsNewFolderModalOpen(false), setRenameModal({ isOpen: false, id: "", name: "" })) }), /* @__PURE__ */ React40.createElement("form", { onSubmit: async (e) => {
|
|
3456
|
+
}))), isLoading && /* @__PURE__ */ React40.createElement("div", { className: "absolute inset-0 top-12 z-20 bg-white/60 backdrop-blur-[1px] flex items-start justify-center pt-20" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: Loading03Icon12, className: "animate-spin text-neutral-400", size: 24 }))), /* @__PURE__ */ React40.createElement("div", { className: `flex items-center justify-between pt-4 border-t border-neutral-100 ${lockClass}` }, /* @__PURE__ */ React40.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em] uppercase" }, "Page ", currentPage, " of ", Math.max(1, totalPages)), /* @__PURE__ */ React40.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React40.createElement("button", { onClick: () => onPageChange(currentPage - 1), disabled: currentPage <= 1, className: "p-2 border border-neutral-100 rounded-full bg-white text-neutral-500 hover:text-black disabled:opacity-30 transition-all outline-none" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: ArrowLeft01Icon8, size: 14 })), /* @__PURE__ */ React40.createElement("button", { onClick: () => onPageChange(currentPage + 1), disabled: currentPage >= totalPages, className: "p-2 border border-neutral-100 rounded-full bg-white text-neutral-500 hover:text-black disabled:opacity-30 transition-all outline-none" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: ArrowRight01Icon7, size: 14 })))), activeJobs.length > 0 && /* @__PURE__ */ React40.createElement("div", { className: "fixed bottom-6 right-6 w-80 bg-white border border-neutral-200 shadow-2xl rounded-xl z-[100] overflow-hidden flex flex-col animate-in slide-in-from-bottom-4 duration-300" }, /* @__PURE__ */ React40.createElement("div", { className: "p-4 border-b border-neutral-100 bg-neutral-50 flex items-center justify-between" }, /* @__PURE__ */ React40.createElement("div", null, /* @__PURE__ */ React40.createElement("h4", { className: "text-xs text-black font-medium" }, "Uploading Elements"), /* @__PURE__ */ React40.createElement("p", { className: "text-[10px] text-neutral-500 mt-0.5" }, "Processing ", activeJobs.length, " streams")), onClearUploadQueue && activeJobs.length === 0 && /* @__PURE__ */ React40.createElement("button", { onClick: onClearUploadQueue, className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: Cancel01Icon3, size: 14 }))), /* @__PURE__ */ React40.createElement("div", { className: "w-full h-1 bg-neutral-100 relative" }, /* @__PURE__ */ React40.createElement("div", { className: "h-full transition-all duration-500 ease-out", style: { width: `${globalProgress}%`, background: "linear-gradient(to right, #f64b4d, #ffa360)" } })), /* @__PURE__ */ React40.createElement("div", { className: "max-h-40 overflow-y-auto divide-y divide-neutral-50 p-2" }, uploadQueue.map((job) => /* @__PURE__ */ React40.createElement("div", { key: job.id, className: "flex items-center justify-between p-2 text-[11px] gap-4" }, /* @__PURE__ */ React40.createElement("span", { className: "text-black truncate flex-1 pr-2" }, job.name), /* @__PURE__ */ React40.createElement("div", { className: "shrink-0 whitespace-nowrap flex items-center gap-2" }, job.status === "COMPLETED" ? /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: Tick01Icon, size: 12, className: "text-green-600" }) : job.status === "FAILED" ? /* @__PURE__ */ React40.createElement("span", { className: "text-red-600 text-[10px]" }, "Failed") : /* @__PURE__ */ React40.createElement("span", { className: "text-neutral-500 text-[10px]" }, job.progress, "%")))))), (isNewFolderModalOpen || renameModal.isOpen) && /* @__PURE__ */ React40.createElement("div", { className: "fixed inset-0 z-[110] flex items-center justify-center p-4" }, /* @__PURE__ */ React40.createElement("div", { className: "absolute inset-0 bg-black/30 backdrop-blur-sm", onClick: () => !isSubmitting && (setIsNewFolderModalOpen(false), setRenameModal({ isOpen: false, id: "", name: "" })) }), /* @__PURE__ */ React40.createElement("form", { onSubmit: async (e) => {
|
|
3454
3457
|
e.preventDefault();
|
|
3455
3458
|
if (!folderInputVal.trim() || isSubmitting) return;
|
|
3456
3459
|
setIsSubmitting(true);
|
|
@@ -3463,7 +3466,7 @@ var UniversalDriveView = ({
|
|
|
3463
3466
|
}, className: "relative w-full max-w-sm bg-white shadow-2xl rounded-2xl p-8 flex flex-col gap-6 animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React40.createElement("div", null, /* @__PURE__ */ React40.createElement("h3", { className: "text-lg text-black tracking-tight mb-1" }, isNewFolderModalOpen ? "Create Directory" : "Rename Element"), /* @__PURE__ */ React40.createElement("p", { className: "text-[11px] text-neutral-400" }, "Please provide a valid alphanumeric name.")), /* @__PURE__ */ React40.createElement(TextInput, { placeholder: "Name (e.g., Q3 Invoices)", value: folderInputVal, onChange: setFolderInputVal }), /* @__PURE__ */ React40.createElement("div", { className: "flex items-center justify-end gap-3 mt-2" }, /* @__PURE__ */ React40.createElement("button", { type: "button", onClick: () => {
|
|
3464
3467
|
setIsNewFolderModalOpen(false);
|
|
3465
3468
|
setRenameModal({ isOpen: false, id: "", name: "" });
|
|
3466
|
-
}, disabled: isSubmitting, className: "px-6 py-2.5 text-xs text-neutral-500 hover:bg-neutral-50 rounded-full outline-none disabled:opacity-50 transition-colors" }, "Cancel"), /* @__PURE__ */ React40.createElement(ThreeDActionButton, { type: "submit", isLoading: isSubmitting, disabled: !folderInputVal.trim() }, isNewFolderModalOpen ? "Create" : "Rename")))), explorer.isOpen && /* @__PURE__ */ React40.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4" }, /* @__PURE__ */ React40.createElement("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-sm", onClick: () => !isSubmitting && setExplorer((p) => ({ ...p, isOpen: false })) }), /* @__PURE__ */ React40.createElement("div", { className: "relative w-full max-w-md bg-white shadow-2xl rounded-2xl p-6 flex flex-col gap-4 animate-in zoom-in-95 duration-200 min-h-
|
|
3469
|
+
}, disabled: isSubmitting, className: "px-6 py-2.5 text-xs text-neutral-500 hover:bg-neutral-50 rounded-full outline-none disabled:opacity-50 transition-colors" }, "Cancel"), /* @__PURE__ */ React40.createElement(ThreeDActionButton, { type: "submit", isLoading: isSubmitting, disabled: !folderInputVal.trim() }, isNewFolderModalOpen ? "Create" : "Rename")))), explorer.isOpen && /* @__PURE__ */ React40.createElement("div", { className: "fixed inset-0 z-[120] flex items-center justify-center p-4" }, /* @__PURE__ */ React40.createElement("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-sm", onClick: () => !isSubmitting && setExplorer((p) => ({ ...p, isOpen: false })) }), /* @__PURE__ */ React40.createElement("div", { className: "relative w-full max-w-md bg-white shadow-2xl rounded-2xl p-6 flex flex-col gap-4 animate-in zoom-in-95 duration-200 min-h-[400px]" }, /* @__PURE__ */ React40.createElement("div", null, /* @__PURE__ */ React40.createElement("h3", { className: "text-lg text-black tracking-tight mb-1 capitalize" }, explorer.action, " Items"), /* @__PURE__ */ React40.createElement("p", { className: "text-[11px] text-neutral-400" }, "Select destination directory.")), /* @__PURE__ */ React40.createElement("div", { className: "flex items-center gap-1.5 overflow-x-auto text-xs py-2 border-b border-neutral-100 text-neutral-400 whitespace-nowrap bg-neutral-50 px-3 rounded-lg" }, explorer.breadcrumbs.map((crumb, idx) => /* @__PURE__ */ React40.createElement(React40.Fragment, { key: idx }, idx > 0 && /* @__PURE__ */ React40.createElement("span", null, "/"), /* @__PURE__ */ React40.createElement("button", { disabled: explorer.loading, onClick: () => navigateExplorer(crumb.id), className: `hover:text-black outline-none ${idx === explorer.breadcrumbs.length - 1 ? "text-black font-medium" : ""}` }, crumb.name)))), /* @__PURE__ */ React40.createElement("div", { className: "flex-1 overflow-y-auto border border-neutral-100 rounded-xl" }, explorer.loading ? /* @__PURE__ */ React40.createElement("div", { className: "h-full flex items-center justify-center p-10" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: Loading03Icon12, className: "animate-spin text-neutral-400", size: 20 })) : explorer.folders.length === 0 ? /* @__PURE__ */ React40.createElement("div", { className: "h-full flex items-center justify-center p-10 text-xs text-neutral-400" }, "No sub-directories.") : /* @__PURE__ */ React40.createElement("div", { className: "divide-y divide-neutral-50" }, explorer.folders.map((f) => /* @__PURE__ */ React40.createElement("div", { key: f.id, onClick: () => navigateExplorer(f.id), className: "flex items-center gap-3 p-3 hover:bg-neutral-50 cursor-pointer transition-colors" }, /* @__PURE__ */ React40.createElement(HugeiconsIcon26, { icon: FolderIcon2, size: 16, className: "text-black" }), /* @__PURE__ */ React40.createElement("span", { className: "text-sm text-black truncate" }, f.name))))), /* @__PURE__ */ React40.createElement("div", { className: "flex items-center justify-end gap-3 mt-2" }, /* @__PURE__ */ React40.createElement("button", { onClick: () => setExplorer((p) => ({ ...p, isOpen: false })), disabled: isSubmitting, className: "px-6 py-2.5 text-xs text-neutral-500 hover:bg-neutral-50 rounded-full outline-none disabled:opacity-50 transition-colors" }, "Cancel"), /* @__PURE__ */ React40.createElement(ThreeDActionButton, { onClick: executeExplorerAction, isLoading: isSubmitting }, "Paste Here")))));
|
|
3467
3470
|
};
|
|
3468
3471
|
|
|
3469
3472
|
// src/components/DriveItemOpener.tsx
|