@atlaskit/editor-plugin-paste 2.0.12 → 2.0.13
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 +6 -0
- package/dist/cjs/pm-plugins/util/tinyMCE.js +2 -0
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/pm-plugins/media.js +1 -1
- package/dist/es2019/pm-plugins/util/handlers.js +3 -3
- package/dist/es2019/pm-plugins/util/tinyMCE.js +2 -0
- package/dist/esm/pm-plugins/util/tinyMCE.js +2 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -126,6 +126,8 @@ var fillIncompleteRowWithEmptyCells = function fillIncompleteRowWithEmptyCells(d
|
|
|
126
126
|
* headers exist.
|
|
127
127
|
*/
|
|
128
128
|
var tryReconstructTableRows = exports.tryReconstructTableRows = function tryReconstructTableRows(doc) {
|
|
129
|
+
// Ignored via go/ees005
|
|
130
|
+
// eslint-disable-next-line prefer-const
|
|
129
131
|
var _getTableElementsInfo = getTableElementsInfo(doc),
|
|
130
132
|
cellCount = _getTableElementsInfo.cellCount,
|
|
131
133
|
thCount = _getTableElementsInfo.thCount,
|
|
@@ -37,7 +37,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
37
37
|
const editorAnalyticsAPI = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
38
38
|
const atlassianMarkDownParser = new MarkdownTransformer(schema, md);
|
|
39
39
|
function getMarkdownSlice(text, openStart, openEnd) {
|
|
40
|
-
|
|
40
|
+
const textInput = escapeBackslashExceptCodeblock(text);
|
|
41
41
|
const doc = atlassianMarkDownParser.parse(escapeLinks(textInput));
|
|
42
42
|
if (doc && doc.content) {
|
|
43
43
|
return new Slice(doc.content, openStart, openEnd);
|
|
@@ -141,7 +141,7 @@ function canContainImage(element) {
|
|
|
141
141
|
*/
|
|
142
142
|
export const unwrapNestedMediaElements = html => {
|
|
143
143
|
const parser = new DOMParser();
|
|
144
|
-
|
|
144
|
+
const doc = parser.parseFromString(html, 'text/html');
|
|
145
145
|
const wrapper = doc.body;
|
|
146
146
|
|
|
147
147
|
// Remove Google Doc's wrapper <b> el
|
|
@@ -887,8 +887,8 @@ export function handleParagraphBlockMarks(state, slice) {
|
|
|
887
887
|
// element around the paragraph node
|
|
888
888
|
const grandparent = $from.node(Math.max(0, $from.depth - 1));
|
|
889
889
|
const markTypesInSlice = getTopLevelMarkTypesInSlice(slice);
|
|
890
|
-
|
|
891
|
-
for (
|
|
890
|
+
const forbiddenMarkTypes = [];
|
|
891
|
+
for (const markType of markTypesInSlice) {
|
|
892
892
|
if (!grandparent.type.allowsMarkType(markType)) {
|
|
893
893
|
forbiddenMarkTypes.push(markType);
|
|
894
894
|
}
|
|
@@ -993,7 +993,7 @@ export function handleRichText(slice, queueCardsFromChangedTr, isNestingMediaOrC
|
|
|
993
993
|
const textNodes = [heading, paragraph];
|
|
994
994
|
const selectionParent = selection.$to.node(selection.$to.depth - 1);
|
|
995
995
|
const noNeedForSafeInsert = selection.$to.node().type.validContent(slice.content) || textNodes.includes(selection.$to.node().type) && selectionParent.type.validContent(slice.content);
|
|
996
|
-
|
|
996
|
+
const panelParentOverCurrentSelection = findParentNodeOfType(panel)(tr.selection);
|
|
997
997
|
const isTargetPanelEmpty = panelParentOverCurrentSelection && ((_panelParentOverCurre = panelParentOverCurrentSelection.node) === null || _panelParentOverCurre === void 0 ? void 0 : _panelParentOverCurre.content.size) === 2;
|
|
998
998
|
let sliceContainsCodeblockOrMedia = false;
|
|
999
999
|
const codeBlockAndMediaNodes = ['codeBlock', 'mediaSingle', 'mediaGroup'];
|
|
@@ -108,6 +108,8 @@ const fillIncompleteRowWithEmptyCells = (doc, thCount, cellCount) => {
|
|
|
108
108
|
* headers exist.
|
|
109
109
|
*/
|
|
110
110
|
export const tryReconstructTableRows = doc => {
|
|
111
|
+
// Ignored via go/ees005
|
|
112
|
+
// eslint-disable-next-line prefer-const
|
|
111
113
|
let {
|
|
112
114
|
cellCount,
|
|
113
115
|
thCount,
|
|
@@ -119,6 +119,8 @@ var fillIncompleteRowWithEmptyCells = function fillIncompleteRowWithEmptyCells(d
|
|
|
119
119
|
* headers exist.
|
|
120
120
|
*/
|
|
121
121
|
export var tryReconstructTableRows = function tryReconstructTableRows(doc) {
|
|
122
|
+
// Ignored via go/ees005
|
|
123
|
+
// eslint-disable-next-line prefer-const
|
|
122
124
|
var _getTableElementsInfo = getTableElementsInfo(doc),
|
|
123
125
|
cellCount = _getTableElementsInfo.cellCount,
|
|
124
126
|
thCount = _getTableElementsInfo.thCount,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/editor-common": "^
|
|
34
|
+
"@atlaskit/editor-common": "^98.0.0",
|
|
35
35
|
"@atlaskit/editor-markdown-transformer": "^5.13.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-annotation": "^1.26.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/media-client": "^29.0.0",
|
|
47
47
|
"@atlaskit/media-common": "^11.7.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^2.31.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"lodash": "^4.17.21",
|
|
52
52
|
"uuid": "^3.1.0"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@af/visual-regression": "*",
|
|
60
60
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
61
|
-
"@atlaskit/editor-plugin-block-type": "^4.
|
|
61
|
+
"@atlaskit/editor-plugin-block-type": "^4.1.0",
|
|
62
62
|
"@atlaskit/editor-plugin-history": "^1.3.0",
|
|
63
63
|
"@atlaskit/editor-plugin-type-ahead": "^1.11.0",
|
|
64
64
|
"@atlaskit/ssr": "*",
|