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

@@ -95,10 +95,12 @@ export class YArray extends Type {
while (n !== null) {
if (!n._deleted && n._countable) {
if (index < n._length) {
if (n.constructor === ItemJSON || n.constructor === ItemString) {
return n._content[index]
} else {
return n
switch (n.constructor) {
case ItemJSON:
case ItemString:
return n._content[index]
default:
return n
}
}
index -= n._length

View File

@@ -485,6 +485,10 @@ export class YText extends YArray {
this._callEventHandler(transaction, new YTextEvent(this, remote, transaction))
}
toDom () {
return document.createTextNode(this.toString())
}
/**
* Returns the unformatted string representation of this YText type.
*