Compare commits

..

1 Commits

Author SHA1 Message Date
Kevin Jahns
2e486d4f46 v13.0.0-48 -- distribution files 2018-01-29 16:42:20 -08:00
14 changed files with 69 additions and 89 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "yjs",
"version": "13.0.0-49",
"version": "13.0.0-48",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "yjs",
"version": "13.0.0-49",
"version": "13.0.0-48",
"description": "A framework for real-time p2p shared editing on any data",
"main": "./y.node.js",
"browser": "./y.js",

View File

@@ -55,16 +55,14 @@ export default class Item {
/**
* Copy the effect of struct
*/
_copy (undeleteChildren, copyPosition) {
_copy () {
let struct = new this.constructor()
if (copyPosition) {
struct._origin = this._left
struct._left = this._left
struct._right = this
struct._right_origin = this
struct._parent = this._parent
struct._parentSub = this._parentSub
}
struct._origin = this._left
struct._left = this._left
struct._right = this
struct._right_origin = this
struct._parent = this._parent
struct._parentSub = this._parentSub
return struct
}
get _lastId () {

View File

@@ -6,8 +6,8 @@ export default class ItemJSON extends Item {
super()
this._content = null
}
_copy (undeleteChildren, copyPosition) {
let struct = super._copy(undeleteChildren, copyPosition)
_copy () {
let struct = super._copy()
struct._content = this._content
return struct
}

View File

@@ -6,8 +6,8 @@ export default class ItemString extends Item {
super()
this._content = null
}
_copy (undeleteChildren, copyPosition) {
let struct = super._copy(undeleteChildren, copyPosition)
_copy () {
let struct = super._copy()
struct._content = this._content
return struct
}

View File

@@ -79,16 +79,15 @@ export default class Type extends Item {
type = type._parent
}
}
_copy (undeleteChildren, copyPosition) {
let copy = super._copy(undeleteChildren, copyPosition)
_copy (undeleteChildren) {
let copy = super._copy()
let map = new Map()
copy._map = map
for (let [key, value] of this._map) {
if (undeleteChildren.has(value) || !value.deleted) {
let _item = value._copy(undeleteChildren, false)
let _item = value._copy(undeleteChildren)
_item._parent = copy
_item._parentSub = key
map.set(key, _item)
map.set(key, value._copy(undeleteChildren))
}
}
let prevUndeleted = null
@@ -96,7 +95,7 @@ export default class Type extends Item {
let item = this._start
while (item !== null) {
if (undeleteChildren.has(item) || !item.deleted) {
let _item = item._copy(undeleteChildren, false)
let _item = item._copy(undeleteChildren)
_item._left = prevUndeleted
_item._origin = prevUndeleted
_item._right = null

View File

@@ -20,8 +20,8 @@ export default class YXmlElement extends YXmlFragment {
this._domFilter = arg2
}
}
_copy (undeleteChildren, copyPosition) {
let struct = super._copy(undeleteChildren, copyPosition)
_copy (undeleteChildren) {
let struct = super._copy(undeleteChildren)
struct.nodeName = this.nodeName
return struct
}

View File

@@ -152,20 +152,18 @@ export default class YXmlFragment extends YArray {
attributes.set(key, attrs[key])
}
}
this._y.transact(() => {
let result = this._domFilter(this.nodeName, new Map(attributes))
if (result === null) {
this._delete(this._y)
} else {
attributes.forEach((value, key) => {
if (!result.has(key)) {
this.removeAttribute(key)
}
})
}
this.forEach(xml => {
xml.setDomFilter(f)
let result = this._domFilter(this.nodeName, new Map(attributes))
if (result === null) {
this._delete(this._y)
} else {
attributes.forEach((value, key) => {
if (!result.has(key)) {
this.removeAttribute(key)
}
})
}
this.forEach(xml => {
xml.setDomFilter(f)
})
}
_callObserver (transaction, parentSubs, remote) {

View File

@@ -14,11 +14,6 @@ export default class YXmlHook extends YMap {
getHook(hookName).fillType(dom, this)
}
}
_copy (undeleteChildren, copyPosition) {
const struct = super._copy(undeleteChildren, copyPosition)
struct.hookName = this.hookName
return struct
}
getDom (_document) {
_document = _document || document
if (this._dom === null) {

View File

@@ -50,7 +50,7 @@ function applyReverseOperation (y, scope, reverseBuffer) {
)
) {
performedUndo = true
op = op._copy(undoOp.deletedStructs, true)
op = op._copy(undoOp.deletedStructs)
op._integrate(y)
}
}

8
y.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
/**
* yjs - A framework for real-time p2p shared editing on any data
* @version v13.0.0-49
* @version v13.0.0-48
* @license MIT
*/
@@ -1344,16 +1344,14 @@ class Item {
/**
* Copy the effect of struct
*/
_copy (undeleteChildren, copyPosition) {
_copy () {
let struct = new this.constructor();
if (copyPosition) {
struct._origin = this._left;
struct._left = this._left;
struct._right = this;
struct._right_origin = this;
struct._parent = this._parent;
struct._parentSub = this._parentSub;
}
struct._origin = this._left;
struct._left = this._left;
struct._right = this;
struct._right_origin = this;
struct._parent = this._parent;
struct._parentSub = this._parentSub;
return struct
}
get _lastId () {
@@ -1720,16 +1718,15 @@ class Type extends Item {
type = type._parent;
}
}
_copy (undeleteChildren, copyPosition) {
let copy = super._copy(undeleteChildren, copyPosition);
_copy (undeleteChildren) {
let copy = super._copy();
let map = new Map();
copy._map = map;
for (let [key, value] of this._map) {
if (undeleteChildren.has(value) || !value.deleted) {
let _item = value._copy(undeleteChildren, false);
let _item = value._copy(undeleteChildren);
_item._parent = copy;
_item._parentSub = key;
map.set(key, _item);
map.set(key, value._copy(undeleteChildren));
}
}
let prevUndeleted = null;
@@ -1737,7 +1734,7 @@ class Type extends Item {
let item = this._start;
while (item !== null) {
if (undeleteChildren.has(item) || !item.deleted) {
let _item = item._copy(undeleteChildren, false);
let _item = item._copy(undeleteChildren);
_item._left = prevUndeleted;
_item._origin = prevUndeleted;
_item._right = null;
@@ -1817,8 +1814,8 @@ class ItemJSON extends Item {
super();
this._content = null;
}
_copy (undeleteChildren, copyPosition) {
let struct = super._copy(undeleteChildren, copyPosition);
_copy () {
let struct = super._copy();
struct._content = this._content;
return struct
}
@@ -1879,8 +1876,8 @@ class ItemString extends Item {
super();
this._content = null;
}
_copy (undeleteChildren, copyPosition) {
let struct = super._copy(undeleteChildren, copyPosition);
_copy () {
let struct = super._copy();
struct._content = this._content;
return struct
}
@@ -2915,20 +2912,18 @@ class YXmlFragment extends YArray {
attributes.set(key, attrs[key]);
}
}
this._y.transact(() => {
let result = this._domFilter(this.nodeName, new Map(attributes));
if (result === null) {
this._delete(this._y);
} else {
attributes.forEach((value, key) => {
if (!result.has(key)) {
this.removeAttribute(key);
}
});
}
this.forEach(xml => {
xml.setDomFilter(f);
let result = this._domFilter(this.nodeName, new Map(attributes));
if (result === null) {
this._delete(this._y);
} else {
attributes.forEach((value, key) => {
if (!result.has(key)) {
this.removeAttribute(key);
}
});
}
this.forEach(xml => {
xml.setDomFilter(f);
});
}
_callObserver (transaction, parentSubs, remote) {
@@ -3133,8 +3128,8 @@ class YXmlElement extends YXmlFragment {
this._domFilter = arg2;
}
}
_copy (undeleteChildren, copyPosition) {
let struct = super._copy(undeleteChildren, copyPosition);
_copy (undeleteChildren) {
let struct = super._copy(undeleteChildren);
struct.nodeName = this.nodeName;
return struct
}
@@ -3272,11 +3267,6 @@ class YXmlHook extends YMap {
getHook(hookName).fillType(dom, this);
}
}
_copy (undeleteChildren, copyPosition) {
const struct = super._copy(undeleteChildren, copyPosition);
struct.hookName = this.hookName;
return struct
}
getDom (_document) {
_document = _document || document;
if (this._dom === null) {
@@ -3717,7 +3707,7 @@ function applyReverseOperation (y, scope, reverseBuffer) {
)
) {
performedUndo = true;
op = op._copy(undoOp.deletedStructs, true);
op = op._copy(undoOp.deletedStructs);
op._integrate(y);
}
}

File diff suppressed because one or more lines are too long