improved granularity of prosemirror binding

This commit is contained in:
Kevin Jahns
2018-12-03 17:09:00 +01:00
parent c9ea3a412e
commit 582095e5a3
18 changed files with 519 additions and 126 deletions

View File

@@ -19,6 +19,10 @@ export class GC {
this._length = 0
}
get _redone () {
return null
}
get _deleted () {
return true
}

View File

@@ -113,6 +113,30 @@ export class Item {
this._redone = null
}
/**
* Returns the next non-deleted item
* @private
*/
get _next () {
let n = this._right
while (n !== null && n._deleted) {
n = n._right
}
return n
}
/**
* Returns the previous non-deleted item
* @private
*/
get _prev () {
let n = this._left
while (n !== null && n._deleted) {
n = n._left
}
return n
}
/**
* Creates an Item with the same effect as this Item (without position effect)
*
@@ -127,7 +151,7 @@ export class Item {
* Redoes the effect of this operation.
*
* @param {Y} y The Yjs instance.
* @param {Array<Item>} redoitems
* @param {Set<Item>} redoitems
*
* @private
*/

View File

@@ -57,6 +57,17 @@ export class Type extends Item {
this._deepEventHandler = new EventHandler()
}
/**
* The first non-deleted item
*/
get _first () {
let n = this._start
while (n !== null && n._deleted) {
n = n._right
}
return n
}
/**
* Compute the path from this type to the specified target.
*