@atlaskit/editor-plugin-paste 0.2.5 → 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 CHANGED
@@ -1,5 +1,17 @@
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
+
9
+ ## 0.2.6
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 0.2.5
4
16
 
5
17
  ### Patch Changes
@@ -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', 'taskList', 'taskItem', 'panel'].includes(transformedSlice.content.firstChild.type.name) && !(0, _utils.isInListItem)(state);
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,
@@ -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', 'taskList', 'taskItem', 'panel'].includes(transformedSlice.content.firstChild.type.name) && !isInListItem(state);
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,
@@ -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', 'taskList', 'taskItem', 'panel'].includes(transformedSlice.content.firstChild.type.name) && !isInListItem(state);
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.5",
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,15 +33,15 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/editor-common": "^76.36.0",
37
- "@atlaskit/editor-markdown-transformer": "^5.2.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",
41
41
  "@atlaskit/editor-plugin-card": "^0.16.0",
42
42
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
43
43
  "@atlaskit/editor-plugin-list": "^3.1.0",
44
- "@atlaskit/editor-plugin-media": "^0.10.0",
44
+ "@atlaskit/editor-plugin-media": "^0.11.0",
45
45
  "@atlaskit/editor-prosemirror": "1.1.0",
46
46
  "@atlaskit/editor-tables": "^2.3.0",
47
47
  "@atlaskit/media-client": "^26.1.0",