Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(ckeditor5-math): fix references: LivePosition -> ModelLivePosition
Elian Doranda8eecf7743f
diff --git a/packages/ckeditor5-math/src/automath.ts b/packages/ckeditor5-math/src/automath.tsindex bf16eacae8..128b650b46 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 textthis._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' ) {