-
-
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
New UI for insert image feature #15255
Conversation
…ion does not require form view, and it is the only enabled integration,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
One missing description - but it's not a blocker.
@@ -32,7 +32,7 @@ | |||
} | |||
|
|||
& > .ck-collapsible__children { | |||
padding: 0 var(--ck-spacing-large) var(--ck-spacing-large); | |||
padding: var(--ck-spacing-medium) var(--ck-spacing-large) var(--ck-spacing-large); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's increased from 0
to medium
😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When it's larger it looks strange when the button outline is not visible.
To give context. In the dropdown, the user already has a context that it's a dropdown to insert an image. The main button does not have the context, so an extended label is used to make it clear that it's inserting images, not any file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and works good 👍
Only questions regarding types (in comments).
@@ -57,5 +59,43 @@ export default class CKBoxUI extends Plugin { | |||
|
|||
return button; | |||
} ); | |||
|
|||
if ( editor.plugins.has( 'ImageInsertUI' ) ) { | |||
const imageInsertUI: ImageInsertUI = editor.plugins.get( 'ImageInsertUI' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this explicit type ImageInsertUI
needed in this case?
const imageInsertUI: ImageInsertUI = editor.plugins.get( 'ImageInsertUI' ); | ||
const command: CKFinderCommand = editor.commands.get( 'ckfinder' )!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these explicit types needed here?
return this._createDropdownView( locale ); | ||
}; | ||
const selection = editor.model.document.selection; | ||
const imageUtils: ImageUtils = editor.plugins.get( 'ImageUtils' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this explicit type needed here?
Suggested merge commit message (convention)
Feature (image): Introduced the image insert dropdown as a consistent UI to insert images through different available integrations like image upload, insert image with asset manager, and insert image via URL. Closes #15303. Closes #15149.
Other (image): The
ImageUploadUI
plugin is loaded by default when theImageBlock
orImageInline
plugins are loaded. See #15149.Other (list, ui): The
CollapsibleView
moved from thelist
package to theui
package. See #15149.Other (ui): The
SplitButtonView
constructor andcreateDropdown()
helper accepts an instance of aButtonView
as an action view customization. See #15149.Other (upload): The
FileDialogButtonView
is now an instance of theButtonView
, not just a wrapper on it. See #15149.Internal (ckbox, ckfinder, image): The
ImageUploadUI
,CKBoxUI
,CKFinderUI
, andImageInsertViaUrlUI
plugins are registering integrations in theImageInsertUI
.Internal (core): Added icons for
ImageUploadUI
and its integrations. Added translation contexts for common labels for images insert/replace via file manager.MINOR BREAKING CHANGE (list): The
CollapsibleView
moved from thelist
package to theui
package. You can import it like this:import { CollapsibleView } from '@ckeditor/ckeditor5-ui';
Additional information