@atlaskit/editor-plugin-paste 1.5.2 → 1.5.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
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 1.5.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.5.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#118497](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/118497)
|
|
14
|
+
[`5b4bfa8be2106`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5b4bfa8be2106) -
|
|
15
|
+
Cleanup FF that improves paste behaviour of markdown tables in tables.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 1.5.2
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -134,7 +134,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
136
|
handlePaste: function handlePaste(view, rawEvent, slice) {
|
|
137
|
-
var _text, _pluginInjectionApi$a2, _analyticsPlugin$perf, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m;
|
|
137
|
+
var _text, _pluginInjectionApi$a2, _analyticsPlugin$perf, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m, _schema$nodes$table;
|
|
138
138
|
var event = rawEvent;
|
|
139
139
|
if (!event.clipboardData) {
|
|
140
140
|
return false;
|
|
@@ -336,12 +336,11 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
336
336
|
return true;
|
|
337
337
|
}
|
|
338
338
|
var isNestedMarkdownTable = false;
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
339
|
+
|
|
340
|
+
// if paste a markdown table inside a table cell, we should treat it as a table slice
|
|
341
|
+
var isParentNodeTdOrTh = selectionParentType === schema.nodes.tableCell || selectionParentType === schema.nodes.tableHeader;
|
|
342
|
+
isNestedMarkdownTable = !!(markdownSlice && isPlainText && isParentNodeTdOrTh && (0, _analytics2.getContentNodeTypes)(markdownSlice.content).includes((_schema$nodes$table = schema.nodes.table) === null || _schema$nodes$table === void 0 ? void 0 : _schema$nodes$table.name));
|
|
343
|
+
slice = isNestedMarkdownTable ? markdownSlice : slice;
|
|
345
344
|
|
|
346
345
|
// If the clipboard only contains plain text, attempt to parse it as Markdown
|
|
347
346
|
if (isPlainText && markdownSlice && !isNestedMarkdownTable) {
|
|
@@ -98,7 +98,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
handlePaste(view, rawEvent, slice) {
|
|
101
|
-
var _text, _pluginInjectionApi$a2, _pluginInjectionApi$a3, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m;
|
|
101
|
+
var _text, _pluginInjectionApi$a2, _pluginInjectionApi$a3, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m, _schema$nodes$table;
|
|
102
102
|
const event = rawEvent;
|
|
103
103
|
if (!event.clipboardData) {
|
|
104
104
|
return false;
|
|
@@ -305,12 +305,11 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
305
305
|
return true;
|
|
306
306
|
}
|
|
307
307
|
let isNestedMarkdownTable = false;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
308
|
+
|
|
309
|
+
// if paste a markdown table inside a table cell, we should treat it as a table slice
|
|
310
|
+
const isParentNodeTdOrTh = selectionParentType === schema.nodes.tableCell || selectionParentType === schema.nodes.tableHeader;
|
|
311
|
+
isNestedMarkdownTable = !!(markdownSlice && isPlainText && isParentNodeTdOrTh && getContentNodeTypes(markdownSlice.content).includes((_schema$nodes$table = schema.nodes.table) === null || _schema$nodes$table === void 0 ? void 0 : _schema$nodes$table.name));
|
|
312
|
+
slice = isNestedMarkdownTable ? markdownSlice : slice;
|
|
314
313
|
|
|
315
314
|
// If the clipboard only contains plain text, attempt to parse it as Markdown
|
|
316
315
|
if (isPlainText && markdownSlice && !isNestedMarkdownTable) {
|
|
@@ -121,7 +121,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
handlePaste: function handlePaste(view, rawEvent, slice) {
|
|
124
|
-
var _text, _pluginInjectionApi$a2, _analyticsPlugin$perf, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m;
|
|
124
|
+
var _text, _pluginInjectionApi$a2, _analyticsPlugin$perf, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m, _schema$nodes$table;
|
|
125
125
|
var event = rawEvent;
|
|
126
126
|
if (!event.clipboardData) {
|
|
127
127
|
return false;
|
|
@@ -323,12 +323,11 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
323
323
|
return true;
|
|
324
324
|
}
|
|
325
325
|
var isNestedMarkdownTable = false;
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
326
|
+
|
|
327
|
+
// if paste a markdown table inside a table cell, we should treat it as a table slice
|
|
328
|
+
var isParentNodeTdOrTh = selectionParentType === schema.nodes.tableCell || selectionParentType === schema.nodes.tableHeader;
|
|
329
|
+
isNestedMarkdownTable = !!(markdownSlice && isPlainText && isParentNodeTdOrTh && getContentNodeTypes(markdownSlice.content).includes((_schema$nodes$table = schema.nodes.table) === null || _schema$nodes$table === void 0 ? void 0 : _schema$nodes$table.name));
|
|
330
|
+
slice = isNestedMarkdownTable ? markdownSlice : slice;
|
|
332
331
|
|
|
333
332
|
// If the clipboard only contains plain text, attempt to parse it as Markdown
|
|
334
333
|
if (isPlainText && markdownSlice && !isNestedMarkdownTable) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
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": "^
|
|
36
|
+
"@atlaskit/editor-common": "^85.0.0",
|
|
37
37
|
"@atlaskit/editor-markdown-transformer": "^5.8.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
39
|
-
"@atlaskit/editor-plugin-annotation": "^1.
|
|
39
|
+
"@atlaskit/editor-plugin-annotation": "^1.15.0",
|
|
40
40
|
"@atlaskit/editor-plugin-better-type-history": "^1.4.0",
|
|
41
|
-
"@atlaskit/editor-plugin-card": "^2.
|
|
41
|
+
"@atlaskit/editor-plugin-card": "^2.6.0",
|
|
42
42
|
"@atlaskit/editor-plugin-feature-flags": "^1.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-list": "^3.5.0",
|
|
44
|
-
"@atlaskit/editor-plugin-media": "^1.
|
|
44
|
+
"@atlaskit/editor-plugin-media": "^1.24.0",
|
|
45
45
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
46
46
|
"@atlaskit/editor-tables": "^2.7.0",
|
|
47
47
|
"@atlaskit/media-client": "^27.3.0",
|
|
@@ -128,9 +128,6 @@
|
|
|
128
128
|
"platform.editor.multi-bodied-extension_0rygg": {
|
|
129
129
|
"type": "boolean"
|
|
130
130
|
},
|
|
131
|
-
"platform.editor.paste-markdown-table-in-a-table": {
|
|
132
|
-
"type": "boolean"
|
|
133
|
-
},
|
|
134
131
|
"platform.editor.extractlistfromparagraphv2": {
|
|
135
132
|
"type": "boolean"
|
|
136
133
|
},
|