Compare commits
3 Commits
v13.0.0-42
...
v13.0.0-43
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e0518e1ec | ||
|
|
08f37a86e3 | ||
|
|
f5d17e6236 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yjs",
|
||||
"version": "13.0.0-42",
|
||||
"version": "13.0.0-43",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yjs",
|
||||
"version": "13.0.0-42",
|
||||
"version": "13.0.0-43",
|
||||
"description": "A framework for real-time p2p shared editing on any data",
|
||||
"main": "./y.node.js",
|
||||
"browser": "./y.js",
|
||||
|
||||
@@ -3,7 +3,7 @@ import commonjs from 'rollup-plugin-commonjs'
|
||||
import multiEntry from 'rollup-plugin-multi-entry'
|
||||
|
||||
export default {
|
||||
input: 'test/*.tests.js',
|
||||
input: 'test/y-xml.tests.js',
|
||||
name: 'y-tests',
|
||||
sourcemap: true,
|
||||
output: {
|
||||
@@ -11,12 +11,12 @@ export default {
|
||||
format: 'umd'
|
||||
},
|
||||
plugins: [
|
||||
multiEntry(),
|
||||
nodeResolve({
|
||||
main: true,
|
||||
module: true,
|
||||
browser: true
|
||||
}),
|
||||
commonjs(),
|
||||
multiEntry()
|
||||
commonjs()
|
||||
]
|
||||
}
|
||||
|
||||
@@ -143,6 +143,23 @@ export default class YXmlFragment extends YArray {
|
||||
}
|
||||
setDomFilter (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 => {
|
||||
xml.setDomFilter(f)
|
||||
})
|
||||
|
||||
1
y.node.js.map
Normal file
1
y.node.js.map
Normal file
File diff suppressed because one or more lines are too long
1
y.test.js.map
Normal file
1
y.test.js.map
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user