@atlaskit/editor-plugin-paste 0.2.6 → 0.2.7
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 +6 -0
- package/dist/cjs/handlers.js +2 -1
- package/dist/es2019/handlers.js +2 -1
- package/dist/esm/handlers.js +2 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 0.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#64972](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64972) [`a72ac4c06038`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a72ac4c06038) - ED-21627 Fixed issue with parsing of task as string - when pasting into an existing task
|
|
8
|
+
|
|
3
9
|
## 0.2.6
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/handlers.js
CHANGED
|
@@ -131,8 +131,9 @@ function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChangedTr) {
|
|
|
131
131
|
filters.push((0, _util.applyTextMarksToSlice)(schema, selection.$head.marks()));
|
|
132
132
|
}
|
|
133
133
|
var transformedSlice = compose.apply(null, filters)(slice);
|
|
134
|
+
var isFirstChildTaskNode = transformedSlice.content.firstChild.type === taskList || transformedSlice.content.firstChild.type === taskItem;
|
|
134
135
|
var tr = (0, _history.closeHistory)(state.tr);
|
|
135
|
-
var transformedSliceIsValidNode = transformedSlice.content.firstChild.type.inlineContent || ['decisionList', 'decisionItem', '
|
|
136
|
+
var transformedSliceIsValidNode = (transformedSlice.content.firstChild.type.inlineContent || ['decisionList', 'decisionItem', 'taskItem', 'taskList', 'panel'].includes(transformedSlice.content.firstChild.type.name)) && (!(0, _utils.isInListItem)(state) || (0, _utils.isInListItem)(state) && isFirstChildTaskNode);
|
|
136
137
|
// If the slice or the selection are valid nodes to handle,
|
|
137
138
|
// and the slice is not a whole node (i.e. openStart is 1 and openEnd is 0)
|
|
138
139
|
// or the slice's first node is a paragraph,
|
package/dist/es2019/handlers.js
CHANGED
|
@@ -107,8 +107,9 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChange
|
|
|
107
107
|
filters.push(applyTextMarksToSlice(schema, selection.$head.marks()));
|
|
108
108
|
}
|
|
109
109
|
const transformedSlice = compose.apply(null, filters)(slice);
|
|
110
|
+
const isFirstChildTaskNode = transformedSlice.content.firstChild.type === taskList || transformedSlice.content.firstChild.type === taskItem;
|
|
110
111
|
const tr = closeHistory(state.tr);
|
|
111
|
-
const transformedSliceIsValidNode = transformedSlice.content.firstChild.type.inlineContent || ['decisionList', 'decisionItem', '
|
|
112
|
+
const transformedSliceIsValidNode = (transformedSlice.content.firstChild.type.inlineContent || ['decisionList', 'decisionItem', 'taskItem', 'taskList', 'panel'].includes(transformedSlice.content.firstChild.type.name)) && (!isInListItem(state) || isInListItem(state) && isFirstChildTaskNode);
|
|
112
113
|
// If the slice or the selection are valid nodes to handle,
|
|
113
114
|
// and the slice is not a whole node (i.e. openStart is 1 and openEnd is 0)
|
|
114
115
|
// or the slice's first node is a paragraph,
|
package/dist/esm/handlers.js
CHANGED
|
@@ -110,8 +110,9 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChange
|
|
|
110
110
|
filters.push(applyTextMarksToSlice(schema, selection.$head.marks()));
|
|
111
111
|
}
|
|
112
112
|
var transformedSlice = compose.apply(null, filters)(slice);
|
|
113
|
+
var isFirstChildTaskNode = transformedSlice.content.firstChild.type === taskList || transformedSlice.content.firstChild.type === taskItem;
|
|
113
114
|
var tr = closeHistory(state.tr);
|
|
114
|
-
var transformedSliceIsValidNode = transformedSlice.content.firstChild.type.inlineContent || ['decisionList', 'decisionItem', '
|
|
115
|
+
var transformedSliceIsValidNode = (transformedSlice.content.firstChild.type.inlineContent || ['decisionList', 'decisionItem', 'taskItem', 'taskList', 'panel'].includes(transformedSlice.content.firstChild.type.name)) && (!isInListItem(state) || isInListItem(state) && isFirstChildTaskNode);
|
|
115
116
|
// If the slice or the selection are valid nodes to handle,
|
|
116
117
|
// and the slice is not a whole node (i.e. openStart is 1 and openEnd is 0)
|
|
117
118
|
// or the slice's first node is a paragraph,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
".": "./src/index.ts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/editor-common": "^76.
|
|
37
|
-
"@atlaskit/editor-markdown-transformer": "^5.
|
|
36
|
+
"@atlaskit/editor-common": "^76.39.0",
|
|
37
|
+
"@atlaskit/editor-markdown-transformer": "^5.3.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^0.4.0",
|
|
39
39
|
"@atlaskit/editor-plugin-annotation": "^0.1.0",
|
|
40
40
|
"@atlaskit/editor-plugin-better-type-history": "^0.1.0",
|