refactor(admonitions): rename classes

This commit is contained in:
Elian Doran 2025-03-13 18:33:39 +02:00
parent e24812f1a3
commit 0f9ab0dd89
4 changed files with 10 additions and 10 deletions

View File

@ -9,8 +9,8 @@
import { Plugin } from 'ckeditor5/src/core.js';
import BlockQuoteEditing from './blockquoteediting.js';
import BlockQuoteUI from './blockquoteui.js';
import AdmonitionEditing from './blockquoteediting.js';
import AdmonitionUI from './blockquoteui.js';
/**
* The block quote plugin.
@ -22,12 +22,12 @@ import BlockQuoteUI from './blockquoteui.js';
*
* @extends module:core/plugin~Plugin
*/
export default class BlockQuote extends Plugin {
export default class Admonition extends Plugin {
/**
* @inheritDoc
*/
public static get requires() {
return [ BlockQuoteEditing, BlockQuoteUI ] as const;
return [ AdmonitionEditing, AdmonitionUI ] as const;
}
/**

View File

@ -16,7 +16,7 @@ import type { DocumentFragment, Element, Position, Range, Schema, Writer } from
*
* @extends module:core/command~Command
*/
export default class BlockQuoteCommand extends Command {
export default class AdmonitionCommand extends Command {
/**
* Whether the selection starts in a block quote.
*

View File

@ -11,7 +11,7 @@ import { Plugin } from 'ckeditor5/src/core.js';
import { Enter, type ViewDocumentEnterEvent } from 'ckeditor5/src/enter.js';
import { Delete, type ViewDocumentDeleteEvent } from 'ckeditor5/src/typing.js';
import BlockQuoteCommand from './blockquotecommand.js';
import AdmonitionCommand from './blockquotecommand.js';
/**
* The block quote editing.
@ -20,7 +20,7 @@ import BlockQuoteCommand from './blockquotecommand.js';
*
* @extends module:core/plugin~Plugin
*/
export default class BlockQuoteEditing extends Plugin {
export default class AdmonitionEditing extends Plugin {
/**
* @inheritDoc
*/
@ -42,7 +42,7 @@ export default class BlockQuoteEditing extends Plugin {
const editor = this.editor;
const schema = editor.model.schema;
editor.commands.add( 'blockQuote', new BlockQuoteCommand( editor ) );
editor.commands.add( 'blockQuote', new AdmonitionCommand( editor ) );
schema.register( 'blockQuote', {
inheritAllFrom: '$container'
@ -105,7 +105,7 @@ export default class BlockQuoteEditing extends Plugin {
const viewDocument = this.editor.editing.view.document;
const selection = editor.model.document.selection;
const blockQuoteCommand: BlockQuoteCommand = editor.commands.get( 'blockQuote' )!;
const blockQuoteCommand: AdmonitionCommand = editor.commands.get( 'blockQuote' )!;
// Overwrite default Enter key behavior.
// If Enter key is pressed with selection collapsed in empty block inside a quote, break the quote.

View File

@ -19,7 +19,7 @@ import '../theme/blockquote.css';
*
* @extends module:core/plugin~Plugin
*/
export default class BlockQuoteUI extends Plugin {
export default class AdmonitionUI extends Plugin {
/**
* @inheritDoc
*/