mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 18:05:55 +01:00 
			
		
		
		
	refactor(admonitions): rename classes
This commit is contained in:
		| @@ -9,8 +9,8 @@ | |||||||
|  |  | ||||||
| import { Plugin } from 'ckeditor5/src/core.js'; | import { Plugin } from 'ckeditor5/src/core.js'; | ||||||
|  |  | ||||||
| import BlockQuoteEditing from './blockquoteediting.js'; | import AdmonitionEditing from './blockquoteediting.js'; | ||||||
| import BlockQuoteUI from './blockquoteui.js'; | import AdmonitionUI from './blockquoteui.js'; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * The block quote plugin. |  * The block quote plugin. | ||||||
| @@ -22,12 +22,12 @@ import BlockQuoteUI from './blockquoteui.js'; | |||||||
|  * |  * | ||||||
|  * @extends module:core/plugin~Plugin |  * @extends module:core/plugin~Plugin | ||||||
|  */ |  */ | ||||||
| export default class BlockQuote extends Plugin { | export default class Admonition extends Plugin { | ||||||
| 	/** | 	/** | ||||||
| 	 * @inheritDoc | 	 * @inheritDoc | ||||||
| 	 */ | 	 */ | ||||||
| 	public static get requires() { | 	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 |  * @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. | 	 * 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 { Enter, type ViewDocumentEnterEvent } from 'ckeditor5/src/enter.js'; | ||||||
| import { Delete, type ViewDocumentDeleteEvent } from 'ckeditor5/src/typing.js'; | import { Delete, type ViewDocumentDeleteEvent } from 'ckeditor5/src/typing.js'; | ||||||
|  |  | ||||||
| import BlockQuoteCommand from './blockquotecommand.js'; | import AdmonitionCommand from './blockquotecommand.js'; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * The block quote editing. |  * The block quote editing. | ||||||
| @@ -20,7 +20,7 @@ import BlockQuoteCommand from './blockquotecommand.js'; | |||||||
|  * |  * | ||||||
|  * @extends module:core/plugin~Plugin |  * @extends module:core/plugin~Plugin | ||||||
|  */ |  */ | ||||||
| export default class BlockQuoteEditing extends Plugin { | export default class AdmonitionEditing extends Plugin { | ||||||
| 	/** | 	/** | ||||||
| 	 * @inheritDoc | 	 * @inheritDoc | ||||||
| 	 */ | 	 */ | ||||||
| @@ -42,7 +42,7 @@ export default class BlockQuoteEditing extends Plugin { | |||||||
| 		const editor = this.editor; | 		const editor = this.editor; | ||||||
| 		const schema = editor.model.schema; | 		const schema = editor.model.schema; | ||||||
|  |  | ||||||
| 		editor.commands.add( 'blockQuote', new BlockQuoteCommand( editor ) ); | 		editor.commands.add( 'blockQuote', new AdmonitionCommand( editor ) ); | ||||||
|  |  | ||||||
| 		schema.register( 'blockQuote', { | 		schema.register( 'blockQuote', { | ||||||
| 			inheritAllFrom: '$container' | 			inheritAllFrom: '$container' | ||||||
| @@ -105,7 +105,7 @@ export default class BlockQuoteEditing extends Plugin { | |||||||
|  |  | ||||||
| 		const viewDocument = this.editor.editing.view.document; | 		const viewDocument = this.editor.editing.view.document; | ||||||
| 		const selection = editor.model.document.selection; | 		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. | 		// Overwrite default Enter key behavior. | ||||||
| 		// If Enter key is pressed with selection collapsed in empty block inside a quote, break the quote. | 		// 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 |  * @extends module:core/plugin~Plugin | ||||||
|  */ |  */ | ||||||
| export default class BlockQuoteUI extends Plugin { | export default class AdmonitionUI extends Plugin { | ||||||
| 	/** | 	/** | ||||||
| 	 * @inheritDoc | 	 * @inheritDoc | ||||||
| 	 */ | 	 */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user