@atlaskit/editor-plugin-selection-extension 3.3.0 → 3.3.1

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,13 @@
1
1
  # @atlaskit/editor-plugin-selection-extension
2
2
 
3
+ ## 3.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#191736](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/191736)
8
+ [`5c91794777225`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5c91794777225) -
9
+ Clear activeExtension when selection changed
10
+
3
11
  ## 3.3.0
4
12
 
5
13
  ### Minor Changes
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
11
  var _transform = require("@atlaskit/editor-prosemirror/transform");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _types = require("../types");
13
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -54,6 +55,12 @@ var createPlugin = exports.createPlugin = function createPlugin() {
54
55
  startTrackChanges: false // Reset the flag to stop tracking after the document has changed
55
56
  });
56
57
  }
58
+ // clear activeExtension if the selection has changed and not empty
59
+ if (tr.selectionSet && !tr.selection.empty && (0, _platformFeatureFlags.fg)('platform_editor_clear_active_extension_fix')) {
60
+ return _objectSpread(_objectSpread({}, pluginState), {}, {
61
+ activeExtension: undefined // Clear active extension on selection change
62
+ });
63
+ }
57
64
  return pluginState;
58
65
  }
59
66
  }
@@ -1,6 +1,7 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
3
  import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { SelectionExtensionActionTypes } from '../types';
5
6
  export const selectionExtensionPluginKey = new PluginKey('selectionExtensionPlugin');
6
7
  export const createPlugin = () => {
@@ -47,6 +48,13 @@ export const createPlugin = () => {
47
48
  startTrackChanges: false // Reset the flag to stop tracking after the document has changed
48
49
  };
49
50
  }
51
+ // clear activeExtension if the selection has changed and not empty
52
+ if (tr.selectionSet && !tr.selection.empty && fg('platform_editor_clear_active_extension_fix')) {
53
+ return {
54
+ ...pluginState,
55
+ activeExtension: undefined // Clear active extension on selection change
56
+ };
57
+ }
50
58
  return pluginState;
51
59
  }
52
60
  }
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
6
  import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { SelectionExtensionActionTypes } from '../types';
8
9
  export var selectionExtensionPluginKey = new PluginKey('selectionExtensionPlugin');
9
10
  export var createPlugin = function createPlugin() {
@@ -47,6 +48,12 @@ export var createPlugin = function createPlugin() {
47
48
  startTrackChanges: false // Reset the flag to stop tracking after the document has changed
48
49
  });
49
50
  }
51
+ // clear activeExtension if the selection has changed and not empty
52
+ if (tr.selectionSet && !tr.selection.empty && fg('platform_editor_clear_active_extension_fix')) {
53
+ return _objectSpread(_objectSpread({}, pluginState), {}, {
54
+ activeExtension: undefined // Clear active extension on selection change
55
+ });
56
+ }
50
57
  return pluginState;
51
58
  }
52
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-extension",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,10 +42,10 @@
42
42
  "@atlaskit/editor-plugin-selection-toolbar": "^4.2.0",
43
43
  "@atlaskit/editor-prosemirror": "7.0.0",
44
44
  "@atlaskit/editor-tables": "^2.9.0",
45
- "@atlaskit/icon": "^27.6.0",
45
+ "@atlaskit/icon": "^27.7.0",
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
47
  "@atlaskit/primitives": "^14.10.0",
48
- "@atlaskit/tmp-editor-statsig": "^9.12.0",
48
+ "@atlaskit/tmp-editor-statsig": "^9.16.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "lodash": "^4.17.21",
51
51
  "react-intl-next": "npm:react-intl@^5.18.1",
@@ -104,6 +104,9 @@
104
104
  }
105
105
  },
106
106
  "platform-feature-flags": {
107
+ "platform_editor_clear_active_extension_fix": {
108
+ "type": "boolean"
109
+ },
107
110
  "platform_editor_selection_extension_api_v2": {
108
111
  "type": "boolean"
109
112
  }