@atlaskit/editor-plugin-paste 1.11.1 → 1.11.3
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 +18 -0
- package/dist/cjs/edge-cases/index.js +2 -2
- package/dist/cjs/handlers.js +4 -4
- package/dist/cjs/plugins/media.js +1 -1
- package/dist/es2019/edge-cases/index.js +1 -1
- package/dist/es2019/handlers.js +5 -5
- package/dist/es2019/plugins/media.js +1 -1
- package/dist/esm/edge-cases/index.js +1 -1
- package/dist/esm/handlers.js +5 -5
- package/dist/esm/plugins/media.js +1 -1
- package/dist/types/edge-cases/index.d.ts +1 -1
- package/dist/types-ts4.5/edge-cases/index.d.ts +1 -1
- package/package.json +6 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 1.11.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#135903](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135903)
|
|
8
|
+
[`42636c7a806fb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42636c7a806fb) -
|
|
9
|
+
[ux] [ED-24525] Fix paste for media nested in blockquotes from external editor. Before it was
|
|
10
|
+
missing quote on paste, now it includes the quote.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 1.11.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#134213](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134213)
|
|
18
|
+
[`93bd7032842ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/93bd7032842ec) -
|
|
19
|
+
[ux] [ED-24636] Bump ADF Schema package
|
|
20
|
+
|
|
3
21
|
## 1.11.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.insertSliceForLists = insertSliceForLists;
|
|
7
|
-
exports.insertSliceForListsInsideBlockquote = insertSliceForListsInsideBlockquote;
|
|
8
7
|
exports.insertSliceForTaskInsideList = insertSliceForTaskInsideList;
|
|
8
|
+
exports.insertSliceInsideBlockquote = insertSliceInsideBlockquote;
|
|
9
9
|
exports.updateSelectionAfterReplace = updateSelectionAfterReplace;
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
11
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
@@ -67,7 +67,7 @@ function insertSliceForLists(_ref) {
|
|
|
67
67
|
}
|
|
68
68
|
tr.replaceSelection(slice);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function insertSliceInsideBlockquote(_ref3) {
|
|
71
71
|
var tr = _ref3.tr,
|
|
72
72
|
slice = _ref3.slice;
|
|
73
73
|
//insert blockquote explicitly and set the selection in blockquote since replaceSelection will only insert the list
|
package/dist/cjs/handlers.js
CHANGED
|
@@ -295,7 +295,7 @@ function handlePasteNonNestableBlockNodesIntoList(slice) {
|
|
|
295
295
|
|
|
296
296
|
// handle the insertion of the slice
|
|
297
297
|
if (((_slice$content$firstC3 = slice.content.firstChild) === null || _slice$content$firstC3 === void 0 ? void 0 : _slice$content$firstC3.type.name) === 'blockquote' && (0, _utils2.contains)(slice.content.firstChild, state.schema.nodes.listItem)) {
|
|
298
|
-
(0, _edgeCases.
|
|
298
|
+
(0, _edgeCases.insertSliceInsideBlockquote)({
|
|
299
299
|
tr: tr,
|
|
300
300
|
slice: slice
|
|
301
301
|
});
|
|
@@ -951,9 +951,9 @@ function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
951
951
|
});
|
|
952
952
|
} else if (noNeedForSafeInsert) {
|
|
953
953
|
var _firstChildOfSlice$ty2, _firstChildOfSlice$co, _firstChildOfSlice$co2;
|
|
954
|
-
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'].includes(firstChildOfSlice === null || firstChildOfSlice === void 0 || (_firstChildOfSlice$co2 = firstChildOfSlice.content.firstChild) === null || _firstChildOfSlice$co2 === void 0 ? void 0 : _firstChildOfSlice$co2.type.name)) {
|
|
955
|
-
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist
|
|
956
|
-
(0, _edgeCases.
|
|
954
|
+
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)) {
|
|
955
|
+
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist or mediaSingle
|
|
956
|
+
(0, _edgeCases.insertSliceInsideBlockquote)({
|
|
957
957
|
tr: tr,
|
|
958
958
|
slice: slice
|
|
959
959
|
});
|
|
@@ -128,7 +128,7 @@ var transformSliceToMediaSingleWithNewExperience = exports.transformSliceToMedia
|
|
|
128
128
|
var isElementInvisible = function isElementInvisible(element) {
|
|
129
129
|
return element.style.opacity === '0' || element.style.display === 'none' || element.style.visibility === 'hidden';
|
|
130
130
|
};
|
|
131
|
-
var VALID_TAGS_CONTAINER = ['DIV', 'TD'];
|
|
131
|
+
var VALID_TAGS_CONTAINER = ['DIV', 'TD', 'BLOCKQUOTE'];
|
|
132
132
|
function canContainImage(element) {
|
|
133
133
|
if (!element) {
|
|
134
134
|
return false;
|
package/dist/es2019/handlers.js
CHANGED
|
@@ -12,7 +12,7 @@ import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
|
12
12
|
// TODO: ED-20519 Needs Macro extraction
|
|
13
13
|
|
|
14
14
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from './commands';
|
|
15
|
-
import { insertSliceForLists,
|
|
15
|
+
import { insertSliceForLists, insertSliceForTaskInsideList, insertSliceInsideBlockquote } from './edge-cases';
|
|
16
16
|
import { insertSliceInsideOfPanelNodeSelected } from './edge-cases/lists';
|
|
17
17
|
import { getPluginState as getPastePluginState } from './pm-plugins/plugin-factory';
|
|
18
18
|
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType, isEmptyNode, isSelectionInsidePanel } from './util';
|
|
@@ -274,7 +274,7 @@ export function handlePasteNonNestableBlockNodesIntoList(slice) {
|
|
|
274
274
|
|
|
275
275
|
// handle the insertion of the slice
|
|
276
276
|
if (((_slice$content$firstC3 = slice.content.firstChild) === null || _slice$content$firstC3 === void 0 ? void 0 : _slice$content$firstC3.type.name) === 'blockquote' && contains(slice.content.firstChild, state.schema.nodes.listItem)) {
|
|
277
|
-
|
|
277
|
+
insertSliceInsideBlockquote({
|
|
278
278
|
tr,
|
|
279
279
|
slice
|
|
280
280
|
});
|
|
@@ -929,9 +929,9 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
929
929
|
});
|
|
930
930
|
} else if (noNeedForSafeInsert) {
|
|
931
931
|
var _firstChildOfSlice$ty2, _firstChildOfSlice$co, _firstChildOfSlice$co2;
|
|
932
|
-
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'].includes(firstChildOfSlice === null || firstChildOfSlice === void 0 ? void 0 : (_firstChildOfSlice$co2 = firstChildOfSlice.content.firstChild) === null || _firstChildOfSlice$co2 === void 0 ? void 0 : _firstChildOfSlice$co2.type.name)) {
|
|
933
|
-
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist
|
|
934
|
-
|
|
932
|
+
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)) {
|
|
933
|
+
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist or mediaSingle
|
|
934
|
+
insertSliceInsideBlockquote({
|
|
935
935
|
tr,
|
|
936
936
|
slice
|
|
937
937
|
});
|
|
@@ -125,7 +125,7 @@ export const transformSliceToMediaSingleWithNewExperience = (slice, schema) => {
|
|
|
125
125
|
const isElementInvisible = element => {
|
|
126
126
|
return element.style.opacity === '0' || element.style.display === 'none' || element.style.visibility === 'hidden';
|
|
127
127
|
};
|
|
128
|
-
const VALID_TAGS_CONTAINER = ['DIV', 'TD'];
|
|
128
|
+
const VALID_TAGS_CONTAINER = ['DIV', 'TD', 'BLOCKQUOTE'];
|
|
129
129
|
function canContainImage(element) {
|
|
130
130
|
if (!element) {
|
|
131
131
|
return false;
|
|
@@ -58,7 +58,7 @@ export function insertSliceForLists(_ref) {
|
|
|
58
58
|
}
|
|
59
59
|
tr.replaceSelection(slice);
|
|
60
60
|
}
|
|
61
|
-
export function
|
|
61
|
+
export function insertSliceInsideBlockquote(_ref3) {
|
|
62
62
|
var tr = _ref3.tr,
|
|
63
63
|
slice = _ref3.slice;
|
|
64
64
|
//insert blockquote explicitly and set the selection in blockquote since replaceSelection will only insert the list
|
package/dist/esm/handlers.js
CHANGED
|
@@ -20,7 +20,7 @@ import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
|
20
20
|
// TODO: ED-20519 Needs Macro extraction
|
|
21
21
|
|
|
22
22
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from './commands';
|
|
23
|
-
import { insertSliceForLists,
|
|
23
|
+
import { insertSliceForLists, insertSliceForTaskInsideList, insertSliceInsideBlockquote } from './edge-cases';
|
|
24
24
|
import { insertSliceInsideOfPanelNodeSelected } from './edge-cases/lists';
|
|
25
25
|
import { getPluginState as getPastePluginState } from './pm-plugins/plugin-factory';
|
|
26
26
|
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType, isEmptyNode, isSelectionInsidePanel } from './util';
|
|
@@ -271,7 +271,7 @@ export function handlePasteNonNestableBlockNodesIntoList(slice) {
|
|
|
271
271
|
|
|
272
272
|
// handle the insertion of the slice
|
|
273
273
|
if (((_slice$content$firstC3 = slice.content.firstChild) === null || _slice$content$firstC3 === void 0 ? void 0 : _slice$content$firstC3.type.name) === 'blockquote' && contains(slice.content.firstChild, state.schema.nodes.listItem)) {
|
|
274
|
-
|
|
274
|
+
insertSliceInsideBlockquote({
|
|
275
275
|
tr: tr,
|
|
276
276
|
slice: slice
|
|
277
277
|
});
|
|
@@ -927,9 +927,9 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
927
927
|
});
|
|
928
928
|
} else if (noNeedForSafeInsert) {
|
|
929
929
|
var _firstChildOfSlice$ty2, _firstChildOfSlice$co, _firstChildOfSlice$co2;
|
|
930
|
-
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'].includes(firstChildOfSlice === null || firstChildOfSlice === void 0 || (_firstChildOfSlice$co2 = firstChildOfSlice.content.firstChild) === null || _firstChildOfSlice$co2 === void 0 ? void 0 : _firstChildOfSlice$co2.type.name)) {
|
|
931
|
-
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist
|
|
932
|
-
|
|
930
|
+
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)) {
|
|
931
|
+
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist or mediaSingle
|
|
932
|
+
insertSliceInsideBlockquote({
|
|
933
933
|
tr: tr,
|
|
934
934
|
slice: slice
|
|
935
935
|
});
|
|
@@ -120,7 +120,7 @@ export var transformSliceToMediaSingleWithNewExperience = function transformSlic
|
|
|
120
120
|
var isElementInvisible = function isElementInvisible(element) {
|
|
121
121
|
return element.style.opacity === '0' || element.style.display === 'none' || element.style.visibility === 'hidden';
|
|
122
122
|
};
|
|
123
|
-
var VALID_TAGS_CONTAINER = ['DIV', 'TD'];
|
|
123
|
+
var VALID_TAGS_CONTAINER = ['DIV', 'TD', 'BLOCKQUOTE'];
|
|
124
124
|
function canContainImage(element) {
|
|
125
125
|
if (!element) {
|
|
126
126
|
return false;
|
|
@@ -5,7 +5,7 @@ export declare function insertSliceForLists({ tr, slice, schema, }: {
|
|
|
5
5
|
slice: PMSlice;
|
|
6
6
|
schema: Schema;
|
|
7
7
|
}): void | Transaction;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function insertSliceInsideBlockquote({ tr, slice, }: {
|
|
9
9
|
tr: Transaction;
|
|
10
10
|
slice: PMSlice;
|
|
11
11
|
}): void;
|
|
@@ -5,7 +5,7 @@ export declare function insertSliceForLists({ tr, slice, schema, }: {
|
|
|
5
5
|
slice: PMSlice;
|
|
6
6
|
schema: Schema;
|
|
7
7
|
}): void | Transaction;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function insertSliceInsideBlockquote({ tr, slice, }: {
|
|
9
9
|
tr: Transaction;
|
|
10
10
|
slice: PMSlice;
|
|
11
11
|
}): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.3",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
"atlassian": {
|
|
11
11
|
"team": "Editor: Lego",
|
|
12
12
|
"singleton": true,
|
|
13
|
-
"inPublicMirror": false,
|
|
14
|
-
"releaseModel": "continuous",
|
|
15
13
|
"runReact18": false
|
|
16
14
|
},
|
|
17
15
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
@@ -33,19 +31,19 @@
|
|
|
33
31
|
".": "./src/index.ts"
|
|
34
32
|
},
|
|
35
33
|
"dependencies": {
|
|
36
|
-
"@atlaskit/editor-common": "^88.
|
|
37
|
-
"@atlaskit/editor-markdown-transformer": "^5.
|
|
34
|
+
"@atlaskit/editor-common": "^88.7.0",
|
|
35
|
+
"@atlaskit/editor-markdown-transformer": "^5.12.0",
|
|
38
36
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
39
37
|
"@atlaskit/editor-plugin-annotation": "^1.19.0",
|
|
40
38
|
"@atlaskit/editor-plugin-better-type-history": "^1.8.0",
|
|
41
|
-
"@atlaskit/editor-plugin-card": "^2.
|
|
39
|
+
"@atlaskit/editor-plugin-card": "^2.14.0",
|
|
42
40
|
"@atlaskit/editor-plugin-feature-flags": "^1.2.0",
|
|
43
41
|
"@atlaskit/editor-plugin-list": "^3.8.0",
|
|
44
42
|
"@atlaskit/editor-plugin-media": "^1.29.0",
|
|
45
43
|
"@atlaskit/editor-plugin-mentions": "^2.5.0",
|
|
46
44
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
47
45
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
48
|
-
"@atlaskit/media-client": "^27.
|
|
46
|
+
"@atlaskit/media-client": "^27.6.0",
|
|
49
47
|
"@atlaskit/media-common": "^11.4.0",
|
|
50
48
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
51
49
|
"@babel/runtime": "^7.0.0",
|
|
@@ -57,7 +55,7 @@
|
|
|
57
55
|
},
|
|
58
56
|
"devDependencies": {
|
|
59
57
|
"@af/visual-regression": "*",
|
|
60
|
-
"@atlaskit/adf-schema": "^40.
|
|
58
|
+
"@atlaskit/adf-schema": "^40.9.0",
|
|
61
59
|
"@atlaskit/editor-plugin-block-type": "^3.14.0",
|
|
62
60
|
"@atlaskit/editor-plugin-history": "^1.3.0",
|
|
63
61
|
"@atlaskit/editor-plugin-type-ahead": "^1.8.0",
|