-
Notifications
You must be signed in to change notification settings - Fork 37
Support for uploading images with base64 source #248
Conversation
Ready for review. |
I have changed the way upload integrates with base64/blob images. Now Important changes:
Slightly different approach for fetching images: As mentioned in points 2 and 3 above the flow for fetching base64/blob images is:
I was wondering if the flow could be altered as:
So in the second variant, the |
package.json
Outdated
@@ -10,6 +10,7 @@ | |||
"ckeditor5-plugin" | |||
], | |||
"dependencies": { | |||
"@ckeditor/ckeditor5-clipboard": "^10.0.3", |
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.
That's not necessary. You're not using it anyway. You're only using plugins.get( 'Clipboard' )
which can be satisfied by other implementations of this feature (not only ckeditor5-clipboard
).
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.
I see, wouldn't
this.listenTo( editor.plugins.get( 'Clipboard' ), ... );
fail if there will not be any Clipboard
feature in the CKEditor build?
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.
☝️ cc @Reinmar
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.
Yes, it would fail. But we do the same thing with other feature-feature relations. This simplifies recomposing the editor with e.g. a bit different implementation of one of those features.
We use Plugin#requires()
for feature-util and gluefeature-subfeature relations.
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.
We can simplify a couple of things here.
Co-Authored-By: f1ames <[email protected]>
Suggested merge commit message (convention)
Feature: Support for uploading images with base64 source. Closes ckeditor/ckeditor5#5172. Closes ckeditor/ckeditor5#2524.
Additional information
See ckeditor/ckeditor5#5172 (and https://github.com/ckeditor/ckeditor5-paste-from-office/issues/24#issuecomment-436186985 which explains the approach a little). ATM Edge browser is not supported, see ckeditor/ckeditor5#5173.