@manuscripts/body-editor 2.6.6 → 2.6.7

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.
@@ -61,12 +61,13 @@ exports.default = (props) => {
61
61
  };
62
62
  let version = 1;
63
63
  const buildBibliographyPluginState = (doc, csl, $old) => {
64
- const nodes = [];
64
+ const nodesMap = new Map();
65
65
  doc.descendants((node, pos) => {
66
66
  if ((0, transform_1.isCitationNode)(node)) {
67
- nodes.push([node, pos]);
67
+ nodesMap.set(node.attrs.id, [node, pos]);
68
68
  }
69
69
  });
70
+ const nodes = Array.from(nodesMap.values());
70
71
  const bibliographyItems = getBibliographyItemAttrs(doc);
71
72
  const citations = (0, bibliography_utils_1.buildCitations)(nodes);
72
73
  const $new = {
@@ -16,11 +16,10 @@ exports.default = () => {
16
16
  const ids = new Set();
17
17
  const tr = newState.tr;
18
18
  newState.doc.descendants((node, pos, parent) => {
19
- if ((0, transform_1.isHighlightMarkerNode)(node) ||
19
+ if (!(node.type.spec.attrs && 'id' in node.type.spec.attrs) ||
20
+ (0, transform_1.isHighlightMarkerNode)(node) ||
20
21
  isManuscriptNode(node) ||
21
- isManuscriptNode(parent) ||
22
- !node.type.spec.attrs ||
23
- !('id' in node.type.spec.attrs)) {
22
+ isManuscriptNode(parent)) {
24
23
  return;
25
24
  }
26
25
  let id = node.attrs.id;
@@ -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.6.6';
4
+ exports.VERSION = '2.6.7';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -26,7 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  };
27
27
  import { ObjectTypes } from '@manuscripts/json-schema';
28
28
  import { CitationProvider } from '@manuscripts/library';
29
- import { isCitationNode, schema } from '@manuscripts/transform';
29
+ import { isCitationNode, schema, } from '@manuscripts/transform';
30
30
  import { isEqual, pickBy } from 'lodash';
31
31
  import { Plugin, PluginKey } from 'prosemirror-state';
32
32
  import { findChildrenByType } from 'prosemirror-utils';
@@ -58,12 +58,13 @@ export default (props) => {
58
58
  };
59
59
  let version = 1;
60
60
  const buildBibliographyPluginState = (doc, csl, $old) => {
61
- const nodes = [];
61
+ const nodesMap = new Map();
62
62
  doc.descendants((node, pos) => {
63
63
  if (isCitationNode(node)) {
64
- nodes.push([node, pos]);
64
+ nodesMap.set(node.attrs.id, [node, pos]);
65
65
  }
66
66
  });
67
+ const nodes = Array.from(nodesMap.values());
67
68
  const bibliographyItems = getBibliographyItemAttrs(doc);
68
69
  const citations = buildCitations(nodes);
69
70
  const $new = {
@@ -14,11 +14,10 @@ export default () => {
14
14
  const ids = new Set();
15
15
  const tr = newState.tr;
16
16
  newState.doc.descendants((node, pos, parent) => {
17
- if (isHighlightMarkerNode(node) ||
17
+ if (!(node.type.spec.attrs && 'id' in node.type.spec.attrs) ||
18
+ isHighlightMarkerNode(node) ||
18
19
  isManuscriptNode(node) ||
19
- isManuscriptNode(parent) ||
20
- !node.type.spec.attrs ||
21
- !('id' in node.type.spec.attrs)) {
20
+ isManuscriptNode(parent)) {
22
21
  return;
23
22
  }
24
23
  let id = node.attrs.id;
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.6.6';
1
+ export const VERSION = '2.6.7';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.6.6";
1
+ export declare const VERSION = "2.6.7";
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.6.6",
4
+ "version": "2.6.7",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",