@atlaskit/editor-plugin-block-controls 7.2.8 → 7.2.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 +7 -0
- package/dist/cjs/editor-commands/move-node.js +1 -1
- package/dist/cjs/pm-plugins/utils/validation.js +17 -19
- package/dist/es2019/editor-commands/move-node.js +1 -1
- package/dist/es2019/pm-plugins/utils/validation.js +17 -19
- package/dist/esm/editor-commands/move-node.js +1 -1
- package/dist/esm/pm-plugins/utils/validation.js +17 -19
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 7.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3a41420ddfc6e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a41420ddfc6e) -
|
|
8
|
+
Clean up platform_editor_drag_layout_column_into_nodes
|
|
9
|
+
|
|
3
10
|
## 7.2.8
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -91,7 +91,7 @@ var isDragLayoutColumnIntoSupportedNodes = function isDragLayoutColumnIntoSuppor
|
|
|
91
91
|
var _$from$nodeAfter;
|
|
92
92
|
var isTopLevel = $to.depth === 0;
|
|
93
93
|
var isDragIntoNodes = nodesSupportDragLayoutColumnInto.includes($to.parent.type.name);
|
|
94
|
-
var supportedCondition =
|
|
94
|
+
var supportedCondition = isDragIntoNodes || isTopLevel;
|
|
95
95
|
return ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.type.name) === 'layoutColumn' && $from.parent.type.name === 'layoutSection' && supportedCondition;
|
|
96
96
|
};
|
|
97
97
|
|
|
@@ -121,26 +121,24 @@ function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNodePos,
|
|
|
121
121
|
if ((destNode === null || destNode === void 0 ? void 0 : destNode.type) === layoutSection || destParentNodeType === doc) {
|
|
122
122
|
return true;
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
return canCreateNodeWithContentInsideAnotherNode([tableCell, tableHeader], convertedFragment);
|
|
134
|
-
}
|
|
135
|
-
if (destParentNodeType === panel) {
|
|
136
|
-
return canCreateNodeWithContentInsideAnotherNode([panel], layoutColumnContent);
|
|
137
|
-
}
|
|
138
|
-
if (destParentNodeType === expand) {
|
|
139
|
-
return canCreateNodeWithContentInsideAnotherNode([expand], layoutColumnContent);
|
|
140
|
-
}
|
|
141
|
-
if (destParentNodeType === nestedExpand) {
|
|
142
|
-
return canCreateNodeWithContentInsideAnotherNode([nestedExpand], layoutColumnContent);
|
|
124
|
+
if (destParentNodeType === tableCell || destParentNodeType === tableHeader) {
|
|
125
|
+
var contentContainsExpand = (0, _utils.findChildrenByType)(srcNode, expand).length > 0;
|
|
126
|
+
//convert expand to nestedExpand if there are expands inside the layout column
|
|
127
|
+
// otherwise, the createChecked will fail as expand is not a valid child of tableCell/tableHeader, but nestedExpand is
|
|
128
|
+
var convertedFragment = contentContainsExpand ? transformFragmentExpandToNestedExpand(layoutColumnContent) : layoutColumnContent;
|
|
129
|
+
if (!convertedFragment) {
|
|
130
|
+
return false;
|
|
143
131
|
}
|
|
132
|
+
return canCreateNodeWithContentInsideAnotherNode([tableCell, tableHeader], convertedFragment);
|
|
133
|
+
}
|
|
134
|
+
if (destParentNodeType === panel) {
|
|
135
|
+
return canCreateNodeWithContentInsideAnotherNode([panel], layoutColumnContent);
|
|
136
|
+
}
|
|
137
|
+
if (destParentNodeType === expand) {
|
|
138
|
+
return canCreateNodeWithContentInsideAnotherNode([expand], layoutColumnContent);
|
|
139
|
+
}
|
|
140
|
+
if (destParentNodeType === nestedExpand) {
|
|
141
|
+
return canCreateNodeWithContentInsideAnotherNode([nestedExpand], layoutColumnContent);
|
|
144
142
|
}
|
|
145
143
|
}
|
|
146
144
|
|
|
@@ -84,7 +84,7 @@ const isDragLayoutColumnIntoSupportedNodes = ($from, $to) => {
|
|
|
84
84
|
var _$from$nodeAfter;
|
|
85
85
|
const isTopLevel = $to.depth === 0;
|
|
86
86
|
const isDragIntoNodes = nodesSupportDragLayoutColumnInto.includes($to.parent.type.name);
|
|
87
|
-
const supportedCondition =
|
|
87
|
+
const supportedCondition = isDragIntoNodes || isTopLevel;
|
|
88
88
|
return ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.type.name) === 'layoutColumn' && $from.parent.type.name === 'layoutSection' && supportedCondition;
|
|
89
89
|
};
|
|
90
90
|
|
|
@@ -112,26 +112,24 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
|
|
|
112
112
|
if ((destNode === null || destNode === void 0 ? void 0 : destNode.type) === layoutSection || destParentNodeType === doc) {
|
|
113
113
|
return true;
|
|
114
114
|
}
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
return canCreateNodeWithContentInsideAnotherNode([tableCell, tableHeader], convertedFragment);
|
|
125
|
-
}
|
|
126
|
-
if (destParentNodeType === panel) {
|
|
127
|
-
return canCreateNodeWithContentInsideAnotherNode([panel], layoutColumnContent);
|
|
128
|
-
}
|
|
129
|
-
if (destParentNodeType === expand) {
|
|
130
|
-
return canCreateNodeWithContentInsideAnotherNode([expand], layoutColumnContent);
|
|
131
|
-
}
|
|
132
|
-
if (destParentNodeType === nestedExpand) {
|
|
133
|
-
return canCreateNodeWithContentInsideAnotherNode([nestedExpand], layoutColumnContent);
|
|
115
|
+
if (destParentNodeType === tableCell || destParentNodeType === tableHeader) {
|
|
116
|
+
const contentContainsExpand = findChildrenByType(srcNode, expand).length > 0;
|
|
117
|
+
//convert expand to nestedExpand if there are expands inside the layout column
|
|
118
|
+
// otherwise, the createChecked will fail as expand is not a valid child of tableCell/tableHeader, but nestedExpand is
|
|
119
|
+
const convertedFragment = contentContainsExpand ? transformFragmentExpandToNestedExpand(layoutColumnContent) : layoutColumnContent;
|
|
120
|
+
if (!convertedFragment) {
|
|
121
|
+
return false;
|
|
134
122
|
}
|
|
123
|
+
return canCreateNodeWithContentInsideAnotherNode([tableCell, tableHeader], convertedFragment);
|
|
124
|
+
}
|
|
125
|
+
if (destParentNodeType === panel) {
|
|
126
|
+
return canCreateNodeWithContentInsideAnotherNode([panel], layoutColumnContent);
|
|
127
|
+
}
|
|
128
|
+
if (destParentNodeType === expand) {
|
|
129
|
+
return canCreateNodeWithContentInsideAnotherNode([expand], layoutColumnContent);
|
|
130
|
+
}
|
|
131
|
+
if (destParentNodeType === nestedExpand) {
|
|
132
|
+
return canCreateNodeWithContentInsideAnotherNode([nestedExpand], layoutColumnContent);
|
|
135
133
|
}
|
|
136
134
|
}
|
|
137
135
|
|
|
@@ -85,7 +85,7 @@ var isDragLayoutColumnIntoSupportedNodes = function isDragLayoutColumnIntoSuppor
|
|
|
85
85
|
var _$from$nodeAfter;
|
|
86
86
|
var isTopLevel = $to.depth === 0;
|
|
87
87
|
var isDragIntoNodes = nodesSupportDragLayoutColumnInto.includes($to.parent.type.name);
|
|
88
|
-
var supportedCondition =
|
|
88
|
+
var supportedCondition = isDragIntoNodes || isTopLevel;
|
|
89
89
|
return ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.type.name) === 'layoutColumn' && $from.parent.type.name === 'layoutSection' && supportedCondition;
|
|
90
90
|
};
|
|
91
91
|
|
|
@@ -111,26 +111,24 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
|
|
|
111
111
|
if ((destNode === null || destNode === void 0 ? void 0 : destNode.type) === layoutSection || destParentNodeType === doc) {
|
|
112
112
|
return true;
|
|
113
113
|
}
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
return canCreateNodeWithContentInsideAnotherNode([tableCell, tableHeader], convertedFragment);
|
|
124
|
-
}
|
|
125
|
-
if (destParentNodeType === panel) {
|
|
126
|
-
return canCreateNodeWithContentInsideAnotherNode([panel], layoutColumnContent);
|
|
127
|
-
}
|
|
128
|
-
if (destParentNodeType === expand) {
|
|
129
|
-
return canCreateNodeWithContentInsideAnotherNode([expand], layoutColumnContent);
|
|
130
|
-
}
|
|
131
|
-
if (destParentNodeType === nestedExpand) {
|
|
132
|
-
return canCreateNodeWithContentInsideAnotherNode([nestedExpand], layoutColumnContent);
|
|
114
|
+
if (destParentNodeType === tableCell || destParentNodeType === tableHeader) {
|
|
115
|
+
var contentContainsExpand = findChildrenByType(srcNode, expand).length > 0;
|
|
116
|
+
//convert expand to nestedExpand if there are expands inside the layout column
|
|
117
|
+
// otherwise, the createChecked will fail as expand is not a valid child of tableCell/tableHeader, but nestedExpand is
|
|
118
|
+
var convertedFragment = contentContainsExpand ? transformFragmentExpandToNestedExpand(layoutColumnContent) : layoutColumnContent;
|
|
119
|
+
if (!convertedFragment) {
|
|
120
|
+
return false;
|
|
133
121
|
}
|
|
122
|
+
return canCreateNodeWithContentInsideAnotherNode([tableCell, tableHeader], convertedFragment);
|
|
123
|
+
}
|
|
124
|
+
if (destParentNodeType === panel) {
|
|
125
|
+
return canCreateNodeWithContentInsideAnotherNode([panel], layoutColumnContent);
|
|
126
|
+
}
|
|
127
|
+
if (destParentNodeType === expand) {
|
|
128
|
+
return canCreateNodeWithContentInsideAnotherNode([expand], layoutColumnContent);
|
|
129
|
+
}
|
|
130
|
+
if (destParentNodeType === nestedExpand) {
|
|
131
|
+
return canCreateNodeWithContentInsideAnotherNode([nestedExpand], layoutColumnContent);
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
134
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.9",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -126,9 +126,6 @@
|
|
|
126
126
|
"platform_editor_ease_of_use_metrics": {
|
|
127
127
|
"type": "boolean"
|
|
128
128
|
},
|
|
129
|
-
"platform_editor_drag_layout_column_into_nodes": {
|
|
130
|
-
"type": "boolean"
|
|
131
|
-
},
|
|
132
129
|
"platform_editor_elements_dnd_multi_select_patch_2": {
|
|
133
130
|
"type": "boolean"
|
|
134
131
|
},
|