@atlaskit/editor-plugin-paste 7.4.4 → 7.4.6
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 +17 -0
- package/dist/cjs/pm-plugins/main.js +3 -3
- package/dist/cjs/pm-plugins/util/index.js +5 -7
- package/dist/es2019/pm-plugins/main.js +4 -4
- package/dist/es2019/pm-plugins/util/index.js +3 -5
- package/dist/esm/pm-plugins/main.js +4 -4
- package/dist/esm/pm-plugins/util/index.js +5 -7
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 7.4.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b14a5fc14cf22`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b14a5fc14cf22) -
|
|
8
|
+
[ux] EDITOR-2606 copy sync block from renderer should flatten out content instead of creating new
|
|
9
|
+
reference
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 7.4.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`4cab7924c4af0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4cab7924c4af0) -
|
|
17
|
+
[ux] Clean up editor_inline_comments_paste_insert_nodes
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 7.4.4
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -347,6 +347,9 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
347
347
|
event: event,
|
|
348
348
|
text: text
|
|
349
349
|
});
|
|
350
|
+
if ((0, _expValEquals.expValEquals)('platform_synced_block', 'isEnabled', true)) {
|
|
351
|
+
slice = (0, _transforms.transformSyncBlock)(slice, schema, (0, _util.getPasteSource)(event));
|
|
352
|
+
}
|
|
350
353
|
var plainTextPasteSlice = (0, _utils.linkifyContent)(state.schema)(slice);
|
|
351
354
|
if ((0, _analytics2.handlePasteAsPlainTextWithAnalytics)(editorAnalyticsAPI)(view, event, plainTextPasteSlice)(state, dispatch, view)) {
|
|
352
355
|
return true;
|
|
@@ -585,9 +588,6 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
585
588
|
slice = (0, _transforms.transformSingleColumnLayout)(slice, schema);
|
|
586
589
|
}
|
|
587
590
|
slice = (0, _transforms.transformSliceToRemoveMacroId)(slice, schema);
|
|
588
|
-
if ((0, _expValEquals.expValEquals)('platform_synced_block', 'isEnabled', true)) {
|
|
589
|
-
slice = (0, _transforms.transformToNewReferenceSyncBlock)(slice, schema);
|
|
590
|
-
}
|
|
591
591
|
return slice;
|
|
592
592
|
},
|
|
593
593
|
transformPastedHTML: function transformPastedHTML(html) {
|
|
@@ -218,13 +218,11 @@ function applyTextMarksToSlice(schema, marks) {
|
|
|
218
218
|
}))).sort((0, _legacyRankPlugins.sortByOrderWithTypeName)('marks'));
|
|
219
219
|
return false;
|
|
220
220
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
})));
|
|
227
|
-
}
|
|
221
|
+
if (node.isInline && ['inlineCard', 'emoji', 'status', 'date', 'mention'].includes(node.type.name) && parent && parent.isBlock) {
|
|
222
|
+
// @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
|
|
223
|
+
node.marks = [].concat((0, _toConsumableArray2.default)(node.marks), (0, _toConsumableArray2.default)(parent.type.allowedMarks(marks).filter(function (mark) {
|
|
224
|
+
return mark.type === schema.marks.annotation;
|
|
225
|
+
})));
|
|
228
226
|
}
|
|
229
227
|
return true;
|
|
230
228
|
});
|
|
@@ -8,7 +8,7 @@ import { isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
|
8
8
|
import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
|
|
9
9
|
import { measureRender } from '@atlaskit/editor-common/performance/measure-render';
|
|
10
10
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
11
|
-
import { transformSingleColumnLayout, transformSingleLineCodeBlockToCodeMark, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId,
|
|
11
|
+
import { transformSingleColumnLayout, transformSingleLineCodeBlockToCodeMark, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId, transformSyncBlock } from '@atlaskit/editor-common/transforms';
|
|
12
12
|
import { containsAnyAnnotations, extractSliceFromStep, linkifyContent, mapChildren } from '@atlaskit/editor-common/utils';
|
|
13
13
|
import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
|
|
14
14
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -309,6 +309,9 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
309
309
|
event,
|
|
310
310
|
text
|
|
311
311
|
});
|
|
312
|
+
if (expValEquals('platform_synced_block', 'isEnabled', true)) {
|
|
313
|
+
slice = transformSyncBlock(slice, schema, getPasteSource(event));
|
|
314
|
+
}
|
|
312
315
|
const plainTextPasteSlice = linkifyContent(state.schema)(slice);
|
|
313
316
|
if (handlePasteAsPlainTextWithAnalytics(editorAnalyticsAPI)(view, event, plainTextPasteSlice)(state, dispatch, view)) {
|
|
314
317
|
return true;
|
|
@@ -547,9 +550,6 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
547
550
|
slice = transformSingleColumnLayout(slice, schema);
|
|
548
551
|
}
|
|
549
552
|
slice = transformSliceToRemoveMacroId(slice, schema);
|
|
550
|
-
if (expValEquals('platform_synced_block', 'isEnabled', true)) {
|
|
551
|
-
slice = transformToNewReferenceSyncBlock(slice, schema);
|
|
552
|
-
}
|
|
553
553
|
return slice;
|
|
554
554
|
},
|
|
555
555
|
transformPastedHTML(html) {
|
|
@@ -198,11 +198,9 @@ export function applyTextMarksToSlice(schema, marks) {
|
|
|
198
198
|
...parent.type.allowedMarks(marks).filter(mark => mark.type !== linkMark)].sort(sortByOrderWithTypeName('marks'));
|
|
199
199
|
return false;
|
|
200
200
|
}
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
node.marks = [...node.marks, ...parent.type.allowedMarks(marks).filter(mark => mark.type === schema.marks.annotation)];
|
|
205
|
-
}
|
|
201
|
+
if (node.isInline && ['inlineCard', 'emoji', 'status', 'date', 'mention'].includes(node.type.name) && parent && parent.isBlock) {
|
|
202
|
+
// @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
|
|
203
|
+
node.marks = [...node.marks, ...parent.type.allowedMarks(marks).filter(mark => mark.type === schema.marks.annotation)];
|
|
206
204
|
}
|
|
207
205
|
return true;
|
|
208
206
|
});
|
|
@@ -13,7 +13,7 @@ import { isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
|
13
13
|
import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
|
|
14
14
|
import { measureRender } from '@atlaskit/editor-common/performance/measure-render';
|
|
15
15
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
16
|
-
import { transformSingleColumnLayout, transformSingleLineCodeBlockToCodeMark, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId,
|
|
16
|
+
import { transformSingleColumnLayout, transformSingleLineCodeBlockToCodeMark, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId, transformSyncBlock } from '@atlaskit/editor-common/transforms';
|
|
17
17
|
import { containsAnyAnnotations, extractSliceFromStep, linkifyContent, mapChildren } from '@atlaskit/editor-common/utils';
|
|
18
18
|
import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
|
|
19
19
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -339,6 +339,9 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
339
339
|
event: event,
|
|
340
340
|
text: text
|
|
341
341
|
});
|
|
342
|
+
if (expValEquals('platform_synced_block', 'isEnabled', true)) {
|
|
343
|
+
slice = transformSyncBlock(slice, schema, getPasteSource(event));
|
|
344
|
+
}
|
|
342
345
|
var plainTextPasteSlice = linkifyContent(state.schema)(slice);
|
|
343
346
|
if (handlePasteAsPlainTextWithAnalytics(editorAnalyticsAPI)(view, event, plainTextPasteSlice)(state, dispatch, view)) {
|
|
344
347
|
return true;
|
|
@@ -577,9 +580,6 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
577
580
|
slice = transformSingleColumnLayout(slice, schema);
|
|
578
581
|
}
|
|
579
582
|
slice = transformSliceToRemoveMacroId(slice, schema);
|
|
580
|
-
if (expValEquals('platform_synced_block', 'isEnabled', true)) {
|
|
581
|
-
slice = transformToNewReferenceSyncBlock(slice, schema);
|
|
582
|
-
}
|
|
583
583
|
return slice;
|
|
584
584
|
},
|
|
585
585
|
transformPastedHTML: function transformPastedHTML(html) {
|
|
@@ -197,13 +197,11 @@ export function applyTextMarksToSlice(schema, marks) {
|
|
|
197
197
|
}))).sort(sortByOrderWithTypeName('marks'));
|
|
198
198
|
return false;
|
|
199
199
|
}
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
})));
|
|
206
|
-
}
|
|
200
|
+
if (node.isInline && ['inlineCard', 'emoji', 'status', 'date', 'mention'].includes(node.type.name) && parent && parent.isBlock) {
|
|
201
|
+
// @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
|
|
202
|
+
node.marks = [].concat(_toConsumableArray(node.marks), _toConsumableArray(parent.type.allowedMarks(marks).filter(function (mark) {
|
|
203
|
+
return mark.type === schema.marks.annotation;
|
|
204
|
+
})));
|
|
207
205
|
}
|
|
208
206
|
return true;
|
|
209
207
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.6",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,17 +41,17 @@
|
|
|
41
41
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
42
42
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
43
43
|
"@atlaskit/insm": "^0.2.0",
|
|
44
|
-
"@atlaskit/media-client": "^35.
|
|
44
|
+
"@atlaskit/media-client": "^35.6.0",
|
|
45
45
|
"@atlaskit/media-common": "^12.3.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^13.38.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"lodash": "^4.17.21",
|
|
50
50
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
51
51
|
"uuid": "^3.1.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@atlaskit/editor-common": "^110.
|
|
54
|
+
"@atlaskit/editor-common": "^110.31.0",
|
|
55
55
|
"react": "^18.2.0",
|
|
56
56
|
"react-dom": "^18.2.0"
|
|
57
57
|
},
|
|
@@ -102,9 +102,6 @@
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
"platform-feature-flags": {
|
|
105
|
-
"editor_inline_comments_paste_insert_nodes": {
|
|
106
|
-
"type": "boolean"
|
|
107
|
-
},
|
|
108
105
|
"platform_editor_use_nested_table_pm_nodes": {
|
|
109
106
|
"type": "boolean"
|
|
110
107
|
},
|