@atlaskit/editor-plugin-toolbar 27.0.2 → 27.0.3

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,12 @@
1
1
  # @atlaskit/editor-plugin-toolbar
2
2
 
3
+ ## 27.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d6e1bd578152`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9d6e1bd578152) -
8
+ Reduce redundant toolbar focus dispatches behind platform_editor_improve_inp
9
+
3
10
  ## 27.0.2
4
11
 
5
12
  ### Patch Changes
@@ -233,11 +233,15 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
233
233
  var unbindEditorViewFocus = (0, _bindEventListener.bind)(_view.dom, {
234
234
  type: 'focus',
235
235
  listener: function listener() {
236
+ var _editorToolbarPluginK;
236
237
  // On first page load, focus fires after mousedown — skip to
237
238
  // avoid showing the toolbar mid-drag
238
239
  if (mouseState.isMouseDown) {
239
240
  return;
240
241
  }
242
+ if ((_editorToolbarPluginK = _pluginKey.editorToolbarPluginKey.getState(_view.state)) !== null && _editorToolbarPluginK !== void 0 && _editorToolbarPluginK.shouldShowToolbar && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_improve_inp')) {
243
+ return;
244
+ }
241
245
  _view.dispatch(_view.state.tr.setMeta(_pluginKey.editorToolbarPluginKey, {
242
246
  shouldShowToolbar: true
243
247
  }));
@@ -225,11 +225,15 @@ export const toolbarPlugin = ({
225
225
  const unbindEditorViewFocus = bind(view.dom, {
226
226
  type: 'focus',
227
227
  listener: () => {
228
+ var _editorToolbarPluginK;
228
229
  // On first page load, focus fires after mousedown — skip to
229
230
  // avoid showing the toolbar mid-drag
230
231
  if (mouseState.isMouseDown) {
231
232
  return;
232
233
  }
234
+ if ((_editorToolbarPluginK = editorToolbarPluginKey.getState(view.state)) !== null && _editorToolbarPluginK !== void 0 && _editorToolbarPluginK.shouldShowToolbar && isExperimentEnabled('platform_editor_improve_inp')) {
235
+ return;
236
+ }
233
237
  view.dispatch(view.state.tr.setMeta(editorToolbarPluginKey, {
234
238
  shouldShowToolbar: true
235
239
  }));
@@ -226,11 +226,15 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
226
226
  var unbindEditorViewFocus = bind(_view.dom, {
227
227
  type: 'focus',
228
228
  listener: function listener() {
229
+ var _editorToolbarPluginK;
229
230
  // On first page load, focus fires after mousedown — skip to
230
231
  // avoid showing the toolbar mid-drag
231
232
  if (mouseState.isMouseDown) {
232
233
  return;
233
234
  }
235
+ if ((_editorToolbarPluginK = editorToolbarPluginKey.getState(_view.state)) !== null && _editorToolbarPluginK !== void 0 && _editorToolbarPluginK.shouldShowToolbar && isExperimentEnabled('platform_editor_improve_inp')) {
236
+ return;
237
+ }
234
238
  _view.dispatch(_view.state.tr.setMeta(editorToolbarPluginKey, {
235
239
  shouldShowToolbar: true
236
240
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-toolbar",
3
- "version": "27.0.2",
3
+ "version": "27.0.3",
4
4
  "description": "Toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",