@manuscripts/body-editor 3.2.30 → 3.2.32

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.
@@ -50,10 +50,7 @@ const addToStart = (state, dispatch) => {
50
50
  return false;
51
51
  }
52
52
  const { $anchor: { parentOffset: startOffset }, $head: { parentOffset: endOffset }, $from, $to, } = selection;
53
- const parentSize = $from.node().content.size;
54
- if ((startOffset === 0 && endOffset === 0) ||
55
- startOffset === parentSize ||
56
- endOffset === parentSize) {
53
+ if (startOffset === 0 && endOffset === 0) {
57
54
  const side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to)
58
55
  .pos - (startOffset === 0 ? 1 : 0);
59
56
  const tr = state.tr;
@@ -352,8 +349,9 @@ const findPosBeforeFirstSubsection = ($pos) => {
352
349
  const parentNode = $pos.node(d);
353
350
  if ((0, transform_1.isSectionNodeType)(parentNode.type)) {
354
351
  const parentStartPos = $pos.start(d);
355
- parentNode.descendants((node, pos) => {
352
+ parentNode.descendants((node, pos, parent) => {
356
353
  if (node.type === transform_1.schema.nodes.section &&
354
+ parent === parentNode &&
357
355
  posBeforeFirstSubsection === null) {
358
356
  posBeforeFirstSubsection = parentStartPos + pos;
359
357
  }
@@ -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 = '3.2.30';
4
+ exports.VERSION = '3.2.32';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -46,10 +46,7 @@ export const addToStart = (state, dispatch) => {
46
46
  return false;
47
47
  }
48
48
  const { $anchor: { parentOffset: startOffset }, $head: { parentOffset: endOffset }, $from, $to, } = selection;
49
- const parentSize = $from.node().content.size;
50
- if ((startOffset === 0 && endOffset === 0) ||
51
- startOffset === parentSize ||
52
- endOffset === parentSize) {
49
+ if (startOffset === 0 && endOffset === 0) {
53
50
  const side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to)
54
51
  .pos - (startOffset === 0 ? 1 : 0);
55
52
  const tr = state.tr;
@@ -331,8 +328,9 @@ export const findPosBeforeFirstSubsection = ($pos) => {
331
328
  const parentNode = $pos.node(d);
332
329
  if (isSectionNodeType(parentNode.type)) {
333
330
  const parentStartPos = $pos.start(d);
334
- parentNode.descendants((node, pos) => {
331
+ parentNode.descendants((node, pos, parent) => {
335
332
  if (node.type === schema.nodes.section &&
333
+ parent === parentNode &&
336
334
  posBeforeFirstSubsection === null) {
337
335
  posBeforeFirstSubsection = parentStartPos + pos;
338
336
  }
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.2.30';
1
+ export const VERSION = '3.2.32';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.2.30";
1
+ export declare const VERSION = "3.2.32";
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": "3.2.30",
4
+ "version": "3.2.32",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -39,7 +39,7 @@
39
39
  "@citation-js/plugin-ris": "0.7.18",
40
40
  "@manuscripts/json-schema": "2.2.12",
41
41
  "@manuscripts/style-guide": "3.1.6",
42
- "@manuscripts/track-changes-plugin": "2.0.6",
42
+ "@manuscripts/track-changes-plugin": "2.0.7",
43
43
  "@manuscripts/transform": "4.2.9",
44
44
  "@popperjs/core": "2.11.8",
45
45
  "citeproc": "2.4.63",