@atlaskit/editor-plugin-expand 2.7.3 → 2.7.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 +9 -0
- package/dist/cjs/legacyExpand/pm-plugins/main.js +2 -1
- package/dist/cjs/singlePlayerExpand/pm-plugins/main.js +2 -1
- package/dist/es2019/legacyExpand/pm-plugins/main.js +2 -1
- package/dist/es2019/singlePlayerExpand/pm-plugins/main.js +2 -1
- package/dist/esm/legacyExpand/pm-plugins/main.js +2 -1
- package/dist/esm/singlePlayerExpand/pm-plugins/main.js +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 2.7.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#142470](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142470)
|
|
8
|
+
[`3f2dc4e949e05`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3f2dc4e949e05) -
|
|
9
|
+
ED-25000 - Add logic to handle when nested expand dragged into another nested expand.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 2.7.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -133,6 +133,7 @@ function handleExpandDrag(view, event, slice) {
|
|
|
133
133
|
var dropLocationParentNodeType = resolvedPos.depth > 0 ? resolvedPos.node(resolvedPos.depth - 1).type : dropLocationNodeType;
|
|
134
134
|
var nodesWithNestedExpandSupport = [state.schema.nodes.expand, state.schema.nodes.tableHeader, state.schema.nodes.tableCell];
|
|
135
135
|
var isNodeAtDropPosInsideNodesWithNestedExpandSupport = nodesWithNestedExpandSupport.includes(dropLocationNodeType) || nodesWithNestedExpandSupport.includes(dropLocationParentNodeType);
|
|
136
|
+
var isNodeBeingDroppedInsideNestedExpand = dropLocationNodeType === state.schema.nodes.nestedExpand || dropLocationParentNodeType === state.schema.nodes.nestedExpand;
|
|
136
137
|
if ((0, _experiments.editorExperiment)('nested-expand-in-expand', false)) {
|
|
137
138
|
if ((sliceContainsExpand || sliceContainsNestedExpand) && (dropLocationNodeType === state.schema.nodes.expand || dropLocationParentNodeType === state.schema.nodes.expand)) {
|
|
138
139
|
event.preventDefault();
|
|
@@ -142,7 +143,7 @@ function handleExpandDrag(view, event, slice) {
|
|
|
142
143
|
var updatedSlice = slice;
|
|
143
144
|
if (sliceContainsExpand && isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
144
145
|
updatedSlice = (0, _utils2.transformSliceExpandToNestedExpand)(slice);
|
|
145
|
-
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
146
|
+
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport && !isNodeBeingDroppedInsideNestedExpand) {
|
|
146
147
|
updatedSlice = (0, _utils2.transformSliceNestedExpandToExpand)(slice, state.schema);
|
|
147
148
|
}
|
|
148
149
|
if (!updatedSlice || updatedSlice.eq(slice)) {
|
|
@@ -115,6 +115,7 @@ function handleExpandDrag(view, event, slice) {
|
|
|
115
115
|
var dropLocationParentNodeType = resolvedPos.depth > 0 ? resolvedPos.node(resolvedPos.depth - 1).type : dropLocationNodeType;
|
|
116
116
|
var nodesWithNestedExpandSupport = [state.schema.nodes.expand, state.schema.nodes.tableHeader, state.schema.nodes.tableCell];
|
|
117
117
|
var isNodeAtDropPosInsideNodesWithNestedExpandSupport = nodesWithNestedExpandSupport.includes(dropLocationNodeType) || nodesWithNestedExpandSupport.includes(dropLocationParentNodeType);
|
|
118
|
+
var isNodeBeingDroppedInsideNestedExpand = dropLocationNodeType === state.schema.nodes.nestedExpand || dropLocationParentNodeType === state.schema.nodes.nestedExpand;
|
|
118
119
|
if ((0, _experiments.editorExperiment)('nested-expand-in-expand', false)) {
|
|
119
120
|
if ((sliceContainsExpand || sliceContainsNestedExpand) && (dropLocationNodeType === state.schema.nodes.expand || dropLocationParentNodeType === state.schema.nodes.expand)) {
|
|
120
121
|
event.preventDefault();
|
|
@@ -124,7 +125,7 @@ function handleExpandDrag(view, event, slice) {
|
|
|
124
125
|
var updatedSlice = slice;
|
|
125
126
|
if (sliceContainsExpand && isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
126
127
|
updatedSlice = (0, _utils.transformSliceExpandToNestedExpand)(slice);
|
|
127
|
-
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
128
|
+
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport && !isNodeBeingDroppedInsideNestedExpand) {
|
|
128
129
|
updatedSlice = (0, _utils.transformSliceNestedExpandToExpand)(slice, state.schema);
|
|
129
130
|
}
|
|
130
131
|
if (!updatedSlice || updatedSlice.eq(slice)) {
|
|
@@ -125,6 +125,7 @@ export function handleExpandDrag(view, event, slice) {
|
|
|
125
125
|
const dropLocationParentNodeType = resolvedPos.depth > 0 ? resolvedPos.node(resolvedPos.depth - 1).type : dropLocationNodeType;
|
|
126
126
|
const nodesWithNestedExpandSupport = [state.schema.nodes.expand, state.schema.nodes.tableHeader, state.schema.nodes.tableCell];
|
|
127
127
|
const isNodeAtDropPosInsideNodesWithNestedExpandSupport = nodesWithNestedExpandSupport.includes(dropLocationNodeType) || nodesWithNestedExpandSupport.includes(dropLocationParentNodeType);
|
|
128
|
+
const isNodeBeingDroppedInsideNestedExpand = dropLocationNodeType === state.schema.nodes.nestedExpand || dropLocationParentNodeType === state.schema.nodes.nestedExpand;
|
|
128
129
|
if (editorExperiment('nested-expand-in-expand', false)) {
|
|
129
130
|
if ((sliceContainsExpand || sliceContainsNestedExpand) && (dropLocationNodeType === state.schema.nodes.expand || dropLocationParentNodeType === state.schema.nodes.expand)) {
|
|
130
131
|
event.preventDefault();
|
|
@@ -134,7 +135,7 @@ export function handleExpandDrag(view, event, slice) {
|
|
|
134
135
|
let updatedSlice = slice;
|
|
135
136
|
if (sliceContainsExpand && isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
136
137
|
updatedSlice = transformSliceExpandToNestedExpand(slice);
|
|
137
|
-
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
138
|
+
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport && !isNodeBeingDroppedInsideNestedExpand) {
|
|
138
139
|
updatedSlice = transformSliceNestedExpandToExpand(slice, state.schema);
|
|
139
140
|
}
|
|
140
141
|
if (!updatedSlice || updatedSlice.eq(slice)) {
|
|
@@ -104,6 +104,7 @@ export function handleExpandDrag(view, event, slice) {
|
|
|
104
104
|
const dropLocationParentNodeType = resolvedPos.depth > 0 ? resolvedPos.node(resolvedPos.depth - 1).type : dropLocationNodeType;
|
|
105
105
|
const nodesWithNestedExpandSupport = [state.schema.nodes.expand, state.schema.nodes.tableHeader, state.schema.nodes.tableCell];
|
|
106
106
|
const isNodeAtDropPosInsideNodesWithNestedExpandSupport = nodesWithNestedExpandSupport.includes(dropLocationNodeType) || nodesWithNestedExpandSupport.includes(dropLocationParentNodeType);
|
|
107
|
+
const isNodeBeingDroppedInsideNestedExpand = dropLocationNodeType === state.schema.nodes.nestedExpand || dropLocationParentNodeType === state.schema.nodes.nestedExpand;
|
|
107
108
|
if (editorExperiment('nested-expand-in-expand', false)) {
|
|
108
109
|
if ((sliceContainsExpand || sliceContainsNestedExpand) && (dropLocationNodeType === state.schema.nodes.expand || dropLocationParentNodeType === state.schema.nodes.expand)) {
|
|
109
110
|
event.preventDefault();
|
|
@@ -113,7 +114,7 @@ export function handleExpandDrag(view, event, slice) {
|
|
|
113
114
|
let updatedSlice = slice;
|
|
114
115
|
if (sliceContainsExpand && isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
115
116
|
updatedSlice = transformSliceExpandToNestedExpand(slice);
|
|
116
|
-
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
117
|
+
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport && !isNodeBeingDroppedInsideNestedExpand) {
|
|
117
118
|
updatedSlice = transformSliceNestedExpandToExpand(slice, state.schema);
|
|
118
119
|
}
|
|
119
120
|
if (!updatedSlice || updatedSlice.eq(slice)) {
|
|
@@ -124,6 +124,7 @@ export function handleExpandDrag(view, event, slice) {
|
|
|
124
124
|
var dropLocationParentNodeType = resolvedPos.depth > 0 ? resolvedPos.node(resolvedPos.depth - 1).type : dropLocationNodeType;
|
|
125
125
|
var nodesWithNestedExpandSupport = [state.schema.nodes.expand, state.schema.nodes.tableHeader, state.schema.nodes.tableCell];
|
|
126
126
|
var isNodeAtDropPosInsideNodesWithNestedExpandSupport = nodesWithNestedExpandSupport.includes(dropLocationNodeType) || nodesWithNestedExpandSupport.includes(dropLocationParentNodeType);
|
|
127
|
+
var isNodeBeingDroppedInsideNestedExpand = dropLocationNodeType === state.schema.nodes.nestedExpand || dropLocationParentNodeType === state.schema.nodes.nestedExpand;
|
|
127
128
|
if (editorExperiment('nested-expand-in-expand', false)) {
|
|
128
129
|
if ((sliceContainsExpand || sliceContainsNestedExpand) && (dropLocationNodeType === state.schema.nodes.expand || dropLocationParentNodeType === state.schema.nodes.expand)) {
|
|
129
130
|
event.preventDefault();
|
|
@@ -133,7 +134,7 @@ export function handleExpandDrag(view, event, slice) {
|
|
|
133
134
|
var updatedSlice = slice;
|
|
134
135
|
if (sliceContainsExpand && isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
135
136
|
updatedSlice = transformSliceExpandToNestedExpand(slice);
|
|
136
|
-
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
137
|
+
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport && !isNodeBeingDroppedInsideNestedExpand) {
|
|
137
138
|
updatedSlice = transformSliceNestedExpandToExpand(slice, state.schema);
|
|
138
139
|
}
|
|
139
140
|
if (!updatedSlice || updatedSlice.eq(slice)) {
|
|
@@ -105,6 +105,7 @@ export function handleExpandDrag(view, event, slice) {
|
|
|
105
105
|
var dropLocationParentNodeType = resolvedPos.depth > 0 ? resolvedPos.node(resolvedPos.depth - 1).type : dropLocationNodeType;
|
|
106
106
|
var nodesWithNestedExpandSupport = [state.schema.nodes.expand, state.schema.nodes.tableHeader, state.schema.nodes.tableCell];
|
|
107
107
|
var isNodeAtDropPosInsideNodesWithNestedExpandSupport = nodesWithNestedExpandSupport.includes(dropLocationNodeType) || nodesWithNestedExpandSupport.includes(dropLocationParentNodeType);
|
|
108
|
+
var isNodeBeingDroppedInsideNestedExpand = dropLocationNodeType === state.schema.nodes.nestedExpand || dropLocationParentNodeType === state.schema.nodes.nestedExpand;
|
|
108
109
|
if (editorExperiment('nested-expand-in-expand', false)) {
|
|
109
110
|
if ((sliceContainsExpand || sliceContainsNestedExpand) && (dropLocationNodeType === state.schema.nodes.expand || dropLocationParentNodeType === state.schema.nodes.expand)) {
|
|
110
111
|
event.preventDefault();
|
|
@@ -114,7 +115,7 @@ export function handleExpandDrag(view, event, slice) {
|
|
|
114
115
|
var updatedSlice = slice;
|
|
115
116
|
if (sliceContainsExpand && isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
116
117
|
updatedSlice = transformSliceExpandToNestedExpand(slice);
|
|
117
|
-
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport) {
|
|
118
|
+
} else if (sliceContainsNestedExpand && !isNodeAtDropPosInsideNodesWithNestedExpandSupport && !isNodeBeingDroppedInsideNestedExpand) {
|
|
118
119
|
updatedSlice = transformSliceNestedExpandToExpand(slice, state.schema);
|
|
119
120
|
}
|
|
120
121
|
if (!updatedSlice || updatedSlice.eq(slice)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.4",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
35
35
|
"@atlaskit/button": "^20.1.0",
|
|
36
|
-
"@atlaskit/editor-common": "^90.
|
|
36
|
+
"@atlaskit/editor-common": "^90.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
38
38
|
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|