@atlaskit/editor-plugin-block-controls 7.5.10 → 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,23 @@
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
+
14
+ ## 7.6.0
15
+
16
+ ### Minor Changes
17
+
18
+ - [`a68556d4ce662`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a68556d4ce662) -
19
+ [ux] Stop flickering on synced blocks as first child + expands as f irst child in synced blocks
20
+
3
21
  ## 7.5.10
4
22
 
5
23
  ### Patch 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);
@@ -231,7 +231,7 @@ var globalDnDStyle = (0, _react.css)({
231
231
  var globalStyles = function globalStyles() {
232
232
  return (0, _react.css)({
233
233
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
234
- '.ProseMirror-widget:first-child + *:not([data-panel-type], .code-block, [data-node-type="nestedExpand"], [data-layout-section="true"])': {
234
+ '.ProseMirror-widget:first-child + *:not([data-panel-type], .code-block, [data-node-type="nestedExpand"], [data-node-type="expand"], [data-layout-section="true"], [data-prosemirror-node-name="bodiedSyncBlock"])': {
235
235
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
236
236
  marginTop: '0 !important'
237
237
  }
@@ -324,7 +324,7 @@ var topLevelNodeMarginStyles = (0, _react.css)({
324
324
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
325
325
  '.ProseMirror': {
326
326
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
327
- '> .ProseMirror-widget:first-child + .ProseMirror-gapcursor + *:not([data-layout-section="true"]), > .ProseMirror-widget:first-child + *:not([data-layout-section="true"])': {
327
+ '> .ProseMirror-widget:first-child + .ProseMirror-gapcursor + *:not([data-layout-section="true"], [data-prosemirror-node-name="bodiedSyncBlock"]), > .ProseMirror-widget:first-child + *:not([data-layout-section="true"], [data-prosemirror-node-name="bodiedSyncBlock"])': {
328
328
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
329
329
  marginTop: '0 !important'
330
330
  }
@@ -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);
@@ -284,7 +284,7 @@ const globalDnDStyle = css({
284
284
  });
285
285
  const globalStyles = () => css({
286
286
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
287
- '.ProseMirror-widget:first-child + *:not([data-panel-type], .code-block, [data-node-type="nestedExpand"], [data-layout-section="true"])': {
287
+ '.ProseMirror-widget:first-child + *:not([data-panel-type], .code-block, [data-node-type="nestedExpand"], [data-node-type="expand"], [data-layout-section="true"], [data-prosemirror-node-name="bodiedSyncBlock"])': {
288
288
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
289
289
  marginTop: '0 !important'
290
290
  }
@@ -374,7 +374,7 @@ const topLevelNodeMarginStyles = css({
374
374
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
375
375
  '.ProseMirror': {
376
376
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
377
- '> .ProseMirror-widget:first-child + .ProseMirror-gapcursor + *:not([data-layout-section="true"]), > .ProseMirror-widget:first-child + *:not([data-layout-section="true"])': {
377
+ '> .ProseMirror-widget:first-child + .ProseMirror-gapcursor + *:not([data-layout-section="true"], [data-prosemirror-node-name="bodiedSyncBlock"]), > .ProseMirror-widget:first-child + *:not([data-layout-section="true"], [data-prosemirror-node-name="bodiedSyncBlock"])': {
378
378
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
379
379
  marginTop: '0 !important'
380
380
  }
@@ -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);
@@ -224,7 +224,7 @@ var globalDnDStyle = css({
224
224
  var globalStyles = function globalStyles() {
225
225
  return css({
226
226
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
227
- '.ProseMirror-widget:first-child + *:not([data-panel-type], .code-block, [data-node-type="nestedExpand"], [data-layout-section="true"])': {
227
+ '.ProseMirror-widget:first-child + *:not([data-panel-type], .code-block, [data-node-type="nestedExpand"], [data-node-type="expand"], [data-layout-section="true"], [data-prosemirror-node-name="bodiedSyncBlock"])': {
228
228
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
229
229
  marginTop: '0 !important'
230
230
  }
@@ -317,7 +317,7 @@ var topLevelNodeMarginStyles = css({
317
317
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
318
318
  '.ProseMirror': {
319
319
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
320
- '> .ProseMirror-widget:first-child + .ProseMirror-gapcursor + *:not([data-layout-section="true"]), > .ProseMirror-widget:first-child + *:not([data-layout-section="true"])': {
320
+ '> .ProseMirror-widget:first-child + .ProseMirror-gapcursor + *:not([data-layout-section="true"], [data-prosemirror-node-name="bodiedSyncBlock"]), > .ProseMirror-widget:first-child + *:not([data-layout-section="true"], [data-prosemirror-node-name="bodiedSyncBlock"])': {
321
321
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
322
322
  marginTop: '0 !important'
323
323
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "7.5.10",
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.29.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"