@emailmaker/filemanager 0.10.66 → 0.10.68

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 (36) hide show
  1. package/components/FileContent/FileContent.d.ts +7 -19
  2. package/components/FileContent/FileContentHeader.d.ts +34 -0
  3. package/components/FileContent/FileSelectionCheckbox.d.ts +14 -0
  4. package/components/FileContent/SelectableTableRow.d.ts +12 -0
  5. package/components/FileContent/presentation/FileGridItem.d.ts +33 -0
  6. package/components/FileContent/presentation/FileItemActionsDropdown.d.ts +24 -0
  7. package/components/FileContent/presentation/FileItemDate.d.ts +11 -0
  8. package/components/FileContent/presentation/FileItemName.d.ts +13 -0
  9. package/components/FileContent/presentation/FileItemPreview.d.ts +22 -0
  10. package/components/FileContent/presentation/types.d.ts +1 -0
  11. package/components/FileContent/renderers/FileGridView.d.ts +36 -0
  12. package/components/FileContent/renderers/FileTableView.d.ts +26 -0
  13. package/file-manager.css +11 -2
  14. package/file-manager.esm.js +9 -9
  15. package/file-manager.esm.js.map +1 -1
  16. package/file-manager.js +1 -1
  17. package/hooks/core/files/index.d.ts +1 -0
  18. package/hooks/core/files/useFileSelectionStore.d.ts +32 -0
  19. package/hooks/core/types.d.ts +0 -3
  20. package/hooks/useFileActions.d.ts +2 -9
  21. package/hooks/usePixieEditor.d.ts +1 -2
  22. package/my-files.json +1 -0
  23. package/package.json +1 -1
  24. package/presentation/file-list/FileListAdapter.d.ts +10 -0
  25. package/presentation/file-list/types.d.ts +20 -0
  26. package/presentation/file-list/useFileListEngine.d.ts +26 -0
  27. package/presentation/list-core/ListItemAdapter.d.ts +9 -0
  28. package/presentation/list-core/RowModelCache.d.ts +13 -0
  29. package/presentation/list-core/ViewportController.d.ts +10 -0
  30. package/presentation/list-core/types.d.ts +31 -0
  31. package/presentation/list-core/useListPresentationEngine.d.ts +20 -0
  32. package/presentation/list-core/useViewportRenderController.d.ts +24 -0
  33. package/presentation/list-core/viewportMetrics.d.ts +3 -0
  34. package/types.d.ts +9 -0
  35. package/utils/imageCompression.d.ts +4 -2
  36. package/utils/jsonDataProvider.d.ts +1 -0
@@ -1,4 +1,5 @@
1
1
  export { useFilesAPI, type UseFilesAPIActions } from './useFilesAPI';
2
2
  export { useFilesSelection, type UseFilesSelectionState, type UseFilesSelectionActions } from './useFilesSelection';
3
+ export { useFileSelectionStore, type FileSelectionToggleOptions } from './useFileSelectionStore';
3
4
  export { useFilesModals, type UseFilesModalsState, type UseFilesModalsActions } from './useFilesModals';
4
5
  export * from './useFilesAPIHelpers';
