@manuscripts/body-editor 3.6.22 → 3.6.24

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.
@@ -840,6 +840,7 @@ const findListsAtSameLevel = (doc, list) => {
840
840
  function toggleOffList(state, dispatch) {
841
841
  const { selection: { $from }, tr, } = state;
842
842
  let rootList = findRootList($from);
843
+ rootList && rootList.pos--;
843
844
  if (state.selection instanceof prosemirror_state_1.NodeSelection &&
844
845
  state.selection.node.type === transform_1.schema.nodes.list) {
845
846
  rootList = {
@@ -854,18 +855,12 @@ function toggleOffList(state, dispatch) {
854
855
  node.nodeSize > rootList.pos + rootList.node.nodeSize)) {
855
856
  return true;
856
857
  }
857
- const $fromPos = tr.doc.resolve(tr.mapping.map(pos));
858
- const $toPos = tr.doc.resolve(tr.mapping.map(pos + node.nodeSize - 1));
859
- const nodeRange = $fromPos.blockRange($toPos);
860
- if (!nodeRange) {
861
- return;
862
- }
863
- const targetLiftDepth = (0, prosemirror_transform_1.liftTarget)(nodeRange);
864
- if (targetLiftDepth || targetLiftDepth === 0) {
865
- tr.lift(nodeRange, targetLiftDepth);
858
+ if (node.type === transform_1.schema.nodes.paragraph) {
859
+ tr.insert(tr.mapping.map(rootList.pos), node);
866
860
  return false;
867
861
  }
868
862
  });
863
+ tr.delete(tr.mapping.map(rootList.pos), tr.mapping.map(rootList.pos + rootList.node.nodeSize));
869
864
  dispatch(tr);
870
865
  return true;
871
866
  }
@@ -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.6.22';
4
+ exports.VERSION = '3.6.24';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -20,7 +20,7 @@ import { Fragment, NodeRange, Slice, } from 'prosemirror-model';
20
20
  import { wrapInList } from 'prosemirror-schema-list';
21
21
  import { NodeSelection, TextSelection, } from 'prosemirror-state';
22
22
  import { addColumnAfter, addColumnBefore, addRow, selectedRect, } from 'prosemirror-tables';
23
- import { findWrapping, liftTarget, ReplaceAroundStep, ReplaceStep, } from 'prosemirror-transform';
23
+ import { findWrapping, ReplaceAroundStep, ReplaceStep, } from 'prosemirror-transform';
24
24
  import { findChildrenByType, findParentNodeOfType, findParentNodeOfTypeClosestToPos, flatten, hasParentNodeOfType, } from 'prosemirror-utils';
25
25
  import { getCommentKey, getCommentRange } from './lib/comments';
26
26
  import { findAbstractsNode, findBackmatter, findBibliographySection, findBody, findFootnotesSection, insertAttachmentsNode, insertAwardsNode, insertFootnotesSection, upsertSupplementsSection, } from './lib/doc';
@@ -801,6 +801,7 @@ const findListsAtSameLevel = (doc, list) => {
801
801
  function toggleOffList(state, dispatch) {
802
802
  const { selection: { $from }, tr, } = state;
803
803
  let rootList = findRootList($from);
804
+ rootList && rootList.pos--;
804
805
  if (state.selection instanceof NodeSelection &&
805
806
  state.selection.node.type === schema.nodes.list) {
806
807
  rootList = {
@@ -815,18 +816,12 @@ function toggleOffList(state, dispatch) {
815
816
  node.nodeSize > rootList.pos + rootList.node.nodeSize)) {
816
817
  return true;
817
818
  }
818
- const $fromPos = tr.doc.resolve(tr.mapping.map(pos));
819
- const $toPos = tr.doc.resolve(tr.mapping.map(pos + node.nodeSize - 1));
820
- const nodeRange = $fromPos.blockRange($toPos);
821
- if (!nodeRange) {
822
- return;
823
- }
824
- const targetLiftDepth = liftTarget(nodeRange);
825
- if (targetLiftDepth || targetLiftDepth === 0) {
826
- tr.lift(nodeRange, targetLiftDepth);
819
+ if (node.type === schema.nodes.paragraph) {
820
+ tr.insert(tr.mapping.map(rootList.pos), node);
827
821
  return false;
828
822
  }
829
823
  });
824
+ tr.delete(tr.mapping.map(rootList.pos), tr.mapping.map(rootList.pos + rootList.node.nodeSize));
830
825
  dispatch(tr);
831
826
  return true;
832
827
  }
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.6.22';
1
+ export const VERSION = '3.6.24';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.6.22";
1
+ export declare const VERSION = "3.6.24";
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.6.22",
4
+ "version": "3.6.24",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -39,8 +39,8 @@
39
39
  "@iarna/word-count": "1.1.2",
40
40
  "@manuscripts/json-schema": "2.2.12",
41
41
  "@manuscripts/style-guide": "3.3.5",
42
- "@manuscripts/track-changes-plugin": "2.1.0",
43
- "@manuscripts/transform": "4.3.7",
42
+ "@manuscripts/track-changes-plugin": "2.1.1",
43
+ "@manuscripts/transform": "4.3.8",
44
44
  "@popperjs/core": "2.11.8",
45
45
  "citeproc": "2.4.63",
46
46
  "codemirror": "5.65.19",