@webiny/app-file-manager 6.0.0-beta.0 → 6.0.0-rc.0
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 +75 -112
- package/BatchFileUploader.js.map +1 -1
- package/README.md +7 -28
- package/app.js +9 -14
- package/app.js.map +1 -1
- package/components/BottomInfoBar/BottomInfoBar.d.ts +3 -3
- package/components/BottomInfoBar/BottomInfoBar.js +14 -17
- package/components/BottomInfoBar/BottomInfoBar.js.map +1 -1
- package/components/BottomInfoBar/ListStatus.js +17 -21
- package/components/BottomInfoBar/ListStatus.js.map +1 -1
- package/components/BottomInfoBar/SupportedFileTypes.d.ts +4 -2
- package/components/BottomInfoBar/SupportedFileTypes.js +37 -26
- package/components/BottomInfoBar/SupportedFileTypes.js.map +1 -1
- package/components/BottomInfoBar/index.d.ts +1 -1
- package/components/BottomInfoBar/index.js +1 -16
- package/components/BottomInfoBar/index.js.map +1 -1
- package/components/BulkActions/ActionDelete.js +70 -71
- package/components/BulkActions/ActionDelete.js.map +1 -1
- package/components/BulkActions/ActionEdit/ActionEdit.js +38 -45
- package/components/BulkActions/ActionEdit/ActionEdit.js.map +1 -1
- package/components/BulkActions/ActionEdit/ActionEdit.types.d.ts +2 -2
- package/components/BulkActions/ActionEdit/ActionEdit.types.js +1 -5
- 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 +45 -80
- package/components/BulkActions/ActionEdit/ActionEditPresenter.js.map +1 -1
- package/components/BulkActions/ActionEdit/ActionEditPresenter.test.js +16 -19
- package/components/BulkActions/ActionEdit/ActionEditPresenter.test.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/AddOperation.js +15 -18
- package/components/BulkActions/ActionEdit/BatchEditorDialog/AddOperation.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditor.d.ts +2 -2
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditor.js +33 -54
- 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 +36 -46
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialog.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.d.ts +5 -10
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.js +125 -173
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.test.js +58 -49
- 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 +20 -28
- 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 +34 -46
- 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 -16
- 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 +41 -51
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.js.map +1 -1
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.test.js +90 -77
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.test.js.map +1 -1
- package/components/BulkActions/ActionEdit/domain/Batch.js +23 -38
- package/components/BulkActions/ActionEdit/domain/Batch.js.map +1 -1
- package/components/BulkActions/ActionEdit/domain/BatchMapper.d.ts +1 -1
- package/components/BulkActions/ActionEdit/domain/BatchMapper.js +10 -27
- package/components/BulkActions/ActionEdit/domain/BatchMapper.js.map +1 -1
- package/components/BulkActions/ActionEdit/domain/Field.d.ts +2 -2
- package/components/BulkActions/ActionEdit/domain/Field.js +31 -53
- 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 +18 -41
- 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 -49
- 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 -16
- package/components/BulkActions/ActionEdit/index.js.map +1 -1
- package/components/BulkActions/ActionEdit/useActionEditWorker.d.ts +2 -2
- package/components/BulkActions/ActionEdit/useActionEditWorker.js +44 -48
- package/components/BulkActions/ActionEdit/useActionEditWorker.js.map +1 -1
- package/components/BulkActions/ActionMove.js +64 -61
- package/components/BulkActions/ActionMove.js.map +1 -1
- package/components/BulkActions/BulkActions.js +35 -38
- package/components/BulkActions/BulkActions.js.map +1 -1
- package/components/BulkActions/index.d.ts +4 -4
- package/components/BulkActions/index.js +4 -43
- package/components/BulkActions/index.js.map +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrl.d.ts +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrl.js +31 -43
- package/components/EditFileUsingUrl/EditFileUsingUrl.js.map +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.d.ts +2 -2
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.js +39 -49
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.js.map +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.d.ts +2 -2
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.js +32 -49
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.js.map +1 -1
- package/components/EditFileUsingUrl/GetFileByUrl.d.ts +4 -4
- package/components/EditFileUsingUrl/GetFileByUrl.js +22 -34
- package/components/EditFileUsingUrl/GetFileByUrl.js.map +1 -1
- package/components/EditFileUsingUrl/Loading.js +30 -53
- package/components/EditFileUsingUrl/Loading.js.map +1 -1
- package/components/EditFileUsingUrl/UpdateFile.d.ts +4 -4
- package/components/EditFileUsingUrl/UpdateFile.js +6 -19
- package/components/EditFileUsingUrl/UpdateFile.js.map +1 -1
- package/components/EditFileUsingUrl/getFileByUrl.graphql.d.ts +1 -1
- package/components/EditFileUsingUrl/getFileByUrl.graphql.js +16 -13
- package/components/EditFileUsingUrl/getFileByUrl.graphql.js.map +1 -1
- package/components/EditFileUsingUrl/index.d.ts +1 -1
- package/components/EditFileUsingUrl/index.js +1 -16
- package/components/EditFileUsingUrl/index.js.map +1 -1
- package/components/Empty/Empty.d.ts +1 -1
- package/components/Empty/Empty.js +18 -23
- package/components/Empty/Empty.js.map +1 -1
- package/components/Empty/index.d.ts +1 -1
- package/components/Empty/index.js +1 -16
- package/components/Empty/index.js.map +1 -1
- package/components/FileDetails/FileDetails.d.ts +2 -2
- package/components/FileDetails/FileDetails.js +116 -140
- package/components/FileDetails/FileDetails.js.map +1 -1
- package/components/FileDetails/FileDetailsProvider.d.ts +1 -1
- package/components/FileDetails/FileDetailsProvider.js +11 -17
- package/components/FileDetails/FileDetailsProvider.js.map +1 -1
- package/components/FileDetails/components/ActionButton.d.ts +2 -1
- package/components/FileDetails/components/ActionButton.js +17 -24
- package/components/FileDetails/components/ActionButton.js.map +1 -1
- package/components/FileDetails/components/Actions.js +11 -34
- package/components/FileDetails/components/Actions.js.map +1 -1
- package/components/FileDetails/components/BaseFields.d.ts +1 -1
- package/components/FileDetails/components/BaseFields.js +14 -22
- package/components/FileDetails/components/BaseFields.js.map +1 -1
- package/components/FileDetails/components/Content.d.ts +2 -1
- package/components/FileDetails/components/Content.js +28 -41
- package/components/FileDetails/components/Content.js.map +1 -1
- package/components/FileDetails/components/CreatedOn.js +19 -52
- package/components/FileDetails/components/CreatedOn.js.map +1 -1
- package/components/FileDetails/components/Description.d.ts +2 -0
- package/components/FileDetails/components/Description.js +23 -0
- package/components/FileDetails/components/Description.js.map +1 -0
- package/components/FileDetails/components/Extensions.d.ts +1 -1
- package/components/FileDetails/components/Extensions.js +19 -50
- package/components/FileDetails/components/Extensions.js.map +1 -1
- package/components/FileDetails/components/Preview.js +9 -27
- package/components/FileDetails/components/Preview.js.map +1 -1
- package/components/FileDetails/components/Thumbnail.js +13 -18
- package/components/FileDetails/components/Thumbnail.js.map +1 -1
- package/components/FileDetails/index.d.ts +1 -1
- package/components/FileDetails/index.js +1 -16
- package/components/FileDetails/index.js.map +1 -1
- package/components/FileDropArea/FileDropArea.d.ts +9 -0
- package/components/FileDropArea/FileDropArea.js +69 -0
- package/components/FileDropArea/FileDropArea.js.map +1 -0
- package/components/FileDropArea/index.d.ts +1 -0
- package/components/FileDropArea/index.js +3 -0
- package/components/FileDropArea/index.js.map +1 -0
- package/components/FileDropPlaceholder/FileDropPlaceholder.d.ts +2 -0
- package/components/FileDropPlaceholder/FileDropPlaceholder.js +12 -0
- package/components/FileDropPlaceholder/FileDropPlaceholder.js.map +1 -0
- package/components/FileDropPlaceholder/index.d.ts +1 -0
- package/components/FileDropPlaceholder/index.js +3 -0
- package/components/FileDropPlaceholder/index.js.map +1 -0
- package/components/Filters/Filters.js +26 -0
- package/components/Filters/Filters.js.map +1 -0
- package/components/Filters/index.d.ts +1 -0
- package/components/Filters/index.js +3 -0
- package/components/Filters/index.js.map +1 -0
- package/components/Grid/ActionButton.d.ts +2 -1
- package/components/Grid/ActionButton.js +24 -21
- package/components/Grid/ActionButton.js.map +1 -1
- package/components/Grid/File.d.ts +23 -7
- package/components/Grid/File.js +77 -52
- package/components/Grid/File.js.map +1 -1
- package/components/Grid/Grid.d.ts +7 -4
- package/components/Grid/Grid.js +60 -67
- package/components/Grid/Grid.js.map +1 -1
- package/components/Grid/Thumbnail.js +13 -18
- package/components/Grid/Thumbnail.js.map +1 -1
- package/components/Grid/index.d.ts +1 -1
- package/components/Grid/index.js +1 -16
- package/components/Grid/index.js.map +1 -1
- package/components/Header/Actions.d.ts +5 -0
- package/components/Header/Actions.js +99 -0
- package/components/Header/Actions.js.map +1 -0
- package/components/Header/Header.d.ts +9 -0
- package/components/Header/Header.js +21 -0
- package/components/Header/Header.js.map +1 -0
- package/components/Header/Title.d.ts +2 -0
- package/components/Header/Title.js +55 -0
- package/components/Header/Title.js.map +1 -0
- package/components/Header/index.d.ts +1 -0
- package/components/Header/index.js +3 -0
- package/components/Header/index.js.map +1 -0
- package/components/ImageEditor/ImageEditor.d.ts +45 -0
- package/components/ImageEditor/ImageEditor.js +218 -0
- package/components/ImageEditor/ImageEditor.js.map +1 -0
- package/components/ImageEditor/ImageEditorDialog.d.ts +16 -0
- package/components/ImageEditor/ImageEditorDialog.js +53 -0
- package/components/ImageEditor/ImageEditorDialog.js.map +1 -0
- package/components/ImageEditor/index.d.ts +1 -0
- package/components/ImageEditor/index.js +3 -0
- package/components/ImageEditor/index.js.map +1 -0
- package/components/ImageEditor/toolbar/crop.d.ts +4 -0
- package/components/ImageEditor/toolbar/crop.js +67 -0
- package/components/ImageEditor/toolbar/crop.js.map +1 -0
- package/components/ImageEditor/toolbar/filter.d.ts +3 -0
- package/components/ImageEditor/toolbar/filter.js +167 -0
- package/components/ImageEditor/toolbar/filter.js.map +1 -0
- package/components/ImageEditor/toolbar/flip.d.ts +4 -0
- package/components/ImageEditor/toolbar/flip.js +94 -0
- package/components/ImageEditor/toolbar/flip.js.map +1 -0
- package/components/ImageEditor/toolbar/index.d.ts +4 -0
- package/components/ImageEditor/toolbar/index.js +6 -0
- package/components/ImageEditor/toolbar/index.js.map +1 -0
- package/components/ImageEditor/toolbar/rotate.d.ts +4 -0
- package/components/ImageEditor/toolbar/rotate.js +93 -0
- package/components/ImageEditor/toolbar/rotate.js.map +1 -0
- package/components/ImageEditor/toolbar/types.d.ts +32 -0
- package/components/ImageEditor/toolbar/types.js +3 -0
- package/components/ImageEditor/toolbar/types.js.map +1 -0
- package/components/LayoutSwitch/LayoutSwitch.js +18 -29
- package/components/LayoutSwitch/LayoutSwitch.js.map +1 -1
- package/components/LayoutSwitch/index.d.ts +1 -1
- package/components/LayoutSwitch/index.js +1 -16
- package/components/LayoutSwitch/index.js.map +1 -1
- package/components/NoPermissions/NoPermissions.d.ts +2 -0
- package/components/NoPermissions/NoPermissions.js +28 -0
- package/components/NoPermissions/NoPermissions.js.map +1 -0
- package/components/NoPermissions/index.d.ts +1 -0
- package/components/NoPermissions/index.js +3 -0
- package/components/NoPermissions/index.js.map +1 -0
- package/components/NoResults/NoResults.js +19 -15
- package/components/NoResults/NoResults.js.map +1 -1
- package/components/NoResults/index.d.ts +1 -1
- package/components/NoResults/index.js +1 -16
- package/components/NoResults/index.js.map +1 -1
- package/components/SearchWidget/SearchWidget.js +30 -0
- package/components/SearchWidget/SearchWidget.js.map +1 -0
- package/components/SearchWidget/index.d.ts +1 -0
- package/components/SearchWidget/index.js +3 -0
- package/components/SearchWidget/index.js.map +1 -0
- package/components/Table/Actions/CopyFile.js +19 -22
- package/components/Table/Actions/CopyFile.js.map +1 -1
- package/components/Table/Actions/DeleteFile.js +23 -25
- package/components/Table/Actions/DeleteFile.js.map +1 -1
- package/components/Table/Actions/EditFile.js +18 -23
- package/components/Table/Actions/EditFile.js.map +1 -1
- package/components/Table/Actions/MoveFile.js +15 -19
- 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 -49
- package/components/Table/Actions/index.js.map +1 -1
- package/components/Table/Cells/CellActions.js +25 -30
- package/components/Table/Cells/CellActions.js.map +1 -1
- package/components/Table/Cells/CellAuthor.js +13 -14
- package/components/Table/Cells/CellAuthor.js.map +1 -1
- package/components/Table/Cells/CellCreated.js +15 -16
- package/components/Table/Cells/CellCreated.js.map +1 -1
- package/components/Table/Cells/CellModified.js +15 -16
- package/components/Table/Cells/CellModified.js.map +1 -1
- package/components/Table/Cells/CellName.d.ts +4 -4
- package/components/Table/Cells/CellName.js +55 -48
- package/components/Table/Cells/CellName.js.map +1 -1
- package/components/Table/Cells/CellSize.js +13 -18
- package/components/Table/Cells/CellSize.js.map +1 -1
- package/components/Table/Cells/CellThumbnail.d.ts +2 -0
- package/components/Table/Cells/CellThumbnail.js +16 -0
- package/components/Table/Cells/CellThumbnail.js.map +1 -0
- package/components/Table/Cells/CellType.js +12 -17
- 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 -82
- package/components/Table/Cells/index.js.map +1 -1
- package/components/Table/Table.d.ts +4 -4
- package/components/Table/Table.js +23 -21
- package/components/Table/Table.js.map +1 -1
- package/components/Table/index.d.ts +3 -3
- package/components/Table/index.js +3 -38
- package/components/Table/index.js.map +1 -1
- package/{modules/FileManagerRenderer/FileManagerView/components → components}/TagsList/Empty.d.ts +1 -1
- package/components/TagsList/Empty.js +11 -0
- package/components/TagsList/Empty.js.map +1 -0
- package/components/TagsList/FilterSelect.d.ts +2 -0
- package/components/TagsList/FilterSelect.js +28 -0
- package/components/TagsList/FilterSelect.js.map +1 -0
- package/components/TagsList/FilterStatus.d.ts +7 -0
- package/components/TagsList/FilterStatus.js +27 -0
- package/components/TagsList/FilterStatus.js.map +1 -0
- package/{modules/FileManagerRenderer/FileManagerView/components → components}/TagsList/Tag.d.ts +2 -2
- package/components/TagsList/Tag.js +16 -0
- package/components/TagsList/Tag.js.map +1 -0
- package/components/TagsList/Tags.d.ts +8 -0
- package/components/TagsList/Tags.js +32 -0
- package/components/TagsList/Tags.js.map +1 -0
- package/{modules/FileManagerRenderer/FileManagerView/components → components}/TagsList/TagsList.d.ts +1 -1
- package/components/TagsList/TagsList.js +31 -0
- package/components/TagsList/TagsList.js.map +1 -0
- package/components/TagsList/index.d.ts +1 -0
- package/components/TagsList/index.js +3 -0
- package/components/TagsList/index.js.map +1 -0
- package/components/Thumbnail/Thumbnail.d.ts +2 -0
- package/components/Thumbnail/Thumbnail.js +16 -0
- package/components/Thumbnail/Thumbnail.js.map +1 -0
- package/components/Thumbnail/index.d.ts +1 -0
- package/components/Thumbnail/index.js +3 -0
- package/components/Thumbnail/index.js.map +1 -0
- package/components/UploadStatus/UploadStatus.d.ts +3 -1
- package/components/UploadStatus/UploadStatus.js +33 -32
- package/components/UploadStatus/UploadStatus.js.map +1 -1
- package/components/UploadStatus/index.d.ts +1 -1
- package/components/UploadStatus/index.js +1 -16
- package/components/UploadStatus/index.js.map +1 -1
- package/components/fields/AccessControl.js +31 -31
- package/components/fields/AccessControl.js.map +1 -1
- package/components/fields/Name.js +21 -23
- package/components/fields/Name.js.map +1 -1
- package/components/fields/Tags.js +30 -30
- package/components/fields/Tags.js.map +1 -1
- package/components/fields/index.d.ts +3 -4
- package/components/fields/index.js +3 -49
- package/components/fields/index.js.map +1 -1
- package/components/fields/useAccessControlField.d.ts +1 -2
- package/components/fields/useAccessControlField.js +9 -21
- package/components/fields/useAccessControlField.js.map +1 -1
- package/components/fields/useFileOrUndefined.js +4 -10
- package/components/fields/useFileOrUndefined.js.map +1 -1
- package/constants.d.ts +2 -2
- package/constants.js +4 -16
- package/constants.js.map +1 -1
- package/contexts/FileProvider.d.ts +1 -1
- package/contexts/FileProvider.js +12 -18
- package/contexts/FileProvider.js.map +1 -1
- package/hooks/useCopyFile.d.ts +1 -1
- package/hooks/useCopyFile.js +18 -24
- package/hooks/useCopyFile.js.map +1 -1
- package/hooks/useDeleteFile.d.ts +1 -1
- package/hooks/useDeleteFile.js +35 -62
- package/hooks/useDeleteFile.js.map +1 -1
- package/hooks/useFile.d.ts +1 -1
- package/hooks/useFile.js +5 -12
- package/hooks/useFile.js.map +1 -1
- package/hooks/useFileDetails.d.ts +1 -1
- package/hooks/useFileDetails.js +5 -12
- package/hooks/useFileDetails.js.map +1 -1
- package/hooks/useFileModel.js +5 -12
- package/hooks/useFileModel.js.map +1 -1
- package/hooks/useMoveFileToFolder.d.ts +1 -1
- package/hooks/useMoveFileToFolder.js +19 -21
- package/hooks/useMoveFileToFolder.js.map +1 -1
- package/index.d.ts +8 -8
- package/index.js +8 -101
- package/index.js.map +1 -1
- package/modules/Enterprise/HandleWebsocketMessages.d.ts +1 -0
- package/modules/Enterprise/HandleWebsocketMessages.js +57 -0
- package/modules/Enterprise/HandleWebsocketMessages.js.map +1 -0
- package/modules/Enterprise/components/ThreatScanInProgressFileBody.d.ts +2 -0
- package/modules/Enterprise/components/ThreatScanInProgressFileBody.js +23 -0
- package/modules/Enterprise/components/ThreatScanInProgressFileBody.js.map +1 -0
- package/modules/Enterprise/components/ThreatScanInProgressTableCell.d.ts +6 -0
- package/modules/Enterprise/components/ThreatScanInProgressTableCell.js +32 -0
- package/modules/Enterprise/components/ThreatScanInProgressTableCell.js.map +1 -0
- package/modules/Enterprise/constants.d.ts +3 -0
- package/modules/Enterprise/constants.js +5 -0
- package/modules/Enterprise/constants.js.map +1 -0
- package/modules/Enterprise/index.d.ts +2 -0
- package/modules/Enterprise/index.js +40 -0
- package/modules/Enterprise/index.js.map +1 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.d.ts +2 -3
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.js +138 -129
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.d.ts +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.js +14 -25
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.d.ts +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.js +28 -11
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileUploader.d.ts +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileUploader.js +3 -9
- 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 -26
- package/modules/FileManagerApiProvider/FileManagerApiContext/index.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.d.ts +2 -2
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.js +4 -11
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.js.map +1 -1
- package/modules/FileManagerApiProvider/graphql.d.ts +8 -9
- package/modules/FileManagerApiProvider/graphql.js +116 -27
- package/modules/FileManagerApiProvider/graphql.js.map +1 -1
- package/modules/FileManagerApiProvider/index.js +11 -17
- package/modules/FileManagerApiProvider/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/CopyUrl.js +18 -25
- package/modules/FileManagerRenderer/FileActions/FileDetails/CopyUrl.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/DeleteImage.js +26 -39
- package/modules/FileManagerRenderer/FileActions/FileDetails/DeleteImage.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/Download.js +15 -23
- package/modules/FileManagerRenderer/FileActions/FileDetails/Download.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/EditImage.js +48 -59
- package/modules/FileManagerRenderer/FileActions/FileDetails/EditImage.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/FileDetails/MoveToFolder.js +14 -22
- package/modules/FileManagerRenderer/FileActions/FileDetails/MoveToFolder.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/Grid/Delete.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Delete.js +29 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Delete.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Download.js +16 -19
- package/modules/FileManagerRenderer/FileActions/Grid/Download.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/Grid/MoveToFolder.js +14 -17
- package/modules/FileManagerRenderer/FileActions/Grid/MoveToFolder.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/Grid/Settings.js +15 -18
- package/modules/FileManagerRenderer/FileActions/Grid/Settings.js.map +1 -1
- package/modules/FileManagerRenderer/FileActions/index.js +33 -38
- package/modules/FileManagerRenderer/FileActions/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/FileManagerView.js +168 -233
- package/modules/FileManagerRenderer/FileManagerView/FileManagerView.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.d.ts +216 -63
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js +55 -48
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/LeftSidebar.d.ts +1 -1
- package/modules/FileManagerRenderer/FileManagerView/LeftSidebar.js +42 -48
- package/modules/FileManagerRenderer/FileManagerView/LeftSidebar.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkAction.d.ts +2 -2
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkAction.js +34 -45
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkAction.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkEditField.js +11 -17
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkEditField.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FileAction.d.ts +5 -5
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FileAction.js +8 -22
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FileAction.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Filter.d.ts +20 -4
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Filter.js +20 -29
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Filter.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FilterByTags.js +7 -13
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FilterByTags.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FiltersToWhere.js +7 -13
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FiltersToWhere.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderAction.d.ts +4 -4
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderAction.js +8 -22
- 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/FolderFieldDecorator.d.ts +7 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderFieldDecorator.js +16 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderFieldDecorator.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Action.d.ts +15 -3
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Action.js +18 -27
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Action.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Thumbnail.d.ts +15 -3
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Thumbnail.js +13 -19
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Thumbnail.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/index.d.ts +2 -2
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/index.js +1 -5
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.d.ts +29 -6
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.js +10 -22
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Thumbnail.d.ts +28 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Thumbnail.js +30 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Thumbnail.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/index.d.ts +50 -5
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/index.js +7 -9
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.d.ts +148 -41
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.js +40 -31
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Action.d.ts +15 -3
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Action.js +17 -26
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Action.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Field.d.ts +20 -4
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Field.js +20 -29
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Field.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/FieldDecorator.d.ts +3 -3
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/FieldDecorator.js +16 -24
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/FieldDecorator.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/GroupFields.js +8 -14
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/GroupFields.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Thumbnail.d.ts +15 -3
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Thumbnail.js +12 -18
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Thumbnail.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Width.js +8 -14
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Width.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/index.d.ts +58 -19
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/index.js +15 -21
- 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 +7 -16
- package/modules/FileManagerRenderer/FileManagerView/getThumbnailRenderer.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/index.d.ts +1 -1
- package/modules/FileManagerRenderer/FileManagerView/index.js +55 -64
- package/modules/FileManagerRenderer/FileManagerView/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/outputFileSelectionError.d.ts +1 -1
- package/modules/FileManagerRenderer/FileManagerView/outputFileSelectionError.js +6 -17
- package/modules/FileManagerRenderer/FileManagerView/outputFileSelectionError.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/FileManagerViewContext.d.ts +30 -15
- package/modules/FileManagerRenderer/FileManagerViewProvider/FileManagerViewContext.js +300 -310
- 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 -27
- package/modules/FileManagerRenderer/FileManagerViewProvider/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.d.ts +7 -5
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.js +30 -45
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.d.ts +5 -3
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.js +5 -9
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.d.ts +2 -2
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.js +4 -10
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.d.ts +7 -7
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.js +92 -92
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useTags.d.ts +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useTags.js +63 -81
- package/modules/FileManagerRenderer/FileManagerViewProvider/useTags.js.map +1 -1
- package/modules/FileManagerRenderer/filters/FilterByType.js +9 -16
- package/modules/FileManagerRenderer/filters/FilterByType.js.map +1 -1
- package/modules/FileManagerRenderer/index.js +87 -84
- package/modules/FileManagerRenderer/index.js.map +1 -1
- package/modules/HeadlessCms/fileField.d.ts +1 -1
- package/modules/HeadlessCms/fileField.js +13 -21
- package/modules/HeadlessCms/fileField.js.map +1 -1
- package/modules/HeadlessCms/fileRenderer/fileField.d.ts +1 -1
- package/modules/HeadlessCms/fileRenderer/fileField.js +50 -92
- package/modules/HeadlessCms/fileRenderer/fileField.js.map +1 -1
- package/modules/HeadlessCms/fileRenderer/fileFields.d.ts +1 -1
- package/modules/HeadlessCms/fileRenderer/fileFields.js +78 -148
- package/modules/HeadlessCms/fileRenderer/fileFields.js.map +1 -1
- package/modules/HeadlessCms/fileRenderer/utils.d.ts +1 -11
- package/modules/HeadlessCms/fileRenderer/utils.js +3 -53
- package/modules/HeadlessCms/fileRenderer/utils.js.map +1 -1
- package/modules/HeadlessCms/index.js +8 -14
- package/modules/HeadlessCms/index.js.map +1 -1
- package/modules/SecurityPermissions.d.ts +2 -0
- package/modules/SecurityPermissions.js +36 -0
- package/modules/SecurityPermissions.js.map +1 -0
- package/modules/Settings/graphql.js +32 -15
- package/modules/Settings/graphql.js.map +1 -1
- package/modules/Settings/index.js +34 -32
- package/modules/Settings/index.js.map +1 -1
- package/modules/Settings/views/FileManagerSettings.js +146 -113
- package/modules/Settings/views/FileManagerSettings.js.map +1 -1
- package/modules/ThumbnailRenderers/FilePreviewDefaultRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/FilePreviewDefaultRenderer.js +12 -0
- package/modules/ThumbnailRenderers/FilePreviewDefaultRenderer.js.map +1 -0
- package/modules/ThumbnailRenderers/FilePreviewImageRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/FilePreviewImageRenderer.js +19 -0
- package/modules/ThumbnailRenderers/FilePreviewImageRenderer.js.map +1 -0
- package/modules/ThumbnailRenderers/GridItemDefaultRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/GridItemDefaultRenderer.js +12 -0
- package/modules/ThumbnailRenderers/GridItemDefaultRenderer.js.map +1 -0
- package/modules/ThumbnailRenderers/GridItemImageRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/GridItemImageRenderer.js +19 -0
- package/modules/ThumbnailRenderers/GridItemImageRenderer.js.map +1 -0
- package/modules/ThumbnailRenderers/TableItemDefaultRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/TableItemDefaultRenderer.js +19 -0
- package/modules/ThumbnailRenderers/TableItemDefaultRenderer.js.map +1 -0
- package/modules/ThumbnailRenderers/TableItemImageRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/TableItemImageRenderer.js +19 -0
- package/modules/ThumbnailRenderers/TableItemImageRenderer.js.map +1 -0
- package/package.json +32 -43
- 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 +31 -37
- package/tagsHelpers.js.map +1 -1
- package/types.d.ts +55 -12
- package/types.js +1 -12
- package/types.js.map +1 -1
- package/components/BottomInfoBar/styled.d.ts +0 -21
- package/components/BottomInfoBar/styled.js +0 -81
- package/components/BottomInfoBar/styled.js.map +0 -1
- package/components/BulkActions/ActionEdit/ActionEdit.styled.d.ts +0 -28
- package/components/BulkActions/ActionEdit/ActionEdit.styled.js +0 -77
- package/components/BulkActions/ActionEdit/ActionEdit.styled.js.map +0 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/RemoveOperation.d.ts +0 -7
- package/components/BulkActions/ActionEdit/BatchEditorDialog/RemoveOperation.js +0 -26
- package/components/BulkActions/ActionEdit/BatchEditorDialog/RemoveOperation.js.map +0 -1
- package/components/BulkActions/BulkActions.styled.d.ts +0 -13
- package/components/BulkActions/BulkActions.styled.js +0 -46
- package/components/BulkActions/BulkActions.styled.js.map +0 -1
- package/components/DropFilesHere/DropFilesHere.d.ts +0 -8
- package/components/DropFilesHere/DropFilesHere.js +0 -28
- package/components/DropFilesHere/DropFilesHere.js.map +0 -1
- package/components/DropFilesHere/index.d.ts +0 -1
- package/components/DropFilesHere/index.js +0 -18
- package/components/DropFilesHere/index.js.map +0 -1
- package/components/DropFilesHere/styled.d.ts +0 -22
- package/components/DropFilesHere/styled.js +0 -61
- package/components/DropFilesHere/styled.js.map +0 -1
- package/components/FileDetails/components/Flex.d.ts +0 -7
- package/components/FileDetails/components/Flex.js +0 -48
- package/components/FileDetails/components/Flex.js.map +0 -1
- package/components/FileDetails/components/Footer.d.ts +0 -2
- package/components/FileDetails/components/Footer.js +0 -40
- package/components/FileDetails/components/Footer.js.map +0 -1
- package/components/FileDetails/components/Header.d.ts +0 -2
- package/components/FileDetails/components/Header.js +0 -40
- package/components/FileDetails/components/Header.js.map +0 -1
- package/components/FileDetails/components/PreviewMeta.d.ts +0 -2
- package/components/FileDetails/components/PreviewMeta.js +0 -31
- package/components/FileDetails/components/PreviewMeta.js.map +0 -1
- package/components/FileDetails/components/TypeAndSize.d.ts +0 -2
- package/components/FileDetails/components/TypeAndSize.js +0 -67
- package/components/FileDetails/components/TypeAndSize.js.map +0 -1
- package/components/Grid/styled.d.ts +0 -41
- package/components/Grid/styled.js +0 -137
- package/components/Grid/styled.js.map +0 -1
- package/components/NoPermission/NoPermission.d.ts +0 -2
- package/components/NoPermission/NoPermission.js +0 -25
- package/components/NoPermission/NoPermission.js.map +0 -1
- package/components/NoPermission/index.d.ts +0 -1
- package/components/NoPermission/index.js +0 -18
- package/components/NoPermission/index.js.map +0 -1
- package/components/NoPermission/styled.d.ts +0 -24
- package/components/NoPermission/styled.js +0 -97
- package/components/NoPermission/styled.js.map +0 -1
- package/components/NoResults/styled.d.ts +0 -5
- package/components/NoResults/styled.js +0 -25
- package/components/NoResults/styled.js.map +0 -1
- package/components/Table/Cells/Cells.styled.d.ts +0 -12
- package/components/Table/Cells/Cells.styled.js +0 -54
- package/components/Table/Cells/Cells.styled.js.map +0 -1
- package/components/Title/Title.d.ts +0 -5
- package/components/Title/Title.js +0 -21
- package/components/Title/Title.js.map +0 -1
- package/components/Title/index.d.ts +0 -1
- package/components/Title/index.js +0 -18
- package/components/Title/index.js.map +0 -1
- package/components/Title/styled.d.ts +0 -4
- package/components/Title/styled.js +0 -26
- package/components/Title/styled.js.map +0 -1
- package/components/UploadStatus/assets/check.svg +0 -3
- package/components/UploadStatus/assets/loading.svg +0 -17
- package/components/UploadStatus/styled.d.ts +0 -39
- package/components/UploadStatus/styled.js +0 -127
- package/components/UploadStatus/styled.js.map +0 -1
- package/components/fields/Aliases.d.ts +0 -2
- package/components/fields/Aliases.js +0 -136
- package/components/fields/Aliases.js.map +0 -1
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.d.ts +0 -4
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.js +0 -37
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.js.map +0 -1
- package/modules/FileManagerRenderer/FileManagerView/components/Filters.js +0 -33
- package/modules/FileManagerRenderer/FileManagerView/components/Filters.js.map +0 -1
- package/modules/FileManagerRenderer/FileManagerView/components/SearchWidget.js +0 -98
- package/modules/FileManagerRenderer/FileManagerView/components/SearchWidget.js.map +0 -1
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/Empty.js +0 -19
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/Empty.js.map +0 -1
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/Tag.js +0 -29
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/Tag.js.map +0 -1
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/TagsList.js +0 -74
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/TagsList.js.map +0 -1
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/index.d.ts +0 -1
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/index.js +0 -18
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/index.js.map +0 -1
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/styled.d.ts +0 -21
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/styled.js +0 -61
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/styled.js.map +0 -1
- package/modules/HeadlessCms/fileRenderer/File.d.ts +0 -10
- package/modules/HeadlessCms/fileRenderer/File.js +0 -86
- package/modules/HeadlessCms/fileRenderer/File.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 -232
- 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 -29
- package/modules/Settings/plugins/permissionRenderer/index.js.map +0 -1
- package/modules/ThumbnailRenderers/DefaultRenderer.d.ts +0 -2
- package/modules/ThumbnailRenderers/DefaultRenderer.js +0 -25
- package/modules/ThumbnailRenderers/DefaultRenderer.js.map +0 -1
- package/modules/ThumbnailRenderers/ImageRenderer.d.ts +0 -2
- package/modules/ThumbnailRenderers/ImageRenderer.js +0 -29
- package/modules/ThumbnailRenderers/ImageRenderer.js.map +0 -1
- /package/{modules/FileManagerRenderer/FileManagerView/components → components/Filters}/Filters.d.ts +0 -0
- /package/{modules/FileManagerRenderer/FileManagerView/components → components/SearchWidget}/SearchWidget.d.ts +0 -0
|
@@ -1,188 +1,140 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.BatchEditorDialogPresenter = void 0;
|
|
8
|
-
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
var _mobx = require("mobx");
|
|
14
|
-
var _domain = require("../domain");
|
|
15
|
-
var BatchEditorDialogPresenter = exports.BatchEditorDialogPresenter = /*#__PURE__*/function () {
|
|
16
|
-
function BatchEditorDialogPresenter() {
|
|
17
|
-
var _this = this;
|
|
18
|
-
(0, _classCallCheck2.default)(this, BatchEditorDialogPresenter);
|
|
19
|
-
(0, _defineProperty2.default)(this, "invalidFields", {});
|
|
20
|
-
(0, _defineProperty2.default)(this, "formWasSubmitted", false);
|
|
21
|
-
(0, _defineProperty2.default)(this, "getOperations", function () {
|
|
22
|
-
return _this.batch?.operations.map(function (operation, operationIndex) {
|
|
23
|
-
var fieldOptions = _this.getFieldOptions(operation.field);
|
|
24
|
-
var selectedField = fieldOptions.find(function (field) {
|
|
25
|
-
return field.value === operation.field;
|
|
26
|
-
});
|
|
27
|
-
var operatorOptions = selectedField?.operators || [];
|
|
28
|
-
return {
|
|
29
|
-
title: _this.getOperationTitle(operation.field, operation.operator) ?? "Operation #".concat(operationIndex + 1),
|
|
30
|
-
open: true,
|
|
31
|
-
field: operation.field,
|
|
32
|
-
operator: operation.operator,
|
|
33
|
-
value: operation.value,
|
|
34
|
-
canDelete: operationIndex !== 0,
|
|
35
|
-
fieldOptions: fieldOptions,
|
|
36
|
-
selectedField: selectedField,
|
|
37
|
-
operatorOptions: operatorOptions
|
|
38
|
-
};
|
|
39
|
-
}) || [];
|
|
40
|
-
});
|
|
1
|
+
import { makeAutoObservable } from "mobx";
|
|
2
|
+
import { Batch } from "../domain/index.js";
|
|
3
|
+
export class BatchEditorDialogPresenter {
|
|
4
|
+
invalidFields = {};
|
|
5
|
+
formWasSubmitted = false;
|
|
6
|
+
constructor() {
|
|
41
7
|
this.batch = undefined;
|
|
42
8
|
this.fields = [];
|
|
43
|
-
|
|
9
|
+
makeAutoObservable(this);
|
|
44
10
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
invalidFields: this.invalidFields,
|
|
58
|
-
canAddOperation: canAddOperation,
|
|
59
|
-
data: {
|
|
60
|
-
operations: operations
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}, {
|
|
65
|
-
key: "addOperation",
|
|
66
|
-
value: function addOperation() {
|
|
67
|
-
if (!this.batch) {
|
|
68
|
-
return;
|
|
11
|
+
load(batch, fields) {
|
|
12
|
+
this.batch = batch;
|
|
13
|
+
this.fields = fields;
|
|
14
|
+
}
|
|
15
|
+
get vm() {
|
|
16
|
+
const operations = this.getOperations();
|
|
17
|
+
const canAddOperation = operations[operations.length - 1].fieldOptions.length > 1;
|
|
18
|
+
return {
|
|
19
|
+
invalidFields: this.invalidFields,
|
|
20
|
+
canAddOperation,
|
|
21
|
+
data: {
|
|
22
|
+
operations
|
|
69
23
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
addOperation() {
|
|
27
|
+
if (!this.batch) {
|
|
28
|
+
return;
|
|
75
29
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
30
|
+
this.batch.operations.push({
|
|
31
|
+
field: "",
|
|
32
|
+
operator: "",
|
|
33
|
+
value: undefined
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
deleteOperation(operationIndex) {
|
|
37
|
+
if (!this.batch) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.batch.operations = this.batch.operations.filter((_, index) => index !== operationIndex);
|
|
85
41
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
42
|
+
// Make sure we always have at least 1 operation!
|
|
43
|
+
if (this.batch.operations.length === 0) {
|
|
44
|
+
this.addOperation();
|
|
90
45
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
this.batch.operations = [].concat((0, _toConsumableArray2.default)(this.batch.operations.slice(0, batchIndex)), [{
|
|
98
|
-
field: data,
|
|
99
|
-
operator: "",
|
|
100
|
-
value: undefined
|
|
101
|
-
}], (0, _toConsumableArray2.default)(this.batch.operations.slice(batchIndex + 1)));
|
|
46
|
+
}
|
|
47
|
+
setOperationFieldData(batchIndex, data) {
|
|
48
|
+
if (!this.batch) {
|
|
49
|
+
return;
|
|
102
50
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
field: operation.field,
|
|
113
|
-
operator: operation.operator,
|
|
114
|
-
value: operation.value
|
|
115
|
-
};
|
|
116
|
-
})
|
|
117
|
-
});
|
|
118
|
-
if (this.formWasSubmitted) {
|
|
119
|
-
this.validateBatch(this.batch);
|
|
120
|
-
}
|
|
51
|
+
this.batch.operations = [...this.batch.operations.slice(0, batchIndex), {
|
|
52
|
+
field: data,
|
|
53
|
+
operator: "",
|
|
54
|
+
value: undefined
|
|
55
|
+
}, ...this.batch.operations.slice(batchIndex + 1)];
|
|
56
|
+
}
|
|
57
|
+
setBatch(data) {
|
|
58
|
+
if (!this.batch) {
|
|
59
|
+
return;
|
|
121
60
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
onError && onError(this.batch, this.invalidFields);
|
|
133
|
-
}
|
|
61
|
+
this.batch = {
|
|
62
|
+
...this.batch,
|
|
63
|
+
operations: data.operations.map(operation => ({
|
|
64
|
+
field: operation.field,
|
|
65
|
+
operator: operation.operator,
|
|
66
|
+
value: operation.value
|
|
67
|
+
}))
|
|
68
|
+
};
|
|
69
|
+
if (this.formWasSubmitted) {
|
|
70
|
+
this.validateBatch(this.batch);
|
|
134
71
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return undefined;
|
|
140
|
-
}
|
|
141
|
-
var field = this.fields.find(function (field) {
|
|
142
|
-
return field.value === inputField;
|
|
143
|
-
});
|
|
144
|
-
if (!field) {
|
|
145
|
-
return undefined;
|
|
146
|
-
}
|
|
147
|
-
var operator = field.operators.find(function (operator) {
|
|
148
|
-
return operator.value === inputOperation;
|
|
149
|
-
});
|
|
150
|
-
if (!operator) {
|
|
151
|
-
return undefined;
|
|
152
|
-
}
|
|
153
|
-
return "".concat(operator.label, " for field \"").concat(field.label, "\"");
|
|
72
|
+
}
|
|
73
|
+
onApply(onSuccess, onError) {
|
|
74
|
+
if (!this.batch) {
|
|
75
|
+
return;
|
|
154
76
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return [];
|
|
161
|
-
}
|
|
162
|
-
var existings = this.batch.operations.filter(function (operation) {
|
|
163
|
-
return operation.field !== currentFieldId;
|
|
164
|
-
}).map(function (operation) {
|
|
165
|
-
return operation.field;
|
|
166
|
-
});
|
|
167
|
-
return this.fields.filter(function (field) {
|
|
168
|
-
return !existings.includes(field.value);
|
|
169
|
-
});
|
|
77
|
+
const result = this.validateBatch(this.batch);
|
|
78
|
+
if (result.success) {
|
|
79
|
+
onSuccess && onSuccess(this.batch);
|
|
80
|
+
} else {
|
|
81
|
+
onError && onError(this.batch, this.invalidFields);
|
|
170
82
|
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
83
|
+
}
|
|
84
|
+
getOperations = () => {
|
|
85
|
+
return this.batch?.operations.map((operation, operationIndex) => {
|
|
86
|
+
const fieldOptions = this.getFieldOptions(operation.field);
|
|
87
|
+
const selectedField = fieldOptions.find(field => field.value === operation.field);
|
|
88
|
+
const operatorOptions = selectedField?.operators || [];
|
|
89
|
+
return {
|
|
90
|
+
title: this.getOperationTitle(operation.field, operation.operator) ?? `Operation #${operationIndex + 1}`,
|
|
91
|
+
open: true,
|
|
92
|
+
field: operation.field,
|
|
93
|
+
operator: operation.operator,
|
|
94
|
+
value: operation.value,
|
|
95
|
+
canDelete: operationIndex !== 0,
|
|
96
|
+
fieldOptions,
|
|
97
|
+
selectedField,
|
|
98
|
+
operatorOptions
|
|
99
|
+
};
|
|
100
|
+
}) || [];
|
|
101
|
+
};
|
|
102
|
+
getOperationTitle(inputField, inputOperation) {
|
|
103
|
+
if (!inputField || !inputOperation) {
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
const field = this.fields.find(field => field.value === inputField);
|
|
107
|
+
if (!field) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
const operator = field.operators.find(operator => operator.value === inputOperation);
|
|
111
|
+
if (!operator) {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
return `${operator.label} for field "${field.label}"`;
|
|
115
|
+
}
|
|
116
|
+
getFieldOptions(currentFieldId = "") {
|
|
117
|
+
if (!this.batch) {
|
|
118
|
+
return [];
|
|
184
119
|
}
|
|
185
|
-
|
|
186
|
-
|
|
120
|
+
const existings = this.batch.operations.filter(operation => operation.field !== currentFieldId).map(operation => operation.field);
|
|
121
|
+
return this.fields.filter(field => !existings.includes(field.value));
|
|
122
|
+
}
|
|
123
|
+
validateBatch(data) {
|
|
124
|
+
this.formWasSubmitted = true;
|
|
125
|
+
const validation = Batch.validate(data);
|
|
126
|
+
if (!validation.success) {
|
|
127
|
+
this.invalidFields = validation.error.issues.reduce((acc, issue) => {
|
|
128
|
+
return {
|
|
129
|
+
...acc,
|
|
130
|
+
[issue.path.join(".")]: issue.message
|
|
131
|
+
};
|
|
132
|
+
}, {});
|
|
133
|
+
} else {
|
|
134
|
+
this.invalidFields = {};
|
|
135
|
+
}
|
|
136
|
+
return validation;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
187
139
|
|
|
188
140
|
//# sourceMappingURL=BatchEditorDialogPresenter.js.map
|
package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_mobx","require","_domain","BatchEditorDialogPresenter","exports","_this","_classCallCheck2","default","_defineProperty2","batch","operations","map","operation","operationIndex","fieldOptions","getFieldOptions","field","selectedField","find","value","operatorOptions","operators","title","getOperationTitle","operator","concat","open","canDelete","undefined","fields","makeAutoObservable","_createClass2","key","load","get","getOperations","canAddOperation","length","invalidFields","data","addOperation","push","deleteOperation","filter","_","index","setOperationFieldData","batchIndex","_toConsumableArray2","slice","setBatch","_objectSpread3","formWasSubmitted","validateBatch","onApply","onSuccess","onError","result","success","inputField","inputOperation","label","currentFieldId","arguments","existings","includes","validation","Batch","validate","error","issues","reduce","acc","issue","path","join","message"],"sources":["BatchEditorDialogPresenter.tsx"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\n\nimport {\n Batch,\n BatchDTO,\n FieldDTO,\n OperationDTO,\n OperatorDTO\n} from \"~/components/BulkActions/ActionEdit/domain\";\n\nexport interface IBatchEditorDialogPresenter {\n load(batch: BatchDTO, fields: FieldDTO[]): void;\n addOperation(): void;\n deleteOperation(operationIndex: number): void;\n setOperationFieldData(operationIndex: number, data: string): void;\n setBatch(data: any): void;\n onApply(onSuccess?: (batch: BatchDTO) => void, onError?: (batch: BatchDTO) => void): void;\n get vm(): BatchEditorDialogViewModel;\n}\n\nexport interface BatchEditorDialogViewModel {\n invalidFields: Record<string, { isValid: boolean; message: string }>;\n canAddOperation: boolean;\n data: BatchEditorFormData;\n}\n\nexport interface BatchEditorFormData {\n operations: OperationFormData[];\n}\n\nexport type OperationFormData = OperationDTO & {\n canDelete: boolean;\n title: string;\n open: boolean;\n fieldOptions: FieldDTO[];\n operatorOptions: OperatorDTO[];\n selectedField?: FieldDTO;\n};\n\nexport class BatchEditorDialogPresenter implements IBatchEditorDialogPresenter {\n private batch: BatchDTO | undefined;\n private fields: FieldDTO[];\n private invalidFields: BatchEditorDialogViewModel[\"invalidFields\"] = {};\n private formWasSubmitted = false;\n\n constructor() {\n this.batch = undefined;\n this.fields = [];\n makeAutoObservable(this);\n }\n\n load(batch: BatchDTO, fields: FieldDTO[]) {\n this.batch = batch;\n this.fields = fields;\n }\n\n get vm() {\n const operations = this.getOperations();\n const canAddOperation = operations[operations.length - 1].fieldOptions.length > 1 ?? false;\n\n return {\n invalidFields: this.invalidFields,\n canAddOperation,\n data: {\n operations\n }\n };\n }\n\n addOperation(): void {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations.push({\n field: \"\",\n operator: \"\",\n value: undefined\n });\n }\n\n deleteOperation(operationIndex: number): void {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations = this.batch.operations.filter(\n (_, index) => index !== operationIndex\n );\n\n // Make sure we always have at least 1 operation!\n if (this.batch.operations.length === 0) {\n this.addOperation();\n }\n }\n\n setOperationFieldData(batchIndex: number, data: string) {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations = [\n ...this.batch.operations.slice(0, batchIndex),\n {\n field: data,\n operator: \"\",\n value: undefined\n },\n ...this.batch.operations.slice(batchIndex + 1)\n ];\n }\n\n setBatch(data: BatchEditorFormData): void {\n if (!this.batch) {\n return;\n }\n\n this.batch = {\n ...this.batch,\n operations: data.operations.map(operation => ({\n field: operation.field,\n operator: operation.operator,\n value: operation.value\n }))\n };\n\n if (this.formWasSubmitted) {\n this.validateBatch(this.batch);\n }\n }\n\n onApply(\n onSuccess?: (batch: BatchDTO) => void,\n onError?: (\n batch: BatchDTO,\n invalidFields: BatchEditorDialogViewModel[\"invalidFields\"]\n ) => void\n ) {\n if (!this.batch) {\n return;\n }\n\n const result = this.validateBatch(this.batch);\n if (result.success) {\n onSuccess && onSuccess(this.batch);\n } else {\n onError && onError(this.batch, this.invalidFields);\n }\n }\n\n private getOperations = () => {\n return (\n this.batch?.operations.map((operation: OperationDTO, operationIndex) => {\n const fieldOptions = this.getFieldOptions(operation.field);\n const selectedField = fieldOptions.find(field => field.value === operation.field);\n const operatorOptions = selectedField?.operators || [];\n\n return {\n title:\n this.getOperationTitle(operation.field, operation.operator) ??\n `Operation #${operationIndex + 1}`,\n open: true,\n field: operation.field,\n operator: operation.operator,\n value: operation.value,\n canDelete: operationIndex !== 0,\n fieldOptions,\n selectedField,\n operatorOptions\n };\n }) || []\n );\n };\n\n private getOperationTitle(inputField?: string, inputOperation?: string) {\n if (!inputField || !inputOperation) {\n return undefined;\n }\n\n const field = this.fields.find(field => field.value === inputField);\n\n if (!field) {\n return undefined;\n }\n\n const operator = field.operators.find(operator => operator.value === inputOperation);\n\n if (!operator) {\n return undefined;\n }\n\n return `${operator.label} for field \"${field.label}\"`;\n }\n\n private getFieldOptions(currentFieldId = \"\") {\n if (!this.batch) {\n return [];\n }\n\n const existings = this.batch.operations\n .filter(operation => operation.field !== currentFieldId)\n .map(operation => operation.field);\n\n return this.fields.filter(field => !existings.includes(field.value));\n }\n\n private validateBatch(data: BatchDTO) {\n this.formWasSubmitted = true;\n const validation = Batch.validate(data);\n\n if (!validation.success) {\n this.invalidFields = validation.error.issues.reduce((acc, issue) => {\n return {\n ...acc,\n [issue.path.join(\".\")]: issue.message\n };\n }, {});\n } else {\n this.invalidFields = {};\n }\n\n return validation;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAMoD,IA+BvCE,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA;EAMnC,SAAAA,2BAAA,EAAc;IAAA,IAAAE,KAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,0BAAA;IAAA,IAAAK,gBAAA,CAAAD,OAAA,yBAHuD,CAAC,CAAC;IAAA,IAAAC,gBAAA,CAAAD,OAAA,4BAC5C,KAAK;IAAA,IAAAC,gBAAA,CAAAD,OAAA,yBA2GR,YAAM;MAC1B,OACIF,KAAI,CAACI,KAAK,EAAEC,UAAU,CAACC,GAAG,CAAC,UAACC,SAAuB,EAAEC,cAAc,EAAK;QACpE,IAAMC,YAAY,GAAGT,KAAI,CAACU,eAAe,CAACH,SAAS,CAACI,KAAK,CAAC;QAC1D,IAAMC,aAAa,GAAGH,YAAY,CAACI,IAAI,CAAC,UAAAF,KAAK;UAAA,OAAIA,KAAK,CAACG,KAAK,KAAKP,SAAS,CAACI,KAAK;QAAA,EAAC;QACjF,IAAMI,eAAe,GAAGH,aAAa,EAAEI,SAAS,IAAI,EAAE;QAEtD,OAAO;UACHC,KAAK,EACDjB,KAAI,CAACkB,iBAAiB,CAACX,SAAS,CAACI,KAAK,EAAEJ,SAAS,CAACY,QAAQ,CAAC,kBAAAC,MAAA,CAC7CZ,cAAc,GAAG,CAAC,CAAE;UACtCa,IAAI,EAAE,IAAI;UACVV,KAAK,EAAEJ,SAAS,CAACI,KAAK;UACtBQ,QAAQ,EAAEZ,SAAS,CAACY,QAAQ;UAC5BL,KAAK,EAAEP,SAAS,CAACO,KAAK;UACtBQ,SAAS,EAAEd,cAAc,KAAK,CAAC;UAC/BC,Y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reList":[]}
|
|
1
|
+
{"version":3,"names":["makeAutoObservable","Batch","BatchEditorDialogPresenter","invalidFields","formWasSubmitted","constructor","batch","undefined","fields","load","vm","operations","getOperations","canAddOperation","length","fieldOptions","data","addOperation","push","field","operator","value","deleteOperation","operationIndex","filter","_","index","setOperationFieldData","batchIndex","slice","setBatch","map","operation","validateBatch","onApply","onSuccess","onError","result","success","getFieldOptions","selectedField","find","operatorOptions","operators","title","getOperationTitle","open","canDelete","inputField","inputOperation","label","currentFieldId","existings","includes","validation","validate","error","issues","reduce","acc","issue","path","join","message"],"sources":["BatchEditorDialogPresenter.tsx"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\n\nimport {\n Batch,\n type BatchDTO,\n type FieldDTO,\n type OperationDTO,\n type OperatorDTO\n} from \"~/components/BulkActions/ActionEdit/domain/index.js\";\nimport type { FormInvalidFields } from \"@webiny/form\";\n\nexport interface IBatchEditorDialogPresenter {\n load(batch: BatchDTO, fields: FieldDTO[]): void;\n addOperation(): void;\n deleteOperation(operationIndex: number): void;\n setOperationFieldData(operationIndex: number, data: string): void;\n setBatch(data: any): void;\n onApply(onSuccess?: (batch: BatchDTO) => void, onError?: (batch: BatchDTO) => void): void;\n get vm(): BatchEditorDialogViewModel;\n}\n\nexport interface BatchEditorDialogViewModel {\n invalidFields: FormInvalidFields;\n canAddOperation: boolean;\n data: BatchEditorFormData;\n}\n\nexport interface BatchEditorFormData {\n operations: OperationFormData[];\n}\n\nexport type OperationFormData = OperationDTO & {\n canDelete: boolean;\n title: string;\n open: boolean;\n fieldOptions: FieldDTO[];\n operatorOptions: OperatorDTO[];\n selectedField?: FieldDTO;\n};\n\nexport class BatchEditorDialogPresenter implements IBatchEditorDialogPresenter {\n private batch: BatchDTO | undefined;\n private fields: FieldDTO[];\n private invalidFields: BatchEditorDialogViewModel[\"invalidFields\"] = {};\n private formWasSubmitted = false;\n\n constructor() {\n this.batch = undefined;\n this.fields = [];\n makeAutoObservable(this);\n }\n\n load(batch: BatchDTO, fields: FieldDTO[]) {\n this.batch = batch;\n this.fields = fields;\n }\n\n get vm() {\n const operations = this.getOperations();\n const canAddOperation = operations[operations.length - 1].fieldOptions.length > 1;\n\n return {\n invalidFields: this.invalidFields,\n canAddOperation,\n data: {\n operations\n }\n };\n }\n\n addOperation(): void {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations.push({\n field: \"\",\n operator: \"\",\n value: undefined\n });\n }\n\n deleteOperation(operationIndex: number): void {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations = this.batch.operations.filter(\n (_, index) => index !== operationIndex\n );\n\n // Make sure we always have at least 1 operation!\n if (this.batch.operations.length === 0) {\n this.addOperation();\n }\n }\n\n setOperationFieldData(batchIndex: number, data: string) {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations = [\n ...this.batch.operations.slice(0, batchIndex),\n {\n field: data,\n operator: \"\",\n value: undefined\n },\n ...this.batch.operations.slice(batchIndex + 1)\n ];\n }\n\n setBatch(data: BatchEditorFormData): void {\n if (!this.batch) {\n return;\n }\n\n this.batch = {\n ...this.batch,\n operations: data.operations.map(operation => ({\n field: operation.field,\n operator: operation.operator,\n value: operation.value\n }))\n };\n\n if (this.formWasSubmitted) {\n this.validateBatch(this.batch);\n }\n }\n\n onApply(\n onSuccess?: (batch: BatchDTO) => void,\n onError?: (\n batch: BatchDTO,\n invalidFields: BatchEditorDialogViewModel[\"invalidFields\"]\n ) => void\n ) {\n if (!this.batch) {\n return;\n }\n\n const result = this.validateBatch(this.batch);\n if (result.success) {\n onSuccess && onSuccess(this.batch);\n } else {\n onError && onError(this.batch, this.invalidFields);\n }\n }\n\n private getOperations = () => {\n return (\n this.batch?.operations.map((operation: OperationDTO, operationIndex) => {\n const fieldOptions = this.getFieldOptions(operation.field);\n const selectedField = fieldOptions.find(field => field.value === operation.field);\n const operatorOptions = selectedField?.operators || [];\n\n return {\n title:\n this.getOperationTitle(operation.field, operation.operator) ??\n `Operation #${operationIndex + 1}`,\n open: true,\n field: operation.field,\n operator: operation.operator,\n value: operation.value,\n canDelete: operationIndex !== 0,\n fieldOptions,\n selectedField,\n operatorOptions\n };\n }) || []\n );\n };\n\n private getOperationTitle(inputField?: string, inputOperation?: string) {\n if (!inputField || !inputOperation) {\n return undefined;\n }\n\n const field = this.fields.find(field => field.value === inputField);\n\n if (!field) {\n return undefined;\n }\n\n const operator = field.operators.find(operator => operator.value === inputOperation);\n\n if (!operator) {\n return undefined;\n }\n\n return `${operator.label} for field \"${field.label}\"`;\n }\n\n private getFieldOptions(currentFieldId = \"\") {\n if (!this.batch) {\n return [];\n }\n\n const existings = this.batch.operations\n .filter(operation => operation.field !== currentFieldId)\n .map(operation => operation.field);\n\n return this.fields.filter(field => !existings.includes(field.value));\n }\n\n private validateBatch(data: BatchDTO) {\n this.formWasSubmitted = true;\n const validation = Batch.validate(data);\n\n if (!validation.success) {\n this.invalidFields = validation.error.issues.reduce((acc, issue) => {\n return {\n ...acc,\n [issue.path.join(\".\")]: issue.message\n };\n }, {});\n } else {\n this.invalidFields = {};\n }\n\n return validation;\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AAEzC,SACIC,KAAK;AAqCT,OAAO,MAAMC,0BAA0B,CAAwC;EAGnEC,aAAa,GAAgD,CAAC,CAAC;EAC/DC,gBAAgB,GAAG,KAAK;EAEhCC,WAAWA,CAAA,EAAG;IACV,IAAI,CAACC,KAAK,GAAGC,SAAS;IACtB,IAAI,CAACC,MAAM,GAAG,EAAE;IAChBR,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAS,IAAIA,CAACH,KAAe,EAAEE,MAAkB,EAAE;IACtC,IAAI,CAACF,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACE,MAAM,GAAGA,MAAM;EACxB;EAEA,IAAIE,EAAEA,CAAA,EAAG;IACL,MAAMC,UAAU,GAAG,IAAI,CAACC,aAAa,CAAC,CAAC;IACvC,MAAMC,eAAe,GAAGF,UAAU,CAACA,UAAU,CAACG,MAAM,G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,OAAO,IAAI,CAACX,MAAM,CAACgB,MAAM,CAACL,KAAK,IAAI,CAACiC,SAAS,CAACC,QAAQ,CAAClC,KAAK,CAACE,KAAK,CAAC,CAAC;EACxE;EAEQY,aAAaA,CAACjB,IAAc,EAAE;IAClC,IAAI,CAACZ,gBAAgB,GAAG,IAAI;IAC5B,MAAMkD,UAAU,GAAGrD,KAAK,CAACsD,QAAQ,CAACvC,IAAI,CAAC;IAEvC,IAAI,CAACsC,UAAU,CAAChB,OAAO,EAAE;MACrB,IAAI,CAACnC,aAAa,GAAGmD,UAAU,CAACE,KAAK,CAACC,MAAM,CAACC,MAAM,CAAC,CAACC,GAAG,EAAEC,KAAK,KAAK;QAChE,OAAO;UACH,GAAGD,GAAG;UACN,CAACC,KAAK,CAACC,IAAI,CAACC,IAAI,CAAC,GAAG,CAAC,GAAGF,KAAK,CAACG;QAClC,CAAC;MACL,CAAC,EAAE,CAAC,CAAC,CAAC;IACV,CAAC,MAAM;MACH,IAAI,CAAC5D,aAAa,GAAG,CAAC,CAAC;IAC3B;IAEA,OAAOmD,UAAU;EACrB;AACJ","ignoreList":[]}
|
package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.test.js
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _domain = require("../domain");
|
|
7
|
-
describe("BatchEditorDialogPresenter", function () {
|
|
8
|
-
var batch = {
|
|
1
|
+
import { describe, it, expect, beforeEach, vi } from "vitest";
|
|
2
|
+
import { BatchEditorDialogPresenter } from "./BatchEditorDialogPresenter.js";
|
|
3
|
+
import { OperatorType } from "../domain/index.js";
|
|
4
|
+
describe("BatchEditorDialogPresenter", () => {
|
|
5
|
+
const batch = {
|
|
9
6
|
operations: [{
|
|
10
7
|
field: "",
|
|
11
8
|
operator: "",
|
|
12
9
|
value: undefined
|
|
13
10
|
}]
|
|
14
11
|
};
|
|
15
|
-
|
|
12
|
+
const fields = [{
|
|
16
13
|
label: "Field 1",
|
|
17
14
|
value: "field1",
|
|
18
15
|
operators: [{
|
|
19
16
|
label: "Override existing values",
|
|
20
|
-
value:
|
|
17
|
+
value: OperatorType.OVERRIDE
|
|
21
18
|
}, {
|
|
22
19
|
label: "Clear all existing values",
|
|
23
|
-
value:
|
|
20
|
+
value: OperatorType.REMOVE
|
|
24
21
|
}],
|
|
25
22
|
raw: {
|
|
26
23
|
id: "field1",
|
|
@@ -38,10 +35,10 @@ describe("BatchEditorDialogPresenter", function () {
|
|
|
38
35
|
value: "field2",
|
|
39
36
|
operators: [{
|
|
40
37
|
label: "Override existing values",
|
|
41
|
-
value:
|
|
38
|
+
value: OperatorType.OVERRIDE
|
|
42
39
|
}, {
|
|
43
40
|
label: "Clear all existing values",
|
|
44
|
-
value:
|
|
41
|
+
value: OperatorType.REMOVE
|
|
45
42
|
}],
|
|
46
43
|
raw: {
|
|
47
44
|
id: "field2",
|
|
@@ -55,22 +52,22 @@ describe("BatchEditorDialogPresenter", function () {
|
|
|
55
52
|
storageId: "text@field2"
|
|
56
53
|
}
|
|
57
54
|
}];
|
|
58
|
-
|
|
59
|
-
value:
|
|
55
|
+
const operators = [{
|
|
56
|
+
value: OperatorType.OVERRIDE,
|
|
60
57
|
label: "Override existing values"
|
|
61
58
|
}, {
|
|
62
|
-
value:
|
|
59
|
+
value: OperatorType.REMOVE,
|
|
63
60
|
label: "Clear all existing values"
|
|
64
61
|
}, {
|
|
65
|
-
value:
|
|
62
|
+
value: OperatorType.APPEND,
|
|
66
63
|
label: "Append to existing values"
|
|
67
64
|
}];
|
|
68
|
-
|
|
69
|
-
beforeEach(
|
|
70
|
-
|
|
71
|
-
presenter = new
|
|
65
|
+
let presenter;
|
|
66
|
+
beforeEach(() => {
|
|
67
|
+
vi.clearAllMocks();
|
|
68
|
+
presenter = new BatchEditorDialogPresenter();
|
|
72
69
|
});
|
|
73
|
-
it("should load data",
|
|
70
|
+
it("should load data", () => {
|
|
74
71
|
presenter.load(batch, fields);
|
|
75
72
|
|
|
76
73
|
// `vm` should have the expected `data` definition
|
|
@@ -94,7 +91,7 @@ describe("BatchEditorDialogPresenter", function () {
|
|
|
94
91
|
// `vm` should have the expected `canAddOperation` definition
|
|
95
92
|
expect(presenter.vm.canAddOperation).toEqual(true);
|
|
96
93
|
});
|
|
97
|
-
it("should be able to add and delete operations",
|
|
94
|
+
it("should be able to add and delete operations", () => {
|
|
98
95
|
presenter.load(batch, fields);
|
|
99
96
|
|
|
100
97
|
// should only have 1 operator, created by default
|
|
@@ -168,17 +165,19 @@ describe("BatchEditorDialogPresenter", function () {
|
|
|
168
165
|
selectedField: undefined
|
|
169
166
|
}]);
|
|
170
167
|
});
|
|
171
|
-
it("should be able to handle the `fieldOptions` based operations set in the batch",
|
|
168
|
+
it("should be able to handle the `fieldOptions` based operations set in the batch", () => {
|
|
172
169
|
presenter.load(batch, fields);
|
|
173
170
|
|
|
174
171
|
// let's set some `data` back to the operation
|
|
175
172
|
presenter.setBatch({
|
|
176
173
|
operations: [{
|
|
177
|
-
title:
|
|
174
|
+
title: `Override existing values for field "${fields[0].label}"`,
|
|
178
175
|
open: true,
|
|
179
176
|
field: fields[0].value,
|
|
180
|
-
operator:
|
|
181
|
-
value:
|
|
177
|
+
operator: OperatorType.OVERRIDE,
|
|
178
|
+
value: {
|
|
179
|
+
[fields[0].value]: "newValue"
|
|
180
|
+
},
|
|
182
181
|
canDelete: false,
|
|
183
182
|
fieldOptions: fields,
|
|
184
183
|
operatorOptions: [operators[0], operators[1]],
|
|
@@ -206,20 +205,22 @@ describe("BatchEditorDialogPresenter", function () {
|
|
|
206
205
|
// let's set some `data` back to the operations
|
|
207
206
|
presenter.setBatch({
|
|
208
207
|
operations: [{
|
|
209
|
-
title:
|
|
208
|
+
title: `Override existing values for field "${fields[0].label}"`,
|
|
210
209
|
open: true,
|
|
211
210
|
field: fields[0].value,
|
|
212
|
-
operator:
|
|
213
|
-
value:
|
|
211
|
+
operator: OperatorType.OVERRIDE,
|
|
212
|
+
value: {
|
|
213
|
+
[fields[0].value]: "newValue"
|
|
214
|
+
},
|
|
214
215
|
canDelete: false,
|
|
215
216
|
fieldOptions: fields,
|
|
216
217
|
operatorOptions: [operators[0], operators[1]],
|
|
217
218
|
selectedField: fields[0]
|
|
218
219
|
}, {
|
|
219
|
-
title:
|
|
220
|
+
title: `Remove all values for field "${fields[1].label}"`,
|
|
220
221
|
open: false,
|
|
221
222
|
field: fields[1].value,
|
|
222
|
-
operator:
|
|
223
|
+
operator: OperatorType.REMOVE,
|
|
223
224
|
value: undefined,
|
|
224
225
|
canDelete: true,
|
|
225
226
|
fieldOptions: [fields[1]],
|
|
@@ -231,17 +232,19 @@ describe("BatchEditorDialogPresenter", function () {
|
|
|
231
232
|
// I should NOT be able to add a new operation
|
|
232
233
|
expect(presenter.vm.canAddOperation).toBeFalsy();
|
|
233
234
|
});
|
|
234
|
-
it("should be able to set data back to the operation",
|
|
235
|
+
it("should be able to set data back to the operation", () => {
|
|
235
236
|
presenter.load(batch, fields);
|
|
236
237
|
|
|
237
238
|
// should be able to set the `data` operation
|
|
238
239
|
presenter.setBatch({
|
|
239
240
|
operations: [{
|
|
240
|
-
title:
|
|
241
|
+
title: `Remove all values for field "${fields[0].label}"`,
|
|
241
242
|
open: false,
|
|
242
243
|
field: fields[0].value,
|
|
243
|
-
operator:
|
|
244
|
-
value:
|
|
244
|
+
operator: OperatorType.OVERRIDE,
|
|
245
|
+
value: {
|
|
246
|
+
[fields[0].value]: "newValue"
|
|
247
|
+
},
|
|
245
248
|
canDelete: false,
|
|
246
249
|
fieldOptions: fields,
|
|
247
250
|
operatorOptions: [operators[0], operators[1]],
|
|
@@ -249,19 +252,23 @@ describe("BatchEditorDialogPresenter", function () {
|
|
|
249
252
|
}]
|
|
250
253
|
});
|
|
251
254
|
expect(presenter.vm.data.operations[0].field).toEqual(fields[0].value);
|
|
252
|
-
expect(presenter.vm.data.operations[0].operator).toEqual(
|
|
253
|
-
expect(presenter.vm.data.operations[0].value).toEqual(
|
|
255
|
+
expect(presenter.vm.data.operations[0].operator).toEqual(OperatorType.OVERRIDE);
|
|
256
|
+
expect(presenter.vm.data.operations[0].value).toEqual({
|
|
257
|
+
[fields[0].value]: "newValue"
|
|
258
|
+
});
|
|
254
259
|
expect(presenter.vm.data.operations[0].fieldOptions).toEqual(fields);
|
|
255
260
|
});
|
|
256
|
-
it("should able to set the operation `field` data",
|
|
261
|
+
it("should able to set the operation `field` data", () => {
|
|
257
262
|
presenter.load(batch, fields);
|
|
258
263
|
presenter.setBatch({
|
|
259
264
|
operations: [{
|
|
260
|
-
title:
|
|
265
|
+
title: `Override existing values for field "${fields[0].label}"`,
|
|
261
266
|
open: true,
|
|
262
267
|
field: fields[0].value,
|
|
263
|
-
operator:
|
|
264
|
-
value:
|
|
268
|
+
operator: OperatorType.OVERRIDE,
|
|
269
|
+
value: {
|
|
270
|
+
[fields[0].value]: "newValue"
|
|
271
|
+
},
|
|
265
272
|
canDelete: false,
|
|
266
273
|
fieldOptions: fields,
|
|
267
274
|
operatorOptions: [operators[0], operators[1]],
|
|
@@ -285,13 +292,13 @@ describe("BatchEditorDialogPresenter", function () {
|
|
|
285
292
|
selectedField: undefined
|
|
286
293
|
});
|
|
287
294
|
});
|
|
288
|
-
it("should perform validation and call provided callbacks `onApply`",
|
|
295
|
+
it("should perform validation and call provided callbacks `onApply`", () => {
|
|
289
296
|
presenter.load(batch, fields);
|
|
290
|
-
|
|
291
|
-
|
|
297
|
+
const onSuccess = vi.fn();
|
|
298
|
+
const onError = vi.fn();
|
|
292
299
|
presenter.setBatch({
|
|
293
300
|
operations: [{
|
|
294
|
-
title:
|
|
301
|
+
title: `Override existing values for field "${fields[0].label}"`,
|
|
295
302
|
open: true,
|
|
296
303
|
field: fields[0].value,
|
|
297
304
|
operator: "",
|
|
@@ -308,11 +315,13 @@ describe("BatchEditorDialogPresenter", function () {
|
|
|
308
315
|
expect(Object.keys(presenter.vm.invalidFields).length).toBe(1);
|
|
309
316
|
presenter.setBatch({
|
|
310
317
|
operations: [{
|
|
311
|
-
title:
|
|
318
|
+
title: `Override existing values for field "${fields[0].label}"`,
|
|
312
319
|
open: true,
|
|
313
320
|
field: fields[0].value,
|
|
314
|
-
operator:
|
|
315
|
-
value:
|
|
321
|
+
operator: OperatorType.OVERRIDE,
|
|
322
|
+
value: {
|
|
323
|
+
[fields[0].value]: "newValue"
|
|
324
|
+
},
|
|
316
325
|
canDelete: false,
|
|
317
326
|
fieldOptions: fields,
|
|
318
327
|
operatorOptions: [operators[0], operators[1]],
|