@manuscripts/body-editor 1.9.14 → 1.9.15
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
|
|
101
|
-
|
|
102
|
-
|
|
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
|
|
94
|
-
|
|
95
|
-
|
|
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.
|
|
4
|
+
"version": "1.9.15",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|