@atlaskit/editor-plugin-block-controls 3.3.3 → 3.3.4
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
|
+
## 3.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#122078](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122078)
|
|
8
|
+
[`b0ffa0b719b38`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b0ffa0b719b38) -
|
|
9
|
+
[ux] ED-26811 fixing the copy and paste issue for copy and paste
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.3.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -41,6 +41,16 @@ var isNodeWithMedia = function isNodeWithMedia(tr, start, nodeSize) {
|
|
|
41
41
|
});
|
|
42
42
|
return hasMedia;
|
|
43
43
|
};
|
|
44
|
+
var isNodeWithMediaOrExtension = function isNodeWithMediaOrExtension(tr, start, nodeSize) {
|
|
45
|
+
var $startPos = tr.doc.resolve(start);
|
|
46
|
+
var hasMediaOrExtension = false;
|
|
47
|
+
tr.doc.nodesBetween($startPos.pos, $startPos.pos + nodeSize, function (n) {
|
|
48
|
+
if (['media', 'extension'].includes(n.type.name)) {
|
|
49
|
+
hasMediaOrExtension = true;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return hasMediaOrExtension;
|
|
53
|
+
};
|
|
44
54
|
var getSelection = exports.getSelection = function getSelection(tr, start) {
|
|
45
55
|
var node = tr.doc.nodeAt(start);
|
|
46
56
|
var isNodeSelection = node && _state.NodeSelection.isSelectable(node);
|
|
@@ -48,7 +58,8 @@ var getSelection = exports.getSelection = function getSelection(tr, start) {
|
|
|
48
58
|
var $startPos = tr.doc.resolve(start);
|
|
49
59
|
var nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
50
60
|
var isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
|
|
51
|
-
|
|
61
|
+
var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
62
|
+
if (isNodeSelection && nodeName !== 'blockquote' || ((0, _platformFeatureFlags.fg)('platform_editor_non_macros_copy_and_paste_fix') ? isBlockQuoteWithMediaOrExtension : isBlockQuoteWithMedia) ||
|
|
52
63
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
53
64
|
['decisionList', 'layoutColumn'].includes(nodeName || '')) {
|
|
54
65
|
return new _state.NodeSelection($startPos);
|
|
@@ -35,6 +35,16 @@ const isNodeWithMedia = (tr, start, nodeSize) => {
|
|
|
35
35
|
});
|
|
36
36
|
return hasMedia;
|
|
37
37
|
};
|
|
38
|
+
const isNodeWithMediaOrExtension = (tr, start, nodeSize) => {
|
|
39
|
+
const $startPos = tr.doc.resolve(start);
|
|
40
|
+
let hasMediaOrExtension = false;
|
|
41
|
+
tr.doc.nodesBetween($startPos.pos, $startPos.pos + nodeSize, n => {
|
|
42
|
+
if (['media', 'extension'].includes(n.type.name)) {
|
|
43
|
+
hasMediaOrExtension = true;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return hasMediaOrExtension;
|
|
47
|
+
};
|
|
38
48
|
export const getSelection = (tr, start) => {
|
|
39
49
|
const node = tr.doc.nodeAt(start);
|
|
40
50
|
const isNodeSelection = node && NodeSelection.isSelectable(node);
|
|
@@ -42,7 +52,8 @@ export const getSelection = (tr, start) => {
|
|
|
42
52
|
const $startPos = tr.doc.resolve(start);
|
|
43
53
|
const nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
44
54
|
const isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
|
|
45
|
-
|
|
55
|
+
const isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
56
|
+
if (isNodeSelection && nodeName !== 'blockquote' || (fg('platform_editor_non_macros_copy_and_paste_fix') ? isBlockQuoteWithMediaOrExtension : isBlockQuoteWithMedia) ||
|
|
46
57
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
47
58
|
['decisionList', 'layoutColumn'].includes(nodeName || '')) {
|
|
48
59
|
return new NodeSelection($startPos);
|
|
@@ -35,6 +35,16 @@ var isNodeWithMedia = function isNodeWithMedia(tr, start, nodeSize) {
|
|
|
35
35
|
});
|
|
36
36
|
return hasMedia;
|
|
37
37
|
};
|
|
38
|
+
var isNodeWithMediaOrExtension = function isNodeWithMediaOrExtension(tr, start, nodeSize) {
|
|
39
|
+
var $startPos = tr.doc.resolve(start);
|
|
40
|
+
var hasMediaOrExtension = false;
|
|
41
|
+
tr.doc.nodesBetween($startPos.pos, $startPos.pos + nodeSize, function (n) {
|
|
42
|
+
if (['media', 'extension'].includes(n.type.name)) {
|
|
43
|
+
hasMediaOrExtension = true;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return hasMediaOrExtension;
|
|
47
|
+
};
|
|
38
48
|
export var getSelection = function getSelection(tr, start) {
|
|
39
49
|
var node = tr.doc.nodeAt(start);
|
|
40
50
|
var isNodeSelection = node && NodeSelection.isSelectable(node);
|
|
@@ -42,7 +52,8 @@ export var getSelection = function getSelection(tr, start) {
|
|
|
42
52
|
var $startPos = tr.doc.resolve(start);
|
|
43
53
|
var nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
44
54
|
var isBlockQuoteWithMedia = nodeName === 'blockquote' && isNodeWithMedia(tr, start, nodeSize);
|
|
45
|
-
|
|
55
|
+
var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
|
|
56
|
+
if (isNodeSelection && nodeName !== 'blockquote' || (fg('platform_editor_non_macros_copy_and_paste_fix') ? isBlockQuoteWithMediaOrExtension : isBlockQuoteWithMedia) ||
|
|
46
57
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
47
58
|
['decisionList', 'layoutColumn'].includes(nodeName || '')) {
|
|
48
59
|
return new NodeSelection($startPos);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -166,6 +166,9 @@
|
|
|
166
166
|
},
|
|
167
167
|
"platform_editor_ease_of_use_metrics": {
|
|
168
168
|
"type": "boolean"
|
|
169
|
+
},
|
|
170
|
+
"platform_editor_non_macros_copy_and_paste_fix": {
|
|
171
|
+
"type": "boolean"
|
|
169
172
|
}
|
|
170
173
|
}
|
|
171
174
|
}
|