@ckeditor/ckeditor5-engine
Advanced tools
Comparing version 0.0.0-nightly-20241219.2 to 0.0.0-nightly-20241220.0
{ | ||
"name": "@ckeditor/ckeditor5-engine", | ||
"version": "0.0.0-nightly-20241219.2", | ||
"version": "0.0.0-nightly-20241220.0", | ||
"description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-20241219.2", | ||
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-20241220.0", | ||
"lodash-es": "4.17.21" | ||
@@ -30,0 +30,0 @@ }, |
@@ -587,3 +587,4 @@ /** | ||
} | ||
for (const value of range.getWalker()) { | ||
const treewalker = range.getWalker(); | ||
for (const value of treewalker) { | ||
const block = value.item; | ||
@@ -593,2 +594,8 @@ if (value.type == 'elementEnd' && isUnvisitedTopBlock(block, visited, range)) { | ||
} | ||
// If element is block, we can skip its children and jump to the end of it. | ||
else if (value.type == 'elementStart' && | ||
block.is('model:element') && | ||
block.root.document.model.schema.isBlock(block)) { | ||
treewalker.jumpTo(Position._createAt(block, 'end')); | ||
} | ||
} | ||
@@ -595,0 +602,0 @@ const endBlock = getParentBlock(range.end, visited); |
@@ -96,2 +96,18 @@ /** | ||
/** | ||
* Moves tree walker {@link #position} to provided `position`. Tree walker will | ||
* continue traversing from that position. | ||
* | ||
* Note: in contrary to {@link ~TreeWalker#skip}, this method does not iterate over the nodes along the way. | ||
* It simply sets the current tree walker position to a new one. | ||
* From the performance standpoint, it is better to use {@link ~TreeWalker#jumpTo} rather than {@link ~TreeWalker#skip}. | ||
* | ||
* If the provided position is before the start boundary, the position will be | ||
* set to the start boundary. If the provided position is after the end boundary, | ||
* the position will be set to the end boundary. | ||
* This is done to prevent the treewalker from traversing outside the boundaries. | ||
* | ||
* @param position Position to jump to. | ||
*/ | ||
jumpTo(position: Position): void; | ||
/** | ||
* Gets the next tree walker's value. | ||
@@ -98,0 +114,0 @@ */ |
@@ -96,2 +96,27 @@ /** | ||
/** | ||
* Moves tree walker {@link #position} to provided `position`. Tree walker will | ||
* continue traversing from that position. | ||
* | ||
* Note: in contrary to {@link ~TreeWalker#skip}, this method does not iterate over the nodes along the way. | ||
* It simply sets the current tree walker position to a new one. | ||
* From the performance standpoint, it is better to use {@link ~TreeWalker#jumpTo} rather than {@link ~TreeWalker#skip}. | ||
* | ||
* If the provided position is before the start boundary, the position will be | ||
* set to the start boundary. If the provided position is after the end boundary, | ||
* the position will be set to the end boundary. | ||
* This is done to prevent the treewalker from traversing outside the boundaries. | ||
* | ||
* @param position Position to jump to. | ||
*/ | ||
jumpTo(position) { | ||
if (this._boundaryStartParent && position.isBefore(this.boundaries.start)) { | ||
position = this.boundaries.start; | ||
} | ||
else if (this._boundaryEndParent && position.isAfter(this.boundaries.end)) { | ||
position = this.boundaries.end; | ||
} | ||
this._position = position.clone(); | ||
this._visitedParent = position.parent; | ||
} | ||
/** | ||
* Gets the next tree walker's value. | ||
@@ -98,0 +123,0 @@ */ |
@@ -85,2 +85,18 @@ /** | ||
/** | ||
* Moves tree walker {@link #position} to provided `position`. Tree walker will | ||
* continue traversing from that position. | ||
* | ||
* Note: in contrary to {@link ~TreeWalker#skip}, this method does not iterate over the nodes along the way. | ||
* It simply sets the current tree walker position to a new one. | ||
* From the performance standpoint, it is better to use {@link ~TreeWalker#jumpTo} rather than {@link ~TreeWalker#skip}. | ||
* | ||
* If the provided position is before the start boundary, the position will be | ||
* set to the start boundary. If the provided position is after the end boundary, | ||
* the position will be set to the end boundary. | ||
* This is done to prevent the treewalker from traversing outside the boundaries. | ||
* | ||
* @param position Position to jump to. | ||
*/ | ||
jumpTo(position: Position): void; | ||
/** | ||
* Gets the next tree walker's value. | ||
@@ -87,0 +103,0 @@ * |
@@ -87,2 +87,26 @@ /** | ||
/** | ||
* Moves tree walker {@link #position} to provided `position`. Tree walker will | ||
* continue traversing from that position. | ||
* | ||
* Note: in contrary to {@link ~TreeWalker#skip}, this method does not iterate over the nodes along the way. | ||
* It simply sets the current tree walker position to a new one. | ||
* From the performance standpoint, it is better to use {@link ~TreeWalker#jumpTo} rather than {@link ~TreeWalker#skip}. | ||
* | ||
* If the provided position is before the start boundary, the position will be | ||
* set to the start boundary. If the provided position is after the end boundary, | ||
* the position will be set to the end boundary. | ||
* This is done to prevent the treewalker from traversing outside the boundaries. | ||
* | ||
* @param position Position to jump to. | ||
*/ | ||
jumpTo(position) { | ||
if (this._boundaryStartParent && position.isBefore(this.boundaries.start)) { | ||
position = this.boundaries.start; | ||
} | ||
else if (this._boundaryEndParent && position.isAfter(this.boundaries.end)) { | ||
position = this.boundaries.end; | ||
} | ||
this._position = position.clone(); | ||
} | ||
/** | ||
* Gets the next tree walker's value. | ||
@@ -89,0 +113,0 @@ * |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12281658
102365
+ Added@ckeditor/ckeditor5-core@0.0.0-nightly-20241220.0(transitive)
+ Added@ckeditor/ckeditor5-ui@0.0.0-nightly-20241220.0(transitive)
+ Added@ckeditor/ckeditor5-utils@0.0.0-nightly-20241220.0(transitive)
+ Added@ckeditor/ckeditor5-watchdog@0.0.0-nightly-20241220.0(transitive)
- Removed@ckeditor/ckeditor5-core@0.0.0-nightly-20241219.2(transitive)
- Removed@ckeditor/ckeditor5-ui@0.0.0-nightly-20241219.2(transitive)
- Removed@ckeditor/ckeditor5-utils@0.0.0-nightly-20241219.2(transitive)
- Removed@ckeditor/ckeditor5-watchdog@0.0.0-nightly-20241219.2(transitive)