import VuetifyIcon from '~/extensions/nativeExtensions/icons/VuetifyIcon' ; import AbstractExtension from '~/extensions/AbstractExtension' ; import ExtensionActionInterface from '~/extensions/actions/ExtensionActionInterface' ; import { VuetifyIconsGroups } from '~/configs/theme' ; import ExtensionActionRenderBtn from '~/extensions/actions/renders/btn/ExtensionActionRenderBtn.ts' ; export default class MyCustomExtension extends AbstractExtension { isEditable ? : boolean ; get availableActions ( ) : ExtensionActionInterface [ ] { return [ { render : new ExtensionActionRenderBtn ( { tooltip : ( context , options ) => options . isActive ( context ) ? 'Make read-only' : 'Disable read-only' , icons : { [ VuetifyIconsGroups . fa ] : new VuetifyIcon ( 'fas fa-lock' ) , [ VuetifyIconsGroups . mdi ] : new VuetifyIcon ( 'mdi-cancel' ) } , onClick : ( { editor } ) => { this . isEditable = ! editor . options . editable ; editor . setOptions ( { editable : this . isEditable } ) ; } , isActive : ( ) => { return ! this . isEditable ; } } ) } ] ; } onEditorInit ( editor ) { this . isEditable = editor . options . editable ; } }