@atlaskit/editor-tables 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/editor-tables
2
2
 
3
+ ## 2.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4e6fbaf5898`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6fbaf5898) - ED-14117 Change EditorState.apply type to receive readonly transaction
8
+
9
+ Transactions should not be mutated after being dispatched as it can lead to
10
+ unexpected behaviour. This change patches the relevant types declared in
11
+ prosemirror-state as a compile-time safeguard.
12
+
3
13
  ## 2.1.1
4
14
 
5
15
  ### Patch Changes
@@ -19,18 +19,6 @@ var _input = require("./input");
19
19
 
20
20
  var _pluginKey = require("./plugin-key");
21
21
 
22
- // :: () → Plugin
23
- //
24
- // Creates a [plugin](http://prosemirror.net/docs/ref/#state.Plugin)
25
- // that, when added to an editor, enables cell-selection, handles
26
- // cell-based copy/paste, and makes sure tables stay well-formed (each
27
- // row has the same width, and cells don't overlap).
28
- //
29
- // You should probably put this plugin near the end of your array of
30
- // plugins, since it handles mouse and arrow key events in tables
31
- // rather broadly, and other plugins, like the gap cursor or the
32
- // column-width dragging plugin, might want to get a turn first to
33
- // perform more specific behavior.
34
22
  function tableEditing() {
35
23
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
36
24
  _ref$allowTableNodeSe = _ref.allowTableNodeSelection,
@@ -45,7 +33,8 @@ function tableEditing() {
45
33
  init: function init() {
46
34
  return null;
47
35
  },
48
- apply: function apply(tr, cur) {
36
+ apply: function apply(unsafeTr, cur) {
37
+ var tr = unsafeTr;
49
38
  var set = tr.getMeta(_pluginKey.tableEditingKey);
50
39
 
51
40
  if (set != null) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "sideEffects": false
5
5
  }
@@ -30,7 +30,8 @@ export function tableEditing({
30
30
  return null;
31
31
  },
32
32
 
33
- apply(tr, cur) {
33
+ apply(unsafeTr, cur) {
34
+ const tr = unsafeTr;
34
35
  const set = tr.getMeta(tableEditingKey);
35
36
 
36
37
  if (set != null) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "sideEffects": false
5
5
  }
@@ -31,7 +31,8 @@ export function tableEditing() {
31
31
  init: function init() {
32
32
  return null;
33
33
  },
34
- apply: function apply(tr, cur) {
34
+ apply: function apply(unsafeTr, cur) {
35
+ var tr = unsafeTr;
35
36
  var set = tr.getMeta(tableEditingKey);
36
37
 
37
38
  if (set != null) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,6 @@
1
1
  import { Plugin } from 'prosemirror-state';
2
+ declare type PluginState = number | null;
2
3
  export declare function tableEditing({ allowTableNodeSelection }?: {
3
4
  allowTableNodeSelection?: boolean | undefined;
4
- }): Plugin;
5
+ }): Plugin<PluginState>;
6
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "A package that contains common classes and utility functions for editor tables",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,8 +29,8 @@
29
29
  "prosemirror-view": "1.23.2"
30
30
  },
31
31
  "devDependencies": {
32
- "@atlaskit/adf-schema": "^21.0.0",
33
- "@atlaskit/editor-test-helpers": "^16.0.0",
32
+ "@atlaskit/adf-schema": "^22.0.0",
33
+ "@atlaskit/editor-test-helpers": "^16.1.0",
34
34
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1"
35
35
  },
36
36
  "techstack": {