@atlaskit/editor-plugin-block-controls 3.15.7 → 3.15.9
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,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.15.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#163993](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/163993)
|
|
8
|
+
[`1a5e31989fe1d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1a5e31989fe1d) -
|
|
9
|
+
clean up platform_editor_non_macros_copy_and_paste_fix
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.15.8
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 3.15.7
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -32,16 +32,6 @@ var getInlineNodePos = exports.getInlineNodePos = function getInlineNodePos(tr,
|
|
|
32
32
|
inlineNodeEndPos: inlineNodeEndPos
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
var isNodeWithMedia = function isNodeWithMedia(tr, start, nodeSize) {
|
|
36
|
-
var $startPos = tr.doc.resolve(start);
|
|
37
|
-
var hasMedia = false;
|
|
38
|
-
tr.doc.nodesBetween($startPos.pos, $startPos.pos + nodeSize, function (n) {
|
|
39
|
-
if (n.type.name === 'media') {
|
|
40
|
-
hasMedia = true;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return hasMedia;
|
|
44
|
-
};
|
|
45
35
|
var isNodeWithMediaOrExtension = function isNodeWithMediaOrExtension(tr, start, nodeSize) {
|
|
46
36
|
var $startPos = tr.doc.resolve(start);
|
|
47
37
|
var hasMediaOrExtension = false;
|
|
@@ -58,10 +48,9 @@ var oldGetSelection = function oldGetSelection(tr, start) {
|
|
|
58
48
|
var nodeSize = node ? node.nodeSize : 1;
|
|
59
49
|
var $startPos = tr.doc.resolve(start);
|
|
60
50
|
var nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
61
|
-
var isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
|
|
62
51
|
var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
63
52
|
var isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(tr, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
64
|
-
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension
|
|
53
|
+
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
65
54
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
66
55
|
['decisionList', 'layoutColumn'].includes(nodeName || '')) {
|
|
67
56
|
return new _state.NodeSelection($startPos);
|
|
@@ -92,10 +81,9 @@ var newGetSelection = function newGetSelection(tr, start) {
|
|
|
92
81
|
if (nodeName === 'paragraph' && tr.selection.empty && (node === null || node === void 0 ? void 0 : node.childCount) === 0) {
|
|
93
82
|
return false;
|
|
94
83
|
}
|
|
95
|
-
var isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
|
|
96
84
|
var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
97
85
|
var isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(tr, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
98
|
-
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension
|
|
86
|
+
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
99
87
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
100
88
|
['decisionList', 'layoutColumn'].includes(nodeName || '') || nodeName === 'mediaGroup' && typeof (node === null || node === void 0 ? void 0 : node.childCount) === 'number' && (node === null || node === void 0 ? void 0 : node.childCount) > 1) {
|
|
101
89
|
return new _state.NodeSelection(tr.doc.resolve(start));
|
|
@@ -26,16 +26,6 @@ export const getInlineNodePos = (tr, start, nodeSize) => {
|
|
|
26
26
|
inlineNodeEndPos
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
const isNodeWithMedia = (tr, start, nodeSize) => {
|
|
30
|
-
const $startPos = tr.doc.resolve(start);
|
|
31
|
-
let hasMedia = false;
|
|
32
|
-
tr.doc.nodesBetween($startPos.pos, $startPos.pos + nodeSize, n => {
|
|
33
|
-
if (n.type.name === 'media') {
|
|
34
|
-
hasMedia = true;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return hasMedia;
|
|
38
|
-
};
|
|
39
29
|
const isNodeWithMediaOrExtension = (tr, start, nodeSize) => {
|
|
40
30
|
const $startPos = tr.doc.resolve(start);
|
|
41
31
|
let hasMediaOrExtension = false;
|
|
@@ -52,10 +42,9 @@ const oldGetSelection = (tr, start) => {
|
|
|
52
42
|
const nodeSize = node ? node.nodeSize : 1;
|
|
53
43
|
const $startPos = tr.doc.resolve(start);
|
|
54
44
|
const nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
55
|
-
const isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
|
|
56
45
|
const isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
57
46
|
const isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(tr, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
58
|
-
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension
|
|
47
|
+
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
59
48
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
60
49
|
['decisionList', 'layoutColumn'].includes(nodeName || '')) {
|
|
61
50
|
return new NodeSelection($startPos);
|
|
@@ -87,10 +76,9 @@ const newGetSelection = (tr, start) => {
|
|
|
87
76
|
if (nodeName === 'paragraph' && tr.selection.empty && (node === null || node === void 0 ? void 0 : node.childCount) === 0) {
|
|
88
77
|
return false;
|
|
89
78
|
}
|
|
90
|
-
const isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
|
|
91
79
|
const isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
92
80
|
const isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(tr, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
93
|
-
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension
|
|
81
|
+
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
94
82
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
95
83
|
['decisionList', 'layoutColumn'].includes(nodeName || '') || nodeName === 'mediaGroup' && typeof (node === null || node === void 0 ? void 0 : node.childCount) === 'number' && (node === null || node === void 0 ? void 0 : node.childCount) > 1) {
|
|
96
84
|
return new NodeSelection(tr.doc.resolve(start));
|
|
@@ -26,16 +26,6 @@ export var getInlineNodePos = function getInlineNodePos(tr, start, nodeSize) {
|
|
|
26
26
|
inlineNodeEndPos: inlineNodeEndPos
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
var isNodeWithMedia = function isNodeWithMedia(tr, start, nodeSize) {
|
|
30
|
-
var $startPos = tr.doc.resolve(start);
|
|
31
|
-
var hasMedia = false;
|
|
32
|
-
tr.doc.nodesBetween($startPos.pos, $startPos.pos + nodeSize, function (n) {
|
|
33
|
-
if (n.type.name === 'media') {
|
|
34
|
-
hasMedia = true;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return hasMedia;
|
|
38
|
-
};
|
|
39
29
|
var isNodeWithMediaOrExtension = function isNodeWithMediaOrExtension(tr, start, nodeSize) {
|
|
40
30
|
var $startPos = tr.doc.resolve(start);
|
|
41
31
|
var hasMediaOrExtension = false;
|
|
@@ -52,10 +42,9 @@ var oldGetSelection = function oldGetSelection(tr, start) {
|
|
|
52
42
|
var nodeSize = node ? node.nodeSize : 1;
|
|
53
43
|
var $startPos = tr.doc.resolve(start);
|
|
54
44
|
var nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
55
|
-
var isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
|
|
56
45
|
var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
57
46
|
var isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(tr, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
58
|
-
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension
|
|
47
|
+
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
59
48
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
60
49
|
['decisionList', 'layoutColumn'].includes(nodeName || '')) {
|
|
61
50
|
return new NodeSelection($startPos);
|
|
@@ -86,10 +75,9 @@ var newGetSelection = function newGetSelection(tr, start) {
|
|
|
86
75
|
if (nodeName === 'paragraph' && tr.selection.empty && (node === null || node === void 0 ? void 0 : node.childCount) === 0) {
|
|
87
76
|
return false;
|
|
88
77
|
}
|
|
89
|
-
var isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
|
|
90
78
|
var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
91
79
|
var isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(tr, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
92
|
-
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension
|
|
80
|
+
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
93
81
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
94
82
|
['decisionList', 'layoutColumn'].includes(nodeName || '') || nodeName === 'mediaGroup' && typeof (node === null || node === void 0 ? void 0 : node.childCount) === 'number' && (node === null || node === void 0 ? void 0 : node.childCount) > 1) {
|
|
95
83
|
return new NodeSelection(tr.doc.resolve(start));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.9",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|
|
41
|
-
"@atlaskit/editor-plugin-interaction": "^
|
|
41
|
+
"@atlaskit/editor-plugin-interaction": "^2.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-metrics": "^3.4.0",
|
|
43
43
|
"@atlaskit/editor-plugin-quick-insert": "^2.5.0",
|
|
44
44
|
"@atlaskit/editor-plugin-selection": "^2.2.0",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
57
57
|
"@atlaskit/primitives": "^14.8.0",
|
|
58
58
|
"@atlaskit/theme": "^18.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^5.
|
|
60
|
-
"@atlaskit/tokens": "^
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^5.8.0",
|
|
60
|
+
"@atlaskit/tokens": "^5.0.0",
|
|
61
61
|
"@atlaskit/tooltip": "^20.2.0",
|
|
62
62
|
"@babel/runtime": "^7.0.0",
|
|
63
63
|
"@emotion/react": "^11.7.1",
|
|
@@ -140,9 +140,6 @@
|
|
|
140
140
|
"platform_editor_ease_of_use_metrics": {
|
|
141
141
|
"type": "boolean"
|
|
142
142
|
},
|
|
143
|
-
"platform_editor_non_macros_copy_and_paste_fix": {
|
|
144
|
-
"type": "boolean"
|
|
145
|
-
},
|
|
146
143
|
"platform_editor_remove_drag_handle_fix": {
|
|
147
144
|
"type": "boolean"
|
|
148
145
|
},
|