chore(ckeditor5-footnotes): integrate source code changes

This commit is contained in:
Elian Doran
2025-05-04 20:31:25 +03:00
parent 9643bf310e
commit d977866c44
51 changed files with 14 additions and 1323 deletions

View File

@@ -1,39 +1,13 @@
import { Plugin, ButtonView } from 'ckeditor5';
import ckeditor5Icon from '../theme/icons/ckeditor.svg';
import { Plugin } from 'ckeditor5';
import FootnoteEditing from './footnote-editing/footnote-editing.js';
import FootnoteUI from './footnote-ui.js';
export default class Footnotes extends Plugin {
public static get pluginName() {
return 'Footnotes' as const;
}
public init(): void {
const editor = this.editor;
const t = editor.t;
const model = editor.model;
// Register the "footnotes" button, so it can be displayed in the toolbar.
editor.ui.componentFactory.add( 'footnotes', locale => {
const view = new ButtonView( locale );
view.set( {
label: t( 'Footnotes' ),
icon: ckeditor5Icon,
tooltip: true
} );
// Insert a text into the editor after clicking the button.
this.listenTo( view, 'execute', () => {
model.change( writer => {
const textNode = writer.createText( 'Hello CKEditor 5!' );
model.insertContent( textNode );
} );
editor.editing.view.focus();
} );
return view;
} );
public static get requires() {
return [ FootnoteEditing, FootnoteUI ] as const;
}
}