-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2052: Support for inline images #9236
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…gin rather than in model attributes to prevent issues with RTC.
…red in an internal map but not in a model attribute.
Other (image): The side-aligned images should always have some min-width property to not take the whole editor width. Closes #9342.
Internal: Renamed the `'image'` model element to `'imageBlock'`. Closes #9246.
# Conflicts: # packages/ckeditor5-image/src/imagestyle/imagestylecommand.js
Internal (image): Added post-fixer for the `imageStyle` attribute to ensure a valid value for a given image type.
# Conflicts: # packages/ckeditor5-link/package.json
Steps:
CKE5-inline-linked-table-caption.mp4Result:Editor crashes with error:
Notes:
|
Steps:
CKE5-inline-drag-html-undo.mp4Result:Editor throws error:
Notes:
|
Docs: Inline images guide. Closes #8591.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Suggested merge commit message (convention)
Feature (image): Introduced support for inline images in editor content. Available out–of–the–box in all ready–to–use editor builds inline images can be uploaded, styled, resized, and linked and complement the already supported block images. See the image feature overview guide to see inline images in action. For more information about breaking changes, migration path, and tips, check out the migration guide.
Feature (image): It should be possible to define the dropdown menu as an object in the
config.image.toolbar
configuration. Closes #9340.Other (image): Turned the image utils module into an editor plugin to allow sharing utils outside the package. See #8871.
Fix (image): The side-aligned images should always have some
min-width
property to not take the whole editor width. Closes #9342.Fix (image): The floating block images, except the
side
image, should be displayed side by side by default. Closes #9183.Fix (image): An image should never overflow the widget boundaries while changing its size. Closes #9166.
Fix (image): The size label should be displayed above the image if it doesn't fit inside. See #9166.
Fix (image): An Image caption placeholder text should not wrap or overflow. Closes #9162.
Other (image): The image toolbar should be visible if the selection is placed inside an image caption. Closes #9136.
Other (image): The image caption should be controlled using the toolbar button and a command for better integration with image styles. Closes #8907.
Other (build-decoupled-document): The editor document build should include the
ImageResize
plugin. Closes #9507.Feature (link): Integrated the link feature with inline images. Closes #8871. Closes #9017. Closes #9167.
Fix (link): The link UI should be shown when clicking a linked inline widget. Closes #9607.
Other (widget): Safeguarded the way the
Widget
plugin sets the fake selection. Closes #9580.Fix (widget): Selected inline widgets wrapped in an attribute in the view should create a fake selection. Closes #9524. Closes #9521.
Other (widget): Replaced the
findOptimalInsertionPosition()
helper withfindOptimalInsertionRange()
that will now attempt to replace selected blocks when inserting new widgets. Closes #9102.Fix (clipboard): Hide all toolbars when the user starts dragging the widget and show them when the drag ends. Closes #9566.
Fix (code-block): The code block feature should not allow for inserting inline widgets as its content. Closes #9567.
Other (easy-image): Removed the
Image
plugin dependency from theEasyImage
plugin. Closes #9399.Other (table): Added the
.ck-table-bogus-paragraph
CSS class to the in-cell pseudo-paragraph used for data tables for easier and safer styling.Other (core): Added several icons for new image styles (see #8909).
Other (ui): Added the
class
property to theSplitButtonView
UI component. See #8909.Other (image, table, html-embed, media-embed, page-break, horizontal-line): New widgets will replace the selected block instead of being added next to it while being inserted (see #9102).
BREAKING CHANGE (image): The
Image
plugin works as a glue for bothImageBlock
andImageInline
features now (previously only block images). If you do not want inline images to be allowed, consider replacing theImage
plugin withImageBlock
in your editor configuration. Otherwise, all images without the<figure>
wrapper will be loaded into the editor content as inline images, which in some cases may affect content semantics and styling.BREAKING CHANGE (image): The
ImageEditing
plugin is no longer standalone as the majority of its logic was extracted toImageBlockEditing
andImageInlineEditing
plugins. The logic remaining in theImageEditing
is common for bothImageBlockEditing
andImageInlineEditing
plugins.BREAKING CHANGE (image): The image caption is no longer displayed automatically the user selects a block image. Instead, its presence is controlled using the
'toggleImageCaption'
toolbar button and aToggleImageCaptionCommand
for better integration with revamped image styles system. Learn more.BREAKING CHANGE (image): Some helpers from the image utils module (
@ckeditor/ckeditor5-image/src/image/utils.js
) have moved to theImageUtils
plugin. The helpers are still accessible viaeditor.plugins.get( 'ImageUtils' )
namespace, for instance,editor.plugins.get( 'ImageUtils' ).insertImage( ... )
.BREAKING CHANGE (image): The API of the
insertImage()
helper has changed, please make sure to update your integrations.BREAKING CHANGE (image): The
getSelectedImageWidget()
helper is no longer part of the public API.BREAKING CHANGE (image): The
getViewImgFromWidget()
helper is no longer part of the public API.BREAKING CHANGE (image): The
isImageAllowed()
helper is no longer part of the public API.BREAKING CHANGE (image): The
isImage()
helper is no longer part of the public API.BREAKING CHANGE (image): The
isImageWidget()
helper is no longer part of the public API.BREAKING CHANGE (image): The
toImageWidget()
helper is no longer part of the public API.BREAKING CHANGE (image): The
captionElementCreator()
helper is no longer part of the public API.BREAKING CHANGE (image): The
isCaption()
helper is no longer part of the public API.BREAKING CHANGE (image): The
getCaptionFromImage()
helper is now available asgetCaptionFromImageModelElement()
.BREAKING CHANGE (image): The
matchImageCaption()
helper is now available asmatchImageCaptionViewElement()
.BREAKING CHANGE (image): The
defaultIcons
are now available asDEFAULT_ICONS
.BREAKING CHANGE (image): The
defaultStyles
are now available asDEFAULT_OPTIONS
.BREAKING CHANGE (image): The linked image indicator (icon) rendered as a
<span>
with the.ck-link-image_icon
CSS class has been removed. To alter the look of the indicator (including the icon), please usefigure.image > a::after
(for linked block images) anda span.image-inline::after
(for linked inline images) CSS selectors instead.BREAKING CHANGE (image): The
isImageWidget()
helper is no longer exposed by theImage
plugin.BREAKING CHANGE (image): The API of common image converters has changed. Please refer to the documentation to learn more.
BREAKING CHANGE (image): The API of various image caption utils has changed. Please refer to the documentation to learn more.
BREAKING CHANGE (image): The conversion helpers
srcsetAttributeConverter()
andmodelToViewAttributeConverter()
now require theimageType
parameter.BREAKING CHANGE (easy-image): The
EasyImage
plugin is no longer automatically importing theImage
plugin as a dependency. Learn more.BREAKING CHANGE (ckfinder): The
CKFinder
plugin is no longer automatically importing theImage
plugin as a dependency. Learn more.BREAKING CHANGE (link): The
isImageAllowed()
helper is now available asisLinkableElement()
.BREAKING CHANGE (media-embed): The API of the
insertMedia()
helper has changed. See the documentation to learn more.BREAKING CHANGE (build-decoupled-document): The official decoupled document build now ships with the
ImageResize
plugin enabled by default. Learn more.BREAKING CHANGE (table): The in-cell pseudo-paragraph used for data tables is no longer styled using the inline
style
attribute but a.ck-table-bogus-paragraph
CSS class instead.BREAKING CHANGE (widget): The
findOptimalInsertionPosition()
helper is nowfindOptimalInsertionRange()
and returns a model range. Also, instead of searching for a position next to the currently selected block, it will now attempt to replace that block (see #9102).BREAKING CHANGE (widget): The
checkSelectionOnObject()
helper is no longer part of the public API.Additional information