@webiny/app-file-manager 6.4.11 → 6.6.0-alpha.1
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/app.js +21 -2
- package/app.js.map +1 -1
- package/domain/tagsHelpers.d.ts +2 -2
- package/domain/types.d.ts +0 -8
- package/features/permissions/abstractions.d.ts +2 -2
- package/features/permissions/feature.d.ts +3 -3
- package/features/shared/FILE_FIELDS.js +4 -0
- package/features/shared/FILE_FIELDS.js.map +1 -1
- package/features/shared/FileFieldsProviderWithWcp.d.ts +5 -5
- package/features/shared/FileFieldsProviderWithWcp.js +7 -7
- package/features/shared/FileFieldsProviderWithWcp.js.map +1 -1
- package/modules/AiEnrichment/AiImageEnrichmentEventHandler.d.ts +18 -0
- package/modules/AiEnrichment/AiImageEnrichmentEventHandler.js +33 -0
- package/modules/AiEnrichment/AiImageEnrichmentEventHandler.js.map +1 -0
- package/modules/AiEnrichment/ReenrichFileGateway.d.ts +12 -0
- package/modules/AiEnrichment/ReenrichFileGateway.js +23 -0
- package/modules/AiEnrichment/ReenrichFileGateway.js.map +1 -0
- package/modules/AiEnrichment/ReenrichWithAi.d.ts +11 -0
- package/modules/AiEnrichment/ReenrichWithAi.js +57 -0
- package/modules/AiEnrichment/ReenrichWithAi.js.map +1 -0
- package/modules/AiEnrichment/ReenrichWithAiPresenter.d.ts +50 -0
- package/modules/AiEnrichment/ReenrichWithAiPresenter.js +114 -0
- package/modules/AiEnrichment/ReenrichWithAiPresenter.js.map +1 -0
- package/modules/AiEnrichment/StreamingPlaceholder.d.ts +15 -0
- package/modules/AiEnrichment/StreamingPlaceholder.js +32 -0
- package/modules/AiEnrichment/StreamingPlaceholder.js.map +1 -0
- package/modules/AiEnrichment/abstractions.d.ts +70 -0
- package/modules/AiEnrichment/abstractions.js +6 -0
- package/modules/AiEnrichment/abstractions.js.map +1 -0
- package/modules/AiEnrichment/feature.d.ts +3 -0
- package/modules/AiEnrichment/feature.js +21 -0
- package/modules/AiEnrichment/feature.js.map +1 -0
- package/modules/AiEnrichment/index.d.ts +2 -0
- package/modules/AiEnrichment/index.js +9 -0
- package/modules/AiEnrichment/index.js.map +1 -0
- package/modules/Enterprise/index.js +3 -3
- package/modules/Enterprise/index.js.map +1 -1
- package/modules/HeadlessCms/fieldType/AssetFieldSettingsModifier.d.ts +26 -0
- package/modules/HeadlessCms/fieldType/AssetFieldSettingsModifier.js +39 -0
- package/modules/HeadlessCms/fieldType/AssetFieldSettingsModifier.js.map +1 -0
- package/modules/HeadlessCms/fieldType/AssetFieldType.d.ts +34 -0
- package/modules/HeadlessCms/fieldType/AssetFieldType.js +42 -0
- package/modules/HeadlessCms/fieldType/AssetFieldType.js.map +1 -0
- package/modules/HeadlessCms/fieldType/AssetFormFieldType.d.ts +21 -0
- package/modules/HeadlessCms/fieldType/AssetFormFieldType.js +42 -0
- package/modules/HeadlessCms/fieldType/AssetFormFieldType.js.map +1 -0
- package/modules/HeadlessCms/fieldType/AssetInputRenderer.d.ts +15 -0
- package/modules/HeadlessCms/fieldType/AssetInputRenderer.js +20 -0
- package/modules/HeadlessCms/fieldType/AssetInputRenderer.js.map +1 -0
- package/modules/HeadlessCms/fieldType/AssetInputsRenderer.d.ts +15 -0
- package/modules/HeadlessCms/fieldType/AssetInputsRenderer.js +20 -0
- package/modules/HeadlessCms/fieldType/AssetInputsRenderer.js.map +1 -0
- package/modules/HeadlessCms/fieldType/FileFieldSettingsModifier.d.ts +16 -0
- package/modules/HeadlessCms/fieldType/FileFieldSettingsModifier.js +33 -0
- package/modules/HeadlessCms/fieldType/FileFieldSettingsModifier.js.map +1 -0
- package/modules/HeadlessCms/fieldType/FileFieldType.d.ts +25 -0
- package/modules/HeadlessCms/fieldType/FileFieldType.js +38 -0
- package/modules/HeadlessCms/fieldType/FileFieldType.js.map +1 -0
- package/modules/HeadlessCms/fieldType/FileInputRenderer.d.ts +15 -0
- package/modules/HeadlessCms/fieldType/FileInputRenderer.js +19 -0
- package/modules/HeadlessCms/fieldType/FileInputRenderer.js.map +1 -0
- package/modules/HeadlessCms/fieldType/FileInputsRenderer.d.ts +15 -0
- package/modules/HeadlessCms/fieldType/FileInputsRenderer.js +19 -0
- package/modules/HeadlessCms/fieldType/FileInputsRenderer.js.map +1 -0
- package/modules/HeadlessCms/fieldType/feature.d.ts +1 -0
- package/modules/HeadlessCms/fieldType/feature.js +27 -0
- package/modules/HeadlessCms/fieldType/feature.js.map +1 -0
- package/modules/HeadlessCms/fieldType/isAssetField.d.ts +2 -0
- package/modules/HeadlessCms/fieldType/isAssetField.js +4 -0
- package/modules/HeadlessCms/fieldType/isAssetField.js.map +1 -0
- package/package.json +24 -34
- package/presentation/FileActions/FileDetails/EditImage.d.ts +2 -0
- package/presentation/FileActions/FileDetails/EditImage.js +39 -0
- package/presentation/FileActions/FileDetails/EditImage.js.map +1 -0
- package/presentation/FileActions/index.js +8 -0
- package/presentation/FileActions/index.js.map +1 -1
- package/presentation/FileDetails/FileDetailsPresenter.d.ts +5 -4
- package/presentation/FileDetails/FileDetailsPresenter.js +40 -46
- package/presentation/FileDetails/FileDetailsPresenter.js.map +1 -1
- package/presentation/FileDetails/FileDetailsPresenter.test.js +39 -56
- package/presentation/FileDetails/FileDetailsPresenter.test.js.map +1 -1
- package/presentation/FileDetails/abstractions.d.ts +2 -0
- package/presentation/FileDetails/abstractions.js.map +1 -1
- package/presentation/FileDetails/components/Content.d.ts +6 -4
- package/presentation/FileDetails/components/Content.js +2 -2
- package/presentation/FileDetails/components/Content.js.map +1 -1
- package/presentation/FileDetails/components/FileDetailsDrawer.d.ts +2 -2
- package/presentation/FileDetails/components/FileDetailsDrawer.js +11 -5
- package/presentation/FileDetails/components/FileDetailsDrawer.js.map +1 -1
- package/presentation/FileList/FileListDataSource.d.ts +8 -12
- package/presentation/FileList/FileListDataSource.js +47 -87
- package/presentation/FileList/FileListDataSource.js.map +1 -1
- package/presentation/FileList/FileListPresenter.test.js +9 -3
- package/presentation/FileList/FileListPresenter.test.js.map +1 -1
- package/presentation/FileList/FileManagerPresenter.d.ts +1 -0
- package/presentation/FileList/FileManagerPresenter.js +15 -5
- package/presentation/FileList/FileManagerPresenter.js.map +1 -1
- package/presentation/FileList/abstractions.d.ts +3 -0
- package/presentation/FileList/abstractions.js.map +1 -1
- package/presentation/FileList/components/BulkActions/BulkActionBar.d.ts +2 -2
- package/presentation/FileList/components/BulkActions/BulkActionDelete.d.ts +2 -2
- package/presentation/FileList/components/BulkActions/BulkActionMove.d.ts +2 -2
- package/presentation/FileList/components/BulkActions/index.d.ts +0 -1
- package/presentation/FileList/components/BulkActions/index.js +0 -1
- package/presentation/FileList/components/BulkActions/useBulkActionWorker.d.ts +9 -8
- package/presentation/FileList/components/BulkActions/useBulkActionWorker.js +3 -9
- package/presentation/FileList/components/BulkActions/useBulkActionWorker.js.map +1 -1
- package/presentation/FileList/components/Filters/SubFoldersToggle.d.ts +2 -2
- package/presentation/FileList/components/Filters/TagsFilter.d.ts +2 -2
- package/presentation/FileList/components/Filters/TypeFilter.d.ts +2 -2
- package/presentation/FileList/components/Grid/FileGrid.d.ts +2 -2
- package/presentation/FileList/components/Grid/FileGrid.js +1 -1
- package/presentation/FileList/components/Grid/FileGrid.js.map +1 -1
- package/presentation/FileList/components/Grid/FileGrid.test.js +18 -7
- package/presentation/FileList/components/Grid/FileGrid.test.js.map +1 -1
- package/presentation/FileList/components/Header/FileManagerHeader.d.ts +2 -2
- package/presentation/FileList/components/Search/SearchBar.d.ts +2 -2
- package/presentation/FileList/components/Table/FileTable.d.ts +2 -2
- package/presentation/FileList/components/Table/FileTable.js +1 -1
- package/presentation/FileList/components/Table/FileTable.js.map +1 -1
- package/presentation/FileList/components/Table/FileTable.test.js +9 -4
- package/presentation/FileList/components/Table/FileTable.test.js.map +1 -1
- package/presentation/FileList/components/Upload/UploadProgress.d.ts +2 -2
- package/presentation/FileManager/FileManagerBreadcrumbs.d.ts +12 -0
- package/presentation/FileManager/FileManagerBreadcrumbs.js +37 -0
- package/presentation/FileManager/FileManagerBreadcrumbs.js.map +1 -0
- package/presentation/FileManager/FileManagerView.js +36 -2
- package/presentation/FileManager/FileManagerView.js.map +1 -1
- package/presentation/FileManager/RouteParamsSync.d.ts +2 -0
- package/presentation/FileManager/RouteParamsSync.js +30 -0
- package/presentation/FileManager/RouteParamsSync.js.map +1 -0
- package/presentation/Settings/components/SettingsView.d.ts +2 -2
- package/presentation/config/DefaultFileManagerConfig.js +13 -11
- package/presentation/config/DefaultFileManagerConfig.js.map +1 -1
- package/presentation/config/FileManagerViewConfig.d.ts +19 -25
- package/presentation/config/configComponents/Browser/BulkAction.d.ts +10 -8
- package/presentation/config/configComponents/Browser/BulkAction.js +3 -9
- package/presentation/config/configComponents/Browser/BulkAction.js.map +1 -1
- package/presentation/config/configComponents/Browser/FileAction.d.ts +2 -1
- package/presentation/config/configComponents/Browser/FolderAction.d.ts +2 -1
- package/presentation/config/configComponents/Browser/Table/Column.d.ts +9 -8
- package/presentation/config/configComponents/Browser/Table/index.d.ts +9 -9
- package/presentation/config/configComponents/Browser/index.d.ts +20 -20
- package/presentation/config/configComponents/Browser/index.js +0 -8
- package/presentation/config/configComponents/Browser/index.js.map +1 -1
- package/presentation/config/configComponents/FileDetails/index.d.ts +4 -2
- package/presentation/config/thumbnailRenderers/CroppedFileImage.d.ts +18 -0
- package/presentation/config/thumbnailRenderers/CroppedFileImage.js +66 -0
- package/presentation/config/thumbnailRenderers/CroppedFileImage.js.map +1 -0
- package/presentation/config/thumbnailRenderers/FilePreviewImageRenderer.js +6 -9
- package/presentation/config/thumbnailRenderers/FilePreviewImageRenderer.js.map +1 -1
- package/presentation/config/thumbnailRenderers/GridItemImageRenderer.js +6 -9
- package/presentation/config/thumbnailRenderers/GridItemImageRenderer.js.map +1 -1
- package/presentation/config/thumbnailRenderers/TableItemImageRenderer.js +6 -9
- package/presentation/config/thumbnailRenderers/TableItemImageRenderer.js.map +1 -1
- package/presentation/fieldRenderers/CmsAssetPickerRenderer.d.ts +22 -0
- package/presentation/fieldRenderers/CmsAssetPickerRenderer.js +56 -0
- package/presentation/fieldRenderers/CmsAssetPickerRenderer.js.map +1 -0
- package/presentation/fieldRenderers/CmsFilePickerRenderer.d.ts +13 -0
- package/presentation/fieldRenderers/CmsFilePickerRenderer.js +36 -0
- package/presentation/fieldRenderers/CmsFilePickerRenderer.js.map +1 -0
- package/presentation/fieldRenderers/CmsImageEditorDialog.d.ts +7 -0
- package/presentation/fieldRenderers/CmsImageEditorDialog.js +32 -0
- package/presentation/fieldRenderers/CmsImageEditorDialog.js.map +1 -0
- package/presentation/fieldRenderers/CmsMultiAssetPickerRenderer.d.ts +18 -0
- package/presentation/fieldRenderers/CmsMultiAssetPickerRenderer.js +88 -0
- package/presentation/fieldRenderers/CmsMultiAssetPickerRenderer.js.map +1 -0
- package/presentation/fieldRenderers/CmsMultiFilePickerRenderer.d.ts +13 -0
- package/presentation/fieldRenderers/CmsMultiFilePickerRenderer.js +60 -0
- package/presentation/fieldRenderers/CmsMultiFilePickerRenderer.js.map +1 -0
- package/presentation/fieldRenderers/CroppedAssetThumb.d.ts +15 -0
- package/presentation/fieldRenderers/CroppedAssetThumb.js +25 -0
- package/presentation/fieldRenderers/CroppedAssetThumb.js.map +1 -0
- package/presentation/fieldRenderers/assetValue.d.ts +10 -0
- package/presentation/fieldRenderers/assetValue.js +88 -0
- package/presentation/fieldRenderers/assetValue.js.map +1 -0
- package/presentation/hooks/useCmsImageEditor.d.ts +10 -0
- package/presentation/hooks/useCmsImageEditor.js +76 -0
- package/presentation/hooks/useCmsImageEditor.js.map +1 -0
- package/presentation/hooks/useEditImage.d.ts +14 -0
- package/presentation/hooks/useEditImage.js +67 -0
- package/presentation/hooks/useEditImage.js.map +1 -0
- package/routes.d.ts +1 -0
- package/routes.js +2 -1
- package/routes.js.map +1 -1
- package/modules/HeadlessCms/fileField.d.ts +0 -2
- package/modules/HeadlessCms/fileField.js +0 -44
- package/modules/HeadlessCms/fileField.js.map +0 -1
- package/modules/HeadlessCms/fileRenderer/fileField.d.ts +0 -2
- package/modules/HeadlessCms/fileRenderer/fileField.js +0 -53
- package/modules/HeadlessCms/fileRenderer/fileField.js.map +0 -1
- package/modules/HeadlessCms/fileRenderer/fileFields.d.ts +0 -2
- package/modules/HeadlessCms/fileRenderer/fileFields.js +0 -73
- package/modules/HeadlessCms/fileRenderer/fileFields.js.map +0 -1
- package/modules/HeadlessCms/fileRenderer/utils.d.ts +0 -2
- package/modules/HeadlessCms/fileRenderer/utils.js +0 -15
- package/modules/HeadlessCms/fileRenderer/utils.js.map +0 -1
- package/modules/HeadlessCms/index.d.ts +0 -1
- package/modules/HeadlessCms/index.js +0 -14
- package/modules/HeadlessCms/index.js.map +0 -1
- package/modules/Settings/graphql.d.ts +0 -12
- package/modules/Settings/graphql.js +0 -36
- package/modules/Settings/graphql.js.map +0 -1
- package/modules/Settings/views/FileManagerSettings.d.ts +0 -2
- package/modules/Settings/views/FileManagerSettings.js +0 -134
- package/modules/Settings/views/FileManagerSettings.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.d.ts +0 -7
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.js +0 -15
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.d.ts +0 -15
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.js +0 -44
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.d.ts +0 -15
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.js +0 -52
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.d.ts +0 -61
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.js +0 -111
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.test.d.ts +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.test.js +0 -372
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.test.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/FieldRenderer.d.ts +0 -8
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/FieldRenderer.js +0 -31
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/FieldRenderer.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/Operation.d.ts +0 -11
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/Operation.js +0 -33
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/Operation.js.map +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/index.d.ts +0 -1
- package/presentation/FileList/components/BulkActions/BatchEditorDialog/index.js +0 -1
- package/presentation/FileList/components/BulkActions/BulkActionEdit.d.ts +0 -4
- package/presentation/FileList/components/BulkActions/BulkActionEdit.js +0 -105
- package/presentation/FileList/components/BulkActions/BulkActionEdit.js.map +0 -1
- package/presentation/config/configComponents/Browser/FolderFieldDecorator.d.ts +0 -7
- package/presentation/config/configComponents/Browser/FolderFieldDecorator.js +0 -11
- package/presentation/config/configComponents/Browser/FolderFieldDecorator.js.map +0 -1
|
@@ -33,6 +33,8 @@ import { TagsList } from "../FileList/components/TagsList/index.js";
|
|
|
33
33
|
import { UploadProgress } from "../FileList/components/Upload/index.js";
|
|
34
34
|
import { GetSettingsRepository } from "../../features/settings/abstractions.js";
|
|
35
35
|
import { OverlayProvider, useOverlay } from "./OverlayContext.js";
|
|
36
|
+
import { RouteParamsSync } from "./RouteParamsSync.js";
|
|
37
|
+
import { FileManagerBreadcrumbs } from "./FileManagerBreadcrumbs.js";
|
|
36
38
|
import { outputFileSelectionError } from "./outputFileSelectionError.js";
|
|
37
39
|
const t = i18n.ns("app-admin/file-manager/file-manager-view");
|
|
38
40
|
const FileManagerView_FileManagerViewLayout = observer(function() {
|
|
@@ -57,6 +59,37 @@ const FileManagerView_FileManagerViewLayout = observer(function() {
|
|
|
57
59
|
title: "File upload complete."
|
|
58
60
|
});
|
|
59
61
|
};
|
|
62
|
+
useEffect(()=>{
|
|
63
|
+
const handlePaste = (e)=>{
|
|
64
|
+
const items = e.clipboardData?.items;
|
|
65
|
+
if (!items) return;
|
|
66
|
+
const files = [];
|
|
67
|
+
for(let i = 0; i < items.length; i++)if ("file" === items[i].kind) {
|
|
68
|
+
const file = items[i].getAsFile();
|
|
69
|
+
if (file) {
|
|
70
|
+
const name = file.name && "image.png" !== file.name ? file.name : `pasted-${Date.now()}.${file.type.split("/")[1] || "png"}`;
|
|
71
|
+
files.push({
|
|
72
|
+
id: String(Date.now()) + "-" + i,
|
|
73
|
+
name,
|
|
74
|
+
type: file.type,
|
|
75
|
+
size: file.size,
|
|
76
|
+
src: {
|
|
77
|
+
file,
|
|
78
|
+
base64: null
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (files.length > 0) {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
uploadFiles(files);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
document.addEventListener("paste", handlePaste);
|
|
89
|
+
return ()=>document.removeEventListener("paste", handlePaste);
|
|
90
|
+
}, [
|
|
91
|
+
actions
|
|
92
|
+
]);
|
|
60
93
|
const onError = useCallback((errors)=>{
|
|
61
94
|
const message = outputFileSelectionError(errors);
|
|
62
95
|
if (message) toast.showWarningToast({
|
|
@@ -198,7 +231,8 @@ const FileManagerViewInner = observer(({ overlay = false, onChange, onClose, mul
|
|
|
198
231
|
]);
|
|
199
232
|
useEffect(()=>{
|
|
200
233
|
presenter.init({
|
|
201
|
-
scope
|
|
234
|
+
scope,
|
|
235
|
+
accept: accept ?? void 0
|
|
202
236
|
});
|
|
203
237
|
return ()=>presenter.dispose();
|
|
204
238
|
}, [
|
|
@@ -208,7 +242,7 @@ const FileManagerViewInner = observer(({ overlay = false, onChange, onClose, mul
|
|
|
208
242
|
]);
|
|
209
243
|
const inner = /*#__PURE__*/ react.createElement(DialogsProvider, null, /*#__PURE__*/ react.createElement(FileManagerViewWithConfig, null, /*#__PURE__*/ react.createElement(FileManagerPresenterProvider, {
|
|
210
244
|
presenter: presenter
|
|
211
|
-
}, /*#__PURE__*/ react.createElement(FileManagerView_FileManagerViewLayout, null), children)));
|
|
245
|
+
}, /*#__PURE__*/ react.createElement(FileManagerView_FileManagerViewLayout, null), children, !overlayConfig && /*#__PURE__*/ react.createElement(RouteParamsSync, null), !overlayConfig && /*#__PURE__*/ react.createElement(FileManagerBreadcrumbs, null))));
|
|
212
246
|
if (overlayConfig) return /*#__PURE__*/ react.createElement(OverlayProvider, {
|
|
213
247
|
config: overlayConfig
|
|
214
248
|
}, inner);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/FileManager/FileManagerView.js","sources":["../../../src/presentation/FileManager/FileManagerView.tsx"],"sourcesContent":["import React, { useMemo, useEffect, useCallback } from \"react\";\nimport { DiContainerProvider, useContainer, useFeature } from \"@webiny/app\";\nimport { observer } from \"mobx-react-lite\";\nimport {\n BrowserFilePicker,\n type BrowserFilePickerRenderProps\n} from \"@webiny/app-admin/presentation/browserFilePicker/index.js\";\nimport debounce from \"lodash/debounce.js\";\nimport { Heading, OverlayLoader, ScrollArea, Separator, useToast } from \"@webiny/admin-ui\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport {\n LeftPanel,\n OverlayLayout,\n RightPanel,\n SplitView,\n DialogsProvider,\n useHotkeys\n} from \"@webiny/app-admin\";\nimport { FoldersFeature } from \"@webiny/app-aco/features/folders/feature.js\";\nimport { FolderTreePresenterFeature } from \"@webiny/app-aco/presentation/folderTree/feature.js\";\nimport { FileManagerPresenterFeature } from \"~/presentation/FileList/feature.js\";\nimport {\n FileManagerPresenterProvider,\n useFileManagerPresenter\n} from \"~/presentation/FileList/FileManagerPresenterProvider.js\";\nimport { FileDetailsPresenterFeature } from \"~/presentation/FileDetails/feature.js\";\nimport { SharedCacheFeature } from \"~/features/shared/feature.js\";\nimport { ListFilesFeature } from \"~/features/listFiles/feature.js\";\nimport { GetFileFeature } from \"~/features/getFile/feature.js\";\nimport { DeleteFileFeature } from \"~/features/deleteFile/feature.js\";\nimport { UpdateFileFeature } from \"~/features/updateFile/feature.js\";\nimport { FileUploaderFeature } from \"~/features/fileUploader/feature.js\";\nimport { ListTagsFeature } from \"~/features/tags/feature.js\";\nimport { GetSettingsFeature } from \"~/features/settings/feature.js\";\nimport {\n FileManagerViewWithConfig,\n useFileManagerConfig\n} from \"~/presentation/config/FileManagerViewConfig.js\";\nimport { FolderTree } from \"@webiny/app-aco/presentation/folderTree/FolderTree.js\";\nimport { BottomInfoBar } from \"~/presentation/FileList/components/BottomInfoBar/index.js\";\nimport { BulkActionBar } from \"~/presentation/FileList/components/BulkActions/index.js\";\nimport { FileDropPlaceholder } from \"~/presentation/FileList/components/FileDropPlaceholder/index.js\";\nimport { Empty } from \"~/presentation/FileList/components/Empty/index.js\";\nimport { FileDetailsDrawer } from \"~/presentation/FileDetails/components/FileDetailsDrawer.js\";\nimport { FileGrid } from \"~/presentation/FileList/components/Grid/index.js\";\nimport { FileManagerHeader } from \"~/presentation/FileList/components/Header/FileManagerHeader.js\";\nimport { FileTable } from \"~/presentation/FileList/components/Table/index.js\";\nimport { TagsList } from \"~/presentation/FileList/components/TagsList/index.js\";\nimport { UploadProgress } from \"~/presentation/FileList/components/Upload/index.js\";\nimport { GetSettingsRepository } from \"~/features/settings/abstractions.js\";\nimport { OverlayProvider, useOverlay } from \"./OverlayContext.js\";\n\nimport type { FmFile } from \"~/features/shared/types.js\";\nimport type {\n FileError,\n SelectedFile\n} from \"@webiny/app-admin/presentation/browserFilePicker/index.js\";\nimport { outputFileSelectionError } from \"~/presentation/FileManager/outputFileSelectionError.js\";\nimport type { ScrollPosition } from \"@webiny/admin-ui\";\n\nexport interface FileManagerViewProps {\n overlay?: boolean;\n onChange?: (files: FmFile[]) => void;\n onClose?: () => void;\n multiple?: boolean;\n accept?: string[];\n scope?: string;\n children?: React.ReactNode;\n}\n\nconst t = i18n.ns(\"app-admin/file-manager/file-manager-view\");\n\n// ---------------------------------------------------------------------------\n// Layout — uses original UI components, wired to the presenter.\n// ---------------------------------------------------------------------------\n\nconst FileManagerViewLayout = observer(function FileManagerViewLayout() {\n const { vm, actions } = useFileManagerPresenter();\n const { browser } = useFileManagerConfig();\n const overlay = useOverlay();\n const toast = useToast();\n\n useHotkeys({\n zIndex: 20,\n keys: {\n esc: () => overlay && overlay.onClose()\n }\n });\n\n const container = useContainer();\n const settingsRepository = useMemo(() => container.resolve(GetSettingsRepository), [container]);\n const settings = settingsRepository.settings;\n\n const uploadFiles = async (files: SelectedFile[]) => {\n await actions.upload(files);\n toast.showSuccessToast({ title: \"File upload complete.\" });\n };\n\n const onError = useCallback((errors: FileError[]) => {\n const message = outputFileSelectionError(errors);\n if (message) {\n toast.showWarningToast({ title: message });\n } else {\n toast.showWarningToast({ title: \"Couldn't process selected files.\" });\n console.error(errors);\n }\n }, []);\n\n const loadMoreOnScroll = useCallback(\n debounce(async (scrollFrame: ScrollPosition) => {\n if (scrollFrame.top > 0.8) {\n void actions.loadMore();\n }\n }, 200),\n [vm.list.pagination, actions]\n );\n\n if (!vm.fileModel) {\n return <OverlayLoader text={t`Preparing File Manager...`} />;\n }\n\n const renderList = (browseFiles: BrowserFilePickerRenderProps[\"browseFiles\"]) => {\n if (vm.loading) {\n return <OverlayLoader text={t`Loading files...`} size={\"lg\"} />;\n }\n\n if (vm.empty) {\n return <Empty isSearchResult={!vm.showFolders} browseFiles={browseFiles} />;\n }\n\n if (vm.viewMode === \"table\") {\n return (\n <ScrollArea className={\"h-full\"} onScroll={loadMoreOnScroll}>\n <FileTable />\n </ScrollArea>\n );\n }\n\n return (\n <ScrollArea className={\"h-full\"} onScroll={loadMoreOnScroll}>\n <FileGrid />\n </ScrollArea>\n );\n };\n\n const content = (\n <BrowserFilePicker\n multiple\n maxSize={settings ? settings.uploadMaxFileSize + \"b\" : \"1TB\"}\n multipleMaxSize={\"1TB\"}\n accept={overlay?.accept ?? []}\n onSuccess={uploadFiles}\n onError={onError}\n >\n {({ getDropZoneProps, browseFiles }) => (\n <>\n <FileDetailsDrawer />\n <SplitView namespace={\"fm/file/list\"}>\n <LeftPanel span={2}>\n <div className={\"flex flex-col h-full\"}>\n <div className={\"py-sm px-md\"}>\n <Heading level={5}>{t`File Manager`}</Heading>\n </div>\n <Separator />\n <div className={\"shrink-0 overflow-y-auto max-h-[66vh]\"}>\n <FolderTree\n vm={vm.folders}\n actions={actions.folders}\n folderActions={browser.folder.actions}\n dropConfirmation={browser.folder.dropConfirmation}\n enableActions={true}\n enableCreate={true}\n />\n </div>\n {browser.filterByTags ? (\n <>\n <Separator />\n <div className={\"flex-1 overflow-y-auto min-h-0\"}>\n <TagsList\n loading={false}\n activeTags={\n (vm.list.filters[\"tags\"] as string[]) ?? []\n }\n tags={vm.tags.map(tag => ({\n tag: tag.tag,\n count: tag.count\n }))}\n onActivatedTagsChange={tags => {\n if (tags.length > 0) {\n actions.filter.set(\"tags\", tags);\n } else {\n actions.filter.clear(\"tags\");\n actions.filter.clear(\"tags_rule\");\n }\n }}\n />\n </div>\n </>\n ) : null}\n </div>\n </LeftPanel>\n <RightPanel span={10}>\n <div className={\"flex flex-col relative h-full overflow-hidden\"}>\n <FileManagerHeader browseFiles={browseFiles} />\n <div\n className={\"flex-1 min-h-0 overflow-hidden\"}\n {...getDropZoneProps({\n onDragEnter: () => actions.setDragging(true),\n onDrop: () => actions.setDragging(false),\n onDragLeave: (e: React.DragEvent) => {\n if (\n !e.relatedTarget ||\n !e.currentTarget.contains(e.relatedTarget as Node)\n ) {\n actions.setDragging(false);\n }\n }\n })}\n data-testid={\"fm-list-wrapper\"}\n >\n {!overlay && <BulkActionBar />}\n {renderList(browseFiles)}\n {vm.dragging && <FileDropPlaceholder />}\n <UploadProgress />\n </div>\n <BottomInfoBar\n accept={overlay?.accept ?? []}\n listing={vm.list.pagination.loadingMore}\n loading={vm.list.pagination.loading}\n totalCount={vm.list.pagination.totalCount}\n currentCount={vm.list.pagination.currentCount}\n />\n </div>\n </RightPanel>\n </SplitView>\n </>\n )}\n </BrowserFilePicker>\n );\n\n if (overlay) {\n return (\n <OverlayLayout variant={\"strong\"} onExited={() => overlay.onClose()}>\n {content}\n </OverlayLayout>\n );\n }\n\n return content;\n});\n\n// ---------------------------------------------------------------------------\n// Inner component that resolves the presenter from the scoped container.\n// ---------------------------------------------------------------------------\n\nconst FileManagerViewInner = observer(\n ({\n overlay = false,\n onChange,\n onClose,\n multiple,\n accept,\n scope,\n children\n }: FileManagerViewProps) => {\n const { presenter } = useFeature(FileManagerPresenterFeature);\n\n const overlayConfig = useMemo(() => {\n if (!overlay || !onChange || !onClose) {\n return null;\n }\n\n const handleFileClick = (file: FmFile) => {\n if (multiple) {\n presenter.actions.selection.toggle(file.id);\n } else {\n onChange([file]);\n }\n };\n\n const confirmSelection = () => {\n const selectedIds = presenter.vm.list.selection.selectedIds;\n const selectedFiles = presenter.vm.list.rows.filter(f => selectedIds.has(f.id));\n if (selectedFiles.length > 0) {\n onChange(selectedFiles);\n }\n };\n\n return {\n onFileClick: handleFileClick,\n confirmSelection,\n onClose,\n accept: accept ?? [],\n multiple: multiple ?? false\n };\n }, [overlay, onChange, onClose, multiple, accept]);\n\n useEffect(() => {\n presenter.init({ scope });\n return () => presenter.dispose();\n }, [presenter, overlay, scope]);\n\n const inner = (\n <DialogsProvider>\n <FileManagerViewWithConfig>\n <FileManagerPresenterProvider presenter={presenter}>\n <FileManagerViewLayout />\n {children}\n </FileManagerPresenterProvider>\n </FileManagerViewWithConfig>\n </DialogsProvider>\n );\n\n if (overlayConfig) {\n return <OverlayProvider config={overlayConfig}>{inner}</OverlayProvider>;\n }\n\n return inner;\n }\n);\n\n// ---------------------------------------------------------------------------\n// FileManagerView — sets up DI container and renders the inner component.\n// ---------------------------------------------------------------------------\n\nexport const FileManagerView = (props: FileManagerViewProps) => {\n const container = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = container.createChildContainer();\n\n SharedCacheFeature.register(child);\n FoldersFeature.register(child, { type: \"FmFile\" });\n FolderTreePresenterFeature.register(child);\n ListFilesFeature.register(child);\n GetFileFeature.register(child);\n DeleteFileFeature.register(child);\n UpdateFileFeature.register(child);\n FileUploaderFeature.register(child);\n ListTagsFeature.register(child);\n GetSettingsFeature.register(child);\n FileDetailsPresenterFeature.register(child);\n FileManagerPresenterFeature.register(child);\n\n return child;\n }, []);\n\n return (\n <DiContainerProvider container={scopedContainer}>\n <FileManagerViewInner {...props} />\n </DiContainerProvider>\n );\n};\n"],"names":["t","i18n","FileManagerViewLayout","observer","vm","actions","useFileManagerPresenter","browser","useFileManagerConfig","overlay","useOverlay","toast","useToast","useHotkeys","container","useContainer","settingsRepository","useMemo","GetSettingsRepository","settings","uploadFiles","files","onError","useCallback","errors","message","outputFileSelectionError","console","loadMoreOnScroll","debounce","scrollFrame","OverlayLoader","renderList","browseFiles","Empty","ScrollArea","FileTable","FileGrid","content","BrowserFilePicker","getDropZoneProps","FileDetailsDrawer","SplitView","LeftPanel","Heading","Separator","FolderTree","TagsList","tag","tags","RightPanel","FileManagerHeader","e","BulkActionBar","FileDropPlaceholder","UploadProgress","BottomInfoBar","OverlayLayout","FileManagerViewInner","onChange","onClose","multiple","accept","scope","children","presenter","useFeature","FileManagerPresenterFeature","overlayConfig","handleFileClick","file","confirmSelection","selectedIds","selectedFiles","f","useEffect","inner","DialogsProvider","FileManagerViewWithConfig","FileManagerPresenterProvider","OverlayProvider","FileManagerView","props","scopedContainer","child","SharedCacheFeature","FoldersFeature","FolderTreePresenterFeature","ListFilesFeature","GetFileFeature","DeleteFileFeature","UpdateFileFeature","FileUploaderFeature","ListTagsFeature","GetSettingsFeature","FileDetailsPresenterFeature","DiContainerProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAMlB,MAAMC,wCAAwBC,SAAS;IACnC,MAAM,EAAEC,EAAE,EAAEC,OAAO,EAAE,GAAGC;IACxB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IACpB,MAAMC,UAAUC;IAChB,MAAMC,QAAQC;IAEdC,WAAW;QACP,QAAQ;QACR,MAAM;YACF,KAAK,IAAMJ,WAAWA,QAAQ,OAAO;QACzC;IACJ;IAEA,MAAMK,YAAYC;IAClB,MAAMC,qBAAqBC,QAAQ,IAAMH,UAAU,OAAO,CAACI,wBAAwB;QAACJ;KAAU;IAC9F,MAAMK,WAAWH,mBAAmB,QAAQ;IAE5C,MAAMI,cAAc,OAAOC;QACvB,MAAMhB,QAAQ,MAAM,CAACgB;QACrBV,MAAM,gBAAgB,CAAC;YAAE,OAAO;QAAwB;IAC5D;IAEA,MAAMW,UAAUC,YAAY,CAACC;QACzB,MAAMC,UAAUC,yBAAyBF;QACzC,IAAIC,SACAd,MAAM,gBAAgB,CAAC;YAAE,OAAOc;QAAQ;aACrC;YACHd,MAAM,gBAAgB,CAAC;gBAAE,OAAO;YAAmC;YACnEgB,QAAQ,KAAK,CAACH;QAClB;IACJ,GAAG,EAAE;IAEL,MAAMI,mBAAmBL,YACrBM,SAAS,OAAOC;QACZ,IAAIA,YAAY,GAAG,GAAG,KACbzB,QAAQ,QAAQ;IAE7B,GAAG,MACH;QAACD,GAAG,IAAI,CAAC,UAAU;QAAEC;KAAQ;IAGjC,IAAI,CAACD,GAAG,SAAS,EACb,OAAO,WAAP,GAAO,oBAAC2B,eAAaA;QAAC,MAAM/B,CAAC,CAAC,yBAAyB,CAAC;;IAG5D,MAAMgC,aAAa,CAACC;QAChB,IAAI7B,GAAG,O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;IAMjB,IAAII,eACA,OAAO,WAAP,GAAO,oBAACY,iBAAeA;QAAC,QAAQZ;OAAgBQ;IAGpD,OAAOA;AACX;AAOG,MAAMK,kBAAkB,CAACC;IAC5B,MAAMpE,YAAYC;IAElB,MAAMoE,kBAAkBlE,QAAQ;QAC5B,MAAMmE,QAAQtE,UAAU,oBAAoB;QAE5CuE,mBAAmB,QAAQ,CAACD;QAC5BE,eAAe,QAAQ,CAACF,OAAO;YAAE,MAAM;QAAS;QAChDG,2BAA2B,QAAQ,CAACH;QACpCI,iBAAiB,QAAQ,CAACJ;QAC1BK,eAAe,QAAQ,CAACL;QACxBM,kBAAkB,QAAQ,CAACN;QAC3BO,kBAAkB,QAAQ,CAACP;QAC3BQ,oBAAoB,QAAQ,CAACR;QAC7BS,gBAAgB,QAAQ,CAACT;QACzBU,mBAAmB,QAAQ,CAACV;QAC5BW,4BAA4B,QAAQ,CAACX;QACrCjB,4BAA4B,QAAQ,CAACiB;QAErC,OAAOA;IACX,GAAG,EAAE;IAEL,OAAO,WAAP,GACI,oBAACY,qBAAmBA;QAAC,WAAWb;qBAC5B,oBAACzB,sBAAyBwB;AAGtC"}
|
|
1
|
+
{"version":3,"file":"presentation/FileManager/FileManagerView.js","sources":["../../../src/presentation/FileManager/FileManagerView.tsx"],"sourcesContent":["import React, { useMemo, useEffect, useCallback } from \"react\";\nimport { DiContainerProvider, useContainer, useFeature } from \"@webiny/app\";\nimport { observer } from \"mobx-react-lite\";\nimport {\n BrowserFilePicker,\n type BrowserFilePickerRenderProps\n} from \"@webiny/app-admin/presentation/browserFilePicker/index.js\";\nimport debounce from \"lodash/debounce.js\";\nimport { Heading, OverlayLoader, ScrollArea, Separator, useToast } from \"@webiny/admin-ui\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport {\n LeftPanel,\n OverlayLayout,\n RightPanel,\n SplitView,\n DialogsProvider,\n useHotkeys\n} from \"@webiny/app-admin\";\nimport { FoldersFeature } from \"@webiny/app-aco/features/folders/feature.js\";\nimport { FolderTreePresenterFeature } from \"@webiny/app-aco/presentation/folderTree/feature.js\";\nimport { FileManagerPresenterFeature } from \"~/presentation/FileList/feature.js\";\nimport {\n FileManagerPresenterProvider,\n useFileManagerPresenter\n} from \"~/presentation/FileList/FileManagerPresenterProvider.js\";\nimport { FileDetailsPresenterFeature } from \"~/presentation/FileDetails/feature.js\";\nimport { SharedCacheFeature } from \"~/features/shared/feature.js\";\nimport { ListFilesFeature } from \"~/features/listFiles/feature.js\";\nimport { GetFileFeature } from \"~/features/getFile/feature.js\";\nimport { DeleteFileFeature } from \"~/features/deleteFile/feature.js\";\nimport { UpdateFileFeature } from \"~/features/updateFile/feature.js\";\nimport { FileUploaderFeature } from \"~/features/fileUploader/feature.js\";\nimport { ListTagsFeature } from \"~/features/tags/feature.js\";\nimport { GetSettingsFeature } from \"~/features/settings/feature.js\";\nimport {\n FileManagerViewWithConfig,\n useFileManagerConfig\n} from \"~/presentation/config/FileManagerViewConfig.js\";\nimport { FolderTree } from \"@webiny/app-aco/presentation/folderTree/FolderTree.js\";\nimport { BottomInfoBar } from \"~/presentation/FileList/components/BottomInfoBar/index.js\";\nimport { BulkActionBar } from \"~/presentation/FileList/components/BulkActions/index.js\";\nimport { FileDropPlaceholder } from \"~/presentation/FileList/components/FileDropPlaceholder/index.js\";\nimport { Empty } from \"~/presentation/FileList/components/Empty/index.js\";\nimport { FileDetailsDrawer } from \"~/presentation/FileDetails/components/FileDetailsDrawer.js\";\nimport { FileGrid } from \"~/presentation/FileList/components/Grid/index.js\";\nimport { FileManagerHeader } from \"~/presentation/FileList/components/Header/FileManagerHeader.js\";\nimport { FileTable } from \"~/presentation/FileList/components/Table/index.js\";\nimport { TagsList } from \"~/presentation/FileList/components/TagsList/index.js\";\nimport { UploadProgress } from \"~/presentation/FileList/components/Upload/index.js\";\nimport { GetSettingsRepository } from \"~/features/settings/abstractions.js\";\nimport { OverlayProvider, useOverlay } from \"./OverlayContext.js\";\nimport { RouteParamsSync } from \"./RouteParamsSync.js\";\nimport { FileManagerBreadcrumbs } from \"./FileManagerBreadcrumbs.js\";\n\nimport type { FmFile } from \"~/features/shared/types.js\";\nimport type {\n FileError,\n SelectedFile\n} from \"@webiny/app-admin/presentation/browserFilePicker/index.js\";\nimport { outputFileSelectionError } from \"~/presentation/FileManager/outputFileSelectionError.js\";\nimport type { ScrollPosition } from \"@webiny/admin-ui\";\n\nexport interface FileManagerViewProps {\n overlay?: boolean;\n onChange?: (files: FmFile[]) => void;\n onClose?: () => void;\n multiple?: boolean;\n accept?: string[];\n scope?: string;\n children?: React.ReactNode;\n}\n\nconst t = i18n.ns(\"app-admin/file-manager/file-manager-view\");\n\n// ---------------------------------------------------------------------------\n// Layout — uses original UI components, wired to the presenter.\n// ---------------------------------------------------------------------------\n\nconst FileManagerViewLayout = observer(function FileManagerViewLayout() {\n const { vm, actions } = useFileManagerPresenter();\n const { browser } = useFileManagerConfig();\n const overlay = useOverlay();\n const toast = useToast();\n\n useHotkeys({\n zIndex: 20,\n keys: {\n esc: () => overlay && overlay.onClose()\n }\n });\n\n const container = useContainer();\n const settingsRepository = useMemo(() => container.resolve(GetSettingsRepository), [container]);\n const settings = settingsRepository.settings;\n\n const uploadFiles = async (files: SelectedFile[]) => {\n await actions.upload(files);\n toast.showSuccessToast({ title: \"File upload complete.\" });\n };\n\n useEffect(() => {\n const handlePaste = (e: ClipboardEvent) => {\n const items = e.clipboardData?.items;\n if (!items) {\n return;\n }\n\n const files: SelectedFile[] = [];\n for (let i = 0; i < items.length; i++) {\n if (items[i].kind === \"file\") {\n const file = items[i].getAsFile();\n if (file) {\n const name =\n file.name && file.name !== \"image.png\"\n ? file.name\n : `pasted-${Date.now()}.${file.type.split(\"/\")[1] || \"png\"}`;\n\n files.push({\n id: String(Date.now()) + \"-\" + i,\n name,\n type: file.type,\n size: file.size,\n src: { file, base64: null }\n });\n }\n }\n }\n\n if (files.length > 0) {\n e.preventDefault();\n void uploadFiles(files);\n }\n };\n\n document.addEventListener(\"paste\", handlePaste);\n return () => document.removeEventListener(\"paste\", handlePaste);\n }, [actions]);\n\n const onError = useCallback((errors: FileError[]) => {\n const message = outputFileSelectionError(errors);\n if (message) {\n toast.showWarningToast({ title: message });\n } else {\n toast.showWarningToast({ title: \"Couldn't process selected files.\" });\n console.error(errors);\n }\n }, []);\n\n const loadMoreOnScroll = useCallback(\n debounce(async (scrollFrame: ScrollPosition) => {\n if (scrollFrame.top > 0.8) {\n void actions.loadMore();\n }\n }, 200),\n [vm.list.pagination, actions]\n );\n\n if (!vm.fileModel) {\n return <OverlayLoader text={t`Preparing File Manager...`} />;\n }\n\n const renderList = (browseFiles: BrowserFilePickerRenderProps[\"browseFiles\"]) => {\n if (vm.loading) {\n return <OverlayLoader text={t`Loading files...`} size={\"lg\"} />;\n }\n\n if (vm.empty) {\n return <Empty isSearchResult={!vm.showFolders} browseFiles={browseFiles} />;\n }\n\n if (vm.viewMode === \"table\") {\n return (\n <ScrollArea className={\"h-full\"} onScroll={loadMoreOnScroll}>\n <FileTable />\n </ScrollArea>\n );\n }\n\n return (\n <ScrollArea className={\"h-full\"} onScroll={loadMoreOnScroll}>\n <FileGrid />\n </ScrollArea>\n );\n };\n\n const content = (\n <BrowserFilePicker\n multiple\n maxSize={settings ? settings.uploadMaxFileSize + \"b\" : \"1TB\"}\n multipleMaxSize={\"1TB\"}\n accept={overlay?.accept ?? []}\n onSuccess={uploadFiles}\n onError={onError}\n >\n {({ getDropZoneProps, browseFiles }) => (\n <>\n <FileDetailsDrawer />\n <SplitView namespace={\"fm/file/list\"}>\n <LeftPanel span={2}>\n <div className={\"flex flex-col h-full\"}>\n <div className={\"py-sm px-md\"}>\n <Heading level={5}>{t`File Manager`}</Heading>\n </div>\n <Separator />\n <div className={\"shrink-0 overflow-y-auto max-h-[66vh]\"}>\n <FolderTree\n vm={vm.folders}\n actions={actions.folders}\n folderActions={browser.folder.actions}\n dropConfirmation={browser.folder.dropConfirmation}\n enableActions={true}\n enableCreate={true}\n />\n </div>\n {browser.filterByTags ? (\n <>\n <Separator />\n <div className={\"flex-1 overflow-y-auto min-h-0\"}>\n <TagsList\n loading={false}\n activeTags={\n (vm.list.filters[\"tags\"] as string[]) ?? []\n }\n tags={vm.tags.map(tag => ({\n tag: tag.tag,\n count: tag.count\n }))}\n onActivatedTagsChange={tags => {\n if (tags.length > 0) {\n actions.filter.set(\"tags\", tags);\n } else {\n actions.filter.clear(\"tags\");\n actions.filter.clear(\"tags_rule\");\n }\n }}\n />\n </div>\n </>\n ) : null}\n </div>\n </LeftPanel>\n <RightPanel span={10}>\n <div className={\"flex flex-col relative h-full overflow-hidden\"}>\n <FileManagerHeader browseFiles={browseFiles} />\n <div\n className={\"flex-1 min-h-0 overflow-hidden\"}\n {...getDropZoneProps({\n onDragEnter: () => actions.setDragging(true),\n onDrop: () => actions.setDragging(false),\n onDragLeave: (e: React.DragEvent) => {\n if (\n !e.relatedTarget ||\n !e.currentTarget.contains(e.relatedTarget as Node)\n ) {\n actions.setDragging(false);\n }\n }\n })}\n data-testid={\"fm-list-wrapper\"}\n >\n {!overlay && <BulkActionBar />}\n {renderList(browseFiles)}\n {vm.dragging && <FileDropPlaceholder />}\n <UploadProgress />\n </div>\n <BottomInfoBar\n accept={overlay?.accept ?? []}\n listing={vm.list.pagination.loadingMore}\n loading={vm.list.pagination.loading}\n totalCount={vm.list.pagination.totalCount}\n currentCount={vm.list.pagination.currentCount}\n />\n </div>\n </RightPanel>\n </SplitView>\n </>\n )}\n </BrowserFilePicker>\n );\n\n if (overlay) {\n return (\n <OverlayLayout variant={\"strong\"} onExited={() => overlay.onClose()}>\n {content}\n </OverlayLayout>\n );\n }\n\n return content;\n});\n\n// ---------------------------------------------------------------------------\n// Inner component that resolves the presenter from the scoped container.\n// ---------------------------------------------------------------------------\n\nconst FileManagerViewInner = observer(\n ({\n overlay = false,\n onChange,\n onClose,\n multiple,\n accept,\n scope,\n children\n }: FileManagerViewProps) => {\n const { presenter } = useFeature(FileManagerPresenterFeature);\n\n const overlayConfig = useMemo(() => {\n if (!overlay || !onChange || !onClose) {\n return null;\n }\n\n const handleFileClick = (file: FmFile) => {\n if (multiple) {\n presenter.actions.selection.toggle(file.id);\n } else {\n onChange([file]);\n }\n };\n\n const confirmSelection = () => {\n const selectedIds = presenter.vm.list.selection.selectedIds;\n const selectedFiles = presenter.vm.list.rows.filter(f => selectedIds.has(f.id));\n if (selectedFiles.length > 0) {\n onChange(selectedFiles);\n }\n };\n\n return {\n onFileClick: handleFileClick,\n confirmSelection,\n onClose,\n accept: accept ?? [],\n multiple: multiple ?? false\n };\n }, [overlay, onChange, onClose, multiple, accept]);\n\n useEffect(() => {\n presenter.init({ scope, accept: accept ?? undefined });\n return () => presenter.dispose();\n }, [presenter, overlay, scope]);\n\n const inner = (\n <DialogsProvider>\n <FileManagerViewWithConfig>\n <FileManagerPresenterProvider presenter={presenter}>\n <FileManagerViewLayout />\n {children}\n {!overlayConfig && <RouteParamsSync />}\n {!overlayConfig && <FileManagerBreadcrumbs />}\n </FileManagerPresenterProvider>\n </FileManagerViewWithConfig>\n </DialogsProvider>\n );\n\n if (overlayConfig) {\n return <OverlayProvider config={overlayConfig}>{inner}</OverlayProvider>;\n }\n\n return inner;\n }\n);\n\n// ---------------------------------------------------------------------------\n// FileManagerView — sets up DI container and renders the inner component.\n// ---------------------------------------------------------------------------\n\nexport const FileManagerView = (props: FileManagerViewProps) => {\n const container = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = container.createChildContainer();\n\n SharedCacheFeature.register(child);\n FoldersFeature.register(child, { type: \"FmFile\" });\n FolderTreePresenterFeature.register(child);\n ListFilesFeature.register(child);\n GetFileFeature.register(child);\n DeleteFileFeature.register(child);\n UpdateFileFeature.register(child);\n FileUploaderFeature.register(child);\n ListTagsFeature.register(child);\n GetSettingsFeature.register(child);\n FileDetailsPresenterFeature.register(child);\n FileManagerPresenterFeature.register(child);\n\n return child;\n }, []);\n\n return (\n <DiContainerProvider container={scopedContainer}>\n <FileManagerViewInner {...props} />\n </DiContainerProvider>\n );\n};\n"],"names":["t","i18n","FileManagerViewLayout","observer","vm","actions","useFileManagerPresenter","browser","useFileManagerConfig","overlay","useOverlay","toast","useToast","useHotkeys","container","useContainer","settingsRepository","useMemo","GetSettingsRepository","settings","uploadFiles","files","useEffect","handlePaste","e","items","i","file","name","Date","String","document","onError","useCallback","errors","message","outputFileSelectionError","console","loadMoreOnScroll","debounce","scrollFrame","OverlayLoader","renderList","browseFiles","Empty","ScrollArea","FileTable","FileGrid","content","BrowserFilePicker","getDropZoneProps","FileDetailsDrawer","SplitView","LeftPanel","Heading","Separator","FolderTree","TagsList","tag","tags","RightPanel","FileManagerHeader","BulkActionBar","FileDropPlaceholder","UploadProgress","BottomInfoBar","OverlayLayout","FileManagerViewInner","onChange","onClose","multiple","accept","scope","children","presenter","useFeature","FileManagerPresenterFeature","overlayConfig","handleFileClick","confirmSelection","selectedIds","selectedFiles","f","undefined","inner","DialogsProvider","FileManagerViewWithConfig","FileManagerPresenterProvider","RouteParamsSync","FileManagerBreadcrumbs","OverlayProvider","FileManagerView","props","scopedContainer","child","SharedCacheFeature","FoldersFeature","FolderTreePresenterFeature","ListFilesFeature","GetFileFeature","DeleteFileFeature","UpdateFileFeature","FileUploaderFeature","ListTagsFeature","GetSettingsFeature","FileDetailsPresenterFeature","DiContainerProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAMlB,MAAMC,wCAAwBC,SAAS;IACnC,MAAM,EAAEC,EAAE,EAAEC,OAAO,EAAE,GAAGC;IACxB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IACpB,MAAMC,UAAUC;IAChB,MAAMC,QAAQC;IAEdC,WAAW;QACP,QAAQ;QACR,MAAM;YACF,KAAK,IAAMJ,WAAWA,QAAQ,OAAO;QACzC;IACJ;IAEA,MAAMK,YAAYC;IAClB,MAAMC,qBAAqBC,QAAQ,IAAMH,UAAU,OAAO,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,oBAAC1B,sBAAyByB;AAGtC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { RouteParamsSync } from "@webiny/app/presentation/router/components/RouteParamsSync.js";
|
|
3
|
+
import { useFileManagerPresenter } from "../FileList/FileManagerPresenterProvider.js";
|
|
4
|
+
import { Routes } from "../../routes.js";
|
|
5
|
+
const RouteParamsSync_RouteParamsSync = ()=>{
|
|
6
|
+
const presenter = useFileManagerPresenter();
|
|
7
|
+
return /*#__PURE__*/ react.createElement(RouteParamsSync, {
|
|
8
|
+
route: Routes.List,
|
|
9
|
+
fields: (fields)=>[
|
|
10
|
+
fields.create({
|
|
11
|
+
param: "folderId",
|
|
12
|
+
read: ()=>presenter.vm.folders.currentFolderId ?? void 0,
|
|
13
|
+
write: (value)=>{
|
|
14
|
+
presenter.actions.folders.selectFolder(value ?? null);
|
|
15
|
+
}
|
|
16
|
+
}),
|
|
17
|
+
fields.create({
|
|
18
|
+
param: "search",
|
|
19
|
+
read: ()=>presenter.vm.list.search || void 0,
|
|
20
|
+
write: (value)=>{
|
|
21
|
+
if (value) presenter.actions.search.set(value);
|
|
22
|
+
else presenter.actions.search.clear();
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export { RouteParamsSync_RouteParamsSync as RouteParamsSync };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=RouteParamsSync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/FileManager/RouteParamsSync.js","sources":["../../../src/presentation/FileManager/RouteParamsSync.tsx"],"sourcesContent":["import React from \"react\";\nimport { RouteParamsSync as GenericRouteParamsSync } from \"@webiny/app/presentation/router/components/RouteParamsSync.js\";\nimport { useFileManagerPresenter } from \"~/presentation/FileList/FileManagerPresenterProvider.js\";\nimport { Routes } from \"~/routes.js\";\n\nexport const RouteParamsSync = () => {\n const presenter = useFileManagerPresenter();\n\n return (\n <GenericRouteParamsSync\n route={Routes.List}\n fields={fields => [\n fields.create<string>({\n param: \"folderId\",\n read: () => presenter.vm.folders.currentFolderId ?? undefined,\n write: value => {\n presenter.actions.folders.selectFolder(value ?? null);\n }\n }),\n fields.create<string>({\n param: \"search\",\n read: () => presenter.vm.list.search || undefined,\n write: value => {\n if (value) {\n presenter.actions.search.set(value);\n } else {\n presenter.actions.search.clear();\n }\n }\n })\n ]}\n />\n );\n};\n"],"names":["RouteParamsSync","presenter","useFileManagerPresenter","GenericRouteParamsSync","Routes","fields","undefined","value"],"mappings":";;;;AAKO,MAAMA,kCAAkB;IAC3B,MAAMC,YAAYC;IAElB,OAAO,WAAP,GACI,oBAACC,iBAAsBA;QACnB,OAAOC,OAAO,IAAI;QAClB,QAAQC,CAAAA,SAAU;gBACdA,OAAO,MAAM,CAAS;oBAClB,OAAO;oBACP,MAAM,IAAMJ,UAAU,EAAE,CAAC,OAAO,CAAC,eAAe,IAAIK;oBACpD,OAAOC,CAAAA;wBACHN,UAAU,OAAO,CAAC,OAAO,CAAC,YAAY,CAACM,SAAS;oBACpD;gBACJ;gBACAF,OAAO,MAAM,CAAS;oBAClB,OAAO;oBACP,MAAM,IAAMJ,UAAU,EAAE,CAAC,IAAI,CAAC,MAAM,IAAIK;oBACxC,OAAOC,CAAAA;wBACH,IAAIA,OACAN,UAAU,OAAO,CAAC,MAAM,CAAC,GAAG,CAACM;6BAE7BN,UAAU,OAAO,CAAC,MAAM,CAAC,KAAK;oBAEtC;gBACJ;aACH;;AAGb"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import react from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useFeatureFlags } from "@webiny/app-admin";
|
|
3
3
|
import { DeleteFolder, EditFolder, SetFolderPermissions } from "@webiny/app-aco";
|
|
4
4
|
import { FileManagerViewConfig } from "./FileManagerViewConfig.js";
|
|
5
5
|
import { FilterByType } from "../FileList/components/Filters/FilterByType.js";
|
|
6
|
-
import { BulkActionDelete,
|
|
6
|
+
import { BulkActionDelete, BulkActionMove } from "../FileList/components/BulkActions/index.js";
|
|
7
7
|
import { AccessControl, Tags } from "./fields/index.js";
|
|
8
8
|
import { CellActions, CellAuthor, CellCreated, CellModified, CellName, CellSize, CellType, CopyFile, DeleteFile, EditFile, MoveFile } from "../FileList/components/Table/index.js";
|
|
9
9
|
import { GridItemDefaultRenderer } from "./thumbnailRenderers/GridItemDefaultRenderer.js";
|
|
@@ -14,12 +14,19 @@ import { TableItemDefaultRenderer } from "./thumbnailRenderers/TableItemDefaultR
|
|
|
14
14
|
import { TableItemImageRenderer } from "./thumbnailRenderers/TableItemImageRenderer.js";
|
|
15
15
|
import { FilePreviewDefaultRenderer } from "./thumbnailRenderers/FilePreviewDefaultRenderer.js";
|
|
16
16
|
const { Browser: Browser, FileDetails: FileDetails } = FileManagerViewConfig;
|
|
17
|
+
const PrivateFilesBulkEditField = ()=>{
|
|
18
|
+
const featureFlags = useFeatureFlags();
|
|
19
|
+
if (!featureFlags.isEnabled("advancedAccessControlLayer.privateFiles")) return null;
|
|
20
|
+
return /*#__PURE__*/ react.createElement(Browser.BulkEditField, {
|
|
21
|
+
name: "accessControl",
|
|
22
|
+
element: /*#__PURE__*/ react.createElement(AccessControl, {
|
|
23
|
+
placeholder: "Select privacy settings"
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
};
|
|
17
27
|
const DefaultFileManagerConfig = ()=>/*#__PURE__*/ react.createElement(FileManagerViewConfig, null, /*#__PURE__*/ react.createElement(Browser.FilterByTags, null), /*#__PURE__*/ react.createElement(Browser.Filter, {
|
|
18
28
|
name: "type",
|
|
19
29
|
element: /*#__PURE__*/ react.createElement(FilterByType, null)
|
|
20
|
-
}), /*#__PURE__*/ react.createElement(Browser.BulkAction, {
|
|
21
|
-
name: "edit",
|
|
22
|
-
element: /*#__PURE__*/ react.createElement(BulkActionEdit, null)
|
|
23
30
|
}), /*#__PURE__*/ react.createElement(Browser.BulkAction, {
|
|
24
31
|
name: "move",
|
|
25
32
|
element: /*#__PURE__*/ react.createElement(BulkActionMove, null)
|
|
@@ -89,12 +96,7 @@ const DefaultFileManagerConfig = ()=>/*#__PURE__*/ react.createElement(FileManag
|
|
|
89
96
|
}), /*#__PURE__*/ react.createElement(Browser.BulkEditField, {
|
|
90
97
|
name: "tags",
|
|
91
98
|
element: /*#__PURE__*/ react.createElement(Tags, null)
|
|
92
|
-
}), /*#__PURE__*/ react.createElement(FileActions, null), /*#__PURE__*/ react.createElement(
|
|
93
|
-
name: "accessControl",
|
|
94
|
-
element: /*#__PURE__*/ react.createElement(AccessControl, {
|
|
95
|
-
placeholder: "Select privacy settings"
|
|
96
|
-
})
|
|
97
|
-
})), /*#__PURE__*/ react.createElement(Browser.Grid.Item.Thumbnail, {
|
|
99
|
+
}), /*#__PURE__*/ react.createElement(FileActions, null), /*#__PURE__*/ react.createElement(PrivateFilesBulkEditField, null), /*#__PURE__*/ react.createElement(Browser.Grid.Item.Thumbnail, {
|
|
98
100
|
type: "*/*",
|
|
99
101
|
element: /*#__PURE__*/ react.createElement(GridItemDefaultRenderer, null)
|
|
100
102
|
}), /*#__PURE__*/ react.createElement(Browser.Grid.Item.Thumbnail, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/DefaultFileManagerConfig.js","sources":["../../../src/presentation/config/DefaultFileManagerConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"presentation/config/DefaultFileManagerConfig.js","sources":["../../../src/presentation/config/DefaultFileManagerConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { useFeatureFlags } from \"@webiny/app-admin\";\nimport { DeleteFolder, EditFolder, SetFolderPermissions } from \"@webiny/app-aco\";\nimport { FileManagerViewConfig as FileManagerConfig } from \"~/presentation/config/FileManagerViewConfig.js\";\nimport { FilterByType } from \"~/presentation/FileList/components/Filters/FilterByType.js\";\nimport {\n BulkActionDelete,\n BulkActionMove\n} from \"~/presentation/FileList/components/BulkActions/index.js\";\nimport { Tags, AccessControl } from \"~/presentation/config/fields/index.js\";\nimport {\n CellActions,\n CellAuthor,\n CellCreated,\n CellModified,\n CellName,\n CellSize,\n CellType,\n CopyFile,\n DeleteFile,\n EditFile,\n MoveFile\n} from \"~/presentation/FileList/components/Table/index.js\";\nimport { GridItemDefaultRenderer } from \"~/presentation/config/thumbnailRenderers/GridItemDefaultRenderer.js\";\nimport { GridItemImageRenderer } from \"~/presentation/config/thumbnailRenderers/GridItemImageRenderer.js\";\nimport { FileActions } from \"~/presentation/FileActions/index.js\";\nimport { FilePreviewImageRenderer } from \"~/presentation/config/thumbnailRenderers/FilePreviewImageRenderer.js\";\nimport { TableItemDefaultRenderer } from \"~/presentation/config/thumbnailRenderers/TableItemDefaultRenderer.js\";\nimport { TableItemImageRenderer } from \"~/presentation/config/thumbnailRenderers/TableItemImageRenderer.js\";\nimport { FilePreviewDefaultRenderer } from \"~/presentation/config/thumbnailRenderers/FilePreviewDefaultRenderer.js\";\n\nconst { Browser, FileDetails } = FileManagerConfig;\n\nconst PrivateFilesBulkEditField = () => {\n const featureFlags = useFeatureFlags();\n if (!featureFlags.isEnabled(\"advancedAccessControlLayer.privateFiles\")) {\n return null;\n }\n return (\n <Browser.BulkEditField\n name={\"accessControl\"}\n element={<AccessControl placeholder={\"Select privacy settings\"} />}\n />\n );\n};\n\nexport const DefaultFileManagerConfig = () => {\n return (\n <FileManagerConfig>\n {/* Filters */}\n <Browser.FilterByTags />\n <Browser.Filter name={\"type\"} element={<FilterByType />} />\n {/* Bulk Actions */}\n <Browser.BulkAction name={\"move\"} element={<BulkActionMove />} />\n <Browser.BulkAction name={\"delete\"} element={<BulkActionDelete />} />\n {/* Folder Actions */}\n <Browser.Folder.Action name={\"edit\"} element={<EditFolder />} />\n <Browser.Folder.Action name={\"permissions\"} element={<SetFolderPermissions />} />\n <Browser.Folder.Action name={\"delete\"} element={<DeleteFolder />} />\n {/* File Actions */}\n <Browser.File.Action name={\"copy\"} element={<CopyFile />} />\n <Browser.File.Action name={\"edit\"} element={<EditFile />} />\n <Browser.File.Action name={\"move\"} element={<MoveFile />} />\n <Browser.File.Action name={\"delete\"} element={<DeleteFile />} />\n {/* Table Columns */}\n <Browser.Table.Column\n name={\"name\"}\n header={\"Name\"}\n cell={<CellName />}\n sortable={true}\n hideable={false}\n size={200}\n />\n <Browser.Table.Column name={\"type\"} header={\"Type\"} cell={<CellType />} />\n <Browser.Table.Column\n name={\"size\"}\n header={\"Size\"}\n cell={<CellSize />}\n sortable={true}\n />\n <Browser.Table.Column name={\"createdBy\"} header={\"Author\"} cell={<CellAuthor />} />\n <Browser.Table.Column\n name={\"createdOn\"}\n header={\"Created\"}\n cell={<CellCreated />}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"savedOn\"}\n header={\"Modified\"}\n cell={<CellModified />}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"actions\"}\n header={\" \"}\n cell={<CellActions />}\n size={56}\n truncate={false}\n className={\"flex justify-center\"}\n hideable={false}\n resizable={false}\n />\n <Browser.BulkEditField name={\"tags\"} element={<Tags />} />\n {/* File Details Actions */}\n <FileActions />\n {/* Access Control */}\n <PrivateFilesBulkEditField />\n {/* Grid Thumbnail */}\n <Browser.Grid.Item.Thumbnail type={\"*/*\"} element={<GridItemDefaultRenderer />} />\n <Browser.Grid.Item.Thumbnail type={\"image/*\"} element={<GridItemImageRenderer />} />\n {/* Table Thumbnail */}\n <Browser.Table.Cell.Thumbnail type={\"image/*\"} element={<TableItemImageRenderer />} />\n <Browser.Table.Cell.Thumbnail type={\"*/*\"} element={<TableItemDefaultRenderer />} />\n {/* File Details Thumbnail */}\n <FileDetails.Preview.Thumbnail type={\"*/*\"} element={<FilePreviewDefaultRenderer />} />\n <FileDetails.Preview.Thumbnail\n type={\"image/*\"}\n element={<FilePreviewImageRenderer />}\n />\n </FileManagerConfig>\n );\n};\n"],"names":["Browser","FileDetails","FileManagerConfig","PrivateFilesBulkEditField","featureFlags","useFeatureFlags","AccessControl","DefaultFileManagerConfig","FilterByType","BulkActionMove","BulkActionDelete","EditFolder","SetFolderPermissions","DeleteFolder","CopyFile","EditFile","MoveFile","DeleteFile","CellName","CellType","CellSize","CellAuthor","CellCreated","CellModified","CellActions","Tags","FileActions","GridItemDefaultRenderer","GridItemImageRenderer","TableItemImageRenderer","TableItemDefaultRenderer","FilePreviewDefaultRenderer","FilePreviewImageRenderer"],"mappings":";;;;;;;;;;;;;;;AA+BA,MAAM,EAAEA,SAAAA,OAAO,EAAEC,aAAAA,WAAW,EAAE,GAAGC;AAEjC,MAAMC,4BAA4B;IAC9B,MAAMC,eAAeC;IACrB,IAAI,CAACD,aAAa,SAAS,CAAC,4CACxB,OAAO;IAEX,OAAO,WAAP,GACI,oBAACJ,QAAQ,aAAa;QAClB,MAAM;QACN,uBAAS,oBAACM,eAAaA;YAAC,aAAa;;;AAGjD;AAEO,MAAMC,2BAA2B,IAC7B,WAAP,GACI,oBAACL,uBAAiBA,MAAAA,WAAAA,GAEd,oBAACF,QAAQ,YAAY,uBACrB,oBAACA,QAAQ,MAAM;QAAC,MAAM;QAAQ,uBAAS,oBAACQ,cAAYA;sBAEpD,oBAACR,QAAQ,UAAU;QAAC,MAAM;QAAQ,uBAAS,oBAACS,gBAAcA;sBAC1D,oBAACT,QAAQ,UAAU;QAAC,MAAM;QAAU,uBAAS,oBAACU,kBAAgBA;sBAE9D,oBAACV,QAAQ,MAAM,CAAC,MAAM;QAAC,MAAM;QAAQ,uBAAS,oBAACW,YAAUA;sBACzD,oBAACX,QAAQ,MAAM,CAAC,MAAM;QAAC,MAAM;QAAe,uBAAS,oBAACY,sBAAoBA;sBAC1E,oBAACZ,QAAQ,MAAM,CAAC,MAAM;QAAC,MAAM;QAAU,uBAAS,oBAACa,cAAYA;sBAE7D,oBAACb,QAAQ,IAAI,CAAC,MAAM;QAAC,MAAM;QAAQ,uBAAS,oBAACc,UAAQA;sBACrD,oBAACd,QAAQ,IAAI,CAAC,MAAM;QAA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E,oBAAC3B,QAAQ,IAAI,CAAC,IAAI,CAAC,SAAS;QAAC,MAAM;QAAW,uBAAS,oBAAC4B,uBAAqBA;sBAE7E,oBAAC5B,QAAQ,KAAK,CAAC,IAAI,CAAC,SAAS;QAAC,MAAM;QAAW,uBAAS,oBAAC6B,wBAAsBA;sBAC/E,oBAAC7B,QAAQ,KAAK,CAAC,IAAI,CAAC,SAAS;QAAC,MAAM;QAAO,uBAAS,oBAAC8B,0BAAwBA;sBAE7E,oBAAC7B,YAAY,OAAO,CAAC,SAAS;QAAC,MAAM;QAAO,uBAAS,oBAAC8B,4BAA0BA;sBAChF,oBAAC9B,YAAY,OAAO,CAAC,SAAS;QAC1B,MAAM;QACN,uBAAS,oBAAC+B,0BAAwBA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { getThumbnailRenderer } from "./getThumbnailRenderer.js";
|
|
2
3
|
export declare const FileManagerViewConfig: (({ priority, children }: import("@webiny/react-properties").ConfigProps) => React.JSX.Element) & {
|
|
3
4
|
Browser: {
|
|
4
5
|
Grid: {
|
|
@@ -59,11 +60,11 @@ export declare const FileManagerViewConfig: (({ priority, children }: import("@w
|
|
|
59
60
|
displayName: string;
|
|
60
61
|
}>) => (props: unknown) => React.JSX.Element;
|
|
61
62
|
} & {
|
|
62
|
-
IconButton:
|
|
63
|
+
IconButton: typeof import("../FileList/components/Grid/ActionButton.js").ActionButton;
|
|
63
64
|
};
|
|
64
65
|
};
|
|
65
66
|
};
|
|
66
|
-
BulkAction:
|
|
67
|
+
BulkAction: typeof import("./configComponents/Browser/BulkAction.js").BaseBulkAction & {
|
|
67
68
|
useButtons: () => import("@webiny/app-admin/components/Buttons/useButtons.js").ButtonsProviderContext;
|
|
68
69
|
useWorker: () => {
|
|
69
70
|
items: import("@webiny/sdk/index.js").FmFile[];
|
|
@@ -74,7 +75,7 @@ export declare const FileManagerViewConfig: (({ priority, children }: import("@w
|
|
|
74
75
|
};
|
|
75
76
|
useDialog: () => import("@webiny/app-admin/index.js").UseDialogWithReportResponse;
|
|
76
77
|
};
|
|
77
|
-
BulkEditField:
|
|
78
|
+
BulkEditField: typeof import("./configComponents/Browser/BulkEditField.js").BulkEditField;
|
|
78
79
|
Filter: (({ name, element, after, before, remove }: import("./configComponents/Browser/Filter.js").FilterProps) => React.JSX.Element) & {
|
|
79
80
|
original: ({ name, element, after, before, remove }: import("./configComponents/Browser/Filter.js").FilterProps) => React.JSX.Element;
|
|
80
81
|
originalName: string;
|
|
@@ -102,18 +103,13 @@ export declare const FileManagerViewConfig: (({ priority, children }: import("@w
|
|
|
102
103
|
name: string;
|
|
103
104
|
}) => React.JSX.Element;
|
|
104
105
|
};
|
|
105
|
-
FiltersToWhere: (
|
|
106
|
-
|
|
107
|
-
}) => React.JSX.Element;
|
|
108
|
-
FilterByTags: ({ remove }: import("./configComponents/Browser/FilterByTags.js").FilterByTagProps) => React.JSX.Element;
|
|
106
|
+
FiltersToWhere: typeof import("./configComponents/Browser/FiltersToWhere.js").FiltersToWhere;
|
|
107
|
+
FilterByTags: typeof import("./configComponents/Browser/FilterByTags.js").FilterByTags;
|
|
109
108
|
Folder: {
|
|
110
|
-
ExtensionField: {
|
|
111
|
-
createDecorator: (decorator: import("@webiny/react-composition").Decorator<import("@webiny/react-composition").GenericComponent<import("@webiny/app-aco").FieldProps>>) => (props: import("@webiny/app-aco").FieldDecoratorProps) => React.JSX.Element;
|
|
112
|
-
};
|
|
113
109
|
Action: ((props: import("@webiny/app-aco/config/folder/Action.js").ActionProps) => React.JSX.Element) & {
|
|
114
110
|
OptionsMenuItem: (props: import("@webiny/app-admin/index.js").OptionsMenuItemProps) => React.JSX.Element;
|
|
115
111
|
};
|
|
116
|
-
DropConfirmation:
|
|
112
|
+
DropConfirmation: typeof import("./configComponents/Browser/FolderDropConfirmation.js").FolderDropConfirmation;
|
|
117
113
|
};
|
|
118
114
|
File: {
|
|
119
115
|
Action: ((props: import("@webiny/app-aco/config/record/Action.js").ActionProps) => React.JSX.Element) & {
|
|
@@ -122,28 +118,28 @@ export declare const FileManagerViewConfig: (({ priority, children }: import("@w
|
|
|
122
118
|
};
|
|
123
119
|
};
|
|
124
120
|
Table: {
|
|
125
|
-
Column: ((props: import("@webiny/app-
|
|
126
|
-
original: (props: import("@webiny/app-
|
|
121
|
+
Column: ((props: import("@webiny/app-admin/config/table/Column.js").ColumnProps) => React.JSX.Element) & {
|
|
122
|
+
original: (props: import("@webiny/app-admin/config/table/Column.js").ColumnProps) => React.JSX.Element;
|
|
127
123
|
originalName: string;
|
|
128
124
|
displayName: string;
|
|
129
125
|
} & {
|
|
130
|
-
original: ((props: import("@webiny/app-
|
|
131
|
-
original: (props: import("@webiny/app-
|
|
126
|
+
original: ((props: import("@webiny/app-admin/config/table/Column.js").ColumnProps) => React.JSX.Element) & {
|
|
127
|
+
original: (props: import("@webiny/app-admin/config/table/Column.js").ColumnProps) => React.JSX.Element;
|
|
132
128
|
originalName: string;
|
|
133
129
|
displayName: string;
|
|
134
130
|
};
|
|
135
131
|
originalName: string;
|
|
136
132
|
displayName: string;
|
|
137
133
|
} & {
|
|
138
|
-
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<((props: import("@webiny/app-
|
|
139
|
-
original: (props: import("@webiny/app-
|
|
134
|
+
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<((props: import("@webiny/app-admin/config/table/Column.js").ColumnProps) => React.JSX.Element) & {
|
|
135
|
+
original: (props: import("@webiny/app-admin/config/table/Column.js").ColumnProps) => React.JSX.Element;
|
|
140
136
|
originalName: string;
|
|
141
137
|
displayName: string;
|
|
142
138
|
}>) => (props: unknown) => React.JSX.Element;
|
|
143
139
|
} & {
|
|
144
140
|
useTableRow: {
|
|
145
|
-
(): import("@webiny/app-
|
|
146
|
-
<TUserRow>(): import("@webiny/app-
|
|
141
|
+
(): import("@webiny/app-admin/index.js").TableRowContextData<import("../../domain/types.js").TableItem>;
|
|
142
|
+
<TUserRow>(): import("@webiny/app-admin/index.js").TableRowContextData<import("../../domain/types.js").TableItem & {
|
|
147
143
|
data: TUserRow;
|
|
148
144
|
}>;
|
|
149
145
|
};
|
|
@@ -192,7 +188,7 @@ export declare const FileManagerViewConfig: (({ priority, children }: import("@w
|
|
|
192
188
|
displayName: string;
|
|
193
189
|
}>) => (props: unknown) => React.JSX.Element;
|
|
194
190
|
} & {
|
|
195
|
-
Button:
|
|
191
|
+
Button: typeof import("../FileDetails/components/ActionButton.js").ActionButton;
|
|
196
192
|
};
|
|
197
193
|
Preview: {
|
|
198
194
|
Thumbnail: (({ type, element }: import("./configComponents/FileDetails/Thumbnail.js").RendererProps) => React.JSX.Element) & {
|
|
@@ -215,18 +211,16 @@ export declare const FileManagerViewConfig: (({ priority, children }: import("@w
|
|
|
215
211
|
}>) => (props: unknown) => React.JSX.Element;
|
|
216
212
|
};
|
|
217
213
|
};
|
|
218
|
-
Width:
|
|
214
|
+
Width: typeof import("./configComponents/FileDetails/Width.js").Width;
|
|
219
215
|
};
|
|
220
216
|
};
|
|
221
217
|
export declare const FileManagerViewWithConfig: ({ onProperties, children }: import("@webiny/react-properties").WithConfigProps) => React.JSX.Element;
|
|
222
218
|
export declare function useFileManagerConfig(): {
|
|
223
|
-
getThumbnailRenderer:
|
|
224
|
-
type: string;
|
|
225
|
-
}>(renderers: T[], file: import("../../domain/types.js").FileItem) => T;
|
|
219
|
+
getThumbnailRenderer: typeof getThumbnailRenderer;
|
|
226
220
|
browser: {
|
|
227
221
|
table: {
|
|
228
|
-
cellThumbnails: import("./configComponents/Browser/Table/Thumbnail.js").ThumbnailConfig[];
|
|
229
222
|
columns: import("@webiny/app-aco").TableColumnConfig[];
|
|
223
|
+
cellThumbnails: import("./configComponents/Browser/Table/Thumbnail.js").ThumbnailConfig[];
|
|
230
224
|
};
|
|
231
225
|
grid: {
|
|
232
226
|
itemActions: import("./configComponents/Browser/Grid/Action.js").ActionConfig[];
|
|
@@ -13,14 +13,16 @@ export interface BulkActionProps {
|
|
|
13
13
|
element?: React.ReactElement;
|
|
14
14
|
}
|
|
15
15
|
export declare const BaseBulkAction: ({ name, after, before, remove, element }: BulkActionProps) => React.JSX.Element;
|
|
16
|
-
|
|
16
|
+
declare const useWorker: () => {
|
|
17
|
+
items: import("@webiny/sdk/index").FmFile[];
|
|
18
|
+
process: (callback: (items: FileItem[]) => void) => void;
|
|
19
|
+
processInSeries: (callback: ({ item, allItems, report }: CallbackParams<FileItem>) => Promise<void>, chunkSize?: number) => Promise<void>;
|
|
20
|
+
resetItems: () => void;
|
|
21
|
+
results: import("@webiny/app-admin").Result[];
|
|
22
|
+
};
|
|
23
|
+
export declare const BulkAction: typeof BaseBulkAction & {
|
|
17
24
|
useButtons: () => import("@webiny/app-admin/components/Buttons/useButtons").ButtonsProviderContext;
|
|
18
|
-
useWorker:
|
|
19
|
-
items: import("@webiny/sdk/index").FmFile[];
|
|
20
|
-
process: (callback: (items: FileItem[]) => void) => void;
|
|
21
|
-
processInSeries: (callback: ({ item, allItems, report }: CallbackParams<FileItem>) => Promise<void>, chunkSize?: number) => Promise<void>;
|
|
22
|
-
resetItems: () => void;
|
|
23
|
-
results: import("@webiny/app-admin").Result[];
|
|
24
|
-
};
|
|
25
|
+
useWorker: typeof useWorker;
|
|
25
26
|
useDialog: () => import("@webiny/app-admin").UseDialogWithReportResponse;
|
|
26
27
|
};
|
|
28
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import react, { useCallback,
|
|
1
|
+
import react, { useCallback, useRef } from "react";
|
|
2
2
|
import { Worker, useButtons, useDialogWithReport } from "@webiny/app-admin";
|
|
3
3
|
import { Property, useIdGenerator } from "@webiny/react-properties";
|
|
4
4
|
import { useFileManagerPresenter } from "../../../FileList/FileManagerPresenterProvider.js";
|
|
@@ -30,19 +30,13 @@ const useWorker = ()=>{
|
|
|
30
30
|
const { vm, actions } = useFileManagerPresenter();
|
|
31
31
|
const { current: worker } = useRef(new Worker());
|
|
32
32
|
const selected = vm.list.rows.filter((f)=>vm.list.selection.selectedIds.has(f.id));
|
|
33
|
-
useEffect(()=>{
|
|
34
|
-
worker.items = selected;
|
|
35
|
-
}, [
|
|
36
|
-
selected.length
|
|
37
|
-
]);
|
|
38
33
|
const resetItems = useCallback(()=>{
|
|
39
|
-
worker.items = [];
|
|
40
34
|
actions.selection.deselectAll();
|
|
41
35
|
}, []);
|
|
42
36
|
return {
|
|
43
37
|
items: selected,
|
|
44
|
-
process: (callback)=>worker.process(callback),
|
|
45
|
-
processInSeries: async (callback, chunkSize)=>worker.processInSeries(callback, chunkSize),
|
|
38
|
+
process: (callback)=>worker.process(selected, callback),
|
|
39
|
+
processInSeries: async (callback, chunkSize)=>worker.processInSeries(selected, callback, chunkSize),
|
|
46
40
|
resetItems: resetItems,
|
|
47
41
|
results: worker.results
|
|
48
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation/config/configComponents/Browser/BulkAction.js","sources":["../../../../../src/presentation/config/configComponents/Browser/BulkAction.tsx"],"sourcesContent":["import React, { useCallback,
|
|
1
|
+
{"version":3,"file":"presentation/config/configComponents/Browser/BulkAction.js","sources":["../../../../../src/presentation/config/configComponents/Browser/BulkAction.tsx"],"sourcesContent":["import React, { useCallback, useRef } from \"react\";\nimport type { CallbackParams } from \"@webiny/app-admin\";\nimport { useButtons, useDialogWithReport, Worker } from \"@webiny/app-admin\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport { useFileManagerPresenter } from \"~/presentation/FileList/FileManagerPresenterProvider.js\";\nimport type { FileItem } from \"~/domain/types.js\";\n\nexport interface BulkActionConfig {\n name: string;\n element: React.ReactElement;\n}\n\nexport interface BulkActionProps {\n name: string;\n remove?: boolean;\n before?: string;\n after?: string;\n element?: React.ReactElement;\n}\n\nexport const BaseBulkAction = ({\n name,\n after = undefined,\n before = undefined,\n remove = false,\n element\n}: BulkActionProps) => {\n const getId = useIdGenerator(\"bulkAction\");\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n return (\n <Property id=\"browser\" name={\"browser\"}>\n <Property\n id={getId(name)}\n name={\"bulkActions\"}\n remove={remove}\n array={true}\n before={placeBefore}\n after={placeAfter}\n >\n <Property id={getId(name, \"name\")} name={\"name\"} value={name} />\n {element ? (\n <Property id={getId(name, \"element\")} name={\"element\"} value={element} />\n ) : null}\n </Property>\n </Property>\n );\n};\n\nconst useWorker = () => {\n const { vm, actions } = useFileManagerPresenter();\n const { current: worker } = useRef(new Worker<FileItem>());\n\n const selected = vm.list.rows.filter(f => vm.list.selection.selectedIds.has(f.id));\n\n const resetItems = useCallback(() => {\n actions.selection.deselectAll();\n }, []);\n\n return {\n items: selected,\n process: (callback: (items: FileItem[]) => void) => worker.process(selected, callback),\n processInSeries: async (\n callback: ({ item, allItems, report }: CallbackParams<FileItem>) => Promise<void>,\n chunkSize?: number\n ) => worker.processInSeries(selected, callback, chunkSize),\n resetItems: resetItems,\n results: worker.results\n };\n};\n\nexport const BulkAction = Object.assign(BaseBulkAction, {\n useButtons,\n useWorker,\n useDialog: useDialogWithReport\n});\n"],"names":["BaseBulkAction","name","after","before","remove","element","getId","useIdGenerator","placeAfter","undefined","placeBefore","Property","useWorker","vm","actions","useFileManagerPresenter","worker","useRef","Worker","selected","f","resetItems","useCallback","callback","chunkSize","BulkAction","Object","useButtons","useDialogWithReport"],"mappings":";;;;AAoBO,MAAMA,iBAAiB,CAAC,EAC3BC,IAAI,EACJC,KAAiB,EACjBC,MAAkB,EAClBC,SAAS,KAAK,EACdC,OAAO,EACO;IACd,MAAMC,QAAQC,eAAe;IAE7B,MAAMC,aAAaN,AAAUO,WAAVP,QAAsBI,MAAMJ,SAASO;IACxD,MAAMC,cAAcP,AAAWM,WAAXN,SAAuBG,MAAMH,UAAUM;IAE3D,OAAO,WAAP,GACI,oBAACE,UAAQA;QAAC,IAAG;QAAU,MAAM;qBACzB,oBAACA,UAAQA;QACL,IAAIL,MAAML;QACV,MAAM;QACN,QAAQG;QACR,OAAO;QACP,QAAQM;QACR,OAAOF;qBAEP,oBAACG,UAAQA;QAAC,IAAIL,MAAML,MAAM;QAAS,MAAM;QAAQ,OAAOA;QACvDI,UAAU,WAAVA,GACG,oBAACM,UAAQA;QAAC,IAAIL,MAAML,MAAM;QAAY,MAAM;QAAW,OAAOI;SAC9D;AAIpB;AAEA,MAAMO,YAAY;IACd,MAAM,EAAEC,EAAE,EAAEC,OAAO,EAAE,GAAGC;IACxB,MAAM,EAAE,SAASC,MAAM,EAAE,GAAGC,OAAO,IAAIC;IAEvC,MAAMC,WAAWN,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAACO,CAAAA,IAAKP,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAACO,EAAE,EAAE;IAEhF,MAAMC,aAAaC,YAAY;QAC3BR,QAAQ,SAAS,CAAC,WAAW;IACjC,GAAG,EAAE;IAEL,OAAO;QACH,OAAOK;QACP,SAAS,CAACI,WAA0CP,OAAO,OAAO,CAACG,UAAUI;QAC7E,iBAAiB,OACbA,UACAC,YACCR,OAAO,eAAe,CAACG,UAAUI,UAAUC;QAChD,YAAYH;QACZ,SAASL,OAAO,OAAO;IAC3B;AACJ;AAEO,MAAMS,aAAaC,OAAO,MAAM,CAAC1B,gBAAgB;IACpD2B,YAAUA;IACVf,WAAAA;IACA,WAAWgB;AACf"}
|
|
@@ -2,7 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { AcoConfig, type RecordActionConfig } from "@webiny/app-aco";
|
|
3
3
|
export type { RecordActionConfig as FileActionConfig };
|
|
4
4
|
type FileActionProps = React.ComponentProps<typeof AcoConfig.Record.Action>;
|
|
5
|
-
|
|
5
|
+
declare const BaseFileAction: (props: FileActionProps) => React.JSX.Element;
|
|
6
|
+
export declare const FileAction: typeof BaseFileAction & {
|
|
6
7
|
OptionsMenuItem: (props: import("@webiny/app-admin/components").OptionsMenuItemProps) => React.JSX.Element;
|
|
7
8
|
OptionsMenuLink: (props: import("@webiny/app-admin/components").OptionsMenuLinkProps) => React.JSX.Element;
|
|
8
9
|
};
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { AcoConfig, type FolderActionConfig } from "@webiny/app-aco";
|
|
3
3
|
export type { FolderActionConfig };
|
|
4
4
|
type FolderActionProps = React.ComponentProps<typeof AcoConfig.Folder.Action>;
|
|
5
|
-
|
|
5
|
+
declare const BaseFolderAction: (props: FolderActionProps) => React.JSX.Element;
|
|
6
|
+
export declare const FolderAction: typeof BaseFolderAction & {
|
|
6
7
|
OptionsMenuItem: (props: import("@webiny/app-admin/components").OptionsMenuItemProps) => React.JSX.Element;
|
|
7
8
|
};
|
|
@@ -3,28 +3,29 @@ import { AcoConfig, type TableColumnConfig as ColumnConfig } from "@webiny/app-a
|
|
|
3
3
|
import type { TableItem } from "../../../../../domain/types.js";
|
|
4
4
|
export type { ColumnConfig };
|
|
5
5
|
type ColumnProps = React.ComponentProps<typeof AcoConfig.Table.Column>;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
declare const BaseColumnComponent: (props: ColumnProps) => React.JSX.Element;
|
|
7
|
+
export declare const Column: typeof BaseColumnComponent & {
|
|
8
|
+
original: typeof BaseColumnComponent;
|
|
8
9
|
originalName: string;
|
|
9
10
|
displayName: string;
|
|
10
11
|
} & {
|
|
11
|
-
original:
|
|
12
|
-
original:
|
|
12
|
+
original: typeof BaseColumnComponent & {
|
|
13
|
+
original: typeof BaseColumnComponent;
|
|
13
14
|
originalName: string;
|
|
14
15
|
displayName: string;
|
|
15
16
|
};
|
|
16
17
|
originalName: string;
|
|
17
18
|
displayName: string;
|
|
18
19
|
} & {
|
|
19
|
-
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<
|
|
20
|
-
original:
|
|
20
|
+
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<typeof BaseColumnComponent & {
|
|
21
|
+
original: typeof BaseColumnComponent;
|
|
21
22
|
originalName: string;
|
|
22
23
|
displayName: string;
|
|
23
24
|
}>) => (props: unknown) => React.JSX.Element;
|
|
24
25
|
} & {
|
|
25
26
|
useTableRow: {
|
|
26
|
-
(): import("@webiny/app-
|
|
27
|
-
<TUserRow>(): import("@webiny/app-
|
|
27
|
+
(): import("@webiny/app-admin/components").TableRowContextData<TableItem>;
|
|
28
|
+
<TUserRow>(): import("@webiny/app-admin/components").TableRowContextData<TableItem & {
|
|
28
29
|
data: TUserRow;
|
|
29
30
|
}>;
|
|
30
31
|
};
|