@atlaskit/editor-plugin-block-controls 1.12.5 → 1.12.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
+ ## 1.12.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#135137](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135137)
8
+ [`c1cc86c3c898f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c1cc86c3c898f) -
9
+ [ux] Fix bug where drag handles may be missing
10
+
3
11
  ## 1.12.5
4
12
 
5
13
  ### Patch Changes
@@ -28,7 +28,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
28
28
  if (['wrap-right', 'wrap-left'].includes(rootElement.getAttribute('layout') || '') && (0, _platformFeatureFlags.fg)('platform_editor_element_drag_and_drop_ed_24227')) {
29
29
  return false;
30
30
  }
31
- var pos = view.posAtDOM(rootElement, 0, 0);
31
+ var pos = view.posAtDOM(rootElement, 0, -1);
32
32
  var rootPos;
33
33
  if ((0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_nested')) {
34
34
  var _$rootPos$parent, _$rootPos$parent2, _$rootPos$nodeAfter;
@@ -187,7 +187,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl) {
187
187
  decorations = decorations.remove(oldNodeDecs);
188
188
  newNodeDecs = (_newNodeDecs = newNodeDecs) !== null && _newNodeDecs !== void 0 ? _newNodeDecs : (0, _decorations.nodeDecorations)(newState);
189
189
  decorations = decorations.add(newState.doc, (0, _toConsumableArray2.default)(newNodeDecs));
190
- if (activeNode && !isDecsMissing) {
190
+ if (activeNode && !(meta !== null && meta !== void 0 && meta.nodeMoved) && !isDecsMissing) {
191
191
  var mappedPosisiton = tr.mapping.map(activeNode.pos);
192
192
  var prevMappedPos = oldState.tr.mapping.map(activeNode.pos);
193
193
 
@@ -23,7 +23,7 @@ export const handleMouseOver = (view, event, api) => {
23
23
  if (['wrap-right', 'wrap-left'].includes(rootElement.getAttribute('layout') || '') && fg('platform_editor_element_drag_and_drop_ed_24227')) {
24
24
  return false;
25
25
  }
26
- const pos = view.posAtDOM(rootElement, 0, 0);
26
+ const pos = view.posAtDOM(rootElement, 0, -1);
27
27
  let rootPos;
28
28
  if (fg('platform_editor_elements_dnd_nested')) {
29
29
  var _$rootPos$parent, _$rootPos$parent2, _$rootPos$nodeAfter;
@@ -176,7 +176,7 @@ export const createPlugin = (api, getIntl) => {
176
176
  decorations = decorations.remove(oldNodeDecs);
177
177
  newNodeDecs = (_newNodeDecs = newNodeDecs) !== null && _newNodeDecs !== void 0 ? _newNodeDecs : nodeDecorations(newState);
178
178
  decorations = decorations.add(newState.doc, [...newNodeDecs]);
179
- if (activeNode && !isDecsMissing) {
179
+ if (activeNode && !(meta !== null && meta !== void 0 && meta.nodeMoved) && !isDecsMissing) {
180
180
  let mappedPosisiton = tr.mapping.map(activeNode.pos);
181
181
  const prevMappedPos = oldState.tr.mapping.map(activeNode.pos);
182
182
 
@@ -22,7 +22,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
22
22
  if (['wrap-right', 'wrap-left'].includes(rootElement.getAttribute('layout') || '') && fg('platform_editor_element_drag_and_drop_ed_24227')) {
23
23
  return false;
24
24
  }
25
- var pos = view.posAtDOM(rootElement, 0, 0);
25
+ var pos = view.posAtDOM(rootElement, 0, -1);
26
26
  var rootPos;
27
27
  if (fg('platform_editor_elements_dnd_nested')) {
28
28
  var _$rootPos$parent, _$rootPos$parent2, _$rootPos$nodeAfter;
@@ -180,7 +180,7 @@ export var createPlugin = function createPlugin(api, getIntl) {
180
180
  decorations = decorations.remove(oldNodeDecs);
181
181
  newNodeDecs = (_newNodeDecs = newNodeDecs) !== null && _newNodeDecs !== void 0 ? _newNodeDecs : nodeDecorations(newState);
182
182
  decorations = decorations.add(newState.doc, _toConsumableArray(newNodeDecs));
183
- if (activeNode && !isDecsMissing) {
183
+ if (activeNode && !(meta !== null && meta !== void 0 && meta.nodeMoved) && !isDecsMissing) {
184
184
  var mappedPosisiton = tr.mapping.map(activeNode.pos);
185
185
  var prevMappedPos = oldState.tr.mapping.map(activeNode.pos);
186
186
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "1.12.5",
3
+ "version": "1.12.6",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/editor-common": "^88.2.0",
34
+ "@atlaskit/editor-common": "^88.4.0",
35
35
  "@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
37
37
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",