y-prosemirror
Advanced tools
Comparing version 0.3.2 to 0.3.3
{ | ||
"name": "y-prosemirror", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Prosemirror bindings for Yjs", | ||
@@ -42,3 +42,3 @@ "main": "./dist/y-prosemirror.cjs", | ||
"dependencies": { | ||
"lib0": "^0.2.13" | ||
"lib0": "^0.2.15" | ||
}, | ||
@@ -45,0 +45,0 @@ "peerDependencies": { |
@@ -36,3 +36,3 @@ | ||
if (aw.cursor != null) { | ||
let user = aw.user || {} | ||
const user = aw.user || {} | ||
if (user.color == null) { | ||
@@ -47,3 +47,3 @@ user.color = '#ffa500' | ||
if (anchor !== null && head !== null) { | ||
let maxsize = math.max(state.doc.content.size - 1, 0) | ||
const maxsize = math.max(state.doc.content.size - 1, 0) | ||
anchor = math.min(anchor, maxsize) | ||
@@ -50,0 +50,0 @@ head = math.min(head, maxsize) |
@@ -108,3 +108,3 @@ /** | ||
pluginState = Object.assign({}, pluginState) | ||
for (let key in change) { | ||
for (const key in change) { | ||
pluginState[key] = change[key] | ||
@@ -146,3 +146,4 @@ } | ||
if (pluginState.snapshot == null && pluginState.prevSnapshot == null) { | ||
if (changedInitialContent || view.state.doc.content.size > 2) { | ||
const emptySize = view.state.doc.type.createAndFill().content.size | ||
if (changedInitialContent || view.state.doc.content.size > emptySize) { | ||
changedInitialContent = true | ||
@@ -220,2 +221,3 @@ binding._prosemirrorChanged(view.state.doc) | ||
} | ||
renderSnapshot (snapshot, prevSnapshot) { | ||
@@ -227,2 +229,3 @@ if (!prevSnapshot) { | ||
} | ||
unrenderSnapshot () { | ||
@@ -238,2 +241,3 @@ this.mapping = new Map() | ||
} | ||
_forceRerender () { | ||
@@ -248,2 +252,3 @@ this.mapping = new Map() | ||
} | ||
/** | ||
@@ -294,2 +299,3 @@ * @param {Y.Snapshot} snapshot | ||
} | ||
/** | ||
@@ -326,2 +332,3 @@ * @param {Array<Y.YEvent>} events | ||
} | ||
_prosemirrorChanged (doc) { | ||
@@ -335,2 +342,3 @@ this.mux(() => { | ||
} | ||
destroy () { | ||
@@ -436,3 +444,3 @@ this.type.unobserveDeep(this._observeFunction) | ||
const marks = [] | ||
for (let markName in delta.attributes) { | ||
for (const markName in delta.attributes) { | ||
marks.push(schema.mark(markName, delta.attributes[markName])) | ||
@@ -479,3 +487,3 @@ } | ||
const type = new Y.XmlElement(node.type.name) | ||
for (let key in node.attrs) { | ||
for (const key in node.attrs) { | ||
const val = node.attrs[key] | ||
@@ -670,3 +678,3 @@ if (val !== null && key !== 'ychange') { | ||
const pAttrs = pNode.attrs | ||
for (let key in pAttrs) { | ||
for (const key in pAttrs) { | ||
if (pAttrs[key] !== null) { | ||
@@ -681,3 +689,3 @@ if (yDomAttrs[key] !== pAttrs[key] && key !== 'ychange') { | ||
// remove all keys that are no longer in pAttrs | ||
for (let key in yDomAttrs) { | ||
for (const key in yDomAttrs) { | ||
if (pAttrs[key] === undefined) { | ||
@@ -684,0 +692,0 @@ yDomFragment.removeAttribute(key) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3157196
29448
Updatedlib0@^0.2.15