@putkoff/abstract-securefiles 0.0.48 → 0.0.50
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/ConfirmButton.d.ts +5 -0
- package/dist/CopyButton.d.ts +4 -0
- package/dist/FolderSelect.d.ts +6 -0
- package/dist/SecureFiles.d.ts +3 -0
- package/dist/ServerFiles.d.ts +6 -0
- package/dist/ShareDialog.d.ts +6 -0
- package/dist/UploadPanel.d.ts +6 -0
- package/dist/api.d.ts +47 -0
- package/dist/index.cjs +529 -1004
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -8
- package/dist/index.js +522 -951
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +60 -0
- package/package.json +15 -11
- package/src/ConfirmButton.tsx +35 -0
- package/src/CopyButton.tsx +24 -0
- package/src/FolderSelect.tsx +68 -0
- package/src/SecureFiles.tsx +346 -0
- package/src/ServerFiles.tsx +339 -0
- package/src/ShareDialog.tsx +148 -0
- package/src/UploadPanel.tsx +217 -0
- package/src/api.ts +108 -0
- package/src/index.ts +4 -8
- package/src/styles.css +442 -0
- package/src/types.ts +56 -0
- package/css.d.ts +0 -2
- package/dist/App/SecureFiles.d.ts +0 -4
- package/dist/App/index.d.ts +0 -1
- package/dist/FileHandlers/FileRow/imports.d.ts +0 -2
- package/dist/FileHandlers/FileRow/index.d.ts +0 -1
- package/dist/FileHandlers/FileRow/src/index.d.ts +0 -1
- package/dist/FileHandlers/FileRow/src/row_utils.d.ts +0 -2
- package/dist/FileHandlers/FileTable/imports.d.ts +0 -4
- package/dist/FileHandlers/FileTable/index.d.ts +0 -1
- package/dist/FileHandlers/FileTable/src/index.d.ts +0 -1
- package/dist/FileHandlers/FileTable/src/table_utils.d.ts +0 -2
- package/dist/FileHandlers/ShareModal/imports.d.ts +0 -2
- package/dist/FileHandlers/ShareModal/index.d.ts +0 -1
- package/dist/FileHandlers/ShareModal/src/index.d.ts +0 -1
- package/dist/FileHandlers/ShareModal/src/share_utils.d.ts +0 -2
- package/dist/FileHandlers/Upload/imports.d.ts +0 -2
- package/dist/FileHandlers/Upload/index.d.ts +0 -1
- package/dist/FileHandlers/Upload/src/index.d.ts +0 -2
- package/dist/FileHandlers/Upload/src/upload_utils.d.ts +0 -2
- package/dist/FileHandlers/imports.d.ts +0 -4
- package/dist/FileHandlers/index.d.ts +0 -4
- package/dist/UI/index.d.ts +0 -28
- package/dist/file_utils/imports.d.ts +0 -2
- package/dist/file_utils/index.d.ts +0 -1
- package/dist/file_utils/src/cookieFetch.d.ts +0 -33
- package/dist/file_utils/src/delete_utils/imports.d.ts +0 -1
- package/dist/file_utils/src/delete_utils/index.d.ts +0 -1
- package/dist/file_utils/src/delete_utils/src/delete_row.d.ts +0 -2
- package/dist/file_utils/src/delete_utils/src/delete_select.d.ts +0 -4
- package/dist/file_utils/src/delete_utils/src/delete_selected.d.ts +0 -2
- package/dist/file_utils/src/delete_utils/src/index.d.ts +0 -3
- package/dist/file_utils/src/download_utils/imports.d.ts +0 -2
- package/dist/file_utils/src/download_utils/index.d.ts +0 -1
- package/dist/file_utils/src/download_utils/src/direct_download.d.ts +0 -3
- package/dist/file_utils/src/download_utils/src/download_file.d.ts +0 -6
- package/dist/file_utils/src/download_utils/src/download_select.d.ts +0 -2
- package/dist/file_utils/src/download_utils/src/index.d.ts +0 -5
- package/dist/file_utils/src/download_utils/src/target_downloads.d.ts +0 -4
- package/dist/file_utils/src/download_utils/src/trigger_download.d.ts +0 -2
- package/dist/file_utils/src/imports.d.ts +0 -2
- package/dist/file_utils/src/index.d.ts +0 -6
- package/dist/file_utils/src/list_utils/imports.d.ts +0 -1
- package/dist/file_utils/src/list_utils/index.d.ts +0 -1
- package/dist/file_utils/src/list_utils/src/index.d.ts +0 -1
- package/dist/file_utils/src/list_utils/src/list_utils.d.ts +0 -2
- package/dist/file_utils/src/select_utils/index.d.ts +0 -1
- package/dist/file_utils/src/select_utils/src/index.d.ts +0 -3
- package/dist/file_utils/src/select_utils/src/init_select_all.d.ts +0 -2
- package/dist/file_utils/src/select_utils/src/sync_header_checkbox.d.ts +0 -5
- package/dist/file_utils/src/select_utils/src/toggle_checkboxes.d.ts +0 -2
- package/dist/file_utils/src/share_utils/imports.d.ts +0 -1
- package/dist/file_utils/src/share_utils/index.d.ts +0 -1
- package/dist/file_utils/src/share_utils/src/index.d.ts +0 -1
- package/dist/file_utils/src/share_utils/src/share_utils.d.ts +0 -7
- package/dist/file_utils/src/upload_utils/imports.d.ts +0 -0
- package/dist/file_utils/src/upload_utils/index.d.ts +0 -1
- package/dist/file_utils/src/upload_utils/src/index.d.ts +0 -3
- package/dist/file_utils/src/upload_utils/src/patch_file_settings.d.ts +0 -2
- package/dist/file_utils/src/upload_utils/src/upload_file.d.ts +0 -2
- package/dist/file_utils/src/upload_utils/src/upload_files.d.ts +0 -5
- package/dist/hooks/imports.d.ts +0 -3
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useFiles/imports.d.ts +0 -2
- package/dist/hooks/useFiles/index.d.ts +0 -1
- package/dist/hooks/useFiles/src/deleteFile.d.ts +0 -3
- package/dist/hooks/useFiles/src/index.d.ts +0 -6
- package/dist/hooks/useFiles/src/load.d.ts +0 -3
- package/dist/hooks/useFiles/src/patchShareSettings.d.ts +0 -3
- package/dist/hooks/useFiles/src/toggleShare.d.ts +0 -3
- package/dist/hooks/useFiles/src/useFiles.d.ts +0 -13
- package/dist/hooks/useFiles/src/useSaveShareSettings.d.ts +0 -7
- package/dist/imports.d.ts +0 -6
- package/dist/index.css +0 -1
- package/dist/styles/index.d.ts +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/types.d.ts +0 -75
- package/index.ts +0 -1
- package/postcss.config.cjs +0 -8
- package/rollup.config.js +0 -38
- package/rollup.config.mjs +0 -35
- package/src/App/SecureFiles.tsx +0 -45
- package/src/App/index.ts +0 -1
- package/src/FileHandlers/FileRow/imports.ts +0 -2
- package/src/FileHandlers/FileRow/index.ts +0 -1
- package/src/FileHandlers/FileRow/src/index.ts +0 -1
- package/src/FileHandlers/FileRow/src/row_utils.tsx +0 -143
- package/src/FileHandlers/FileTable/imports.ts +0 -15
- package/src/FileHandlers/FileTable/index.ts +0 -1
- package/src/FileHandlers/FileTable/src/index.ts +0 -1
- package/src/FileHandlers/FileTable/src/table_utils.tsx +0 -251
- package/src/FileHandlers/ShareModal/imports.ts +0 -2
- package/src/FileHandlers/ShareModal/index.ts +0 -1
- package/src/FileHandlers/ShareModal/src/index.ts +0 -1
- package/src/FileHandlers/ShareModal/src/share_utils.tsx +0 -155
- package/src/FileHandlers/Upload/imports.ts +0 -3
- package/src/FileHandlers/Upload/index.ts +0 -1
- package/src/FileHandlers/Upload/src/index.ts +0 -2
- package/src/FileHandlers/Upload/src/upload_utils.tsx +0 -369
- package/src/FileHandlers/imports.ts +0 -17
- package/src/FileHandlers/index.ts +0 -4
- package/src/UI/index.tsx +0 -122
- package/src/custom.d.ts +0 -7
- package/src/file_utils/imports.ts +0 -2
- package/src/file_utils/index.ts +0 -1
- package/src/file_utils/src/cookieFetch.ts +0 -109
- package/src/file_utils/src/delete_utils/imports.ts +0 -1
- package/src/file_utils/src/delete_utils/index.ts +0 -1
- package/src/file_utils/src/delete_utils/src/delete_row.ts +0 -11
- package/src/file_utils/src/delete_utils/src/delete_select.ts +0 -10
- package/src/file_utils/src/delete_utils/src/delete_selected.ts +0 -15
- package/src/file_utils/src/delete_utils/src/index.ts +0 -3
- package/src/file_utils/src/download_utils/imports.ts +0 -3
- package/src/file_utils/src/download_utils/index.ts +0 -1
- package/src/file_utils/src/download_utils/src/direct_download.ts +0 -22
- package/src/file_utils/src/download_utils/src/download_file.ts +0 -25
- package/src/file_utils/src/download_utils/src/download_select.ts +0 -25
- package/src/file_utils/src/download_utils/src/index.ts +0 -5
- package/src/file_utils/src/download_utils/src/target_downloads.ts +0 -21
- package/src/file_utils/src/download_utils/src/trigger_download.ts +0 -14
- package/src/file_utils/src/imports.ts +0 -3
- package/src/file_utils/src/index.ts +0 -6
- package/src/file_utils/src/list_utils/imports.ts +0 -2
- package/src/file_utils/src/list_utils/index.ts +0 -1
- package/src/file_utils/src/list_utils/src/index.ts +0 -1
- package/src/file_utils/src/list_utils/src/list_utils.ts +0 -28
- package/src/file_utils/src/select_utils/index.ts +0 -1
- package/src/file_utils/src/select_utils/src/index.ts +0 -3
- package/src/file_utils/src/select_utils/src/init_select_all.ts +0 -37
- package/src/file_utils/src/select_utils/src/sync_header_checkbox.ts +0 -18
- package/src/file_utils/src/select_utils/src/toggle_checkboxes.ts +0 -11
- package/src/file_utils/src/share_utils/imports.ts +0 -1
- package/src/file_utils/src/share_utils/index.ts +0 -1
- package/src/file_utils/src/share_utils/src/index.ts +0 -1
- package/src/file_utils/src/share_utils/src/share_utils.ts +0 -20
- package/src/file_utils/src/upload_utils/imports.ts +0 -1
- package/src/file_utils/src/upload_utils/index.ts +0 -1
- package/src/file_utils/src/upload_utils/src/index.ts +0 -3
- package/src/file_utils/src/upload_utils/src/patch_file_settings.ts +0 -20
- package/src/file_utils/src/upload_utils/src/upload_file.ts +0 -27
- package/src/file_utils/src/upload_utils/src/upload_files.ts +0 -19
- package/src/hooks/imports.ts +0 -3
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useFiles/imports.ts +0 -3
- package/src/hooks/useFiles/index.ts +0 -1
- package/src/hooks/useFiles/src/deleteFile.ts +0 -23
- package/src/hooks/useFiles/src/index.ts +0 -6
- package/src/hooks/useFiles/src/load.ts +0 -39
- package/src/hooks/useFiles/src/logs/clipit_logs.log +0 -0
- package/src/hooks/useFiles/src/logs/routes_bp.log +0 -0
- package/src/hooks/useFiles/src/patchShareSettings.ts +0 -27
- package/src/hooks/useFiles/src/toggleShare.ts +0 -28
- package/src/hooks/useFiles/src/useFiles.ts +0 -35
- package/src/hooks/useFiles/src/useSaveShareSettings.ts +0 -31
- package/src/imports.ts +0 -18
- package/src/styles/SecureFiles/App.css +0 -42
- package/src/styles/SecureFiles/index.css +0 -10
- package/src/styles/SecureFiles/logs/clipit_logs.log +0 -0
- package/src/styles/SecureFiles/logs/routes_bp.log +0 -0
- package/src/styles/SecureFiles/tailwind.css +0 -3
- package/src/styles/SecureFiles/window-manager.css +0 -283
- package/src/styles/SecureFilesStyles.module.css +0 -287
- package/src/styles/index.ts +0 -1
- package/src/types/index.ts +0 -1
- package/src/types/src/index.ts +0 -1
- package/src/types/src/types.ts +0 -88
- package/tailwind.config.cjs +0 -7
- package/testit.mjs +0 -11
- package/testit.ts +0 -3
- package/tsconfig.json +0 -27
- /package/src/{global.d.ts → css.d.ts} +0 -0
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Given a checkbox inside a table-row → download that row’s file. */
|
|
2
|
-
export declare function downloadRow(cb: HTMLInputElement): Promise<void>;
|
|
3
|
-
/** Bulk download: pass a NodeList or array of checkboxes. */
|
|
4
|
-
export declare function downloadSelected(checkboxes: Iterable<HTMLInputElement>): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { FileItem, ApiRow } from './../imports';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './list_utils';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { FileItem } from './../../../types/src/types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './share_utils';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { FileItem } from './../imports';
|
|
2
|
-
/**
|
|
3
|
-
* Toggle sharing on a file.
|
|
4
|
-
* Sends the updated settings to /api/secure-files/files/share.
|
|
5
|
-
* Does NOT update local state – the caller is responsible for that.
|
|
6
|
-
*/
|
|
7
|
-
export declare function toggleShare(file: FileItem): Promise<void>;
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src';
|
package/dist/hooks/imports.d.ts
DELETED
package/dist/hooks/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useFiles';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { FileItem } from './../imports';
|
|
3
|
-
export declare const useLoadFiles: (setLoading: React.Dispatch<React.SetStateAction<boolean>>, setError: React.Dispatch<React.SetStateAction<Error | null>>, setFiles: React.Dispatch<React.SetStateAction<FileItem[]>>) => () => Promise<void>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { FileItem } from './../imports';
|
|
2
|
-
export declare function useFiles(): {
|
|
3
|
-
files: FileItem[];
|
|
4
|
-
loading: boolean;
|
|
5
|
-
error: Error | null;
|
|
6
|
-
load: () => Promise<void>;
|
|
7
|
-
toggleShare: (file: FileItem) => Promise<void>;
|
|
8
|
-
patchShareSettings: (file: any) => Promise<void>;
|
|
9
|
-
deleteFile: (file: FileItem | FileItem[]) => Promise<void>;
|
|
10
|
-
setFiles: import("react").Dispatch<import("react").SetStateAction<FileItem[]>>;
|
|
11
|
-
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
12
|
-
setError: import("react").Dispatch<import("react").SetStateAction<Error | null>>;
|
|
13
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Hook alias used by useFiles.ts. Patches share settings via the session-cookie
|
|
4
|
-
* authenticated /files/share endpoint.
|
|
5
|
-
*/
|
|
6
|
-
export declare const useSaveShareSettings: (setFiles: React.Dispatch<React.SetStateAction<any[]>>) => (file: any) => Promise<void>;
|
|
7
|
-
export default useSaveShareSettings;
|
package/dist/imports.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { createPortal } from "react-dom";
|
|
2
|
-
export { ClipboardIcon, CloudArrowUpIcon } from "@heroicons/react/24/outline";
|
|
3
|
-
export { useEffect, useRef, useState, useCallback } from 'react';
|
|
4
|
-
export type { QueuedFile, FileItem, FileTableProps, UploadProps, ShareModalProps, FileRowProps, ApiRow, EnhancedInputProps } from './types';
|
|
5
|
-
export { currentUsername, alertit, requireToken, isLoggedIn, fetchIt, stripPrefixes, make_path } from "@putkoff/abstract-utilities";
|
|
6
|
-
export { Button, Checkbox, Input, Spinner } from './UI';
|
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */.relative{position:relative}.z-100{z-index:100}.z-110{z-index:110}.mx-auto{margin-inline:auto}.flex{display:flex}.hidden{display:none}.table{display:table}.table-row{display:table-row}.w-full{width:100%}.flex-1{flex:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap}.overflow-hidden,.truncate{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-full{border-radius:calc(infinity * 1px)}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-colors{transition-duration:var(--tw-duration,0s);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,ease)}.transition-shadow{transition-duration:var(--tw-duration,0s);transition-property:box-shadow;transition-timing-function:var(--tw-ease,ease)}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-150{--tw-duration:150ms;transition-duration:.15s}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.wm-table{font-size:13px;table-layout:fixed;width:100%}.wm-thead th{background-color:#e5e7eb;border-bottom:1px solid #9ca3af;font-weight:600;padding:5px 8px;text-align:left}.wm-row{background-color:#f9fafb;border-bottom:1px solid #d1d5db}.wm-row:hover{background-color:#eff6ff}.wm-cell{overflow:hidden;padding:5px 8px;text-overflow:ellipsis;white-space:nowrap}.wm-checkbox{border:1px solid #9ca3af;border-radius:4px;color:#2563eb;cursor:pointer;height:14px;width:14px}.wm-btn-link{color:#2563eb;text-decoration:underline}.wm-btn-link:hover{color:#1e40af}.wm-btn-link:disabled{color:#9ca3af;cursor:not-allowed}.wm-btn-icon{border-radius:4px;color:#4b5563;padding:2px}.wm-btn-icon:hover{background-color:#e5e7eb;color:#111827}.wm-btn-icon:disabled{color:#9ca3af}.file-table{border:1px solid #9ca3af;border-collapse:collapse;font-size:13px;line-height:1.15rem;width:100%}.file-table thead th{background-color:#e5e7eb;border-bottom:1px solid #9ca3af;border-right:1px solid #d1d5db;color:#1f2937;font-weight:600;padding:6px 12px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.file-table thead th:last-child{border-right:none}.file-table tbody tr{border-bottom:1px solid #d1d5db;transition:background-color .2s}.file-table tbody tr:hover{background-color:#f3f4f6}.file-table tbody tr:nth-child(2n){background-color:#f9fafb}.file-table td{border-right:1px solid #d1d5db;padding:6px 12px;vertical-align:middle;white-space:nowrap}.file-table td:last-child{border-right:none}.file-table .unsaved{color:#dc2626}.modal-backdrop{background-color:rgba(0,0,0,.6)}.modal-backdrop,.modal-wrapper{bottom:0;left:0;position:fixed;right:0;top:0}.modal-wrapper{align-items:center;display:flex;justify-content:center}.modal-panel{border-radius:12px;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);max-height:90vh;outline:none;overflow-y:auto}.form-container,.modal-panel{background-color:#fff;max-width:28rem;padding:24px}.form-container{border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06);display:flex;flex-direction:column;gap:16px}.form-title{font-size:20px;font-weight:600;text-align:center}.form-input{border:1px solid #d1d5db;border-radius:4px;display:block;padding:4px 8px;width:100%}.form-input:disabled{background-color:#f3f4f6}.form-group{margin-bottom:16px}.form-label{display:block;font-size:14px;font-weight:500;margin-bottom:4px}.form-error{color:#dc2626;font-size:14px}.btn{border-radius:8px;font-size:14px;font-weight:500;padding:4px 12px;transition:background-color .15s,color .15s}.btn:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(0,0,0,.1);outline:none}.btn-primary{background-color:#2563eb;color:#fff}.btn-primary:hover{background-color:#1d4ed8}.btn-primary:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(59,130,246,.5)}.btn-secondary{background-color:#e5e7eb}.btn-secondary:hover{background-color:#d1d5db}.btn-secondary:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(156,163,175,.5)}.btn-success{background-color:#16a34a;color:#fff}.btn-success:hover{background-color:#15803d}.btn-success:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(34,197,94,.5)}.btn-danger{background-color:#dc2626;color:#fff}.btn-danger:hover{background-color:#b91c1c}.btn-danger:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(239,68,68,.5)}.btn-icon{background-color:transparent;padding:4px}.btn-icon:hover{background-color:#f3f4f6}.checkbox{align-items:center;display:flex;gap:8px;margin-bottom:16px}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.logo{height:6em;padding:1.5em;transition:filter .3s;will-change:filter}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@media (prefers-reduced-motion:no-preference){a:nth-of-type(2) .logo{animation:logo-spin 20s linear infinite}}.card{padding:2em}.read-the-docs{color:#888}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}
|
package/dist/styles/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SecureFiles/index.css';
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { QueuedFile, FileItem, FileTableProps, UploadProps, ShareModalProps, FileRowProps, ApiRow, EnhancedInputProps } from './src/types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { QueuedFile, FileItem, FileTableProps, UploadProps, ShareModalProps, FileRowProps, ApiRow, EnhancedInputProps } from './types';
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export interface FileItem {
|
|
2
|
-
id: number | string;
|
|
3
|
-
filename: string;
|
|
4
|
-
uploader_id: string;
|
|
5
|
-
filepath: string;
|
|
6
|
-
created_at: string;
|
|
7
|
-
download_count: number;
|
|
8
|
-
download_limit: number | null;
|
|
9
|
-
shareable: boolean;
|
|
10
|
-
needsPassword: boolean;
|
|
11
|
-
share_password: string | null;
|
|
12
|
-
password_str: string | null;
|
|
13
|
-
}
|
|
14
|
-
export interface ApiRow {
|
|
15
|
-
id: number | string;
|
|
16
|
-
filename: string;
|
|
17
|
-
uploader_id: string;
|
|
18
|
-
filepath: string;
|
|
19
|
-
created_at: string;
|
|
20
|
-
download_count: number;
|
|
21
|
-
download_limit: number | null;
|
|
22
|
-
shareable: boolean;
|
|
23
|
-
needsPassword: boolean;
|
|
24
|
-
share_password: string;
|
|
25
|
-
password_str: string | null;
|
|
26
|
-
}
|
|
27
|
-
export interface FileListResponse {
|
|
28
|
-
files?: ApiRow[];
|
|
29
|
-
}
|
|
30
|
-
export interface FileTableProps {
|
|
31
|
-
files: FileItem[];
|
|
32
|
-
loading: boolean;
|
|
33
|
-
error: Error | null;
|
|
34
|
-
onDownload(id: any): Promise<void>;
|
|
35
|
-
onToggleShare(id: any): Promise<void>;
|
|
36
|
-
onPatchShare(id: any): Promise<void>;
|
|
37
|
-
onDelete(id: any): Promise<void>;
|
|
38
|
-
}
|
|
39
|
-
export interface ShareModalProps {
|
|
40
|
-
file: FileItem | null;
|
|
41
|
-
onClose(): void;
|
|
42
|
-
onSave(patch: Partial<FileItem>): Promise<void>;
|
|
43
|
-
}
|
|
44
|
-
export interface UploadProps {
|
|
45
|
-
/** Called *after* a successful upload */
|
|
46
|
-
onUploaded: () => Promise<void>;
|
|
47
|
-
}
|
|
48
|
-
export interface FileRowProps {
|
|
49
|
-
file: FileItem;
|
|
50
|
-
onDownload: () => Promise<void>;
|
|
51
|
-
onSettings: () => void;
|
|
52
|
-
onToggleShare: () => Promise<void>;
|
|
53
|
-
onDelete: () => any;
|
|
54
|
-
}
|
|
55
|
-
export interface QueuedFile {
|
|
56
|
-
file: File;
|
|
57
|
-
relPath: string;
|
|
58
|
-
progress: number;
|
|
59
|
-
}
|
|
60
|
-
export interface InputProps {
|
|
61
|
-
label?: any;
|
|
62
|
-
type?: any;
|
|
63
|
-
value?: any;
|
|
64
|
-
onChange?: any;
|
|
65
|
-
disabled?: any;
|
|
66
|
-
placeholder?: any;
|
|
67
|
-
error?: string;
|
|
68
|
-
}
|
|
69
|
-
export interface FileInputExtra {
|
|
70
|
-
directory?: boolean;
|
|
71
|
-
multiple?: boolean;
|
|
72
|
-
accept?: string;
|
|
73
|
-
}
|
|
74
|
-
/** keep other InputProps fields … */
|
|
75
|
-
export type EnhancedInputProps = InputProps & FileInputExtra;
|
package/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src';
|
package/postcss.config.cjs
DELETED
package/rollup.config.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
2
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
-
import typescript from '@rollup/plugin-typescript';
|
|
4
|
-
import dts from 'rollup-plugin-dts';
|
|
5
|
-
import { readFileSync } from 'fs';
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
7
|
-
|
|
8
|
-
// load package.json
|
|
9
|
-
const pkg = JSON.parse(
|
|
10
|
-
readFileSync(new URL('./package.json', import.meta.url), 'utf-8')
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
const deps = [
|
|
14
|
-
...Object.keys(pkg.peerDependencies || {}),
|
|
15
|
-
...Object.keys(pkg.dependencies || {}),
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
export default [
|
|
19
|
-
{
|
|
20
|
-
input: 'src/index.ts',
|
|
21
|
-
external: deps,
|
|
22
|
-
output: [
|
|
23
|
-
{ file: pkg.module, format: 'esm', sourcemap: true },
|
|
24
|
-
{ file: pkg.main, format: 'cjs', sourcemap: true, exports: 'named' }
|
|
25
|
-
],
|
|
26
|
-
plugins: [
|
|
27
|
-
resolve(),
|
|
28
|
-
commonjs(),
|
|
29
|
-
typescript({ tsconfig: './tsconfig.json', declaration: false })
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
input: 'src/index.ts',
|
|
34
|
-
external: deps,
|
|
35
|
-
output: { file: pkg.types, format: 'esm' },
|
|
36
|
-
plugins: [dts()]
|
|
37
|
-
}
|
|
38
|
-
];
|
package/rollup.config.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'fs';
|
|
2
|
-
import typescript from '@rollup/plugin-typescript';
|
|
3
|
-
import postcss from 'rollup-plugin-postcss';
|
|
4
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
5
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
6
|
-
|
|
7
|
-
const pkg = JSON.parse(
|
|
8
|
-
readFileSync(new URL('./package.json', import.meta.url), 'utf-8')
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
// Treat deps/peerDeps as externals so they are NOT bundled
|
|
12
|
-
const externals = [
|
|
13
|
-
...Object.keys(pkg.peerDependencies || {}),
|
|
14
|
-
...Object.keys(pkg.dependencies || {}),
|
|
15
|
-
'react/jsx-runtime', // needed for "react-jsx" TS transform
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
input: 'src/index.ts',
|
|
20
|
-
external: externals,
|
|
21
|
-
output: [
|
|
22
|
-
{ file: 'dist/index.js', format: 'esm', sourcemap: true },
|
|
23
|
-
{ file: 'dist/index.cjs', format: 'cjs', sourcemap: true, exports: 'named' }
|
|
24
|
-
],
|
|
25
|
-
plugins: [
|
|
26
|
-
resolve(), // let Rollup resolve node modules where needed
|
|
27
|
-
commonjs(), // convert CJS to ESM for build pipeline
|
|
28
|
-
postcss({
|
|
29
|
-
extract: true, // emits dist/index.css
|
|
30
|
-
minimize: true,
|
|
31
|
-
extensions: ['.css'],
|
|
32
|
-
}),
|
|
33
|
-
typescript({ tsconfig: './tsconfig.json' }),
|
|
34
|
-
],
|
|
35
|
-
};
|
package/src/App/SecureFiles.tsx
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import './../styles/SecureFiles/index.css';
|
|
2
|
-
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import { FileTable, Upload } from './../FileHandlers';
|
|
4
|
-
import { useFiles } from './../hooks';
|
|
5
|
-
import { checkAuth } from '../file_utils/src/cookieFetch';
|
|
6
|
-
|
|
7
|
-
const SecureFiles: React.FC = () => {
|
|
8
|
-
const [authChecked, setAuthChecked] = useState(false);
|
|
9
|
-
const [loggedIn, setLoggedIn] = useState(false);
|
|
10
|
-
const filesHook = useFiles();
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
checkAuth().then(ok => {
|
|
14
|
-
setLoggedIn(ok);
|
|
15
|
-
setAuthChecked(true);
|
|
16
|
-
});
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
19
|
-
if (!authChecked) return null;
|
|
20
|
-
|
|
21
|
-
if (!loggedIn) {
|
|
22
|
-
return (
|
|
23
|
-
<p style={{ textAlign: 'center', marginTop: '2rem', color: '#6b7280' }}>
|
|
24
|
-
Please log in to access your files.
|
|
25
|
-
</p>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<>
|
|
31
|
-
<Upload onUploaded={filesHook.load} />
|
|
32
|
-
<FileTable
|
|
33
|
-
files={filesHook.files}
|
|
34
|
-
loading={filesHook.loading}
|
|
35
|
-
error={filesHook.error}
|
|
36
|
-
onDownload={filesHook.toggleShare}
|
|
37
|
-
onToggleShare={filesHook.toggleShare}
|
|
38
|
-
onPatchShare={filesHook.patchShareSettings}
|
|
39
|
-
onDelete={filesHook.deleteFile}
|
|
40
|
-
/>
|
|
41
|
-
</>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default SecureFiles;
|
package/src/App/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SecureFiles } from './SecureFiles'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {FileRow} from './src';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {default as FileRow} from './row_utils'
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import type { FileRowProps } from './../imports';
|
|
2
|
-
import { useState, Button, currentUsername } from './../imports';
|
|
3
|
-
|
|
4
|
-
export default function FileRow({
|
|
5
|
-
file,
|
|
6
|
-
onDownload,
|
|
7
|
-
onSettings,
|
|
8
|
-
onToggleShare,
|
|
9
|
-
onDelete,
|
|
10
|
-
}: FileRowProps) {
|
|
11
|
-
const isOwner =
|
|
12
|
-
file.uploader_id?.toLowerCase() === (currentUsername() ?? '').toLowerCase();
|
|
13
|
-
const downloadAllowed = isOwner || file.shareable;
|
|
14
|
-
const [isDownloading, setIsDownloading] = useState(false);
|
|
15
|
-
const [isTogglingShare, setIsTogglingShare] = useState(false);
|
|
16
|
-
const [isDeleting, setIsDeleting] = useState(false);
|
|
17
|
-
|
|
18
|
-
// Mimic WindowManagerApp's unsaved heuristic
|
|
19
|
-
const looksUnsaved =
|
|
20
|
-
file.filename.toLowerCase().startsWith('untitled') ||
|
|
21
|
-
file.filename.includes('*');
|
|
22
|
-
|
|
23
|
-
const handleDownload = async () => {
|
|
24
|
-
setIsDownloading(true);
|
|
25
|
-
try {
|
|
26
|
-
await onDownload();
|
|
27
|
-
} finally {
|
|
28
|
-
setIsDownloading(false);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const handleToggleShare = async () => {
|
|
33
|
-
setIsTogglingShare(true);
|
|
34
|
-
try {
|
|
35
|
-
await onToggleShare();
|
|
36
|
-
} finally {
|
|
37
|
-
setIsTogglingShare(false);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const handleDeleteFile = async () => {
|
|
42
|
-
setIsDeleting(true);
|
|
43
|
-
try {
|
|
44
|
-
await onDelete();
|
|
45
|
-
} finally {
|
|
46
|
-
setIsDeleting(false);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<tr className="wm-row transition-colors duration-75">
|
|
52
|
-
{/* Select checkbox */}
|
|
53
|
-
<td className="wm-cell w-12 align-middle">
|
|
54
|
-
<input
|
|
55
|
-
type="checkbox"
|
|
56
|
-
className="wm-checkbox"
|
|
57
|
-
aria-label={`Select ${file.filename}`}
|
|
58
|
-
/>
|
|
59
|
-
</td>
|
|
60
|
-
|
|
61
|
-
{/* Filename */}
|
|
62
|
-
<td className={`wm-cell ${looksUnsaved ? 'unsaved' : ''}`}>
|
|
63
|
-
{file.filename}
|
|
64
|
-
</td>
|
|
65
|
-
|
|
66
|
-
{/* Download button or lock */}
|
|
67
|
-
<td className="wm-cell w-12 align-middle">
|
|
68
|
-
{downloadAllowed ? (
|
|
69
|
-
<Button
|
|
70
|
-
color="blue"
|
|
71
|
-
variant="secondary"
|
|
72
|
-
onClick={handleDownload}
|
|
73
|
-
disabled={isDownloading}
|
|
74
|
-
aria-label={`Download ${file.filename}`}
|
|
75
|
-
className="wm-btn-link"
|
|
76
|
-
>
|
|
77
|
-
{isDownloading ? 'Downloading...' : 'Download'}
|
|
78
|
-
</Button>
|
|
79
|
-
) : (
|
|
80
|
-
<span
|
|
81
|
-
className="text-gray-500 text-lg"
|
|
82
|
-
aria-label="Download restricted"
|
|
83
|
-
>
|
|
84
|
-
🔒
|
|
85
|
-
</span>
|
|
86
|
-
)}
|
|
87
|
-
</td>
|
|
88
|
-
|
|
89
|
-
{/* Settings cog */}
|
|
90
|
-
<td className="wm-cell w-12 align-middle">
|
|
91
|
-
{isOwner && (
|
|
92
|
-
<Button
|
|
93
|
-
color="gray"
|
|
94
|
-
variant="icon"
|
|
95
|
-
onClick={() => {
|
|
96
|
-
console.log('⚙︎ clicked', file.id);
|
|
97
|
-
onSettings();
|
|
98
|
-
}}
|
|
99
|
-
aria-label="Open share settings"
|
|
100
|
-
className="wm-btn-icon text-lg"
|
|
101
|
-
>
|
|
102
|
-
⚙️
|
|
103
|
-
</Button>
|
|
104
|
-
)}
|
|
105
|
-
</td>
|
|
106
|
-
|
|
107
|
-
{/* Share toggle */}
|
|
108
|
-
<td className="wm-cell w-12 align-middle">
|
|
109
|
-
{isOwner && (
|
|
110
|
-
<Button
|
|
111
|
-
color={file.shareable ? 'blue' : 'gray'}
|
|
112
|
-
variant={file.shareable ? 'primary' : 'secondary'}
|
|
113
|
-
onClick={handleToggleShare}
|
|
114
|
-
disabled={isTogglingShare}
|
|
115
|
-
className="btn"
|
|
116
|
-
>
|
|
117
|
-
{isTogglingShare
|
|
118
|
-
? 'Toggling...'
|
|
119
|
-
: file.shareable
|
|
120
|
-
? 'Sharing'
|
|
121
|
-
: 'Share'}
|
|
122
|
-
</Button>
|
|
123
|
-
)}
|
|
124
|
-
</td>
|
|
125
|
-
|
|
126
|
-
{/* Delete button */}
|
|
127
|
-
<td className="wm-cell w-12 align-middle">
|
|
128
|
-
{isOwner && (
|
|
129
|
-
<Button
|
|
130
|
-
color="gray"
|
|
131
|
-
variant="icon"
|
|
132
|
-
onClick={handleDeleteFile}
|
|
133
|
-
disabled={isDeleting}
|
|
134
|
-
className="wm-btn-icon text-lg"
|
|
135
|
-
>
|
|
136
|
-
🗑
|
|
137
|
-
</Button>
|
|
138
|
-
)}
|
|
139
|
-
</td>
|
|
140
|
-
<td className="wm-cell">{file.download_count} / {file.download_limit ?? "∞"}</td>
|
|
141
|
-
</tr>
|
|
142
|
-
);
|
|
143
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export {FileRow} from './../FileRow';
|
|
2
|
-
export {ShareModal} from './../ShareModal';
|
|
3
|
-
export type {
|
|
4
|
-
FileItem ,
|
|
5
|
-
FileTableProps
|
|
6
|
-
} from './../imports';
|
|
7
|
-
export {
|
|
8
|
-
useState ,
|
|
9
|
-
useFiles ,
|
|
10
|
-
downloadFile ,
|
|
11
|
-
Spinner ,
|
|
12
|
-
Input,
|
|
13
|
-
currentUsername,
|
|
14
|
-
Button
|
|
15
|
-
} from './../imports';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {FileTable} from './src'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {default as FileTable} from './table_utils'
|