@atlaskit/editor-plugin-block-controls 7.6.0 → 7.7.0

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,16 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 7.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`1bfde822534e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1bfde822534e5) -
8
+ EDITOR-2749 fix drag and drop issue in bodied sync block
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 7.6.0
4
15
 
5
16
  ### Minor Changes
@@ -18,12 +18,16 @@ var _validation = require("./utils/validation");
18
18
  * List of parent node types that can have child nodes
19
19
  */
20
20
  var PARENT_WITH_END_DROP_TARGET = ['tableCell', 'tableHeader', 'panel', 'layoutColumn', 'expand', 'nestedExpand', 'bodiedExtension'];
21
+ var PARENT_WITH_END_DROP_TARGET_SYNC_BLOCK = [].concat(PARENT_WITH_END_DROP_TARGET, ['bodiedSyncBlock']);
21
22
 
22
23
  /**
23
24
  * List of node types that does not allow drop targets at before or after the node.
24
25
  */
25
26
  var NODE_WITH_NO_PARENT_POS = ['tableCell', 'tableHeader', 'layoutColumn'];
26
27
  var isContainerNode = function isContainerNode(node) {
28
+ if ((0, _expValEquals.expValEquals)('platform_synced_block', 'isEnabled', true)) {
29
+ return PARENT_WITH_END_DROP_TARGET_SYNC_BLOCK.includes(node.type.name);
30
+ }
27
31
  return PARENT_WITH_END_DROP_TARGET.includes(node.type.name);
28
32
  };
29
33
  var canMoveNodeOrSliceToPos = exports.canMoveNodeOrSliceToPos = function canMoveNodeOrSliceToPos(state, node, parent, index, $toPos, activeNode) {
@@ -493,7 +493,7 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
493
493
  if (api) {
494
494
  if ((0, _expValEquals.expValEquals)('platform_editor_block_controls_perf_optimization', 'isEnabled', true)) {
495
495
  // If page is updated while dragging (likely by remote updates), we simply remove the drop targets
496
- // and add them back when the use interacts with the editor again
496
+ // and add them back when the user interacts with the editor again
497
497
  if (isDropTargetsMissing) {
498
498
  var oldDropTargetDecs = (0, _decorationsDropTarget.findDropTargetDecs)(decorations);
499
499
  decorations = decorations.remove(oldDropTargetDecs);
@@ -13,12 +13,16 @@ import { canMoveNodeToIndex, canMoveSliceToIndex, isInSameLayout } from './utils
13
13
  * List of parent node types that can have child nodes
14
14
  */
15
15
  const PARENT_WITH_END_DROP_TARGET = ['tableCell', 'tableHeader', 'panel', 'layoutColumn', 'expand', 'nestedExpand', 'bodiedExtension'];
16
+ const PARENT_WITH_END_DROP_TARGET_SYNC_BLOCK = [...PARENT_WITH_END_DROP_TARGET, 'bodiedSyncBlock'];
16
17
 
17
18
  /**
18
19
  * List of node types that does not allow drop targets at before or after the node.
19
20
  */
20
21
  const NODE_WITH_NO_PARENT_POS = ['tableCell', 'tableHeader', 'layoutColumn'];
21
22
  const isContainerNode = node => {
23
+ if (expValEquals('platform_synced_block', 'isEnabled', true)) {
24
+ return PARENT_WITH_END_DROP_TARGET_SYNC_BLOCK.includes(node.type.name);
25
+ }
22
26
  return PARENT_WITH_END_DROP_TARGET.includes(node.type.name);
23
27
  };
24
28
  export const canMoveNodeOrSliceToPos = (state, node, parent, index, $toPos, activeNode) => {
@@ -490,7 +490,7 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
490
490
  if (api) {
491
491
  if (expValEquals('platform_editor_block_controls_perf_optimization', 'isEnabled', true)) {
492
492
  // If page is updated while dragging (likely by remote updates), we simply remove the drop targets
493
- // and add them back when the use interacts with the editor again
493
+ // and add them back when the user interacts with the editor again
494
494
  if (isDropTargetsMissing) {
495
495
  const oldDropTargetDecs = findDropTargetDecs(decorations);
496
496
  decorations = decorations.remove(oldDropTargetDecs);
@@ -13,12 +13,16 @@ import { canMoveNodeToIndex, canMoveSliceToIndex, isInSameLayout } from './utils
13
13
  * List of parent node types that can have child nodes
14
14
  */
15
15
  var PARENT_WITH_END_DROP_TARGET = ['tableCell', 'tableHeader', 'panel', 'layoutColumn', 'expand', 'nestedExpand', 'bodiedExtension'];
16
+ var PARENT_WITH_END_DROP_TARGET_SYNC_BLOCK = [].concat(PARENT_WITH_END_DROP_TARGET, ['bodiedSyncBlock']);
16
17
 
17
18
  /**
18
19
  * List of node types that does not allow drop targets at before or after the node.
19
20
  */
20
21
  var NODE_WITH_NO_PARENT_POS = ['tableCell', 'tableHeader', 'layoutColumn'];
21
22
  var isContainerNode = function isContainerNode(node) {
23
+ if (expValEquals('platform_synced_block', 'isEnabled', true)) {
24
+ return PARENT_WITH_END_DROP_TARGET_SYNC_BLOCK.includes(node.type.name);
25
+ }
22
26
  return PARENT_WITH_END_DROP_TARGET.includes(node.type.name);
23
27
  };
24
28
  export var canMoveNodeOrSliceToPos = function canMoveNodeOrSliceToPos(state, node, parent, index, $toPos, activeNode) {
@@ -486,7 +486,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
486
486
  if (api) {
487
487
  if (expValEquals('platform_editor_block_controls_perf_optimization', 'isEnabled', true)) {
488
488
  // If page is updated while dragging (likely by remote updates), we simply remove the drop targets
489
- // and add them back when the use interacts with the editor again
489
+ // and add them back when the user interacts with the editor again
490
490
  if (isDropTargetsMissing) {
491
491
  var oldDropTargetDecs = findDropTargetDecs(decorations);
492
492
  decorations = decorations.remove(oldDropTargetDecs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "7.6.0",
3
+ "version": "7.7.0",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -55,7 +55,7 @@
55
55
  "@atlaskit/theme": "^21.0.0",
56
56
  "@atlaskit/tmp-editor-statsig": "^13.38.0",
57
57
  "@atlaskit/tokens": "^8.0.0",
58
- "@atlaskit/tooltip": "^20.8.0",
58
+ "@atlaskit/tooltip": "^20.9.0",
59
59
  "@babel/runtime": "^7.0.0",
60
60
  "@emotion/react": "^11.7.1",
61
61
  "@popperjs/core": "^2.11.8",
@@ -65,7 +65,7 @@
65
65
  "uuid": "^3.1.0"
66
66
  },
67
67
  "peerDependencies": {
68
- "@atlaskit/editor-common": "^110.30.0",
68
+ "@atlaskit/editor-common": "^110.31.0",
69
69
  "react": "^18.2.0",
70
70
  "react-dom": "^18.2.0",
71
71
  "react-intl-next": "npm:react-intl@^5.18.1"