@mci-ui/mci-ui 0.0.79 → 0.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -18
- package/dist/index.es.js +1451 -1314
- package/dist/index.umd.js +2 -2
- package/dist/types/shared/lib/uploadLanguage.d.ts +1 -0
- package/dist/types/shared/ui/mciUpload/mci-upload.utils.d.ts +12 -1
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ export interface UploadLanguage {
|
|
|
15
15
|
maxFilesError: (maxFiles: number) => string;
|
|
16
16
|
fileSizeError: (fileName: string, maxSize: number) => string;
|
|
17
17
|
fileTypeError: (fileName: string) => string;
|
|
18
|
+
blockedFileTypeError: (fileName: string) => string;
|
|
18
19
|
uploadFailed: string;
|
|
19
20
|
file: string;
|
|
20
21
|
image: string;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
export declare const SECURE_ALLOWED_EXTENSIONS: readonly ["pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "jpg", "jpeg", "png", "bmp", "tiff"];
|
|
2
|
+
export declare const BLOCKED_EXTENSIONS: readonly ["zip", "rar", "7z", "tar", "gz", "bz2", "xz", "tgz", "tbz2", "txz", "iso", "cab", "arj", "lz", "lzh", "z", "exe", "bat", "cmd", "com", "msi", "scr", "pif", "js", "mjs", "cjs", "jse", "vbs", "vbe", "wsf", "wsh", "ps1", "psm1", "sh", "bash", "zsh", "ksh", "csh", "fish"];
|
|
3
|
+
type FileTypeValidationResult = {
|
|
4
|
+
isValid: true;
|
|
5
|
+
} | {
|
|
6
|
+
isValid: false;
|
|
7
|
+
reason: 'blocked' | 'not-allowed';
|
|
8
|
+
};
|
|
9
|
+
export declare function buildSecureAccept(accept: string): string;
|
|
10
|
+
export declare function getAllowedFormatsHint(accept: string): string;
|
|
1
11
|
export declare function getFileIcon(file: File): import("react/jsx-runtime").JSX.Element;
|
|
2
12
|
export declare function formatFileSize(bytes: number): string;
|
|
3
13
|
export declare function validateFileSize(file: File, maxSizeMb: number): boolean;
|
|
4
|
-
export declare function validateFileType(file: File, accept: string):
|
|
14
|
+
export declare function validateFileType(file: File, accept: string): FileTypeValidationResult;
|
|
5
15
|
export declare function createPreview(file: File): Promise<string>;
|
|
16
|
+
export {};
|