@atlaskit/editor-plugin-block-controls 2.13.2 → 2.13.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,14 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 2.13.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`01ef5296f2ad8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/01ef5296f2ad8) -
8
+ ED-25331 Fix jittering after dropping blockquotes by setting cursor at inline end pos instead of
9
+ gap cursor
10
+ - Updated dependencies
11
+
3
12
  ## 2.13.2
4
13
 
5
14
  ### Patch Changes
@@ -7,6 +7,7 @@ exports.setCursorPositionAtMovedNode = exports.selectNode = exports.getSelection
7
7
  var _selection = require("@atlaskit/editor-common/selection");
8
8
  var _state = require("@atlaskit/editor-prosemirror/state");
9
9
  var _utils = require("@atlaskit/editor-tables/utils");
10
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
11
  var getInlineNodePos = exports.getInlineNodePos = function getInlineNodePos(tr, start, nodeSize) {
11
12
  var $startPos = tr.doc.resolve(start);
12
13
  // To trigger the annotation floating toolbar for non-selectable node, we need to select inline nodes
@@ -80,7 +81,8 @@ var setCursorPositionAtMovedNode = exports.setCursorPositionAtMovedNode = functi
80
81
  var nodeSize = node ? node.nodeSize : 1;
81
82
  var selection;
82
83
  // decisionList node is not selectable, but we want to select the whole node not just text
83
- if (isNodeSelection || (node === null || node === void 0 ? void 0 : node.type.name) === 'decisionList') {
84
+ // blockQuote is selectable, but we want to set cursor at the inline end Pos instead of the gap cursor as this causes jittering post drop
85
+ if (isNodeSelection && ((0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_4') ? node.type.name !== 'blockquote' : true) || (node === null || node === void 0 ? void 0 : node.type.name) === 'decisionList') {
84
86
  selection = new _selection.GapCursorSelection(tr.doc.resolve(start + node.nodeSize), _selection.Side.RIGHT);
85
87
  } else {
86
88
  var _getInlineNodePos2 = getInlineNodePos(tr, start, nodeSize),
@@ -1,6 +1,7 @@
1
1
  import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
2
2
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  export const getInlineNodePos = (tr, start, nodeSize) => {
5
6
  const $startPos = tr.doc.resolve(start);
6
7
  // To trigger the annotation floating toolbar for non-selectable node, we need to select inline nodes
@@ -75,7 +76,8 @@ export const setCursorPositionAtMovedNode = (tr, start) => {
75
76
  const nodeSize = node ? node.nodeSize : 1;
76
77
  let selection;
77
78
  // decisionList node is not selectable, but we want to select the whole node not just text
78
- if (isNodeSelection || (node === null || node === void 0 ? void 0 : node.type.name) === 'decisionList') {
79
+ // blockQuote is selectable, but we want to set cursor at the inline end Pos instead of the gap cursor as this causes jittering post drop
80
+ if (isNodeSelection && (fg('platform_editor_element_dnd_nested_fix_patch_4') ? node.type.name !== 'blockquote' : true) || (node === null || node === void 0 ? void 0 : node.type.name) === 'decisionList') {
79
81
  selection = new GapCursorSelection(tr.doc.resolve(start + node.nodeSize), Side.RIGHT);
80
82
  } else {
81
83
  const {
@@ -1,6 +1,7 @@
1
1
  import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
2
2
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  export var getInlineNodePos = function getInlineNodePos(tr, start, nodeSize) {
5
6
  var $startPos = tr.doc.resolve(start);
6
7
  // To trigger the annotation floating toolbar for non-selectable node, we need to select inline nodes
@@ -74,7 +75,8 @@ export var setCursorPositionAtMovedNode = function setCursorPositionAtMovedNode(
74
75
  var nodeSize = node ? node.nodeSize : 1;
75
76
  var selection;
76
77
  // decisionList node is not selectable, but we want to select the whole node not just text
77
- if (isNodeSelection || (node === null || node === void 0 ? void 0 : node.type.name) === 'decisionList') {
78
+ // blockQuote is selectable, but we want to set cursor at the inline end Pos instead of the gap cursor as this causes jittering post drop
79
+ if (isNodeSelection && (fg('platform_editor_element_dnd_nested_fix_patch_4') ? node.type.name !== 'blockquote' : true) || (node === null || node === void 0 ? void 0 : node.type.name) === 'decisionList') {
78
80
  selection = new GapCursorSelection(tr.doc.resolve(start + node.nodeSize), Side.RIGHT);
79
81
  } else {
80
82
  var _getInlineNodePos2 = getInlineNodePos(tr, start, nodeSize),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "2.13.2",
3
+ "version": "2.13.3",
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
  },
32
32
  "dependencies": {
33
33
  "@atlaskit/adf-schema": "^44.2.0",
34
- "@atlaskit/editor-common": "^94.9.0",
34
+ "@atlaskit/editor-common": "^94.10.0",
35
35
  "@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
37
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
@@ -142,6 +142,9 @@
142
142
  "platform_editor_element_dnd_nested_fix_patch_3": {
143
143
  "type": "boolean"
144
144
  },
145
+ "platform_editor_element_dnd_nested_fix_patch_4": {
146
+ "type": "boolean"
147
+ },
145
148
  "platform_editor_element_dnd_nested_type_error_fix": {
146
149
  "type": "boolean"
147
150
  },