@atlaskit/editor-plugin-expand 31.1.3 → 31.1.4

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,14 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 31.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`87d171d3ba846`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/87d171d3ba846) -
8
+ Allow the Expand floating toolbar to open Remix while the Expand title has focus under the
9
+ `platform_editor_remix_reliability_improvements` experiment, while preserving Expand keyboard
10
+ navigation.
11
+
3
12
  ## 31.1.3
4
13
 
5
14
  ### Patch Changes
@@ -12,6 +12,7 @@ var _selection = require("@atlaskit/editor-common/selection");
12
12
  var _expand = require("@atlaskit/editor-common/styles/expand");
13
13
  var _transforms = require("@atlaskit/editor-common/transforms");
14
14
  var _utils = require("@atlaskit/editor-prosemirror/utils");
15
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
15
16
  var _commands = require("../commands");
16
17
  var _nodeviews = _interopRequireDefault(require("../nodeviews"));
17
18
  var _pluginFactory = require("./plugin-factory");
@@ -73,7 +74,8 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
73
74
  },
74
75
  // @see ED-8027 to follow up on this work-around
75
76
  filterTransaction: function filterTransaction(tr) {
76
- if (containsClass(document.activeElement, _expand.expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric)) {
77
+ // Preserve title editing against selection changes unless explicitly allowed.
78
+ if (containsClass(document.activeElement, _expand.expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric) && !((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_remix_reliability_improvements') && tr.getMeta('allowSelectionChangeWhileExpandTitleFocused') === true)) {
77
79
  return false;
78
80
  }
79
81
  return true;
@@ -14,6 +14,7 @@ var _expand = require("@atlaskit/editor-common/styles/expand");
14
14
  var _transforms = require("@atlaskit/editor-common/transforms");
15
15
  var _state = require("@atlaskit/editor-prosemirror/state");
16
16
  var _view2 = require("@atlaskit/editor-prosemirror/view");
17
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
17
18
  var _toggleExpandRange = require("../../editor-commands/toggleExpandRange");
18
19
  var _nodeViews = _interopRequireDefault(require("../node-views"));
19
20
  // Ignored via go/ees005
@@ -104,7 +105,8 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
104
105
  },
105
106
  // @see ED-8027 to follow up on this work-around
106
107
  filterTransaction: function filterTransaction(tr) {
107
- if (containsClass(document.activeElement, _expand.expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric)) {
108
+ // Preserve title editing against selection changes unless explicitly allowed.
109
+ if (containsClass(document.activeElement, _expand.expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric) && !((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_remix_reliability_improvements') && tr.getMeta('allowSelectionChangeWhileExpandTitleFocused') === true)) {
108
110
  return false;
109
111
  }
110
112
  return true;
@@ -3,6 +3,7 @@ import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
3
3
  import { expandClassNames } from '@atlaskit/editor-common/styles/expand';
4
4
  import { findExpand, transformSliceExpandToNestedExpand, transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
5
5
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
6
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
6
7
  import { setExpandRef } from '../commands';
7
8
  // Ignored via go/ees005
8
9
  // eslint-disable-next-line import/no-named-as-default
@@ -55,7 +56,8 @@ export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLon
55
56
  },
56
57
  // @see ED-8027 to follow up on this work-around
57
58
  filterTransaction(tr) {
58
- if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric)) {
59
+ // Preserve title editing against selection changes unless explicitly allowed.
60
+ if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric) && !(isExperimentEnabled('platform_editor_remix_reliability_improvements') && tr.getMeta('allowSelectionChangeWhileExpandTitleFocused') === true)) {
59
61
  return false;
60
62
  }
61
63
  return true;
@@ -4,6 +4,7 @@ import { expandClassNames } from '@atlaskit/editor-common/styles/expand';
4
4
  import { transformSliceExpandToNestedExpand, transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
5
5
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
6
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
7
8
  import { TOGGLE_EXPAND_RANGE_META_KEY } from '../../editor-commands/toggleExpandRange';
8
9
  // Ignored via go/ees005
9
10
  // eslint-disable-next-line import/no-named-as-default
@@ -85,7 +86,8 @@ export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLon
85
86
  },
86
87
  // @see ED-8027 to follow up on this work-around
87
88
  filterTransaction(tr) {
88
- if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric)) {
89
+ // Preserve title editing against selection changes unless explicitly allowed.
90
+ if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric) && !(isExperimentEnabled('platform_editor_remix_reliability_improvements') && tr.getMeta('allowSelectionChangeWhileExpandTitleFocused') === true)) {
89
91
  return false;
90
92
  }
91
93
  return true;
@@ -3,6 +3,7 @@ import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
3
3
  import { expandClassNames } from '@atlaskit/editor-common/styles/expand';
4
4
  import { findExpand, transformSliceExpandToNestedExpand, transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
5
5
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
6
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
6
7
  import { setExpandRef } from '../commands';
7
8
  // Ignored via go/ees005
8
9
  // eslint-disable-next-line import/no-named-as-default
@@ -63,7 +64,8 @@ export var createPlugin = function createPlugin(dispatch, getIntl) {
63
64
  },
64
65
  // @see ED-8027 to follow up on this work-around
65
66
  filterTransaction: function filterTransaction(tr) {
66
- if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric)) {
67
+ // Preserve title editing against selection changes unless explicitly allowed.
68
+ if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric) && !(isExperimentEnabled('platform_editor_remix_reliability_improvements') && tr.getMeta('allowSelectionChangeWhileExpandTitleFocused') === true)) {
67
69
  return false;
68
70
  }
69
71
  return true;
@@ -4,6 +4,7 @@ import { expandClassNames } from '@atlaskit/editor-common/styles/expand';
4
4
  import { transformSliceExpandToNestedExpand, transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
5
5
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
6
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
7
8
  import { TOGGLE_EXPAND_RANGE_META_KEY } from '../../editor-commands/toggleExpandRange';
8
9
  // Ignored via go/ees005
9
10
  // eslint-disable-next-line import/no-named-as-default
@@ -93,7 +94,8 @@ export var createPlugin = function createPlugin(dispatch, getIntl) {
93
94
  },
94
95
  // @see ED-8027 to follow up on this work-around
95
96
  filterTransaction: function filterTransaction(tr) {
96
- if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric)) {
97
+ // Preserve title editing against selection changes unless explicitly allowed.
98
+ if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric) && !(isExperimentEnabled('platform_editor_remix_reliability_improvements') && tr.getMeta('allowSelectionChangeWhileExpandTitleFocused') === true)) {
97
99
  return false;
98
100
  }
99
101
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "31.1.3",
3
+ "version": "31.1.4",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",