@atlaskit/editor-plugin-paste 7.4.8 → 7.4.9
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 +9 -0
- package/dist/cjs/pm-plugins/main.js +15 -0
- package/dist/cjs/pm-plugins/move-analytics/plugin.js +8 -0
- package/dist/es2019/pm-plugins/main.js +18 -0
- package/dist/es2019/pm-plugins/move-analytics/plugin.js +8 -0
- package/dist/esm/pm-plugins/main.js +15 -0
- package/dist/esm/pm-plugins/move-analytics/plugin.js +8 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 7.4.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
|
|
8
|
+
ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
|
|
9
|
+
project refs are setup
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 7.4.8
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -128,8 +128,12 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
128
128
|
props: {
|
|
129
129
|
// For serialising to plain text
|
|
130
130
|
clipboardTextSerializer: (0, _platformFeatureFlags.fg)('platform_editor_date_to_text') ? (0, _clipboardTextSerializer.createClipboardTextSerializer)(getIntl()) : _clipboardTextSerializer.clipboardTextSerializer,
|
|
131
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
132
|
+
|
|
131
133
|
handleDOMEvents: {
|
|
132
134
|
// note
|
|
135
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
136
|
+
|
|
133
137
|
paste: function paste(view, event) {
|
|
134
138
|
mostRecentPasteEvent = event;
|
|
135
139
|
if ((0, _expValEquals.expValEquals)('cc_editor_interactivity_monitoring', 'isEnabled', true) && event.clipboardData) {
|
|
@@ -139,6 +143,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
139
143
|
}
|
|
140
144
|
},
|
|
141
145
|
// note
|
|
146
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
142
147
|
handlePaste: function handlePaste(view, rawEvent, slice) {
|
|
143
148
|
var _text, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m, _schema$nodes$table;
|
|
144
149
|
var event = rawEvent;
|
|
@@ -264,10 +269,15 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
264
269
|
// appendedTransactions to repair them (if they're partial or incomplete) and we don't want
|
|
265
270
|
// to split those repairing transactions in prosemirror-history when they're being added to the
|
|
266
271
|
// "done" stack
|
|
272
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
273
|
+
|
|
267
274
|
var isPastingTable = tr.steps.some(function (step) {
|
|
268
275
|
var _slice$content;
|
|
269
276
|
var slice = (0, _utils.extractSliceFromStep)(step);
|
|
270
277
|
var tableExists = false;
|
|
278
|
+
|
|
279
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
280
|
+
|
|
271
281
|
slice === null || slice === void 0 || (_slice$content = slice.content) === null || _slice$content === void 0 || _slice$content.forEach(function (node) {
|
|
272
282
|
if (node.type === state.schema.nodes.table) {
|
|
273
283
|
tableExists = true;
|
|
@@ -525,6 +535,9 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
525
535
|
// breakout marks are only valid in the root document.
|
|
526
536
|
if (selectionParentType !== state.schema.nodes.doc) {
|
|
527
537
|
var sliceCopy = _model.Slice.fromJSON(state.schema, slice.toJSON() || {});
|
|
538
|
+
|
|
539
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
540
|
+
|
|
528
541
|
sliceCopy.content.descendants(function (node) {
|
|
529
542
|
// @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
|
|
530
543
|
node.marks = node.marks.filter(function (mark) {
|
|
@@ -560,6 +573,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
560
573
|
}
|
|
561
574
|
return false;
|
|
562
575
|
},
|
|
576
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
563
577
|
transformPasted: function transformPasted(slice) {
|
|
564
578
|
if (sanitizePrivateContent) {
|
|
565
579
|
slice = (0, _handlers.handleMention)(slice, schema);
|
|
@@ -590,6 +604,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
590
604
|
slice = (0, _transforms.transformSliceToRemoveMacroId)(slice, schema);
|
|
591
605
|
return slice;
|
|
592
606
|
},
|
|
607
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
593
608
|
transformPastedHTML: function transformPastedHTML(html) {
|
|
594
609
|
// Fix for issue ED-4438
|
|
595
610
|
// text from google docs should not be pasted as inline code
|
|
@@ -27,11 +27,17 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
27
27
|
key: _pluginKey.pluginKey,
|
|
28
28
|
state: (0, _pluginFactory.createPluginState)(dispatch, _types.defaultState),
|
|
29
29
|
props: {
|
|
30
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
31
|
+
|
|
30
32
|
handleDOMEvents: {
|
|
33
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
34
|
+
|
|
31
35
|
cut: function cut() {
|
|
32
36
|
isCutEvent = true;
|
|
33
37
|
}
|
|
34
38
|
},
|
|
39
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
40
|
+
|
|
35
41
|
handlePaste: function handlePaste(_ref, event, slice) {
|
|
36
42
|
var _content$firstChild;
|
|
37
43
|
var state = _ref.state,
|
|
@@ -69,6 +75,8 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
69
75
|
var updatedTr = (0, _commands.resetContentMovedTransform)()(tr);
|
|
70
76
|
dispatch(updatedTr);
|
|
71
77
|
},
|
|
78
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
79
|
+
|
|
72
80
|
transformCopied: function transformCopied(slice, _ref2) {
|
|
73
81
|
var _content$firstChild2;
|
|
74
82
|
var state = _ref2.state,
|
|
@@ -94,8 +94,12 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
94
94
|
props: {
|
|
95
95
|
// For serialising to plain text
|
|
96
96
|
clipboardTextSerializer: fg('platform_editor_date_to_text') ? createClipboardTextSerializer(getIntl()) : clipboardTextSerializer,
|
|
97
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
98
|
+
|
|
97
99
|
handleDOMEvents: {
|
|
98
100
|
// note
|
|
101
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
102
|
+
|
|
99
103
|
paste: (view, event) => {
|
|
100
104
|
mostRecentPasteEvent = event;
|
|
101
105
|
if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true) && event.clipboardData) {
|
|
@@ -105,6 +109,8 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
105
109
|
}
|
|
106
110
|
},
|
|
107
111
|
// note
|
|
112
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
113
|
+
|
|
108
114
|
handlePaste(view, rawEvent, slice) {
|
|
109
115
|
var _text, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m, _schema$nodes$table;
|
|
110
116
|
const event = rawEvent;
|
|
@@ -226,10 +232,15 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
226
232
|
// appendedTransactions to repair them (if they're partial or incomplete) and we don't want
|
|
227
233
|
// to split those repairing transactions in prosemirror-history when they're being added to the
|
|
228
234
|
// "done" stack
|
|
235
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
236
|
+
|
|
229
237
|
const isPastingTable = tr.steps.some(step => {
|
|
230
238
|
var _slice$content;
|
|
231
239
|
const slice = extractSliceFromStep(step);
|
|
232
240
|
let tableExists = false;
|
|
241
|
+
|
|
242
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
243
|
+
|
|
233
244
|
slice === null || slice === void 0 ? void 0 : (_slice$content = slice.content) === null || _slice$content === void 0 ? void 0 : _slice$content.forEach(node => {
|
|
234
245
|
if (node.type === state.schema.nodes.table) {
|
|
235
246
|
tableExists = true;
|
|
@@ -489,6 +500,9 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
489
500
|
// breakout marks are only valid in the root document.
|
|
490
501
|
if (selectionParentType !== state.schema.nodes.doc) {
|
|
491
502
|
const sliceCopy = Slice.fromJSON(state.schema, slice.toJSON() || {});
|
|
503
|
+
|
|
504
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
505
|
+
|
|
492
506
|
sliceCopy.content.descendants(node => {
|
|
493
507
|
// @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
|
|
494
508
|
node.marks = node.marks.filter(mark => mark.type.name !== 'breakout');
|
|
@@ -522,6 +536,8 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
522
536
|
}
|
|
523
537
|
return false;
|
|
524
538
|
},
|
|
539
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
540
|
+
|
|
525
541
|
transformPasted(slice) {
|
|
526
542
|
if (sanitizePrivateContent) {
|
|
527
543
|
slice = handleMention(slice, schema);
|
|
@@ -552,6 +568,8 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
552
568
|
slice = transformSliceToRemoveMacroId(slice, schema);
|
|
553
569
|
return slice;
|
|
554
570
|
},
|
|
571
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
572
|
+
|
|
555
573
|
transformPastedHTML(html) {
|
|
556
574
|
// Fix for issue ED-4438
|
|
557
575
|
// text from google docs should not be pasted as inline code
|
|
@@ -18,11 +18,17 @@ export const createPlugin = (dispatch, editorAnalyticsAPI) => {
|
|
|
18
18
|
key: pluginKey,
|
|
19
19
|
state: createPluginState(dispatch, defaultState),
|
|
20
20
|
props: {
|
|
21
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
22
|
+
|
|
21
23
|
handleDOMEvents: {
|
|
24
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
25
|
+
|
|
22
26
|
cut: () => {
|
|
23
27
|
isCutEvent = true;
|
|
24
28
|
}
|
|
25
29
|
},
|
|
30
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
31
|
+
|
|
26
32
|
handlePaste: ({
|
|
27
33
|
state,
|
|
28
34
|
dispatch
|
|
@@ -66,6 +72,8 @@ export const createPlugin = (dispatch, editorAnalyticsAPI) => {
|
|
|
66
72
|
const updatedTr = resetContentMovedTransform()(tr);
|
|
67
73
|
dispatch(updatedTr);
|
|
68
74
|
},
|
|
75
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
76
|
+
|
|
69
77
|
transformCopied: (slice, {
|
|
70
78
|
state,
|
|
71
79
|
dispatch
|
|
@@ -120,8 +120,12 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
120
120
|
props: {
|
|
121
121
|
// For serialising to plain text
|
|
122
122
|
clipboardTextSerializer: fg('platform_editor_date_to_text') ? createClipboardTextSerializer(getIntl()) : clipboardTextSerializer,
|
|
123
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
124
|
+
|
|
123
125
|
handleDOMEvents: {
|
|
124
126
|
// note
|
|
127
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
128
|
+
|
|
125
129
|
paste: function paste(view, event) {
|
|
126
130
|
mostRecentPasteEvent = event;
|
|
127
131
|
if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true) && event.clipboardData) {
|
|
@@ -131,6 +135,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
131
135
|
}
|
|
132
136
|
},
|
|
133
137
|
// note
|
|
138
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
134
139
|
handlePaste: function handlePaste(view, rawEvent, slice) {
|
|
135
140
|
var _text, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m, _schema$nodes$table;
|
|
136
141
|
var event = rawEvent;
|
|
@@ -256,10 +261,15 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
256
261
|
// appendedTransactions to repair them (if they're partial or incomplete) and we don't want
|
|
257
262
|
// to split those repairing transactions in prosemirror-history when they're being added to the
|
|
258
263
|
// "done" stack
|
|
264
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
265
|
+
|
|
259
266
|
var isPastingTable = tr.steps.some(function (step) {
|
|
260
267
|
var _slice$content;
|
|
261
268
|
var slice = extractSliceFromStep(step);
|
|
262
269
|
var tableExists = false;
|
|
270
|
+
|
|
271
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
272
|
+
|
|
263
273
|
slice === null || slice === void 0 || (_slice$content = slice.content) === null || _slice$content === void 0 || _slice$content.forEach(function (node) {
|
|
264
274
|
if (node.type === state.schema.nodes.table) {
|
|
265
275
|
tableExists = true;
|
|
@@ -517,6 +527,9 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
517
527
|
// breakout marks are only valid in the root document.
|
|
518
528
|
if (selectionParentType !== state.schema.nodes.doc) {
|
|
519
529
|
var sliceCopy = Slice.fromJSON(state.schema, slice.toJSON() || {});
|
|
530
|
+
|
|
531
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
532
|
+
|
|
520
533
|
sliceCopy.content.descendants(function (node) {
|
|
521
534
|
// @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
|
|
522
535
|
node.marks = node.marks.filter(function (mark) {
|
|
@@ -552,6 +565,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
552
565
|
}
|
|
553
566
|
return false;
|
|
554
567
|
},
|
|
568
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
555
569
|
transformPasted: function transformPasted(slice) {
|
|
556
570
|
if (sanitizePrivateContent) {
|
|
557
571
|
slice = handleMention(slice, schema);
|
|
@@ -582,6 +596,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
582
596
|
slice = transformSliceToRemoveMacroId(slice, schema);
|
|
583
597
|
return slice;
|
|
584
598
|
},
|
|
599
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
585
600
|
transformPastedHTML: function transformPastedHTML(html) {
|
|
586
601
|
// Fix for issue ED-4438
|
|
587
602
|
// text from google docs should not be pasted as inline code
|
|
@@ -21,11 +21,17 @@ export var createPlugin = function createPlugin(dispatch, editorAnalyticsAPI) {
|
|
|
21
21
|
key: pluginKey,
|
|
22
22
|
state: createPluginState(dispatch, defaultState),
|
|
23
23
|
props: {
|
|
24
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
25
|
+
|
|
24
26
|
handleDOMEvents: {
|
|
27
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
28
|
+
|
|
25
29
|
cut: function cut() {
|
|
26
30
|
isCutEvent = true;
|
|
27
31
|
}
|
|
28
32
|
},
|
|
33
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
34
|
+
|
|
29
35
|
handlePaste: function handlePaste(_ref, event, slice) {
|
|
30
36
|
var _content$firstChild;
|
|
31
37
|
var state = _ref.state,
|
|
@@ -63,6 +69,8 @@ export var createPlugin = function createPlugin(dispatch, editorAnalyticsAPI) {
|
|
|
63
69
|
var updatedTr = resetContentMovedTransform()(tr);
|
|
64
70
|
dispatch(updatedTr);
|
|
65
71
|
},
|
|
72
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
73
|
+
|
|
66
74
|
transformCopied: function transformCopied(slice, _ref2) {
|
|
67
75
|
var _content$firstChild2;
|
|
68
76
|
var state = _ref2.state,
|
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.9",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
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.42.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.34.0",
|
|
55
55
|
"react": "^18.2.0",
|
|
56
56
|
"react-dom": "^18.2.0"
|
|
57
57
|
},
|