@@ -0,0 +1,32 @@
1
+ import type { File as AppFile } from '../../../types';
2
+ export interface FileSelectionToggleOptions {
3
+ metaKey?: boolean;
4
+ ctrlKey?: boolean;
5
+ shiftKey?: boolean;
6
+ forceToggle?: boolean;
7
+ }
8
+ interface FileSelectionStoreState {
9
+ selectedFiles: Set<string>;
10
+ visibleFileIds: string[];
11
+ anchorId: string | null;
12
+ multiSelect: boolean;
13
+ }
14
+ interface FileSelectionStoreActions {
15
+ setMultiSelect: (enabled: boolean) => void;
16
+ syncVisibleFiles: (files: AppFile[]) => void;
17
+ setSelectedFiles: (selectedFiles: Set<string>) => void;
18
+ clearSelection: () => void;
19
+ selectAllVisible: () => void;
20
+ toggleFileSelection: (fileId: string, opts?: FileSelectionToggleOptions) => void;
21
+ }
22
+ type FileSelectionStore = FileSelectionStoreState & FileSelectionStoreActions;
23
+ /**
24
+ * Централизованный store для selection.
25
+ *
26
+ * Почему здесь отдельный store, а не общий React context:
27
+ * - selection меняется очень часто;
28
+ * - список должен подписываться на selection максимально узко;
29
+ * - элементы, которых больше нет на текущем экране, должны автоматически выпадать из selection.
30
+ */
31
+ export declare const useFileSelectionStore: import("zustand").UseBoundStore<import("zustand").StoreApi<FileSelectionStore>>;
32
+ export {};
@@ -17,7 +17,6 @@ export interface FileManagerState {
17
17
  sortBy: SortByType;
18
18
  sortOrder: SortOrderType;
19
19
  pathHistory: PathItem[];
20
- selectedFiles: Set<string>;
21
20
  currentMenuFile: string;
22
21
  loading: boolean;
23
22
  pagination: PaginationState;
@@ -52,7 +51,6 @@ export interface FileManagerActions {
52
51
  setSortBy: (sortBy: SortByType) => void;
53
52
  setSortOrder: (sortOrder: SortOrderType) => void;
54
53
  setPathHistory: (history: PathItem[]) => void;
55
- setSelectedFiles: (files?: Set<string>) => void;
56
54
  setCurrentMenuFile: (file: string) => void;
57
55
  setLoading: (isLoading: boolean) => void;
58
56
  setPagination: (pagination: Partial<PaginationState>) => void;
@@ -141,7 +139,6 @@ export interface FileManagerContextType {
141
139
  sortBy: SortByType;
142
140
  sortOrder: SortOrderType;
143
141
  pathHistory: PathItem[];
144
- selectedFiles: Set<string>;
145
142
  loading: boolean;
146
143
  pagination: PaginationState;
147
144
  searchQuery: string;
@@ -1,14 +1,7 @@
1
1
  import { File as AppFile, ThumbnailFile } from '../types';
2
2
  interface UseFileActionsProps {
3
3
  files: AppFile[];
4
- selectedFiles: Set<string>;
5
- currentMenuFile: string;
6
- toggleFileSelection: (fileId: string, opts?: {
7
- metaKey?: boolean;
8
- ctrlKey?: boolean;
9
- shiftKey?: boolean;
10
- forceToggle?: boolean;
11
- }) => void;
4
+ clearSelection: () => void;
12
5
  showRenameModal: (fileId: string) => void;
13
6
  showMoveModal: () => void;
14
7
  showCopyModal: () => void;
@@ -17,7 +10,7 @@ interface UseFileActionsProps {
17
10
  showDeleteConfirm?: () => void;
18
11
  onEdit: (file?: AppFile | ThumbnailFile) => void;
19
12
  }
20
- export declare const useFileActions: ({ files, selectedFiles, toggleFileSelection, showRenameModal, showMoveModal, showCopyModal, handleDeleteFile, handleDeleteFolder, showDeleteConfirm, onEdit, }: UseFileActionsProps) => {
13
+ export declare const useFileActions: ({ files, clearSelection, showRenameModal, showMoveModal, showCopyModal, handleDeleteFile, handleDeleteFolder, showDeleteConfirm, onEdit, }: UseFileActionsProps) => {
21
14
  handleClearSelection: () => void;
22
15
  handleRename: (selectedFileId?: string) => void;
23
16
  handleDeleteSelected: (file: AppFile | undefined) => void;
@@ -2,11 +2,10 @@ import type { PixieSavePayload } from '../types';
2
2
  import { File as AppFile, FilesQueryParams, ThumbnailFile } from '../types';
3
3
  interface UsePixieEditorProps {
4
4
  files: AppFile[];
5
- selectedFiles: Set<string>;
6
5
  fetchFiles: (params?: FilesQueryParams) => Promise<void>;
7
6
  selectedFolder: string | null;
8
7
  }
9
- export declare const usePixieEditor: ({ files, selectedFiles, fetchFiles, selectedFolder }: UsePixieEditorProps) => {
8
+ export declare const usePixieEditor: ({ files, fetchFiles, selectedFolder }: UsePixieEditorProps) => {
10
9
  isPixieEditorVisible: boolean;
11
10
  editingFile: ThumbnailFile | AppFile | null;
12
11
  handleEdit: (fileForEdit?: ThumbnailFile | AppFile) => void;