@atlaskit/editor-plugin-toolbar 7.3.0 → 7.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,10 +1,19 @@
1
1
  # @atlaskit/editor-plugin-toolbar
2
2
 
3
+ ## 7.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a4948eba59865`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a4948eba59865) -
8
+ Editor-5610: Fix domMutationTargetNotFound failure going up, so "Toolbars reliably open" error
9
+ budget does not keep burning down
10
+ - Updated dependencies
11
+
3
12
  ## 7.3.0
4
13
 
5
14
  ### Minor Changes
6
15
 
7
- - [`41168b2bd2790`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/41168b2bd2790) -
16
+ - [`ebab8f80bfc40`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ebab8f80bfc40) -
8
17
  Autofix: add explicit package exports (barrel removal)
9
18
 
10
19
  ### Patch Changes
@@ -88,6 +88,10 @@ var getSelectionToolbarOpenExperiencePlugin = exports.getSelectionToolbarOpenExp
88
88
  return true;
89
89
  }
90
90
  var target = getTarget();
91
+ if (!target && (0, _platformFeatureFlags.fg)('platform_editor_toolbar_open_experience_fix_2')) {
92
+ // when target is not found, skip the experience start
93
+ return true;
94
+ }
91
95
  return isSelectionToolbarWithinNode(target) || isBlockMenuWithinNode(target) && (0, _platformFeatureFlags.fg)('platform_editor_toolbar_open_experience_fix');
92
96
  };
93
97
  return new _safePlugin.SafePlugin({
@@ -102,7 +106,8 @@ var getSelectionToolbarOpenExperiencePlugin = exports.getSelectionToolbarOpenExp
102
106
  reason: ABORT_REASON.SELECTION_CLEARED
103
107
  });
104
108
  }
105
- if (shiftArrowKeyPressed && !newState.selection.eq(oldState.selection) && !isSelectionWithoutTextContent(newState.selection)) {
109
+ var shouldStartExperience = (0, _platformFeatureFlags.fg)('platform_editor_toolbar_open_experience_fix_2') ? shiftArrowKeyPressed && !newState.selection.eq(oldState.selection) && !shouldSkipExperienceStart(newState.selection) : shiftArrowKeyPressed && !newState.selection.eq(oldState.selection) && !isSelectionWithoutTextContent(newState.selection);
110
+ if (shouldStartExperience) {
106
111
  experience.start({
107
112
  method: START_METHOD.KEY_DOWN
108
113
  });
@@ -81,6 +81,10 @@ export const getSelectionToolbarOpenExperiencePlugin = ({
81
81
  return true;
82
82
  }
83
83
  const target = getTarget();
84
+ if (!target && fg('platform_editor_toolbar_open_experience_fix_2')) {
85
+ // when target is not found, skip the experience start
86
+ return true;
87
+ }
84
88
  return isSelectionToolbarWithinNode(target) || isBlockMenuWithinNode(target) && fg('platform_editor_toolbar_open_experience_fix');
85
89
  };
86
90
  return new SafePlugin({
@@ -93,7 +97,8 @@ export const getSelectionToolbarOpenExperiencePlugin = ({
93
97
  reason: ABORT_REASON.SELECTION_CLEARED
94
98
  });
95
99
  }
96
- if (shiftArrowKeyPressed && !newState.selection.eq(oldState.selection) && !isSelectionWithoutTextContent(newState.selection)) {
100
+ const shouldStartExperience = fg('platform_editor_toolbar_open_experience_fix_2') ? shiftArrowKeyPressed && !newState.selection.eq(oldState.selection) && !shouldSkipExperienceStart(newState.selection) : shiftArrowKeyPressed && !newState.selection.eq(oldState.selection) && !isSelectionWithoutTextContent(newState.selection);
101
+ if (shouldStartExperience) {
97
102
  experience.start({
98
103
  method: START_METHOD.KEY_DOWN
99
104
  });
@@ -81,6 +81,10 @@ export var getSelectionToolbarOpenExperiencePlugin = function getSelectionToolba
81
81
  return true;
82
82
  }
83
83
  var target = getTarget();
84
+ if (!target && fg('platform_editor_toolbar_open_experience_fix_2')) {
85
+ // when target is not found, skip the experience start
86
+ return true;
87
+ }
84
88
  return isSelectionToolbarWithinNode(target) || isBlockMenuWithinNode(target) && fg('platform_editor_toolbar_open_experience_fix');
85
89
  };
86
90
  return new SafePlugin({
@@ -95,7 +99,8 @@ export var getSelectionToolbarOpenExperiencePlugin = function getSelectionToolba
95
99
  reason: ABORT_REASON.SELECTION_CLEARED
96
100
  });
97
101
  }
98
- if (shiftArrowKeyPressed && !newState.selection.eq(oldState.selection) && !isSelectionWithoutTextContent(newState.selection)) {
102
+ var shouldStartExperience = fg('platform_editor_toolbar_open_experience_fix_2') ? shiftArrowKeyPressed && !newState.selection.eq(oldState.selection) && !shouldSkipExperienceStart(newState.selection) : shiftArrowKeyPressed && !newState.selection.eq(oldState.selection) && !isSelectionWithoutTextContent(newState.selection);
103
+ if (shouldStartExperience) {
99
104
  experience.start({
100
105
  method: START_METHOD.KEY_DOWN
101
106
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-toolbar",
3
- "version": "7.3.0",
3
+ "version": "7.3.1",
4
4
  "description": "Toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,10 +37,10 @@
37
37
  "@atlaskit/editor-plugin-user-preferences": "^8.2.0",
38
38
  "@atlaskit/editor-prosemirror": "^7.3.0",
39
39
  "@atlaskit/editor-shared-styles": "^3.10.0",
40
- "@atlaskit/editor-toolbar": "^1.2.0",
40
+ "@atlaskit/editor-toolbar": "^1.3.0",
41
41
  "@atlaskit/editor-toolbar-model": "^0.4.0",
42
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
43
- "@atlaskit/tmp-editor-statsig": "^80.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^80.1.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "bind-event-listener": "^3.0.0"
46
46
  },
@@ -61,6 +61,9 @@
61
61
  },
62
62
  "platform_editor_toolbar_open_experience_fix": {
63
63
  "type": "boolean"
64
+ },
65
+ "platform_editor_toolbar_open_experience_fix_2": {
66
+ "type": "boolean"
64
67
  }
65
68
  },
66
69
  "techstack": {