@putkoff/abstract-securefiles 0.0.47 → 0.0.49
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 +46 -0
- package/dist/index.cjs +539 -956
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -8
- package/dist/index.js +531 -902
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +54 -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 +344 -0
- package/src/ServerFiles.tsx +324 -0
- package/src/ShareDialog.tsx +148 -0
- package/src/UploadPanel.tsx +217 -0
- package/src/api.ts +119 -0
- package/src/index.ts +4 -8
- package/src/styles.css +432 -0
- package/src/types.ts +54 -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 -267
- 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
package/dist/UI/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type String = string | undefined | null;
|
|
3
|
-
export type Astring = any[] | string | undefined | null;
|
|
4
|
-
export type Trailing = React.ReactNode;
|
|
5
|
-
export type ImportElem = {
|
|
6
|
-
reaxlEle?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
7
|
-
label?: String;
|
|
8
|
-
checked?: boolean;
|
|
9
|
-
type?: string;
|
|
10
|
-
onChange?: any;
|
|
11
|
-
value?: any;
|
|
12
|
-
trailing?: Trailing;
|
|
13
|
-
className?: String;
|
|
14
|
-
classNames?: Astring;
|
|
15
|
-
disabled?: any;
|
|
16
|
-
placeholder?: any;
|
|
17
|
-
error?: string;
|
|
18
|
-
min?: any;
|
|
19
|
-
readOnly?: boolean;
|
|
20
|
-
};
|
|
21
|
-
export declare function Button({ children, color, variant, className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
22
|
-
color?: 'gray' | 'green' | 'blue';
|
|
23
|
-
variant?: 'default' | 'icon' | 'primary' | 'secondary';
|
|
24
|
-
className?: string;
|
|
25
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare function Checkbox({ label, className, classNames, ...rest }: ImportElem): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare function Input({ label, trailing, className, classNames, ...rest }: ImportElem): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare function Spinner(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src';
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cookie-authenticated API helpers.
|
|
3
|
-
* All requests include credentials: 'include' so the browser sends the
|
|
4
|
-
* session cookie (auth_session) automatically. No JWT tokens are used.
|
|
5
|
-
*
|
|
6
|
-
* API base URL resolution order (first truthy value wins):
|
|
7
|
-
* 1. window.__SECURE_FILES_API_BASE__ – runtime override (any bundler)
|
|
8
|
-
* 2. VITE_SECURE_FILES_API_BASE – Vite env var
|
|
9
|
-
* 3. REACT_APP_SECURE_FILES_API_BASE – Create React App env var
|
|
10
|
-
* 4. /api/secure-files – same-origin default
|
|
11
|
-
*
|
|
12
|
-
* Subdomain API example (set one of the above to the full origin + path):
|
|
13
|
-
* VITE_SECURE_FILES_API_BASE=https://api.example.com/secure-files
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Generic JSON fetch with session-cookie auth.
|
|
17
|
-
* Throws Error("UNAUTHENTICATED") on 401 so callers can redirect to login.
|
|
18
|
-
*/
|
|
19
|
-
export declare function cookieFetch<T = unknown>(path: string, body?: unknown, method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"): Promise<T>;
|
|
20
|
-
/**
|
|
21
|
-
* Check whether the current session is valid.
|
|
22
|
-
* Calls /userInfo which requires authentication; returns true if the user
|
|
23
|
-
* is logged in, false otherwise (no exception thrown).
|
|
24
|
-
*/
|
|
25
|
-
export declare function checkAuth(): Promise<boolean>;
|
|
26
|
-
/**
|
|
27
|
-
* Upload a single file using multipart/form-data with session-cookie auth.
|
|
28
|
-
* @param file The File object to upload.
|
|
29
|
-
* @param relPath Optional relative path within the user's directory.
|
|
30
|
-
*/
|
|
31
|
-
export declare function cookieUpload(file: File, relPath?: string): Promise<unknown>;
|
|
32
|
-
/** The resolved API base URL, exported for debugging / display purposes. */
|
|
33
|
-
export declare const SECURE_FILES_API_BASE: string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { requireToken, alertit } from "./../imports";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src';
|
|
@@ -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'
|