@webiny/app-file-manager 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.f6dc066313
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/BatchFileUploader.d.ts +2 -2
- package/BatchFileUploader.js.map +1 -1
- package/README.md +7 -28
- package/app.js +7 -6
- package/app.js.map +1 -1
- package/components/BottomInfoBar/BottomInfoBar.d.ts +2 -2
- package/components/BottomInfoBar/BottomInfoBar.js +5 -5
- package/components/BottomInfoBar/BottomInfoBar.js.map +1 -1
- package/components/BottomInfoBar/ListStatus.js +3 -3
- package/components/BottomInfoBar/ListStatus.js.map +1 -1
- package/components/BottomInfoBar/SupportedFileTypes.d.ts +1 -2
- package/components/BottomInfoBar/SupportedFileTypes.js +5 -6
- package/components/BottomInfoBar/SupportedFileTypes.js.map +1 -1
- package/components/BottomInfoBar/index.d.ts +1 -1
- package/components/BottomInfoBar/index.js +1 -1
- package/components/BottomInfoBar/index.js.map +1 -1
- package/components/BulkActions/ActionDelete.js +4 -4
- package/components/BulkActions/ActionDelete.js.map +1 -1
- package/components/BulkActions/ActionEdit/ActionEdit.js +5 -5
- package/components/BulkActions/ActionEdit/ActionEdit.js.map +1 -1
- package/components/BulkActions/ActionEdit/ActionEdit.types.d.ts +1 -1
- package/components/BulkActions/ActionEdit/ActionEdit.types.js.map +1 -1
- package/components/BulkActions/ActionEdit/ActionEditPresenter.d.ts +1 -1
- package/components/BulkActions/ActionEdit/ActionEditPresenter.js +1 -1
- package/components/BulkActions/ActionEdit/ActionEditPresenter.js.map +1 -1
- package/components/BulkActions/ActionEdit/ActionEditPresenter.test.js +6 -5
- package/components/BulkActions/ActionEdit/ActionEditPresenter.test.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/AddOperation.js +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/AddOperation.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditor.d.ts +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditor.js +4 -5
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditor.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialog.d.ts +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialog.js +5 -3
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialog.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.d.ts +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.js +2 -2
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.test.js +6 -5
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.test.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/FieldRenderer.d.ts +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/FieldRenderer.js +3 -3
- package/components/BulkActions/ActionEdit/BatchEditorDialog/FieldRenderer.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/Operation.d.ts +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/Operation.js +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/Operation.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/index.d.ts +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/index.js +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/index.js.map +1 -1
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.d.ts +15 -10
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.js +3 -3
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.js.map +1 -1
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.test.js +4 -4
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.test.js.map +1 -1
- package/components/BulkActions/ActionEdit/domain/BatchMapper.d.ts +1 -1
- package/components/BulkActions/ActionEdit/domain/BatchMapper.js.map +1 -1
- package/components/BulkActions/ActionEdit/domain/Field.d.ts +1 -1
- package/components/BulkActions/ActionEdit/domain/Field.js +1 -1
- package/components/BulkActions/ActionEdit/domain/Field.js.map +1 -1
- package/components/BulkActions/ActionEdit/domain/FieldMapper.d.ts +1 -1
- package/components/BulkActions/ActionEdit/domain/FieldMapper.js.map +1 -1
- package/components/BulkActions/ActionEdit/domain/index.d.ts +4 -4
- package/components/BulkActions/ActionEdit/domain/index.js +4 -4
- package/components/BulkActions/ActionEdit/domain/index.js.map +1 -1
- package/components/BulkActions/ActionEdit/index.d.ts +1 -1
- package/components/BulkActions/ActionEdit/index.js +1 -1
- package/components/BulkActions/ActionEdit/index.js.map +1 -1
- package/components/BulkActions/ActionEdit/useActionEditWorker.d.ts +2 -2
- package/components/BulkActions/ActionEdit/useActionEditWorker.js +6 -6
- package/components/BulkActions/ActionEdit/useActionEditWorker.js.map +1 -1
- package/components/BulkActions/ActionMove.js +4 -4
- package/components/BulkActions/ActionMove.js.map +1 -1
- package/components/BulkActions/BulkActions.js +8 -8
- package/components/BulkActions/BulkActions.js.map +1 -1
- package/components/BulkActions/index.d.ts +4 -4
- package/components/BulkActions/index.js +4 -4
- package/components/BulkActions/index.js.map +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrl.d.ts +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrl.js +9 -9
- package/components/EditFileUsingUrl/EditFileUsingUrl.js.map +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.d.ts +2 -2
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.js +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.js.map +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.d.ts +2 -2
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.js +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.js.map +1 -1
- package/components/EditFileUsingUrl/GetFileByUrl.d.ts +3 -3
- package/components/EditFileUsingUrl/GetFileByUrl.js +1 -1
- package/components/EditFileUsingUrl/GetFileByUrl.js.map +1 -1
- package/components/EditFileUsingUrl/UpdateFile.d.ts +3 -3
- package/components/EditFileUsingUrl/UpdateFile.js.map +1 -1
- package/components/EditFileUsingUrl/getFileByUrl.graphql.d.ts +1 -1
- package/components/EditFileUsingUrl/getFileByUrl.graphql.js +1 -1
- package/components/EditFileUsingUrl/getFileByUrl.graphql.js.map +1 -1
- package/components/EditFileUsingUrl/index.d.ts +1 -1
- package/components/EditFileUsingUrl/index.js +1 -1
- package/components/EditFileUsingUrl/index.js.map +1 -1
- package/components/Empty/Empty.js +4 -4
- package/components/Empty/Empty.js.map +1 -1
- package/components/Empty/index.d.ts +1 -1
- package/components/Empty/index.js +1 -1
- package/components/Empty/index.js.map +1 -1
- package/components/FileDetails/FileDetails.d.ts +2 -2
- package/components/FileDetails/FileDetails.js +18 -31
- package/components/FileDetails/FileDetails.js.map +1 -1
- package/components/FileDetails/FileDetailsProvider.d.ts +1 -1
- package/components/FileDetails/FileDetailsProvider.js +1 -1
- package/components/FileDetails/FileDetailsProvider.js.map +1 -1
- package/components/FileDetails/components/Actions.js +2 -2
- package/components/FileDetails/components/Actions.js.map +1 -1
- package/components/FileDetails/components/BaseFields.d.ts +1 -1
- package/components/FileDetails/components/BaseFields.js +2 -2
- package/components/FileDetails/components/BaseFields.js.map +1 -1
- package/components/FileDetails/components/Content.js +2 -2
- package/components/FileDetails/components/Content.js.map +1 -1
- package/components/FileDetails/components/CreatedOn.js +2 -2
- package/components/FileDetails/components/CreatedOn.js.map +1 -1
- package/components/FileDetails/components/Description.js +1 -1
- package/components/FileDetails/components/Description.js.map +1 -1
- package/components/FileDetails/components/Extensions.d.ts +1 -1
- package/components/FileDetails/components/Extensions.js +2 -2
- package/components/FileDetails/components/Extensions.js.map +1 -1
- package/components/FileDetails/components/Preview.js +3 -3
- package/components/FileDetails/components/Preview.js.map +1 -1
- package/components/FileDetails/components/Thumbnail.js +2 -2
- package/components/FileDetails/components/Thumbnail.js.map +1 -1
- package/components/FileDetails/index.d.ts +1 -1
- package/components/FileDetails/index.js +1 -1
- package/components/FileDetails/index.js.map +1 -1
- package/components/FileDropArea/FileDropArea.js +7 -7
- package/components/FileDropArea/FileDropArea.js.map +1 -1
- package/components/FileDropArea/index.d.ts +1 -1
- package/components/FileDropArea/index.js +1 -1
- package/components/FileDropArea/index.js.map +1 -1
- package/components/FileDropPlaceholder/FileDropPlaceholder.js +2 -2
- package/components/FileDropPlaceholder/FileDropPlaceholder.js.map +1 -1
- package/components/FileDropPlaceholder/index.d.ts +1 -1
- package/components/FileDropPlaceholder/index.js +1 -1
- package/components/FileDropPlaceholder/index.js.map +1 -1
- package/components/Filters/Filters.js +1 -1
- package/components/Filters/Filters.js.map +1 -1
- package/components/Filters/index.d.ts +1 -1
- package/components/Filters/index.js +1 -1
- package/components/Filters/index.js.map +1 -1
- package/components/Grid/File.d.ts +1 -1
- package/components/Grid/File.js +10 -14
- package/components/Grid/File.js.map +1 -1
- package/components/Grid/Grid.d.ts +6 -4
- package/components/Grid/Grid.js +8 -6
- package/components/Grid/Grid.js.map +1 -1
- package/components/Grid/Thumbnail.js +2 -2
- package/components/Grid/Thumbnail.js.map +1 -1
- package/components/Grid/index.d.ts +1 -1
- package/components/Grid/index.js +1 -1
- package/components/Grid/index.js.map +1 -1
- package/components/Header/Actions.d.ts +1 -1
- package/components/Header/Actions.js +5 -5
- package/components/Header/Actions.js.map +1 -1
- package/components/Header/Header.js +14 -10
- package/components/Header/Header.js.map +1 -1
- package/components/Header/Title.js +23 -30
- package/components/Header/Title.js.map +1 -1
- package/components/Header/index.d.ts +1 -1
- package/components/Header/index.js +1 -1
- package/components/Header/index.js.map +1 -1
- package/components/ImageEditor/ImageEditor.d.ts +1 -1
- package/components/ImageEditor/ImageEditor.js +8 -8
- package/components/ImageEditor/ImageEditor.js.map +1 -1
- package/components/ImageEditor/ImageEditorDialog.js +2 -2
- package/components/ImageEditor/ImageEditorDialog.js.map +1 -1
- package/components/ImageEditor/index.d.ts +1 -1
- package/components/ImageEditor/index.js +1 -1
- package/components/ImageEditor/index.js.map +1 -1
- package/components/ImageEditor/toolbar/crop.d.ts +1 -1
- package/components/ImageEditor/toolbar/crop.js.map +1 -1
- package/components/ImageEditor/toolbar/filter.d.ts +1 -1
- package/components/ImageEditor/toolbar/filter.js +2 -2
- package/components/ImageEditor/toolbar/filter.js.map +1 -1
- package/components/ImageEditor/toolbar/flip.d.ts +1 -1
- package/components/ImageEditor/toolbar/flip.js +1 -1
- package/components/ImageEditor/toolbar/flip.js.map +1 -1
- package/components/ImageEditor/toolbar/index.d.ts +4 -4
- package/components/ImageEditor/toolbar/index.js +4 -4
- package/components/ImageEditor/toolbar/index.js.map +1 -1
- package/components/ImageEditor/toolbar/rotate.d.ts +1 -1
- package/components/ImageEditor/toolbar/rotate.js.map +1 -1
- package/components/ImageEditor/toolbar/types.d.ts +4 -4
- package/components/ImageEditor/toolbar/types.js.map +1 -1
- package/components/LayoutSwitch/LayoutSwitch.js +2 -2
- package/components/LayoutSwitch/LayoutSwitch.js.map +1 -1
- package/components/LayoutSwitch/index.d.ts +1 -1
- package/components/LayoutSwitch/index.js +1 -1
- package/components/LayoutSwitch/index.js.map +1 -1
- package/components/NoPermissions/NoPermissions.js +6 -6
- package/components/NoPermissions/NoPermissions.js.map +1 -1
- package/components/NoPermissions/index.d.ts +1 -1
- package/components/NoPermissions/index.js +1 -1
- package/components/NoPermissions/index.js.map +1 -1
- package/components/NoResults/NoResults.js +5 -5
- package/components/NoResults/NoResults.js.map +1 -1
- package/components/NoResults/index.d.ts +1 -1
- package/components/NoResults/index.js +1 -1
- package/components/NoResults/index.js.map +1 -1
- package/components/SearchWidget/SearchWidget.js +2 -3
- package/components/SearchWidget/SearchWidget.js.map +1 -1
- package/components/SearchWidget/index.d.ts +1 -1
- package/components/SearchWidget/index.js +1 -1
- package/components/SearchWidget/index.js.map +1 -1
- package/components/Table/Actions/CopyFile.js +4 -4
- package/components/Table/Actions/CopyFile.js.map +1 -1
- package/components/Table/Actions/DeleteFile.js +5 -5
- package/components/Table/Actions/DeleteFile.js.map +1 -1
- package/components/Table/Actions/EditFile.js +4 -4
- package/components/Table/Actions/EditFile.js.map +1 -1
- package/components/Table/Actions/MoveFile.js +4 -4
- package/components/Table/Actions/MoveFile.js.map +1 -1
- package/components/Table/Actions/index.d.ts +4 -4
- package/components/Table/Actions/index.js +4 -4
- package/components/Table/Actions/index.js.map +1 -1
- package/components/Table/Cells/CellActions.js +7 -8
- package/components/Table/Cells/CellActions.js.map +1 -1
- package/components/Table/Cells/CellAuthor.js +4 -1
- package/components/Table/Cells/CellAuthor.js.map +1 -1
- package/components/Table/Cells/CellCreated.js +4 -1
- package/components/Table/Cells/CellCreated.js.map +1 -1
- package/components/Table/Cells/CellModified.js +4 -1
- package/components/Table/Cells/CellModified.js.map +1 -1
- package/components/Table/Cells/CellName.d.ts +3 -3
- package/components/Table/Cells/CellName.js +10 -10
- package/components/Table/Cells/CellName.js.map +1 -1
- package/components/Table/Cells/CellSize.js +1 -1
- package/components/Table/Cells/CellSize.js.map +1 -1
- package/components/Table/Cells/CellThumbnail.js +2 -2
- package/components/Table/Cells/CellThumbnail.js.map +1 -1
- package/components/Table/Cells/CellType.js +1 -1
- package/components/Table/Cells/CellType.js.map +1 -1
- package/components/Table/Cells/index.d.ts +7 -7
- package/components/Table/Cells/index.js +7 -7
- package/components/Table/Cells/index.js.map +1 -1
- package/components/Table/Table.d.ts +1 -1
- package/components/Table/Table.js +7 -2
- package/components/Table/Table.js.map +1 -1
- package/components/Table/index.d.ts +3 -3
- package/components/Table/index.js +3 -3
- package/components/Table/index.js.map +1 -1
- package/components/TagsList/Empty.js +1 -1
- package/components/TagsList/Empty.js.map +1 -1
- package/components/TagsList/FilterSelect.js +3 -3
- package/components/TagsList/FilterSelect.js.map +1 -1
- package/components/TagsList/FilterStatus.js +3 -3
- package/components/TagsList/FilterStatus.js.map +1 -1
- package/components/TagsList/Tag.d.ts +1 -1
- package/components/TagsList/Tag.js.map +1 -1
- package/components/TagsList/Tags.d.ts +1 -1
- package/components/TagsList/Tags.js +1 -1
- package/components/TagsList/Tags.js.map +1 -1
- package/components/TagsList/TagsList.d.ts +1 -1
- package/components/TagsList/TagsList.js +5 -5
- package/components/TagsList/TagsList.js.map +1 -1
- package/components/TagsList/index.d.ts +1 -1
- package/components/TagsList/index.js +1 -1
- package/components/TagsList/index.js.map +1 -1
- package/components/Thumbnail/Thumbnail.js +2 -2
- package/components/Thumbnail/Thumbnail.js.map +1 -1
- package/components/Thumbnail/index.d.ts +1 -1
- package/components/Thumbnail/index.js +1 -1
- package/components/Thumbnail/index.js.map +1 -1
- package/components/UploadStatus/UploadStatus.js +5 -5
- package/components/UploadStatus/UploadStatus.js.map +1 -1
- package/components/UploadStatus/index.d.ts +1 -1
- package/components/UploadStatus/index.js +1 -1
- package/components/UploadStatus/index.js.map +1 -1
- package/components/fields/AccessControl.js +3 -3
- package/components/fields/AccessControl.js.map +1 -1
- package/components/fields/Name.js +1 -1
- package/components/fields/Name.js.map +1 -1
- package/components/fields/Tags.js +3 -3
- package/components/fields/Tags.js.map +1 -1
- package/components/fields/index.d.ts +3 -4
- package/components/fields/index.js +3 -4
- package/components/fields/index.js.map +1 -1
- package/components/fields/useAccessControlField.d.ts +0 -1
- package/components/fields/useAccessControlField.js +1 -1
- package/components/fields/useAccessControlField.js.map +1 -1
- package/components/fields/useFileOrUndefined.js +2 -2
- package/components/fields/useFileOrUndefined.js.map +1 -1
- package/constants.d.ts +2 -2
- package/constants.js +2 -2
- package/constants.js.map +1 -1
- package/contexts/FileProvider.d.ts +1 -1
- package/contexts/FileProvider.js.map +1 -1
- package/hooks/useCopyFile.d.ts +1 -1
- package/hooks/useCopyFile.js +2 -2
- package/hooks/useCopyFile.js.map +1 -1
- package/hooks/useDeleteFile.d.ts +1 -1
- package/hooks/useDeleteFile.js +2 -5
- package/hooks/useDeleteFile.js.map +1 -1
- package/hooks/useFile.d.ts +1 -1
- package/hooks/useFile.js +1 -1
- package/hooks/useFile.js.map +1 -1
- package/hooks/useFileDetails.d.ts +1 -1
- package/hooks/useFileDetails.js +1 -1
- package/hooks/useFileDetails.js.map +1 -1
- package/hooks/useFileModel.js +1 -1
- package/hooks/useFileModel.js.map +1 -1
- package/hooks/useMoveFileToFolder.d.ts +1 -1
- package/hooks/useMoveFileToFolder.js +1 -1
- package/hooks/useMoveFileToFolder.js.map +1 -1
- package/index.d.ts +8 -8
- package/index.js +8 -8
- package/index.js.map +1 -1
- package/modules/Enterprise/HandleWebsocketMessages.js +1 -1
- package/modules/Enterprise/HandleWebsocketMessages.js.map +1 -1
- package/modules/Enterprise/components/ThreatScanInProgressFileBody.js +3 -3
- package/modules/Enterprise/components/ThreatScanInProgressFileBody.js.map +1 -1
- package/modules/Enterprise/components/ThreatScanInProgressTableCell.js +3 -3
- package/modules/Enterprise/components/ThreatScanInProgressTableCell.js.map +1 -1
- package/modules/Enterprise/index.js +5 -5
- package/modules/Enterprise/index.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.d.ts +2 -3
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.js +36 -19
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.d.ts +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.js +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.d.ts +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.js +3 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileUploader.d.ts +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileUploader.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/index.d.ts +3 -3
- package/modules/FileManagerApiProvider/FileManagerApiContext/index.js +3 -3
- package/modules/FileManagerApiProvider/FileManagerApiContext/index.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.d.ts +2 -2
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.js +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.js.map +1 -1
- package/modules/FileManagerApiProvider/graphql.d.ts +4 -5
- package/modules/FileManagerApiProvider/graphql.js.map +1 -1
- package/modules/FileManagerApiProvider/index.js +2 -2
- package/modules/FileManagerApiProvider/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/CopyUrl.js +2 -2
- package/modules/FileManagerRenderer/FileActions/FileDetails/CopyUrl.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/DeleteImage.js +2 -2
- package/modules/FileManagerRenderer/FileActions/FileDetails/DeleteImage.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/Download.js +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/Download.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/EditImage.js +3 -3
- package/modules/FileManagerRenderer/FileActions/FileDetails/EditImage.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/MoveToFolder.js +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/MoveToFolder.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/Grid/Delete.js +2 -2
- package/modules/FileManagerRenderer/FileActions/Grid/Delete.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/Grid/Download.js +1 -1
- package/modules/FileManagerRenderer/FileActions/Grid/Download.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/Grid/MoveToFolder.js +1 -1
- package/modules/FileManagerRenderer/FileActions/Grid/MoveToFolder.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/Grid/Settings.js +1 -1
- package/modules/FileManagerRenderer/FileActions/Grid/Settings.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/index.js +9 -13
- package/modules/FileManagerRenderer/FileActions/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/FileManagerView.js +42 -62
- package/modules/FileManagerRenderer/FileManagerView/FileManagerView.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.d.ts +98 -98
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js +10 -5
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/LeftSidebar.js +19 -9
- package/modules/FileManagerRenderer/FileManagerView/LeftSidebar.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkAction.d.ts +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkAction.js +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkAction.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FileAction.d.ts +2 -2
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FileAction.js +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FileAction.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderAction.d.ts +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderAction.js +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderAction.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderDropConfirmation.d.ts +5 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderDropConfirmation.js +10 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderDropConfirmation.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/index.d.ts +2 -2
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.d.ts +2 -2
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.js +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/index.d.ts +19 -20
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/index.js +2 -2
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.d.ts +75 -82
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.js +19 -20
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/index.d.ts +31 -32
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/index.js +7 -7
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/formatFileItem.d.ts +6 -0
- package/modules/FileManagerRenderer/FileManagerView/formatFileItem.js +19 -0
- package/modules/FileManagerRenderer/FileManagerView/formatFileItem.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/getThumbnailRenderer.d.ts +1 -1
- package/modules/FileManagerRenderer/FileManagerView/getThumbnailRenderer.js +1 -1
- package/modules/FileManagerRenderer/FileManagerView/getThumbnailRenderer.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/index.d.ts +1 -1
- package/modules/FileManagerRenderer/FileManagerView/index.js +22 -33
- package/modules/FileManagerRenderer/FileManagerView/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/FileManagerViewContext.d.ts +10 -7
- package/modules/FileManagerRenderer/FileManagerViewProvider/FileManagerViewContext.js +9 -8
- package/modules/FileManagerRenderer/FileManagerViewProvider/FileManagerViewContext.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/index.d.ts +2 -2
- package/modules/FileManagerRenderer/FileManagerViewProvider/index.js +2 -2
- package/modules/FileManagerRenderer/FileManagerViewProvider/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.d.ts +4 -4
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.d.ts +3 -3
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.d.ts +2 -2
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.js +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.d.ts +5 -6
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.js +6 -6
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useTags.d.ts +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useTags.js +4 -4
- package/modules/FileManagerRenderer/FileManagerViewProvider/useTags.js.map +1 -1
- package/modules/FileManagerRenderer/index.js +21 -24
- package/modules/FileManagerRenderer/index.js.map +1 -1
- package/modules/HeadlessCms/fileField.d.ts +1 -1
- package/modules/HeadlessCms/fileField.js +2 -2
- package/modules/HeadlessCms/fileField.js.map +1 -1
- package/modules/HeadlessCms/fileRenderer/fileField.d.ts +1 -1
- package/modules/HeadlessCms/fileRenderer/fileField.js +17 -8
- package/modules/HeadlessCms/fileRenderer/fileField.js.map +1 -1
- package/modules/HeadlessCms/fileRenderer/fileFields.d.ts +1 -1
- package/modules/HeadlessCms/fileRenderer/fileFields.js +17 -11
- package/modules/HeadlessCms/fileRenderer/fileFields.js.map +1 -1
- package/modules/HeadlessCms/index.js +3 -3
- package/modules/HeadlessCms/index.js.map +1 -1
- package/modules/SecurityPermissions.d.ts +2 -0
- package/modules/SecurityPermissions.js +34 -0
- package/modules/SecurityPermissions.js.map +1 -0
- package/modules/Settings/graphql.js +6 -0
- package/modules/Settings/graphql.js.map +1 -1
- package/modules/Settings/index.js +11 -12
- package/modules/Settings/index.js.map +1 -1
- package/modules/Settings/views/FileManagerSettings.js +65 -19
- package/modules/Settings/views/FileManagerSettings.js.map +1 -1
- package/modules/ThumbnailRenderers/FilePreviewDefaultRenderer.js +1 -1
- package/modules/ThumbnailRenderers/FilePreviewDefaultRenderer.js.map +1 -1
- package/modules/ThumbnailRenderers/FilePreviewImageRenderer.js +3 -3
- package/modules/ThumbnailRenderers/FilePreviewImageRenderer.js.map +1 -1
- package/modules/ThumbnailRenderers/GridItemDefaultRenderer.js +1 -1
- package/modules/ThumbnailRenderers/GridItemDefaultRenderer.js.map +1 -1
- package/modules/ThumbnailRenderers/GridItemImageRenderer.js +3 -3
- package/modules/ThumbnailRenderers/GridItemImageRenderer.js.map +1 -1
- package/modules/ThumbnailRenderers/TableItemDefaultRenderer.js +2 -2
- package/modules/ThumbnailRenderers/TableItemDefaultRenderer.js.map +1 -1
- package/modules/ThumbnailRenderers/TableItemImageRenderer.js +3 -3
- package/modules/ThumbnailRenderers/TableItemImageRenderer.js.map +1 -1
- package/package.json +30 -35
- package/routes.d.ts +4 -0
- package/routes.js +9 -0
- package/routes.js.map +1 -0
- package/tagsHelpers.d.ts +1 -1
- package/tagsHelpers.js +2 -2
- package/tagsHelpers.js.map +1 -1
- package/types.d.ts +50 -6
- package/types.js +1 -1
- package/types.js.map +1 -1
- package/components/fields/Aliases.d.ts +0 -2
- package/components/fields/Aliases.js +0 -85
- package/components/fields/Aliases.js.map +0 -1
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.d.ts +0 -4
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.js +0 -26
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.js.map +0 -1
- package/modules/Settings/plugins/installation.d.ts +0 -3
- package/modules/Settings/plugins/installation.js +0 -96
- package/modules/Settings/plugins/installation.js.map +0 -1
- package/modules/Settings/plugins/permissionRenderer/FileManagerPermissions.d.ts +0 -14
- package/modules/Settings/plugins/permissionRenderer/FileManagerPermissions.js +0 -205
- package/modules/Settings/plugins/permissionRenderer/FileManagerPermissions.js.map +0 -1
- package/modules/Settings/plugins/permissionRenderer/index.d.ts +0 -3
- package/modules/Settings/plugins/permissionRenderer/index.js +0 -23
- package/modules/Settings/plugins/permissionRenderer/index.js.map +0 -1
package/BatchFileUploader.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FileItem } from "
|
|
2
|
-
import type { FileManagerViewContext } from "./modules/FileManagerRenderer/FileManagerViewProvider";
|
|
1
|
+
import type { FileItem } from "./types.js";
|
|
2
|
+
import type { FileManagerViewContext } from "./modules/FileManagerRenderer/FileManagerViewProvider/index.js";
|
|
3
3
|
export interface FileError {
|
|
4
4
|
file: File;
|
|
5
5
|
e: Error;
|
package/BatchFileUploader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["generateId","makeAutoObservable","runInAction","action","FileJob","constructor","file","id","BatchFileUploader","fileJobs","uploading","uploadStatus","Map","uploader","getJobs","addFiles","files","forEach","fileJob","push","set","upload","reset","clear","progress","progressInBytes","Array","from","values","loadedBytes","reduce","a","b","totalBytesToUpload","sum","job","size","Math","min","onUploadFinished","cb","onUploadFinishedCallback","errors","uploaded","getNextFile","newFile","onProgress","event","sent","e","find","get"],"sources":["BatchFileUploader.ts"],"sourcesContent":["import { generateId } from \"@webiny/utils\";\nimport { makeAutoObservable, runInAction, action } from \"mobx\";\nimport type { FileItem } from \"
|
|
1
|
+
{"version":3,"names":["generateId","makeAutoObservable","runInAction","action","FileJob","constructor","file","id","BatchFileUploader","fileJobs","uploading","uploadStatus","Map","uploader","getJobs","addFiles","files","forEach","fileJob","push","set","upload","reset","clear","progress","progressInBytes","Array","from","values","loadedBytes","reduce","a","b","totalBytesToUpload","sum","job","size","Math","min","onUploadFinished","cb","onUploadFinishedCallback","errors","uploaded","getNextFile","newFile","onProgress","event","sent","e","find","get"],"sources":["BatchFileUploader.ts"],"sourcesContent":["import { generateId } from \"@webiny/utils\";\nimport { makeAutoObservable, runInAction, action } from \"mobx\";\nimport type { FileItem } from \"~/types.js\";\nimport type { FileManagerViewContext } from \"~/modules/FileManagerRenderer/FileManagerViewProvider/index.js\";\n\nexport interface FileError {\n file: File;\n e: Error;\n}\n\ninterface OnUploadFinishedParams {\n uploaded: FileItem[];\n errors: FileError[];\n}\n\ninterface OnUploadFinishedCallback {\n (params: OnUploadFinishedParams): void;\n}\n\nclass FileJob {\n public id: string;\n public file: File;\n\n constructor(file: File) {\n this.id = generateId();\n this.file = file;\n }\n}\n\nexport class BatchFileUploader {\n private readonly uploader: FileManagerViewContext[\"uploadFile\"];\n private fileJobs: FileJob[] = [];\n private onUploadFinishedCallback: OnUploadFinishedCallback | undefined;\n private uploading = false;\n private uploadStatus: Map<string, number> = new Map();\n\n constructor(uploader: FileManagerViewContext[\"uploadFile\"]) {\n this.uploader = uploader;\n makeAutoObservable(this);\n }\n\n public getJobs() {\n return this.fileJobs;\n }\n\n public addFiles(files: File[]) {\n files.forEach(file => {\n const fileJob = new FileJob(file);\n this.fileJobs.push(fileJob);\n this.uploadStatus.set(fileJob.id, 0);\n });\n\n this.upload();\n }\n\n public reset() {\n this.fileJobs = [];\n this.uploadStatus.clear();\n }\n\n get progress() {\n const progressInBytes = Array.from(this.uploadStatus.values());\n const loadedBytes = progressInBytes.reduce((a, b) => a + b, 0);\n const totalBytesToUpload = this.fileJobs.reduce((sum, job) => sum + job.file.size, 0);\n return Math.min((100 * loadedBytes) / totalBytesToUpload, 100);\n }\n\n public onUploadFinished(cb: OnUploadFinishedCallback) {\n this.onUploadFinishedCallback = cb;\n }\n\n private async upload() {\n if (this.uploading) {\n return;\n }\n\n this.uploading = true;\n\n const errors: FileError[] = [];\n const uploaded: FileItem[] = [];\n\n while (true) {\n const fileJob = this.getNextFile();\n\n if (!fileJob) {\n break;\n }\n\n try {\n const newFile = await this.uploader(fileJob.file, {\n onProgress: action(\"BatchFileUploader.onProgress\", event => {\n this.uploadStatus.set(fileJob.id, event.sent);\n })\n });\n\n if (newFile) {\n uploaded.push(newFile);\n }\n } catch (e) {\n runInAction(() => {\n this.uploadStatus.set(fileJob.id, -1);\n });\n\n errors.push({ file: fileJob.file, e });\n }\n }\n\n runInAction(() => {\n this.uploading = false;\n });\n\n if (this.onUploadFinishedCallback) {\n this.onUploadFinishedCallback({ uploaded, errors });\n }\n }\n\n private getNextFile() {\n return this.fileJobs.find(file => this.uploadStatus.get(file.id) === 0);\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,eAAe;AAC1C,SAASC,kBAAkB,EAAEC,WAAW,EAAEC,MAAM,QAAQ,MAAM;AAkB9D,MAAMC,OAAO,CAAC;EAIVC,WAAWA,CAACC,IAAU,EAAE;IACpB,IAAI,CAACC,EAAE,GAAGP,UAAU,CAAC,CAAC;IACtB,IAAI,CAACM,IAAI,GAAGA,IAAI;EACpB;AACJ;AAEA,OAAO,MAAME,iBAAiB,CAAC;EAEnBC,QAAQ,GAAc,EAAE;EAExBC,SAAS,GAAG,KAAK;EACjBC,YAAY,GAAwB,IAAIC,GAAG,CAAC,CAAC;EAErDP,WAAWA,CAACQ,QAA8C,EAAE;IACxD,IAAI,CAACA,QAAQ,GAAGA,QAAQ;IACxBZ,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEOa,OAAOA,CAAA,EAAG;IACb,OAAO,IAAI,CAACL,QAAQ;EACxB;EAEOM,QAAQA,CAACC,KAAa,EAAE;IAC3BA,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-file-manager)
|
|
3
|
-
[](https://www.npmjs.com/package/@webiny/app-file-manager)
|
|
4
|
-
[](https://github.com/prettier/prettier)
|
|
5
|
-
[](http://makeapullrequest.com)
|
|
1
|
+
# @webiny/app-file-manager
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
npm install --save @webiny/app-file-manager
|
|
12
|
-
```
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
yarn add @webiny/app-file-manager
|
|
17
|
-
```
|
|
7
|
+
📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
18
8
|
|
|
19
|
-
|
|
20
|
-
To setup, you must register a set of plugins. For more information on
|
|
21
|
-
plugins, please visit [Webiny documentation](https://docs.webiny.com/docs/developer-tutorials/plugins-crash-course).
|
|
9
|
+
---
|
|
22
10
|
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
import { plugins } from "@webiny/plugins";
|
|
26
|
-
import appFileManagerPlugin from "@webiny/app-file-manager/admin"
|
|
27
|
-
|
|
28
|
-
plugins.register(appFileManagerPlugin);
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Enables the file manager settings components which can be accessed via Settings
|
|
32
|
-
section in the main menu.
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/app.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { SettingsModule } from "./modules/Settings";
|
|
3
|
-
import { FileManagerApiProviderModule } from "./modules/FileManagerApiProvider";
|
|
4
|
-
import { FileManagerRendererModule } from "./modules/FileManagerRenderer";
|
|
5
|
-
import { HeadlessCmsModule } from "./modules/HeadlessCms";
|
|
6
|
-
import { EnterpriseModule } from "./modules/Enterprise";
|
|
2
|
+
import { SettingsModule } from "./modules/Settings/index.js";
|
|
3
|
+
import { FileManagerApiProviderModule } from "./modules/FileManagerApiProvider/index.js";
|
|
4
|
+
import { FileManagerRendererModule } from "./modules/FileManagerRenderer/index.js";
|
|
5
|
+
import { HeadlessCmsModule } from "./modules/HeadlessCms/index.js";
|
|
6
|
+
import { EnterpriseModule } from "./modules/Enterprise/index.js";
|
|
7
|
+
import { SecurityPermissions } from "./modules/SecurityPermissions.js";
|
|
7
8
|
export const FileManager = () => {
|
|
8
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SettingsModule, null), /*#__PURE__*/React.createElement(FileManagerApiProviderModule, null), /*#__PURE__*/React.createElement(FileManagerRendererModule, null), /*#__PURE__*/React.createElement(HeadlessCmsModule, null), /*#__PURE__*/React.createElement(EnterpriseModule, null));
|
|
9
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SettingsModule, null), /*#__PURE__*/React.createElement(FileManagerApiProviderModule, null), /*#__PURE__*/React.createElement(FileManagerRendererModule, null), /*#__PURE__*/React.createElement(HeadlessCmsModule, null), /*#__PURE__*/React.createElement(EnterpriseModule, null), /*#__PURE__*/React.createElement(SecurityPermissions, null));
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
//# sourceMappingURL=app.js.map
|
package/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","SettingsModule","FileManagerApiProviderModule","FileManagerRendererModule","HeadlessCmsModule","EnterpriseModule","FileManager","createElement","Fragment"],"sources":["app.tsx"],"sourcesContent":["import React from \"react\";\nimport { SettingsModule } from \"~/modules/Settings\";\nimport { FileManagerApiProviderModule } from \"~/modules/FileManagerApiProvider\";\nimport { FileManagerRendererModule } from \"~/modules/FileManagerRenderer\";\nimport { HeadlessCmsModule } from \"~/modules/HeadlessCms\";\nimport { EnterpriseModule } from \"~/modules/Enterprise\";\n\nexport const FileManager = () => {\n return (\n <>\n <SettingsModule />\n <FileManagerApiProviderModule />\n <FileManagerRendererModule />\n <HeadlessCmsModule />\n <EnterpriseModule />\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc;AACvB,SAASC,4BAA4B;AACrC,SAASC,yBAAyB;AAClC,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;
|
|
1
|
+
{"version":3,"names":["React","SettingsModule","FileManagerApiProviderModule","FileManagerRendererModule","HeadlessCmsModule","EnterpriseModule","SecurityPermissions","FileManager","createElement","Fragment"],"sources":["app.tsx"],"sourcesContent":["import React from \"react\";\nimport { SettingsModule } from \"~/modules/Settings/index.js\";\nimport { FileManagerApiProviderModule } from \"~/modules/FileManagerApiProvider/index.js\";\nimport { FileManagerRendererModule } from \"~/modules/FileManagerRenderer/index.js\";\nimport { HeadlessCmsModule } from \"~/modules/HeadlessCms/index.js\";\nimport { EnterpriseModule } from \"~/modules/Enterprise/index.js\";\nimport { SecurityPermissions } from \"./modules/SecurityPermissions.js\";\n\nexport const FileManager = () => {\n return (\n <>\n <SettingsModule />\n <FileManagerApiProviderModule />\n <FileManagerRendererModule />\n <HeadlessCmsModule />\n <EnterpriseModule />\n <SecurityPermissions />\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc;AACvB,SAASC,4BAA4B;AACrC,SAASC,yBAAyB;AAClC,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAE5B,OAAO,MAAMC,WAAW,GAAGA,CAAA,KAAM;EAC7B,oBACIP,KAAA,CAAAQ,aAAA,CAAAR,KAAA,CAAAS,QAAA,qBACIT,KAAA,CAAAQ,aAAA,CAACP,cAAc,MAAE,CAAC,eAClBD,KAAA,CAAAQ,aAAA,CAACN,4BAA4B,MAAE,CAAC,eAChCF,KAAA,CAAAQ,aAAA,CAACL,yBAAyB,MAAE,CAAC,eAC7BH,KAAA,CAAAQ,aAAA,CAACJ,iBAAiB,MAAE,CAAC,eACrBJ,KAAA,CAAAQ,aAAA,CAACH,gBAAgB,MAAE,CAAC,eACpBL,KAAA,CAAAQ,aAAA,CAACF,mBAAmB,MAAE,CACxB,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { SupportedFileTypesProps } from "./SupportedFileTypes";
|
|
3
|
-
import type { ListStatusProps } from "./ListStatus";
|
|
2
|
+
import type { SupportedFileTypesProps } from "./SupportedFileTypes.js";
|
|
3
|
+
import type { ListStatusProps } from "./ListStatus.js";
|
|
4
4
|
type BottomInfoBarProps = SupportedFileTypesProps & ListStatusProps;
|
|
5
5
|
export declare const BottomInfoBar: (props: BottomInfoBarProps) => React.JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import mime from "mime/lite";
|
|
2
|
+
import mime from "mime/lite.js";
|
|
3
3
|
import { Separator } from "@webiny/admin-ui";
|
|
4
|
-
import SupportedFileTypes from "./SupportedFileTypes";
|
|
5
|
-
import ListStatus from "./ListStatus";
|
|
4
|
+
import { SupportedFileTypes } from "./SupportedFileTypes.js";
|
|
5
|
+
import ListStatus from "./ListStatus.js";
|
|
6
6
|
mime.define({
|
|
7
7
|
"image/x-icon": ["ico"]
|
|
8
8
|
}, true);
|
|
@@ -14,9 +14,9 @@ mime.define({
|
|
|
14
14
|
}, true);
|
|
15
15
|
export const BottomInfoBar = props => {
|
|
16
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
className: "
|
|
17
|
+
className: "bg-neutral-base w-full overflow-hidden z-5"
|
|
18
18
|
}, /*#__PURE__*/React.createElement(Separator, null), /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className: "
|
|
19
|
+
className: "h-xl px-md py-sm flex items-center justify-between"
|
|
20
20
|
}, /*#__PURE__*/React.createElement(SupportedFileTypes, props), /*#__PURE__*/React.createElement(ListStatus, props)));
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","mime","Separator","SupportedFileTypes","ListStatus","define","BottomInfoBar","props","createElement","className"],"sources":["BottomInfoBar.tsx"],"sourcesContent":["import React from \"react\";\nimport mime from \"mime/lite\";\nimport { Separator } from \"@webiny/admin-ui\";\n\nimport type { SupportedFileTypesProps } from \"./SupportedFileTypes\";\nimport SupportedFileTypes from \"./SupportedFileTypes\";\nimport type { ListStatusProps } from \"./ListStatus\";\nimport ListStatus from \"./ListStatus\";\n\nmime.define({ \"image/x-icon\": [\"ico\"] }, true);\nmime.define({ \"image/jpg\": [\"jpg\"] }, true);\nmime.define({ \"image/vnd.microsoft.icon\": [\"ico\"] }, true);\n\ntype BottomInfoBarProps = SupportedFileTypesProps & ListStatusProps;\n\nexport const BottomInfoBar = (props: BottomInfoBarProps) => {\n return (\n <div className=\"
|
|
1
|
+
{"version":3,"names":["React","mime","Separator","SupportedFileTypes","ListStatus","define","BottomInfoBar","props","createElement","className"],"sources":["BottomInfoBar.tsx"],"sourcesContent":["import React from \"react\";\nimport mime from \"mime/lite.js\";\nimport { Separator } from \"@webiny/admin-ui\";\n\nimport type { SupportedFileTypesProps } from \"./SupportedFileTypes.js\";\nimport { SupportedFileTypes } from \"./SupportedFileTypes.js\";\nimport type { ListStatusProps } from \"./ListStatus.js\";\nimport ListStatus from \"./ListStatus.js\";\n\nmime.define({ \"image/x-icon\": [\"ico\"] }, true);\nmime.define({ \"image/jpg\": [\"jpg\"] }, true);\nmime.define({ \"image/vnd.microsoft.icon\": [\"ico\"] }, true);\n\ntype BottomInfoBarProps = SupportedFileTypesProps & ListStatusProps;\n\nexport const BottomInfoBar = (props: BottomInfoBarProps) => {\n return (\n <div className=\"bg-neutral-base w-full overflow-hidden z-5\">\n <Separator />\n <div className={\"h-xl px-md py-sm flex items-center justify-between\"}>\n <SupportedFileTypes {...props} />\n <ListStatus {...props} />\n </div>\n </div>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,cAAc;AAC/B,SAASC,SAAS,QAAQ,kBAAkB;AAG5C,SAASC,kBAAkB;AAE3B,OAAOC,UAAU;AAEjBH,IAAI,CAACI,MAAM,CAAC;EAAE,cAAc,EAAE,CAAC,KAAK;AAAE,CAAC,EAAE,IAAI,CAAC;AAC9CJ,IAAI,CAACI,MAAM,CAAC;EAAE,WAAW,EAAE,CAAC,KAAK;AAAE,CAAC,EAAE,IAAI,CAAC;AAC3CJ,IAAI,CAACI,MAAM,CAAC;EAAE,0BAA0B,EAAE,CAAC,KAAK;AAAE,CAAC,EAAE,IAAI,CAAC;AAI1D,OAAO,MAAMC,aAAa,GAAIC,KAAyB,IAAK;EACxD,oBACIP,KAAA,CAAAQ,aAAA;IAAKC,SAAS,EAAC;EAA4C,gBACvDT,KAAA,CAAAQ,aAAA,CAACN,SAAS,MAAE,CAAC,eACbF,KAAA,CAAAQ,aAAA;IAAKC,SAAS,EAAE;EAAqD,gBACjET,KAAA,CAAAQ,aAAA,CAACL,kBAAkB,EAAKI,KAAQ,CAAC,eACjCP,KAAA,CAAAQ,aAAA,CAACJ,UAAU,EAAKG,KAAQ,CACvB,CACJ,CAAC;AAEd,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { i18n } from "@webiny/app/i18n";
|
|
2
|
+
import { i18n } from "@webiny/app/i18n/index.js";
|
|
3
3
|
import { Loader, Text } from "@webiny/admin-ui";
|
|
4
4
|
const t = i18n.ns("app-admin/file-manager/components/bottom-info-bar/list-status");
|
|
5
5
|
const ListStatus = ({
|
|
@@ -9,11 +9,11 @@ const ListStatus = ({
|
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
11
|
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
className: "
|
|
12
|
+
className: "flex items-center gap-sm"
|
|
13
13
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
14
14
|
size: "sm",
|
|
15
15
|
as: "div",
|
|
16
|
-
className: "
|
|
16
|
+
className: "text-neutral-strong"
|
|
17
17
|
}, t`Loading more files...`), /*#__PURE__*/React.createElement(Loader, {
|
|
18
18
|
size: "xs"
|
|
19
19
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","i18n","Loader","Text","t","ns","ListStatus","listing","createElement","className","size","as"],"sources":["ListStatus.tsx"],"sourcesContent":["import React from \"react\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { Loader, Text } from \"@webiny/admin-ui\";\n\nconst t = i18n.ns(\"app-admin/file-manager/components/bottom-info-bar/list-status\");\n\nexport interface ListStatusProps {\n listing: boolean;\n}\n\nconst ListStatus = ({ listing }: ListStatusProps) => {\n if (!listing) {\n return null;\n }\n\n return (\n <div className=\"
|
|
1
|
+
{"version":3,"names":["React","i18n","Loader","Text","t","ns","ListStatus","listing","createElement","className","size","as"],"sources":["ListStatus.tsx"],"sourcesContent":["import React from \"react\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { Loader, Text } from \"@webiny/admin-ui\";\n\nconst t = i18n.ns(\"app-admin/file-manager/components/bottom-info-bar/list-status\");\n\nexport interface ListStatusProps {\n listing: boolean;\n}\n\nconst ListStatus = ({ listing }: ListStatusProps) => {\n if (!listing) {\n return null;\n }\n\n return (\n <div className=\"flex items-center gap-sm\">\n <Text size={\"sm\"} as={\"div\"} className={\"text-neutral-strong\"}>\n {t`Loading more files...`}\n </Text>\n <Loader size={\"xs\"} />\n </div>\n );\n};\n\nexport default ListStatus;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,2BAA2B;AAChD,SAASC,MAAM,EAAEC,IAAI,QAAQ,kBAAkB;AAE/C,MAAMC,CAAC,GAAGH,IAAI,CAACI,EAAE,CAAC,+DAA+D,CAAC;AAMlF,MAAMC,UAAU,GAAGA,CAAC;EAAEC;AAAyB,CAAC,KAAK;EACjD,IAAI,CAACA,OAAO,EAAE;IACV,OAAO,IAAI;EACf;EAEA,oBACIP,KAAA,CAAAQ,aAAA;IAAKC,SAAS,EAAC;EAA0B,gBACrCT,KAAA,CAAAQ,aAAA,CAACL,IAAI;IAACO,IAAI,EAAE,IAAK;IAACC,EAAE,EAAE,KAAM;IAACF,SAAS,EAAE;EAAsB,GACzDL,CAAC,uBACA,CAAC,eACPJ,KAAA,CAAAQ,aAAA,CAACN,MAAM;IAACQ,IAAI,EAAE;EAAK,CAAE,CACpB,CAAC;AAEd,CAAC;AAED,eAAeJ,UAAU","ignoreList":[]}
|
|
@@ -5,5 +5,4 @@ export interface SupportedFileTypesProps {
|
|
|
5
5
|
totalCount: number;
|
|
6
6
|
currentCount: number;
|
|
7
7
|
}
|
|
8
|
-
declare const SupportedFileTypes: ({ accept, loading, totalCount, currentCount }: SupportedFileTypesProps) => React.JSX.Element | null;
|
|
9
|
-
export default SupportedFileTypes;
|
|
8
|
+
export declare const SupportedFileTypes: ({ accept, loading, totalCount, currentCount }: SupportedFileTypesProps) => React.JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback } from "react";
|
|
2
2
|
import { Text } from "@webiny/admin-ui";
|
|
3
|
-
import { i18n } from "@webiny/app/i18n";
|
|
4
|
-
import mime from "mime/lite";
|
|
3
|
+
import { i18n } from "@webiny/app/i18n/index.js";
|
|
4
|
+
import mime from "mime/lite.js";
|
|
5
5
|
mime.define({
|
|
6
6
|
"image/x-icon": ["ico"]
|
|
7
7
|
}, true);
|
|
@@ -23,7 +23,7 @@ const getUniqueFilePlugins = accept => {
|
|
|
23
23
|
});
|
|
24
24
|
return Object.keys(exts);
|
|
25
25
|
};
|
|
26
|
-
const SupportedFileTypes = ({
|
|
26
|
+
export const SupportedFileTypes = ({
|
|
27
27
|
accept,
|
|
28
28
|
loading,
|
|
29
29
|
totalCount,
|
|
@@ -39,7 +39,7 @@ const SupportedFileTypes = ({
|
|
|
39
39
|
return /*#__PURE__*/React.createElement(Text, {
|
|
40
40
|
size: "sm",
|
|
41
41
|
as: "div",
|
|
42
|
-
className: "
|
|
42
|
+
className: "text-neutral-strong"
|
|
43
43
|
}, t`Showing {currentCountLabel} out of {totalCountLabel} from all file extensions.`({
|
|
44
44
|
currentCountLabel: String(currentCount),
|
|
45
45
|
totalCountLabel: getLabel(totalCount)
|
|
@@ -48,13 +48,12 @@ const SupportedFileTypes = ({
|
|
|
48
48
|
return /*#__PURE__*/React.createElement(Text, {
|
|
49
49
|
size: "sm",
|
|
50
50
|
as: "div",
|
|
51
|
-
className: "
|
|
51
|
+
className: "text-neutral-strong"
|
|
52
52
|
}, t`Showing {currentCountLabel} out of {totalCountLabel} from the following file extensions: {files}.`({
|
|
53
53
|
currentCountLabel: String(currentCount),
|
|
54
54
|
totalCountLabel: getLabel(totalCount),
|
|
55
55
|
files: getUniqueFilePlugins(accept).join(", ")
|
|
56
56
|
}));
|
|
57
57
|
};
|
|
58
|
-
export default SupportedFileTypes;
|
|
59
58
|
|
|
60
59
|
//# sourceMappingURL=SupportedFileTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","Text","i18n","mime","define","t","ns","getUniqueFilePlugins","accept","exts","forEach","item","ext","getExtension","Object","keys","SupportedFileTypes","loading","totalCount","currentCount","getLabel","count","length","createElement","size","as","className","currentCountLabel","String","totalCountLabel","files","join"],"sources":["SupportedFileTypes.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { Text } from \"@webiny/admin-ui\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport mime from \"mime/lite\";\n\nmime.define({ \"image/x-icon\": [\"ico\"] }, true);\nmime.define({ \"image/jpg\": [\"jpg\"] }, true);\nmime.define({ \"image/vnd.microsoft.icon\": [\"ico\"] }, true);\n\nconst t = i18n.ns(\"app-admin/file-manager/components/bottom-info-bar/supported-files\");\n\nconst getUniqueFilePlugins = (accept: string[]): string[] => {\n const exts: Record<string, boolean> = {};\n accept.forEach(item => {\n const ext = mime.getExtension(item);\n if (!ext) {\n return;\n }\n exts[ext] = true;\n });\n\n return Object.keys(exts);\n};\n\nexport interface SupportedFileTypesProps {\n accept: string[];\n loading: boolean;\n totalCount: number;\n currentCount: number;\n}\n\
|
|
1
|
+
{"version":3,"names":["React","useCallback","Text","i18n","mime","define","t","ns","getUniqueFilePlugins","accept","exts","forEach","item","ext","getExtension","Object","keys","SupportedFileTypes","loading","totalCount","currentCount","getLabel","count","length","createElement","size","as","className","currentCountLabel","String","totalCountLabel","files","join"],"sources":["SupportedFileTypes.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { Text } from \"@webiny/admin-ui\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport mime from \"mime/lite.js\";\n\nmime.define({ \"image/x-icon\": [\"ico\"] }, true);\nmime.define({ \"image/jpg\": [\"jpg\"] }, true);\nmime.define({ \"image/vnd.microsoft.icon\": [\"ico\"] }, true);\n\nconst t = i18n.ns(\"app-admin/file-manager/components/bottom-info-bar/supported-files\");\n\nconst getUniqueFilePlugins = (accept: string[]): string[] => {\n const exts: Record<string, boolean> = {};\n accept.forEach(item => {\n const ext = mime.getExtension(item);\n if (!ext) {\n return;\n }\n exts[ext] = true;\n });\n\n return Object.keys(exts);\n};\n\nexport interface SupportedFileTypesProps {\n accept: string[];\n loading: boolean;\n totalCount: number;\n currentCount: number;\n}\n\nexport const SupportedFileTypes = ({\n accept,\n loading,\n totalCount,\n currentCount\n}: SupportedFileTypesProps) => {\n const getLabel = useCallback((count = 0): string => {\n return `${count} ${count === 1 ? \"file\" : \"files\"}`;\n }, []);\n\n if (!accept || loading) {\n return null;\n }\n\n if (accept.length === 0) {\n return (\n <Text size={\"sm\"} as={\"div\"} className={\"text-neutral-strong\"}>\n {t`Showing {currentCountLabel} out of {totalCountLabel} from all file extensions.`({\n currentCountLabel: String(currentCount),\n totalCountLabel: getLabel(totalCount)\n })}\n </Text>\n );\n }\n\n return (\n <Text size={\"sm\"} as={\"div\"} className={\"text-neutral-strong\"}>\n {t`Showing {currentCountLabel} out of {totalCountLabel} from the following file extensions: {files}.`(\n {\n currentCountLabel: String(currentCount),\n totalCountLabel: getLabel(totalCount),\n files: getUniqueFilePlugins(accept).join(\", \")\n }\n )}\n </Text>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,IAAI,QAAQ,2BAA2B;AAChD,OAAOC,IAAI,MAAM,cAAc;AAE/BA,IAAI,CAACC,MAAM,CAAC;EAAE,cAAc,EAAE,CAAC,KAAK;AAAE,CAAC,EAAE,IAAI,CAAC;AAC9CD,IAAI,CAACC,MAAM,CAAC;EAAE,WAAW,EAAE,CAAC,KAAK;AAAE,CAAC,EAAE,IAAI,CAAC;AAC3CD,IAAI,CAACC,MAAM,CAAC;EAAE,0BAA0B,EAAE,CAAC,KAAK;AAAE,CAAC,EAAE,IAAI,CAAC;AAE1D,MAAMC,CAAC,GAAGH,IAAI,CAACI,EAAE,CAAC,mEAAmE,CAAC;AAEtF,MAAMC,oBAAoB,GAAIC,MAAgB,IAAe;EACzD,MAAMC,IAA6B,GAAG,CAAC,CAAC;EACxCD,MAAM,CAACE,OAAO,CAACC,IAAI,IAAI;IACnB,MAAMC,GAAG,GAAGT,IAAI,CAACU,YAAY,CAACF,IAAI,CAAC;IACnC,IAAI,CAACC,GAAG,EAAE;MACN;IACJ;IACAH,IAAI,CAACG,GAAG,CAAC,GAAG,IAAI;EACpB,CAAC,CAAC;EAEF,OAAOE,MAAM,CAACC,IAAI,CAACN,IAAI,CAAC;AAC5B,CAAC;AASD,OAAO,MAAMO,kBAAkB,GAAGA,CAAC;EAC/BR,MAAM;EACNS,OAAO;EACPC,UAAU;EACVC;AACqB,CAAC,KAAK;EAC3B,MAAMC,QAAQ,GAAGpB,WAAW,CAAC,CAACqB,KAAK,GAAG,CAAC,KAAa;IAChD,OAAO,GAAGA,KAAK,IAAIA,KAAK,KAAK,CAAC,GAAG,MAAM,GAAG,OAAO,EAAE;EACvD,CAAC,EAAE,EAAE,CAAC;EAEN,IAAI,CAACb,MAAM,IAAIS,OAAO,EAAE;IACpB,OAAO,IAAI;EACf;EAEA,IAAIT,MAAM,CAACc,MAAM,KAAK,CAAC,EAAE;IACrB,oBACIvB,KAAA,CAAAwB,aAAA,CAACtB,IAAI;MAACuB,IAAI,EAAE,IAAK;MAACC,EAAE,EAAE,KAAM;MAACC,SAAS,EAAE;IAAsB,GACzDrB,CAAC,gFAAgF,CAAC;MAC/EsB,iBAAiB,EAAEC,MAAM,CAACT,YAAY,CAAC;MACvCU,eAAe,EAAET,QAAQ,CAACF,UAAU;IACxC,CAAC,CACC,CAAC;EAEf;EAEA,oBACInB,KAAA,CAAAwB,aAAA,CAACtB,IAAI;IAACuB,IAAI,EAAE,IAAK;IAACC,EAAE,EAAE,KAAM;IAACC,SAAS,EAAE;EAAsB,GACzDrB,CAAC,mGAAmG,CACjG;IACIsB,iBAAiB,EAAEC,MAAM,CAACT,YAAY,CAAC;IACvCU,eAAe,EAAET,QAAQ,CAACF,UAAU,CAAC;IACrCY,KAAK,EAAEvB,oBAAoB,CAACC,MAAM,CAAC,CAACuB,IAAI,CAAC,IAAI;EACjD,CACJ,CACE,CAAC;AAEf,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./BottomInfoBar";
|
|
1
|
+
export * from "./BottomInfoBar.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * from \"./BottomInfoBar\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * from \"./BottomInfoBar.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -2,10 +2,10 @@ import React, { useMemo } from "react";
|
|
|
2
2
|
import { Tooltip } from "@webiny/admin-ui";
|
|
3
3
|
import { ReactComponent as DeleteIcon } from "@webiny/icons/delete.svg";
|
|
4
4
|
import { observer } from "mobx-react-lite";
|
|
5
|
-
import { FileManagerViewConfig } from "../../modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig";
|
|
6
|
-
import { useFileManagerApi } from "../../modules/FileManagerApiProvider/FileManagerApiContext";
|
|
7
|
-
import { useFileManagerView } from "../../modules/FileManagerRenderer/FileManagerViewProvider";
|
|
8
|
-
import { getFilesLabel } from "./BulkActions";
|
|
5
|
+
import { FileManagerViewConfig } from "../../modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js";
|
|
6
|
+
import { useFileManagerApi } from "../../modules/FileManagerApiProvider/FileManagerApiContext/index.js";
|
|
7
|
+
import { useFileManagerView } from "../../modules/FileManagerRenderer/FileManagerViewProvider/index.js";
|
|
8
|
+
import { getFilesLabel } from "./BulkActions.js";
|
|
9
9
|
export const ActionDelete = observer(() => {
|
|
10
10
|
const {
|
|
11
11
|
deleteFile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Tooltip","ReactComponent","DeleteIcon","observer","FileManagerViewConfig","useFileManagerApi","useFileManagerView","getFilesLabel","ActionDelete","deleteFile","canDelete","useWorker","useButtons","useDialog","Browser","BulkAction","ButtonDefault","worker","showConfirmationDialog","showResultsDialog","filesLabel","items","length","canDeleteAll","every","item","openDeleteDialog","title","message","loadingLabel","execute","processInSeries","report","id","success","name","e","error","resetItems","results","console","log","createElement","side","content","trigger","icon","onAction","size"],"sources":["ActionDelete.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Tooltip } from \"@webiny/admin-ui\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { observer } from \"mobx-react-lite\";\n\nimport { FileManagerViewConfig } from \"~/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig\";\nimport { useFileManagerApi } from \"~/modules/FileManagerApiProvider/FileManagerApiContext\";\nimport { useFileManagerView } from \"~/modules/FileManagerRenderer/FileManagerViewProvider\";\nimport { getFilesLabel } from \"~/components/BulkActions/BulkActions\";\n\nexport const ActionDelete = observer(() => {\n const { deleteFile } = useFileManagerView();\n const { canDelete } = useFileManagerApi();\n\n const { useWorker, useButtons, useDialog } = FileManagerViewConfig.Browser.BulkAction;\n const { ButtonDefault } = useButtons();\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n\n const filesLabel = useMemo(() => {\n return getFilesLabel(worker.items.length);\n }, [worker.items.length]);\n\n const canDeleteAll = useMemo(() => {\n return worker.items.every(item => canDelete(item));\n }, [worker.items]);\n\n const openDeleteDialog = () =>\n showConfirmationDialog({\n title: \"Delete files\",\n message: `You are about to delete ${filesLabel}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${filesLabel}`,\n execute: async () => {\n await worker.processInSeries(async ({ item, report }) => {\n try {\n await deleteFile(item.id);\n\n report.success({\n title: `${item.name}`,\n message: \"File successfully deleted.\"\n });\n } catch (e) {\n report.error({\n title: `${item.name}`,\n message: e.message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Delete files\",\n message: \"Finished deleting files! See full report below:\"\n });\n }\n });\n\n if (!canDeleteAll) {\n console.log(\"You don't have permissions to delete files.\");\n return null;\n }\n\n return (\n <Tooltip\n side={\"bottom\"}\n content={`Delete ${filesLabel}`}\n trigger={\n <ButtonDefault icon={<DeleteIcon />} onAction={openDeleteDialog} size={\"sm\"}>\n {`Delete`}\n </ButtonDefault>\n }\n />\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,cAAc,IAAIC,UAAU,QAAQ,0BAA0B;AACvE,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,qBAAqB;AAC9B,SAASC,iBAAiB;AAC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,CAAC;YACXP,KAAK,EAAE,GAAGF,IAAI,CAACU,IAAI,EAAE;YACrBP,OAAO,EAAE;UACb,CAAC,CAAC;QACN,CAAC,CAAC,OAAOQ,CAAC,EAAE;UACRJ,MAAM,CAACK,KAAK,CAAC;YACTV,KAAK,EAAE,GAAGF,IAAI,CAACU,IAAI,EAAE;YACrBP,OAAO,EAAEQ,CAAC,CAACR;UACf,CAAC,CAAC;QACN;MACJ,CAAC,CAAC;MAEFX,MAAM,CAACqB,UAAU,CAAC,CAAC;MAEnBnB,iBAAiB,CAAC;QACdoB,OAAO,EAAEtB,MAAM,CAACsB,OAAO;QACvBZ,KAAK,EAAE,cAAc;QACrBC,OAAO,EAAE;MACb,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;EAEN,IAAI,CAACL,YAAY,EAAE;IACfiB,OAAO,CAACC,GAAG,CAAC,6CAA6C,CAAC;IAC1D,OAAO,IAAI;EACf;EAEA,oBACI3C,KAAA,CAAA4C,aAAA,CAAC1C,OAAO;IACJ2C,IAAI,EAAE,QAAS;IACfC,OAAO,EAAE,UAAUxB,UAAU,EAAG;IAChCyB,OAAO,eACH/C,KAAA,CAAA4C,aAAA,CAAC1B,aAAa;MAAC8B,IAAI,eAAEhD,KAAA,CAAA4C,aAAA,CAACxC,UAAU,MAAE,CAAE;MAAC6C,QAAQ,EAAErB,gBAAiB;MAACsB,IAAI,EAAE;IAAK,GACvE,QACU;EAClB,CACJ,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useMemo","Tooltip","ReactComponent","DeleteIcon","observer","FileManagerViewConfig","useFileManagerApi","useFileManagerView","getFilesLabel","ActionDelete","deleteFile","canDelete","useWorker","useButtons","useDialog","Browser","BulkAction","ButtonDefault","worker","showConfirmationDialog","showResultsDialog","filesLabel","items","length","canDeleteAll","every","item","openDeleteDialog","title","message","loadingLabel","execute","processInSeries","report","id","success","name","e","error","resetItems","results","console","log","createElement","side","content","trigger","icon","onAction","size"],"sources":["ActionDelete.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Tooltip } from \"@webiny/admin-ui\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { observer } from \"mobx-react-lite\";\n\nimport { FileManagerViewConfig } from \"~/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js\";\nimport { useFileManagerApi } from \"~/modules/FileManagerApiProvider/FileManagerApiContext/index.js\";\nimport { useFileManagerView } from \"~/modules/FileManagerRenderer/FileManagerViewProvider/index.js\";\nimport { getFilesLabel } from \"~/components/BulkActions/BulkActions.js\";\n\nexport const ActionDelete = observer(() => {\n const { deleteFile } = useFileManagerView();\n const { canDelete } = useFileManagerApi();\n\n const { useWorker, useButtons, useDialog } = FileManagerViewConfig.Browser.BulkAction;\n const { ButtonDefault } = useButtons();\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n\n const filesLabel = useMemo(() => {\n return getFilesLabel(worker.items.length);\n }, [worker.items.length]);\n\n const canDeleteAll = useMemo(() => {\n return worker.items.every(item => canDelete(item));\n }, [worker.items]);\n\n const openDeleteDialog = () =>\n showConfirmationDialog({\n title: \"Delete files\",\n message: `You are about to delete ${filesLabel}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${filesLabel}`,\n execute: async () => {\n await worker.processInSeries(async ({ item, report }) => {\n try {\n await deleteFile(item.id);\n\n report.success({\n title: `${item.name}`,\n message: \"File successfully deleted.\"\n });\n } catch (e) {\n report.error({\n title: `${item.name}`,\n message: e.message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Delete files\",\n message: \"Finished deleting files! See full report below:\"\n });\n }\n });\n\n if (!canDeleteAll) {\n console.log(\"You don't have permissions to delete files.\");\n return null;\n }\n\n return (\n <Tooltip\n side={\"bottom\"}\n content={`Delete ${filesLabel}`}\n trigger={\n <ButtonDefault icon={<DeleteIcon />} onAction={openDeleteDialog} size={\"sm\"}>\n {`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Effect, useMemo } from "react";
|
|
2
2
|
import { observer } from "mobx-react-lite";
|
|
3
3
|
import { ReactComponent as EditIcon } from "@webiny/icons/edit.svg";
|
|
4
|
-
import { FileManagerViewConfig, useFileManagerViewConfig } from "../../../modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig";
|
|
5
|
-
import { useFileModel } from "../../../hooks/useFileModel";
|
|
6
|
-
import { BatchEditorDialog } from "./BatchEditorDialog";
|
|
7
|
-
import { ActionEditPresenter } from "./ActionEditPresenter";
|
|
8
|
-
import { useActionEditWorker } from "./useActionEditWorker";
|
|
4
|
+
import { FileManagerViewConfig, useFileManagerViewConfig } from "../../../modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js";
|
|
5
|
+
import { useFileModel } from "../../../hooks/useFileModel.js";
|
|
6
|
+
import { BatchEditorDialog } from "./BatchEditorDialog/index.js";
|
|
7
|
+
import { ActionEditPresenter } from "./ActionEditPresenter.js";
|
|
8
|
+
import { useActionEditWorker } from "./useActionEditWorker.js";
|
|
9
9
|
import { Tooltip } from "@webiny/admin-ui";
|
|
10
10
|
const {
|
|
11
11
|
useButtons
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","observer","ReactComponent","EditIcon","FileManagerViewConfig","useFileManagerViewConfig","useFileModel","BatchEditorDialog","ActionEditPresenter","useActionEditWorker","Tooltip","useButtons","Browser","BulkAction","ActionEdit","fields","allModelFields","config","ButtonDefault","fileDetails","find","field","name","filter","fieldId","worker","presenter","load","onBatchEditorSubmit","batch","closeEditor","openWorkerDialog","vm","show","canEditAll","console","log","createElement","Fragment","side","content","filesLabel","trigger","icon","onAction","openEditor","size","onClose","currentBatch","editorVm","onApply"],"sources":["ActionEdit.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as EditIcon } from \"@webiny/icons/edit.svg\";\nimport {\n FileManagerViewConfig,\n useFileManagerViewConfig\n} from \"~/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig\";\nimport { useFileModel } from \"~/hooks/useFileModel\";\nimport type { BatchDTO } from \"~/components/BulkActions/ActionEdit/domain\";\nimport { BatchEditorDialog } from \"./BatchEditorDialog\";\nimport { ActionEditPresenter } from \"./ActionEditPresenter\";\nimport { useActionEditWorker } from \"~/components/BulkActions/ActionEdit/useActionEditWorker\";\nimport { Tooltip } from \"@webiny/admin-ui\";\n\nconst { useButtons } = FileManagerViewConfig.Browser.BulkAction;\n\nexport const ActionEdit = observer(() => {\n const { fields: allModelFields } = useFileModel();\n const config = useFileManagerViewConfig();\n const { ButtonDefault } = useButtons();\n\n const fields = useMemo(() => {\n if (!config.fileDetails.fields.find(field => field.name === \"tags\")) {\n return allModelFields.filter(field => field.fieldId !== \"tags\");\n }\n\n return allModelFields;\n }, [config, allModelFields]);\n\n const worker = useActionEditWorker(fields);\n\n const presenter = useMemo<ActionEditPresenter>(() => {\n return new ActionEditPresenter();\n }, []);\n\n useEffect(() => {\n presenter.load(fields);\n }, [fields]);\n\n const onBatchEditorSubmit = useCallback(\n (batch: BatchDTO) => {\n presenter.closeEditor();\n worker.openWorkerDialog(batch);\n },\n [worker.openWorkerDialog]\n );\n\n if (!presenter.vm.show) {\n return null;\n }\n\n if (!worker.canEditAll) {\n console.log(\"You don't have permissions to edit files.\");\n return null;\n }\n\n return (\n <>\n <Tooltip\n side={\"bottom\"}\n content={`Edit ${worker.filesLabel}`}\n trigger={\n <ButtonDefault\n icon={<EditIcon />}\n onAction={() => presenter.openEditor()}\n size={\"sm\"}\n >\n {\"Edit\"}\n </ButtonDefault>\n }\n />\n <BatchEditorDialog\n onClose={() => presenter.closeEditor()}\n fields={presenter.vm.fields}\n batch={presenter.vm.currentBatch}\n vm={presenter.vm.editorVm}\n onApply={onBatchEditorSubmit}\n />\n </>\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,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,SAAS,CAACI,WAAW,CAAC,CAAC;IACvBL,MAAM,CAACM,gBAAgB,CAACF,KAAK,CAAC;EAClC,CAAC,EACD,CAACJ,MAAM,CAACM,gBAAgB,CAC5B,CAAC;EAED,IAAI,CAACL,SAAS,CAACM,EAAE,CAACC,IAAI,EAAE;IACpB,OAAO,IAAI;EACf;EAEA,IAAI,CAACR,MAAM,CAACS,UAAU,EAAE;IACpBC,OAAO,CAACC,GAAG,CAAC,2CAA2C,CAAC;IACxD,OAAO,IAAI;EACf;EAEA,oBACIvC,KAAA,CAAAwC,aAAA,CAAAxC,KAAA,CAAAyC,QAAA,qBACIzC,KAAA,CAAAwC,aAAA,CAAC3B,OAAO;IACJ6B,IAAI,EAAE,QAAS;IACfC,OAAO,EAAE,QAAQf,MAAM,CAACgB,UAAU,EAAG;IACrCC,OAAO,eACH7C,KAAA,CAAAwC,aAAA,CAACnB,aAAa;MACVyB,IAAI,eAAE9C,KAAA,CAAAwC,aAAA,CAAClC,QAAQ,MAAE,CAAE;MACnByC,QAAQ,EAAEA,CAAA,KAAMlB,SAAS,CAACmB,UAAU,CAAC,CAAE;MACvCC,IAAI,EAAE;IAAK,GAEV,MACU;EAClB,CACJ,CAAC,eACFjD,KAAA,CAAAwC,aAAA,CAAC9B,iBAAiB;IACdwC,OAAO,EAAEA,CAAA,KAAMrB,SAAS,CAACI,WAAW,CAAC,CAAE;IACvCf,MAAM,EAAEW,SAAS,CAACM,EAAE,CAACjB,MAAO;IAC5Bc,KAAK,EAAEH,SAAS,CAACM,EAAE,CAACgB,YAAa;IACjChB,EAAE,EAAEN,SAAS,CAACM,EAAE,CAACiB,QAAS;IAC1BC,OAAO,EAAEtB;EAAoB,CAChC,CACH,CAAC;AAEX,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","observer","ReactComponent","EditIcon","FileManagerViewConfig","useFileManagerViewConfig","useFileModel","BatchEditorDialog","ActionEditPresenter","useActionEditWorker","Tooltip","useButtons","Browser","BulkAction","ActionEdit","fields","allModelFields","config","ButtonDefault","fileDetails","find","field","name","filter","fieldId","worker","presenter","load","onBatchEditorSubmit","batch","closeEditor","openWorkerDialog","vm","show","canEditAll","console","log","createElement","Fragment","side","content","filesLabel","trigger","icon","onAction","openEditor","size","onClose","currentBatch","editorVm","onApply"],"sources":["ActionEdit.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as EditIcon } from \"@webiny/icons/edit.svg\";\nimport {\n FileManagerViewConfig,\n useFileManagerViewConfig\n} from \"~/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js\";\nimport { useFileModel } from \"~/hooks/useFileModel.js\";\nimport type { BatchDTO } from \"~/components/BulkActions/ActionEdit/domain/index.js\";\nimport { BatchEditorDialog } from \"./BatchEditorDialog/index.js\";\nimport { ActionEditPresenter } from \"./ActionEditPresenter.js\";\nimport { useActionEditWorker } from \"~/components/BulkActions/ActionEdit/useActionEditWorker.js\";\nimport { Tooltip } from \"@webiny/admin-ui\";\n\nconst { useButtons } = FileManagerViewConfig.Browser.BulkAction;\n\nexport const ActionEdit = observer(() => {\n const { fields: allModelFields } = useFileModel();\n const config = useFileManagerViewConfig();\n const { ButtonDefault } = useButtons();\n\n const fields = useMemo(() => {\n if (!config.fileDetails.fields.find(field => field.name === \"tags\")) {\n return allModelFields.filter(field => field.fieldId !== \"tags\");\n }\n\n return allModelFields;\n }, [config, allModelFields]);\n\n const worker = useActionEditWorker(fields);\n\n const presenter = useMemo<ActionEditPresenter>(() => {\n return new ActionEditPresenter();\n }, []);\n\n useEffect(() => {\n presenter.load(fields);\n }, [fields]);\n\n const onBatchEditorSubmit = useCallback(\n (batch: BatchDTO) => {\n presenter.closeEditor();\n worker.openWorkerDialog(batch);\n },\n [worker.openWorkerDialog]\n );\n\n if (!presenter.vm.show) {\n return null;\n }\n\n if (!worker.canEditAll) {\n console.log(\"You don't have permissions to edit files.\");\n return null;\n }\n\n return (\n <>\n <Tooltip\n side={\"bottom\"}\n content={`Edit ${worker.filesLabel}`}\n trigger={\n <ButtonDefault\n icon={<EditIcon />}\n onAction={() => presenter.openEditor()}\n size={\"sm\"}\n >\n {\"Edit\"}\n </ButtonDefault>\n }\n />\n <BatchEditorDialog\n onClose={() => presenter.closeEditor()}\n fields={presenter.vm.fields}\n batch={presenter.vm.currentBatch}\n vm={presenter.vm.editorVm}\n onApply={onBatchEditorSubmit}\n />\n </>\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAC9D,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,cAAc,IAAIC,QAAQ,QAAQ,wBAAwB;AACnE,SACIC,qBAAqB,EACrBC,wBAAwB;AAE5B,SAASC,YAAY;AAErB,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,mBAAmB;AAC5B,SAASC,OAAO,QAAQ,kBAAkB;AAE1C,MAAM;EAAEC;AAAW,CAAC,GAAGP,qBAAqB,CAACQ,OAAO,CAACC,UAAU;AAE/D,OAAO,MAAMC,UAAU,GAAGb,QAAQ,CAAC,MAAM;EACrC,MAAM;IAAEc,MAAM,EAAEC;EAAe,CAAC,GAAGV,YAAY,CAAC,CAAC;EACjD,MAAMW,MAAM,GAAGZ,wBAAwB,CAAC,CAAC;EACzC,MAAM;IAAEa;EAAc,CAAC,GAAGP,UAAU,CAAC,CAAC;EAEtC,MAAMI,MAAM,GAAGf,OAAO,CAAC,MAAM;IACzB,IAAI,CAACiB,MAAM,CAACE,WAAW,CAACJ,MAAM,CAACK,IAAI,CAACC,KAAK,IAAIA,KAAK,CAACC,IAAI,KAAK,MAAM,CAAC,EAAE;MACjE,OAAON,cAAc,CAACO,MAAM,CAACF,KAAK,IAAIA,KAAK,CAACG,OAAO,KAAK,MAAM,CAAC;IACnE;IAEA,OAAOR,cAAc;EACzB,CAAC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ACI,WAAW,CAAC,CAAE;IACvCf,MAAM,EAAEW,SAAS,CAACM,EAAE,CAACjB,MAAO;IAC5Bc,KAAK,EAAEH,SAAS,CAACM,EAAE,CAACgB,YAAa;IACjChB,EAAE,EAAEN,SAAS,CAACM,EAAE,CAACiB,QAAS;IAC1BC,OAAO,EAAEtB;EAAoB,CAChC,CACH,CAAC;AAEX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { FileItem } from "
|
|
1
|
+
import type { FileItem } from "../../../types.js";
|
|
2
2
|
export type ActionFormData = Partial<Omit<FileItem, "id">>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["ActionEdit.types.ts"],"sourcesContent":["import type { FileItem } from \"
|
|
1
|
+
{"version":3,"names":[],"sources":["ActionEdit.types.ts"],"sourcesContent":["import type { FileItem } from \"~/types.js\";\n\nexport type ActionFormData = Partial<Omit<FileItem, \"id\">>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BatchDTO, FieldDTO, FieldRaw } from "
|
|
1
|
+
import type { BatchDTO, FieldDTO, FieldRaw } from "../../../components/BulkActions/ActionEdit/domain/index.js";
|
|
2
2
|
interface IActionEditPresenter {
|
|
3
3
|
load: (fields: FieldRaw[]) => void;
|
|
4
4
|
openEditor: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeAutoObservable } from "mobx";
|
|
2
|
-
import { Batch, BatchMapper, Field, FieldMapper } from "./domain";
|
|
2
|
+
import { Batch, BatchMapper, Field, FieldMapper } from "./domain/index.js";
|
|
3
3
|
function isBulkEditableField(field) {
|
|
4
4
|
return field.tags && field.tags.includes("$bulk-edit");
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["makeAutoObservable","Batch","BatchMapper","Field","FieldMapper","isBulkEditableField","field","tags","includes","ActionEditPresenter","showEditor","constructor","fields","currentBatch","toDTO","createEmpty","load","getBuiltInFields","getExtensionFields","vm","show","length","editorVm","openEditor","closeEditor","builtInFields","filter","fieldId","map","createFromRaw","extensions","find","settings","extensionFields","extFields","value","isOpen"],"sources":["ActionEditPresenter.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\n\nimport type {
|
|
1
|
+
{"version":3,"names":["makeAutoObservable","Batch","BatchMapper","Field","FieldMapper","isBulkEditableField","field","tags","includes","ActionEditPresenter","showEditor","constructor","fields","currentBatch","toDTO","createEmpty","load","getBuiltInFields","getExtensionFields","vm","show","length","editorVm","openEditor","closeEditor","builtInFields","filter","fieldId","map","createFromRaw","extensions","find","settings","extensionFields","extFields","value","isOpen"],"sources":["ActionEditPresenter.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\n\nimport type {\n BatchDTO,\n FieldDTO,\n FieldRaw\n} from \"~/components/BulkActions/ActionEdit/domain/index.js\";\nimport {\n Batch,\n BatchMapper,\n Field,\n FieldMapper\n} from \"~/components/BulkActions/ActionEdit/domain/index.js\";\n\nfunction isBulkEditableField(field: FieldRaw) {\n return field.tags && field.tags.includes(\"$bulk-edit\");\n}\n\ninterface IActionEditPresenter {\n load: (fields: FieldRaw[]) => void;\n openEditor: () => void;\n closeEditor: () => void;\n get vm(): {\n show: boolean;\n currentBatch: BatchDTO;\n fields: FieldDTO[];\n editorVm: {\n isOpen: boolean;\n };\n };\n}\n\nexport class ActionEditPresenter implements IActionEditPresenter {\n private showEditor = false;\n private readonly currentBatch: BatchDTO;\n private fields: FieldDTO[];\n\n constructor() {\n this.fields = [];\n this.currentBatch = BatchMapper.toDTO(Batch.createEmpty());\n makeAutoObservable(this);\n }\n\n load(fields: FieldRaw[]) {\n this.fields = [...this.getBuiltInFields(fields), ...this.getExtensionFields(fields)];\n }\n\n get vm() {\n return {\n show: this.fields.length > 0,\n currentBatch: this.currentBatch,\n fields: this.fields,\n editorVm: this.editorVm\n };\n }\n\n openEditor() {\n this.showEditor = true;\n }\n\n closeEditor() {\n this.showEditor = false;\n }\n\n private getBuiltInFields(fields: FieldRaw[]) {\n const builtInFields = fields\n .filter(field => field.fieldId !== \"extensions\")\n .filter(isBulkEditableField);\n\n return FieldMapper.toDTO(builtInFields.map(field => Field.createFromRaw(field)));\n }\n\n private getExtensionFields(fields: FieldRaw[]) {\n const extensions = fields.find(field => field.fieldId === \"extensions\");\n\n if (!extensions?.settings?.fields) {\n return [];\n }\n\n const extensionFields = extensions.settings.fields.filter(isBulkEditableField) || [];\n\n const extFields = FieldMapper.toDTO(\n extensionFields.map(field => Field.createFromRaw(field))\n );\n\n return extFields.map(field => {\n return { ...field, value: `extensions.${field.value}` };\n });\n }\n\n private get editorVm() {\n return {\n isOpen: this.showEditor\n };\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AAOzC,SACIC,KAAK,EACLC,WAAW,EACXC,KAAK,EACLC,WAAW;AAGf,SAASC,mBAAmBA,CAACC,KAAe,EAAE;EAC1C,OAAOA,KAAK,CAACC,IAAI,IAAID,KAAK,CAACC,IAAI,CAACC,QAAQ,CAAC,YAAY,CAAC;AAC1D;AAgBA,OAAO,MAAMC,mBAAmB,CAAiC;EACrDC,UAAU,GAAG,KAAK;EAI1BC,WAAWA,CAAA,EAAG;IACV,IAAI,CAACC,MAAM,GAAG,EAAE;IAChB,IAAI,CAACC,YAAY,GAAGX,WAAW,CAACY,KAAK,CAACb,KAAK,CAACc,WAAW,CAAC,CAAC,CAAC;IAC1Df,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAgB,IAAIA,CAACJ,MAAkB,EAAE;IACrB,IAAI,CAACA,MAAM,GAAG,CAAC,GAAG,IAAI,CAACK,gBAAgB,CAACL,MAAM,CAAC,EAAE,GAAG,IAAI,CAACM,kBAAkB,CAACN,MAAM,CAAC,CAAC;EACxF;EAEA,IAAIO,EAAEA,CAAA,EAAG;IACL,OAAO;MACHC,IAAI,EAAE,IAAI,CAACR,MAAM,CAACS,MAAM,GA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N;EAEA,IAAYb,QAAQA,CAAA,EAAG;IACnB,OAAO;MACHc,MAAM,EAAE,IAAI,CAAC1B;IACjB,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { describe, it, expect, beforeEach, vi } from "vitest";
|
|
2
|
+
import { ActionEditPresenter } from "./ActionEditPresenter.js";
|
|
2
3
|
describe("ActionEditPresenter", () => {
|
|
3
4
|
const extensionFields = [{
|
|
4
5
|
id: "field1",
|
|
@@ -18,7 +19,7 @@ describe("ActionEditPresenter", () => {
|
|
|
18
19
|
renderer: {
|
|
19
20
|
name: "ref-inputs"
|
|
20
21
|
},
|
|
21
|
-
|
|
22
|
+
list: true,
|
|
22
23
|
settings: {
|
|
23
24
|
models: [{
|
|
24
25
|
modelId: "any-model"
|
|
@@ -50,7 +51,7 @@ describe("ActionEditPresenter", () => {
|
|
|
50
51
|
name: "required",
|
|
51
52
|
message: "Value is required."
|
|
52
53
|
}],
|
|
53
|
-
|
|
54
|
+
list: false,
|
|
54
55
|
predefinedValues: {
|
|
55
56
|
values: [],
|
|
56
57
|
enabled: false
|
|
@@ -70,7 +71,7 @@ describe("ActionEditPresenter", () => {
|
|
|
70
71
|
},
|
|
71
72
|
listValidation: [],
|
|
72
73
|
validation: [],
|
|
73
|
-
|
|
74
|
+
list: false,
|
|
74
75
|
predefinedValues: {
|
|
75
76
|
values: [],
|
|
76
77
|
enabled: false
|
|
@@ -82,7 +83,7 @@ describe("ActionEditPresenter", () => {
|
|
|
82
83
|
};
|
|
83
84
|
let presenter;
|
|
84
85
|
beforeEach(() => {
|
|
85
|
-
|
|
86
|
+
vi.clearAllMocks();
|
|
86
87
|
presenter = new ActionEditPresenter();
|
|
87
88
|
});
|
|
88
89
|
it("should create a presenter and load extensions fields", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["describe","it","expect","beforeEach","vi","ActionEditPresenter","extensionFields","id","fieldId","label","type","renderer","name","tags","storageId","list","settings","models","modelId","createFields","listValidation","validation","message","predefinedValues","values","enabled","layout","map","field","fields","presenter","clearAllMocks","load","vm","show","toEqual","currentBatch","operations","operator","value","undefined","operators","raw","editorVm","isOpen","toBe","openEditor","closeEditor"],"sources":["ActionEditPresenter.test.ts"],"sourcesContent":["import { describe, it, expect, beforeEach, vi } from \"vitest\";\nimport { ActionEditPresenter } from \"./ActionEditPresenter.js\";\nimport { type FieldRaw } from \"~/components/BulkActions/ActionEdit/domain/index.js\";\n\ndescribe(\"ActionEditPresenter\", () => {\n const extensionFields = [\n {\n id: \"field1\",\n fieldId: \"field1\",\n label: \"Field 1\",\n type: \"text\",\n renderer: {\n name: \"text-input\"\n },\n tags: [\"$bulk-edit\"],\n storageId: \"text@field1\"\n },\n {\n id: \"field2\",\n fieldId: \"field2\",\n label: \"Field 2\",\n type: \"ref\",\n renderer: {\n name: \"ref-inputs\"\n },\n list: true,\n settings: {\n models: [\n {\n modelId: \"any-model\"\n }\n ]\n },\n tags: [\"$bulk-edit\"],\n storageId: \"ref@field2\"\n },\n {\n id: \"field3\",\n fieldId: \"field3\",\n label: \"Field 3\",\n type: \"number\",\n renderer: {\n name: \"number-input\"\n },\n tags: [],\n storageId: \"number@field3\"\n }\n ];\n\n const createFields = (extensionFields: FieldRaw[]) => {\n return [\n {\n id: \"name\",\n storageId: \"text@name\",\n fieldId: \"name\",\n label: \"Name\",\n type: \"text\",\n settings: {},\n listValidation: [],\n validation: [\n {\n name: \"required\",\n message: \"Value is required.\"\n }\n ],\n list: false,\n predefinedValues: {\n values: [],\n enabled: false\n },\n renderer: {\n name: \"text-input\"\n }\n },\n {\n id: \"extensions\",\n storageId: \"object@extensions\",\n fieldId: \"extensions\",\n label: \"Extensions\",\n type: \"object\",\n settings: {\n layout: extensionFields.map(field => [field.id]),\n fields: extensionFields\n },\n listValidation: [],\n validation: [],\n list: false,\n predefinedValues: {\n values: [],\n enabled: false\n },\n renderer: {\n name: \"any\"\n }\n }\n ];\n };\n\n let presenter: ActionEditPresenter;\n\n beforeEach(() => {\n vi.clearAllMocks();\n presenter = new ActionEditPresenter();\n });\n\n it(\"should create a presenter and load extensions fields\", () => {\n presenter.load(createFields(extensionFields));\n\n // I should see the bulk edit action\n expect(presenter.vm.show).toEqual(true);\n\n // I should receive a `currentBatch`\n expect(presenter.vm.currentBatch).toEqual({\n operations: [\n {\n field: \"\",\n operator: \"\",\n value: undefined\n }\n ]\n });\n\n // I should receive the `fields` available for bulk edit\n expect(presenter.vm.fields).toEqual([\n {\n label: \"Field 1\",\n value: \"extensions.field1\",\n operators: [\n {\n label: \"Override existing values\",\n value: \"OVERRIDE\"\n },\n {\n label: \"Clear all existing values\",\n value: \"REMOVE\"\n }\n ],\n raw: extensionFields[0]\n },\n {\n label: \"Field 2\",\n value: \"extensions.field2\",\n operators: [\n {\n label: \"Override existing values\",\n value: \"OVERRIDE\"\n },\n {\n label: \"Clear all existing values\",\n value: \"REMOVE\"\n },\n {\n label: \"Append to existing values\",\n value: \"APPEND\"\n }\n ],\n raw: extensionFields[1]\n }\n ]);\n\n // I should receive the editor.vm\n expect(presenter.vm.editorVm).toEqual({\n isOpen: false\n });\n });\n\n it(\"should not show the bulk action if no `extensions` fields are defined\", () => {\n presenter.load(createFields([]));\n\n // The editor action should not be rendered\n expect(presenter.vm.show).toBe(false);\n });\n\n it(\"should open / close the editor\", () => {\n presenter.load(createFields(extensionFields));\n\n // The editor should be closed by default\n expect(presenter.vm.editorVm.isOpen).toBe(false);\n\n // Let's open the editor\n presenter.openEditor();\n expect(presenter.vm.editorVm.isOpen).toBe(true);\n\n // Let's open the editor\n presenter.closeEditor();\n expect(presenter.vm.editorVm.isOpen).toBe(false);\n });\n});\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,EAAEC,UAAU,EAAEC,EAAE,QAAQ,QAAQ;AAC7D,SAASC,mBAAmB;AAG5BL,QAAQ,CAAC,qBAAqB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MAAM,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;;IAE/C;IACAf,SAAS,CAACiB,WAAW,CAAC,CAAC;IACvB7C,MAAM,CAAC4B,SAAS,CAACG,EAAE,CAACU,QAAQ,CAACC,MAAM,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;EACpD,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ export const AddOperation = ({
|
|
|
6
6
|
onClick
|
|
7
7
|
}) => {
|
|
8
8
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
className: "
|
|
9
|
+
className: "mt-lg text-center"
|
|
10
10
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
11
11
|
onClick: onClick,
|
|
12
12
|
text: "Add new operation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Button","ReactComponent","AddIcon","AddOperation","disabled","onClick","createElement","className","text","icon","variant"],"sources":["AddOperation.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button } from \"@webiny/admin-ui\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\n\ninterface AddOperationProps {\n disabled: boolean;\n onClick: () => void;\n}\n\nexport const AddOperation = ({ disabled, onClick }: AddOperationProps) => {\n return (\n <div className={\"
|
|
1
|
+
{"version":3,"names":["React","Button","ReactComponent","AddIcon","AddOperation","disabled","onClick","createElement","className","text","icon","variant"],"sources":["AddOperation.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button } from \"@webiny/admin-ui\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\n\ninterface AddOperationProps {\n disabled: boolean;\n onClick: () => void;\n}\n\nexport const AddOperation = ({ disabled, onClick }: AddOperationProps) => {\n return (\n <div className={\"mt-lg text-center\"}>\n <Button\n onClick={onClick}\n text={\"Add new operation\"}\n icon={<AddIcon />}\n variant={\"secondary\"}\n disabled={disabled}\n />\n </div>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,cAAc,IAAIC,OAAO,QAAQ,uBAAuB;AAOjE,OAAO,MAAMC,YAAY,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAA2B,CAAC,KAAK;EACtE,oBACIN,KAAA,CAAAO,aAAA;IAAKC,SAAS,EAAE;EAAoB,gBAChCR,KAAA,CAAAO,aAAA,CAACN,MAAM;IACHK,OAAO,EAAEA,OAAQ;IACjBG,IAAI,EAAE,mBAAoB;IAC1BC,IAAI,eAAEV,KAAA,CAAAO,aAAA,CAACJ,OAAO,MAAE,CAAE;IAClBQ,OAAO,EAAE,WAAY;IACrBN,QAAQ,EAAEA;EAAS,CACtB,CACA,CAAC;AAEd,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { FormAPI, FormOnSubmit } from "@webiny/form";
|
|
3
|
-
import type { BatchEditorDialogViewModel, BatchEditorFormData } from "
|
|
3
|
+
import type { BatchEditorDialogViewModel, BatchEditorFormData } from "../../../../components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.js";
|
|
4
4
|
export interface BatchEditorProps {
|
|
5
5
|
onForm: (form: FormAPI) => void;
|
|
6
6
|
onAdd: () => void;
|