Compare commits
1 Commits
v13.0.0-43
...
v13.0.0-41
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16e01ad3d5 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "13.0.0-43",
|
"version": "13.0.0-41",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "13.0.0-43",
|
"version": "13.0.0-41",
|
||||||
"description": "A framework for real-time p2p shared editing on any data",
|
"description": "A framework for real-time p2p shared editing on any data",
|
||||||
"main": "./y.node.js",
|
"main": "./y.node.js",
|
||||||
"browser": "./y.js",
|
"browser": "./y.js",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import commonjs from 'rollup-plugin-commonjs'
|
|||||||
import multiEntry from 'rollup-plugin-multi-entry'
|
import multiEntry from 'rollup-plugin-multi-entry'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
input: 'test/y-xml.tests.js',
|
input: 'test/*.tests.js',
|
||||||
name: 'y-tests',
|
name: 'y-tests',
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
output: {
|
output: {
|
||||||
@@ -11,12 +11,12 @@ export default {
|
|||||||
format: 'umd'
|
format: 'umd'
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
multiEntry(),
|
|
||||||
nodeResolve({
|
nodeResolve({
|
||||||
main: true,
|
main: true,
|
||||||
module: true,
|
module: true,
|
||||||
browser: true
|
browser: true
|
||||||
}),
|
}),
|
||||||
commonjs()
|
commonjs(),
|
||||||
|
multiEntry()
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,12 +207,8 @@ export default class YArray extends Type {
|
|||||||
prevJsonIns._content.push(c)
|
prevJsonIns._content.push(c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (prevJsonIns !== null) {
|
if (prevJsonIns !== null && y !== null) {
|
||||||
if (y !== null) {
|
prevJsonIns._integrate(y)
|
||||||
prevJsonIns._integrate(y)
|
|
||||||
} else if (prevJsonIns._left === null) {
|
|
||||||
this._start = prevJsonIns
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,23 +143,6 @@ export default class YXmlFragment extends YArray {
|
|||||||
}
|
}
|
||||||
setDomFilter (f) {
|
setDomFilter (f) {
|
||||||
this._domFilter = f
|
this._domFilter = f
|
||||||
let attributes = new Map()
|
|
||||||
if (this.getAttributes !== undefined) {
|
|
||||||
let attrs = this.getAttributes()
|
|
||||||
for (let key in attrs) {
|
|
||||||
attributes.set(key, attrs[key])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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 => {
|
this.forEach(xml => {
|
||||||
xml.setDomFilter(f)
|
xml.setDomFilter(f)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -24,11 +24,6 @@ export default class YXmlHook extends YMap {
|
|||||||
}
|
}
|
||||||
return this._dom
|
return this._dom
|
||||||
}
|
}
|
||||||
_unbindFromDom () {
|
|
||||||
this._dom._yxml = null
|
|
||||||
this._yxml = null
|
|
||||||
// TODO: cleanup hook?
|
|
||||||
}
|
|
||||||
_fromBinary (y, decoder) {
|
_fromBinary (y, decoder) {
|
||||||
const missing = super._fromBinary(y, decoder)
|
const missing = super._fromBinary(y, decoder)
|
||||||
this.hookName = decoder.readVarString()
|
this.hookName = decoder.readVarString()
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ export function reflectChangesOnDom (events, _document) {
|
|||||||
// let anchorViewPosition = getAnchorViewPosition(yxml._scrollElement)
|
// let anchorViewPosition = getAnchorViewPosition(yxml._scrollElement)
|
||||||
if (yxml.constructor === YXmlText) {
|
if (yxml.constructor === YXmlText) {
|
||||||
yxml._dom.nodeValue = yxml.toString()
|
yxml._dom.nodeValue = yxml.toString()
|
||||||
} else if (event.attributesChanged !== undefined) {
|
} else {
|
||||||
// update attributes
|
// update attributes
|
||||||
event.attributesChanged.forEach(attributeName => {
|
event.attributesChanged.forEach(attributeName => {
|
||||||
const value = yxml.getAttribute(attributeName)
|
const value = yxml.getAttribute(attributeName)
|
||||||
|
|||||||
34
y.node.js
34
y.node.js
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* yjs - A framework for real-time p2p shared editing on any data
|
* yjs - A framework for real-time p2p shared editing on any data
|
||||||
* @version v13.0.0-43
|
* @version v13.0.0-41
|
||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -2406,12 +2406,8 @@ class YArray extends Type {
|
|||||||
prevJsonIns._content.push(c);
|
prevJsonIns._content.push(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (prevJsonIns !== null) {
|
if (prevJsonIns !== null && y !== null) {
|
||||||
if (y !== null) {
|
prevJsonIns._integrate(y);
|
||||||
prevJsonIns._integrate(y);
|
|
||||||
} else if (prevJsonIns._left === null) {
|
|
||||||
this._start = prevJsonIns;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -2764,7 +2760,7 @@ function reflectChangesOnDom (events, _document) {
|
|||||||
// let anchorViewPosition = getAnchorViewPosition(yxml._scrollElement)
|
// let anchorViewPosition = getAnchorViewPosition(yxml._scrollElement)
|
||||||
if (yxml.constructor === YXmlText) {
|
if (yxml.constructor === YXmlText) {
|
||||||
yxml._dom.nodeValue = yxml.toString();
|
yxml._dom.nodeValue = yxml.toString();
|
||||||
} else if (event.attributesChanged !== undefined) {
|
} else {
|
||||||
// update attributes
|
// update attributes
|
||||||
event.attributesChanged.forEach(attributeName => {
|
event.attributesChanged.forEach(attributeName => {
|
||||||
const value = yxml.getAttribute(attributeName);
|
const value = yxml.getAttribute(attributeName);
|
||||||
@@ -3885,23 +3881,6 @@ class YXmlFragment extends YArray {
|
|||||||
}
|
}
|
||||||
setDomFilter (f) {
|
setDomFilter (f) {
|
||||||
this._domFilter = f;
|
this._domFilter = f;
|
||||||
let attributes = new Map();
|
|
||||||
if (this.getAttributes !== undefined) {
|
|
||||||
let attrs = this.getAttributes();
|
|
||||||
for (let key in attrs) {
|
|
||||||
attributes.set(key, attrs[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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 => {
|
this.forEach(xml => {
|
||||||
xml.setDomFilter(f);
|
xml.setDomFilter(f);
|
||||||
});
|
});
|
||||||
@@ -4258,11 +4237,6 @@ class YXmlHook extends YMap {
|
|||||||
}
|
}
|
||||||
return this._dom
|
return this._dom
|
||||||
}
|
}
|
||||||
_unbindFromDom () {
|
|
||||||
this._dom._yxml = null;
|
|
||||||
this._yxml = null;
|
|
||||||
// TODO: cleanup hook?
|
|
||||||
}
|
|
||||||
_fromBinary (y, decoder) {
|
_fromBinary (y, decoder) {
|
||||||
const missing = super._fromBinary(y, decoder);
|
const missing = super._fromBinary(y, decoder);
|
||||||
this.hookName = decoder.readVarString();
|
this.hookName = decoder.readVarString();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user