prosemirror-history
Advanced tools
Comparing version 0.18.0 to 0.19.0
@@ -259,7 +259,8 @@ var RopeSequence = require("rope-sequence") | ||
var newState = tr.getMeta(historyKey), rebased | ||
if (newState) { | ||
return newState | ||
} else if (tr.steps.length == 0) { | ||
if (tr.getMeta(closeHistoryKey)) { return new HistoryState(history.done, history.undone, null, 0) } | ||
else { return history } | ||
if (newState) { return newState } | ||
if (tr.getMeta(closeHistoryKey)) { history = new HistoryState(history.done, history.undone, null, 0) } | ||
if (tr.steps.length == 0) { | ||
return history | ||
} else if (tr.getMeta("addToHistory") !== false) { | ||
@@ -321,4 +322,8 @@ // Group transforms that occur in quick succession into one event. | ||
function closeHistory(state) { | ||
return state.tr.setMeta(closeHistoryKey, true) | ||
// :: (Transaction) → Transaction | ||
// Set a flag on the given transaction that will prevent further steps | ||
// from being appended to an existing history event (so that they | ||
// require a separate undo command to undo). | ||
function closeHistory(tr) { | ||
return tr.setMeta(closeHistoryKey, true) | ||
} | ||
@@ -325,0 +330,0 @@ exports.closeHistory = closeHistory |
{ | ||
"name": "prosemirror-history", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"description": "Undo history for ProseMirror", | ||
@@ -19,4 +19,4 @@ "main": "dist/history.js", | ||
"dependencies": { | ||
"prosemirror-state": "^0.18.0", | ||
"prosemirror-transform": "^0.18.0", | ||
"prosemirror-state": "^0.19.0", | ||
"prosemirror-transform": "^0.19.0", | ||
"rope-sequence": "^1.2.0" | ||
@@ -29,3 +29,3 @@ }, | ||
"rimraf": "^2.5.4", | ||
"prosemirror-model": "^0.18.0" | ||
"prosemirror-model": "^0.19.0" | ||
}, | ||
@@ -32,0 +32,0 @@ "scripts": { |
@@ -257,7 +257,8 @@ const RopeSequence = require("rope-sequence") | ||
let newState = tr.getMeta(historyKey), rebased | ||
if (newState) { | ||
return newState | ||
} else if (tr.steps.length == 0) { | ||
if (tr.getMeta(closeHistoryKey)) return new HistoryState(history.done, history.undone, null, 0) | ||
else return history | ||
if (newState) return newState | ||
if (tr.getMeta(closeHistoryKey)) history = new HistoryState(history.done, history.undone, null, 0) | ||
if (tr.steps.length == 0) { | ||
return history | ||
} else if (tr.getMeta("addToHistory") !== false) { | ||
@@ -319,4 +320,8 @@ // Group transforms that occur in quick succession into one event. | ||
function closeHistory(state) { | ||
return state.tr.setMeta(closeHistoryKey, true) | ||
// :: (Transaction) → Transaction | ||
// Set a flag on the given transaction that will prevent further steps | ||
// from being appended to an existing history event (so that they | ||
// require a separate undo command to undo). | ||
function closeHistory(tr) { | ||
return tr.setMeta(closeHistoryKey, true) | ||
} | ||
@@ -323,0 +328,0 @@ exports.closeHistory = closeHistory |
@@ -12,1 +12,3 @@ An implementation of undo/redo history for ProseMirror. | ||
@redoDepth | ||
@closeHistory |
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
37754
748
+ Addedprosemirror-model@0.19.0(transitive)
+ Addedprosemirror-state@0.19.1(transitive)
+ Addedprosemirror-transform@0.19.0(transitive)
- Removedprosemirror-model@0.18.0(transitive)
- Removedprosemirror-state@0.18.0(transitive)
- Removedprosemirror-transform@0.18.0(transitive)
Updatedprosemirror-state@^0.19.0