From da8eecf7743f55c4d45c442cdf37f7a1ca3ebe0a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 12 Jul 2025 19:27:22 +0300 Subject: [PATCH] chore(ckeditor5-math): fix references: LivePosition -> ModelLivePosition --- packages/ckeditor5-math/src/automath.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/ckeditor5-math/src/automath.ts b/packages/ckeditor5-math/src/automath.ts index bf16eacae..128b650b4 100644 --- a/packages/ckeditor5-math/src/automath.ts +++ b/packages/ckeditor5-math/src/automath.ts @@ -1,4 +1,4 @@ -import { Clipboard, Plugin, type Editor, LivePosition, LiveRange, Undo } from 'ckeditor5'; +import { Clipboard, Plugin, type Editor, ModelLivePosition, LiveRange, Undo } from 'ckeditor5'; import { extractDelimiters, hasDelimiters, delimitersCounts } from './utils.js'; export default class AutoMath extends Plugin { @@ -11,7 +11,7 @@ export default class AutoMath extends Plugin { } private _timeoutId: null | number; - private _positionToInsert: null | LivePosition; + private _positionToInsert: null | ModelLivePosition; constructor( editor: Editor ) { super( editor ); @@ -31,10 +31,10 @@ export default class AutoMath extends Plugin { return; } - const leftLivePosition = LivePosition.fromPosition( firstRange.start ); + const leftLivePosition = ModelLivePosition.fromPosition( firstRange.start ); leftLivePosition.stickiness = 'toPrevious'; - const rightLivePosition = LivePosition.fromPosition( firstRange.end ); + const rightLivePosition = ModelLivePosition.fromPosition( firstRange.end ); rightLivePosition.stickiness = 'toNext'; modelDocument.once( 'change:data', () => { @@ -63,8 +63,8 @@ export default class AutoMath extends Plugin { } private _mathBetweenPositions( - leftPosition: LivePosition, - rightPosition: LivePosition + leftPosition: ModelLivePosition, + rightPosition: ModelLivePosition ) { const editor = this.editor; @@ -97,7 +97,7 @@ export default class AutoMath extends Plugin { return; } - this._positionToInsert = LivePosition.fromPosition( leftPosition ); + this._positionToInsert = ModelLivePosition.fromPosition( leftPosition ); // With timeout user can undo conversation if want use plain text this._timeoutId = window.setTimeout( () => { @@ -106,7 +106,7 @@ export default class AutoMath extends Plugin { writer.remove( equationRange ); - let insertPosition: LivePosition | null; + let insertPosition: ModelLivePosition | null; // Check if position where the math element should be inserted is still valid. if ( this._positionToInsert?.root.rootName !== '$graveyard' ) {