@manuscripts/transform 1.3.11-LEAN-2147 → 1.3.11-LEAN-2744

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.
@@ -689,7 +689,7 @@ class JATSExporter {
689
689
  const rid = getReferencedObjectId(auxiliaryObjectReference.referencedObject);
690
690
  xref.setAttribute('rid', rid);
691
691
  }
692
- xref.textContent = node.attrs.customLabel || node.attrs.label;
692
+ xref.textContent = node.attrs.label;
693
693
  return xref;
694
694
  },
695
695
  doc: () => '',
@@ -24,7 +24,6 @@ exports.crossReference = {
24
24
  attrs: {
25
25
  rid: { default: '' },
26
26
  label: { default: '' },
27
- customLabel: { default: '' },
28
27
  dataTracked: { default: null },
29
28
  },
30
29
  parseDOM: [
@@ -52,11 +51,7 @@ exports.crossReference = {
52
51
  {
53
52
  class: 'kind elementIndex',
54
53
  },
55
- [
56
- 'b',
57
- crossReferenceNode.attrs.customLabel ||
58
- crossReferenceNode.attrs.label,
59
- ],
54
+ ['b', crossReferenceNode.attrs.label],
60
55
  ],
61
56
  ];
62
57
  },
@@ -165,6 +165,8 @@ class Decoder {
165
165
  },
166
166
  [json_schema_1.ObjectTypes.BibliographyItem]: (data) => {
167
167
  const model = data;
168
+ const commentNodes = this.createCommentsNode(model);
169
+ commentNodes.forEach((c) => this.comments.set(c.attrs.id, c));
168
170
  return schema_1.schema.nodes.bibliography_item.create({
169
171
  id: model._id,
170
172
  type: model.type,
@@ -178,6 +180,7 @@ class Decoder {
178
180
  page: model.page,
179
181
  title: model.title,
180
182
  literal: model.literal,
183
+ comments: commentNodes.map((c) => c.attrs.id),
181
184
  });
182
185
  },
183
186
  [object_types_1.ExtraObjectTypes.PlaceholderElement]: (data) => {
@@ -228,8 +228,7 @@ class HTMLTransformer {
228
228
  }
229
229
  element.setAttribute('data-reference-ids', crossReferenceNode.attrs.rid);
230
230
  }
231
- element.textContent =
232
- crossReferenceNode.attrs.customLabel || crossReferenceNode.attrs.label;
231
+ element.textContent = crossReferenceNode.attrs.label;
233
232
  return element;
234
233
  };
235
234
  nodes.listing = (node) => {
@@ -682,7 +682,7 @@ export class JATSExporter {
682
682
  const rid = getReferencedObjectId(auxiliaryObjectReference.referencedObject);
683
683
  xref.setAttribute('rid', rid);
684
684
  }
685
- xref.textContent = node.attrs.customLabel || node.attrs.label;
685
+ xref.textContent = node.attrs.label;
686
686
  return xref;
687
687
  },
688
688
  doc: () => '',
@@ -21,7 +21,6 @@ export const crossReference = {
21
21
  attrs: {
22
22
  rid: { default: '' },
23
23
  label: { default: '' },
24
- customLabel: { default: '' },
25
24
  dataTracked: { default: null },
26
25
  },
27
26
  parseDOM: [
@@ -49,11 +48,7 @@ export const crossReference = {
49
48
  {
50
49
  class: 'kind elementIndex',
51
50
  },
52
- [
53
- 'b',
54
- crossReferenceNode.attrs.customLabel ||
55
- crossReferenceNode.attrs.label,
56
- ],
51
+ ['b', crossReferenceNode.attrs.label],
57
52
  ],
58
53
  ];
59
54
  },
@@ -155,6 +155,8 @@ export class Decoder {
155
155
  },
156
156
  [ObjectTypes.BibliographyItem]: (data) => {
157
157
  const model = data;
158
+ const commentNodes = this.createCommentsNode(model);
159
+ commentNodes.forEach((c) => this.comments.set(c.attrs.id, c));
158
160
  return schema.nodes.bibliography_item.create({
159
161
  id: model._id,
160
162
  type: model.type,
@@ -168,6 +170,7 @@ export class Decoder {
168
170
  page: model.page,
169
171
  title: model.title,
170
172
  literal: model.literal,
173
+ comments: commentNodes.map((c) => c.attrs.id),
171
174
  });
172
175
  },
173
176
  [ExtraObjectTypes.PlaceholderElement]: (data) => {
@@ -222,8 +222,7 @@ export class HTMLTransformer {
222
222
  }
223
223
  element.setAttribute('data-reference-ids', crossReferenceNode.attrs.rid);
224
224
  }
225
- element.textContent =
226
- crossReferenceNode.attrs.customLabel || crossReferenceNode.attrs.label;
225
+ element.textContent = crossReferenceNode.attrs.label;
227
226
  return element;
228
227
  };
229
228
  nodes.listing = (node) => {
@@ -18,7 +18,6 @@ import { ManuscriptNode } from '../types';
18
18
  interface Attrs {
19
19
  rid: string;
20
20
  label: string;
21
- customLabel: string;
22
21
  }
23
22
  export interface CrossReferenceNode extends ManuscriptNode {
24
23
  attrs: Attrs;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/transform",
3
3
  "description": "ProseMirror transformer for Manuscripts applications",
4
- "version": "1.3.11-LEAN-2147",
4
+ "version": "1.3.11-LEAN-2744",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",