y-prosemirror
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -839,3 +839,5 @@ 'use strict'; | ||
undoManager, | ||
prevSel: null | ||
prevSel: null, | ||
hasUndoOps: undoManager.undoStack.length > 0, | ||
hasRedoOps: undoManager.redoStack.length > 0 | ||
} | ||
@@ -845,9 +847,21 @@ }, | ||
const binding = ySyncPluginKey.getState(state).binding; | ||
const undoManager = val.undoManager; | ||
const hasUndoOps = undoManager.undoStack.length > 0; | ||
const hasRedoOps = undoManager.redoStack.length > 0; | ||
if (binding) { | ||
return { | ||
undoManager: val.undoManager, | ||
prevSel: getRelativeSelection(binding, oldState) | ||
undoManager, | ||
prevSel: getRelativeSelection(binding, oldState), | ||
hasUndoOps, | ||
hasRedoOps | ||
} | ||
} else { | ||
return val | ||
if (hasUndoOps !== val.hasUndoOps || hasRedoOps !== val.hasRedoOps) { | ||
return Object.assign({}, val, { | ||
hasUndoOps: undoManager.undoStack.length > 0, | ||
hasRedoOps: undoManager.redoStack.length > 0 | ||
}) | ||
} else { // nothing changed | ||
return val | ||
} | ||
} | ||
@@ -854,0 +868,0 @@ } |
{ | ||
"name": "y-prosemirror", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Prosemirror bindings for Yjs", | ||
@@ -45,3 +45,3 @@ "main": "./dist/y-prosemirror.js", | ||
"yjs": ">=13.0.0-93", | ||
"y-protocols": ">=0.0.6", | ||
"y-protocols": ">=0.0.7", | ||
"prosemirror-model": "^1.7.0", | ||
@@ -63,5 +63,5 @@ "prosemirror-state": "^1.2.2", | ||
"standard": "^12.0.1", | ||
"y-protocols": "0.0.6", | ||
"y-protocols": "0.0.7", | ||
"yjs": "13.0.0-93" | ||
} | ||
} |
@@ -34,3 +34,5 @@ | ||
undoManager, | ||
prevSel: null | ||
prevSel: null, | ||
hasUndoOps: undoManager.undoStack.length > 0, | ||
hasRedoOps: undoManager.redoStack.length > 0 | ||
} | ||
@@ -40,9 +42,21 @@ }, | ||
const binding = ySyncPluginKey.getState(state).binding | ||
const undoManager = val.undoManager | ||
const hasUndoOps = undoManager.undoStack.length > 0 | ||
const hasRedoOps = undoManager.redoStack.length > 0 | ||
if (binding) { | ||
return { | ||
undoManager: val.undoManager, | ||
prevSel: getRelativeSelection(binding, oldState) | ||
undoManager, | ||
prevSel: getRelativeSelection(binding, oldState), | ||
hasUndoOps, | ||
hasRedoOps | ||
} | ||
} else { | ||
return val | ||
if (hasUndoOps !== val.hasUndoOps || hasRedoOps !== val.hasRedoOps) { | ||
return Object.assign({}, val, { | ||
hasUndoOps: undoManager.undoStack.length > 0, | ||
hasRedoOps: undoManager.redoStack.length > 0 | ||
}) | ||
} else { // nothing changed | ||
return val | ||
} | ||
} | ||
@@ -49,0 +63,0 @@ } |
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
2343987
21009