mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-01 12:42:28 +08:00
refactor(admonitions): rename classes
This commit is contained in:
parent
e24812f1a3
commit
0f9ab0dd89
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user