Socket
Socket
Sign inDemoInstall

prosemirror-state

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-state - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 1.2.2 (2018-07-23)
### Bug fixes
The `"appendedTransaction"` meta property on appended transactions now points to the root transaction instead of at the transaction itself, which it accidentally did before.
## 1.2.1 (2018-07-02)

@@ -2,0 +8,0 @@

16

dist/index.js

@@ -821,8 +821,8 @@ 'use strict';

// plugins) along with the new state.
EditorState.prototype.applyTransaction = function applyTransaction (tr) {
EditorState.prototype.applyTransaction = function applyTransaction (rootTr) {
var this$1 = this;
if (!this.filterTransaction(tr)) { return {state: this, transactions: []} }
if (!this.filterTransaction(rootTr)) { return {state: this, transactions: []} }
var trs = [tr], newState = this.applyInner(tr), seen = null;
var trs = [rootTr], newState = this.applyInner(rootTr), seen = null;
// This loop repeatedly gives plugins a chance to respond to

@@ -837,6 +837,6 @@ // transactions as new transactions are added, making sure to only

var n = seen ? seen[i].n : 0, oldState = seen ? seen[i].state : this$1;
var tr$1 = n < trs.length &&
var tr = n < trs.length &&
plugin.spec.appendTransaction.call(plugin, n ? trs.slice(n) : trs, oldState, newState);
if (tr$1 && newState.filterTransaction(tr$1, i)) {
tr$1.setMeta("appendedTransaction", tr$1);
if (tr && newState.filterTransaction(tr, i)) {
tr.setMeta("appendedTransaction", rootTr);
if (!seen) {

@@ -847,4 +847,4 @@ seen = [];

}
trs.push(tr$1);
newState = newState.applyInner(tr$1);
trs.push(tr);
newState = newState.applyInner(tr);
haveNew = true;

@@ -851,0 +851,0 @@ }

{
"name": "prosemirror-state",
"version": "1.2.1",
"version": "1.2.2",
"description": "ProseMirror editor state",

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

@@ -115,6 +115,6 @@ import {Node} from "prosemirror-model"

// plugins) along with the new state.
applyTransaction(tr) {
if (!this.filterTransaction(tr)) return {state: this, transactions: []}
applyTransaction(rootTr) {
if (!this.filterTransaction(rootTr)) return {state: this, transactions: []}
let trs = [tr], newState = this.applyInner(tr), seen = null
let trs = [rootTr], newState = this.applyInner(rootTr), seen = null
// This loop repeatedly gives plugins a chance to respond to

@@ -132,3 +132,3 @@ // transactions as new transactions are added, making sure to only

if (tr && newState.filterTransaction(tr, i)) {
tr.setMeta("appendedTransaction", tr)
tr.setMeta("appendedTransaction", rootTr)
if (!seen) {

@@ -135,0 +135,0 @@ seen = []

Sorry, the diff of this file is not supported yet

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