@emailmaker/filemanager 0.10.46 → 0.10.47

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.
Files changed (35) hide show
  1. package/components/FileContent/FileContent.d.ts +1 -0
  2. package/components/FileManagerApp/ActionsHeader.d.ts +4 -0
  3. package/components/FileModals/FileModals.d.ts +4 -1
  4. package/components/ImageIcons/IconsControls.d.ts +26 -0
  5. package/components/ImageIcons/IconsGrid.d.ts +26 -0
  6. package/components/ImageIcons/IconsSearchForm.d.ts +13 -0
  7. package/components/ImageIcons/IconsTab.d.ts +4 -0
  8. package/components/ImageIcons/useIconsCopyToFolder.d.ts +28 -0
  9. package/components/ImageIcons/useStreamlineApi.d.ts +47 -0
  10. package/components/index.d.ts +1 -0
  11. package/constants/index.d.ts +2 -0
  12. package/file-manager.css +466 -20
  13. package/file-manager.esm.js +9 -9
  14. package/file-manager.esm.js.map +1 -1
  15. package/file-manager.js +1 -1
  16. package/file-manager.js.LICENSE.txt +2 -0
  17. package/hooks/core/files/actions/useFilesCopy.d.ts +1 -0
  18. package/hooks/core/files/useFilesAPI.d.ts +1 -0
  19. package/hooks/core/files/useFilesSelection.d.ts +1 -0
  20. package/hooks/core/types.d.ts +6 -1
  21. package/hooks/core/useFiles.d.ts +1 -0
  22. package/hooks/useCustomIcons.d.ts +1 -0
  23. package/hooks/useFileActions.d.ts +6 -1
  24. package/hooks/useFolderSelectionMenu.d.ts +26 -0
  25. package/notification.d.ts +16 -8
  26. package/package.json +1 -1
  27. package/types.d.ts +78 -7
  28. package/utils/errorMessages.d.ts +22 -2
  29. package/utils/fileFormatUtils.d.ts +39 -0
  30. package/utils/fileValidation.d.ts +22 -0
  31. package/utils/imageCompression.d.ts +1 -0
  32. package/utils/jsonDataProvider.d.ts +8 -0
  33. package/utils/mimeUtils.d.ts +12 -0
  34. package/utils/nameNormalization.d.ts +23 -0
  35. package/utils/svgToPng.d.ts +11 -0
@@ -26,6 +26,7 @@ interface FileContentProps {
26
26
  metaKey?: boolean;
27
27
  ctrlKey?: boolean;
28
28
  shiftKey?: boolean;
29
+ forceToggle?: boolean;
29
30
  }) => void;
30
31
  handleDroppedFiles: (droppedFiles: globalThis.File[]) => Promise<void>;
31
32
  fileUpload: UseFileUploadReturn;
@@ -1,8 +1,12 @@
1
1
  import * as React from 'react';
2
+ import { File as AppFile } from '../../types';
2
3
  interface ActionsHeaderProps {
3
4
  activeLibraryItem: string;
4
5
  selectedFolder: string;
5
6
  isTrashFolder?: boolean;
7
+ onClearTrash?: () => void;
8
+ files: AppFile[];
9
+ loading: boolean;
6
10
  onRefresh?: () => void;
7
11
  refreshDisabled?: boolean;
8
12
  }
