@atlaskit/editor-plugin-block-controls 8.0.5 → 8.0.6

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,13 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 8.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`52a4db18c2a6a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/52a4db18c2a6a) -
8
+ EDITOR-4161 Fix drag handle selection collapse in nested scenarios
9
+ - Updated dependencies
10
+
3
11
  ## 8.0.5
4
12
 
5
13
  ### Patch Changes
@@ -463,6 +463,12 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref3) {
463
463
  }
464
464
  }
465
465
  }, [anchorName, nodeType, view.dom]);
466
+ var handleMouseUp = (0, _react.useCallback)(function (e) {
467
+ // Stop propagation so that for drag handles in nested scenarios the click is captured
468
+ // and doesn't propagate to the edge of the element and trigger a node selection
469
+ // on the parent element
470
+ e.stopPropagation();
471
+ }, []);
466
472
  var handleOnClickNew = (0, _react.useCallback)(function (e) {
467
473
  var _api$core;
468
474
  api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref4) {
@@ -1085,6 +1091,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref3) {
1085
1091
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
1086
1092
  ,
1087
1093
  style: !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? (0, _experiments.editorExperiment)('platform_editor_block_control_optimise_render', true) ? positionStyles : positionStylesOld : {},
1094
+ onMouseUp: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) ? handleMouseUp : undefined,
1088
1095
  onClick: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) ? handleOnClickNew : handleOnClick,
1089
1096
  onKeyDown: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) ? handleKeyDownNew : handleKeyDown
1090
1097
  // eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
@@ -441,6 +441,12 @@ export const DragHandle = ({
441
441
  }
442
442
  }
443
443
  }, [anchorName, nodeType, view.dom]);
444
+ const handleMouseUp = useCallback(e => {
445
+ // Stop propagation so that for drag handles in nested scenarios the click is captured
446
+ // and doesn't propagate to the edge of the element and trigger a node selection
447
+ // on the parent element
448
+ e.stopPropagation();
449
+ }, []);
444
450
  const handleOnClickNew = useCallback(e => {
445
451
  var _api$core;
446
452
  api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(({
@@ -1073,6 +1079,7 @@ export const DragHandle = ({
1073
1079
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
1074
1080
  ,
1075
1081
  style: !editorExperiment('platform_editor_controls', 'variant1') ? editorExperiment('platform_editor_block_control_optimise_render', true) ? positionStyles : positionStylesOld : {},
1082
+ onMouseUp: expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) ? handleMouseUp : undefined,
1076
1083
  onClick: expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) ? handleOnClickNew : handleOnClick,
1077
1084
  onKeyDown: expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) ? handleKeyDownNew : handleKeyDown
1078
1085
  // eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
@@ -460,6 +460,12 @@ export var DragHandle = function DragHandle(_ref3) {
460
460
  }
461
461
  }
462
462
  }, [anchorName, nodeType, view.dom]);
463
+ var handleMouseUp = useCallback(function (e) {
464
+ // Stop propagation so that for drag handles in nested scenarios the click is captured
465
+ // and doesn't propagate to the edge of the element and trigger a node selection
466
+ // on the parent element
467
+ e.stopPropagation();
468
+ }, []);
463
469
  var handleOnClickNew = useCallback(function (e) {
464
470
  var _api$core;
465
471
  api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref4) {
@@ -1082,6 +1088,7 @@ export var DragHandle = function DragHandle(_ref3) {
1082
1088
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
1083
1089
  ,
1084
1090
  style: !editorExperiment('platform_editor_controls', 'variant1') ? editorExperiment('platform_editor_block_control_optimise_render', true) ? positionStyles : positionStylesOld : {},
1091
+ onMouseUp: expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) ? handleMouseUp : undefined,
1085
1092
  onClick: expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) ? handleOnClickNew : handleOnClick,
1086
1093
  onKeyDown: expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) ? handleKeyDownNew : handleKeyDown
1087
1094
  // eslint-disable-next-line @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "8.0.5",
3
+ "version": "8.0.6",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",