Skip to content

Commit 49b46d0

Browse files
authored
[5.0] Media Manager Image crop using importmaps (#41034)
* Image crop using Copeer module * Remove the polyfill from the dependencies * Update Crop.php * Update settings.json
1 parent 12a1274 commit 49b46d0

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

build/build-modules-js/settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@
215215
"name": "cropperjs",
216216
"js": {
217217
"dist/cropper.js": "js/cropper.js",
218-
"dist/cropper.min.js": "js/cropper.min.js"
218+
"dist/cropper.min.js": "js/cropper.min.js",
219+
"dist/cropper.esm.js": "js/cropper.esm.js"
219220
},
220221
"css": {
221222
"dist/cropper.css": "css/cropper.css",
@@ -227,9 +228,16 @@
227228
"type": "style",
228229
"uri": "cropper.min.css"
229230
},
231+
{
232+
"name": "cropper.esm",
233+
"type": "script",
234+
"uri": "cropper.esm.js",
235+
"importmap": true
236+
},
230237
{
231238
"name": "cropperjs",
232239
"type": "script",
240+
"deprecated": true,
233241
"uri": "cropper.min.js",
234242
"attributes": {
235243
"defer": true

build/media_source/plg_media-action_crop/js/crop.es6.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
33
* @license GNU General Public License version 2 or later; see LICENSE.txt
44
*/
5-
/* global Cropper */
5+
// eslint-disable-next-line import/no-unresolved
6+
import Cropper from 'cropper-module';
7+
68
let formElements;
79
let activated = false;
810
let instance;

plugins/media-action/crop/src/Extension/Crop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function loadJs()
3939
return;
4040
}
4141

42-
$this->getApplication()->getDocument()->getWebAssetManager()->useScript('cropperjs');
42+
$this->getApplication()->getDocument()->getWebAssetManager()->useScript('cropper.esm');
4343
}
4444

4545
/**

0 commit comments

Comments
 (0)