@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.
@@ -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) {
@@ -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 {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MATHJAX_VERSION = exports.VERSION = void 0;
4
- exports.VERSION = '2.8.60';
4
+ exports.VERSION = '2.8.62';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -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) {
@@ -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 {
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.8.60';
1
+ export const VERSION = '2.8.62';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.8.60";
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.60",
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",