@emailmaker/filemanager 0.10.0 → 0.10.2

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.
@@ -11,7 +11,7 @@ export interface UseFilesAPIActions {
11
11
  }) => Promise<void>;
12
12
  handleAddFileByUrl: (url?: string | null, noFolder?: boolean) => Promise<AppFile | void>;
13
13
  handleDroppedFiles: (droppedFiles: globalThis.File[]) => Promise<void>;
14
- getFileData: (fileId: string) => Promise<Blob | undefined>;
14
+ getFileData: (file: AppFile) => Promise<Blob | undefined>;
15
15
  uploadFileWithProvider: (file: globalThis.File) => Promise<void>;
16
16
  }
17
17
  export declare const useFilesAPI: () => UseFilesAPIActions;
@@ -1,2 +1,5 @@
1
1
  import { File as AppFile, Folder, FilesQueryParams } from '../../../types';
2
- export declare const addSubfoldersToFiles: (files: AppFile[], params: FilesQueryParams, getFolders: (() => Promise<Folder[]>) | undefined) => Promise<AppFile[]>;
2
+ export declare const addSubfoldersToFiles: (files: AppFile[], params: FilesQueryParams, getFolders: ((options?: {
3
+ parentId?: string | null;
4
+ deep?: boolean;
5
+ }) => Promise<Folder[]>) | undefined) => Promise<AppFile[]>;
@@ -7,6 +7,7 @@ export interface UseFoldersState {
7
7
  }
8
8
  export interface UseFoldersActions {
9
9
  fetchFolders: () => Promise<void>;
10
+ fetchChildFolders: (parentId: string | null) => Promise<Folder[]>;
10
11
  handleCreateFolder: () => void;
11
12
  handleModalOk: () => Promise<void>;
12
13
  handleModalCancel: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emailmaker/filemanager",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "main": "./file-manager.js",
5
5
  "module": "./file-manager.esm.js",
6
6
  "types": "./index.d.ts",
package/types.d.ts CHANGED
@@ -124,8 +124,11 @@ export interface FileManagerOptions {
124
124
  notification?: Partial<Omit<NotificationInstance, 'destroy'>>;
125
125
  }
126
126
  export interface FileManagerDataProviders {
127
- getFile: (fileId: string) => Promise<Blob>;
128
- getFolders: () => Promise<Folder[]>;
127
+ getFileData: (file: File) => Promise<Blob>;
128
+ getFolders: (options?: {
129
+ parentId?: string | null;
130
+ deep?: boolean;
131
+ }) => Promise<Folder[]>;
129
132
  getFiles: (options: {
130
133
  folderId?: string;
131
134
  search?: string;
@@ -256,6 +259,11 @@ export interface Config {
256
259
  locale?: string;
257
260
  mode?: 'fileManager' | 'imageCenter' | 'plugin';
258
261
  enabledTabs?: string[];
262
+ features?: {
263
+ enableRenameFolder?: boolean;
264
+ enableRenameFile?: boolean;
265
+ enableUpdateFile?: boolean;
266
+ };
259
267
  dataProcessingMode?: 'server' | 'client' | 'auto';
260
268
  enableClientSideProcessing?: boolean;
261
269
  staticData?: {
@@ -284,6 +292,10 @@ export interface Config {
284
292
  handleLimitUsageEmitter?: {
285
293
  fire: (args: object) => void;
286
294
  };
295
+ folderTreeLoading?: 'lazy' | 'eager';
296
+ expandAllFoldersOnInit?: boolean;
297
+ /** Запоминать последнюю открытую папку между сессиями */
298
+ rememberLastFolder?: boolean;
287
299
  }
288
300
  export type LibraryMenuKey = typeof MY_FILES | typeof GIF | typeof STOCK_IMAGES | typeof AI | typeof EDITOR;
289
301
  export interface GifItem {
@@ -10,8 +10,11 @@ export declare class JSONDataProvider implements FileManagerDataProviders {
10
10
  loadFromURL: (url: string) => Promise<void>;
11
11
  addFiles: (newFiles: File[]) => void;
12
12
  addFolders: (newFolders: Folder[]) => void;
13
- getFile: (fileId: string) => Promise<Blob>;
14
- getFolders: () => Promise<Folder[]>;
13
+ getFileData: (file: File) => Promise<Blob>;
14
+ getFolders: (options?: {
15
+ parentId?: string | null;
16
+ deep?: boolean;
17
+ }) => Promise<Folder[]>;
15
18
  getFiles: (options?: {
16
19
  folderId?: string;
17
20
  search?: string;