How to catch event when image is uploaded in ckeditor 5?

In Laravel 8 / livewire 2 app uploading images in ckeditor 5/32.0.0 I have a problem with applying value to livewire model
when Image is selected and uploaded. When I need to apply text content to livewire model I use
I do :

ClassicEditor
    .create( document.querySelector( '#content_textarea' ), {
        extraPlugins: [ SimpleUploadAdapterPlugin ],
    } )


    .then(editor => {
        console.log('editor::')
        console.log(editor)

        editor.ui.focusTracker.on( 'change:isFocused', ( evt, name, isFocused ) => {
            if ( !isFocused ) { // THAT WORKS OK 
                // Do whatever you want with current editor data:
                var wireIds = window.livewire.find(doc.getAttribute("wire:id"))
                wireIds.set('form.content', editor.getData())
            }
        } );  // 'change:isFocused'

        // Non of events below is triggered 
        editor.ui.focusTracker.on( 'change:uploadTotal', ( eventInfo, name, value, oldValue ) => {
            console.log('change:uploadTotal eventInfo::')
            console.log(eventInfo)
            ...
        } );  
        editor.ui.focusTracker.on( 'change:uploaded', ( eventInfo, name, value, oldValue ) => {
            console.log('uploaded eventInfo::')
            console.log(eventInfo)
            ...
        } );  

        editor.ui.focusTracker.on( 'set:uploaded', ( eventInfo, name, value, oldValue ) => {
            console.log('SET uploaded eventInfo::')
            console.log(eventInfo)
            ...
        } );  

    })

    .catch( error => {
        console.error( error );
    } );

I read docs here

and I used events from this listing, not of them is triggered…

Which syntax is valid ?

Thanks!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.