@atlaskit/editor-plugin-paste 7.2.0 → 7.4.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
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 7.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`5167552fe1a93`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5167552fe1a93) -
|
|
8
|
+
[EDITOR-2339] Bump @atlaskit/adf-schema to 51.3.0
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 7.3.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [`0ac75e0d28c72`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0ac75e0d28c72) -
|
|
19
|
+
Migrate @atlaskit/editor-prosemirror/history to @atlaskit/prosemirror-history package
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 7.2.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
|
@@ -248,7 +270,6 @@
|
|
|
248
270
|
shared context or singletons.
|
|
249
271
|
|
|
250
272
|
**HOW TO ADJUST:**
|
|
251
|
-
|
|
252
273
|
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
253
274
|
any of these editor plugins.
|
|
254
275
|
- Ensure the version you install matches the version required by the plugins.
|
|
@@ -1763,7 +1784,6 @@
|
|
|
1763
1784
|
- [#43646](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43646)
|
|
1764
1785
|
[`d43f8e9402f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d43f8e9402f) - Make
|
|
1765
1786
|
feature flags plugin optional in all plugins including:
|
|
1766
|
-
|
|
1767
1787
|
- analytics
|
|
1768
1788
|
- base
|
|
1769
1789
|
- card
|
|
@@ -36,12 +36,12 @@ var _mark = require("@atlaskit/editor-common/mark");
|
|
|
36
36
|
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
37
37
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
38
38
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
39
|
-
var _history = require("@atlaskit/editor-prosemirror/history");
|
|
40
39
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
41
40
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
42
41
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
43
42
|
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
44
43
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
44
|
+
var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
|
|
45
45
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
46
46
|
var _commands = require("../../editor-commands/commands");
|
|
47
47
|
var _pluginFactory = require("../plugin-factory");
|
|
@@ -163,7 +163,7 @@ function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChangedTr) {
|
|
|
163
163
|
}
|
|
164
164
|
var transformedSlice = compose.apply(null, filters)(slice);
|
|
165
165
|
var isFirstChildTaskNode = transformedSlice.content.firstChild.type === taskList || transformedSlice.content.firstChild.type === taskItem;
|
|
166
|
-
var tr = (0,
|
|
166
|
+
var tr = (0, _prosemirrorHistory.closeHistory)(state.tr);
|
|
167
167
|
if (panelNode && sliceHasTask && ((_slice$content$firstC2 = slice.content.firstChild) === null || _slice$content$firstC2 === void 0 ? void 0 : _slice$content$firstC2.type) === panel && (0, _index.isEmptyNode)(panelNode) && selection.$from.node() === selection.$to.node()) {
|
|
168
168
|
return Boolean((0, _lists.insertSliceInsideOfPanelNodeSelected)(panelNode)({
|
|
169
169
|
tr: tr,
|
|
@@ -500,7 +500,7 @@ function handlePasteAsPlainText(slice, _event, editorAnalyticsAPI) {
|
|
|
500
500
|
// @see prosemirror-view/src/clipboard.js:parseFromClipboard()).
|
|
501
501
|
// @see prosemirror-view/src/input.js:doPaste().
|
|
502
502
|
if (isShiftKeyPressed) {
|
|
503
|
-
var tr = (0,
|
|
503
|
+
var tr = (0, _prosemirrorHistory.closeHistory)(state.tr);
|
|
504
504
|
var _tr = tr,
|
|
505
505
|
selection = _tr.selection;
|
|
506
506
|
|
|
@@ -562,7 +562,7 @@ function handlePastePreservingMarks(slice, queueCardsFromChangedTr) {
|
|
|
562
562
|
// we apply current selection marks to the pasted slice
|
|
563
563
|
if ((0, _index.hasOnlyNodesOfType)(bulletList, hardBreak, heading, listItem, text, emoji, mention, orderedList)(slice) || selectionIsHeading || hasActiveCodeMark || hasAnnotationMark) {
|
|
564
564
|
var transformedSlice = (0, _index.applyTextMarksToSlice)(schema, selectionMarks)(slice);
|
|
565
|
-
var tr = (0,
|
|
565
|
+
var tr = (0, _prosemirrorHistory.closeHistory)(state.tr).replaceSelection(transformedSlice).setStoredMarks(selectionMarks).scrollIntoView();
|
|
566
566
|
queueCardsFromChangedTr === null || queueCardsFromChangedTr === void 0 || queueCardsFromChangedTr(state, tr, _analytics.INPUT_METHOD.CLIPBOARD);
|
|
567
567
|
if (dispatch) {
|
|
568
568
|
dispatch(tr);
|
|
@@ -620,7 +620,7 @@ function insertAutoMacro(slice, macro, view, from, to) {
|
|
|
620
620
|
|
|
621
621
|
// replace the text with the macro as a separate transaction
|
|
622
622
|
// so the autoconversion generates 2 undo steps
|
|
623
|
-
view.dispatch((0,
|
|
623
|
+
view.dispatch((0, _prosemirrorHistory.closeHistory)(view.state.tr).replaceRangeWith(before, before + slice.size, macro).scrollIntoView());
|
|
624
624
|
return true;
|
|
625
625
|
}
|
|
626
626
|
return false;
|
|
@@ -683,7 +683,7 @@ function handleCodeBlock(text) {
|
|
|
683
683
|
return function (state, dispatch) {
|
|
684
684
|
var codeBlock = state.schema.nodes.codeBlock;
|
|
685
685
|
if (text && (0, _utils2.hasParentNodeOfType)(codeBlock)(state.selection)) {
|
|
686
|
-
var tr = (0,
|
|
686
|
+
var tr = (0, _prosemirrorHistory.closeHistory)(state.tr);
|
|
687
687
|
tr.scrollIntoView();
|
|
688
688
|
if (dispatch) {
|
|
689
689
|
dispatch(tr.insertText(text));
|
|
@@ -847,7 +847,7 @@ function handleExpandPaste(slice) {
|
|
|
847
847
|
}
|
|
848
848
|
function handleMarkdown(markdownSlice, queueCardsFromChangedTr, from, to) {
|
|
849
849
|
return function (state, dispatch) {
|
|
850
|
-
var tr = (0,
|
|
850
|
+
var tr = (0, _prosemirrorHistory.closeHistory)(state.tr);
|
|
851
851
|
var pastesFrom = typeof from === 'number' ? from : tr.selection.from;
|
|
852
852
|
if (typeof from === 'number' && typeof to === 'number') {
|
|
853
853
|
tr.replaceRange(from, to, markdownSlice);
|
|
@@ -1037,7 +1037,7 @@ function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
1037
1037
|
if (shouldFlattenList(state, slice)) {
|
|
1038
1038
|
slice = flattenNestedListInSlice(slice);
|
|
1039
1039
|
}
|
|
1040
|
-
(0,
|
|
1040
|
+
(0, _prosemirrorHistory.closeHistory)(tr);
|
|
1041
1041
|
var isFirstChildListNode = (0, _utils.isListNode)(firstChildOfSlice);
|
|
1042
1042
|
var isLastChildListNode = (0, _utils.isListNode)(lastChildOfSlice);
|
|
1043
1043
|
var isSliceContentListNodes = isFirstChildListNode || isLastChildListNode;
|
|
@@ -5,12 +5,12 @@ import { anyMarkActive } from '@atlaskit/editor-common/mark';
|
|
|
5
5
|
import { getParentOfTypeCount, getPositionAfterTopParentNodeOfType } from '@atlaskit/editor-common/nesting';
|
|
6
6
|
import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
7
7
|
import { canLinkBeCreatedInRange, insideTableCell, isInListItem, isLinkMark, isListItemNode, isListNode, isNodeEmpty, isParagraph, isText, linkifyContent, mapSlice } from '@atlaskit/editor-common/utils';
|
|
8
|
-
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
9
8
|
import { Fragment, Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
10
9
|
import { AllSelection, NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
10
|
import { canInsert, contains, findParentNodeOfType, findParentNodeOfTypeClosestToPos, hasParentNode, hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
12
11
|
import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
13
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { closeHistory } from '@atlaskit/prosemirror-history';
|
|
14
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
15
15
|
// TODO: ED-20519 - Needs Macro extraction
|
|
16
16
|
|
|
@@ -13,12 +13,12 @@ import { anyMarkActive } from '@atlaskit/editor-common/mark';
|
|
|
13
13
|
import { getParentOfTypeCount, getPositionAfterTopParentNodeOfType } from '@atlaskit/editor-common/nesting';
|
|
14
14
|
import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
15
15
|
import { canLinkBeCreatedInRange, insideTableCell, isInListItem, isLinkMark, isListItemNode, isListNode, isNodeEmpty, isParagraph, isText, linkifyContent, mapSlice } from '@atlaskit/editor-common/utils';
|
|
16
|
-
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
17
16
|
import { Fragment, Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
18
17
|
import { AllSelection, NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
19
18
|
import { canInsert, contains, findParentNodeOfType, findParentNodeOfTypeClosestToPos, hasParentNode, hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
20
19
|
import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
21
20
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
|
+
import { closeHistory } from '@atlaskit/prosemirror-history';
|
|
22
22
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
23
23
|
// TODO: ED-20519 - Needs Macro extraction
|
|
24
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,39 +27,40 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "^51.
|
|
30
|
+
"@atlaskit/adf-schema": "^51.3.0",
|
|
31
31
|
"@atlaskit/code": "^17.2.0",
|
|
32
|
-
"@atlaskit/editor-markdown-transformer": "^5.
|
|
33
|
-
"@atlaskit/editor-plugin-analytics": "^6.
|
|
34
|
-
"@atlaskit/editor-plugin-annotation": "^6.
|
|
35
|
-
"@atlaskit/editor-plugin-better-type-history": "^6.
|
|
36
|
-
"@atlaskit/editor-plugin-card": "^11.
|
|
32
|
+
"@atlaskit/editor-markdown-transformer": "^5.20.0",
|
|
33
|
+
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
34
|
+
"@atlaskit/editor-plugin-annotation": "^6.2.0",
|
|
35
|
+
"@atlaskit/editor-plugin-better-type-history": "^6.1.0",
|
|
36
|
+
"@atlaskit/editor-plugin-card": "^11.4.0",
|
|
37
37
|
"@atlaskit/editor-plugin-feature-flags": "^5.0.0",
|
|
38
|
-
"@atlaskit/editor-plugin-list": "^8.
|
|
39
|
-
"@atlaskit/editor-plugin-media": "^8.
|
|
40
|
-
"@atlaskit/editor-plugin-mentions": "^8.
|
|
38
|
+
"@atlaskit/editor-plugin-list": "^8.2.0",
|
|
39
|
+
"@atlaskit/editor-plugin-media": "^8.2.0",
|
|
40
|
+
"@atlaskit/editor-plugin-mentions": "^8.2.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
42
42
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
43
43
|
"@atlaskit/insm": "^0.1.0",
|
|
44
44
|
"@atlaskit/media-client": "^35.5.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.13.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.14.0",
|
|
55
55
|
"react": "^18.2.0",
|
|
56
56
|
"react-dom": "^18.2.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@af/visual-regression": "workspace:^",
|
|
60
|
-
"@atlaskit/editor-plugin-block-type": "^10.
|
|
61
|
-
"@atlaskit/editor-plugin-history": "^6.
|
|
62
|
-
"@atlaskit/editor-plugin-type-ahead": "^6.
|
|
60
|
+
"@atlaskit/editor-plugin-block-type": "^10.2.0",
|
|
61
|
+
"@atlaskit/editor-plugin-history": "^6.1.0",
|
|
62
|
+
"@atlaskit/editor-plugin-type-ahead": "^6.5.0",
|
|
63
|
+
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
63
64
|
"@atlaskit/ssr": "workspace:^",
|
|
64
65
|
"@testing-library/react": "^13.4.0",
|
|
65
66
|
"wait-for-expect": "^1.2.0"
|