create a plugin to CKEditor that triggered an image drop or select:
https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/upload-adapter.html
The component should emit a file event, that includes the actual file selected, and a callbacks to get the file URL after uploaded, or an error.
from the client perspective, the usage should look like:
<template>
<gp-editor :value="value" @file=onFileUpload"/>
</template>
<script>
export default {
setup() {
const onFileUpload = ({file, resolve, reject}) => {
callUploadApi(file)
.then(url => resolve({url}))
.catch(() => reject(new Error()))
}
return {value: 'bla bla', onFileUpload}
}
}
</script>
create a plugin to CKEditor that triggered an image drop or select:
https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/upload-adapter.html
The component should emit a
fileevent, that includes the actual file selected, and a callbacks to get the file URL after uploaded, or an error.from the client perspective, the usage should look like: