@manuscripts/body-editor 2.8.60 → 2.8.62
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/dist/cjs/commands.js +1 -0
- package/dist/cjs/lib/paste.js +4 -1
- package/dist/cjs/versions.js +1 -1
- package/dist/es/commands.js +1 -0
- package/dist/es/lib/paste.js +4 -1
- package/dist/es/versions.js +1 -1
- package/dist/types/versions.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/commands.js
CHANGED
|
@@ -668,6 +668,7 @@ const insertGraphicalAbstract = (category) => (state, dispatch, view) => {
|
|
|
668
668
|
createAndFillFigureElement(state),
|
|
669
669
|
]);
|
|
670
670
|
const tr = state.tr.insert(pos, node);
|
|
671
|
+
node.lastChild && (0, accessibility_element_1.expandAccessibilitySection)(tr, node.lastChild);
|
|
671
672
|
if (dispatch) {
|
|
672
673
|
const selection = prosemirror_state_1.TextSelection.create(tr.doc, pos + 1);
|
|
673
674
|
if (view) {
|
package/dist/cjs/lib/paste.js
CHANGED
|
@@ -115,6 +115,8 @@ const handlePaste = (view, event, slice) => {
|
|
|
115
115
|
}
|
|
116
116
|
if (selection instanceof prosemirror_state_1.TextSelection &&
|
|
117
117
|
isElement(slice) &&
|
|
118
|
+
slice.openStart !== 1 &&
|
|
119
|
+
slice.openEnd !== 1 &&
|
|
118
120
|
selection.$anchor.parentOffset > 0 &&
|
|
119
121
|
selection.$head.parentOffset > 0 &&
|
|
120
122
|
selection.$from.node().type === transform_1.schema.nodes.paragraph) {
|
|
@@ -125,13 +127,14 @@ const handlePaste = (view, event, slice) => {
|
|
|
125
127
|
return true;
|
|
126
128
|
}
|
|
127
129
|
if (selection instanceof prosemirror_state_1.TextSelection &&
|
|
130
|
+
selection.$from.depth === slice.openStart &&
|
|
128
131
|
selection.$anchor.parentOffset === 0 &&
|
|
129
132
|
selection.$head.parentOffset === 0 &&
|
|
130
133
|
selection.$from.node().type === transform_1.schema.nodes.paragraph) {
|
|
131
134
|
const { $from, $to } = selection;
|
|
132
135
|
const side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to)
|
|
133
136
|
.pos - 1;
|
|
134
|
-
if (isElement(slice)) {
|
|
137
|
+
if (isElement(slice) && slice.openStart !== 1 && slice.openEnd !== 1) {
|
|
135
138
|
tr.replace(side, side, new prosemirror_model_1.Slice(slice.content, 0, 0));
|
|
136
139
|
}
|
|
137
140
|
else {
|
package/dist/cjs/versions.js
CHANGED
package/dist/es/commands.js
CHANGED
|
@@ -634,6 +634,7 @@ export const insertGraphicalAbstract = (category) => (state, dispatch, view) =>
|
|
|
634
634
|
createAndFillFigureElement(state),
|
|
635
635
|
]);
|
|
636
636
|
const tr = state.tr.insert(pos, node);
|
|
637
|
+
node.lastChild && expandAccessibilitySection(tr, node.lastChild);
|
|
637
638
|
if (dispatch) {
|
|
638
639
|
const selection = TextSelection.create(tr.doc, pos + 1);
|
|
639
640
|
if (view) {
|
package/dist/es/lib/paste.js
CHANGED
|
@@ -110,6 +110,8 @@ export const handlePaste = (view, event, slice) => {
|
|
|
110
110
|
}
|
|
111
111
|
if (selection instanceof TextSelection &&
|
|
112
112
|
isElement(slice) &&
|
|
113
|
+
slice.openStart !== 1 &&
|
|
114
|
+
slice.openEnd !== 1 &&
|
|
113
115
|
selection.$anchor.parentOffset > 0 &&
|
|
114
116
|
selection.$head.parentOffset > 0 &&
|
|
115
117
|
selection.$from.node().type === schema.nodes.paragraph) {
|
|
@@ -120,13 +122,14 @@ export const handlePaste = (view, event, slice) => {
|
|
|
120
122
|
return true;
|
|
121
123
|
}
|
|
122
124
|
if (selection instanceof TextSelection &&
|
|
125
|
+
selection.$from.depth === slice.openStart &&
|
|
123
126
|
selection.$anchor.parentOffset === 0 &&
|
|
124
127
|
selection.$head.parentOffset === 0 &&
|
|
125
128
|
selection.$from.node().type === schema.nodes.paragraph) {
|
|
126
129
|
const { $from, $to } = selection;
|
|
127
130
|
const side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to)
|
|
128
131
|
.pos - 1;
|
|
129
|
-
if (isElement(slice)) {
|
|
132
|
+
if (isElement(slice) && slice.openStart !== 1 && slice.openEnd !== 1) {
|
|
130
133
|
tr.replace(side, side, new Slice(slice.content, 0, 0));
|
|
131
134
|
}
|
|
132
135
|
else {
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.8.
|
|
1
|
+
export const VERSION = '2.8.62';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.8.
|
|
1
|
+
export declare const VERSION = "2.8.62";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/body-editor",
|
|
3
3
|
"description": "Prosemirror components for editing and viewing manuscripts",
|
|
4
|
-
"version": "2.8.
|
|
4
|
+
"version": "2.8.62",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|