@emailmaker/filemanager 0.10.11 → 0.10.13
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/components/CustomSpinIndicator/CustomSpinIndicator.d.ts +2 -0
- package/components/EmIcons/EmIcons.d.ts +2 -0
- package/components/FileManagerApp/ActionsHeader.d.ts +1 -0
- package/components/FileModals/FileModals.d.ts +3 -3
- package/components/FolderTree/FolderTree.d.ts +25 -0
- package/components/PageLoader/PageLoader.d.ts +6 -0
- package/components/index.d.ts +1 -0
- package/constants/index.d.ts +5 -0
- package/file-manager.css +622 -416
- package/file-manager.esm.js +10 -10
- package/file-manager.esm.js.map +1 -1
- package/file-manager.js +1 -1
- package/file-manager.js.LICENSE.txt +0 -8
- package/hooks/core/files/useFilesAPI.d.ts +3 -2
- package/hooks/core/files/useFilesModals.d.ts +2 -2
- package/hooks/core/types.d.ts +1 -1
- package/hooks/core/useFiles.d.ts +4 -3
- package/hooks/core/useFolders.d.ts +2 -1
- package/hooks/useCustomIcons.d.ts +2 -0
- package/hooks/useNotifications.d.ts +1 -1
- package/package.json +1 -1
- package/types.d.ts +9 -5
- package/widgets/layout/errorBoundary/errorBoundary.d.ts +1 -1
|
@@ -135,8 +135,6 @@ and limitations under the License.
|
|
|
135
135
|
|
|
136
136
|
/** */
|
|
137
137
|
|
|
138
|
-
/** */
|
|
139
|
-
|
|
140
138
|
/** */
|
|
141
139
|
|
|
142
140
|
/** */
|
|
@@ -147,12 +145,8 @@ and limitations under the License.
|
|
|
147
145
|
|
|
148
146
|
/** */
|
|
149
147
|
|
|
150
|
-
/** */
|
|
151
|
-
|
|
152
148
|
/** */
|
|
153
149
|
|
|
154
|
-
/** */
|
|
155
|
-
|
|
156
150
|
/** */
|
|
157
151
|
|
|
158
152
|
/** */
|
|
@@ -167,8 +161,6 @@ and limitations under the License.
|
|
|
167
161
|
|
|
168
162
|
/** */
|
|
169
163
|
|
|
170
|
-
/** */
|
|
171
|
-
|
|
172
164
|
/** */
|
|
173
165
|
|
|
174
166
|
/** */
|
|
@@ -4,7 +4,8 @@ export interface UseFilesAPIActions {
|
|
|
4
4
|
handleDeleteFile: (fileId: string) => Promise<void>;
|
|
5
5
|
handleDeleteFolder: (folderId: string) => Promise<void>;
|
|
6
6
|
handleAddFile: (progressCallbacks?: {
|
|
7
|
-
onStart
|
|
7
|
+
onStart?: (file: globalThis.File) => void;
|
|
8
|
+
onStartBatch?: (files: globalThis.File[]) => void;
|
|
8
9
|
onProgress: (fileName: string, progress: number) => void;
|
|
9
10
|
onComplete: (fileName: string) => void;
|
|
10
11
|
onError: (fileName: string, error: string) => void;
|
|
@@ -12,6 +13,6 @@ export interface UseFilesAPIActions {
|
|
|
12
13
|
handleAddFileByUrl: (url?: string | null, noFolder?: boolean) => Promise<AppFile | void>;
|
|
13
14
|
handleDroppedFiles: (droppedFiles: globalThis.File[]) => Promise<void>;
|
|
14
15
|
getFileData: (file: AppFile) => Promise<Blob | undefined>;
|
|
15
|
-
uploadFileWithProvider: (file: globalThis.File) => Promise<void>;
|
|
16
|
+
uploadFileWithProvider: (file: globalThis.File, targetFolderId?: string) => Promise<void>;
|
|
16
17
|
}
|
|
17
18
|
export declare const useFilesAPI: () => UseFilesAPIActions;
|
|
@@ -9,10 +9,10 @@ export interface UseFilesModalsActions {
|
|
|
9
9
|
handleRenameOk: () => Promise<void>;
|
|
10
10
|
showMoveModal: () => void;
|
|
11
11
|
handleMoveCancel: () => void;
|
|
12
|
-
handleMoveOk: () => Promise<void>;
|
|
12
|
+
handleMoveOk: (targetFolder?: string) => Promise<void>;
|
|
13
13
|
showCopyModal: () => void;
|
|
14
14
|
handleCopyCancel: () => void;
|
|
15
|
-
handleCopyOk: () => Promise<void>;
|
|
15
|
+
handleCopyOk: (targetFolder?: string) => Promise<void>;
|
|
16
16
|
showDeleteConfirm: () => void;
|
|
17
17
|
handleDeleteConfirmCancel: () => void;
|
|
18
18
|
handleDeleteConfirmOk: () => Promise<void>;
|
package/hooks/core/types.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export interface FileManagerActions {
|
|
|
65
65
|
updatePathHistoryOnFolderRename: (folderId: string, newName: string) => void;
|
|
66
66
|
fetchFolders: () => Promise<void>;
|
|
67
67
|
handleCreateFolder: () => void;
|
|
68
|
-
handleModalOk: () => Promise<
|
|
68
|
+
handleModalOk: (currentForm?: FormInstance) => Promise<Folder | undefined>;
|
|
69
69
|
handleModalCancel: () => void;
|
|
70
70
|
generateMenuItems: () => MenuItem[];
|
|
71
71
|
fetchFiles: (params?: FilesQueryParams) => Promise<void>;
|
package/hooks/core/useFiles.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export interface UseFilesActions {
|
|
|
13
13
|
handleDeleteFile: (fileId: string) => Promise<void>;
|
|
14
14
|
handleDeleteFolder: (folderId: string) => Promise<void>;
|
|
15
15
|
handleAddFile: (progressCallbacks?: {
|
|
16
|
-
onStart
|
|
16
|
+
onStart?: (file: globalThis.File) => void;
|
|
17
|
+
onStartBatch?: (files: globalThis.File[]) => void;
|
|
17
18
|
onProgress: (fileName: string, progress: number) => void;
|
|
18
19
|
onComplete: (fileName: string) => void;
|
|
19
20
|
onError: (fileName: string, error: string) => void;
|
|
@@ -26,10 +27,10 @@ export interface UseFilesActions {
|
|
|
26
27
|
handleDroppedFiles: (droppedFiles: globalThis.File[]) => Promise<void>;
|
|
27
28
|
showMoveModal: () => void;
|
|
28
29
|
handleMoveCancel: () => void;
|
|
29
|
-
handleMoveOk: () => Promise<void>;
|
|
30
|
+
handleMoveOk: (targetFolder?: string) => Promise<void>;
|
|
30
31
|
showCopyModal: () => void;
|
|
31
32
|
handleCopyCancel: () => void;
|
|
32
|
-
handleCopyOk: () => Promise<void>;
|
|
33
|
+
handleCopyOk: (targetFolder?: string) => Promise<void>;
|
|
33
34
|
uploadFileWithProvider: (file: globalThis.File) => Promise<AppFile | void>;
|
|
34
35
|
showDeleteConfirm: () => void;
|
|
35
36
|
handleDeleteConfirmCancel: () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Folder, MenuItem } from '../../types';
|
|
2
2
|
import { FileManagerHookBase } from './types';
|
|
3
|
+
import type { FormInstance } from 'antd/es/form';
|
|
3
4
|
export interface UseFoldersState {
|
|
4
5
|
folders: Folder[];
|
|
5
6
|
isCreatingFolder: boolean;
|
|
@@ -9,7 +10,7 @@ export interface UseFoldersActions {
|
|
|
9
10
|
fetchFolders: () => Promise<void>;
|
|
10
11
|
fetchChildFolders: (parentId: string | null) => Promise<Folder[]>;
|
|
11
12
|
handleCreateFolder: () => void;
|
|
12
|
-
handleModalOk: () => Promise<
|
|
13
|
+
handleModalOk: (currentForm?: FormInstance) => Promise<Folder | undefined>;
|
|
13
14
|
handleModalCancel: () => void;
|
|
14
15
|
generateMenuItems: () => MenuItem[];
|
|
15
16
|
renameFolder: (folderId: string, newName: string) => Promise<void>;
|
|
@@ -19,5 +19,7 @@ export declare const useCustomIcons: () => {
|
|
|
19
19
|
DropZoneFileIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
20
20
|
BigStockIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
21
21
|
BigAIIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
22
|
+
GifPlayIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
23
|
+
StockBigIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
22
24
|
getCustomIcon: (iconName: keyof NonNullable<import("../types").CustomIcons | undefined>, defaultIcon: React.ComponentType<any>, props?: IconProps) => React.ReactElement;
|
|
23
25
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const useNotifications: () => {
|
|
2
|
+
open: (args: import("antd").NotificationArgsProps) => void;
|
|
2
3
|
success: (args: import("antd").NotificationArgsProps) => void;
|
|
3
4
|
error: (args: import("antd").NotificationArgsProps) => void;
|
|
4
5
|
info: (args: import("antd").NotificationArgsProps) => void;
|
|
5
6
|
warning: (args: import("antd").NotificationArgsProps) => void;
|
|
6
|
-
open: (args: import("antd").NotificationArgsProps) => void;
|
|
7
7
|
destroy(key?: React.Key): void;
|
|
8
8
|
};
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ export interface File {
|
|
|
18
18
|
id: string;
|
|
19
19
|
name: string;
|
|
20
20
|
size?: number;
|
|
21
|
-
date?: string;
|
|
22
21
|
folderId: string;
|
|
22
|
+
date?: string;
|
|
23
23
|
type?: string;
|
|
24
24
|
url?: string;
|
|
25
25
|
thumbnail?: string;
|
|
@@ -185,20 +185,22 @@ export interface FileManagerDataProviders {
|
|
|
185
185
|
noFolder?: boolean;
|
|
186
186
|
}) => Promise<File>;
|
|
187
187
|
deleteFile: (fileId: string) => Promise<boolean>;
|
|
188
|
-
deleteItems?: (items: string[]
|
|
188
|
+
deleteItems?: (items: string[], options?: {
|
|
189
|
+
permanent?: boolean;
|
|
190
|
+
}) => Promise<BatchResult<{}>>;
|
|
189
191
|
renameFile?: (fileId: string, newName: string) => Promise<File>;
|
|
190
192
|
moveItem?: (options: {
|
|
191
193
|
itemId: string;
|
|
192
194
|
targetFolderId: string;
|
|
193
195
|
isFolder: boolean;
|
|
194
196
|
}) => Promise<boolean>;
|
|
195
|
-
moveItems?: (targetFolderId: string, files: string[]) => Promise<BatchResult<
|
|
197
|
+
moveItems?: (targetFolderId: string, files: string[]) => Promise<BatchResult<unknown>>;
|
|
196
198
|
copyItem?: (options: {
|
|
197
199
|
itemId: string;
|
|
198
200
|
targetFolderId: string;
|
|
199
201
|
isFolder: boolean;
|
|
200
202
|
}) => Promise<boolean>;
|
|
201
|
-
copyItems?: (targetFolderId: string, files: string[]) => Promise<BatchResult<
|
|
203
|
+
copyItems?: (targetFolderId: string, files: string[]) => Promise<BatchResult<unknown>>;
|
|
202
204
|
updateFile?: (fileId: string, updates: {
|
|
203
205
|
name?: string;
|
|
204
206
|
type?: string;
|
|
@@ -233,7 +235,7 @@ export interface FileManagerHookReturn {
|
|
|
233
235
|
fetchFolders: () => Promise<void>;
|
|
234
236
|
fetchFiles: (folderId?: string) => Promise<void>;
|
|
235
237
|
handleCreateFolder: () => void;
|
|
236
|
-
handleModalOk: () => Promise<
|
|
238
|
+
handleModalOk: (currentForm?: FormInstance) => Promise<Folder | undefined>;
|
|
237
239
|
handleModalCancel: () => void;
|
|
238
240
|
handleDeleteFile: (fileId: string) => Promise<void>;
|
|
239
241
|
handleAddFile: () => void;
|
|
@@ -286,6 +288,8 @@ export interface Config {
|
|
|
286
288
|
enableRenameFolder?: boolean;
|
|
287
289
|
enableRenameFile?: boolean;
|
|
288
290
|
enableUpdateFile?: boolean;
|
|
291
|
+
/** Разрешить выбор директорий в диалоге загрузки (webkitdirectory) */
|
|
292
|
+
enableDirectoryUpload?: boolean;
|
|
289
293
|
/** Включить кнопку/пункт редактирования файла */
|
|
290
294
|
enableEdit?: boolean;
|
|
291
295
|
/** Включить перемещение */
|
|
@@ -14,6 +14,6 @@ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBo
|
|
|
14
14
|
error: Error;
|
|
15
15
|
};
|
|
16
16
|
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
17
|
-
render(): string | number | boolean |
|
|
17
|
+
render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
18
18
|
}
|
|
19
19
|
export {};
|