I want to create a custom plugin for CKEditor 5 in react.js like what is done in:
StackOverFlow question: CKEditor 5 insert image by external url
CKEditor documentation: Creating a simple plugin
In the above examples when the plugin is clicked the code below executes and user enters the image URL:
const imageUrl = prompt( 'Image URL' );
which is in init()
method of the plugin class. But what I'm intending to do is:
When the custom plugin is clicked I want a react component to open, then user selects an image and the URL of the selected image gets passed to CKEditor to be inserted. I've read lots of articles and Stackoverflow Q&As but still I don't know how to manage the click event of the plugin in React to open the component and pass the URL to CKEditor.
P.S: I'm using a build of CKEditor which I'm customizing and building it myself (like this article). So I'm NOT integrating CKEditor into my project which is another option of using it in React.