@emailmaker/filemanager 0.10.15 → 0.10.17
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/FileManagerApp/FileManagerApp.d.ts +1 -1
- package/components/PixieEditor/backgroundColor.d.ts +2 -0
- package/constants/errors.d.ts +47 -0
- package/constants/index.d.ts +4 -0
- package/file-manager.css +42 -13
- package/file-manager.d.ts +11 -1
- package/file-manager.esm.js +9 -9
- package/file-manager.esm.js.map +1 -1
- package/file-manager.js +1 -1
- package/hooks/core/files/useFilesAPI.d.ts +1 -1
- package/hooks/useNotifications.d.ts +20 -6
- package/index.d.ts +2 -1
- package/notification.d.ts +368 -0
- package/package.json +1 -1
- package/shared/config.d.ts +2 -2
- package/shared/fileManagerApiError.d.ts +20 -0
- package/types.d.ts +60 -13
- package/utils/blobUtils.d.ts +1 -0
- package/utils/errorMessages.d.ts +12 -0
- package/utils/jsonDataProvider.d.ts +4 -6
- package/utils/themeUtils.d.ts +1 -1
|
@@ -2,4 +2,4 @@ import React from 'react';
|
|
|
2
2
|
import { FileManagerProps } from '../../types';
|
|
3
3
|
import '../../styles/index.scss';
|
|
4
4
|
import '../../styles/variables.scss';
|
|
5
|
-
export declare const FileManagerApp: React.MemoExoticComponent<({ config, onPathChange, onChangeSelection, onEditorOk, searchQuery, sortBySize, apiEndpoints, customIcons, dragDropIcon, dataProviders,
|
|
5
|
+
export declare const FileManagerApp: React.MemoExoticComponent<({ config, onPathChange, onChangeSelection, onEditorOk, searchQuery, sortBySize, apiEndpoints, customIcons, dragDropIcon, dataProviders, handleNotify, handleError, handleSuccess }: FileManagerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Коды ошибок для FileManager API.
|
|
3
|
+
* Используются для идентификации причины ошибки независимо от UI.
|
|
4
|
+
*/
|
|
5
|
+
export declare const FileManagerErrorCode: {
|
|
6
|
+
readonly FileNotFound: "FileNotFound";
|
|
7
|
+
readonly FileAlreadyExists: "FileAlreadyExists";
|
|
8
|
+
readonly FileInvalidName: "FileInvalidName";
|
|
9
|
+
readonly FileAccessDenied: "FileAccessDenied";
|
|
10
|
+
readonly FileReadError: "FileReadError";
|
|
11
|
+
readonly FileWriteError: "FileWriteError";
|
|
12
|
+
readonly FileUploadQuotaExceeded: "FileUploadQuotaExceeded";
|
|
13
|
+
readonly FileUploadNetworkError: "FileUploadNetworkError";
|
|
14
|
+
readonly FileDownloadNetworkError: "FileDownloadNetworkError";
|
|
15
|
+
readonly FileBackendError: "FileBackendError";
|
|
16
|
+
readonly FileTimeout: "FileTimeout";
|
|
17
|
+
readonly FolderNotFound: "FolderNotFound";
|
|
18
|
+
readonly FolderAlreadyExists: "FolderAlreadyExists";
|
|
19
|
+
readonly FolderInvalidName: "FolderInvalidName";
|
|
20
|
+
readonly FolderAccessDenied: "FolderAccessDenied";
|
|
21
|
+
readonly FolderReadError: "FolderReadError";
|
|
22
|
+
readonly FolderWriteError: "FolderWriteError";
|
|
23
|
+
readonly FolderQuotaExceeded: "FolderQuotaExceeded";
|
|
24
|
+
readonly FolderBackendError: "FolderBackendError";
|
|
25
|
+
readonly FolderTimeout: "FolderTimeout";
|
|
26
|
+
readonly RenameNotAllowed: "RenameNotAllowed";
|
|
27
|
+
readonly MoveNotAllowed: "MoveNotAllowed";
|
|
28
|
+
readonly CopyNotAllowed: "CopyNotAllowed";
|
|
29
|
+
readonly DeleteNotAllowed: "DeleteNotAllowed";
|
|
30
|
+
readonly MoveIntoSelf: "MoveIntoSelf";
|
|
31
|
+
readonly MoveIntoDescendant: "MoveIntoDescendant";
|
|
32
|
+
readonly BatchPartialFailure: "BatchPartialFailure";
|
|
33
|
+
readonly BatchAllFailed: "BatchAllFailed";
|
|
34
|
+
readonly BatchConflict: "BatchConflict";
|
|
35
|
+
readonly NetworkError: "NetworkError";
|
|
36
|
+
readonly BackendError: "BackendError";
|
|
37
|
+
readonly Timeout: "Timeout";
|
|
38
|
+
readonly AuthenticationFailed: "AuthenticationFailed";
|
|
39
|
+
readonly AuthorizationFailed: "AuthorizationFailed";
|
|
40
|
+
readonly AIResponseInvalid: "AIResponseInvalid";
|
|
41
|
+
readonly AIImageGenerationFailed: "AIImageGenerationFailed";
|
|
42
|
+
readonly AIImageGenerationLimitExceeded: "AIImageGenerationLimitExceeded";
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Тип всех кодов ошибок FileManager
|
|
46
|
+
*/
|
|
47
|
+
export type FileManagerErrorCode = typeof FileManagerErrorCode[keyof typeof FileManagerErrorCode];
|
package/constants/index.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ export declare const GIF: "gif";
|
|
|
3
3
|
export declare const STOCK_IMAGES: "stock_images";
|
|
4
4
|
export declare const AI: "ai";
|
|
5
5
|
export declare const EDITOR: "editor";
|
|
6
|
+
export declare const LIGHT = "light";
|
|
7
|
+
export declare const DARK = "dark";
|
|
8
|
+
export declare const SYSTEM = "system";
|
|
9
|
+
export declare const PREFERS_COLOR_SCHEME_DARK = "(prefers-color-scheme: dark)";
|
|
6
10
|
export declare const PLUGIN: {
|
|
7
11
|
isPlugin: boolean;
|
|
8
12
|
};
|
package/file-manager.css
CHANGED
|
@@ -134,6 +134,7 @@
|
|
|
134
134
|
position: relative;
|
|
135
135
|
text-overflow: ellipsis;
|
|
136
136
|
overflow: hidden;
|
|
137
|
+
display: block;
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
.em-filemanager .tableMenu {
|
|
@@ -435,34 +436,63 @@
|
|
|
435
436
|
justify-content: space-between;
|
|
436
437
|
align-items: center;
|
|
437
438
|
width: 100%;
|
|
439
|
+
min-width: 0; /* Позволяет flex-элементам сжиматься */
|
|
438
440
|
}
|
|
439
441
|
.em-filemanager .folderTree .folderItemContainer .folderLabel {
|
|
440
442
|
display: flex;
|
|
441
443
|
align-items: center;
|
|
442
444
|
gap: 8px;
|
|
445
|
+
padding: 0 8px;
|
|
446
|
+
flex: 1;
|
|
447
|
+
min-width: 0; /* Позволяет сжиматься */
|
|
448
|
+
overflow: hidden; /* Скрываем переполнение */
|
|
449
|
+
/* Иконки не должны сжиматься */
|
|
450
|
+
}
|
|
451
|
+
.em-filemanager .folderTree .folderItemContainer .folderLabel > svg,
|
|
452
|
+
.em-filemanager .folderTree .folderItemContainer .folderLabel > *:first-child {
|
|
453
|
+
flex-shrink: 0;
|
|
443
454
|
}
|
|
444
455
|
.em-filemanager .folderTree .folderItemContainer .folderLabel .folderLabelItem {
|
|
445
456
|
font-size: 14px;
|
|
446
|
-
|
|
447
|
-
|
|
457
|
+
white-space: nowrap; /* Запрещаем перенос строк */
|
|
458
|
+
overflow: hidden; /* Скрываем переполнение */
|
|
459
|
+
text-overflow: ellipsis; /* Показываем троеточие */
|
|
460
|
+
flex: 1; /* Занимает доступное место */
|
|
461
|
+
min-width: 0; /* Позволяет сжиматься */
|
|
448
462
|
}
|
|
449
463
|
.em-filemanager .folderTree .folderItemContainer .fileCount {
|
|
450
464
|
color: #666;
|
|
451
465
|
font-size: 12px;
|
|
452
466
|
min-width: 20px;
|
|
467
|
+
flex-shrink: 0; /* Запрещаем сжатие счетчика */
|
|
453
468
|
}
|
|
454
469
|
.em-filemanager .folderTree .foldersTitle {
|
|
455
470
|
cursor: pointer;
|
|
456
471
|
width: 100%;
|
|
472
|
+
min-width: 0; /* Позволяет сжиматься */
|
|
473
|
+
overflow: hidden; /* Скрываем переполнение */
|
|
457
474
|
}
|
|
458
475
|
.em-filemanager .folderTree .foldersTitle .foldersTitleItem {
|
|
459
476
|
display: flex;
|
|
460
477
|
align-items: center;
|
|
461
478
|
gap: 8px;
|
|
479
|
+
padding: 0 8px;
|
|
480
|
+
flex: 1;
|
|
481
|
+
min-width: 0; /* Позволяет сжиматься */
|
|
482
|
+
overflow: hidden; /* Скрываем переполнение */
|
|
483
|
+
/* Иконки не должны сжиматься */
|
|
484
|
+
}
|
|
485
|
+
.em-filemanager .folderTree .foldersTitle .foldersTitleItem > svg,
|
|
486
|
+
.em-filemanager .folderTree .foldersTitle .foldersTitleItem > *:first-child {
|
|
487
|
+
flex-shrink: 0;
|
|
462
488
|
}
|
|
463
489
|
.em-filemanager .folderTree .foldersTitle .foldersTitleItem .folderLabelItem {
|
|
464
490
|
font-size: 14px;
|
|
465
|
-
|
|
491
|
+
white-space: nowrap; /* Запрещаем перенос строк */
|
|
492
|
+
overflow: hidden; /* Скрываем переполнение */
|
|
493
|
+
text-overflow: ellipsis; /* Показываем троеточие */
|
|
494
|
+
flex: 1; /* Занимает доступное место */
|
|
495
|
+
min-width: 0; /* Позволяет сжиматься */
|
|
466
496
|
}
|
|
467
497
|
|
|
468
498
|
.em-filemanager .folderSelectionTree {
|
|
@@ -492,7 +522,6 @@
|
|
|
492
522
|
|
|
493
523
|
.em-filemanager .folderLabelItem {
|
|
494
524
|
font-size: 14px;
|
|
495
|
-
font-weight: 400;
|
|
496
525
|
white-space: nowrap; /* Запрещаем перенос строк */
|
|
497
526
|
overflow: hidden; /* Скрываем переполнение */
|
|
498
527
|
text-overflow: ellipsis; /* Показываем троеточие */
|
|
@@ -500,7 +529,6 @@
|
|
|
500
529
|
min-width: 0; /* Позволяет сжиматься */
|
|
501
530
|
-webkit-user-select: none;
|
|
502
531
|
user-select: none;
|
|
503
|
-
margin-left: 8px;
|
|
504
532
|
}
|
|
505
533
|
|
|
506
534
|
.em-filemanager .foldersTitleItem {
|
|
@@ -557,8 +585,8 @@
|
|
|
557
585
|
|
|
558
586
|
.em-filemanager .folderActions {
|
|
559
587
|
position: absolute;
|
|
560
|
-
top:
|
|
561
|
-
right:
|
|
588
|
+
top: 4px; /* Выравниваем по заголовку Folders */
|
|
589
|
+
right: 4px;
|
|
562
590
|
display: flex;
|
|
563
591
|
align-items: center;
|
|
564
592
|
gap: 4px;
|
|
@@ -674,7 +702,6 @@
|
|
|
674
702
|
|
|
675
703
|
.em-filemanager .folderLabelItem {
|
|
676
704
|
font-size: 14px;
|
|
677
|
-
font-weight: 400;
|
|
678
705
|
white-space: nowrap; /* Запрещаем перенос строк */
|
|
679
706
|
overflow: hidden; /* Скрываем переполнение */
|
|
680
707
|
text-overflow: ellipsis; /* Показываем троеточие */
|
|
@@ -682,7 +709,6 @@
|
|
|
682
709
|
min-width: 0; /* Позволяет сжиматься */
|
|
683
710
|
-webkit-user-select: none;
|
|
684
711
|
user-select: none;
|
|
685
|
-
margin-left: 8px;
|
|
686
712
|
}
|
|
687
713
|
|
|
688
714
|
.em-filemanager .foldersTitleItem {
|
|
@@ -1710,8 +1736,8 @@
|
|
|
1710
1736
|
display: flex;
|
|
1711
1737
|
align-items: center;
|
|
1712
1738
|
justify-content: space-between;
|
|
1713
|
-
padding:
|
|
1714
|
-
border-radius:
|
|
1739
|
+
padding: 0;
|
|
1740
|
+
border-radius: calc(var(--borderRadius) * 1px);
|
|
1715
1741
|
transition: background-color 0.2s ease;
|
|
1716
1742
|
width: 100%;
|
|
1717
1743
|
margin-bottom: 0;
|
|
@@ -1851,10 +1877,13 @@
|
|
|
1851
1877
|
.em-filemanager .ant-tree {
|
|
1852
1878
|
background: none;
|
|
1853
1879
|
}
|
|
1880
|
+
.em-filemanager .ant-tree .ant-tree-list-holder-inner {
|
|
1881
|
+
gap: 3px;
|
|
1882
|
+
}
|
|
1854
1883
|
.em-filemanager .ant-tree .ant-tree-treenode {
|
|
1855
1884
|
margin: 0;
|
|
1856
|
-
height:
|
|
1857
|
-
line-height:
|
|
1885
|
+
height: 40px;
|
|
1886
|
+
line-height: 40px;
|
|
1858
1887
|
display: flex;
|
|
1859
1888
|
padding: 0 12px;
|
|
1860
1889
|
overflow: hidden;
|
package/file-manager.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Config, CustomIcons, File, FileManagerDataProviders, ThumbnailFile } from './types';
|
|
2
|
+
import type { Config, CustomIcons, File, FileManagerDataProviders, NotifyListener, Notify, NotifyEvent, ThumbnailFile } from './types';
|
|
3
3
|
import 'antd/dist/reset.css';
|
|
4
4
|
import './styles/index.scss';
|
|
5
5
|
export declare const FileManagerAppWithContext: (props: FileManagerAppProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,6 +24,9 @@ export interface Options {
|
|
|
24
24
|
};
|
|
25
25
|
customIcons?: CustomIcons;
|
|
26
26
|
dragDropIcon?: string;
|
|
27
|
+
handleNotify?: NotifyListener<NotifyEvent>;
|
|
28
|
+
handleError?: NotifyListener<Notify.ErrorEvent>;
|
|
29
|
+
handleSuccess?: NotifyListener<Notify.SuccessEvent>;
|
|
27
30
|
}
|
|
28
31
|
export interface FileManagerAppProps {
|
|
29
32
|
config?: Config;
|
|
@@ -47,6 +50,9 @@ export interface FileManagerAppProps {
|
|
|
47
50
|
};
|
|
48
51
|
customIcons?: CustomIcons;
|
|
49
52
|
dragDropIcon?: string;
|
|
53
|
+
handleNotify?: NotifyListener<NotifyEvent>;
|
|
54
|
+
handleError?: NotifyListener<Notify.ErrorEvent>;
|
|
55
|
+
handleSuccess?: NotifyListener<Notify.SuccessEvent>;
|
|
50
56
|
}
|
|
51
57
|
export declare const init: (containerOrOptions: HTMLElement | Options, config?: Config) => void;
|
|
52
58
|
export declare const unmount: (container: HTMLElement) => void;
|
|
@@ -64,6 +70,10 @@ export interface InitPixieEditorOptions {
|
|
|
64
70
|
locale?: string;
|
|
65
71
|
baseUrl?: string;
|
|
66
72
|
assetsUrl?: string;
|
|
73
|
+
showNotifications?: boolean;
|
|
74
|
+
handleNotify?: NotifyListener<NotifyEvent>;
|
|
75
|
+
handleError?: NotifyListener<Notify.ErrorEvent>;
|
|
76
|
+
handleSuccess?: NotifyListener<Notify.SuccessEvent>;
|
|
67
77
|
}
|
|
68
78
|
export declare const PixieOnlyApp: React.FC<Omit<InitPixieEditorOptions, 'element'>>;
|
|
69
79
|
export declare const initPixieEditor: (options: InitPixieEditorOptions) => void;
|