@atlaskit/editor-plugin-decorations 2.0.6 → 2.0.8

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,19 @@
1
1
  # @atlaskit/editor-plugin-decorations
2
2
 
3
+ ## 2.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#181594](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181594)
8
+ [`f7fa55cd505ce`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f7fa55cd505ce) -
9
+ Avoid using tables commands directly in floating toolbar plugin.
10
+
11
+ ## 2.0.7
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 2.0.6
4
18
 
5
19
  ### Patch Changes
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.decorationsPlugin = void 0;
8
8
  var _main = _interopRequireWildcard(require("./pm-plugins/main"));
9
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
10
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
9
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
11
10
  /**
12
11
  * Decorations plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
13
12
  * from `@atlaskit/editor-core`.
@@ -8,7 +8,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
8
8
  var _state = require("@atlaskit/editor-prosemirror/state");
9
9
  var _utils = require("@atlaskit/editor-prosemirror/utils");
10
10
  var _view = require("@atlaskit/editor-prosemirror/view");
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  var decorationStateKey = exports.decorationStateKey = new _state.PluginKey('decorationPlugin');
13
12
  var ACTIONS = exports.ACTIONS = /*#__PURE__*/function (ACTIONS) {
14
13
  ACTIONS[ACTIONS["DECORATION_ADD"] = 0] = "DECORATION_ADD";
@@ -17,22 +16,13 @@ var ACTIONS = exports.ACTIONS = /*#__PURE__*/function (ACTIONS) {
17
16
  }({});
18
17
  var removeDecoration = exports.removeDecoration = function removeDecoration(state, dispatch) {
19
18
  var tr = state.tr;
20
- if ((0, _platformFeatureFlags.fg)('platform_editor_remove_slow_table_transactions')) {
21
- var _ref = decorationStateKey.getState(state),
22
- decoration = _ref.decoration;
23
- if (decoration && dispatch) {
24
- dispatch(tr.setMeta(decorationStateKey, {
25
- action: ACTIONS.DECORATION_REMOVE
26
- }));
27
- return true;
28
- }
29
- } else {
30
- if (dispatch) {
31
- dispatch(tr.setMeta(decorationStateKey, {
32
- action: ACTIONS.DECORATION_REMOVE
33
- }));
34
- return true;
35
- }
19
+ var _ref = decorationStateKey.getState(state),
20
+ decoration = _ref.decoration;
21
+ if (decoration && dispatch) {
22
+ dispatch(tr.setMeta(decorationStateKey, {
23
+ action: ACTIONS.DECORATION_REMOVE
24
+ }));
25
+ return true;
36
26
  }
37
27
  return false;
38
28
  };
@@ -2,7 +2,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { NodeSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
3
3
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
4
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
5
  export const decorationStateKey = new PluginKey('decorationPlugin');
7
6
  export let ACTIONS = /*#__PURE__*/function (ACTIONS) {
8
7
  ACTIONS[ACTIONS["DECORATION_ADD"] = 0] = "DECORATION_ADD";
@@ -13,23 +12,14 @@ export const removeDecoration = (state, dispatch) => {
13
12
  const {
14
13
  tr
15
14
  } = state;
16
- if (fg('platform_editor_remove_slow_table_transactions')) {
17
- const {
18
- decoration
19
- } = decorationStateKey.getState(state);
20
- if (decoration && dispatch) {
21
- dispatch(tr.setMeta(decorationStateKey, {
22
- action: ACTIONS.DECORATION_REMOVE
23
- }));
24
- return true;
25
- }
26
- } else {
27
- if (dispatch) {
28
- dispatch(tr.setMeta(decorationStateKey, {
29
- action: ACTIONS.DECORATION_REMOVE
30
- }));
31
- return true;
32
- }
15
+ const {
16
+ decoration
17
+ } = decorationStateKey.getState(state);
18
+ if (decoration && dispatch) {
19
+ dispatch(tr.setMeta(decorationStateKey, {
20
+ action: ACTIONS.DECORATION_REMOVE
21
+ }));
22
+ return true;
33
23
  }
34
24
  return false;
35
25
  };
@@ -2,7 +2,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { NodeSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
3
3
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
4
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
5
  export var decorationStateKey = new PluginKey('decorationPlugin');
7
6
  export var ACTIONS = /*#__PURE__*/function (ACTIONS) {
8
7
  ACTIONS[ACTIONS["DECORATION_ADD"] = 0] = "DECORATION_ADD";
@@ -11,22 +10,13 @@ export var ACTIONS = /*#__PURE__*/function (ACTIONS) {
11
10
  }({});
12
11
  export var removeDecoration = function removeDecoration(state, dispatch) {
13
12
  var tr = state.tr;
14
- if (fg('platform_editor_remove_slow_table_transactions')) {
15
- var _ref = decorationStateKey.getState(state),
16
- decoration = _ref.decoration;
17
- if (decoration && dispatch) {
18
- dispatch(tr.setMeta(decorationStateKey, {
19
- action: ACTIONS.DECORATION_REMOVE
20
- }));
21
- return true;
22
- }
23
- } else {
24
- if (dispatch) {
25
- dispatch(tr.setMeta(decorationStateKey, {
26
- action: ACTIONS.DECORATION_REMOVE
27
- }));
28
- return true;
29
- }
13
+ var _ref = decorationStateKey.getState(state),
14
+ decoration = _ref.decoration;
15
+ if (decoration && dispatch) {
16
+ dispatch(tr.setMeta(decorationStateKey, {
17
+ action: ACTIONS.DECORATION_REMOVE
18
+ }));
19
+ return true;
30
20
  }
31
21
  return false;
32
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-decorations",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "Decorations plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -9,8 +9,7 @@
9
9
  },
10
10
  "atlassian": {
11
11
  "team": "Editor: Lego",
12
- "singleton": true,
13
- "runReact18": true
12
+ "singleton": true
14
13
  },
15
14
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
16
15
  "main": "dist/cjs/index.js",
@@ -23,7 +22,7 @@
23
22
  ".": "./src/index.ts"
24
23
  },
25
24
  "dependencies": {
26
- "@atlaskit/editor-common": "^106.0.0",
25
+ "@atlaskit/editor-common": "^107.6.0",
27
26
  "@atlaskit/editor-prosemirror": "7.0.0",
28
27
  "@atlaskit/platform-feature-flags": "^1.1.0",
29
28
  "@babel/runtime": "^7.0.0"
@@ -70,10 +69,5 @@
70
69
  "emotion"
71
70
  ]
72
71
  }
73
- },
74
- "platform-feature-flags": {
75
- "platform_editor_remove_slow_table_transactions": {
76
- "type": "boolean"
77
- }
78
72
  }
79
73
  }