@atlaskit/editor-plugin-paste 8.2.7 → 8.2.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 +14 -0
- package/dist/cjs/pm-plugins/util/handlers.js +5 -4
- package/dist/es2019/pm-plugins/util/handlers.js +4 -3
- package/dist/esm/pm-plugins/util/handlers.js +5 -4
- package/dist/types/pm-plugins/util/handlers.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/util/handlers.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 8.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 8.2.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`19274be1b1972`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/19274be1b1972) -
|
|
14
|
+
[ux] EDITOR-5417 Flexible list indentation ADF schema + validator support
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 8.2.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -43,6 +43,7 @@ var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
|
43
43
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
44
44
|
var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
|
|
45
45
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
46
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
46
47
|
var _commands = require("../../editor-commands/commands");
|
|
47
48
|
var _pluginFactory = require("../plugin-factory");
|
|
48
49
|
var _edgeCases = require("./edge-cases");
|
|
@@ -814,7 +815,7 @@ function handleExpandPaste(slice) {
|
|
|
814
815
|
hasExpand = true;
|
|
815
816
|
try {
|
|
816
817
|
return nestedExpand.createChecked(maybeNode.attrs, maybeNode.content, maybeNode.marks);
|
|
817
|
-
} catch (
|
|
818
|
+
} catch (_unused) {
|
|
818
819
|
tr = (0, _utils2.safeInsert)(maybeNode, tr.selection.$to.pos)(tr);
|
|
819
820
|
return _model.Fragment.empty;
|
|
820
821
|
}
|
|
@@ -1050,7 +1051,7 @@ function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
1050
1051
|
slice: slice,
|
|
1051
1052
|
schema: schema
|
|
1052
1053
|
});
|
|
1053
|
-
} else if (noNeedForSafeInsert) {
|
|
1054
|
+
} else if (noNeedForSafeInsert && !((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_flexible_list_indentation', 'isEnabled', true) && checkTaskListInList(state, slice))) {
|
|
1054
1055
|
var _firstChildOfSlice$ty2, _firstChildOfSlice$co, _firstChildOfSlice$co2;
|
|
1055
1056
|
if ((firstChildOfSlice === null || firstChildOfSlice === void 0 || (_firstChildOfSlice$ty2 = firstChildOfSlice.type) === null || _firstChildOfSlice$ty2 === void 0 ? void 0 : _firstChildOfSlice$ty2.name) === 'blockquote' && firstChildOfSlice !== null && firstChildOfSlice !== void 0 && (_firstChildOfSlice$co = firstChildOfSlice.content.firstChild) !== null && _firstChildOfSlice$co !== void 0 && _firstChildOfSlice$co.type.name && ['bulletList', 'orderedList', 'mediaSingle'].includes(firstChildOfSlice === null || firstChildOfSlice === void 0 || (_firstChildOfSlice$co2 = firstChildOfSlice.content.firstChild) === null || _firstChildOfSlice$co2 === void 0 ? void 0 : _firstChildOfSlice$co2.type.name)) {
|
|
1056
1057
|
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist or mediaSingle
|
|
@@ -1078,7 +1079,7 @@ function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
1078
1079
|
} else {
|
|
1079
1080
|
// need to scan the slice if there's a block node or list items inside it
|
|
1080
1081
|
var sliceHasList = false;
|
|
1081
|
-
slice.content.nodesBetween(0, slice.content.size, function (node
|
|
1082
|
+
slice.content.nodesBetween(0, slice.content.size, function (node) {
|
|
1082
1083
|
if (node.type === state.schema.nodes.listItem) {
|
|
1083
1084
|
sliceHasList = true;
|
|
1084
1085
|
return false;
|
|
@@ -1120,7 +1121,7 @@ function isUrlString(text) {
|
|
|
1120
1121
|
try {
|
|
1121
1122
|
new URL(text);
|
|
1122
1123
|
return true;
|
|
1123
|
-
} catch (
|
|
1124
|
+
} catch (_unused2) {
|
|
1124
1125
|
return false;
|
|
1125
1126
|
}
|
|
1126
1127
|
}
|
|
@@ -13,6 +13,7 @@ import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { closeHistory } from '@atlaskit/prosemirror-history';
|
|
15
15
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
16
17
|
// TODO: ED-20519 - Needs Macro extraction
|
|
17
18
|
|
|
18
19
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from '../../editor-commands/commands';
|
|
@@ -804,7 +805,7 @@ export function handleExpandPaste(slice) {
|
|
|
804
805
|
hasExpand = true;
|
|
805
806
|
try {
|
|
806
807
|
return nestedExpand.createChecked(maybeNode.attrs, maybeNode.content, maybeNode.marks);
|
|
807
|
-
} catch
|
|
808
|
+
} catch {
|
|
808
809
|
tr = safeInsert(maybeNode, tr.selection.$to.pos)(tr);
|
|
809
810
|
return Fragment.empty;
|
|
810
811
|
}
|
|
@@ -1031,7 +1032,7 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
1031
1032
|
slice,
|
|
1032
1033
|
schema
|
|
1033
1034
|
});
|
|
1034
|
-
} else if (noNeedForSafeInsert) {
|
|
1035
|
+
} else if (noNeedForSafeInsert && !(expValEqualsNoExposure('platform_editor_flexible_list_indentation', 'isEnabled', true) && checkTaskListInList(state, slice))) {
|
|
1035
1036
|
var _firstChildOfSlice$ty2, _firstChildOfSlice$co, _firstChildOfSlice$co2;
|
|
1036
1037
|
if ((firstChildOfSlice === null || firstChildOfSlice === void 0 ? void 0 : (_firstChildOfSlice$ty2 = firstChildOfSlice.type) === null || _firstChildOfSlice$ty2 === void 0 ? void 0 : _firstChildOfSlice$ty2.name) === 'blockquote' && firstChildOfSlice !== null && firstChildOfSlice !== void 0 && (_firstChildOfSlice$co = firstChildOfSlice.content.firstChild) !== null && _firstChildOfSlice$co !== void 0 && _firstChildOfSlice$co.type.name && ['bulletList', 'orderedList', 'mediaSingle'].includes(firstChildOfSlice === null || firstChildOfSlice === void 0 ? void 0 : (_firstChildOfSlice$co2 = firstChildOfSlice.content.firstChild) === null || _firstChildOfSlice$co2 === void 0 ? void 0 : _firstChildOfSlice$co2.type.name)) {
|
|
1037
1038
|
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist or mediaSingle
|
|
@@ -1059,7 +1060,7 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
1059
1060
|
} else {
|
|
1060
1061
|
// need to scan the slice if there's a block node or list items inside it
|
|
1061
1062
|
let sliceHasList = false;
|
|
1062
|
-
slice.content.nodesBetween(0, slice.content.size,
|
|
1063
|
+
slice.content.nodesBetween(0, slice.content.size, node => {
|
|
1063
1064
|
if (node.type === state.schema.nodes.listItem) {
|
|
1064
1065
|
sliceHasList = true;
|
|
1065
1066
|
return false;
|
|
@@ -21,6 +21,7 @@ import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import { closeHistory } from '@atlaskit/prosemirror-history';
|
|
23
23
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
24
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
24
25
|
// TODO: ED-20519 - Needs Macro extraction
|
|
25
26
|
|
|
26
27
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from '../../editor-commands/commands';
|
|
@@ -788,7 +789,7 @@ export function handleExpandPaste(slice) {
|
|
|
788
789
|
hasExpand = true;
|
|
789
790
|
try {
|
|
790
791
|
return nestedExpand.createChecked(maybeNode.attrs, maybeNode.content, maybeNode.marks);
|
|
791
|
-
} catch (
|
|
792
|
+
} catch (_unused) {
|
|
792
793
|
tr = safeInsert(maybeNode, tr.selection.$to.pos)(tr);
|
|
793
794
|
return Fragment.empty;
|
|
794
795
|
}
|
|
@@ -1024,7 +1025,7 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
1024
1025
|
slice: slice,
|
|
1025
1026
|
schema: schema
|
|
1026
1027
|
});
|
|
1027
|
-
} else if (noNeedForSafeInsert) {
|
|
1028
|
+
} else if (noNeedForSafeInsert && !(expValEqualsNoExposure('platform_editor_flexible_list_indentation', 'isEnabled', true) && checkTaskListInList(state, slice))) {
|
|
1028
1029
|
var _firstChildOfSlice$ty2, _firstChildOfSlice$co, _firstChildOfSlice$co2;
|
|
1029
1030
|
if ((firstChildOfSlice === null || firstChildOfSlice === void 0 || (_firstChildOfSlice$ty2 = firstChildOfSlice.type) === null || _firstChildOfSlice$ty2 === void 0 ? void 0 : _firstChildOfSlice$ty2.name) === 'blockquote' && firstChildOfSlice !== null && firstChildOfSlice !== void 0 && (_firstChildOfSlice$co = firstChildOfSlice.content.firstChild) !== null && _firstChildOfSlice$co !== void 0 && _firstChildOfSlice$co.type.name && ['bulletList', 'orderedList', 'mediaSingle'].includes(firstChildOfSlice === null || firstChildOfSlice === void 0 || (_firstChildOfSlice$co2 = firstChildOfSlice.content.firstChild) === null || _firstChildOfSlice$co2 === void 0 ? void 0 : _firstChildOfSlice$co2.type.name)) {
|
|
1030
1031
|
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist or mediaSingle
|
|
@@ -1052,7 +1053,7 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
1052
1053
|
} else {
|
|
1053
1054
|
// need to scan the slice if there's a block node or list items inside it
|
|
1054
1055
|
var sliceHasList = false;
|
|
1055
|
-
slice.content.nodesBetween(0, slice.content.size, function (node
|
|
1056
|
+
slice.content.nodesBetween(0, slice.content.size, function (node) {
|
|
1056
1057
|
if (node.type === state.schema.nodes.listItem) {
|
|
1057
1058
|
sliceHasList = true;
|
|
1058
1059
|
return false;
|
|
@@ -1094,7 +1095,7 @@ function isUrlString(text) {
|
|
|
1094
1095
|
try {
|
|
1095
1096
|
new URL(text);
|
|
1096
1097
|
return true;
|
|
1097
|
-
} catch (
|
|
1098
|
+
} catch (_unused2) {
|
|
1098
1099
|
return false;
|
|
1099
1100
|
}
|
|
1100
1101
|
}
|
|
@@ -5,8 +5,8 @@ import type { Command } from '@atlaskit/editor-common/types';
|
|
|
5
5
|
import type { RunMacroAutoConvert } from '@atlaskit/editor-plugin-extension';
|
|
6
6
|
import type { FindRootParentListNode } from '@atlaskit/editor-plugin-list';
|
|
7
7
|
import type { InsertMediaAsMediaSingle } from '@atlaskit/editor-plugin-media/types';
|
|
8
|
-
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
9
8
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
9
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
export declare function handleMention(slice: Slice, schema: Schema): Slice;
|
|
12
12
|
export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
|
|
@@ -5,8 +5,8 @@ import type { Command } from '@atlaskit/editor-common/types';
|
|
|
5
5
|
import type { RunMacroAutoConvert } from '@atlaskit/editor-plugin-extension';
|
|
6
6
|
import type { FindRootParentListNode } from '@atlaskit/editor-plugin-list';
|
|
7
7
|
import type { InsertMediaAsMediaSingle } from '@atlaskit/editor-plugin-media/types';
|
|
8
|
-
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
9
8
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
9
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
export declare function handleMention(slice: Slice, schema: Schema): Slice;
|
|
12
12
|
export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.9",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "^
|
|
30
|
+
"@atlaskit/adf-schema": "^52.0.0",
|
|
31
31
|
"@atlaskit/code": "^17.4.0",
|
|
32
32
|
"@atlaskit/editor-markdown-transformer": "^5.20.0",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^7.0.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/media-common": "^12.4.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^32.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^11.0.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"lodash": "^4.17.21",
|