@atlaskit/editor-plugin-block-controls 7.17.0 → 7.17.1
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
|
+
## 7.17.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d5e222a3c15bc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d5e222a3c15bc) -
|
|
8
|
+
[ux] EDITOR-3945 Blockquote NodeSelection support
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 7.17.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -92,17 +92,16 @@ var newGetSelection = function newGetSelection(doc, selectionEmpty, start) {
|
|
|
92
92
|
return false;
|
|
93
93
|
}
|
|
94
94
|
var isParagraphHeadingEmpty = ['paragraph', 'heading'].includes(nodeName || '') && selectionEmpty && (node === null || node === void 0 ? void 0 : node.childCount) === 0;
|
|
95
|
-
var isBlockQuoteEmpty = nodeName === 'blockquote' && (node === null || node === void 0 ? void 0 : node.textContent) === '';
|
|
96
95
|
var isListEmpty = ['orderedList', 'bulletList', 'taskList'].includes(nodeName || '') && selectionEmpty && (node === null || node === void 0 ? void 0 : node.textContent) === '';
|
|
97
96
|
|
|
98
97
|
// if block menu and empty line format menu are enabled,
|
|
99
98
|
// we want to set the selection to avoid the selection goes to the top of the document
|
|
100
|
-
if ((isParagraphHeadingEmpty ||
|
|
99
|
+
if ((isParagraphHeadingEmpty || isListEmpty) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
|
|
101
100
|
return _state.TextSelection.create(doc, start + 1, start + 1);
|
|
102
101
|
}
|
|
103
102
|
var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(doc, start, nodeSize);
|
|
104
103
|
var isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(doc, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(doc, start, nodeSize);
|
|
105
|
-
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
104
|
+
if (isNodeSelection && (nodeName !== 'blockquote' || (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
106
105
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
107
106
|
['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) {
|
|
108
107
|
return new _state.NodeSelection(doc.resolve(start));
|
|
@@ -87,17 +87,16 @@ const newGetSelection = (doc, selectionEmpty, start) => {
|
|
|
87
87
|
return false;
|
|
88
88
|
}
|
|
89
89
|
const isParagraphHeadingEmpty = ['paragraph', 'heading'].includes(nodeName || '') && selectionEmpty && (node === null || node === void 0 ? void 0 : node.childCount) === 0;
|
|
90
|
-
const isBlockQuoteEmpty = nodeName === 'blockquote' && (node === null || node === void 0 ? void 0 : node.textContent) === '';
|
|
91
90
|
const isListEmpty = ['orderedList', 'bulletList', 'taskList'].includes(nodeName || '') && selectionEmpty && (node === null || node === void 0 ? void 0 : node.textContent) === '';
|
|
92
91
|
|
|
93
92
|
// if block menu and empty line format menu are enabled,
|
|
94
93
|
// we want to set the selection to avoid the selection goes to the top of the document
|
|
95
|
-
if ((isParagraphHeadingEmpty ||
|
|
94
|
+
if ((isParagraphHeadingEmpty || isListEmpty) && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
96
95
|
return TextSelection.create(doc, start + 1, start + 1);
|
|
97
96
|
}
|
|
98
97
|
const isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(doc, start, nodeSize);
|
|
99
98
|
const isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(doc, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(doc, start, nodeSize);
|
|
100
|
-
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
99
|
+
if (isNodeSelection && (nodeName !== 'blockquote' || expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
101
100
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
102
101
|
['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) {
|
|
103
102
|
return new NodeSelection(doc.resolve(start));
|
|
@@ -86,17 +86,16 @@ var newGetSelection = function newGetSelection(doc, selectionEmpty, start) {
|
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
88
|
var isParagraphHeadingEmpty = ['paragraph', 'heading'].includes(nodeName || '') && selectionEmpty && (node === null || node === void 0 ? void 0 : node.childCount) === 0;
|
|
89
|
-
var isBlockQuoteEmpty = nodeName === 'blockquote' && (node === null || node === void 0 ? void 0 : node.textContent) === '';
|
|
90
89
|
var isListEmpty = ['orderedList', 'bulletList', 'taskList'].includes(nodeName || '') && selectionEmpty && (node === null || node === void 0 ? void 0 : node.textContent) === '';
|
|
91
90
|
|
|
92
91
|
// if block menu and empty line format menu are enabled,
|
|
93
92
|
// we want to set the selection to avoid the selection goes to the top of the document
|
|
94
|
-
if ((isParagraphHeadingEmpty ||
|
|
93
|
+
if ((isParagraphHeadingEmpty || isListEmpty) && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
95
94
|
return TextSelection.create(doc, start + 1, start + 1);
|
|
96
95
|
}
|
|
97
96
|
var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(doc, start, nodeSize);
|
|
98
97
|
var isListWithMediaOrExtension = nodeName === 'bulletList' && isNodeWithMediaOrExtension(doc, start, nodeSize) || nodeName === 'orderedList' && isNodeWithMediaOrExtension(doc, start, nodeSize);
|
|
99
|
-
if (isNodeSelection && nodeName !== 'blockquote' || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
98
|
+
if (isNodeSelection && (nodeName !== 'blockquote' || expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) || isListWithMediaOrExtension || isBlockQuoteWithMediaOrExtension ||
|
|
100
99
|
// decisionList/layoutColumn node is not selectable, but we want to select the whole node not just text
|
|
101
100
|
['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) {
|
|
102
101
|
return new NodeSelection(doc.resolve(start));
|