@atlaskit/editor-plugin-paste 1.5.6 → 1.6.0
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 +21 -0
- package/dist/cjs/util/index.js +9 -0
- package/dist/es2019/util/index.js +7 -0
- package/dist/esm/util/index.js +9 -0
- package/package.json +15 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 1.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#122895](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122895)
|
|
8
|
+
[`49b8c7658f3b5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/49b8c7658f3b5) -
|
|
9
|
+
[ED-24173] bump @atlaskit/adf-schema to 40.3.0 and @atlassian/adf-schema-json to 1.18.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 1.5.7
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#122612](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122612)
|
|
20
|
+
[`01a85ce0a88ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/01a85ce0a88ec) -
|
|
21
|
+
[ux] ED-23705 Add logic to handle annotations on inline nodes when they are inserted or pasted.
|
|
22
|
+
Covers the following inline nodes: emoji, status, mention, date, inlineCard
|
|
23
|
+
|
|
3
24
|
## 1.5.6
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/cjs/util/index.js
CHANGED
|
@@ -27,6 +27,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
27
27
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
28
28
|
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
29
29
|
var _mediaClient = require("@atlaskit/media-client");
|
|
30
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
30
31
|
function isPastedFromWord(html) {
|
|
31
32
|
return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
|
|
32
33
|
}
|
|
@@ -117,6 +118,14 @@ function applyTextMarksToSlice(schema, marks) {
|
|
|
117
118
|
}))).sort((0, _legacyRankPlugins.sortByOrderWithTypeName)('marks'));
|
|
118
119
|
return false;
|
|
119
120
|
}
|
|
121
|
+
if ((0, _platformFeatureFlags.fg)('editor_inline_comments_paste_insert_nodes')) {
|
|
122
|
+
if (node.isInline && ['inlineCard', 'emoji', 'status', 'date', 'mention'].includes(node.type.name) && parent && parent.isBlock) {
|
|
123
|
+
// @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
|
|
124
|
+
node.marks = [].concat((0, _toConsumableArray2.default)(node.marks), (0, _toConsumableArray2.default)(parent.type.allowedMarks(marks).filter(function (mark) {
|
|
125
|
+
return mark.type === schema.marks.annotation;
|
|
126
|
+
})));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
120
129
|
return true;
|
|
121
130
|
});
|
|
122
131
|
return sliceCopy;
|
|
@@ -6,6 +6,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
6
6
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
8
8
|
import { isMediaBlobUrl } from '@atlaskit/media-client';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
export function isPastedFromWord(html) {
|
|
10
11
|
return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
|
|
11
12
|
}
|
|
@@ -98,6 +99,12 @@ export function applyTextMarksToSlice(schema, marks) {
|
|
|
98
99
|
...parent.type.allowedMarks(marks).filter(mark => mark.type !== linkMark)].sort(sortByOrderWithTypeName('marks'));
|
|
99
100
|
return false;
|
|
100
101
|
}
|
|
102
|
+
if (fg('editor_inline_comments_paste_insert_nodes')) {
|
|
103
|
+
if (node.isInline && ['inlineCard', 'emoji', 'status', 'date', 'mention'].includes(node.type.name) && parent && parent.isBlock) {
|
|
104
|
+
// @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
|
|
105
|
+
node.marks = [...node.marks, ...parent.type.allowedMarks(marks).filter(mark => mark.type === schema.marks.annotation)];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
101
108
|
return true;
|
|
102
109
|
});
|
|
103
110
|
return sliceCopy;
|
package/dist/esm/util/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
7
7
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
9
9
|
import { isMediaBlobUrl } from '@atlaskit/media-client';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
export function isPastedFromWord(html) {
|
|
11
12
|
return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
|
|
12
13
|
}
|
|
@@ -97,6 +98,14 @@ export function applyTextMarksToSlice(schema, marks) {
|
|
|
97
98
|
}))).sort(sortByOrderWithTypeName('marks'));
|
|
98
99
|
return false;
|
|
99
100
|
}
|
|
101
|
+
if (fg('editor_inline_comments_paste_insert_nodes')) {
|
|
102
|
+
if (node.isInline && ['inlineCard', 'emoji', 'status', 'date', 'mention'].includes(node.type.name) && parent && parent.isBlock) {
|
|
103
|
+
// @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
|
|
104
|
+
node.marks = [].concat(_toConsumableArray(node.marks), _toConsumableArray(parent.type.allowedMarks(marks).filter(function (mark) {
|
|
105
|
+
return mark.type === schema.marks.annotation;
|
|
106
|
+
})));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
100
109
|
return true;
|
|
101
110
|
});
|
|
102
111
|
return sliceCopy;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
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": "^86.
|
|
37
|
-
"@atlaskit/editor-markdown-transformer": "^5.
|
|
38
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
39
|
-
"@atlaskit/editor-plugin-annotation": "^1.
|
|
40
|
-
"@atlaskit/editor-plugin-better-type-history": "^1.
|
|
41
|
-
"@atlaskit/editor-plugin-card": "^2.
|
|
36
|
+
"@atlaskit/editor-common": "^86.7.0",
|
|
37
|
+
"@atlaskit/editor-markdown-transformer": "^5.9.0",
|
|
38
|
+
"@atlaskit/editor-plugin-analytics": "^1.5.0",
|
|
39
|
+
"@atlaskit/editor-plugin-annotation": "^1.17.0",
|
|
40
|
+
"@atlaskit/editor-plugin-better-type-history": "^1.5.0",
|
|
41
|
+
"@atlaskit/editor-plugin-card": "^2.7.0",
|
|
42
42
|
"@atlaskit/editor-plugin-feature-flags": "^1.1.0",
|
|
43
|
-
"@atlaskit/editor-plugin-list": "^3.
|
|
44
|
-
"@atlaskit/editor-plugin-media": "^1.
|
|
43
|
+
"@atlaskit/editor-plugin-list": "^3.6.0",
|
|
44
|
+
"@atlaskit/editor-plugin-media": "^1.26.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",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@af/visual-regression": "*",
|
|
59
|
-
"@atlaskit/adf-schema": "^
|
|
60
|
-
"@atlaskit/editor-plugin-block-type": "^3.
|
|
59
|
+
"@atlaskit/adf-schema": "^40.3.0",
|
|
60
|
+
"@atlaskit/editor-plugin-block-type": "^3.9.0",
|
|
61
61
|
"@atlaskit/editor-plugin-history": "^1.1.0",
|
|
62
|
-
"@atlaskit/editor-plugin-type-ahead": "^1.
|
|
62
|
+
"@atlaskit/editor-plugin-type-ahead": "^1.5.0",
|
|
63
63
|
"@atlaskit/ssr": "*",
|
|
64
64
|
"@atlaskit/visual-regression": "*",
|
|
65
65
|
"@atlassian/feature-flags-test-utils": "^0.2.0",
|
|
@@ -130,6 +130,9 @@
|
|
|
130
130
|
},
|
|
131
131
|
"platform.editor.preserve-whitespace-clipboard-text-serialization": {
|
|
132
132
|
"type": "boolean"
|
|
133
|
+
},
|
|
134
|
+
"editor_inline_comments_paste_insert_nodes": {
|
|
135
|
+
"type": "boolean"
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
138
|
}
|