@atlaskit/editor-plugin-block-controls 1.4.25 → 1.4.26

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
+ ## 1.4.26
4
+
5
+ ### Patch Changes
6
+
7
+ - [#113192](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113192)
8
+ [`e30355e61e571`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e30355e61e571) -
9
+ [ED-23770] Fix the bug where clicking drag handle does not select inline nodes
10
+ - Updated dependencies
11
+
3
12
  ## 1.4.25
4
13
 
5
14
  ### Patch Changes
@@ -14,23 +14,23 @@ var getSelection = exports.getSelection = function getSelection(tr, start) {
14
14
  if (isNodeSelection) {
15
15
  return new _state.NodeSelection($startPos);
16
16
  } else {
17
- // To trigger the annotation floating toolbar for non-selectable node, we need to select on the text node
18
- // Find the first text node in the node
19
- var textNodesPos = start;
20
- var foundTextNodes = false;
17
+ // To trigger the annotation floating toolbar for non-selectable node, we need to select inline nodes
18
+ // Find the first inline node in the node
19
+ var inlineNodePos = start;
20
+ var foundInlineNode = false;
21
21
  tr.doc.nodesBetween($startPos.pos, $startPos.pos + nodeSize, function (n, pos) {
22
- if (foundTextNodes) {
22
+ if (foundInlineNode) {
23
23
  return false;
24
24
  }
25
- if (n.isText) {
26
- textNodesPos = pos;
27
- foundTextNodes = true;
25
+ if (n.isInline) {
26
+ inlineNodePos = pos;
27
+ foundInlineNode = true;
28
28
  return false;
29
29
  }
30
30
  return true;
31
31
  });
32
- var textNodeDepth = textNodesPos - start;
33
- return new _state.TextSelection(tr.doc.resolve(textNodesPos), tr.doc.resolve(start + nodeSize - textNodeDepth));
32
+ var inlineNodeDepth = inlineNodePos - start;
33
+ return new _state.TextSelection(tr.doc.resolve(inlineNodePos), tr.doc.resolve(start + nodeSize - inlineNodeDepth));
34
34
  }
35
35
  };
36
36
  var selectNode = exports.selectNode = function selectNode(tr, start, nodeType) {
@@ -8,23 +8,23 @@ export const getSelection = (tr, start) => {
8
8
  if (isNodeSelection) {
9
9
  return new NodeSelection($startPos);
10
10
  } else {
11
- // To trigger the annotation floating toolbar for non-selectable node, we need to select on the text node
12
- // Find the first text node in the node
13
- let textNodesPos = start;
14
- let foundTextNodes = false;
11
+ // To trigger the annotation floating toolbar for non-selectable node, we need to select inline nodes
12
+ // Find the first inline node in the node
13
+ let inlineNodePos = start;
14
+ let foundInlineNode = false;
15
15
  tr.doc.nodesBetween($startPos.pos, $startPos.pos + nodeSize, (n, pos) => {
16
- if (foundTextNodes) {
16
+ if (foundInlineNode) {
17
17
  return false;
18
18
  }
19
- if (n.isText) {
20
- textNodesPos = pos;
21
- foundTextNodes = true;
19
+ if (n.isInline) {
20
+ inlineNodePos = pos;
21
+ foundInlineNode = true;
22
22
  return false;
23
23
  }
24
24
  return true;
25
25
  });
26
- const textNodeDepth = textNodesPos - start;
27
- return new TextSelection(tr.doc.resolve(textNodesPos), tr.doc.resolve(start + nodeSize - textNodeDepth));
26
+ const inlineNodeDepth = inlineNodePos - start;
27
+ return new TextSelection(tr.doc.resolve(inlineNodePos), tr.doc.resolve(start + nodeSize - inlineNodeDepth));
28
28
  }
29
29
  };
30
30
  export const selectNode = (tr, start, nodeType) => {
@@ -8,23 +8,23 @@ export var getSelection = function getSelection(tr, start) {
8
8
  if (isNodeSelection) {
9
9
  return new NodeSelection($startPos);
10
10
  } else {
11
- // To trigger the annotation floating toolbar for non-selectable node, we need to select on the text node
12
- // Find the first text node in the node
13
- var textNodesPos = start;
14
- var foundTextNodes = false;
11
+ // To trigger the annotation floating toolbar for non-selectable node, we need to select inline nodes
12
+ // Find the first inline node in the node
13
+ var inlineNodePos = start;
14
+ var foundInlineNode = false;
15
15
  tr.doc.nodesBetween($startPos.pos, $startPos.pos + nodeSize, function (n, pos) {
16
- if (foundTextNodes) {
16
+ if (foundInlineNode) {
17
17
  return false;
18
18
  }
19
- if (n.isText) {
20
- textNodesPos = pos;
21
- foundTextNodes = true;
19
+ if (n.isInline) {
20
+ inlineNodePos = pos;
21
+ foundInlineNode = true;
22
22
  return false;
23
23
  }
24
24
  return true;
25
25
  });
26
- var textNodeDepth = textNodesPos - start;
27
- return new TextSelection(tr.doc.resolve(textNodesPos), tr.doc.resolve(start + nodeSize - textNodeDepth));
26
+ var inlineNodeDepth = inlineNodePos - start;
27
+ return new TextSelection(tr.doc.resolve(inlineNodePos), tr.doc.resolve(start + nodeSize - inlineNodeDepth));
28
28
  }
29
29
  };
30
30
  export var selectNode = function selectNode(tr, start, nodeType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "1.4.25",
3
+ "version": "1.4.26",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^36.10.7",
35
- "@atlaskit/editor-common": "^82.9.0",
35
+ "@atlaskit/editor-common": "^82.10.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.2.3",
37
37
  "@atlaskit/editor-plugin-editor-disabled": "^1.1.5",
38
38
  "@atlaskit/editor-plugin-feature-flags": "^1.1.0",