Skip to content

Commit

Permalink
Add @ckeditor5/image-resize as opt-in plugin configuratable by ckedit…
Browse files Browse the repository at this point in the history
…or config
  • Loading branch information
Vladimír Votava committed Feb 6, 2025
1 parent 7a366ba commit d351c9a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/web/assets/ckeditor/dist/ckeditor5-craftcms.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/ckeditor/dist/ckeditor5-craftcms.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/web/assets/ckeditor/src/ckeditor5-craftcms.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {Alignment} from '@ckeditor/ckeditor5-alignment';
import {
AutoImage,
Image,
ImageResize,
ImageCaption,
ImageStyle,
ImageToolbar,
Expand Down Expand Up @@ -87,6 +88,7 @@ const allPlugins = [
HtmlComment,
HtmlEmbed,
Image,
ImageResize,
ImageCaption,
ImageStyle,
ImageToolbar,
Expand Down Expand Up @@ -565,6 +567,12 @@ export const create = async function (element, config) {
// for more info
removePlugins.push('MediaEmbedToolbar');

// remove ImageResize build-in plugin, if it's not explicitly allowed in config
// see: https://github.com/craftcms/ckeditor/issues/328
if (!config.enableImageResize) {
removePlugins.push('ImageResize');
}

if (removePlugins.length) {
plugins = plugins.filter((p) => !removePlugins.includes(p.pluginName));
}
Expand Down

0 comments on commit d351c9a

Please sign in to comment.