@atlaskit/editor-plugin-block-controls 1.12.9 → 1.12.10

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.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#136410](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136410)
8
+ [`52083ca79b5dc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52083ca79b5dc) -
9
+ [ux] ED-24603 Disable dragging nested nodes within table behind FF
10
+
3
11
  ## 1.12.9
4
12
 
5
13
  ### Patch Changes
@@ -22,7 +22,14 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
22
22
  }
23
23
  var rootElement = target === null || target === void 0 ? void 0 : target.closest('[data-drag-handler-anchor-name]');
24
24
  if (rootElement) {
25
+ var tableElement = rootElement.closest('[data-drag-handler-node-type="table"]');
26
+ if (tableElement && (0, _experiments.editorExperiment)('nested-dnd', true) && (0, _experiments.editorExperiment)('table-nested-dnd', false, {
27
+ exposure: true
28
+ })) {
29
+ rootElement = tableElement;
30
+ }
25
31
  var anchorName = rootElement.getAttribute('data-drag-handler-anchor-name');
32
+ var nodeType = rootElement.getAttribute('data-drag-handler-node-type');
26
33
  if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.anchorName) === anchorName) {
27
34
  return false;
28
35
  }
@@ -39,6 +46,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
39
46
  var depth = $rootPos.depth;
40
47
  var isParentAnIsolatingNode = ((_$rootPos$parent = $rootPos.parent) === null || _$rootPos$parent === void 0 ? void 0 : _$rootPos$parent.type.name) !== 'doc' && ((_$rootPos$parent2 = $rootPos.parent) === null || _$rootPos$parent2 === void 0 ? void 0 : _$rootPos$parent2.type.spec.isolating);
41
48
  var isCurrentNodeAtom = (_$rootPos$nodeAfter = $rootPos.nodeAfter) === null || _$rootPos$nodeAfter === void 0 ? void 0 : _$rootPos$nodeAfter.isAtom;
49
+
42
50
  /**
43
51
  * If the parent node is an isolating node, the sides of nodes of this type are considered boundaries, such as a table cell.
44
52
  * And the current node, as a direct child, is an atom node, meaning it does not have directly editable content.
@@ -51,7 +59,6 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
51
59
  } else {
52
60
  rootPos = view.state.doc.resolve(pos).start(1) - 1;
53
61
  }
54
- var nodeType = rootElement.getAttribute('data-drag-handler-node-type');
55
62
  if (nodeType) {
56
63
  var _api$core, _api$blockControls2;
57
64
  api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.commands.showDragHandleAt(rootPos, anchorName, nodeType));
@@ -15,9 +15,16 @@ export const handleMouseOver = (view, event, api) => {
15
15
  if (target.classList.contains('ProseMirror')) {
16
16
  return false;
17
17
  }
18
- const rootElement = target === null || target === void 0 ? void 0 : target.closest('[data-drag-handler-anchor-name]');
18
+ let rootElement = target === null || target === void 0 ? void 0 : target.closest('[data-drag-handler-anchor-name]');
19
19
  if (rootElement) {
20
+ const tableElement = rootElement.closest('[data-drag-handler-node-type="table"]');
21
+ if (tableElement && editorExperiment('nested-dnd', true) && editorExperiment('table-nested-dnd', false, {
22
+ exposure: true
23
+ })) {
24
+ rootElement = tableElement;
25
+ }
20
26
  const anchorName = rootElement.getAttribute('data-drag-handler-anchor-name');
27
+ const nodeType = rootElement.getAttribute('data-drag-handler-node-type');
21
28
  if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.anchorName) === anchorName) {
22
29
  return false;
23
30
  }
@@ -34,6 +41,7 @@ export const handleMouseOver = (view, event, api) => {
34
41
  const depth = $rootPos.depth;
35
42
  const isParentAnIsolatingNode = ((_$rootPos$parent = $rootPos.parent) === null || _$rootPos$parent === void 0 ? void 0 : _$rootPos$parent.type.name) !== 'doc' && ((_$rootPos$parent2 = $rootPos.parent) === null || _$rootPos$parent2 === void 0 ? void 0 : _$rootPos$parent2.type.spec.isolating);
36
43
  const isCurrentNodeAtom = (_$rootPos$nodeAfter = $rootPos.nodeAfter) === null || _$rootPos$nodeAfter === void 0 ? void 0 : _$rootPos$nodeAfter.isAtom;
44
+
37
45
  /**
38
46
  * If the parent node is an isolating node, the sides of nodes of this type are considered boundaries, such as a table cell.
39
47
  * And the current node, as a direct child, is an atom node, meaning it does not have directly editable content.
@@ -46,7 +54,6 @@ export const handleMouseOver = (view, event, api) => {
46
54
  } else {
47
55
  rootPos = view.state.doc.resolve(pos).start(1) - 1;
48
56
  }
49
- const nodeType = rootElement.getAttribute('data-drag-handler-node-type');
50
57
  if (nodeType) {
51
58
  var _api$core, _api$blockControls2;
52
59
  api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.commands.showDragHandleAt(rootPos, anchorName, nodeType));
@@ -16,7 +16,14 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
16
16
  }
17
17
  var rootElement = target === null || target === void 0 ? void 0 : target.closest('[data-drag-handler-anchor-name]');
18
18
  if (rootElement) {
19
+ var tableElement = rootElement.closest('[data-drag-handler-node-type="table"]');
20
+ if (tableElement && editorExperiment('nested-dnd', true) && editorExperiment('table-nested-dnd', false, {
21
+ exposure: true
22
+ })) {
23
+ rootElement = tableElement;
24
+ }
19
25
  var anchorName = rootElement.getAttribute('data-drag-handler-anchor-name');
26
+ var nodeType = rootElement.getAttribute('data-drag-handler-node-type');
20
27
  if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.anchorName) === anchorName) {
21
28
  return false;
22
29
  }
@@ -33,6 +40,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
33
40
  var depth = $rootPos.depth;
34
41
  var isParentAnIsolatingNode = ((_$rootPos$parent = $rootPos.parent) === null || _$rootPos$parent === void 0 ? void 0 : _$rootPos$parent.type.name) !== 'doc' && ((_$rootPos$parent2 = $rootPos.parent) === null || _$rootPos$parent2 === void 0 ? void 0 : _$rootPos$parent2.type.spec.isolating);
35
42
  var isCurrentNodeAtom = (_$rootPos$nodeAfter = $rootPos.nodeAfter) === null || _$rootPos$nodeAfter === void 0 ? void 0 : _$rootPos$nodeAfter.isAtom;
43
+
36
44
  /**
37
45
  * If the parent node is an isolating node, the sides of nodes of this type are considered boundaries, such as a table cell.
38
46
  * And the current node, as a direct child, is an atom node, meaning it does not have directly editable content.
@@ -45,7 +53,6 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
45
53
  } else {
46
54
  rootPos = view.state.doc.resolve(pos).start(1) - 1;
47
55
  }
48
- var nodeType = rootElement.getAttribute('data-drag-handler-node-type');
49
56
  if (nodeType) {
50
57
  var _api$core, _api$blockControls2;
51
58
  api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.commands.showDragHandleAt(rootPos, anchorName, nodeType));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "1.12.9",
3
+ "version": "1.12.10",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",