@atlaskit/editor-plugin-floating-toolbar 4.1.10 → 4.1.13

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,29 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 4.1.13
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 4.1.12
10
+
11
+ ### Patch Changes
12
+
13
+ - [#160940](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160940)
14
+ [`d63ae1c3f13d9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d63ae1c3f13d9) -
15
+ Hide loading of floating toolbar in SSR environment
16
+ - Updated dependencies
17
+
18
+ ## 4.1.11
19
+
20
+ ### Patch Changes
21
+
22
+ - [#159090](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159090)
23
+ [`9cbae97c20f84`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9cbae97c20f84) -
24
+ Reduces rerenders of text formatting options and the toolbar when it is docked to top.
25
+ - Updated dependencies
26
+
3
27
  ## 4.1.10
4
28
 
5
29
  ### Patch Changes
@@ -14,6 +14,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
  var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
16
16
  var _analytics = require("@atlaskit/editor-common/analytics");
17
+ var _coreUtils = require("@atlaskit/editor-common/core-utils");
17
18
  var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
18
19
  var _hooks = require("@atlaskit/editor-common/hooks");
19
20
  var _providerFactory = require("@atlaskit/editor-common/provider-factory");
@@ -281,6 +282,11 @@ function ContentComponent(_ref5) {
281
282
  isDragging = _useSharedState.isDragging,
282
283
  isMenuOpen = _useSharedState.isMenuOpen,
283
284
  mode = _useSharedState.mode;
285
+ if ((0, _coreUtils.isSSR)() && (0, _experiments.editorExperiment)('platform_editor_hide_floating_toolbar_in_ssr', true, {
286
+ exposure: true
287
+ })) {
288
+ return null;
289
+ }
284
290
  if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
285
291
  return null;
286
292
  }
@@ -571,6 +571,10 @@ var Toolbar = /*#__PURE__*/function (_Component) {
571
571
  event.stopPropagation();
572
572
  event.preventDefault();
573
573
  });
574
+ (0, _defineProperty2.default)(_this, "isShortcutToFocusToolbar", function (event) {
575
+ //Alt + F10 to reach first element in this floating toolbar
576
+ return event.altKey && (event.key === 'F10' || event.keyCode === 121);
577
+ });
574
578
  _this.scrollContainerRef = /*#__PURE__*/_react.default.createRef();
575
579
  _this.mountRef = /*#__PURE__*/_react.default.createRef();
576
580
  _this.toolbarContainerRef = /*#__PURE__*/_react.default.createRef();
@@ -699,7 +703,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
699
703
  handleEscape: this.handleEscape,
700
704
  disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
701
705
  childComponentSelector: "[data-testid='editor-floating-toolbar']",
702
- isShortcutToFocusToolbar: isShortcutToFocusToolbar,
706
+ isShortcutToFocusToolbar: (0, _platformFeatureFlags.fg)('platform_editor_toolbar_rerender_optimization') ? this.isShortcutToFocusToolbar : isShortcutToFocusToolbar,
703
707
  intl: intl
704
708
  }, (0, _react2.jsx)("div", {
705
709
  ref: this.toolbarContainerRef,
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import camelCase from 'lodash/camelCase';
3
3
  import { ACTION, ACTION_SUBJECT, CONTENT_COMPONENT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
4
+ import { isSSR } from '@atlaskit/editor-common/core-utils';
4
5
  import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
5
6
  import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
6
7
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
@@ -268,6 +269,11 @@ export function ContentComponent({
268
269
  isMenuOpen,
269
270
  mode
270
271
  } = useSharedState(pluginInjectionApi);
272
+ if (isSSR() && editorExperiment('platform_editor_hide_floating_toolbar_in_ssr', true, {
273
+ exposure: true
274
+ })) {
275
+ return null;
276
+ }
271
277
  if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
272
278
  return null;
273
279
  }
@@ -531,6 +531,10 @@ class Toolbar extends Component {
531
531
  event.stopPropagation();
532
532
  event.preventDefault();
533
533
  });
534
+ _defineProperty(this, "isShortcutToFocusToolbar", event => {
535
+ //Alt + F10 to reach first element in this floating toolbar
536
+ return event.altKey && (event.key === 'F10' || event.keyCode === 121);
537
+ });
534
538
  this.scrollContainerRef = /*#__PURE__*/React.createRef();
535
539
  this.mountRef = /*#__PURE__*/React.createRef();
536
540
  this.toolbarContainerRef = /*#__PURE__*/React.createRef();
@@ -650,7 +654,7 @@ class Toolbar extends Component {
650
654
  handleEscape: this.handleEscape,
651
655
  disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
652
656
  childComponentSelector: "[data-testid='editor-floating-toolbar']",
653
- isShortcutToFocusToolbar: isShortcutToFocusToolbar,
657
+ isShortcutToFocusToolbar: fg('platform_editor_toolbar_rerender_optimization') ? this.isShortcutToFocusToolbar : isShortcutToFocusToolbar,
654
658
  intl: intl
655
659
  }, jsx("div", {
656
660
  ref: this.toolbarContainerRef,
@@ -5,6 +5,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  import React from 'react';
6
6
  import camelCase from 'lodash/camelCase';
7
7
  import { ACTION, ACTION_SUBJECT, CONTENT_COMPONENT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
8
+ import { isSSR } from '@atlaskit/editor-common/core-utils';
8
9
  import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
9
10
  import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
10
11
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
@@ -269,6 +270,11 @@ export function ContentComponent(_ref5) {
269
270
  isDragging = _useSharedState.isDragging,
270
271
  isMenuOpen = _useSharedState.isMenuOpen,
271
272
  mode = _useSharedState.mode;
273
+ if (isSSR() && editorExperiment('platform_editor_hide_floating_toolbar_in_ssr', true, {
274
+ exposure: true
275
+ })) {
276
+ return null;
277
+ }
272
278
  if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
273
279
  return null;
274
280
  }
@@ -564,6 +564,10 @@ var Toolbar = /*#__PURE__*/function (_Component) {
564
564
  event.stopPropagation();
565
565
  event.preventDefault();
566
566
  });
567
+ _defineProperty(_this, "isShortcutToFocusToolbar", function (event) {
568
+ //Alt + F10 to reach first element in this floating toolbar
569
+ return event.altKey && (event.key === 'F10' || event.keyCode === 121);
570
+ });
567
571
  _this.scrollContainerRef = /*#__PURE__*/React.createRef();
568
572
  _this.mountRef = /*#__PURE__*/React.createRef();
569
573
  _this.toolbarContainerRef = /*#__PURE__*/React.createRef();
@@ -692,7 +696,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
692
696
  handleEscape: this.handleEscape,
693
697
  disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
694
698
  childComponentSelector: "[data-testid='editor-floating-toolbar']",
695
- isShortcutToFocusToolbar: isShortcutToFocusToolbar,
699
+ isShortcutToFocusToolbar: fg('platform_editor_toolbar_rerender_optimization') ? this.isShortcutToFocusToolbar : isShortcutToFocusToolbar,
696
700
  intl: intl
697
701
  }, jsx("div", {
698
702
  ref: this.toolbarContainerRef,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "4.1.10",
3
+ "version": "4.1.13",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,7 +28,7 @@
28
28
  "@atlaskit/adf-utils": "^19.20.0",
29
29
  "@atlaskit/button": "^23.2.0",
30
30
  "@atlaskit/checkbox": "^17.1.0",
31
- "@atlaskit/editor-common": "^105.10.0",
31
+ "@atlaskit/editor-common": "^106.0.0",
32
32
  "@atlaskit/editor-palette": "^2.1.0",
33
33
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
34
34
  "@atlaskit/editor-plugin-context-panel": "^4.1.0",
@@ -43,16 +43,16 @@
43
43
  "@atlaskit/editor-plugin-user-intent": "^0.1.0",
44
44
  "@atlaskit/editor-prosemirror": "7.0.0",
45
45
  "@atlaskit/emoji": "^69.2.0",
46
- "@atlaskit/icon": "^26.3.0",
46
+ "@atlaskit/icon": "^26.4.0",
47
47
  "@atlaskit/menu": "^8.0.0",
48
48
  "@atlaskit/modal-dialog": "^14.2.0",
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
50
  "@atlaskit/primitives": "^14.8.0",
51
51
  "@atlaskit/select": "^20.6.0",
52
52
  "@atlaskit/theme": "^18.0.0",
53
- "@atlaskit/tmp-editor-statsig": "^5.0.0",
53
+ "@atlaskit/tmp-editor-statsig": "^5.2.0",
54
54
  "@atlaskit/tokens": "^4.9.0",
55
- "@atlaskit/tooltip": "^20.0.0",
55
+ "@atlaskit/tooltip": "^20.2.0",
56
56
  "@babel/runtime": "^7.0.0",
57
57
  "@emotion/react": "^11.7.1",
58
58
  "bind-event-listener": "^3.0.0",
@@ -154,6 +154,9 @@
154
154
  },
155
155
  "platform_editor_interaction_api_refactor": {
156
156
  "type": "boolean"
157
+ },
158
+ "platform_editor_toolbar_rerender_optimization": {
159
+ "type": "boolean"
157
160
  }
158
161
  }
159
162
  }