@manuscripts/transform 2.3.8 → 2.3.9

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.
@@ -20,6 +20,7 @@ exports.manuscript = {
20
20
  content: 'title? contributors? affiliations? keywords? supplements? abstracts body backmatter comments',
21
21
  attrs: {
22
22
  id: { default: '' },
23
+ doi: { default: '' },
23
24
  },
24
25
  group: 'block',
25
26
  parseDOM: [
@@ -736,6 +736,7 @@ class Decoder {
736
736
  ];
737
737
  return schema_1.schema.nodes.manuscript.create({
738
738
  id: manuscriptID || this.getManuscriptID(),
739
+ doi: this.getManuscriptDOI() || '',
739
740
  }, contents);
740
741
  };
741
742
  this.addGeneratedLabels = (sections) => {
@@ -781,6 +782,13 @@ class Decoder {
781
782
  }
782
783
  }
783
784
  };
785
+ this.getManuscriptDOI = () => {
786
+ for (const item of this.modelMap.values()) {
787
+ if ((0, object_types_1.isManuscript)(item)) {
788
+ return item.DOI;
789
+ }
790
+ }
791
+ };
784
792
  this.getFigcaption = (model) => {
785
793
  const titleNode = schema_1.schema.nodes.caption_title.create();
786
794
  const captionTitle = model.title
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "2.3.8";
4
+ exports.VERSION = "2.3.9";
@@ -17,6 +17,7 @@ export const manuscript = {
17
17
  content: 'title? contributors? affiliations? keywords? supplements? abstracts body backmatter comments',
18
18
  attrs: {
19
19
  id: { default: '' },
20
+ doi: { default: '' },
20
21
  },
21
22
  group: 'block',
22
23
  parseDOM: [
@@ -727,6 +727,7 @@ export class Decoder {
727
727
  ];
728
728
  return schema.nodes.manuscript.create({
729
729
  id: manuscriptID || this.getManuscriptID(),
730
+ doi: this.getManuscriptDOI() || '',
730
731
  }, contents);
731
732
  };
732
733
  this.addGeneratedLabels = (sections) => {
@@ -772,6 +773,13 @@ export class Decoder {
772
773
  }
773
774
  }
774
775
  };
776
+ this.getManuscriptDOI = () => {
777
+ for (const item of this.modelMap.values()) {
778
+ if (isManuscript(item)) {
779
+ return item.DOI;
780
+ }
781
+ }
782
+ };
775
783
  this.getFigcaption = (model) => {
776
784
  const titleNode = schema.nodes.caption_title.create();
777
785
  const captionTitle = model.title
@@ -1 +1 @@
1
- export const VERSION = "2.3.8";
1
+ export const VERSION = "2.3.9";
@@ -18,6 +18,7 @@ import { ManuscriptNode } from '../types';
18
18
  export interface ActualManuscriptNode extends ManuscriptNode {
19
19
  attrs: {
20
20
  id: string;
21
+ doi: string;
21
22
  };
22
23
  }
23
24
  export declare const manuscript: NodeSpec;
@@ -41,6 +41,7 @@ export declare class Decoder {
41
41
  addGeneratedLabels: (sections: Section[]) => Section[];
42
42
  parseContents: (contents: string, wrapper?: string, commentAnnotations?: CommentAnnotation[], options?: ParseOptions) => ManuscriptNode;
43
43
  private getManuscriptID;
44
+ private getManuscriptDOI;
44
45
  private getFigcaption;
45
46
  private createTable;
46
47
  private createTableColGroup;
@@ -1 +1 @@
1
- export declare const VERSION = "2.3.8";
1
+ export declare const VERSION = "2.3.9";
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": "2.3.8",
4
+ "version": "2.3.9",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",