@atlaskit/editor-plugin-paste 2.1.0 → 2.1.2
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 +15 -0
- package/dist/cjs/pm-plugins/analytics.js +2 -2
- package/dist/cjs/pm-plugins/main.js +7 -0
- package/dist/cjs/pm-plugins/util/edge-cases/handleVSCodeBlock.js +42 -0
- package/dist/cjs/pm-plugins/util/edge-cases/index.js +10 -3
- package/dist/cjs/pm-plugins/util/handlers.js +45 -10
- package/dist/es2019/pm-plugins/main.js +7 -0
- package/dist/es2019/pm-plugins/util/edge-cases/handleVSCodeBlock.js +37 -0
- package/dist/es2019/pm-plugins/util/edge-cases/index.js +10 -3
- package/dist/es2019/pm-plugins/util/handlers.js +48 -11
- package/dist/esm/pm-plugins/analytics.js +4 -3
- package/dist/esm/pm-plugins/main.js +7 -0
- package/dist/esm/pm-plugins/util/edge-cases/handleVSCodeBlock.js +36 -0
- package/dist/esm/pm-plugins/util/edge-cases/index.js +10 -3
- package/dist/esm/pm-plugins/util/handlers.js +45 -11
- package/dist/types/pm-plugins/util/edge-cases/handleVSCodeBlock.d.ts +10 -0
- package/dist/types/pm-plugins/util/handlers.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/util/edge-cases/handleVSCodeBlock.d.ts +10 -0
- package/dist/types-ts4.5/pm-plugins/util/handlers.d.ts +1 -0
- package/package.json +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 2.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#103729](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103729)
|
|
14
|
+
[`3188f307d178a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3188f307d178a) -
|
|
15
|
+
ED-25321: fixes issue where pasting action/task item into the middle of a list item will paste in
|
|
16
|
+
the wrong location and create an extra empty task item
|
|
17
|
+
|
|
3
18
|
## 2.1.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -410,12 +410,12 @@ var createPasteMeasurePayload = exports.createPasteMeasurePayload = function cre
|
|
|
410
410
|
}
|
|
411
411
|
};
|
|
412
412
|
};
|
|
413
|
-
var
|
|
413
|
+
var _getContentNodeTypes = exports.getContentNodeTypes = function getContentNodeTypes(content) {
|
|
414
414
|
var nodeTypes = new Set();
|
|
415
415
|
if (content.size) {
|
|
416
416
|
content.forEach(function (node) {
|
|
417
417
|
if (node.content && node.content.size) {
|
|
418
|
-
nodeTypes = new Set([].concat((0, _toConsumableArray2.default)(nodeTypes), (0, _toConsumableArray2.default)(
|
|
418
|
+
nodeTypes = new Set([].concat((0, _toConsumableArray2.default)(nodeTypes), (0, _toConsumableArray2.default)(_getContentNodeTypes(node.content))));
|
|
419
419
|
}
|
|
420
420
|
nodeTypes.add(node.type.name);
|
|
421
421
|
});
|
|
@@ -30,6 +30,7 @@ var _analytics2 = require("./analytics");
|
|
|
30
30
|
var _clipboardTextSerializer = require("./clipboard-text-serializer");
|
|
31
31
|
var _pluginFactory = require("./plugin-factory");
|
|
32
32
|
var _util = require("./util");
|
|
33
|
+
var _handleVSCodeBlock = require("./util/edge-cases/handleVSCodeBlock");
|
|
33
34
|
var _handlers = require("./util/handlers");
|
|
34
35
|
var _tinyMCE = require("./util/tinyMCE");
|
|
35
36
|
var isInsideBlockQuote = exports.isInsideBlockQuote = function isInsideBlockQuote(state) {
|
|
@@ -275,6 +276,12 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
275
276
|
view.dispatch(tr.setMeta('uiEvent', 'paste'));
|
|
276
277
|
};
|
|
277
278
|
slice = (0, _handlers.handleParagraphBlockMarks)(state, slice);
|
|
279
|
+
slice = (0, _handleVSCodeBlock.handleVSCodeBlock)({
|
|
280
|
+
state: state,
|
|
281
|
+
slice: slice,
|
|
282
|
+
event: event,
|
|
283
|
+
text: text
|
|
284
|
+
});
|
|
278
285
|
var plainTextPasteSlice = (0, _utils.linkifyContent)(state.schema)(slice);
|
|
279
286
|
if ((0, _analytics2.handlePasteAsPlainTextWithAnalytics)(editorAnalyticsAPI)(view, event, plainTextPasteSlice)(state, dispatch, view)) {
|
|
280
287
|
return true;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.handleVSCodeBlock = handleVSCodeBlock;
|
|
7
|
+
var _constants = require("@atlaskit/code/constants");
|
|
8
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
+
function safelyGetVSCodeLanguage(editorData) {
|
|
11
|
+
try {
|
|
12
|
+
var vscodeData = editorData ? JSON.parse(editorData) : undefined;
|
|
13
|
+
return vscodeData === null || vscodeData === void 0 ? void 0 : vscodeData.mode;
|
|
14
|
+
} catch (_e) {}
|
|
15
|
+
}
|
|
16
|
+
function handleVSCodeBlock(_ref) {
|
|
17
|
+
var _event$clipboardData;
|
|
18
|
+
var state = _ref.state,
|
|
19
|
+
slice = _ref.slice,
|
|
20
|
+
text = _ref.text,
|
|
21
|
+
event = _ref.event;
|
|
22
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_vs_code_block_paste')) {
|
|
23
|
+
return slice;
|
|
24
|
+
}
|
|
25
|
+
var vscodeData = event === null || event === void 0 || (_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.getData('vscode-editor-data');
|
|
26
|
+
var language = safelyGetVSCodeLanguage(vscodeData);
|
|
27
|
+
if (text && language && _constants.SUPPORTED_LANGUAGES.some(function (l) {
|
|
28
|
+
return l.alias[0] === language;
|
|
29
|
+
})) {
|
|
30
|
+
var schema = state.schema;
|
|
31
|
+
slice = (0, _utils.mapSlice)(slice, function (node) {
|
|
32
|
+
var _schema$nodes$codeBlo;
|
|
33
|
+
if (node.type.name === ((_schema$nodes$codeBlo = schema.nodes.codeBlock) === null || _schema$nodes$codeBlo === void 0 ? void 0 : _schema$nodes$codeBlo.name)) {
|
|
34
|
+
return schema.nodes.codeBlock.createChecked({
|
|
35
|
+
language: language
|
|
36
|
+
}, schema.text(text));
|
|
37
|
+
}
|
|
38
|
+
return node;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return slice;
|
|
42
|
+
}
|
|
@@ -12,6 +12,7 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
12
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
13
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
14
14
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _index = require("../index");
|
|
16
17
|
var _lists = require("./lists");
|
|
17
18
|
function insertSliceForLists(_ref) {
|
|
@@ -105,9 +106,15 @@ function insertSliceForTaskInsideList(_ref5) {
|
|
|
105
106
|
slice = _ref5.slice;
|
|
106
107
|
var schema = tr.doc.type.schema;
|
|
107
108
|
//To avoid the list being replaced with the tasklist, enclose the slice within a taskItem.
|
|
109
|
+
var selectionBeforeReplace = tr.selection.from;
|
|
108
110
|
tr.replaceSelection(new _model.Slice(_model.Fragment.from(schema.nodes.taskItem.createAndFill()), 0, 0));
|
|
109
|
-
|
|
110
|
-
tr
|
|
111
|
-
|
|
111
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_fix_paste_action_item_in_list')) {
|
|
112
|
+
var nextSelection = _state.Selection.near(tr.doc.resolve(selectionBeforeReplace + 1));
|
|
113
|
+
tr.setSelection(nextSelection);
|
|
114
|
+
} else {
|
|
115
|
+
updateSelectionAfterReplace({
|
|
116
|
+
tr: tr
|
|
117
|
+
});
|
|
118
|
+
}
|
|
112
119
|
tr.replaceSelection(slice);
|
|
113
120
|
}
|
|
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.checkIfSelectionInNestedList = checkIfSelectionInNestedList;
|
|
7
8
|
exports.checkTaskListInList = checkTaskListInList;
|
|
8
9
|
exports.doesSelectionWhichStartsOrEndsInListContainEntireList = void 0;
|
|
9
10
|
exports.flattenNestedListInSlice = flattenNestedListInSlice;
|
|
@@ -40,6 +41,7 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
40
41
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
41
42
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
42
43
|
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
44
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
43
45
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
44
46
|
var _commands = require("../../editor-commands/commands");
|
|
45
47
|
var _main = require("../main");
|
|
@@ -265,16 +267,22 @@ function handlePasteNonNestableBlockNodesIntoList(slice) {
|
|
|
265
267
|
var listItemWrappingOffset = $to.depth - selectionParentListNodeWithPos.depth; // difference in depth between to position and list item node
|
|
266
268
|
|
|
267
269
|
// Anything to do with nested lists should safeInsert and not be handled here
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
270
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_fix_paste_action_item_in_list')) {
|
|
271
|
+
if (checkIfSelectionInNestedList(state)) {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
} else {
|
|
275
|
+
var grandParentListNode = (0, _utils2.findParentNodeOfTypeClosestToPos)(tr.doc.resolve(selectionParentListNodeWithPos.pos), [bulletList, orderedList]);
|
|
276
|
+
var selectionIsInNestedList = !!grandParentListNode;
|
|
277
|
+
var selectedListItemHasNestedList = false;
|
|
278
|
+
selectionParentListItemNode.node.content.forEach(function (child) {
|
|
279
|
+
if ((0, _utils.isListNode)(child)) {
|
|
280
|
+
selectedListItemHasNestedList = true;
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
if (selectedListItemHasNestedList || selectionIsInNestedList) {
|
|
284
|
+
return false;
|
|
274
285
|
}
|
|
275
|
-
});
|
|
276
|
-
if (selectedListItemHasNestedList || selectionIsInNestedList) {
|
|
277
|
-
return false;
|
|
278
286
|
}
|
|
279
287
|
|
|
280
288
|
// Node after the insert position
|
|
@@ -1057,7 +1065,7 @@ function handleRichText(slice, queueCardsFromChangedTr, isNestingMediaOrCodebloc
|
|
|
1057
1065
|
});
|
|
1058
1066
|
if ((0, _utils.insideTableCell)(state) && (0, _utils.isInListItem)(state) && (0, _utils2.canInsert)(selection.$from, slice.content) && (0, _utils2.canInsert)(selection.$to, slice.content) || sliceHasList) {
|
|
1059
1067
|
tr.replaceSelection(slice);
|
|
1060
|
-
} else if (checkTaskListInList(state, slice)) {
|
|
1068
|
+
} else if (checkTaskListInList(state, slice) && (!(0, _platformFeatureFlags.fg)('platform_editor_fix_paste_action_item_in_list') || !checkIfSelectionInNestedList(state))) {
|
|
1061
1069
|
(0, _edgeCases.insertSliceForTaskInsideList)({
|
|
1062
1070
|
tr: tr,
|
|
1063
1071
|
slice: slice
|
|
@@ -1066,6 +1074,11 @@ function handleRichText(slice, queueCardsFromChangedTr, isNestingMediaOrCodebloc
|
|
|
1066
1074
|
// need safeInsert rather than replaceSelection, so that nodes aren't split in half
|
|
1067
1075
|
// e.g. when pasting a layout into a table, replaceSelection splits the table in half and adds the layout in the middle
|
|
1068
1076
|
tr = (0, _utils2.safeInsert)(slice.content, tr.selection.$to.pos)(tr);
|
|
1077
|
+
if (checkTaskListInList(state, slice) && (0, _platformFeatureFlags.fg)('platform_editor_fix_paste_action_item_in_list')) {
|
|
1078
|
+
(0, _edgeCases.updateSelectionAfterReplace)({
|
|
1079
|
+
tr: tr
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1069
1082
|
}
|
|
1070
1083
|
}
|
|
1071
1084
|
tr.setStoredMarks([]);
|
|
@@ -1119,4 +1132,26 @@ var handleSelectedTable = exports.handleSelectedTable = function handleSelectedT
|
|
|
1119
1132
|
function checkTaskListInList(state, slice) {
|
|
1120
1133
|
var _slice$content$firstC4;
|
|
1121
1134
|
return Boolean((0, _utils.isInListItem)(state) && ['taskList', 'taskItem'].includes(((_slice$content$firstC4 = slice.content.firstChild) === null || _slice$content$firstC4 === void 0 || (_slice$content$firstC4 = _slice$content$firstC4.type) === null || _slice$content$firstC4 === void 0 ? void 0 : _slice$content$firstC4.name) || ''));
|
|
1135
|
+
}
|
|
1136
|
+
function checkIfSelectionInNestedList(state) {
|
|
1137
|
+
var selection = state.selection,
|
|
1138
|
+
tr = state.tr;
|
|
1139
|
+
var _state$schema$nodes5 = state.schema.nodes,
|
|
1140
|
+
orderedList = _state$schema$nodes5.orderedList,
|
|
1141
|
+
bulletList = _state$schema$nodes5.bulletList,
|
|
1142
|
+
listItem = _state$schema$nodes5.listItem;
|
|
1143
|
+
var selectionParentListItemNode = (0, _utils2.findParentNodeOfType)(listItem)(selection);
|
|
1144
|
+
var selectionParentListNodeWithPos = (0, _utils2.findParentNodeOfType)([bulletList, orderedList])(selection);
|
|
1145
|
+
if (!selectionParentListItemNode || !selectionParentListNodeWithPos) {
|
|
1146
|
+
return false;
|
|
1147
|
+
}
|
|
1148
|
+
var grandParentListNode = (0, _utils2.findParentNodeOfTypeClosestToPos)(tr.doc.resolve(selectionParentListNodeWithPos.pos), [bulletList, orderedList]);
|
|
1149
|
+
var selectionIsInNestedList = !!grandParentListNode;
|
|
1150
|
+
var selectedListItemHasNestedList = false;
|
|
1151
|
+
selectionParentListItemNode.node.content.forEach(function (child) {
|
|
1152
|
+
if ((0, _utils.isListNode)(child)) {
|
|
1153
|
+
selectedListItemHasNestedList = true;
|
|
1154
|
+
}
|
|
1155
|
+
});
|
|
1156
|
+
return selectedListItemHasNestedList || selectionIsInNestedList;
|
|
1122
1157
|
}
|
|
@@ -20,6 +20,7 @@ import { createPasteMeasurePayload, getContentNodeTypes, handleCodeBlockWithAnal
|
|
|
20
20
|
import { clipboardTextSerializer } from './clipboard-text-serializer';
|
|
21
21
|
import { createPluginState, pluginKey as stateKey } from './plugin-factory';
|
|
22
22
|
import { escapeLinks, getPasteSource, htmlContainsSingleFile, htmlHasInvalidLinkTags, isPastedFromExcel, isPastedFromWord, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline } from './util';
|
|
23
|
+
import { handleVSCodeBlock } from './util/edge-cases/handleVSCodeBlock';
|
|
23
24
|
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks, handleTableContentPasteInBodiedExtension } from './util/handlers';
|
|
24
25
|
import { htmlHasIncompleteTable, isPastedFromTinyMCEConfluence, tryRebuildCompleteTableHtml } from './util/tinyMCE';
|
|
25
26
|
export const isInsideBlockQuote = state => {
|
|
@@ -249,6 +250,12 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
249
250
|
view.dispatch(tr.setMeta('uiEvent', 'paste'));
|
|
250
251
|
};
|
|
251
252
|
slice = handleParagraphBlockMarks(state, slice);
|
|
253
|
+
slice = handleVSCodeBlock({
|
|
254
|
+
state,
|
|
255
|
+
slice,
|
|
256
|
+
event,
|
|
257
|
+
text
|
|
258
|
+
});
|
|
252
259
|
const plainTextPasteSlice = linkifyContent(state.schema)(slice);
|
|
253
260
|
if (handlePasteAsPlainTextWithAnalytics(editorAnalyticsAPI)(view, event, plainTextPasteSlice)(state, dispatch, view)) {
|
|
254
261
|
return true;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SUPPORTED_LANGUAGES } from '@atlaskit/code/constants';
|
|
2
|
+
import { mapSlice } from '@atlaskit/editor-common/utils';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
function safelyGetVSCodeLanguage(editorData) {
|
|
5
|
+
try {
|
|
6
|
+
const vscodeData = editorData ? JSON.parse(editorData) : undefined;
|
|
7
|
+
return vscodeData === null || vscodeData === void 0 ? void 0 : vscodeData.mode;
|
|
8
|
+
} catch (_e) {}
|
|
9
|
+
}
|
|
10
|
+
export function handleVSCodeBlock({
|
|
11
|
+
state,
|
|
12
|
+
slice,
|
|
13
|
+
text,
|
|
14
|
+
event
|
|
15
|
+
}) {
|
|
16
|
+
var _event$clipboardData;
|
|
17
|
+
if (!fg('platform_editor_vs_code_block_paste')) {
|
|
18
|
+
return slice;
|
|
19
|
+
}
|
|
20
|
+
const vscodeData = event === null || event === void 0 ? void 0 : (_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.getData('vscode-editor-data');
|
|
21
|
+
const language = safelyGetVSCodeLanguage(vscodeData);
|
|
22
|
+
if (text && language && SUPPORTED_LANGUAGES.some(l => l.alias[0] === language)) {
|
|
23
|
+
const {
|
|
24
|
+
schema
|
|
25
|
+
} = state;
|
|
26
|
+
slice = mapSlice(slice, node => {
|
|
27
|
+
var _schema$nodes$codeBlo;
|
|
28
|
+
if (node.type.name === ((_schema$nodes$codeBlo = schema.nodes.codeBlock) === null || _schema$nodes$codeBlo === void 0 ? void 0 : _schema$nodes$codeBlo.name)) {
|
|
29
|
+
return schema.nodes.codeBlock.createChecked({
|
|
30
|
+
language
|
|
31
|
+
}, schema.text(text));
|
|
32
|
+
}
|
|
33
|
+
return node;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return slice;
|
|
37
|
+
}
|
|
@@ -3,6 +3,7 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
5
5
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { isCursorSelectionAtTextStartOrEnd, isEmptyNode, isSelectionInsidePanel } from '../index';
|
|
7
8
|
import { insertSliceAtNodeEdge, insertSliceInsideOfPanelNodeSelected, insertSliceIntoEmptyNode, insertSliceIntoRangeSelectionInsideList } from './lists';
|
|
8
9
|
export function insertSliceForLists({
|
|
@@ -108,9 +109,15 @@ export function insertSliceForTaskInsideList({
|
|
|
108
109
|
schema
|
|
109
110
|
} = tr.doc.type;
|
|
110
111
|
//To avoid the list being replaced with the tasklist, enclose the slice within a taskItem.
|
|
112
|
+
const selectionBeforeReplace = tr.selection.from;
|
|
111
113
|
tr.replaceSelection(new Slice(Fragment.from(schema.nodes.taskItem.createAndFill()), 0, 0));
|
|
112
|
-
|
|
113
|
-
tr
|
|
114
|
-
|
|
114
|
+
if (fg('platform_editor_fix_paste_action_item_in_list')) {
|
|
115
|
+
const nextSelection = Selection.near(tr.doc.resolve(selectionBeforeReplace + 1));
|
|
116
|
+
tr.setSelection(nextSelection);
|
|
117
|
+
} else {
|
|
118
|
+
updateSelectionAfterReplace({
|
|
119
|
+
tr
|
|
120
|
+
});
|
|
121
|
+
}
|
|
115
122
|
tr.replaceSelection(slice);
|
|
116
123
|
}
|
|
@@ -10,13 +10,14 @@ import { Fragment, Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/mo
|
|
|
10
10
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { canInsert, contains, findParentNodeOfType, findParentNodeOfTypeClosestToPos, hasParentNode, hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
12
12
|
import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
15
|
// TODO: ED-20519 Needs Macro extraction
|
|
15
16
|
|
|
16
17
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from '../../editor-commands/commands';
|
|
17
18
|
import { isInsideBlockQuote } from '../main';
|
|
18
19
|
import { getPluginState as getPastePluginState } from '../plugin-factory';
|
|
19
|
-
import { insertSliceForLists, insertSliceForTaskInsideList, insertSliceInsideBlockquote } from './edge-cases';
|
|
20
|
+
import { insertSliceForLists, insertSliceForTaskInsideList, insertSliceInsideBlockquote, updateSelectionAfterReplace } from './edge-cases';
|
|
20
21
|
import { insertSliceInsideOfPanelNodeSelected } from './edge-cases/lists';
|
|
21
22
|
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType, isEmptyNode, isSelectionInsidePanel } from './index';
|
|
22
23
|
const insideExpand = state => {
|
|
@@ -243,16 +244,22 @@ export function handlePasteNonNestableBlockNodesIntoList(slice) {
|
|
|
243
244
|
const listItemWrappingOffset = $to.depth - selectionParentListNodeWithPos.depth; // difference in depth between to position and list item node
|
|
244
245
|
|
|
245
246
|
// Anything to do with nested lists should safeInsert and not be handled here
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
247
|
+
if (fg('platform_editor_fix_paste_action_item_in_list')) {
|
|
248
|
+
if (checkIfSelectionInNestedList(state)) {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
const grandParentListNode = findParentNodeOfTypeClosestToPos(tr.doc.resolve(selectionParentListNodeWithPos.pos), [bulletList, orderedList]);
|
|
253
|
+
const selectionIsInNestedList = !!grandParentListNode;
|
|
254
|
+
let selectedListItemHasNestedList = false;
|
|
255
|
+
selectionParentListItemNode.node.content.forEach(child => {
|
|
256
|
+
if (isListNode(child)) {
|
|
257
|
+
selectedListItemHasNestedList = true;
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
if (selectedListItemHasNestedList || selectionIsInNestedList) {
|
|
261
|
+
return false;
|
|
252
262
|
}
|
|
253
|
-
});
|
|
254
|
-
if (selectedListItemHasNestedList || selectionIsInNestedList) {
|
|
255
|
-
return false;
|
|
256
263
|
}
|
|
257
264
|
|
|
258
265
|
// Node after the insert position
|
|
@@ -1041,7 +1048,7 @@ export function handleRichText(slice, queueCardsFromChangedTr, isNestingMediaOrC
|
|
|
1041
1048
|
});
|
|
1042
1049
|
if (insideTableCell(state) && isInListItem(state) && canInsert(selection.$from, slice.content) && canInsert(selection.$to, slice.content) || sliceHasList) {
|
|
1043
1050
|
tr.replaceSelection(slice);
|
|
1044
|
-
} else if (checkTaskListInList(state, slice)) {
|
|
1051
|
+
} else if (checkTaskListInList(state, slice) && (!fg('platform_editor_fix_paste_action_item_in_list') || !checkIfSelectionInNestedList(state))) {
|
|
1045
1052
|
insertSliceForTaskInsideList({
|
|
1046
1053
|
tr,
|
|
1047
1054
|
slice
|
|
@@ -1050,6 +1057,11 @@ export function handleRichText(slice, queueCardsFromChangedTr, isNestingMediaOrC
|
|
|
1050
1057
|
// need safeInsert rather than replaceSelection, so that nodes aren't split in half
|
|
1051
1058
|
// e.g. when pasting a layout into a table, replaceSelection splits the table in half and adds the layout in the middle
|
|
1052
1059
|
tr = safeInsert(slice.content, tr.selection.$to.pos)(tr);
|
|
1060
|
+
if (checkTaskListInList(state, slice) && fg('platform_editor_fix_paste_action_item_in_list')) {
|
|
1061
|
+
updateSelectionAfterReplace({
|
|
1062
|
+
tr
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1053
1065
|
}
|
|
1054
1066
|
}
|
|
1055
1067
|
tr.setStoredMarks([]);
|
|
@@ -1101,4 +1113,29 @@ export const handleSelectedTable = editorAnalyticsAPI => slice => (state, dispat
|
|
|
1101
1113
|
export function checkTaskListInList(state, slice) {
|
|
1102
1114
|
var _slice$content$firstC4, _slice$content$firstC5;
|
|
1103
1115
|
return Boolean(isInListItem(state) && ['taskList', 'taskItem'].includes(((_slice$content$firstC4 = slice.content.firstChild) === null || _slice$content$firstC4 === void 0 ? void 0 : (_slice$content$firstC5 = _slice$content$firstC4.type) === null || _slice$content$firstC5 === void 0 ? void 0 : _slice$content$firstC5.name) || ''));
|
|
1116
|
+
}
|
|
1117
|
+
export function checkIfSelectionInNestedList(state) {
|
|
1118
|
+
const {
|
|
1119
|
+
selection,
|
|
1120
|
+
tr
|
|
1121
|
+
} = state;
|
|
1122
|
+
const {
|
|
1123
|
+
orderedList,
|
|
1124
|
+
bulletList,
|
|
1125
|
+
listItem
|
|
1126
|
+
} = state.schema.nodes;
|
|
1127
|
+
const selectionParentListItemNode = findParentNodeOfType(listItem)(selection);
|
|
1128
|
+
const selectionParentListNodeWithPos = findParentNodeOfType([bulletList, orderedList])(selection);
|
|
1129
|
+
if (!selectionParentListItemNode || !selectionParentListNodeWithPos) {
|
|
1130
|
+
return false;
|
|
1131
|
+
}
|
|
1132
|
+
const grandParentListNode = findParentNodeOfTypeClosestToPos(tr.doc.resolve(selectionParentListNodeWithPos.pos), [bulletList, orderedList]);
|
|
1133
|
+
const selectionIsInNestedList = !!grandParentListNode;
|
|
1134
|
+
let selectedListItemHasNestedList = false;
|
|
1135
|
+
selectionParentListItemNode.node.content.forEach(child => {
|
|
1136
|
+
if (isListNode(child)) {
|
|
1137
|
+
selectedListItemHasNestedList = true;
|
|
1138
|
+
}
|
|
1139
|
+
});
|
|
1140
|
+
return selectedListItemHasNestedList || selectionIsInNestedList;
|
|
1104
1141
|
}
|
|
@@ -398,15 +398,16 @@ export var createPasteMeasurePayload = function createPasteMeasurePayload(_ref3)
|
|
|
398
398
|
}
|
|
399
399
|
};
|
|
400
400
|
};
|
|
401
|
-
|
|
401
|
+
var _getContentNodeTypes = function getContentNodeTypes(content) {
|
|
402
402
|
var nodeTypes = new Set();
|
|
403
403
|
if (content.size) {
|
|
404
404
|
content.forEach(function (node) {
|
|
405
405
|
if (node.content && node.content.size) {
|
|
406
|
-
nodeTypes = new Set([].concat(_toConsumableArray(nodeTypes), _toConsumableArray(
|
|
406
|
+
nodeTypes = new Set([].concat(_toConsumableArray(nodeTypes), _toConsumableArray(_getContentNodeTypes(node.content))));
|
|
407
407
|
}
|
|
408
408
|
nodeTypes.add(node.type.name);
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
411
|
return Array.from(nodeTypes);
|
|
412
|
-
};
|
|
412
|
+
};
|
|
413
|
+
export { _getContentNodeTypes as getContentNodeTypes };
|
|
@@ -22,6 +22,7 @@ import { createPasteMeasurePayload, getContentNodeTypes, handleCodeBlockWithAnal
|
|
|
22
22
|
import { clipboardTextSerializer } from './clipboard-text-serializer';
|
|
23
23
|
import { createPluginState, pluginKey as stateKey } from './plugin-factory';
|
|
24
24
|
import { escapeLinks, getPasteSource, htmlContainsSingleFile, htmlHasInvalidLinkTags, isPastedFromExcel, isPastedFromWord, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline } from './util';
|
|
25
|
+
import { handleVSCodeBlock } from './util/edge-cases/handleVSCodeBlock';
|
|
25
26
|
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks, handleTableContentPasteInBodiedExtension } from './util/handlers';
|
|
26
27
|
import { htmlHasIncompleteTable, isPastedFromTinyMCEConfluence, tryRebuildCompleteTableHtml } from './util/tinyMCE';
|
|
27
28
|
export var isInsideBlockQuote = function isInsideBlockQuote(state) {
|
|
@@ -267,6 +268,12 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
267
268
|
view.dispatch(tr.setMeta('uiEvent', 'paste'));
|
|
268
269
|
};
|
|
269
270
|
slice = handleParagraphBlockMarks(state, slice);
|
|
271
|
+
slice = handleVSCodeBlock({
|
|
272
|
+
state: state,
|
|
273
|
+
slice: slice,
|
|
274
|
+
event: event,
|
|
275
|
+
text: text
|
|
276
|
+
});
|
|
270
277
|
var plainTextPasteSlice = linkifyContent(state.schema)(slice);
|
|
271
278
|
if (handlePasteAsPlainTextWithAnalytics(editorAnalyticsAPI)(view, event, plainTextPasteSlice)(state, dispatch, view)) {
|
|
272
279
|
return true;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SUPPORTED_LANGUAGES } from '@atlaskit/code/constants';
|
|
2
|
+
import { mapSlice } from '@atlaskit/editor-common/utils';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
function safelyGetVSCodeLanguage(editorData) {
|
|
5
|
+
try {
|
|
6
|
+
var vscodeData = editorData ? JSON.parse(editorData) : undefined;
|
|
7
|
+
return vscodeData === null || vscodeData === void 0 ? void 0 : vscodeData.mode;
|
|
8
|
+
} catch (_e) {}
|
|
9
|
+
}
|
|
10
|
+
export function handleVSCodeBlock(_ref) {
|
|
11
|
+
var _event$clipboardData;
|
|
12
|
+
var state = _ref.state,
|
|
13
|
+
slice = _ref.slice,
|
|
14
|
+
text = _ref.text,
|
|
15
|
+
event = _ref.event;
|
|
16
|
+
if (!fg('platform_editor_vs_code_block_paste')) {
|
|
17
|
+
return slice;
|
|
18
|
+
}
|
|
19
|
+
var vscodeData = event === null || event === void 0 || (_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.getData('vscode-editor-data');
|
|
20
|
+
var language = safelyGetVSCodeLanguage(vscodeData);
|
|
21
|
+
if (text && language && SUPPORTED_LANGUAGES.some(function (l) {
|
|
22
|
+
return l.alias[0] === language;
|
|
23
|
+
})) {
|
|
24
|
+
var schema = state.schema;
|
|
25
|
+
slice = mapSlice(slice, function (node) {
|
|
26
|
+
var _schema$nodes$codeBlo;
|
|
27
|
+
if (node.type.name === ((_schema$nodes$codeBlo = schema.nodes.codeBlock) === null || _schema$nodes$codeBlo === void 0 ? void 0 : _schema$nodes$codeBlo.name)) {
|
|
28
|
+
return schema.nodes.codeBlock.createChecked({
|
|
29
|
+
language: language
|
|
30
|
+
}, schema.text(text));
|
|
31
|
+
}
|
|
32
|
+
return node;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return slice;
|
|
36
|
+
}
|
|
@@ -3,6 +3,7 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
5
5
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { isCursorSelectionAtTextStartOrEnd, isEmptyNode, isSelectionInsidePanel } from '../index';
|
|
7
8
|
import { insertSliceAtNodeEdge, insertSliceInsideOfPanelNodeSelected, insertSliceIntoEmptyNode, insertSliceIntoRangeSelectionInsideList } from './lists';
|
|
8
9
|
export function insertSliceForLists(_ref) {
|
|
@@ -96,9 +97,15 @@ export function insertSliceForTaskInsideList(_ref5) {
|
|
|
96
97
|
slice = _ref5.slice;
|
|
97
98
|
var schema = tr.doc.type.schema;
|
|
98
99
|
//To avoid the list being replaced with the tasklist, enclose the slice within a taskItem.
|
|
100
|
+
var selectionBeforeReplace = tr.selection.from;
|
|
99
101
|
tr.replaceSelection(new Slice(Fragment.from(schema.nodes.taskItem.createAndFill()), 0, 0));
|
|
100
|
-
|
|
101
|
-
tr
|
|
102
|
-
|
|
102
|
+
if (fg('platform_editor_fix_paste_action_item_in_list')) {
|
|
103
|
+
var nextSelection = Selection.near(tr.doc.resolve(selectionBeforeReplace + 1));
|
|
104
|
+
tr.setSelection(nextSelection);
|
|
105
|
+
} else {
|
|
106
|
+
updateSelectionAfterReplace({
|
|
107
|
+
tr: tr
|
|
108
|
+
});
|
|
109
|
+
}
|
|
103
110
|
tr.replaceSelection(slice);
|
|
104
111
|
}
|
|
@@ -18,13 +18,14 @@ import { Fragment, Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/mo
|
|
|
18
18
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
19
19
|
import { canInsert, contains, findParentNodeOfType, findParentNodeOfTypeClosestToPos, hasParentNode, hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
20
20
|
import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
21
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
22
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
23
|
// TODO: ED-20519 Needs Macro extraction
|
|
23
24
|
|
|
24
25
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from '../../editor-commands/commands';
|
|
25
26
|
import { isInsideBlockQuote } from '../main';
|
|
26
27
|
import { getPluginState as getPastePluginState } from '../plugin-factory';
|
|
27
|
-
import { insertSliceForLists, insertSliceForTaskInsideList, insertSliceInsideBlockquote } from './edge-cases';
|
|
28
|
+
import { insertSliceForLists, insertSliceForTaskInsideList, insertSliceInsideBlockquote, updateSelectionAfterReplace } from './edge-cases';
|
|
28
29
|
import { insertSliceInsideOfPanelNodeSelected } from './edge-cases/lists';
|
|
29
30
|
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType, isEmptyNode, isSelectionInsidePanel } from './index';
|
|
30
31
|
var insideExpand = function insideExpand(state) {
|
|
@@ -240,16 +241,22 @@ export function handlePasteNonNestableBlockNodesIntoList(slice) {
|
|
|
240
241
|
var listItemWrappingOffset = $to.depth - selectionParentListNodeWithPos.depth; // difference in depth between to position and list item node
|
|
241
242
|
|
|
242
243
|
// Anything to do with nested lists should safeInsert and not be handled here
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
if (fg('platform_editor_fix_paste_action_item_in_list')) {
|
|
245
|
+
if (checkIfSelectionInNestedList(state)) {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
} else {
|
|
249
|
+
var grandParentListNode = findParentNodeOfTypeClosestToPos(tr.doc.resolve(selectionParentListNodeWithPos.pos), [bulletList, orderedList]);
|
|
250
|
+
var selectionIsInNestedList = !!grandParentListNode;
|
|
251
|
+
var selectedListItemHasNestedList = false;
|
|
252
|
+
selectionParentListItemNode.node.content.forEach(function (child) {
|
|
253
|
+
if (isListNode(child)) {
|
|
254
|
+
selectedListItemHasNestedList = true;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
if (selectedListItemHasNestedList || selectionIsInNestedList) {
|
|
258
|
+
return false;
|
|
249
259
|
}
|
|
250
|
-
});
|
|
251
|
-
if (selectedListItemHasNestedList || selectionIsInNestedList) {
|
|
252
|
-
return false;
|
|
253
260
|
}
|
|
254
261
|
|
|
255
262
|
// Node after the insert position
|
|
@@ -1032,7 +1039,7 @@ export function handleRichText(slice, queueCardsFromChangedTr, isNestingMediaOrC
|
|
|
1032
1039
|
});
|
|
1033
1040
|
if (insideTableCell(state) && isInListItem(state) && canInsert(selection.$from, slice.content) && canInsert(selection.$to, slice.content) || sliceHasList) {
|
|
1034
1041
|
tr.replaceSelection(slice);
|
|
1035
|
-
} else if (checkTaskListInList(state, slice)) {
|
|
1042
|
+
} else if (checkTaskListInList(state, slice) && (!fg('platform_editor_fix_paste_action_item_in_list') || !checkIfSelectionInNestedList(state))) {
|
|
1036
1043
|
insertSliceForTaskInsideList({
|
|
1037
1044
|
tr: tr,
|
|
1038
1045
|
slice: slice
|
|
@@ -1041,6 +1048,11 @@ export function handleRichText(slice, queueCardsFromChangedTr, isNestingMediaOrC
|
|
|
1041
1048
|
// need safeInsert rather than replaceSelection, so that nodes aren't split in half
|
|
1042
1049
|
// e.g. when pasting a layout into a table, replaceSelection splits the table in half and adds the layout in the middle
|
|
1043
1050
|
tr = safeInsert(slice.content, tr.selection.$to.pos)(tr);
|
|
1051
|
+
if (checkTaskListInList(state, slice) && fg('platform_editor_fix_paste_action_item_in_list')) {
|
|
1052
|
+
updateSelectionAfterReplace({
|
|
1053
|
+
tr: tr
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1044
1056
|
}
|
|
1045
1057
|
}
|
|
1046
1058
|
tr.setStoredMarks([]);
|
|
@@ -1094,4 +1106,26 @@ export var handleSelectedTable = function handleSelectedTable(editorAnalyticsAPI
|
|
|
1094
1106
|
export function checkTaskListInList(state, slice) {
|
|
1095
1107
|
var _slice$content$firstC4;
|
|
1096
1108
|
return Boolean(isInListItem(state) && ['taskList', 'taskItem'].includes(((_slice$content$firstC4 = slice.content.firstChild) === null || _slice$content$firstC4 === void 0 || (_slice$content$firstC4 = _slice$content$firstC4.type) === null || _slice$content$firstC4 === void 0 ? void 0 : _slice$content$firstC4.name) || ''));
|
|
1109
|
+
}
|
|
1110
|
+
export function checkIfSelectionInNestedList(state) {
|
|
1111
|
+
var selection = state.selection,
|
|
1112
|
+
tr = state.tr;
|
|
1113
|
+
var _state$schema$nodes5 = state.schema.nodes,
|
|
1114
|
+
orderedList = _state$schema$nodes5.orderedList,
|
|
1115
|
+
bulletList = _state$schema$nodes5.bulletList,
|
|
1116
|
+
listItem = _state$schema$nodes5.listItem;
|
|
1117
|
+
var selectionParentListItemNode = findParentNodeOfType(listItem)(selection);
|
|
1118
|
+
var selectionParentListNodeWithPos = findParentNodeOfType([bulletList, orderedList])(selection);
|
|
1119
|
+
if (!selectionParentListItemNode || !selectionParentListNodeWithPos) {
|
|
1120
|
+
return false;
|
|
1121
|
+
}
|
|
1122
|
+
var grandParentListNode = findParentNodeOfTypeClosestToPos(tr.doc.resolve(selectionParentListNodeWithPos.pos), [bulletList, orderedList]);
|
|
1123
|
+
var selectionIsInNestedList = !!grandParentListNode;
|
|
1124
|
+
var selectedListItemHasNestedList = false;
|
|
1125
|
+
selectionParentListItemNode.node.content.forEach(function (child) {
|
|
1126
|
+
if (isListNode(child)) {
|
|
1127
|
+
selectedListItemHasNestedList = true;
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
return selectedListItemHasNestedList || selectionIsInNestedList;
|
|
1097
1131
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
interface VSCodeBlockParams {
|
|
4
|
+
state: EditorState;
|
|
5
|
+
slice: Slice;
|
|
6
|
+
text: string;
|
|
7
|
+
event: ClipboardEvent;
|
|
8
|
+
}
|
|
9
|
+
export declare function handleVSCodeBlock({ state, slice, text, event }: VSCodeBlockParams): Slice;
|
|
10
|
+
export {};
|
|
@@ -56,3 +56,4 @@ export declare function handleRichText(slice: Slice, queueCardsFromChangedTr: Qu
|
|
|
56
56
|
export declare function handlePasteIntoCaption(slice: Slice): Command;
|
|
57
57
|
export declare const handleSelectedTable: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (slice: Slice) => Command;
|
|
58
58
|
export declare function checkTaskListInList(state: EditorState, slice: Slice): boolean;
|
|
59
|
+
export declare function checkIfSelectionInNestedList(state: EditorState): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
interface VSCodeBlockParams {
|
|
4
|
+
state: EditorState;
|
|
5
|
+
slice: Slice;
|
|
6
|
+
text: string;
|
|
7
|
+
event: ClipboardEvent;
|
|
8
|
+
}
|
|
9
|
+
export declare function handleVSCodeBlock({ state, slice, text, event }: VSCodeBlockParams): Slice;
|
|
10
|
+
export {};
|
|
@@ -56,3 +56,4 @@ export declare function handleRichText(slice: Slice, queueCardsFromChangedTr: Qu
|
|
|
56
56
|
export declare function handlePasteIntoCaption(slice: Slice): Command;
|
|
57
57
|
export declare const handleSelectedTable: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (slice: Slice) => Command;
|
|
58
58
|
export declare function checkTaskListInList(state: EditorState, slice: Slice): boolean;
|
|
59
|
+
export declare function checkIfSelectionInNestedList(state: EditorState): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
|
-
"@atlaskit/
|
|
35
|
+
"@atlaskit/code": "^15.6.9",
|
|
36
|
+
"@atlaskit/editor-common": "^99.7.0",
|
|
36
37
|
"@atlaskit/editor-markdown-transformer": "^5.14.0",
|
|
37
38
|
"@atlaskit/editor-plugin-analytics": "^1.11.0",
|
|
38
39
|
"@atlaskit/editor-plugin-annotation": "^1.27.0",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
47
48
|
"@atlaskit/media-client": "^31.1.0",
|
|
48
49
|
"@atlaskit/media-common": "^11.8.0",
|
|
49
|
-
"@atlaskit/platform-feature-flags": "^0.
|
|
50
|
+
"@atlaskit/platform-feature-flags": "^1.0.0",
|
|
50
51
|
"@atlaskit/tmp-editor-statsig": "^2.41.0",
|
|
51
52
|
"@babel/runtime": "^7.0.0",
|
|
52
53
|
"lodash": "^4.17.21",
|
|
@@ -119,11 +120,17 @@
|
|
|
119
120
|
"platform_editor_use_nested_table_pm_nodes": {
|
|
120
121
|
"type": "boolean"
|
|
121
122
|
},
|
|
123
|
+
"platform_editor_vs_code_block_paste": {
|
|
124
|
+
"type": "boolean"
|
|
125
|
+
},
|
|
122
126
|
"platform_editor_advanced_layouts_post_fix_patch_2": {
|
|
123
127
|
"type": "boolean"
|
|
124
128
|
},
|
|
125
129
|
"platform_editor_fix_captions_on_copy": {
|
|
126
130
|
"type": "boolean"
|
|
131
|
+
},
|
|
132
|
+
"platform_editor_fix_paste_action_item_in_list": {
|
|
133
|
+
"type": "boolean"
|
|
127
134
|
}
|
|
128
135
|
}
|
|
129
136
|
}
|