@emailmaker/filemanager 0.10.43 → 0.10.45

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.
@@ -16,9 +16,14 @@ export interface UseFilesAPIActions {
16
16
  fileName: string;
17
17
  error: string;
18
18
  }[];
19
+ uploadedFiles?: Map<string, {
20
+ id?: string;
21
+ name?: string;
22
+ folderId?: string | null;
23
+ }>;
19
24
  }) => void;
20
25
  }) => Promise<void>;
21
- handleAddFileByUrl: (url?: string | null, noFolder?: boolean) => Promise<AppFile | void>;
26
+ handleAddFileByUrl: (url?: string | null, noFolder?: boolean, suppressNotifications?: boolean) => Promise<AppFile | void>;
22
27
  handleDroppedFiles: (droppedFiles: globalThis.File[]) => Promise<void>;
23
28
  getFileData: (fileId: string, silent?: boolean) => Promise<Blob | undefined>;
24
29
  uploadFileWithProvider: (file: globalThis.File, targetFolderId?: string, suppressNotifications?: boolean) => Promise<AppFile | undefined>;
@@ -25,9 +25,14 @@ export interface UseFilesActions {
25
25
  fileName: string;
26
26
  error: string;
27
27
  }[];
28
+ uploadedFiles?: Map<string, {
29
+ id?: string;
30
+ name?: string;
31
+ folderId?: string | null;
32
+ }>;
28
33
  }) => void;
29
34
  }) => Promise<void>;
30
- handleAddFileByUrl: (url?: string | null, noFolder?: boolean) => Promise<AppFile | void>;
35
+ handleAddFileByUrl: (url?: string | null, noFolder?: boolean, suppressNotifications?: boolean) => Promise<AppFile | void>;
31
36
  toggleFileSelection: (fileId: string, opts?: {
32
37
  metaKey?: boolean;
33
38
  ctrlKey?: boolean;
@@ -43,7 +48,7 @@ export interface UseFilesActions {
43
48
  showCopyModal: () => void;
44
49
  handleCopyCancel: () => void;
45
50
  handleCopyOk: (targetFolder?: string) => Promise<void>;
46
- uploadFileWithProvider: (file: globalThis.File) => Promise<AppFile | void>;
51
+ uploadFileWithProvider: (file: globalThis.File, targetFolderId?: string, suppressNotifications?: boolean) => Promise<AppFile | void>;
47
52
  showDeleteConfirm: () => void;
48
53
  handleDeleteConfirmCancel: () => void;
49
54
  handleDeleteConfirmOk: () => Promise<void>;
@@ -6,10 +6,12 @@ export interface UseFileUploadReturn {
6
6
  isUploadMinimized: boolean;
7
7
  totalFiles: number;
8
8
  completedFiles: number;
9
- startUpload: (files: globalThis.File[]) => string[];
9
+ startUpload: (folderId: string | undefined, files: globalThis.File[]) => string[];
10
+ startUploadByUrl: (folderId: string | undefined, fileName: string) => string;
10
11
  updateProgress: (fileId: string, progress: number) => void;
11
12
  markAsSuccess: (fileId: string, uploadedFile?: File) => void;
12
13
  markAsError: (fileId: string, error: string) => void;
14
+ getUploadedFile: (fileId: string) => File | undefined;
13
15
  closeUpload: () => void;
14
16
  minimizeUpload: () => void;
15
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emailmaker/filemanager",
3
- "version": "0.10.43",
3
+ "version": "0.10.45",
4
4
  "main": "./file-manager.js",
5
5
  "module": "./file-manager.esm.js",
6
6
  "types": "./index.d.ts",
package/types.d.ts CHANGED
@@ -131,7 +131,11 @@ export interface FileManagerOptions {
131
131
  sortBySize?: string;
132
132
  onPathChange?: (path: string[]) => void;
133
133
  onChangeSelection?: (files: File[]) => void;
134
- onEditorOk?: (file: File) => void;
134
+ onEditorOk?: (file: {
135
+ id: string;
136
+ folderId: string | undefined;
137
+ name: string;
138
+ }) => void;
135
139
  config?: Config;
136
140
  customIcons?: CustomIcons;
137
141
  dragDropIcon?: string;
@@ -362,6 +366,7 @@ export interface Config {
362
366
  customTheme?: CustomTheme;
363
367
  UNSPLASH_KEY?: string;
364
368
  APP_NAME_UNSPLASH?: string;
369
+ UNSLASH_PROXY_URL?: string;
365
370
  pushToGTM?: boolean;
366
371
  projectId?: string;
367
372
  elementId?: string;
@@ -415,7 +420,7 @@ export interface ImageGifProps {
415
420
  currentReqGif: CurrentReqGif;
416
421
  setCurrentReqGif: React.Dispatch<React.SetStateAction<CurrentReqGif>>;
417
422
  inputRef: React.RefObject<InputRef>;
418
- customRequest: (data: string) => Promise<File | void> | void;
423
+ customRequest: (data: string, fileName?: string) => Promise<File | void> | void;
419
424
  }
420
425
  export interface UnsplashImage {
421
426
  id: string;
@@ -444,7 +449,7 @@ export interface ImageStockProps {
444
449
  currentReq: CurrentReqStock;
445
450
  setCurrentReq: React.Dispatch<React.SetStateAction<CurrentReqStock>>;
446
451
  inputRef: React.RefObject<InputRef>;
447
- customRequest: (data: string) => Promise<File | void> | void;
452
+ customRequest: (data: string, fileName?: string) => Promise<File | void> | void;
448
453
  }
449
454
  export interface ImageAIProps {
450
455
  customRequest: (file: {
@@ -514,7 +519,11 @@ export interface FileManagerProps {
514
519
  currentPath?: string;
515
520
  onPathChange?: (path: string[]) => void;
516
521
  onChangeSelection?: (files: File[]) => void;
517
- onEditorOk?: (files: File) => void;
522
+ onEditorOk?: (file: {
523
+ id: string;
524
+ folderId: string | undefined;
525
+ name: string;
526
+ }) => void;
518
527
  searchQuery?: string;
519
528
  sortBySize?: string;
520
529
  dataProviders?: FileManagerDataProviders;