@emailmaker/filemanager 0.10.62 → 0.10.63
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/PixieEditor/PixieEditor.d.ts +1 -0
- package/file-manager.css +3 -3
- package/file-manager.d.ts +1 -0
- package/file-manager.esm.js +8 -8
- package/file-manager.esm.js.map +1 -1
- package/file-manager.js +1 -1
- package/hooks/core/files/useFilesAPI.d.ts +4 -2
- package/hooks/core/useFiles.d.ts +1 -1
- package/hooks/usePixieEditor.d.ts +1 -0
- package/notification.d.ts +7 -0
- package/package.json +1 -1
- package/types.d.ts +12 -0
- package/utils/jsonDataProvider.d.ts +3 -0
- package/utils/urlNormalization.d.ts +5 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { File as AppFile, FilesQueryParams } from '../../../types';
|
|
1
|
+
import { File as AppFile, FilesQueryParams, ThumbnailFile } from '../../../types';
|
|
2
2
|
export interface UseFilesAPIActions {
|
|
3
3
|
fetchFiles: (params?: FilesQueryParams) => Promise<void>;
|
|
4
4
|
handleDeleteFile: (fileId: string) => Promise<void>;
|
|
@@ -29,6 +29,8 @@ export interface UseFilesAPIActions {
|
|
|
29
29
|
handleAddFileByUrl: (url?: string | null, noFolder?: boolean, suppressNotifications?: boolean, eventSource?: 'upload' | 'uploadByUrl' | 'pixie' | 'iconStock' | 'imageStock' | 'gif') => Promise<AppFile | void>;
|
|
30
30
|
handleDroppedFiles: (droppedFiles: globalThis.File[]) => Promise<void>;
|
|
31
31
|
getFileData: (fileId: string, silent?: boolean) => Promise<Blob | undefined>;
|
|
32
|
-
|
|
32
|
+
findFileByUrl: (url: string, silent?: boolean) => Promise<AppFile | null>;
|
|
33
|
+
resolveFileForEditByUrl: (url: string, silent?: boolean) => Promise<AppFile | ThumbnailFile>;
|
|
34
|
+
uploadFileWithProvider: (file: globalThis.File, targetFolderId?: string, suppressNotifications?: boolean, noFolder?: boolean) => Promise<AppFile | undefined>;
|
|
33
35
|
}
|
|
34
36
|
export declare const useFilesAPI: () => UseFilesAPIActions;
|
package/hooks/core/useFiles.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface UseFilesActions {
|
|
|
51
51
|
showCopyModal: () => void;
|
|
52
52
|
handleCopyCancel: () => void;
|
|
53
53
|
handleCopyOk: (targetFolder?: string) => Promise<void>;
|
|
54
|
-
uploadFileWithProvider: (file: globalThis.File, targetFolderId?: string, suppressNotifications?: boolean) => Promise<AppFile | void>;
|
|
54
|
+
uploadFileWithProvider: (file: globalThis.File, targetFolderId?: string, suppressNotifications?: boolean, noFolder?: boolean) => Promise<AppFile | void>;
|
|
55
55
|
showDeleteConfirm: () => void;
|
|
56
56
|
handleDeleteConfirmCancel: () => void;
|
|
57
57
|
handleDeleteConfirmOk: () => Promise<void>;
|
|
@@ -10,6 +10,7 @@ export declare const usePixieEditor: ({ files, selectedFiles, fetchFiles, select
|
|
|
10
10
|
editingFile: ThumbnailFile | AppFile | null;
|
|
11
11
|
handleEdit: (fileForEdit?: ThumbnailFile | AppFile) => void;
|
|
12
12
|
handlePixieEditorSave: (updatedFile: AppFile) => Promise<AppFile | undefined>;
|
|
13
|
+
handlePixieEditorSaveCopy: (updatedFile: AppFile) => Promise<AppFile | undefined>;
|
|
13
14
|
handlePixieEditorClose: () => void;
|
|
14
15
|
};
|
|
15
16
|
export {};
|
package/notification.d.ts
CHANGED
|
@@ -59,6 +59,9 @@ type FileManagerErrorCode =
|
|
|
59
59
|
| 'UploadUrlNotReachable'
|
|
60
60
|
| 'UploadUrlContentTypeNotAllowed'
|
|
61
61
|
| 'UploadUrlDownloadFailed'
|
|
62
|
+
| 'FileLookupFailed'
|
|
63
|
+
| 'FileProxyFailed'
|
|
64
|
+
| 'FileProxyNotConfigured'
|
|
62
65
|
|
|
63
66
|
// --- File download ---
|
|
64
67
|
| 'FileDownloadNetworkError'
|
|
@@ -486,7 +489,10 @@ declare namespace Notify {
|
|
|
486
489
|
FILE_DOWNLOAD_FAILED: ImageFilePayload;
|
|
487
490
|
IMAGE_DOWNLOAD_FAILED: ImageFilePayload;
|
|
488
491
|
IMAGE_SAVE_FAILED: ImageFilePayload;
|
|
492
|
+
IMAGE_SAVE_COPY_FAILED: ImageFilePayload;
|
|
489
493
|
EDITOR_INIT_FAILED: never;
|
|
494
|
+
EDITOR_FIND_FILE_BY_URL_FAILED: UrlUploadErrorPayload;
|
|
495
|
+
EDITOR_PROXY_FILE_FAILED: UrlUploadErrorPayload;
|
|
490
496
|
|
|
491
497
|
AI_RESPONSE_INVALID: unknown;
|
|
492
498
|
AI_IMAGE_GENERATION_FAILED: AIImageGenerationFailedPayload;
|
|
@@ -551,6 +557,7 @@ declare namespace Notify {
|
|
|
551
557
|
|
|
552
558
|
// EDITOR_IMAGE_DOWNLOAD_SUCCESS: ImageFilePayload;
|
|
553
559
|
IMAGE_UPDATE_SUCCESS: ImageFilePayload;
|
|
560
|
+
IMAGE_SAVE_COPY_SUCCESS: ImageFilePayload;
|
|
554
561
|
|
|
555
562
|
FILE_RENAME_SUCCESS: SingleItemPayload;
|
|
556
563
|
FOLDER_RENAME_SUCCESS: SingleItemPayload;
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ export interface ThumbnailFile {
|
|
|
14
14
|
thumbnail: string;
|
|
15
15
|
name?: string;
|
|
16
16
|
id?: string;
|
|
17
|
+
type?: string;
|
|
18
|
+
extension?: string;
|
|
19
|
+
size?: number;
|
|
20
|
+
sourceUrl?: string;
|
|
21
|
+
saveWithoutFolder?: boolean;
|
|
17
22
|
}
|
|
18
23
|
export interface File {
|
|
19
24
|
id: string;
|
|
@@ -32,6 +37,8 @@ export interface File {
|
|
|
32
37
|
isFolder?: boolean;
|
|
33
38
|
lastEdited?: string;
|
|
34
39
|
childCount?: number;
|
|
40
|
+
sourceUrl?: string;
|
|
41
|
+
saveWithoutFolder?: boolean;
|
|
35
42
|
}
|
|
36
43
|
export interface PathItem {
|
|
37
44
|
id: string;
|
|
@@ -184,6 +191,7 @@ export interface UploadFileItemInput {
|
|
|
184
191
|
*/
|
|
185
192
|
data: UploadBinary;
|
|
186
193
|
extension?: string;
|
|
194
|
+
noFolder?: boolean;
|
|
187
195
|
}
|
|
188
196
|
export interface UploadFileResultData {
|
|
189
197
|
id?: string;
|
|
@@ -200,6 +208,7 @@ export interface UploadFilesRequest {
|
|
|
200
208
|
}
|
|
201
209
|
export interface FileManagerDataProviders {
|
|
202
210
|
getFileData: (fileId: string) => Promise<Blob>;
|
|
211
|
+
findFileByUrl?: (url: string) => Promise<File | null>;
|
|
203
212
|
getFolders?: (options?: {
|
|
204
213
|
parentId?: string | null;
|
|
205
214
|
deep?: boolean;
|
|
@@ -229,6 +238,7 @@ export interface FileManagerDataProviders {
|
|
|
229
238
|
size: number;
|
|
230
239
|
type: string;
|
|
231
240
|
folderId?: string | null;
|
|
241
|
+
noFolder?: boolean;
|
|
232
242
|
/**
|
|
233
243
|
* Бинарные данные файла. При наличии real File передается сам File,
|
|
234
244
|
* в остальных случаях — Blob.
|
|
@@ -403,6 +413,8 @@ export interface Config {
|
|
|
403
413
|
}) => Promise<string>;
|
|
404
414
|
/** Единый хендлер: принимает оригинальный URL, возвращает проксированный (sync или async). Используется для Unsplash, Giphy, Streamline. */
|
|
405
415
|
handleProxyUrl?: (url: string) => string | Promise<string>;
|
|
416
|
+
/** Хендлер проксирования бинарного файла: принимает внешний URL и возвращает Blob. */
|
|
417
|
+
handleFileProxy?: (url: string) => Blob | Promise<Blob>;
|
|
406
418
|
pushToGTM?: boolean;
|
|
407
419
|
projectId?: string;
|
|
408
420
|
elementId?: string;
|
|
@@ -10,7 +10,9 @@ 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
|
+
private normalizeComparableUrl;
|
|
13
14
|
getFileData: (fileId: string) => Promise<Blob>;
|
|
15
|
+
findFileByUrl: (url: string) => Promise<File | null>;
|
|
14
16
|
getFolders: (options?: {
|
|
15
17
|
parentId?: string | null;
|
|
16
18
|
deep?: boolean;
|
|
@@ -36,6 +38,7 @@ export declare class JSONDataProvider implements FileManagerDataProviders {
|
|
|
36
38
|
size: number;
|
|
37
39
|
type: string;
|
|
38
40
|
folderId?: string | null;
|
|
41
|
+
noFolder?: boolean;
|
|
39
42
|
data: UploadBinary;
|
|
40
43
|
thumbnail?: string;
|
|
41
44
|
dimensions?: string;
|