@atlaskit/editor-plugin-floating-toolbar 3.2.4 → 3.2.5

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-floating-toolbar
2
2
 
3
+ ## 3.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#128611](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128611)
8
+ [`428548761fab9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/428548761fab9) -
9
+ [ux] ED-27133 fix toolbar link button
10
+ - Updated dependencies
11
+
3
12
  ## 3.2.4
4
13
 
5
14
  ### Patch Changes
@@ -545,8 +545,14 @@ var Toolbar = /*#__PURE__*/function (_Component) {
545
545
  event.preventDefault();
546
546
  event.stopPropagation();
547
547
  });
548
- (0, _defineProperty2.default)(_this, "handleMouseDown", function (event) {
549
- // Prevents selection toolbar from closing when clicking on the toolbar
548
+ (0, _defineProperty2.default)(_this, "captureMouseEvent", function (event) {
549
+ var _this$props$items2;
550
+ // Don't capture mouse event for custom toolbars e.g. insert hyperlink
551
+ if (((_this$props$items2 = _this.props.items) === null || _this$props$items2 === void 0 ? void 0 : _this$props$items2.length) === 1 && _this.props.items[0].type === 'custom') {
552
+ return;
553
+ }
554
+
555
+ // Prevents toolbar from closing when clicking on the toolbar itself and not on the buttons
550
556
  event.stopPropagation();
551
557
  event.preventDefault();
552
558
  });
@@ -666,7 +672,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
666
672
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
667
673
  ,
668
674
  className: className,
669
- onMouseDown: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? this.handleMouseDown : undefined
675
+ onMouseDown: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? this.captureMouseEvent : undefined
670
676
  }, (0, _react2.jsx)(_ui.Announcer, {
671
677
  text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer)) : intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer),
672
678
  delay: 250
@@ -505,8 +505,14 @@ class Toolbar extends Component {
505
505
  event.preventDefault();
506
506
  event.stopPropagation();
507
507
  });
508
- _defineProperty(this, "handleMouseDown", event => {
509
- // Prevents selection toolbar from closing when clicking on the toolbar
508
+ _defineProperty(this, "captureMouseEvent", event => {
509
+ var _this$props$items2;
510
+ // Don't capture mouse event for custom toolbars e.g. insert hyperlink
511
+ if (((_this$props$items2 = this.props.items) === null || _this$props$items2 === void 0 ? void 0 : _this$props$items2.length) === 1 && this.props.items[0].type === 'custom') {
512
+ return;
513
+ }
514
+
515
+ // Prevents toolbar from closing when clicking on the toolbar itself and not on the buttons
510
516
  event.stopPropagation();
511
517
  event.preventDefault();
512
518
  });
@@ -616,7 +622,7 @@ class Toolbar extends Component {
616
622
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
617
623
  ,
618
624
  className: className,
619
- onMouseDown: editorExperiment('platform_editor_controls', 'variant1') ? this.handleMouseDown : undefined
625
+ onMouseDown: editorExperiment('platform_editor_controls', 'variant1') ? this.captureMouseEvent : undefined
620
626
  }, jsx(Announcer, {
621
627
  text: mediaAssistiveMessage ? `${mediaAssistiveMessage}, ${intl.formatMessage(messages.floatingToolbarAnnouncer)}` : intl.formatMessage(messages.floatingToolbarAnnouncer),
622
628
  delay: 250
@@ -538,8 +538,14 @@ var Toolbar = /*#__PURE__*/function (_Component) {
538
538
  event.preventDefault();
539
539
  event.stopPropagation();
540
540
  });
541
- _defineProperty(_this, "handleMouseDown", function (event) {
542
- // Prevents selection toolbar from closing when clicking on the toolbar
541
+ _defineProperty(_this, "captureMouseEvent", function (event) {
542
+ var _this$props$items2;
543
+ // Don't capture mouse event for custom toolbars e.g. insert hyperlink
544
+ if (((_this$props$items2 = _this.props.items) === null || _this$props$items2 === void 0 ? void 0 : _this$props$items2.length) === 1 && _this.props.items[0].type === 'custom') {
545
+ return;
546
+ }
547
+
548
+ // Prevents toolbar from closing when clicking on the toolbar itself and not on the buttons
543
549
  event.stopPropagation();
544
550
  event.preventDefault();
545
551
  });
@@ -659,7 +665,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
659
665
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
660
666
  ,
661
667
  className: className,
662
- onMouseDown: editorExperiment('platform_editor_controls', 'variant1') ? this.handleMouseDown : undefined
668
+ onMouseDown: editorExperiment('platform_editor_controls', 'variant1') ? this.captureMouseEvent : undefined
663
669
  }, jsx(Announcer, {
664
670
  text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(messages.floatingToolbarAnnouncer)) : intl.formatMessage(messages.floatingToolbarAnnouncer),
665
671
  delay: 250
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "3.2.4",
3
+ "version": "3.2.5",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",