import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
import toggleToolbarIcon from '../../themes/icons/toggle-toolbar.svg';
import * as QMSCKEditorService from '../common/qmsCKEditorService';
export default class ToggleToolbar extends Plugin {
    init() {
        const editor = this.editor;
        const t = editor.t;
        //const toolbar= editor.config.get('toggleToolbarConfig.toolbar') || [];
        editor.ui.componentFactory.add('toggleToolbar', locale => {
            const view = new ButtonView(locale);
            view.set({
                label: t('Toggle Toolbar'),
                icon: toggleToolbarIcon,
                tooltip: true
            });

            view.on('execute', () => {
                QMSCKEditorService.toggleToolbarNotify(null);
            })
            return view;
        })
    }
}