@@ -10,7 +10,7 @@ interface FileModalsProps {
10
10
  folders: Folder[];
11
11
  isUrlModalVisible: boolean;
12
12
  setIsUrlModalVisible: (visible: boolean) => void;
13
- handleAddFileByUrl: (url?: string | null) => Promise<File | void>;
13
+ handleAddFileByUrl: (url?: string | null, noFolder?: boolean, fileName?: string) => Promise<File | void>;
14
14
  urlForm: FormInstance;
15
15
  isRenameModalVisible: boolean;
16
16
  handleRenameOk: () => void;
@@ -35,6 +35,9 @@ interface FileModalsProps {
35
35
  isDeleteConfirmVisible?: boolean;
36
36
  handleDeleteConfirmOk?: () => void | Promise<void>;
37
37
  handleDeleteConfirmCancel?: () => void;
38
+ isClearTrashConfirmVisible?: boolean;
39
+ handleClearTrashConfirm?: () => void | Promise<void>;
40
+ handleClearTrashCancel?: () => void;
38
41
  fetchChildFolders: (parentId: string | null) => Promise<Folder[]>;
39
42
  }
40
43
  export declare const FileModals: React.FC<FileModalsProps>;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ export interface IconsControlsProps {
3
+ mode: 'global' | 'family';
4
+ familySlug: string | null;
5
+ categoryName?: string | null;
6
+ colorHex: string;
7
+ setColorHex: (v: string) => void;
8
+ colorHex2: string;
9
+ setColorHex2: (v: string) => void;
10
+ colorHex3: string;
11
+ setColorHex3: (v: string) => void;
12
+ sizePx: number;
13
+ setSizePx: (v: number) => void;
14
+ strokeWidth: number | undefined;
15
+ setStrokeWidth: (v: number | undefined) => void;
16
+ responsiveSvg: boolean;
17
+ setResponsiveSvg: (v: boolean) => void;
18
+ useCssColor: boolean;
19
+ setUseCssColor: (v: boolean) => void;
20
+ showSecondColor: boolean;
21
+ showThirdColor: boolean;
22
+ styleFilter?: string | null;
23
+ onBack: () => void;
24
+ }
25
+ export declare const IconsControls: React.FC<IconsControlsProps>;
26
+ export default IconsControls;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import type { StreamlineSearchItem } from '../../types';
3
+ export interface IconsGridProps {
4
+ items: StreamlineSearchItem[];
5
+ hasMore: boolean;
6
+ loading: boolean;
7
+ hasQuery: boolean;
8
+ mode: 'global' | 'family';
9
+ selectedHash: string | null;
10
+ onLoadMore: () => void;
11
+ onItemClick: (item: StreamlineSearchItem) => void;
12
+ onInsert: (item: StreamlineSearchItem) => void;
13
+ scrollContainerRef: React.RefObject<HTMLDivElement>;
14
+ colorVars?: {
15
+ colorHex: string;
16
+ colorHex2: string;
17
+ colorHex3: string;
18
+ };
19
+ svgTextMap: Record<string, string>;
20
+ previewSize?: number;
21
+ isFamilyLoading?: boolean;
22
+ selectedHashes?: Set<string>;
23
+ onToggleSelect?: (hash: string) => void;
24
+ }
25
+ export declare const IconsGrid: React.FC<IconsGridProps>;
26
+ export default IconsGrid;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { InputRef } from 'antd';
3
+ export interface IconsSearchFormProps {
4
+ query: string;
5
+ onQueryChange: (value: string) => void;
6
+ onSubmit: () => void;
7
+ styleFilter: string | null;
8
+ onStyleChange: (value: string | null) => void;
9
+ hasResults?: boolean;
10
+ inputRef?: React.RefObject<InputRef>;
11
+ }
12
+ export declare const IconsSearchForm: React.FC<IconsSearchFormProps>;
13
+ export default IconsSearchForm;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { IconsTabProps } from '../../types';
3
+ export declare const IconsTab: React.FC<IconsTabProps>;
4
+ export default IconsTab;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import type { StreamlineSearchItem } from '../../types';
3
+ interface UseIconsCopyToFolderArgs {
4
+ items: StreamlineSearchItem[];
5
+ selectedHashes: Set<string>;
6
+ getPngDataUrlForItem: (item: StreamlineSearchItem) => Promise<string | null>;
7
+ dataUrlToBlob: (dataUrl: string, mimeType?: string) => Blob;
8
+ clearSelection: () => void;
9
+ }
10
+ export declare const useIconsCopyToFolder: ({ items, selectedHashes, getPngDataUrlForItem, dataUrlToBlob, clearSelection, }: UseIconsCopyToFolderArgs) => {
11
+ isCopyIconsModalVisible: boolean;
12
+ isCopyLoading: boolean;
13
+ copyForm: import("antd").FormInstance<any>;
14
+ openCopyModal: () => Promise<void>;
15
+ closeCopyModal: () => void;
16
+ resetAfterClose: () => void;
17
+ handleCopyTreeSelect: (selectedKeys: React.Key[]) => Promise<void>;
18
+ handleIconsCopyOk: (targetFolder?: string) => Promise<void>;
19
+ handleCreateFolderAndCopy: () => void;
20
+ fetchChildFolders: (parentId: string | null) => Promise<import("../../types").Folder[]>;
21
+ generateMenuItemsFromFolders: (params: {
22
+ targetForm: import("antd").FormInstance;
23
+ onTreeSelect: (selectedKeys: React.Key[]) => Promise<void>;
24
+ onComplete: (targetFolder?: string) => void;
25
+ actionButtonText: string;
26
+ }) => import("../../types").MenuItem[];
27
+ };
28
+ export {};
@@ -0,0 +1,47 @@
1
+ import type { StreamlineSearchResponse } from '../../types';
2
+ type SearchMode = 'global' | 'family';
3
+ type SvgCacheValue = {
4
+ text: string;
5
+ url: string;
6
+ original: string;
7
+ };
8
+ export declare function useStreamlineApi(useCssColor?: boolean, streamlineBaseUrl?: string): {
9
+ buildUrl: (params: {
10
+ mode: SearchMode;
11
+ q: string;
12
+ offset: number;
13
+ limit: number;
14
+ familySlug?: string | null;
15
+ style?: string | null;
16
+ }) => string;
17
+ performSearch: (params: {
18
+ mode: SearchMode;
19
+ familySlug: string | null;
20
+ query: string;
21
+ offset: number;
22
+ limit: number;
23
+ style?: string | null;
24
+ signal?: AbortSignal;
25
+ }) => Promise<StreamlineSearchResponse>;
26
+ fetchSvgDataUrl: (hash: string, options?: {
27
+ size?: number;
28
+ responsive?: boolean;
29
+ colors?: string;
30
+ backgroundColor?: string;
31
+ strokeWidth?: number;
32
+ strokeToFill?: boolean;
33
+ signal?: AbortSignal;
34
+ }) => Promise<SvgCacheValue>;
35
+ fetchPngDataUrl: (hash: string, options?: {
36
+ size?: number;
37
+ colors?: string;
38
+ backgroundColor?: string;
39
+ strokeWidth?: number;
40
+ signal?: AbortSignal;
41
+ }) => Promise<string>;
42
+ normalizeSvgForCss: (text: string, opts?: {
43
+ strokeWidth?: number;
44
+ }) => string;
45
+ };
46
+ export type UseStreamlineApiReturn = ReturnType<typeof useStreamlineApi>;
47
+ export {};
@@ -6,3 +6,4 @@ export { FileModals } from './FileModals/FileModals';
6
6
  export { SearchInput } from './SearchInput';
7
7
  export { CustomUploadIcon } from './CustomUploadIcon/';
8
8
  export { SafeImage } from './SafeImage';
9
+ export { default as IconsTab } from './ImageIcons/IconsTab';
@@ -1,8 +1,10 @@
1
1
  export declare const MY_FILES: "my_files";
2
2
  export declare const GIF: "gif";
3
3
  export declare const STOCK_IMAGES: "stock_images";
4
+ export declare const ICONS: "icons";
4
5
  export declare const AI: "ai";
5
6
  export declare const EDITOR: "editor";
7
+ export declare const TRASH: "Trash";
6
8
  export declare const LIGHT = "light";
7
9
  export declare const DARK = "dark";
8
10
  export declare const SYSTEM = "system";