Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prosemirror-history

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-history - npm Package Compare versions

Comparing version 0.12.0 to 0.12.1

13

dist/history.js

@@ -304,5 +304,6 @@ var RopeSequence = require("rope-sequence")

// be shifted.
function histAction(history, state, redo) {
function histAction(history, state, onAction, redo) {
var histOptions = historyKey.get(state).options.config
var pop = (redo ? history.undone : history.done).popEvent(state, histOptions.preserveItems)
if (!pop) { return }

@@ -314,3 +315,3 @@ var selectionBefore = state.selection

var newHist = new HistoryState(redo ? added : pop.remaining, redo ? pop.remaining : added, null, 0)
return pop.transform.action({selection: selection, historyState: newHist, scrollIntoView: true})
onAction(pop.transform.action({selection: selection, historyState: newHist, scrollIntoView: true}))
}

@@ -369,4 +370,4 @@

var hist = historyKey.getState(state)
if (!hist || hist.undoDepth == 0) { return false }
if (onAction) { onAction(histAction(hist, state, false)) }
if (!hist || hist.done.eventCount == 0) { return false }
if (onAction) { histAction(hist, state, onAction, false) }
return true

@@ -380,4 +381,4 @@ }

var hist = historyKey.getState(state)
if (!hist || hist.redoDepth == 0) { return false }
if (onAction) { onAction(histAction(hist, state, true)) }
if (!hist || hist.undone.eventCount == 0) { return false }
if (onAction) { histAction(hist, state, onAction, true) }
return true

@@ -384,0 +385,0 @@ }

{
"name": "prosemirror-history",
"version": "0.12.0",
"version": "0.12.1",
"description": "Undo history for ProseMirror",

@@ -5,0 +5,0 @@ "main": "dist/history.js",

@@ -302,5 +302,6 @@ const RopeSequence = require("rope-sequence")

// be shifted.
function histAction(history, state, redo) {
function histAction(history, state, onAction, redo) {
let histOptions = historyKey.get(state).options.config
let pop = (redo ? history.undone : history.done).popEvent(state, histOptions.preserveItems)
if (!pop) return

@@ -312,3 +313,3 @@ let selectionBefore = state.selection

let newHist = new HistoryState(redo ? added : pop.remaining, redo ? pop.remaining : added, null, 0)
return pop.transform.action({selection, historyState: newHist, scrollIntoView: true})
onAction(pop.transform.action({selection, historyState: newHist, scrollIntoView: true}))
}

@@ -367,4 +368,4 @@

let hist = historyKey.getState(state)
if (!hist || hist.undoDepth == 0) return false
if (onAction) onAction(histAction(hist, state, false))
if (!hist || hist.done.eventCount == 0) return false
if (onAction) histAction(hist, state, onAction, false)
return true

@@ -378,4 +379,4 @@ }

let hist = historyKey.getState(state)
if (!hist || hist.redoDepth == 0) return false
if (onAction) onAction(histAction(hist, state, true))
if (!hist || hist.undone.eventCount == 0) return false
if (onAction) histAction(hist, state, onAction, true)
return true

@@ -382,0 +383,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc