@atlaskit/editor-plugin-selection-toolbar 20.0.0 → 20.0.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,19 @@
1
1
  # @atlaskit/editor-plugin-selection-toolbar
2
2
 
3
+ ## 20.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 20.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8d37dc7e55d62`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d37dc7e55d62) -
14
+ Clean up shipped experiment `platform_editor_block_menu`
15
+ - Updated dependencies
16
+
3
17
  ## 20.0.0
4
18
 
5
19
  ### Patch Changes
@@ -153,18 +153,16 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
153
153
  };
154
154
  },
155
155
  apply: function apply(tr, pluginState) {
156
+ var _api$userIntent;
156
157
  var meta = tr.getMeta(_pluginKey.selectionToolbarPluginKey);
157
158
  var newPluginState = pluginState;
158
159
  if (meta) {
159
160
  return _objectSpread(_objectSpread({}, newPluginState), meta);
160
161
  }
161
- if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
162
- var _api$userIntent;
163
- var isBlockMenuOpen = (api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent) === 'blockMenuOpen';
164
- newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
165
- isBlockMenuOpen: isBlockMenuOpen
166
- });
167
- }
162
+ var isBlockMenuOpen = (api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent) === 'blockMenuOpen';
163
+ newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
164
+ isBlockMenuOpen: isBlockMenuOpen
165
+ });
168
166
 
169
167
  // if the toolbarDockingInitialPosition preference has changed
170
168
  // update the toolbarDocking state
@@ -262,7 +260,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
262
260
  return;
263
261
  }
264
262
  }
265
- if (isBlockMenuOpen && isEditorControlsEnabled && (0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
263
+ if (isBlockMenuOpen && isEditorControlsEnabled) {
266
264
  // If the block menu is open, do not show the selection toolbar.
267
265
  return;
268
266
  }
@@ -1,2 +1,3 @@
1
1
  /* eslint-disable @atlaskit/editor/no-re-export */
2
+
2
3
  export { selectionToolbarPlugin } from '../selectionToolbarPlugin';
@@ -146,6 +146,7 @@ export const selectionToolbarPlugin = ({
146
146
  };
147
147
  },
148
148
  apply(tr, pluginState) {
149
+ var _api$userIntent, _api$userIntent$share;
149
150
  const meta = tr.getMeta(selectionToolbarPluginKey);
150
151
  let newPluginState = pluginState;
151
152
  if (meta) {
@@ -154,14 +155,11 @@ export const selectionToolbarPlugin = ({
154
155
  ...meta
155
156
  };
156
157
  }
157
- if (editorExperiment('platform_editor_block_menu', true)) {
158
- var _api$userIntent, _api$userIntent$share;
159
- const isBlockMenuOpen = (api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : (_api$userIntent$share = _api$userIntent.sharedState.currentState()) === null || _api$userIntent$share === void 0 ? void 0 : _api$userIntent$share.currentUserIntent) === 'blockMenuOpen';
160
- newPluginState = {
161
- ...newPluginState,
162
- isBlockMenuOpen
163
- };
164
- }
158
+ const isBlockMenuOpen = (api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : (_api$userIntent$share = _api$userIntent.sharedState.currentState()) === null || _api$userIntent$share === void 0 ? void 0 : _api$userIntent$share.currentUserIntent) === 'blockMenuOpen';
159
+ newPluginState = {
160
+ ...newPluginState,
161
+ isBlockMenuOpen
162
+ };
165
163
 
166
164
  // if the toolbarDockingInitialPosition preference has changed
167
165
  // update the toolbarDocking state
@@ -261,7 +259,7 @@ export const selectionToolbarPlugin = ({
261
259
  return;
262
260
  }
263
261
  }
264
- if (isBlockMenuOpen && isEditorControlsEnabled && editorExperiment('platform_editor_block_menu', true)) {
262
+ if (isBlockMenuOpen && isEditorControlsEnabled) {
265
263
  // If the block menu is open, do not show the selection toolbar.
266
264
  return;
267
265
  }
@@ -1,2 +1,3 @@
1
1
  /* eslint-disable @atlaskit/editor/no-re-export */
2
+
2
3
  export { selectionToolbarPlugin } from '../selectionToolbarPlugin';
@@ -146,18 +146,16 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
146
146
  };
147
147
  },
148
148
  apply: function apply(tr, pluginState) {
149
+ var _api$userIntent;
149
150
  var meta = tr.getMeta(selectionToolbarPluginKey);
150
151
  var newPluginState = pluginState;
151
152
  if (meta) {
152
153
  return _objectSpread(_objectSpread({}, newPluginState), meta);
153
154
  }
154
- if (editorExperiment('platform_editor_block_menu', true)) {
155
- var _api$userIntent;
156
- var isBlockMenuOpen = (api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent) === 'blockMenuOpen';
157
- newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
158
- isBlockMenuOpen: isBlockMenuOpen
159
- });
160
- }
155
+ var isBlockMenuOpen = (api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent) === 'blockMenuOpen';
156
+ newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
157
+ isBlockMenuOpen: isBlockMenuOpen
158
+ });
161
159
 
162
160
  // if the toolbarDockingInitialPosition preference has changed
163
161
  // update the toolbarDocking state
@@ -255,7 +253,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
255
253
  return;
256
254
  }
257
255
  }
258
- if (isBlockMenuOpen && isEditorControlsEnabled && editorExperiment('platform_editor_block_menu', true)) {
256
+ if (isBlockMenuOpen && isEditorControlsEnabled) {
259
257
  // If the block menu is open, do not show the selection toolbar.
260
258
  return;
261
259
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "20.0.0",
3
+ "version": "20.0.2",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,19 +36,19 @@
36
36
  "@atlaskit/editor-plugin-user-intent": "^17.0.0",
37
37
  "@atlaskit/editor-plugin-user-preferences": "^17.0.0",
38
38
  "@atlaskit/editor-prosemirror": "^9.0.0",
39
- "@atlaskit/editor-toolbar": "^2.6.0",
39
+ "@atlaskit/editor-toolbar": "^2.7.0",
40
40
  "@atlaskit/editor-toolbar-model": "^1.2.0",
41
41
  "@atlaskit/icon": "^37.7.0",
42
42
  "@atlaskit/icon-lab": "^7.9.0",
43
43
  "@atlaskit/menu": "^11.0.0",
44
44
  "@atlaskit/platform-feature-flags": "^2.2.0",
45
- "@atlaskit/tmp-editor-statsig": "^199.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^201.0.0",
46
46
  "@atlaskit/tokens": "^18.2.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "bind-event-listener": "^3.0.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "@atlaskit/editor-common": "^123.0.0",
51
+ "@atlaskit/editor-common": "^123.2.0",
52
52
  "react": "^18.2.0 || ^19.2.0",
53
53
  "react-dom": "^18.2.0 || ^19.2.0",
54
54
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"