@emailmaker/filemanager 0.10.4 → 0.10.6
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/EmIcons/EmIcons.d.ts +5 -0
- package/components/FileContent/FileContent.d.ts +2 -2
- package/components/FileModals/FileModals.d.ts +1 -1
- package/components/FolderSidebar/FolderSidebar.d.ts +1 -1
- package/file-manager.css +596 -556
- 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 +2 -40
- package/hooks/core/types.d.ts +3 -0
- package/hooks/useCustomIcons.d.ts +4 -0
- package/hooks/useFileActions.d.ts +3 -2
- package/package.json +1 -1
- package/types.d.ts +33 -5
|
@@ -30,16 +30,6 @@ and limitations under the License.
|
|
|
30
30
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
33
|
/**
|
|
44
34
|
* @license React
|
|
45
35
|
* react-is.production.min.js
|
|
@@ -50,16 +40,6 @@ and limitations under the License.
|
|
|
50
40
|
* LICENSE file in the root directory of this source tree.
|
|
51
41
|
*/
|
|
52
42
|
|
|
53
|
-
/**
|
|
54
|
-
* @license React
|
|
55
|
-
* react-jsx-runtime.production.js
|
|
56
|
-
*
|
|
57
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the MIT license found in the
|
|
60
|
-
* LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
43
|
/**
|
|
64
44
|
* @license React
|
|
65
45
|
* react-jsx-runtime.production.min.js
|
|
@@ -70,16 +50,6 @@ and limitations under the License.
|
|
|
70
50
|
* LICENSE file in the root directory of this source tree.
|
|
71
51
|
*/
|
|
72
52
|
|
|
73
|
-
/**
|
|
74
|
-
* @license React
|
|
75
|
-
* scheduler.production.js
|
|
76
|
-
*
|
|
77
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the MIT license found in the
|
|
80
|
-
* LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
53
|
/**
|
|
84
54
|
* @license React
|
|
85
55
|
* use-sync-external-store-shim.production.min.js
|
|
@@ -173,16 +143,14 @@ and limitations under the License.
|
|
|
173
143
|
|
|
174
144
|
/** */
|
|
175
145
|
|
|
176
|
-
/** */
|
|
177
|
-
|
|
178
146
|
/** */
|
|
179
147
|
|
|
180
|
-
/** */
|
|
181
|
-
|
|
182
148
|
/** */
|
|
183
149
|
|
|
184
150
|
/** */
|
|
185
151
|
|
|
152
|
+
/** */
|
|
153
|
+
|
|
186
154
|
/** */
|
|
187
155
|
|
|
188
156
|
/** */
|
|
@@ -201,12 +169,6 @@ and limitations under the License.
|
|
|
201
169
|
|
|
202
170
|
/** */
|
|
203
171
|
|
|
204
|
-
/** */
|
|
205
|
-
|
|
206
|
-
/** */
|
|
207
|
-
|
|
208
172
|
/** */
|
|
209
173
|
|
|
210
|
-
/** */
|
|
211
|
-
|
|
212
174
|
/** */
|
package/hooks/core/types.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export interface FileManagerState {
|
|
|
18
18
|
sortOrder: SortOrderType;
|
|
19
19
|
pathHistory: PathItem[];
|
|
20
20
|
selectedFiles: Set<string>;
|
|
21
|
+
currentMenuFile: string;
|
|
21
22
|
loading: boolean;
|
|
22
23
|
pagination: PaginationState;
|
|
23
24
|
isModalVisible: boolean;
|
|
@@ -36,6 +37,7 @@ export interface FileManagerState {
|
|
|
36
37
|
fileToRename: string | null;
|
|
37
38
|
activeLibraryItem: string;
|
|
38
39
|
folderToRename: string | null;
|
|
40
|
+
multiSelect: boolean;
|
|
39
41
|
}
|
|
40
42
|
export interface FileManagerActions {
|
|
41
43
|
setFolders: (folders: Folder[]) => void;
|
|
@@ -47,6 +49,7 @@ export interface FileManagerActions {
|
|
|
47
49
|
setSortOrder: (sortOrder: SortOrderType) => void;
|
|
48
50
|
setPathHistory: (history: PathItem[]) => void;
|
|
49
51
|
setSelectedFiles: (files?: Set<string>) => void;
|
|
52
|
+
setCurrentMenuFile: (file: string) => void;
|
|
50
53
|
setLoading: (isLoading: boolean) => void;
|
|
51
54
|
setPagination: (pagination: Partial<PaginationState>) => void;
|
|
52
55
|
setIsModalVisible: (visible: boolean) => void;
|
|
@@ -13,7 +13,11 @@ export declare const useCustomIcons: () => {
|
|
|
13
13
|
ExpandFolderIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
14
14
|
CollapseFolderIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
15
15
|
FolderPreviewIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
16
|
+
EmptyFolderIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
16
17
|
GridViewIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
17
18
|
ListViewIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
19
|
+
DropZoneFileIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
20
|
+
BigStockIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
21
|
+
BigAIIcon: (props?: IconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
18
22
|
getCustomIcon: (iconName: keyof NonNullable<import("../types").CustomIcons | undefined>, defaultIcon: React.ComponentType<any>, props?: IconProps) => React.ReactElement;
|
|
19
23
|
};
|
|
@@ -2,6 +2,7 @@ import { File as AppFile, ThumbnailFile } from '../types';
|
|
|
2
2
|
interface UseFileActionsProps {
|
|
3
3
|
files: AppFile[];
|
|
4
4
|
selectedFiles: Set<string>;
|
|
5
|
+
currentMenuFile: string;
|
|
5
6
|
toggleFileSelection: (fileId: string) => void;
|
|
6
7
|
showRenameModal: (fileId: string) => void;
|
|
7
8
|
showMoveModal: () => void;
|
|
@@ -13,8 +14,8 @@ interface UseFileActionsProps {
|
|
|
13
14
|
}
|
|
14
15
|
export declare const useFileActions: ({ files, selectedFiles, toggleFileSelection, showRenameModal, showMoveModal, showCopyModal, handleDeleteFile, handleDeleteFolder, showDeleteConfirm, onEdit, }: UseFileActionsProps) => {
|
|
15
16
|
handleClearSelection: () => void;
|
|
16
|
-
handleRename: () => void;
|
|
17
|
-
handleDeleteSelected: () => void;
|
|
17
|
+
handleRename: (selectedFileId?: string) => void;
|
|
18
|
+
handleDeleteSelected: (file: AppFile | undefined) => void;
|
|
18
19
|
handleCopy: () => void;
|
|
19
20
|
handleMove: () => void;
|
|
20
21
|
handleEdit: () => void;
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -126,6 +126,23 @@ export interface FileManagerOptions {
|
|
|
126
126
|
dragDropIcon?: string;
|
|
127
127
|
notification?: Partial<Omit<NotificationInstance, 'destroy'>>;
|
|
128
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Результат операции
|
|
131
|
+
*/
|
|
132
|
+
export interface OperationResult<T = void> {
|
|
133
|
+
id?: string;
|
|
134
|
+
success?: boolean;
|
|
135
|
+
data?: T;
|
|
136
|
+
error?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Результат групповой операции
|
|
140
|
+
*/
|
|
141
|
+
export type BatchResult<T> = {
|
|
142
|
+
success: boolean;
|
|
143
|
+
error?: string;
|
|
144
|
+
detailed?: OperationResult<T>[];
|
|
145
|
+
};
|
|
129
146
|
export interface FileManagerDataProviders {
|
|
130
147
|
getFileData: (file: File) => Promise<Blob>;
|
|
131
148
|
getFolders?: (options?: {
|
|
@@ -140,7 +157,7 @@ export interface FileManagerDataProviders {
|
|
|
140
157
|
sortOrder?: SortState['sortOrder'];
|
|
141
158
|
page?: number;
|
|
142
159
|
limit?: number;
|
|
143
|
-
itemType
|
|
160
|
+
itemType: 'file' | 'folder' | 'all';
|
|
144
161
|
}) => Promise<{
|
|
145
162
|
files: File[];
|
|
146
163
|
pagination?: Partial<ApiPaginationResponse>;
|
|
@@ -168,20 +185,20 @@ export interface FileManagerDataProviders {
|
|
|
168
185
|
noFolder?: boolean;
|
|
169
186
|
}) => Promise<File>;
|
|
170
187
|
deleteFile: (fileId: string) => Promise<boolean>;
|
|
188
|
+
deleteItems?: (items: string[]) => Promise<BatchResult<{}>>;
|
|
171
189
|
renameFile?: (fileId: string, newName: string) => Promise<File>;
|
|
172
190
|
moveItem?: (options: {
|
|
173
191
|
itemId: string;
|
|
174
192
|
targetFolderId: string;
|
|
175
193
|
isFolder: boolean;
|
|
176
194
|
}) => Promise<boolean>;
|
|
195
|
+
moveItems?: (targetFolderId: string, files: string[]) => Promise<BatchResult<{}>>;
|
|
177
196
|
copyItem?: (options: {
|
|
178
197
|
itemId: string;
|
|
179
198
|
targetFolderId: string;
|
|
180
199
|
isFolder: boolean;
|
|
181
|
-
}) => Promise<
|
|
182
|
-
|
|
183
|
-
url?: string;
|
|
184
|
-
}>;
|
|
200
|
+
}) => Promise<boolean>;
|
|
201
|
+
copyItems?: (targetFolderId: string, files: string[]) => Promise<BatchResult<{}>>;
|
|
185
202
|
updateFile?: (fileId: string, updates: {
|
|
186
203
|
name?: string;
|
|
187
204
|
type?: string;
|
|
@@ -264,14 +281,24 @@ export interface Config {
|
|
|
264
281
|
locale?: string;
|
|
265
282
|
mode?: 'fileManager' | 'imageCenter' | 'plugin';
|
|
266
283
|
enabledTabs?: string[];
|
|
284
|
+
iconStrokeWidth?: number;
|
|
267
285
|
features?: {
|
|
268
286
|
enableRenameFolder?: boolean;
|
|
269
287
|
enableRenameFile?: boolean;
|
|
270
288
|
enableUpdateFile?: boolean;
|
|
289
|
+
/** Включить кнопку/пункт редактирования файла */
|
|
290
|
+
enableEdit?: boolean;
|
|
291
|
+
/** Включить перемещение */
|
|
292
|
+
enableMove?: boolean;
|
|
293
|
+
/** Включить копирование */
|
|
294
|
+
enableCopy?: boolean;
|
|
295
|
+
/** Включить удаление */
|
|
296
|
+
enableDelete?: boolean;
|
|
271
297
|
};
|
|
272
298
|
dataProcessingMode?: 'server' | 'client' | 'auto';
|
|
273
299
|
enableClientSideProcessing?: boolean;
|
|
274
300
|
disablePagination?: boolean;
|
|
301
|
+
enableTrashFolder?: boolean;
|
|
275
302
|
staticData?: {
|
|
276
303
|
files?: File[];
|
|
277
304
|
folders?: Folder[];
|
|
@@ -302,6 +329,7 @@ export interface Config {
|
|
|
302
329
|
expandAllFoldersOnInit?: boolean;
|
|
303
330
|
/** Запоминать последнюю открытую папку между сессиями */
|
|
304
331
|
rememberLastFolder?: boolean;
|
|
332
|
+
multiSelect?: boolean;
|
|
305
333
|
}
|
|
306
334
|
export type LibraryMenuKey = typeof MY_FILES | typeof GIF | typeof STOCK_IMAGES | typeof AI | typeof EDITOR;
|
|
307
335
|
export interface GifItem {
|