y-prosemirror
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -483,17 +483,6 @@ 'use strict'; | ||
const createNodeFromYElement = (el, schema, mapping, snapshot, prevSnapshot, computeYChange) => { | ||
let _snapshot = snapshot; | ||
let _prevSnapshot = prevSnapshot; | ||
if (snapshot !== undefined && prevSnapshot !== undefined) { | ||
if (!isVisible(/** @type {Y.Item} */ (el._item), snapshot)) { | ||
// if this element is already rendered as deleted (ychange), then do not render children as deleted | ||
_snapshot = new Y.Snapshot(prevSnapshot.ds, snapshot.sv); | ||
_prevSnapshot = _snapshot; | ||
} else if (!isVisible(/** @type {Y.Item} */(el._item), prevSnapshot)) { | ||
_prevSnapshot = _snapshot; | ||
} | ||
} | ||
const children = []; | ||
const createChildren = type => { | ||
if (type.constructor === Y.XmlElement) { | ||
const n = createNodeIfNotExists(type, schema, mapping, _snapshot, _prevSnapshot, computeYChange); | ||
const n = createNodeIfNotExists(type, schema, mapping, snapshot, prevSnapshot, computeYChange); | ||
if (n !== null) { | ||
@@ -503,3 +492,3 @@ children.push(n); | ||
} else { | ||
const ns = createTextNodesFromYText(type, schema, mapping, _snapshot, _prevSnapshot, computeYChange); | ||
const ns = createTextNodesFromYText(type, schema, mapping, snapshot, prevSnapshot, computeYChange); | ||
if (ns !== null) { | ||
@@ -520,3 +509,3 @@ ns.forEach(textchild => { | ||
try { | ||
const attrs = el.getAttributes(_snapshot); | ||
const attrs = el.getAttributes(snapshot); | ||
if (snapshot !== undefined) { | ||
@@ -523,0 +512,0 @@ if (!isVisible(/** @type {Y.Item} */ (el._item), snapshot)) { |
{ | ||
"name": "y-prosemirror", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Prosemirror bindings for Yjs", | ||
@@ -63,4 +63,5 @@ "main": "./dist/y-prosemirror.js", | ||
"y-protocols": "^0.1.0", | ||
"yjs": "13.0.0-98" | ||
"yjs": "13.0.0-98", | ||
"lib0": "^0.1.1" | ||
} | ||
} |
@@ -346,17 +346,6 @@ /** | ||
export const createNodeFromYElement = (el, schema, mapping, snapshot, prevSnapshot, computeYChange) => { | ||
let _snapshot = snapshot | ||
let _prevSnapshot = prevSnapshot | ||
if (snapshot !== undefined && prevSnapshot !== undefined) { | ||
if (!isVisible(/** @type {Y.Item} */ (el._item), snapshot)) { | ||
// if this element is already rendered as deleted (ychange), then do not render children as deleted | ||
_snapshot = new Y.Snapshot(prevSnapshot.ds, snapshot.sv) | ||
_prevSnapshot = _snapshot | ||
} else if (!isVisible(/** @type {Y.Item} */(el._item), prevSnapshot)) { | ||
_prevSnapshot = _snapshot | ||
} | ||
} | ||
const children = [] | ||
const createChildren = type => { | ||
if (type.constructor === Y.XmlElement) { | ||
const n = createNodeIfNotExists(type, schema, mapping, _snapshot, _prevSnapshot, computeYChange) | ||
const n = createNodeIfNotExists(type, schema, mapping, snapshot, prevSnapshot, computeYChange) | ||
if (n !== null) { | ||
@@ -366,3 +355,3 @@ children.push(n) | ||
} else { | ||
const ns = createTextNodesFromYText(type, schema, mapping, _snapshot, _prevSnapshot, computeYChange) | ||
const ns = createTextNodesFromYText(type, schema, mapping, snapshot, prevSnapshot, computeYChange) | ||
if (ns !== null) { | ||
@@ -383,3 +372,3 @@ ns.forEach(textchild => { | ||
try { | ||
const attrs = el.getAttributes(_snapshot) | ||
const attrs = el.getAttributes(snapshot) | ||
if (snapshot !== undefined) { | ||
@@ -386,0 +375,0 @@ if (!isVisible(/** @type {Y.Item} */ (el._item), snapshot)) { |
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
2414656
21846
14