Skip to content

Ability to upload images using component's events #3

Description

@davidmeirlevy

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions