@atlaskit/editor-plugin-paste 1.0.5 → 1.0.6
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/handlers.js +7 -2
- package/dist/es2019/handlers.js +5 -2
- package/dist/esm/handlers.js +7 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 1.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#75436](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75436) [`bfcf32bb4fa3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bfcf32bb4fa3) - [ux] ED-21941 Disable resize/layout options for table, media and extension when added to MBE. Table rendering fixed for Confluence editor
|
|
8
|
+
|
|
3
9
|
## 1.0.5
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/handlers.js
CHANGED
|
@@ -818,13 +818,18 @@ function handleParagraphBlockMarks(state, slice) {
|
|
|
818
818
|
return new _model.Slice(slice.content, openStart, slice.openEnd);
|
|
819
819
|
}
|
|
820
820
|
|
|
821
|
-
// If the paragraph contains marks forbidden by the parent node
|
|
822
|
-
// drop those marks from the slice
|
|
821
|
+
// If the paragraph or heading contains marks forbidden by the parent node
|
|
822
|
+
// (e.g. alignment/indentation), drop those marks from the slice
|
|
823
823
|
return (0, _utils.mapSlice)(slice, function (node) {
|
|
824
824
|
if (node.type === schema.nodes.paragraph) {
|
|
825
825
|
return schema.nodes.paragraph.createChecked(undefined, node.content, node.marks.filter(function (mark) {
|
|
826
826
|
return !forbiddenMarkTypes.includes(mark.type);
|
|
827
827
|
}));
|
|
828
|
+
} else if (node.type === schema.nodes.heading) {
|
|
829
|
+
// Preserve heading attributes to keep formatting
|
|
830
|
+
return schema.nodes.heading.createChecked(node.attrs, node.content, node.marks.filter(function (mark) {
|
|
831
|
+
return !forbiddenMarkTypes.includes(mark.type);
|
|
832
|
+
}));
|
|
828
833
|
}
|
|
829
834
|
return node;
|
|
830
835
|
});
|
package/dist/es2019/handlers.js
CHANGED
|
@@ -796,11 +796,14 @@ export function handleParagraphBlockMarks(state, slice) {
|
|
|
796
796
|
return new Slice(slice.content, openStart, slice.openEnd);
|
|
797
797
|
}
|
|
798
798
|
|
|
799
|
-
// If the paragraph contains marks forbidden by the parent node
|
|
800
|
-
// drop those marks from the slice
|
|
799
|
+
// If the paragraph or heading contains marks forbidden by the parent node
|
|
800
|
+
// (e.g. alignment/indentation), drop those marks from the slice
|
|
801
801
|
return mapSlice(slice, node => {
|
|
802
802
|
if (node.type === schema.nodes.paragraph) {
|
|
803
803
|
return schema.nodes.paragraph.createChecked(undefined, node.content, node.marks.filter(mark => !forbiddenMarkTypes.includes(mark.type)));
|
|
804
|
+
} else if (node.type === schema.nodes.heading) {
|
|
805
|
+
// Preserve heading attributes to keep formatting
|
|
806
|
+
return schema.nodes.heading.createChecked(node.attrs, node.content, node.marks.filter(mark => !forbiddenMarkTypes.includes(mark.type)));
|
|
804
807
|
}
|
|
805
808
|
return node;
|
|
806
809
|
});
|
package/dist/esm/handlers.js
CHANGED
|
@@ -796,13 +796,18 @@ export function handleParagraphBlockMarks(state, slice) {
|
|
|
796
796
|
return new Slice(slice.content, openStart, slice.openEnd);
|
|
797
797
|
}
|
|
798
798
|
|
|
799
|
-
// If the paragraph contains marks forbidden by the parent node
|
|
800
|
-
// drop those marks from the slice
|
|
799
|
+
// If the paragraph or heading contains marks forbidden by the parent node
|
|
800
|
+
// (e.g. alignment/indentation), drop those marks from the slice
|
|
801
801
|
return mapSlice(slice, function (node) {
|
|
802
802
|
if (node.type === schema.nodes.paragraph) {
|
|
803
803
|
return schema.nodes.paragraph.createChecked(undefined, node.content, node.marks.filter(function (mark) {
|
|
804
804
|
return !forbiddenMarkTypes.includes(mark.type);
|
|
805
805
|
}));
|
|
806
|
+
} else if (node.type === schema.nodes.heading) {
|
|
807
|
+
// Preserve heading attributes to keep formatting
|
|
808
|
+
return schema.nodes.heading.createChecked(node.attrs, node.content, node.marks.filter(function (mark) {
|
|
809
|
+
return !forbiddenMarkTypes.includes(mark.type);
|
|
810
|
+
}));
|
|
806
811
|
}
|
|
807
812
|
return node;
|
|
808
813
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
".": "./src/index.ts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/editor-common": "^78.
|
|
37
|
-
"@atlaskit/editor-markdown-transformer": "^5.
|
|
36
|
+
"@atlaskit/editor-common": "^78.8.0",
|
|
37
|
+
"@atlaskit/editor-markdown-transformer": "^5.4.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-annotation": "^1.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-better-type-history": "^1.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-card": "^1.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-list": "^3.1.0",
|
|
44
|
-
"@atlaskit/editor-plugin-media": "^1.
|
|
44
|
+
"@atlaskit/editor-plugin-media": "^1.4.0",
|
|
45
45
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
46
46
|
"@atlaskit/editor-tables": "^2.5.0",
|
|
47
47
|
"@atlaskit/media-client": "^26.2.0",
|