@webiny/app-file-manager 5.43.2 → 6.0.0-alpha.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.js +75 -112
- package/BatchFileUploader.js.map +1 -1
- package/app.js +8 -15
- package/app.js.map +1 -1
- 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.js +31 -32
- package/components/BottomInfoBar/SupportedFileTypes.js.map +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.js +1 -5
- package/components/BulkActions/ActionEdit/ActionEditPresenter.js +45 -80
- package/components/BulkActions/ActionEdit/ActionEditPresenter.js.map +1 -1
- package/components/BulkActions/ActionEdit/ActionEditPresenter.test.js +11 -15
- 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.js +34 -54
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditor.js.map +1 -1
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialog.js +34 -46
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialog.js.map +1 -1
- 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 +56 -48
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.test.js.map +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.js +34 -46
- package/components/BulkActions/ActionEdit/BatchEditorDialog/Operation.js.map +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.js +41 -51
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.js.map +1 -1
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.test.js +88 -75
- 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.js +10 -27
- package/components/BulkActions/ActionEdit/domain/BatchMapper.js.map +1 -1
- 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.js +18 -41
- package/components/BulkActions/ActionEdit/domain/FieldMapper.js.map +1 -1
- package/components/BulkActions/ActionEdit/domain/index.js +4 -49
- package/components/BulkActions/ActionEdit/domain/index.js.map +1 -1
- package/components/BulkActions/ActionEdit/index.js +1 -16
- package/components/BulkActions/ActionEdit/index.js.map +1 -1
- 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.js +4 -43
- package/components/BulkActions/index.js.map +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrl.js +31 -43
- package/components/EditFileUsingUrl/EditFileUsingUrl.js.map +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.js +39 -49
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.js.map +1 -1
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.js +32 -49
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.js.map +1 -1
- 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.js +6 -19
- package/components/EditFileUsingUrl/UpdateFile.js.map +1 -1
- package/components/EditFileUsingUrl/getFileByUrl.graphql.js +16 -13
- package/components/EditFileUsingUrl/getFileByUrl.graphql.js.map +1 -1
- package/components/EditFileUsingUrl/index.js +1 -16
- package/components/EditFileUsingUrl/index.js.map +1 -1
- package/components/Empty/Empty.js +18 -23
- package/components/Empty/Empty.js.map +1 -1
- package/components/Empty/index.js +1 -16
- package/components/Empty/index.js.map +1 -1
- package/components/FileDetails/FileDetails.js +120 -131
- package/components/FileDetails/FileDetails.js.map +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.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.js +19 -47
- 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.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 +19 -21
- package/components/Grid/ActionButton.js.map +1 -1
- package/components/Grid/File.d.ts +1 -0
- package/components/Grid/File.js +73 -60
- package/components/Grid/File.js.map +1 -1
- package/components/Grid/Grid.d.ts +2 -1
- package/components/Grid/Grid.js +58 -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.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 +17 -0
- package/components/Header/Header.js.map +1 -0
- package/components/Header/Title.d.ts +2 -0
- package/components/Header/Title.js +62 -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.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.js +1 -16
- package/components/NoResults/index.js.map +1 -1
- package/components/SearchWidget/SearchWidget.js +31 -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.js +4 -49
- package/components/Table/Actions/index.js.map +1 -1
- package/components/Table/Cells/CellActions.js +21 -25
- package/components/Table/Cells/CellActions.js.map +1 -1
- package/components/Table/Cells/CellAuthor.js +10 -14
- package/components/Table/Cells/CellAuthor.js.map +1 -1
- package/components/Table/Cells/CellCreated.js +11 -15
- package/components/Table/Cells/CellCreated.js.map +1 -1
- package/components/Table/Cells/CellModified.js +11 -15
- package/components/Table/Cells/CellModified.js.map +1 -1
- package/components/Table/Cells/CellName.js +53 -46
- 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.js +7 -82
- package/components/Table/Cells/index.js.map +1 -1
- package/components/Table/Table.d.ts +3 -3
- package/components/Table/Table.js +9 -18
- package/components/Table/Table.js.map +1 -1
- package/components/Table/index.js +3 -38
- package/components/Table/index.js.map +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/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/components/TagsList/TagsList.js +31 -0
- package/components/TagsList/TagsList.js.map +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.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/Aliases.js +76 -127
- package/components/fields/Aliases.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.js +4 -49
- package/components/fields/index.js.map +1 -1
- package/components/fields/useAccessControlField.d.ts +1 -1
- package/components/fields/useAccessControlField.js +9 -21
- package/components/fields/useAccessControlField.js.map +1 -1
- package/components/fields/useFileOrUndefined.js +3 -9
- package/components/fields/useFileOrUndefined.js.map +1 -1
- package/constants.js +4 -16
- package/constants.js.map +1 -1
- package/contexts/FileProvider.js +12 -18
- package/contexts/FileProvider.js.map +1 -1
- package/hooks/useCopyFile.js +18 -24
- package/hooks/useCopyFile.js.map +1 -1
- package/hooks/useDeleteFile.js +38 -62
- package/hooks/useDeleteFile.js.map +1 -1
- package/hooks/useFile.js +5 -12
- package/hooks/useFile.js.map +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.js +19 -21
- package/hooks/useMoveFileToFolder.js.map +1 -1
- package/index.js +8 -101
- package/index.js.map +1 -1
- package/modules/Enterprise/HandleWebsocketMessages.js +31 -53
- package/modules/Enterprise/HandleWebsocketMessages.js.map +1 -1
- 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.js +1 -7
- package/modules/Enterprise/constants.js.map +1 -1
- package/modules/Enterprise/index.js +29 -22
- package/modules/Enterprise/index.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.js +120 -128
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.js +14 -25
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.js +25 -11
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileUploader.js +3 -9
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileUploader.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/index.js +3 -26
- package/modules/FileManagerApiProvider/FileManagerApiContext/index.js.map +1 -1
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.js +4 -11
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.js.map +1 -1
- 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 +36 -37
- package/modules/FileManagerRenderer/FileActions/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/FileManagerView.js +173 -252
- package/modules/FileManagerRenderer/FileManagerView/FileManagerView.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.d.ts +46 -5
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js +47 -54
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/LeftSidebar.js +21 -53
- package/modules/FileManagerRenderer/FileManagerView/LeftSidebar.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.js +12 -23
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.js.map +1 -1
- 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.js +9 -19
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FileAction.js.map +1 -1
- 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.js +9 -19
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderAction.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderFieldDecorator.js +6 -10
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderFieldDecorator.js.map +1 -1
- 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.js +13 -19
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Thumbnail.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/index.js +1 -5
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.d.ts +19 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.js +11 -19
- 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 +42 -1
- 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 +41 -3
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.js +30 -38
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.js.map +1 -1
- 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.js +20 -29
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Field.js.map +1 -1
- 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.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 +1 -1
- 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/getThumbnailRenderer.js +7 -16
- package/modules/FileManagerRenderer/FileManagerView/getThumbnailRenderer.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerView/index.js +49 -57
- package/modules/FileManagerRenderer/FileManagerView/index.js.map +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 +6 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/FileManagerViewContext.js +281 -337
- package/modules/FileManagerRenderer/FileManagerViewProvider/FileManagerViewContext.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/index.js +2 -27
- package/modules/FileManagerRenderer/FileManagerViewProvider/index.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.d.ts +2 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.js +30 -45
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.d.ts +2 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.js +5 -9
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.js +4 -10
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.js.map +1 -1
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.js +79 -99
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.js.map +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 +89 -83
- package/modules/FileManagerRenderer/index.js.map +1 -1
- package/modules/HeadlessCms/fileField.js +11 -19
- package/modules/HeadlessCms/fileField.js.map +1 -1
- package/modules/HeadlessCms/fileRenderer/fileField.js +44 -91
- package/modules/HeadlessCms/fileRenderer/fileField.js.map +1 -1
- package/modules/HeadlessCms/fileRenderer/fileFields.js +74 -146
- 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/Settings/graphql.js +26 -15
- package/modules/Settings/graphql.js.map +1 -1
- package/modules/Settings/index.js +35 -32
- package/modules/Settings/index.js.map +1 -1
- package/modules/Settings/plugins/installation.js +68 -68
- package/modules/Settings/plugins/installation.js.map +1 -1
- package/modules/Settings/plugins/permissionRenderer/FileManagerPermissions.js +122 -149
- package/modules/Settings/plugins/permissionRenderer/FileManagerPermissions.js.map +1 -1
- package/modules/Settings/plugins/permissionRenderer/index.js +16 -22
- package/modules/Settings/plugins/permissionRenderer/index.js.map +1 -1
- package/modules/Settings/views/FileManagerSettings.js +97 -110
- 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 +23 -24
- package/tagsHelpers.js +31 -37
- package/tagsHelpers.js.map +1 -1
- 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/modules/Enterprise/components/ThreatScanInProgress.d.ts +0 -2
- package/modules/Enterprise/components/ThreatScanInProgress.js +0 -44
- package/modules/Enterprise/components/ThreatScanInProgress.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 -71
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/TagsList.js.map +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 -39
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/styled.js +0 -91
- package/modules/FileManagerRenderer/FileManagerView/components/TagsList/styled.js.map +0 -1
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderDropConfirmation.d.ts +0 -5
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderDropConfirmation.js +0 -15
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderDropConfirmation.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/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
- /package/{modules/FileManagerRenderer/FileManagerView/components → components}/TagsList/Empty.d.ts +0 -0
- /package/{modules/FileManagerRenderer/FileManagerView/components → components}/TagsList/Tag.d.ts +0 -0
- /package/{modules/FileManagerRenderer/FileManagerView/components → components}/TagsList/TagsList.d.ts +0 -0
- /package/{modules/FileManagerRenderer/FileManagerView/components → components}/TagsList/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Button","flip","filter","crop","rotate","loadScript","toolbar","initScripts","Promise","resolve","window","Caman","ImageEditor","Component","defaultProps","tools","state","tool","src","canvas","createRef","componentDidMount","then","updateCanvas","setTimeout","options","props","key","option","autoEnable","activateTool","image","Image","current","onload","width","height","ctx","getContext","drawImage","setState","tt","onActivate","getToolOptions","deactivateTool","getCanvasDataUrl","startsWith","toDataURL","applyActiveTool","apply","cancelActiveTool","cancel","name","render","children","editor","createElement","className","map","icon","Fragment","renderForm","variant","text","onClick","style","id","maxWidth","maxHeight","ref","activeTool"],"sources":["ImageEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button } from \"@webiny/admin-ui\";\nimport { flip, filter, crop, rotate } from \"./toolbar\";\nimport { ImageEditorTool, ToolbarTool } from \"./toolbar/types\";\n/**\n * Package load-script does not have types.\n */\n// @ts-expect-error\nimport loadScript from \"load-script\";\n\nconst toolbar = {\n flip,\n filter,\n crop,\n rotate\n};\n\nconst initScripts = (): Promise<string> => {\n return new Promise((resolve: any) => {\n // @ts-expect-error\n if (window.Caman) {\n return resolve();\n }\n return loadScript(\n \"https://cdnjs.cloudflare.com/ajax/libs/camanjs/4.1.2/caman.full.min.js\",\n resolve\n );\n });\n};\n\ninterface RenderPropArgs {\n render: () => React.ReactNode;\n getCanvasDataUrl: () => string;\n activeTool: ImageEditorTool | null;\n applyActiveTool: () => Promise<void>;\n cancelActiveTool: () => Promise<void>;\n}\n\ninterface ImageEditorPropsPropsOptions {\n autoEnable: boolean;\n}\n\ninterface ImageEditorProps {\n src: string;\n tools: ToolbarTool[];\n options?: {\n flip: ImageEditorPropsPropsOptions;\n filter: ImageEditorPropsPropsOptions;\n crop: ImageEditorPropsPropsOptions;\n rotate: ImageEditorPropsPropsOptions;\n };\n onToolActivate?: () => void;\n onToolDeactivate?: () => void;\n children?: (props: RenderPropArgs) => React.ReactNode;\n}\n\ninterface ImageEditorState {\n tool: ImageEditorTool | null;\n src: string;\n}\n\nclass ImageEditor extends React.Component<ImageEditorProps, ImageEditorState> {\n static defaultProps: Partial<ImageEditorProps> = {\n tools: [\"crop\", \"flip\", \"rotate\", \"filter\"]\n };\n\n public override state: ImageEditorState = {\n tool: null,\n src: \"\"\n };\n\n public canvas = React.createRef<HTMLCanvasElement>();\n public image?: HTMLImageElement;\n\n public override componentDidMount() {\n initScripts().then(() => {\n this.updateCanvas();\n setTimeout(() => {\n const { options } = this.props;\n if (!options || typeof options !== \"object\") {\n return;\n }\n for (const key in options) {\n const option = options[key as ToolbarTool];\n if (option.autoEnable === true) {\n const tool: ImageEditorTool | null = toolbar[key as ToolbarTool];\n tool && this.activateTool(tool);\n break;\n }\n }\n }, 250);\n });\n }\n\n private readonly updateCanvas = (): void => {\n const { src } = this.props;\n this.image = new window.Image();\n const canvas = this.canvas.current;\n if (canvas) {\n this.image.onload = () => {\n if (this.image) {\n canvas.width = this.image.width;\n canvas.height = this.image.height;\n const ctx = canvas.getContext(\"2d\") as CanvasRenderingContext2D;\n ctx.drawImage(this.image, 0, 0);\n }\n };\n\n this.image.src = src;\n }\n };\n\n private readonly activateTool = (tool: ToolbarTool | ImageEditorTool): void => {\n if (typeof tool === \"string\") {\n tool = toolbar[tool];\n }\n\n this.setState({ tool }, () => {\n const tt = tool as ImageEditorTool;\n typeof tt.onActivate === \"function\" &&\n tt.onActivate({ canvas: this.canvas, options: this.getToolOptions(tt) });\n });\n };\n\n private readonly deactivateTool = (): void => {\n this.setState({\n tool: null\n });\n };\n\n public readonly getCanvasDataUrl = (): string => {\n const canvas = this.canvas.current as HTMLCanvasElement;\n if (canvas) {\n const { src } = this.props;\n if (src.startsWith(\"data:image/jpeg;\")) {\n return canvas.toDataURL(\"image/jpeg\", 1.0);\n }\n\n return canvas.toDataURL();\n }\n\n return \"\";\n };\n\n private readonly applyActiveTool = async (): Promise<void> => {\n const { tool } = this.state;\n if (!tool) {\n return;\n }\n\n if (tool.apply) {\n await tool.apply({\n canvas: this.canvas\n });\n }\n this.deactivateTool();\n };\n\n private readonly cancelActiveTool = async (): Promise<void> => {\n const { tool } = this.state;\n if (!tool) {\n return;\n }\n\n if (tool.cancel) {\n await tool.cancel({\n canvas: this.canvas\n });\n }\n this.deactivateTool();\n };\n\n private readonly getToolOptions = (\n tool: ImageEditorTool\n ): Partial<ImageEditorPropsPropsOptions> => {\n const { options } = this.props;\n if (!options || typeof options !== \"object\") {\n return {};\n }\n\n return options[tool.name as ToolbarTool] || {};\n };\n\n public override render(): React.ReactNode {\n const { src, tools, children } = this.props;\n const { tool } = this.state;\n const editor = (\n <div\n className={\n \"wby-w-full wby-h-full wby-flex wby-flex-col wby-gap-md wby-overflow-hidden\"\n }\n >\n <div className={\"wby-flex wby-justify-center wby-items-center wby-w-full\"}>\n {tools.map(key => {\n const tool: ImageEditorTool = toolbar[key];\n if (!tool) {\n return null;\n }\n\n return (\n <div\n key={key}\n className={\n this.state.tool\n ? \"wby-opacity-50 wby-cursor wby-pointer-events-none\"\n : \"\"\n }\n >\n {tool.icon({\n activateTool: () => this.activateTool(tool)\n })}\n </div>\n );\n })}\n </div>\n <div className={\"wby-w-full\"}>\n {tool ? (\n <>\n {typeof tool.renderForm === \"function\" &&\n tool.renderForm({\n options: this.getToolOptions(tool as ImageEditorTool),\n image: this.image as HTMLImageElement,\n canvas: this.canvas\n })}\n\n <div className={\"wby-flex wby-justify-center wby-gap-sm wby-mt-sm\"}>\n <Button\n variant={\"secondary\"}\n text={\"Cancel\"}\n data-testid=\"button-cancel\"\n onClick={() => {\n this.cancelActiveTool();\n }}\n />\n <Button\n variant={\"primary\"}\n text={\"Apply\"}\n data-testid=\"button-apply\"\n onClick={() => {\n this.applyActiveTool();\n }}\n />\n </div>\n </>\n ) : (\n <div className={\"wby-text-center\"}>\n Select a tool to start working on your image.\n </div>\n )}\n </div>\n <div\n className={\n \"wby-flex wby-justify-center wby-items-center wby-w-full wby-bg-neutral-dimmed wby-rounded-md wby-overflow-hidden\"\n }\n style={{ height: \"calc(100vh - 256px)\" }}\n >\n <canvas\n key={src}\n id={\"canvas\"}\n style={{ maxWidth: \"100%\", maxHeight: \"100%\" }}\n ref={this.canvas as React.Ref<any>}\n />\n </div>\n </div>\n );\n\n if (typeof children === \"function\") {\n return children({\n render: () => editor,\n // canvas: this.canvas,\n getCanvasDataUrl: this.getCanvasDataUrl,\n activeTool: this.state.tool,\n applyActiveTool: this.applyActiveTool,\n cancelActiveTool: this.cancelActiveTool\n });\n }\n\n return editor;\n }\n}\n\nexport { ImageEditor };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,IAAI,EAAEC,MAAM,EAAEC,IAAI,EAAEC,MAAM;AAEnC;AACA;AACA;AACA;AACA,OAAOC,UAAU,MAAM,aAAa;AAEpC,MAAMC,OAAO,GAAG;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ogZIndex?: number;
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* We would need to drill down a lot to give correct options.
|
|
8
|
+
* TODO: figure out some other way.
|
|
9
|
+
*/
|
|
10
|
+
options?: any;
|
|
11
|
+
src?: string;
|
|
12
|
+
onAccept: (src: string) => void;
|
|
13
|
+
"data-testid"?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const ImageEditorDialog: (props: ImageEditorDialogProps) => React.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { ImageEditor } from "./ImageEditor";
|
|
3
|
+
import { Dialog, OverlayLoader } from "@webiny/admin-ui";
|
|
4
|
+
export const ImageEditorDialog = props => {
|
|
5
|
+
const {
|
|
6
|
+
src,
|
|
7
|
+
options,
|
|
8
|
+
onAccept,
|
|
9
|
+
onClose,
|
|
10
|
+
open,
|
|
11
|
+
dialogZIndex,
|
|
12
|
+
...dialogProps
|
|
13
|
+
} = props;
|
|
14
|
+
const imageEditor = /*#__PURE__*/React.createRef();
|
|
15
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
16
|
+
const onSave = async () => {
|
|
17
|
+
try {
|
|
18
|
+
setIsSaving(true);
|
|
19
|
+
const url = imageEditor.current ? imageEditor.current.getCanvasDataUrl() : "";
|
|
20
|
+
await onAccept(url);
|
|
21
|
+
} catch (e) {
|
|
22
|
+
console.log(e);
|
|
23
|
+
} finally {
|
|
24
|
+
setIsSaving(false);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return /*#__PURE__*/React.createElement(Dialog, Object.assign({
|
|
28
|
+
style: {
|
|
29
|
+
zIndex: dialogZIndex
|
|
30
|
+
},
|
|
31
|
+
title: "Edit Image",
|
|
32
|
+
size: "full",
|
|
33
|
+
open: open,
|
|
34
|
+
onClose: onClose
|
|
35
|
+
}, dialogProps, {
|
|
36
|
+
actions: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dialog.CancelButton, null), /*#__PURE__*/React.createElement(Dialog.ConfirmButton, {
|
|
37
|
+
text: "Save",
|
|
38
|
+
"data-testid": "dialog-accept",
|
|
39
|
+
onClick: onSave,
|
|
40
|
+
disabled: isSaving
|
|
41
|
+
}))
|
|
42
|
+
}), isSaving && /*#__PURE__*/React.createElement(OverlayLoader, {
|
|
43
|
+
text: "Creating a new version of the image"
|
|
44
|
+
}), /*#__PURE__*/React.createElement(ImageEditor, {
|
|
45
|
+
ref: imageEditor,
|
|
46
|
+
src: src,
|
|
47
|
+
options: options
|
|
48
|
+
}, ({
|
|
49
|
+
render
|
|
50
|
+
}) => render()));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=ImageEditorDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","ImageEditor","Dialog","OverlayLoader","ImageEditorDialog","props","src","options","onAccept","onClose","open","dialogZIndex","dialogProps","imageEditor","createRef","isSaving","setIsSaving","onSave","url","current","getCanvasDataUrl","e","console","log","createElement","Object","assign","style","zIndex","title","size","actions","Fragment","CancelButton","ConfirmButton","text","onClick","disabled","ref","render"],"sources":["ImageEditorDialog.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { ImageEditor } from \"./ImageEditor\";\nimport { Dialog, OverlayLoader } from \"@webiny/admin-ui\";\n\ninterface ImageEditorDialogProps {\n dialogZIndex?: number;\n onClose?: () => void;\n open?: boolean;\n /**\n * We would need to drill down a lot to give correct options.\n * TODO: figure out some other way.\n */\n options?: any;\n src?: string;\n onAccept: (src: string) => void;\n \"data-testid\"?: string;\n}\n\nexport const ImageEditorDialog = (props: ImageEditorDialogProps) => {\n const { src, options, onAccept, onClose, open, dialogZIndex, ...dialogProps } = props;\n const imageEditor = React.createRef<ImageEditor>();\n const [isSaving, setIsSaving] = useState(false);\n\n const onSave = async () => {\n try {\n setIsSaving(true);\n const url = imageEditor.current ? imageEditor.current.getCanvasDataUrl() : \"\";\n await onAccept(url);\n } catch (e) {\n console.log(e);\n } finally {\n setIsSaving(false);\n }\n };\n\n return (\n <Dialog\n style={{ zIndex: dialogZIndex }}\n title={\"Edit Image\"}\n size={\"full\"}\n open={open}\n onClose={onClose}\n {...dialogProps}\n actions={\n <>\n <Dialog.CancelButton />\n <Dialog.ConfirmButton\n text={\"Save\"}\n data-testid=\"dialog-accept\"\n onClick={onSave}\n disabled={isSaving}\n />\n </>\n }\n >\n {isSaving && <OverlayLoader text={\"Creating a new version of the image\"} />}\n <ImageEditor ref={imageEditor} src={src} options={options}>\n {({ render }) => render()}\n </ImageEditor>\n </Dialog>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,WAAW;AACpB,SAASC,MAAM,EAAEC,aAAa,QAAQ,kBAAkB;AAgBxD,OAAO,MAAMC,iBAAiB,GAAIC,KAA6B,IAAK;EAChE,MAAM;IAAEC,GAAG;IAAEC,OAAO;IAAEC,QAAQ;IAAEC,OAAO;IAAEC,IAAI;IAAEC,YAAY;IAAE,GAAGC;EAAY,CAAC,GAAGP,KAAK;EACrF,MAAMQ,WAAW,gBAAGd,KAAK,CAACe,SAAS,CAAc,CAAC;EAClD,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGhB,QAAQ,CAAC,KAAK,CAAC;EAE/C,MAAMiB,MAAM,GAAG,MAAAA,CAAA,KAAY;IACvB,IAAI;MACAD,WAAW,CAAC,IAAI,CAAC;MACjB,MAAME,GAAG,GAAGL,WAAW,CAACM,OAAO,GAAGN,WAAW,CAACM,OAAO,CAACC,gBAAgB,CAAC,CAAC,GAAG,EAAE;MAC7E,MAAMZ,QAAQ,CAACU,GAAG,CAAC;IACvB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACRC,OAAO,CAACC,GAAG,CAACF,CAAC,CAAC;IAClB,CAAC,SAAS;MACNL,WAAW,CAAC,KAAK,CAAC;IACtB;EACJ,CAAC;EAED,oBACIjB,KAAA,CAAAyB,aAAA,CAACtB,MAAM,EAAAuB,MAAA,CAAAC,MAAA;IACHC,KAAK,EAAE;MAAEC,MAAM,EAAEjB;IAAa,CAAE;IAChCkB,KAAK,EAAE,YAAa;IACpBC,IAAI,EAAE,MAAO;IACbpB,IAAI,EAAEA,IAAK;IACXD,OAAO,EAAEA;EAAQ,GACbG,WAAW;IACfmB,OAAO,eACHhC,KAAA,CAAAyB,aAAA,CAAAzB,KAAA,CAAAiC,QAAA,qBACIjC,KAAA,CAAAyB,aAAA,CAACtB,MAAM,CAAC+B,YAAY,MAAE,CAAC,eACvBlC,KAAA,CAAAyB,aAAA,CAACtB,MAAM,CAACgC,aAAa;MACjBC,IAAI,EAAE,MAAO;MACb,eAAY,eAAe;MAC3BC,OAAO,EAAEnB,MAAO;MAChBoB,QAAQ,EAAEtB;IAAS,CACtB,CACH;EACL,IAEAA,QAAQ,iBAAIhB,KAAA,CAAAyB,aAAA,CAACrB,aAAa;IAACgC,IAAI,EAAE;EAAsC,CAAE,CAAC,eAC3EpC,KAAA,CAAAyB,aAAA,CAACvB,WAAW;IAACqC,GAAG,EAAEzB,WAAY;IAACP,GAAG,EAAEA,GAAI;IAACC,OAAO,EAAEA;EAAQ,GACrD,CAAC;IAAEgC;EAAO,CAAC,KAAKA,MAAM,CAAC,CACf,CACT,CAAC;AAEjB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ImageEditor";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ImageEditor\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconButton, Tooltip } from "@webiny/admin-ui";
|
|
3
|
+
import { ReactComponent as CropIcon } from "@webiny/icons/crop.svg";
|
|
4
|
+
import Cropper from "cropperjs";
|
|
5
|
+
import "cropperjs/dist/cropper.css";
|
|
6
|
+
let cropper = undefined;
|
|
7
|
+
const renderForm = () => {
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
style: {
|
|
10
|
+
textAlign: "center"
|
|
11
|
+
}
|
|
12
|
+
}, "Click and drag to crop a portion of the image. Hold Shift to persist aspect ratio.");
|
|
13
|
+
};
|
|
14
|
+
const tool = {
|
|
15
|
+
name: "crop",
|
|
16
|
+
icon({
|
|
17
|
+
activateTool
|
|
18
|
+
}) {
|
|
19
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
20
|
+
side: "bottom",
|
|
21
|
+
content: "Crop",
|
|
22
|
+
trigger: /*#__PURE__*/React.createElement(IconButton, {
|
|
23
|
+
variant: "ghost",
|
|
24
|
+
icon: /*#__PURE__*/React.createElement(CropIcon, null),
|
|
25
|
+
onClick: () => activateTool("crop"),
|
|
26
|
+
"data-testid": "crop-item"
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
renderForm,
|
|
31
|
+
onActivate: ({
|
|
32
|
+
canvas,
|
|
33
|
+
options
|
|
34
|
+
}) => {
|
|
35
|
+
cropper = new Cropper(canvas.current, options);
|
|
36
|
+
},
|
|
37
|
+
cancel: () => cropper && cropper.destroy(),
|
|
38
|
+
apply: ({
|
|
39
|
+
canvas
|
|
40
|
+
}) => {
|
|
41
|
+
return new Promise(resolve => {
|
|
42
|
+
if (!cropper) {
|
|
43
|
+
resolve();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const current = canvas.current;
|
|
47
|
+
const src = cropper.getCroppedCanvas().toDataURL();
|
|
48
|
+
if (current) {
|
|
49
|
+
const image = new window.Image();
|
|
50
|
+
const ctx = current.getContext("2d");
|
|
51
|
+
image.onload = () => {
|
|
52
|
+
ctx.drawImage(image, 0, 0);
|
|
53
|
+
current.width = image.width;
|
|
54
|
+
current.height = image.height;
|
|
55
|
+
ctx.drawImage(image, 0, 0);
|
|
56
|
+
resolve();
|
|
57
|
+
};
|
|
58
|
+
image.src = src;
|
|
59
|
+
}
|
|
60
|
+
cropper.destroy();
|
|
61
|
+
cropper = undefined;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
export default tool;
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=crop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","IconButton","Tooltip","ReactComponent","CropIcon","Cropper","cropper","undefined","renderForm","createElement","style","textAlign","tool","name","icon","activateTool","side","content","trigger","variant","onClick","onActivate","canvas","options","current","cancel","destroy","apply","Promise","resolve","src","getCroppedCanvas","toDataURL","image","window","Image","ctx","getContext","onload","drawImage","width","height"],"sources":["crop.tsx"],"sourcesContent":["import React from \"react\";\nimport { ImageEditorTool } from \"./types\";\nimport { IconButton, Tooltip } from \"@webiny/admin-ui\";\nimport { ReactComponent as CropIcon } from \"@webiny/icons/crop.svg\";\nimport Cropper from \"cropperjs\";\nimport \"cropperjs/dist/cropper.css\";\n\nlet cropper: Cropper | undefined = undefined;\n\nconst renderForm = () => {\n return (\n <div style={{ textAlign: \"center\" }}>\n Click and drag to crop a portion of the image. Hold Shift to persist aspect ratio.\n </div>\n );\n};\n\nconst tool: ImageEditorTool = {\n name: \"crop\",\n icon({ activateTool }) {\n return (\n <Tooltip\n side={\"bottom\"}\n content={\"Crop\"}\n trigger={\n <IconButton\n variant={\"ghost\"}\n icon={<CropIcon />}\n onClick={() => activateTool(\"crop\")}\n data-testid={\"crop-item\"}\n />\n }\n />\n );\n },\n renderForm,\n onActivate: ({ canvas, options }) => {\n cropper = new Cropper(canvas.current as HTMLCanvasElement, options);\n },\n cancel: () => cropper && cropper.destroy(),\n apply: ({ canvas }) => {\n return new Promise((resolve: any) => {\n if (!cropper) {\n resolve();\n return;\n }\n\n const current = canvas.current;\n const src = cropper.getCroppedCanvas().toDataURL();\n if (current) {\n const image = new window.Image();\n const ctx = current.getContext(\"2d\") as CanvasRenderingContext2D;\n image.onload = () => {\n ctx.drawImage(image, 0, 0);\n current.width = image.width;\n current.height = image.height;\n\n ctx.drawImage(image, 0, 0);\n resolve();\n };\n image.src = src;\n }\n\n cropper.destroy();\n cropper = undefined;\n });\n }\n};\n\nexport default tool;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,UAAU,EAAEC,OAAO,QAAQ,kBAAkB;AACtD,SAASC,cAAc,IAAIC,QAAQ,QAAQ,wBAAwB;AACnE,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,4BAA4B;AAEnC,IAAIC,OAA4B,GAAGC,SAAS;AAE5C,MAAMC,UAAU,GAAGA,CAAA,KAAM;EACrB,oBACIR,KAAA,CAAAS,aAAA;IAAKC,KAAK,EAAE;MAAEC,SAAS,EAAE;IAAS;EAAE,GAAC,oFAEhC,CAAC;AAEd,CAAC;AAED,MAAMC,IAAqB,GAAG;EAC1BC,IAAI,EAAE,MAAM;EACZC,IAAIA,CAAC;IAAEC;EAAa,CAAC,EAAE;IACnB,oBACIf,KAAA,CAAAS,aAAA,CAACP,OAAO;MACJc,IAAI,EAAE,QAAS;MACfC,OAAO,EAAE,MAAO;MAChBC,OAAO,eACHlB,KAAA,CAAAS,aAAA,CAACR,UAAU;QACPkB,OAAO,EAAE,OAAQ;QACjBL,IAAI,eAAEd,KAAA,CAAAS,aAAA,CAACL,QAAQ,MAAE,CAAE;QACnBgB,OAAO,EAAEA,CAAA,KAAML,YAAY,CAAC,MAAM,CAAE;QACpC,eAAa;MAAY,CAC5B;IACJ,CACJ,CAAC;EAEV,CAAC;EACDP,UAAU;EACVa,UAAU,EAAEA,CAAC;IAAEC,MAAM;IAAEC;EAAQ,CAAC,KAAK;IACjCjB,OAAO,GAAG,IAAID,OAAO,CAACiB,MAAM,CAACE,OAAO,EAAuBD,OAAO,CAAC;EACvE,CAAC;EACDE,MAAM,EAAEA,CAAA,KAAMnB,OAAO,IAAIA,OAAO,CAACoB,OAAO,CAAC,CAAC;EAC1CC,KAAK,EAAEA,CAAC;IAAEL;EAAO,CAAC,KAAK;IACnB,OAAO,IAAIM,OAAO,CAAEC,OAAY,IAAK;MACjC,IAAI,CAACvB,OAAO,EAAE;QACVuB,OAAO,CAAC,CAAC;QACT;MACJ;MAEA,MAAML,OAAO,GAAGF,MAAM,CAACE,OAAO;MAC9B,MAAMM,GAAG,GAAGxB,OAAO,CAACyB,gBAAgB,CAAC,CAAC,CAACC,SAAS,CAAC,CAAC;MAClD,IAAIR,OAAO,EAAE;QACT,MAAMS,KAAK,GAAG,IAAIC,MAAM,CAACC,KAAK,CAAC,CAAC;QAChC,MAAMC,GAAG,GAAGZ,OAAO,CAACa,UAAU,CAAC,IAAI,CAA6B;QAChEJ,KAAK,CAACK,MAAM,GAAG,MAAM;UACjBF,GAAG,CAACG,SAAS,CAACN,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;UAC1BT,OAAO,CAACgB,KAAK,GAAGP,KAAK,CAACO,KAAK;UAC3BhB,OAAO,CAACiB,MAAM,GAAGR,KAAK,CAACQ,MAAM;UAE7BL,GAAG,CAACG,SAAS,CAACN,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;UAC1BJ,OAAO,CAAC,CAAC;QACb,CAAC;QACDI,KAAK,CAACH,GAAG,GAAGA,GAAG;MACnB;MAEAxB,OAAO,CAACoB,OAAO,CAAC,CAAC;MACjBpB,OAAO,GAAGC,SAAS;IACvB,CAAC,CAAC;EACN;AACJ,CAAC;AAED,eAAeK,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When using Caman, we added @ts-expect-error because it does not exist in packages, but it is loaded in packages/ui/src/ImageEditor/ImageEditor.tsx:38.
|
|
3
|
+
* TODO: use some other library to edit images
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { ReactComponent as FilterIcon } from "@webiny/icons/tune.svg";
|
|
7
|
+
import debounce from "lodash/debounce";
|
|
8
|
+
import { Button, Grid, IconButton, Slider, Tooltip } from "@webiny/admin-ui";
|
|
9
|
+
const sliders = [{
|
|
10
|
+
key: "brightness",
|
|
11
|
+
label: "Brightness",
|
|
12
|
+
min: -100
|
|
13
|
+
}, {
|
|
14
|
+
key: "vibrance",
|
|
15
|
+
label: "Vibrance",
|
|
16
|
+
min: -100
|
|
17
|
+
}, {
|
|
18
|
+
key: "hue",
|
|
19
|
+
label: "Hue",
|
|
20
|
+
min: -100
|
|
21
|
+
}, {
|
|
22
|
+
key: "gamma",
|
|
23
|
+
label: "Gamma"
|
|
24
|
+
}, {
|
|
25
|
+
key: "clip",
|
|
26
|
+
label: "Clip"
|
|
27
|
+
}, {
|
|
28
|
+
key: "stackBlur",
|
|
29
|
+
label: "Blur"
|
|
30
|
+
}, {
|
|
31
|
+
key: "contrast",
|
|
32
|
+
label: "Contrast",
|
|
33
|
+
min: -100
|
|
34
|
+
}, {
|
|
35
|
+
key: "saturation",
|
|
36
|
+
label: "Saturation",
|
|
37
|
+
min: -100
|
|
38
|
+
}, {
|
|
39
|
+
key: "exposure",
|
|
40
|
+
label: "Exposure",
|
|
41
|
+
min: -100
|
|
42
|
+
}, {
|
|
43
|
+
key: "sepia",
|
|
44
|
+
label: "Sepia"
|
|
45
|
+
}, {
|
|
46
|
+
key: "noise",
|
|
47
|
+
label: "Noise"
|
|
48
|
+
}, {
|
|
49
|
+
key: "sharpen",
|
|
50
|
+
label: "Sharpen"
|
|
51
|
+
}];
|
|
52
|
+
class RenderForm extends React.Component {
|
|
53
|
+
state = {
|
|
54
|
+
processing: false,
|
|
55
|
+
values: {}
|
|
56
|
+
};
|
|
57
|
+
componentDidMount() {
|
|
58
|
+
this.resetFiltersValues();
|
|
59
|
+
}
|
|
60
|
+
applyFilters = debounce(() => {
|
|
61
|
+
const {
|
|
62
|
+
canvas
|
|
63
|
+
} = this.props;
|
|
64
|
+
const {
|
|
65
|
+
values
|
|
66
|
+
} = this.state;
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
68
|
+
const component = this;
|
|
69
|
+
|
|
70
|
+
// @ts-expect-error
|
|
71
|
+
Caman(canvas.current, function () {
|
|
72
|
+
// @ts-expect-error
|
|
73
|
+
this.revert(false);
|
|
74
|
+
Object.keys(values).forEach(
|
|
75
|
+
// @ts-expect-error
|
|
76
|
+
key => values[key] !== 0 && this[key] && this[key](values[key]));
|
|
77
|
+
// @ts-expect-error
|
|
78
|
+
this.render();
|
|
79
|
+
component.setState({
|
|
80
|
+
processing: false
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}, 200);
|
|
84
|
+
resetFiltersValues = () => {
|
|
85
|
+
this.setState(state => {
|
|
86
|
+
sliders.reduce((output, current) => {
|
|
87
|
+
state.values[current.key] = 0;
|
|
88
|
+
return output;
|
|
89
|
+
}, {});
|
|
90
|
+
return state;
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
render() {
|
|
94
|
+
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(React.Fragment, null, sliders.map(props => /*#__PURE__*/React.createElement(Grid.Column, {
|
|
95
|
+
span: 4,
|
|
96
|
+
key: props.key
|
|
97
|
+
}, /*#__PURE__*/React.createElement(Slider, Object.assign({
|
|
98
|
+
value: Number(this.state.values[props.key]),
|
|
99
|
+
min: 0,
|
|
100
|
+
max: 100,
|
|
101
|
+
disabled: this.state.processing,
|
|
102
|
+
onValueChange: value => {
|
|
103
|
+
this.setState(state => {
|
|
104
|
+
const values = {
|
|
105
|
+
...state.values
|
|
106
|
+
};
|
|
107
|
+
values[props.key] = value;
|
|
108
|
+
return {
|
|
109
|
+
...state,
|
|
110
|
+
processing: true,
|
|
111
|
+
values
|
|
112
|
+
};
|
|
113
|
+
}, this.applyFilters);
|
|
114
|
+
}
|
|
115
|
+
}, props))))), /*#__PURE__*/React.createElement(Grid.Column, {
|
|
116
|
+
span: 12,
|
|
117
|
+
className: "wby-text-center"
|
|
118
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
119
|
+
text: "Reset filters",
|
|
120
|
+
variant: "secondary",
|
|
121
|
+
onClick: () => {
|
|
122
|
+
this.setState({
|
|
123
|
+
processing: true
|
|
124
|
+
}, () => {
|
|
125
|
+
this.resetFiltersValues();
|
|
126
|
+
this.applyFilters();
|
|
127
|
+
this.setState({
|
|
128
|
+
processing: false
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
})));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const tool = {
|
|
136
|
+
name: "filter",
|
|
137
|
+
icon({
|
|
138
|
+
activateTool
|
|
139
|
+
}) {
|
|
140
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
141
|
+
trigger: /*#__PURE__*/React.createElement(IconButton, {
|
|
142
|
+
variant: "ghost",
|
|
143
|
+
icon: /*#__PURE__*/React.createElement(FilterIcon, null),
|
|
144
|
+
onClick: () => activateTool("filter"),
|
|
145
|
+
"data-testid": "filter-item"
|
|
146
|
+
}),
|
|
147
|
+
content: "Filter"
|
|
148
|
+
});
|
|
149
|
+
},
|
|
150
|
+
renderForm(props) {
|
|
151
|
+
return /*#__PURE__*/React.createElement(RenderForm, props);
|
|
152
|
+
},
|
|
153
|
+
cancel: ({
|
|
154
|
+
canvas
|
|
155
|
+
}) => {
|
|
156
|
+
// @ts-expect-error
|
|
157
|
+
Caman(canvas.current, function () {
|
|
158
|
+
// @ts-expect-error
|
|
159
|
+
this.revert(false);
|
|
160
|
+
// @ts-expect-error
|
|
161
|
+
this.render();
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
export default tool;
|
|
166
|
+
|
|
167
|
+
//# sourceMappingURL=filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","ReactComponent","FilterIcon","debounce","Button","Grid","IconButton","Slider","Tooltip","sliders","key","label","min","RenderForm","Component","state","processing","values","componentDidMount","resetFiltersValues","applyFilters","canvas","props","component","Caman","current","revert","Object","keys","forEach","render","setState","reduce","output","createElement","Fragment","map","Column","span","assign","value","Number","max","disabled","onValueChange","className","text","variant","onClick","tool","name","icon","activateTool","trigger","content","renderForm","cancel"],"sources":["filter.tsx"],"sourcesContent":["/**\n * When using Caman, we added @ts-expect-error because it does not exist in packages, but it is loaded in packages/ui/src/ImageEditor/ImageEditor.tsx:38.\n * TODO: use some other library to edit images\n */\nimport React from \"react\";\nimport { ReactComponent as FilterIcon } from \"@webiny/icons/tune.svg\";\nimport debounce from \"lodash/debounce\";\nimport { Button, Grid, IconButton, Slider, Tooltip } from \"@webiny/admin-ui\";\nimport { ImageEditorTool } from \"./types\";\n\ninterface RenderFormState {\n values: Record<string, any>;\n processing: boolean;\n}\n\ninterface RenderFormProps {\n canvas: any;\n renderApplyCancel?: () => void;\n}\n\nconst sliders = [\n {\n key: \"brightness\",\n label: \"Brightness\",\n min: -100\n },\n {\n key: \"vibrance\",\n label: \"Vibrance\",\n min: -100\n },\n {\n key: \"hue\",\n label: \"Hue\",\n min: -100\n },\n {\n key: \"gamma\",\n label: \"Gamma\"\n },\n {\n key: \"clip\",\n label: \"Clip\"\n },\n {\n key: \"stackBlur\",\n label: \"Blur\"\n },\n {\n key: \"contrast\",\n label: \"Contrast\",\n min: -100\n },\n {\n key: \"saturation\",\n label: \"Saturation\",\n min: -100\n },\n {\n key: \"exposure\",\n label: \"Exposure\",\n min: -100\n },\n {\n key: \"sepia\",\n label: \"Sepia\"\n },\n {\n key: \"noise\",\n label: \"Noise\"\n },\n {\n key: \"sharpen\",\n label: \"Sharpen\"\n }\n];\n\nclass RenderForm extends React.Component<RenderFormProps, RenderFormState> {\n public override state: RenderFormState = {\n processing: false,\n values: {}\n };\n\n public override componentDidMount() {\n this.resetFiltersValues();\n }\n\n private readonly applyFilters = debounce(() => {\n const { canvas } = this.props;\n const { values } = this.state;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const component = this;\n\n // @ts-expect-error\n Caman(canvas.current, function () {\n // @ts-expect-error\n this.revert(false);\n Object.keys(values).forEach(\n // @ts-expect-error\n key => values[key] !== 0 && this[key] && this[key](values[key])\n );\n // @ts-expect-error\n this.render();\n component.setState({ processing: false });\n });\n }, 200);\n\n private readonly resetFiltersValues = () => {\n this.setState(state => {\n sliders.reduce((output, current) => {\n state.values[current.key] = 0;\n return output;\n }, {});\n\n return state;\n });\n };\n\n public override render() {\n return (\n <Grid>\n <>\n {sliders.map(props => (\n <Grid.Column span={4} key={props.key}>\n <Slider\n value={Number(this.state.values[props.key])}\n min={0}\n max={100}\n disabled={this.state.processing}\n onValueChange={(value: number) => {\n this.setState(state => {\n const values = { ...state.values };\n values[props.key] = value;\n\n return { ...state, processing: true, values };\n }, this.applyFilters);\n }}\n {...props}\n />\n </Grid.Column>\n ))}\n </>\n <Grid.Column span={12} className={\"wby-text-center\"}>\n <Button\n text={\"Reset filters\"}\n variant={\"secondary\"}\n onClick={() => {\n this.setState({ processing: true }, () => {\n this.resetFiltersValues();\n this.applyFilters();\n this.setState({ processing: false });\n });\n }}\n />\n </Grid.Column>\n </Grid>\n );\n }\n}\n\nconst tool: ImageEditorTool = {\n name: \"filter\",\n icon({ activateTool }) {\n return (\n <Tooltip\n trigger={\n <IconButton\n variant={\"ghost\"}\n icon={<FilterIcon />}\n onClick={() => activateTool(\"filter\")}\n data-testid={\"filter-item\"}\n />\n }\n content={\"Filter\"}\n />\n );\n },\n renderForm(props) {\n return <RenderForm {...props} />;\n },\n cancel: ({ canvas }) => {\n // @ts-expect-error\n Caman(canvas.current, function () {\n // @ts-expect-error\n this.revert(false);\n // @ts-expect-error\n this.render();\n });\n }\n};\n\nexport default tool;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,IAAIC,UAAU,QAAQ,wBAAwB;AACrE,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAASC,MAAM,EAAEC,IAAI,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;IAAEC;EAAa,CAAC,EAAE;IACnB,oBACIpD,KAAA,CAAAkC,aAAA,CAAC1B,OAAO;MACJ6C,OAAO,eACHrD,KAAA,CAAAkC,aAAA,CAAC5B,UAAU;QACPyC,OAAO,EAAE,OAAQ;QACjBI,IAAI,eAAEnD,KAAA,CAAAkC,aAAA,CAAChC,UAAU,MAAE,CAAE;QACrB8C,OAAO,EAAEA,CAAA,KAAMI,YAAY,CAAC,QAAQ,CAAE;QACtC,eAAa;MAAc,CAC9B,CACJ;MACDE,OAAO,EAAE;IAAS,CACrB,CAAC;EAEV,CAAC;EACDC,UAAUA,CAACjC,KAAK,EAAE;IACd,oBAAOtB,KAAA,CAAAkC,aAAA,CAACrB,UAAU,EAAKS,KAAQ,CAAC;EACpC,CAAC;EACDkC,MAAM,EAAEA,CAAC;IAAEnC;EAAO,CAAC,KAAK;IACpB;IACAG,KAAK,CAACH,MAAM,CAACI,OAAO,EAAE,YAAY;MAC9B;MACA,IAAI,CAACC,MAAM,CAAC,KAAK,CAAC;MAClB;MACA,IAAI,CAACI,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC;EACN;AACJ,CAAC;AAED,eAAemB,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button, IconButton, Tooltip } from "@webiny/admin-ui";
|
|
3
|
+
import { ReactComponent as FlipIcon } from "@webiny/icons/flip.svg";
|
|
4
|
+
import Cropper from "cropperjs";
|
|
5
|
+
import "cropperjs/dist/cropper.css";
|
|
6
|
+
let cropper;
|
|
7
|
+
const flipped = {
|
|
8
|
+
x: 1,
|
|
9
|
+
y: 1
|
|
10
|
+
};
|
|
11
|
+
const renderForm = () => {
|
|
12
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: "wby-flex wby-justify-center wby-gap-sm"
|
|
14
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
15
|
+
text: "FlipX",
|
|
16
|
+
variant: "secondary",
|
|
17
|
+
onClick: () => {
|
|
18
|
+
if (!cropper) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
flipped.x = flipped.x === 1 ? -1 : 1;
|
|
22
|
+
cropper.scaleX(flipped.x);
|
|
23
|
+
}
|
|
24
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
25
|
+
text: "FlipY",
|
|
26
|
+
variant: "secondary",
|
|
27
|
+
onClick: () => {
|
|
28
|
+
if (!cropper) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
flipped.y = flipped.y === 1 ? -1 : 1;
|
|
32
|
+
cropper.scaleY(flipped.y);
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
const tool = {
|
|
37
|
+
name: "flip",
|
|
38
|
+
icon({
|
|
39
|
+
activateTool
|
|
40
|
+
}) {
|
|
41
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
42
|
+
side: "bottom",
|
|
43
|
+
content: "Flip",
|
|
44
|
+
trigger: /*#__PURE__*/React.createElement(IconButton, {
|
|
45
|
+
variant: "ghost",
|
|
46
|
+
icon: /*#__PURE__*/React.createElement(FlipIcon, null),
|
|
47
|
+
onClick: () => activateTool("flip"),
|
|
48
|
+
"data-testid": "flip-item"
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
renderForm,
|
|
53
|
+
cancel: () => cropper && cropper.destroy(),
|
|
54
|
+
onActivate: ({
|
|
55
|
+
canvas
|
|
56
|
+
}) => {
|
|
57
|
+
cropper = new Cropper(canvas.current, {
|
|
58
|
+
background: false,
|
|
59
|
+
modal: false,
|
|
60
|
+
guides: false,
|
|
61
|
+
dragMode: "none",
|
|
62
|
+
highlight: false,
|
|
63
|
+
autoCrop: false
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
apply: ({
|
|
67
|
+
canvas
|
|
68
|
+
}) => {
|
|
69
|
+
return new Promise(resolve => {
|
|
70
|
+
if (!cropper) {
|
|
71
|
+
resolve();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const current = canvas.current;
|
|
75
|
+
const src = cropper.getCroppedCanvas().toDataURL();
|
|
76
|
+
if (current) {
|
|
77
|
+
const image = new window.Image();
|
|
78
|
+
const ctx = current.getContext("2d");
|
|
79
|
+
image.onload = () => {
|
|
80
|
+
ctx.drawImage(image, 0, 0);
|
|
81
|
+
current.width = image.width;
|
|
82
|
+
current.height = image.height;
|
|
83
|
+
ctx.drawImage(image, 0, 0);
|
|
84
|
+
resolve();
|
|
85
|
+
};
|
|
86
|
+
image.src = src;
|
|
87
|
+
}
|
|
88
|
+
cropper.destroy();
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
export default tool;
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=flip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Button","IconButton","Tooltip","ReactComponent","FlipIcon","Cropper","cropper","flipped","x","y","renderForm","createElement","className","text","variant","onClick","scaleX","scaleY","tool","name","icon","activateTool","side","content","trigger","cancel","destroy","onActivate","canvas","current","background","modal","guides","dragMode","highlight","autoCrop","apply","Promise","resolve","src","getCroppedCanvas","toDataURL","image","window","Image","ctx","getContext","onload","drawImage","width","height"],"sources":["flip.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button, IconButton, Tooltip } from \"@webiny/admin-ui\";\nimport { ReactComponent as FlipIcon } from \"@webiny/icons/flip.svg\";\nimport Cropper from \"cropperjs\";\nimport \"cropperjs/dist/cropper.css\";\nimport { ImageEditorTool } from \"./types\";\n\nlet cropper: Cropper;\n\nconst flipped = { x: 1, y: 1 };\n\nconst renderForm = () => {\n return (\n <div className={\"wby-flex wby-justify-center wby-gap-sm\"}>\n <Button\n text={\"FlipX\"}\n variant={\"secondary\"}\n onClick={() => {\n if (!cropper) {\n return;\n }\n\n flipped.x = flipped.x === 1 ? -1 : 1;\n cropper.scaleX(flipped.x);\n }}\n />\n <Button\n text={\"FlipY\"}\n variant={\"secondary\"}\n onClick={() => {\n if (!cropper) {\n return;\n }\n\n flipped.y = flipped.y === 1 ? -1 : 1;\n cropper.scaleY(flipped.y);\n }}\n />\n </div>\n );\n};\n\nconst tool: ImageEditorTool = {\n name: \"flip\",\n icon({ activateTool }) {\n return (\n <Tooltip\n side={\"bottom\"}\n content={\"Flip\"}\n trigger={\n <IconButton\n variant={\"ghost\"}\n icon={<FlipIcon />}\n onClick={() => activateTool(\"flip\")}\n data-testid={\"flip-item\"}\n />\n }\n />\n );\n },\n renderForm,\n cancel: () => cropper && cropper.destroy(),\n onActivate: ({ canvas }) => {\n cropper = new Cropper(canvas.current as HTMLCanvasElement, {\n background: false,\n modal: false,\n guides: false,\n dragMode: \"none\",\n highlight: false,\n autoCrop: false\n });\n },\n apply: ({ canvas }) => {\n return new Promise((resolve: any) => {\n if (!cropper) {\n resolve();\n return;\n }\n\n const current = canvas.current;\n const src = cropper.getCroppedCanvas().toDataURL();\n if (current) {\n const image = new window.Image();\n const ctx = current.getContext(\"2d\") as CanvasRenderingContext2D;\n image.onload = () => {\n ctx.drawImage(image, 0, 0);\n current.width = image.width;\n current.height = image.height;\n\n ctx.drawImage(image, 0, 0);\n resolve();\n };\n image.src = src;\n }\n\n cropper.destroy();\n });\n }\n};\n\nexport default tool;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,QAAQ,kBAAkB;AAC9D,SAASC,cAAc,IAAIC,QAAQ,QAAQ,wBAAwB;AACnE,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,4BAA4B;AAGnC,IAAIC,OAAgB;AAEpB,MAAMC,OAAO,GAAG;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE;AAAE,CAAC;AAE9B,MAAMC,UAAU,GAAGA,CAAA,KAAM;EACrB,oBACIX,KAAA,CAAAY,aAAA;IAAKC,SAAS,EAAE;EAAy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"version":3,"names":["default","crop","flip","filter","rotate"],"sources":["index.ts"],"sourcesContent":["export { default as crop } from \"./crop\";\nexport { default as flip } from \"./flip\";\nexport { default as filter } from \"./filter\";\nexport { default as rotate } from \"./rotate\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI;AACxB,SAASD,OAAO,IAAIE,IAAI;AACxB,SAASF,OAAO,IAAIG,MAAM;AAC1B,SAASH,OAAO,IAAII,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconButton, Slider, Tooltip } from "@webiny/admin-ui";
|
|
3
|
+
import { ReactComponent as RotateRight } from "@webiny/icons/rotate_right.svg";
|
|
4
|
+
import Cropper from "cropperjs";
|
|
5
|
+
import "cropperjs/dist/cropper.css";
|
|
6
|
+
let cropper;
|
|
7
|
+
class RenderForm extends React.Component {
|
|
8
|
+
state = {
|
|
9
|
+
rangeInput: 0
|
|
10
|
+
};
|
|
11
|
+
render() {
|
|
12
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Slider, {
|
|
13
|
+
label: "Range Input",
|
|
14
|
+
value: Number(this.state.rangeInput),
|
|
15
|
+
min: 0,
|
|
16
|
+
max: 360,
|
|
17
|
+
step: 10,
|
|
18
|
+
onValueChange: value => {
|
|
19
|
+
this.setState({
|
|
20
|
+
rangeInput: value
|
|
21
|
+
}, async () => {
|
|
22
|
+
if (cropper) {
|
|
23
|
+
cropper.rotateTo(parseInt(String(value), 10));
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const tool = {
|
|
31
|
+
name: "rotate",
|
|
32
|
+
icon({
|
|
33
|
+
activateTool
|
|
34
|
+
}) {
|
|
35
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
36
|
+
side: "bottom",
|
|
37
|
+
content: "Rotate",
|
|
38
|
+
trigger: /*#__PURE__*/React.createElement(IconButton, {
|
|
39
|
+
variant: "ghost",
|
|
40
|
+
icon: /*#__PURE__*/React.createElement(RotateRight, null),
|
|
41
|
+
onClick: () => activateTool("rotate"),
|
|
42
|
+
"data-testid": "rotate-item"
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
renderForm(props) {
|
|
47
|
+
return /*#__PURE__*/React.createElement(RenderForm, props);
|
|
48
|
+
},
|
|
49
|
+
onActivate: ({
|
|
50
|
+
canvas
|
|
51
|
+
}) => {
|
|
52
|
+
/**
|
|
53
|
+
* We can safely cast canvas.current as HTMLCanvasElement
|
|
54
|
+
*/
|
|
55
|
+
cropper = new Cropper(canvas.current, {
|
|
56
|
+
background: false,
|
|
57
|
+
modal: false,
|
|
58
|
+
guides: false,
|
|
59
|
+
dragMode: "none",
|
|
60
|
+
highlight: false,
|
|
61
|
+
autoCrop: false
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
cancel: () => cropper && cropper.destroy(),
|
|
65
|
+
apply: ({
|
|
66
|
+
canvas
|
|
67
|
+
}) => {
|
|
68
|
+
return new Promise(resolve => {
|
|
69
|
+
if (!cropper) {
|
|
70
|
+
resolve();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const current = canvas.current;
|
|
74
|
+
const src = cropper.getCroppedCanvas().toDataURL();
|
|
75
|
+
if (current) {
|
|
76
|
+
const image = new window.Image();
|
|
77
|
+
const ctx = current.getContext("2d");
|
|
78
|
+
image.onload = () => {
|
|
79
|
+
ctx.drawImage(image, 0, 0);
|
|
80
|
+
current.width = image.width;
|
|
81
|
+
current.height = image.height;
|
|
82
|
+
ctx.drawImage(image, 0, 0);
|
|
83
|
+
};
|
|
84
|
+
image.src = src;
|
|
85
|
+
resolve();
|
|
86
|
+
}
|
|
87
|
+
cropper.destroy();
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
export default tool;
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=rotate.js.map
|