@remirror/pm
Advanced tools
Comparing version 1.0.0-next.37 to 1.0.0-next.38
# @remirror/pm | ||
## 1.0.0-next.38 | ||
> 2020-09-16 | ||
### Patch Changes | ||
- [`14e48698`](https://github.com/remirror/remirror/commit/14e48698a28c3ec54a475970e0a6375f446a3a73) Thanks [@ifiokjr](https://github.com/ifiokjr)! - Update the `selection`, `storedMarks` and `doc` from the `chainableEditorState` whenever the `state.tr` property is accessed. This better mimics the behavior expected within commands where the `Transaction` is created once at the start and the state is used as a reference point. | ||
- Updated dependencies [[`6855ee77`](https://github.com/remirror/remirror/commit/6855ee773bf25a4b30d45a7e09eeab78d6b3f67a)]: | ||
- @remirror/core-helpers@1.0.0-next.38 | ||
- prosemirror-suggest@1.0.0-next.38 | ||
## 1.0.0-next.37 | ||
@@ -4,0 +16,0 @@ |
@@ -83,7 +83,7 @@ export declare type EditorSchema<Nodes extends string = string, Marks extends string = string> = import('../model').Schema<Nodes, Marks>; | ||
/** | ||
* The prosemirror transaction | ||
* The shared ProseMirror Transaction. | ||
*/ | ||
tr: Transaction<Schema>; | ||
/** | ||
* A snapshot of the prosemirror editor state. | ||
* A snapshot of the ProseMirror editor state. | ||
*/ | ||
@@ -102,3 +102,3 @@ state: EditorState<Schema>; | ||
/** | ||
* An instance of the Prosemirror editor `view`. | ||
* An instance of the ProseMirror editor `view`. | ||
*/ | ||
@@ -105,0 +105,0 @@ view?: EditorView<Schema>; |
@@ -28,4 +28,10 @@ 'use strict'; | ||
function chainableEditorState(tr, state) { | ||
// Every time the `state.tr` property is accessed these values are updated to | ||
// reflect the current `transaction` value for the doc, selection and | ||
// storedMarks. This way they can be mostly be constant within the scope of | ||
// the command this state is used in. | ||
var selection = tr.selection; | ||
var doc = tr.doc; | ||
var storedMarks = tr.storedMarks; | ||
return _objectSpread__default['default'](_objectSpread__default['default']({}, state), {}, { | ||
tr, | ||
schema: state.schema, | ||
@@ -39,11 +45,18 @@ plugins: state.plugins, | ||
get storedMarks() { | ||
return state.storedMarks; | ||
return storedMarks; | ||
}, | ||
get selection() { | ||
return state.selection; | ||
return selection; | ||
}, | ||
get doc() { | ||
return state.doc; | ||
return doc; | ||
}, | ||
get tr() { | ||
selection = tr.selection; | ||
doc = tr.doc; | ||
storedMarks = tr.storedMarks; | ||
return tr; | ||
} | ||
@@ -50,0 +63,0 @@ |
@@ -18,4 +18,10 @@ import _createForOfIteratorHelper from '@babel/runtime/helpers/esm/createForOfIteratorHelper'; | ||
function chainableEditorState(tr, state) { | ||
// Every time the `state.tr` property is accessed these values are updated to | ||
// reflect the current `transaction` value for the doc, selection and | ||
// storedMarks. This way they can be mostly be constant within the scope of | ||
// the command this state is used in. | ||
var selection = tr.selection; | ||
var doc = tr.doc; | ||
var storedMarks = tr.storedMarks; | ||
return _objectSpread(_objectSpread({}, state), {}, { | ||
tr, | ||
schema: state.schema, | ||
@@ -29,11 +35,18 @@ plugins: state.plugins, | ||
get storedMarks() { | ||
return state.storedMarks; | ||
return storedMarks; | ||
}, | ||
get selection() { | ||
return state.selection; | ||
return selection; | ||
}, | ||
get doc() { | ||
return state.doc; | ||
return doc; | ||
}, | ||
get tr() { | ||
selection = tr.selection; | ||
doc = tr.doc; | ||
storedMarks = tr.storedMarks; | ||
return tr; | ||
} | ||
@@ -40,0 +53,0 @@ |
@@ -28,4 +28,10 @@ 'use strict'; | ||
function chainableEditorState(tr, state) { | ||
// Every time the `state.tr` property is accessed these values are updated to | ||
// reflect the current `transaction` value for the doc, selection and | ||
// storedMarks. This way they can be mostly be constant within the scope of | ||
// the command this state is used in. | ||
var selection = tr.selection; | ||
var doc = tr.doc; | ||
var storedMarks = tr.storedMarks; | ||
return _objectSpread__default['default'](_objectSpread__default['default']({}, state), {}, { | ||
tr, | ||
schema: state.schema, | ||
@@ -39,11 +45,18 @@ plugins: state.plugins, | ||
get storedMarks() { | ||
return state.storedMarks; | ||
return storedMarks; | ||
}, | ||
get selection() { | ||
return state.selection; | ||
return selection; | ||
}, | ||
get doc() { | ||
return state.doc; | ||
return doc; | ||
}, | ||
get tr() { | ||
selection = tr.selection; | ||
doc = tr.doc; | ||
storedMarks = tr.storedMarks; | ||
return tr; | ||
} | ||
@@ -50,0 +63,0 @@ |
@@ -18,4 +18,4 @@ "use strict"; | ||
function chainableEditorState(tr, state) { | ||
var selection = tr.selection, doc = tr.doc, storedMarks = tr.storedMarks; | ||
return _objectSpread__default.default(_objectSpread__default.default({}, state), {}, { | ||
tr: tr, | ||
schema: state.schema, | ||
@@ -28,9 +28,12 @@ plugins: state.plugins, | ||
get storedMarks() { | ||
return state.storedMarks; | ||
return storedMarks; | ||
}, | ||
get selection() { | ||
return state.selection; | ||
return selection; | ||
}, | ||
get doc() { | ||
return state.doc; | ||
return doc; | ||
}, | ||
get tr() { | ||
return selection = tr.selection, doc = tr.doc, storedMarks = tr.storedMarks, tr; | ||
} | ||
@@ -37,0 +40,0 @@ }); |
@@ -18,4 +18,10 @@ import _createForOfIteratorHelper from '@babel/runtime/helpers/esm/createForOfIteratorHelper'; | ||
function chainableEditorState(tr, state) { | ||
// Every time the `state.tr` property is accessed these values are updated to | ||
// reflect the current `transaction` value for the doc, selection and | ||
// storedMarks. This way they can be mostly be constant within the scope of | ||
// the command this state is used in. | ||
var selection = tr.selection; | ||
var doc = tr.doc; | ||
var storedMarks = tr.storedMarks; | ||
return _objectSpread(_objectSpread({}, state), {}, { | ||
tr, | ||
schema: state.schema, | ||
@@ -29,11 +35,18 @@ plugins: state.plugins, | ||
get storedMarks() { | ||
return state.storedMarks; | ||
return storedMarks; | ||
}, | ||
get selection() { | ||
return state.selection; | ||
return selection; | ||
}, | ||
get doc() { | ||
return state.doc; | ||
return doc; | ||
}, | ||
get tr() { | ||
selection = tr.selection; | ||
doc = tr.doc; | ||
storedMarks = tr.storedMarks; | ||
return tr; | ||
} | ||
@@ -40,0 +53,0 @@ |
{ | ||
"name": "@remirror/pm", | ||
"version": "1.0.0-next.37", | ||
"version": "1.0.0-next.38", | ||
"description": "A bundled library containing all the core prosemirror libraries required for using remirror", | ||
@@ -38,3 +38,3 @@ "homepage": "https://github.com/remirror/remirror/tree/HEAD/packages/@remirror/pm", | ||
"@remirror/core-constants": "1.0.0-next.35", | ||
"@remirror/core-helpers": "1.0.0-next.37", | ||
"@remirror/core-helpers": "1.0.0-next.38", | ||
"@types/prosemirror-commands": "^1.0.3", | ||
@@ -60,3 +60,3 @@ "@types/prosemirror-dropcursor": "^1.0.0", | ||
"prosemirror-state": "^1.3.3", | ||
"prosemirror-suggest": "^1.0.0-next.37", | ||
"prosemirror-suggest": "^1.0.0-next.38", | ||
"prosemirror-tables": "^1.1.1", | ||
@@ -63,0 +63,0 @@ "prosemirror-transform": "^1.2.8", |
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
60434
1307
+ Added@remirror/core-helpers@1.0.0-next.38(transitive)
+ Added@remirror/core-types@1.0.0-next.38(transitive)
- Removed@remirror/core-helpers@1.0.0-next.37(transitive)
- Removed@remirror/core-types@1.0.0-next.37(transitive)