|
@@ -16,9 +16,6 @@ import HeadingButtonsUI from '@ckeditor/ckeditor5-heading/src/headingbuttonsui';
|
|
|
import ParagraphButtonUI from '@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui';
|
|
import ParagraphButtonUI from '@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui';
|
|
|
import BlockToolbar from '../../../src/toolbar/block/blocktoolbar';
|
|
import BlockToolbar from '../../../src/toolbar/block/blocktoolbar';
|
|
|
|
|
|
|
|
-import Position from '@ckeditor/ckeditor5-engine/src/model/position';
|
|
|
|
|
-import Range from '@ckeditor/ckeditor5-engine/src/model/range';
|
|
|
|
|
-
|
|
|
|
|
BalloonEditor
|
|
BalloonEditor
|
|
|
.create( document.querySelector( '#editor' ), {
|
|
.create( document.querySelector( '#editor' ), {
|
|
|
plugins: [ Essentials, List, Paragraph, Heading, Image, ImageCaption, HeadingButtonsUI, ParagraphButtonUI, BlockToolbar ],
|
|
plugins: [ Essentials, List, Paragraph, Heading, Image, ImageCaption, HeadingButtonsUI, ParagraphButtonUI, BlockToolbar ],
|
|
@@ -59,7 +56,7 @@ function createExternalChangesSimulator( editor ) {
|
|
|
|
|
|
|
|
function insertNewLine( path ) {
|
|
function insertNewLine( path ) {
|
|
|
model.enqueueChange( 'transparent', writer => {
|
|
model.enqueueChange( 'transparent', writer => {
|
|
|
- writer.insertElement( 'paragraph', new Position( model.document.getRoot(), path ) );
|
|
|
|
|
|
|
+ writer.insertElement( 'paragraph', writer.createPositionFromPath( model.document.getRoot(), path ) );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
return Promise.resolve();
|
|
return Promise.resolve();
|
|
@@ -67,7 +64,7 @@ function createExternalChangesSimulator( editor ) {
|
|
|
|
|
|
|
|
function type( path, text ) {
|
|
function type( path, text ) {
|
|
|
return new Promise( resolve => {
|
|
return new Promise( resolve => {
|
|
|
- let position = new Position( model.document.getRoot(), path );
|
|
|
|
|
|
|
+ let position = model.createPositionFromPath( model.document.getRoot(), path );
|
|
|
let index = 0;
|
|
let index = 0;
|
|
|
|
|
|
|
|
function typing() {
|
|
function typing() {
|
|
@@ -94,7 +91,9 @@ function createExternalChangesSimulator( editor ) {
|
|
|
|
|
|
|
|
function removeElement( path ) {
|
|
function removeElement( path ) {
|
|
|
model.enqueueChange( 'transparent', writer => {
|
|
model.enqueueChange( 'transparent', writer => {
|
|
|
- writer.remove( Range.createFromPositionAndShift( new Position( model.document.getRoot(), path ), 1 ) );
|
|
|
|
|
|
|
+ const start = writer.createPositionFromPath( model.document.getRoot(), path );
|
|
|
|
|
+
|
|
|
|
|
+ writer.remove( writer.createRange( start, start.getShiftedBy( 1 ) ) );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
return Promise.resolve();
|
|
return Promise.resolve();
|