prosemirror-state
Advanced tools
Comparing version 1.2.4 to 1.3.0
@@ -0,1 +1,7 @@ | ||
## 1.3.0 (2019-11-08) | ||
### New features | ||
Add a `module` field to package json file. | ||
## 1.2.4 (2019-08-12) | ||
@@ -2,0 +8,0 @@ |
@@ -26,3 +26,3 @@ 'use strict'; | ||
var prototypeAccessors = { anchor: {},head: {},from: {},to: {},$from: {},$to: {},empty: {} }; | ||
var prototypeAccessors = { anchor: { configurable: true },head: { configurable: true },from: { configurable: true },to: { configurable: true },$from: { configurable: true },$to: { configurable: true },empty: { configurable: true } }; | ||
@@ -247,3 +247,3 @@ // :: number | ||
// position). | ||
var TextSelection = (function (Selection) { | ||
var TextSelection = /*@__PURE__*/(function (Selection) { | ||
function TextSelection($anchor, $head) { | ||
@@ -259,3 +259,3 @@ if ( $head === void 0 ) $head = $anchor; | ||
var prototypeAccessors$1 = { $cursor: {} }; | ||
var prototypeAccessors$1 = { $cursor: { configurable: true } }; | ||
@@ -360,3 +360,3 @@ // :: ?ResolvedPos | ||
// equals `from`, and `head` equals `to`.. | ||
var NodeSelection = (function (Selection) { | ||
var NodeSelection = /*@__PURE__*/(function (Selection) { | ||
function NodeSelection($pos) { | ||
@@ -442,3 +442,3 @@ var node = $pos.nodeAfter; | ||
// document). | ||
var AllSelection = (function (Selection) { | ||
var AllSelection = /*@__PURE__*/(function (Selection) { | ||
function AllSelection(doc) { | ||
@@ -501,5 +501,3 @@ Selection.call(this, doc.resolve(0), doc.resolve(doc.content.size)); | ||
var UPDATED_SEL = 1; | ||
var UPDATED_MARKS = 2; | ||
var UPDATED_SCROLL = 4; | ||
var UPDATED_SEL = 1, UPDATED_MARKS = 2, UPDATED_SCROLL = 4; | ||
@@ -523,5 +521,5 @@ // ::- An editor state transaction, which can be applied to a state to | ||
// a `"uiEvent"` property of that may be `"paste"`, `"cut"`, or `"drop"`. | ||
var Transaction = (function (Transform$$1) { | ||
var Transaction = /*@__PURE__*/(function (Transform) { | ||
function Transaction(state) { | ||
Transform$$1.call(this, state.doc); | ||
Transform.call(this, state.doc); | ||
// :: number | ||
@@ -544,7 +542,7 @@ // The timestamp associated with this transaction, in the same | ||
if ( Transform$$1 ) Transaction.__proto__ = Transform$$1; | ||
Transaction.prototype = Object.create( Transform$$1 && Transform$$1.prototype ); | ||
if ( Transform ) Transaction.__proto__ = Transform; | ||
Transaction.prototype = Object.create( Transform && Transform.prototype ); | ||
Transaction.prototype.constructor = Transaction; | ||
var prototypeAccessors = { selection: {},selectionSet: {},storedMarksSet: {},isGeneric: {},scrolledIntoView: {} }; | ||
var prototypeAccessors = { selection: { configurable: true },selectionSet: { configurable: true },storedMarksSet: { configurable: true },isGeneric: { configurable: true },scrolledIntoView: { configurable: true } }; | ||
@@ -620,3 +618,3 @@ // :: Selection | ||
Transaction.prototype.addStep = function addStep (step, doc) { | ||
Transform$$1.prototype.addStep.call(this, step, doc); | ||
Transform.prototype.addStep.call(this, step, doc); | ||
this.updated = this.updated & ~UPDATED_MARKS; | ||
@@ -700,5 +698,3 @@ this.storedMarks = null; | ||
prototypeAccessors.isGeneric.get = function () { | ||
var this$1 = this; | ||
for (var _ in this$1.meta) { return false } | ||
for (var _ in this.meta) { return false } | ||
return true | ||
@@ -786,3 +782,3 @@ }; | ||
var prototypeAccessors$1 = { schema: {},plugins: {},tr: {} }; | ||
var prototypeAccessors$1 = { schema: { configurable: true },plugins: { configurable: true },tr: { configurable: true } }; | ||
@@ -819,8 +815,7 @@ // doc:: Node | ||
EditorState.prototype.filterTransaction = function filterTransaction (tr, ignore) { | ||
var this$1 = this; | ||
if ( ignore === void 0 ) ignore = -1; | ||
for (var i = 0; i < this.config.plugins.length; i++) { if (i != ignore) { | ||
var plugin = this$1.config.plugins[i]; | ||
if (plugin.spec.filterTransaction && !plugin.spec.filterTransaction.call(plugin, tr, this$1)) | ||
var plugin = this.config.plugins[i]; | ||
if (plugin.spec.filterTransaction && !plugin.spec.filterTransaction.call(plugin, tr, this)) | ||
{ return false } | ||
@@ -838,4 +833,2 @@ } } | ||
EditorState.prototype.applyTransaction = function applyTransaction (rootTr) { | ||
var this$1 = this; | ||
if (!this.filterTransaction(rootTr)) { return {state: this, transactions: []} } | ||
@@ -847,8 +840,8 @@ | ||
// pass the transactions the plugin did not see before. | ||
outer: for (;;) { | ||
for (;;) { | ||
var haveNew = false; | ||
for (var i = 0; i < this.config.plugins.length; i++) { | ||
var plugin = this$1.config.plugins[i]; | ||
var plugin = this.config.plugins[i]; | ||
if (plugin.spec.appendTransaction) { | ||
var n = seen ? seen[i].n : 0, oldState = seen ? seen[i].state : this$1; | ||
var n = seen ? seen[i].n : 0, oldState = seen ? seen[i].state : this; | ||
var tr = n < trs.length && | ||
@@ -861,3 +854,3 @@ plugin.spec.appendTransaction.call(plugin, n ? trs.slice(n) : trs, oldState, newState); | ||
for (var j = 0; j < this.config.plugins.length; j++) | ||
{ seen.push(j < i ? {state: newState, n: trs.length} : {state: this$1, n: 0}); } | ||
{ seen.push(j < i ? {state: newState, n: trs.length} : {state: this, n: 0}); } | ||
} | ||
@@ -877,4 +870,2 @@ trs.push(tr); | ||
EditorState.prototype.applyInner = function applyInner (tr) { | ||
var this$1 = this; | ||
if (!tr.before.eq(this.doc)) { throw new RangeError("Applying a mismatched transaction") } | ||
@@ -884,5 +875,5 @@ var newInstance = new EditorState(this.config), fields = this.config.fields; | ||
var field = fields[i]; | ||
newInstance[field.name] = field.apply(tr, this$1[field.name], this$1, newInstance); | ||
newInstance[field.name] = field.apply(tr, this[field.name], this, newInstance); | ||
} | ||
for (var i$1 = 0; i$1 < applyListeners.length; i$1++) { applyListeners[i$1](this$1, tr, newInstance); } | ||
for (var i$1 = 0; i$1 < applyListeners.length; i$1++) { applyListeners[i$1](this, tr, newInstance); } | ||
return newInstance | ||
@@ -938,4 +929,2 @@ }; | ||
EditorState.prototype.reconfigure = function reconfigure (config) { | ||
var this$1 = this; | ||
var $config = new Configuration(config.schema || this.schema, config.plugins); | ||
@@ -945,3 +934,3 @@ var fields = $config.fields, instance = new EditorState($config); | ||
var name = fields[i].name; | ||
instance[name] = this$1.hasOwnProperty(name) ? this$1[name] : fields[i].init(config, instance); | ||
instance[name] = this.hasOwnProperty(name) ? this[name] : fields[i].init(config, instance); | ||
} | ||
@@ -958,4 +947,2 @@ return instance | ||
EditorState.prototype.toJSON = function toJSON (pluginFields) { | ||
var this$1 = this; | ||
var result = {doc: this.doc.toJSON(), selection: this.selection.toJSON()}; | ||
@@ -967,3 +954,3 @@ if (this.storedMarks) { result.storedMarks = this.storedMarks.map(function (m) { return m.toJSON(); }); } | ||
var plugin = pluginFields[prop], state = plugin.spec.state; | ||
if (state && state.toJSON) { result[prop] = state.toJSON.call(plugin, this$1[plugin.key]); } | ||
if (state && state.toJSON) { result[prop] = state.toJSON.call(plugin, this[plugin.key]); } | ||
} } | ||
@@ -1162,11 +1149,11 @@ return result | ||
exports.AllSelection = AllSelection; | ||
exports.EditorState = EditorState; | ||
exports.NodeSelection = NodeSelection; | ||
exports.Plugin = Plugin; | ||
exports.PluginKey = PluginKey; | ||
exports.Selection = Selection; | ||
exports.SelectionRange = SelectionRange; | ||
exports.TextSelection = TextSelection; | ||
exports.NodeSelection = NodeSelection; | ||
exports.AllSelection = AllSelection; | ||
exports.Transaction = Transaction; | ||
exports.EditorState = EditorState; | ||
exports.Plugin = Plugin; | ||
exports.PluginKey = PluginKey; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "prosemirror-state", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"description": "ProseMirror editor state", | ||
"main": "dist/index.js", | ||
"module": "src/index.js", | ||
"license": "MIT", | ||
@@ -16,3 +17,3 @@ "maintainers": [ | ||
"type": "git", | ||
"url": "git://github.com/prosemirror/prosemirror.git" | ||
"url": "git://github.com/prosemirror/prosemirror-state.git" | ||
}, | ||
@@ -27,4 +28,4 @@ "dependencies": { | ||
"prosemirror-test-builder": "^1.0.0", | ||
"rollup": "^0.49.0", | ||
"rollup-plugin-buble": "^0.15.0" | ||
"rollup": "^1.26.3", | ||
"@rollup/plugin-buble": "^0.20.0" | ||
}, | ||
@@ -31,0 +32,0 @@ "scripts": { |
@@ -1,7 +0,12 @@ | ||
module.exports = { | ||
input: "./src/index.js", | ||
output: {format: "cjs", file: "dist/index.js"}, | ||
sourcemap: true, | ||
plugins: [require("rollup-plugin-buble")()], | ||
import buble from '@rollup/plugin-buble' | ||
export default { | ||
input: './src/index.js', | ||
output: { | ||
dir: 'dist', | ||
format: 'cjs', | ||
sourcemap: true | ||
}, | ||
plugins: [buble()], | ||
external(id) { return !/^[\.\/]/.test(id) } | ||
} |
Sorry, the diff of this file is not supported yet
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
172695
1983