@manuscripts/body-editor 1.9.13 → 1.9.15-LEAN-3592.0

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.
@@ -29,6 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.buildCitations = exports.getEffectiveAttrs = exports.getLatest = exports.buildDecorations = exports.isBibliographyElement = void 0;
30
30
  const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
31
31
  const prosemirror_view_1 = require("prosemirror-view");
32
+ const track_changes_utils_1 = require("../../lib/track-changes-utils");
32
33
  const isBibliographyElement = (node) => node.type === node.type.schema.nodes.bibliography_element;
33
34
  exports.isBibliographyElement = isBibliographyElement;
34
35
  const buildDecorations = (state, doc) => {
@@ -97,9 +98,11 @@ const getEffectiveAttrs = (node, excludeDeletedNode) => {
97
98
  return isRejected ? nodeChange === null || nodeChange === void 0 ? void 0 : nodeChange.oldAttrs : attrs;
98
99
  };
99
100
  exports.getEffectiveAttrs = getEffectiveAttrs;
100
- const buildCitations = (citations) => citations.map((citation) => ({
101
- citationID: citation[0].attrs.id,
102
- citationItems: citation[0].attrs.rids.map((rid) => ({
101
+ const buildCitations = (citations) => citations
102
+ .map((c) => (0, track_changes_utils_1.getActualAttrs)(c[0]))
103
+ .map((attrs) => ({
104
+ citationID: attrs.id,
105
+ citationItems: attrs.rids.map((rid) => ({
103
106
  id: rid,
104
107
  })),
105
108
  properties: {
@@ -26,6 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  };
27
27
  import { CHANGE_OPERATION, CHANGE_STATUS, } from '@manuscripts/track-changes-plugin';
28
28
  import { Decoration } from 'prosemirror-view';
29
+ import { getActualAttrs } from '../../lib/track-changes-utils';
29
30
  export const isBibliographyElement = (node) => node.type === node.type.schema.nodes.bibliography_element;
30
31
  export const buildDecorations = (state, doc) => {
31
32
  const decorations = [];
@@ -90,9 +91,11 @@ export const getEffectiveAttrs = (node, excludeDeletedNode) => {
90
91
  nodeChange.status === CHANGE_STATUS.rejected;
91
92
  return isRejected ? nodeChange === null || nodeChange === void 0 ? void 0 : nodeChange.oldAttrs : attrs;
92
93
  };
93
- export const buildCitations = (citations) => citations.map((citation) => ({
94
- citationID: citation[0].attrs.id,
95
- citationItems: citation[0].attrs.rids.map((rid) => ({
94
+ export const buildCitations = (citations) => citations
95
+ .map((c) => getActualAttrs(c[0]))
96
+ .map((attrs) => ({
97
+ citationID: attrs.id,
98
+ citationItems: attrs.rids.map((rid) => ({
96
99
  id: rid,
97
100
  })),
98
101
  properties: {
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": "1.9.13",
4
+ "version": "1.9.15-LEAN-3592.0",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -31,7 +31,7 @@
31
31
  "@manuscripts/assets": "^0.6.4",
32
32
  "@manuscripts/json-schema": "^2.2.7",
33
33
  "@manuscripts/library": "^1.3.6",
34
- "@manuscripts/style-guide": "1.12.4",
34
+ "@manuscripts/style-guide": "1.12.5",
35
35
  "@manuscripts/track-changes-plugin": "1.7.11",
36
36
  "@manuscripts/transform": "2.3.3",
37
37
  "astrocite-eutils": "^0.16.4",