@manuscripts/transform 1.5.8 → 2.0.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.
Files changed (133) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/jats/importer/index.js +1 -3
  3. package/dist/cjs/jats/importer/jats-body-dom-parser.js +23 -227
  4. package/dist/cjs/jats/importer/jats-body-transformations.js +110 -201
  5. package/dist/cjs/jats/importer/jats-comments.js +100 -98
  6. package/dist/cjs/jats/importer/jats-front-parser.js +87 -81
  7. package/dist/cjs/jats/importer/jats-journal-meta-parser.js +51 -39
  8. package/dist/cjs/jats/importer/jats-parser-utils.js +17 -56
  9. package/dist/cjs/jats/importer/jats-reference-parser.js +24 -79
  10. package/dist/cjs/jats/importer/jats-references.js +34 -0
  11. package/dist/cjs/jats/importer/parse-jats-article.js +67 -173
  12. package/dist/cjs/jats/index.js +1 -3
  13. package/dist/cjs/jats/jats-exporter.js +34 -55
  14. package/dist/cjs/lib/section-group-type.js +30 -0
  15. package/dist/cjs/lib/utils.js +1 -25
  16. package/dist/cjs/schema/index.js +20 -17
  17. package/dist/cjs/schema/nodes/abstracts.js +27 -0
  18. package/dist/cjs/schema/nodes/affiliations.js +27 -0
  19. package/dist/cjs/schema/nodes/backmatter.js +27 -0
  20. package/dist/cjs/schema/nodes/body.js +27 -0
  21. package/dist/cjs/schema/nodes/citation.js +10 -15
  22. package/dist/cjs/schema/nodes/{comment_list.js → comments.js} +4 -4
  23. package/dist/cjs/schema/nodes/contributors.js +27 -0
  24. package/dist/cjs/schema/nodes/{meta_section.js → core_section.js} +6 -5
  25. package/dist/cjs/schema/nodes/cross_reference.js +4 -3
  26. package/dist/cjs/schema/nodes/inline_footnote.js +6 -5
  27. package/dist/cjs/schema/nodes/keyword.js +0 -1
  28. package/dist/cjs/schema/nodes/{keywords_group.js → keyword_group.js} +6 -6
  29. package/dist/cjs/schema/nodes/{keywords_section.js → keywords.js} +7 -7
  30. package/dist/cjs/schema/nodes/keywords_element.js +1 -1
  31. package/dist/cjs/schema/nodes/manuscript.js +5 -2
  32. package/dist/cjs/transformer/builders.js +9 -86
  33. package/dist/cjs/transformer/decode.js +147 -176
  34. package/dist/cjs/transformer/encode.js +66 -67
  35. package/dist/cjs/transformer/highlight-markers.js +48 -36
  36. package/dist/cjs/transformer/html.js +7 -23
  37. package/dist/cjs/transformer/labels.js +3 -17
  38. package/dist/cjs/transformer/node-names.js +1 -1
  39. package/dist/cjs/transformer/node-title.js +1 -1
  40. package/dist/cjs/transformer/node-types.js +7 -6
  41. package/dist/cjs/transformer/object-types.js +1 -2
  42. package/dist/cjs/transformer/section-category.js +31 -31
  43. package/dist/es/index.js +1 -1
  44. package/dist/es/jats/importer/index.js +1 -1
  45. package/dist/es/jats/importer/jats-body-dom-parser.js +23 -227
  46. package/dist/es/jats/importer/jats-body-transformations.js +111 -202
  47. package/dist/es/jats/importer/jats-comments.js +97 -96
  48. package/dist/es/jats/importer/jats-front-parser.js +88 -82
  49. package/dist/es/jats/importer/jats-journal-meta-parser.js +51 -39
  50. package/dist/es/jats/importer/jats-parser-utils.js +16 -54
  51. package/dist/es/jats/importer/jats-reference-parser.js +27 -82
  52. package/dist/es/jats/importer/jats-references.js +30 -0
  53. package/dist/es/jats/importer/parse-jats-article.js +70 -174
  54. package/dist/es/jats/index.js +1 -1
  55. package/dist/es/jats/jats-exporter.js +34 -55
  56. package/dist/es/lib/section-group-type.js +27 -0
  57. package/dist/es/lib/utils.js +0 -22
  58. package/dist/es/schema/index.js +21 -18
  59. package/dist/es/schema/nodes/abstracts.js +24 -0
  60. package/dist/es/schema/nodes/affiliations.js +24 -0
  61. package/dist/es/schema/nodes/backmatter.js +24 -0
  62. package/dist/es/schema/nodes/body.js +24 -0
  63. package/dist/es/schema/nodes/citation.js +10 -15
  64. package/dist/es/schema/nodes/{comment_list.js → comments.js} +3 -3
  65. package/dist/es/schema/nodes/contributors.js +24 -0
  66. package/dist/es/schema/nodes/{meta_section.js → core_section.js} +5 -4
  67. package/dist/es/schema/nodes/cross_reference.js +4 -3
  68. package/dist/es/schema/nodes/inline_footnote.js +6 -5
  69. package/dist/es/schema/nodes/keyword.js +0 -1
  70. package/dist/es/schema/nodes/{keywords_group.js → keyword_group.js} +4 -4
  71. package/dist/es/schema/nodes/{keywords_section.js → keywords.js} +5 -5
  72. package/dist/es/schema/nodes/keywords_element.js +1 -1
  73. package/dist/es/schema/nodes/manuscript.js +3 -1
  74. package/dist/es/transformer/builders.js +6 -73
  75. package/dist/es/transformer/decode.js +147 -175
  76. package/dist/es/transformer/encode.js +70 -71
  77. package/dist/es/transformer/highlight-markers.js +44 -32
  78. package/dist/es/transformer/html.js +7 -23
  79. package/dist/es/transformer/labels.js +3 -17
  80. package/dist/es/transformer/node-names.js +1 -1
  81. package/dist/es/transformer/node-title.js +1 -1
  82. package/dist/es/transformer/node-types.js +7 -6
  83. package/dist/es/transformer/object-types.js +0 -1
  84. package/dist/es/transformer/section-category.js +29 -29
  85. package/dist/types/index.d.ts +1 -1
  86. package/dist/types/jats/importer/index.d.ts +1 -1
  87. package/dist/types/jats/importer/jats-body-transformations.d.ts +16 -19
  88. package/dist/types/jats/importer/jats-comments.d.ts +13 -9
  89. package/dist/types/jats/importer/jats-front-parser.d.ts +35 -12
  90. package/dist/types/jats/importer/jats-journal-meta-parser.d.ts +4 -4
  91. package/dist/types/jats/importer/jats-parser-utils.d.ts +1 -6
  92. package/dist/types/jats/importer/jats-reference-parser.d.ts +2 -6
  93. package/dist/types/jats/importer/jats-references.d.ts +12 -0
  94. package/dist/types/jats/importer/parse-jats-article.d.ts +5 -17
  95. package/dist/types/jats/index.d.ts +1 -1
  96. package/dist/types/lib/section-group-type.d.ts +23 -0
  97. package/dist/types/lib/utils.d.ts +1 -4
  98. package/dist/types/schema/index.d.ts +4 -5
  99. package/dist/types/schema/nodes/{meta_section.d.ts → abstracts.d.ts} +1 -9
  100. package/dist/types/schema/nodes/affiliations.d.ts +17 -0
  101. package/dist/types/schema/nodes/backmatter.d.ts +17 -0
  102. package/dist/types/schema/nodes/body.d.ts +17 -0
  103. package/dist/types/schema/nodes/citation.d.ts +3 -5
  104. package/dist/types/schema/nodes/comments.d.ts +17 -0
  105. package/dist/types/schema/nodes/contributors.d.ts +17 -0
  106. package/dist/types/schema/nodes/core_section.d.ts +17 -0
  107. package/dist/types/schema/nodes/cross_reference.d.ts +1 -1
  108. package/dist/types/schema/nodes/inline_footnote.d.ts +1 -1
  109. package/dist/types/schema/nodes/keyword.d.ts +0 -1
  110. package/dist/types/schema/nodes/{contributors_element.d.ts → keyword_group.d.ts} +3 -4
  111. package/dist/types/schema/nodes/{comment_list.d.ts → keywords.d.ts} +3 -2
  112. package/dist/types/schema/nodes/manuscript.d.ts +1 -0
  113. package/dist/types/schema/types.d.ts +1 -1
  114. package/dist/types/transformer/builders.d.ts +2 -14
  115. package/dist/types/transformer/decode.d.ts +5 -9
  116. package/dist/types/transformer/encode.d.ts +4 -4
  117. package/dist/types/transformer/highlight-markers.d.ts +7 -2
  118. package/dist/types/transformer/object-types.d.ts +1 -2
  119. package/dist/types/transformer/section-category.d.ts +4 -3
  120. package/package.json +1 -6
  121. package/dist/cjs/lib/core-section-categories.js +0 -29
  122. package/dist/cjs/schema/nodes/affiliations_section.js +0 -36
  123. package/dist/cjs/schema/nodes/contributors_element.js +0 -49
  124. package/dist/cjs/schema/nodes/contributors_section.js +0 -36
  125. package/dist/es/lib/core-section-categories.js +0 -26
  126. package/dist/es/schema/nodes/affiliations_section.js +0 -32
  127. package/dist/es/schema/nodes/contributors_element.js +0 -46
  128. package/dist/es/schema/nodes/contributors_section.js +0 -32
  129. package/dist/types/lib/core-section-categories.d.ts +0 -8
  130. package/dist/types/schema/nodes/affiliations_section.d.ts +0 -11
  131. package/dist/types/schema/nodes/contributors_section.d.ts +0 -12
  132. package/dist/types/schema/nodes/keywords_group.d.ts +0 -26
  133. package/dist/types/schema/nodes/keywords_section.d.ts +0 -26
@@ -431,9 +431,11 @@ class JATSExporter {
431
431
  }
432
432
  };
433
433
  this.buildBody = (fragment) => {
434
- const content = this.serializeFragment(fragment);
435
434
  const body = this.document.createElement('body');
436
- body.appendChild(content);
435
+ fragment.forEach((cFragment) => {
436
+ const serializedNode = this.serializeNode(cFragment);
437
+ body.append(...serializedNode.childNodes);
438
+ });
437
439
  this.fixBody(body, fragment);
438
440
  return body;
439
441
  };
@@ -600,17 +602,19 @@ class JATSExporter {
600
602
  const getModel = (id) => id ? this.modelMap.get(id) : undefined;
601
603
  const nodes = {
602
604
  title: () => '',
603
- affiliations_section: () => '',
604
- contributors_section: () => '',
605
+ affiliations: () => '',
606
+ contributors: () => '',
605
607
  table_element_footer: () => ['table-wrap-foot', 0],
606
608
  contributor: () => '',
607
609
  affiliation: () => '',
608
- meta_section: () => '',
609
610
  attribution: () => ['attrib', 0],
610
611
  bibliography_element: () => '',
611
612
  bibliography_item: () => '',
612
- comment_list: () => '',
613
- keywords_group: () => '',
613
+ comments: () => '',
614
+ keyword_group: () => '',
615
+ body: () => ['body', 0],
616
+ abstracts: () => ['abstract', 0],
617
+ backmatter: () => ['backmatter', 0],
614
618
  bibliography_section: (node) => [
615
619
  'ref-list',
616
620
  { id: normalizeID(node.attrs.id) },
@@ -626,26 +630,15 @@ class JATSExporter {
626
630
  return ['title', 0];
627
631
  },
628
632
  citation: (node) => {
629
- if (!node.attrs.rid) {
630
- warn(`${node.attrs.id} has no rid`);
631
- return node.attrs.label;
632
- }
633
- const rids = node.attrs
634
- .embeddedCitationItems.filter((item) => {
635
- if (!this.modelMap.has(item.bibliographyItem)) {
636
- warn(`Missing ${item.bibliographyItem} referenced by ${node.attrs.rid}`);
637
- return false;
638
- }
639
- return true;
640
- });
633
+ const citation = node;
634
+ const rids = citation.attrs.rids;
641
635
  if (!rids.length) {
642
- warn(`${node.attrs.rid} has no confirmed rids`);
643
636
  return '';
644
637
  }
645
638
  const xref = this.document.createElement('xref');
646
639
  xref.setAttribute('ref-type', 'bibr');
647
- xref.setAttribute('rid', rids.map((item) => normalizeID(item.bibliographyItem)).join(' '));
648
- if (node.attrs.contents) {
640
+ xref.setAttribute('rid', normalizeID(rids.join(' ')));
641
+ if (citation.attrs.contents) {
649
642
  const text = (0, html_1.textFromHTML)(node.attrs.contents);
650
643
  if (text !== null && text.length) {
651
644
  xref.textContent = text;
@@ -654,41 +647,27 @@ class JATSExporter {
654
647
  return xref;
655
648
  },
656
649
  cross_reference: (node) => {
657
- var _a;
658
- if (!node.attrs.rid) {
659
- warn(`${node.attrs.id} has no rid`);
660
- return node.attrs.label;
650
+ const cross = node;
651
+ const rids = cross.attrs.rids;
652
+ if (!rids.length) {
653
+ return cross.attrs.label;
661
654
  }
662
- const auxiliaryObjectReference = getModel(node.attrs.rid);
663
- if (!auxiliaryObjectReference) {
664
- warn(`Missing model ${node.attrs.rid}`);
665
- return node.attrs.label;
655
+ const text = cross.attrs.customLabel || cross.attrs.label;
656
+ const model = getModel(rids[0]);
657
+ if (!model) {
658
+ warn('');
659
+ return text;
666
660
  }
667
661
  const xref = this.document.createElement('xref');
668
- const referencedObject = getModel(auxiliaryObjectReference.referencedObject ||
669
- ((auxiliaryObjectReference === null || auxiliaryObjectReference === void 0 ? void 0 : auxiliaryObjectReference.referencedObjects) &&
670
- auxiliaryObjectReference.referencedObjects[0]));
671
- if (referencedObject) {
672
- const refType = chooseRefType(referencedObject.objectType);
673
- if (refType) {
674
- xref.setAttribute('ref-type', refType);
675
- }
676
- else {
677
- warn(`Unset ref-type for objectType ${referencedObject.objectType}`);
678
- }
662
+ const type = chooseRefType(model.objectType);
663
+ if (type) {
664
+ xref.setAttribute('ref-type', type);
679
665
  }
680
- const getReferencedObjectId = (referencedObject) => {
681
- return normalizeID(referencedObject);
682
- };
683
- if (auxiliaryObjectReference.referencedObjects) {
684
- const rid = (_a = auxiliaryObjectReference.referencedObjects) === null || _a === void 0 ? void 0 : _a.map((referencedObject) => getReferencedObjectId(referencedObject)).join(' ');
685
- xref.setAttribute('rid', rid);
686
- }
687
- if (auxiliaryObjectReference.referencedObject) {
688
- const rid = getReferencedObjectId(auxiliaryObjectReference.referencedObject);
689
- xref.setAttribute('rid', rid);
666
+ else {
667
+ warn(`Unset ref-type for objectType ${model.objectType}`);
690
668
  }
691
- xref.textContent = node.attrs.customLabel || node.attrs.label;
669
+ xref.setAttribute('rid', normalizeID(rids.join(' ')));
670
+ xref.textContent = text;
692
671
  return xref;
693
672
  },
694
673
  doc: () => '',
@@ -756,7 +735,7 @@ class JATSExporter {
756
735
  };
757
736
  return ['sec', attrs, 0];
758
737
  },
759
- hard_break: () => ['break'],
738
+ hard_break: () => '',
760
739
  highlight_marker: () => '',
761
740
  inline_equation: (node) => {
762
741
  const formula = this.document.createElement('inline-formula');
@@ -783,13 +762,13 @@ class JATSExporter {
783
762
  inline_footnote: (node) => {
784
763
  const xref = this.document.createElement('xref');
785
764
  xref.setAttribute('ref-type', 'fn');
786
- xref.setAttribute('rid', normalizeID(node.attrs.rid));
765
+ xref.setAttribute('rid', normalizeID(node.attrs.rids.join(' ')));
787
766
  xref.textContent = node.attrs.contents;
788
767
  return xref;
789
768
  },
790
769
  keyword: () => '',
791
770
  keywords_element: () => '',
792
- keywords_section: () => '',
771
+ keywords: () => '',
793
772
  link: (node) => {
794
773
  const text = node.textContent;
795
774
  if (!text) {
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2023 Atypon Systems LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.backmatterType = exports.bodyType = exports.abstractsType = void 0;
19
+ exports.abstractsType = {
20
+ _id: 'abstracts',
21
+ title: 'Abstracts',
22
+ };
23
+ exports.bodyType = {
24
+ _id: 'body',
25
+ title: 'Body',
26
+ };
27
+ exports.backmatterType = {
28
+ _id: 'backmatter',
29
+ title: 'Backmatter',
30
+ };
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.modelsEqual = exports.getTrimmedTextContent = exports.findParentNodeClosestToPos = exports.isInAbstractsSection = exports.isInBibliographySection = exports.isInGraphicalAbstractSection = exports.findNodePositions = exports.iterateChildren = void 0;
18
+ exports.getTrimmedTextContent = exports.findParentNodeClosestToPos = exports.isInBibliographySection = exports.isInGraphicalAbstractSection = exports.findNodePositions = exports.iterateChildren = void 0;
19
19
  const bibliography_section_1 = require("../schema/nodes/bibliography_section");
20
20
  const graphical_abstract_section_1 = require("../schema/nodes/graphical_abstract_section");
21
21
  function* iterateChildren(node, recurse = false) {
@@ -61,17 +61,6 @@ const isInBibliographySection = ($pos) => {
61
61
  return false;
62
62
  };
63
63
  exports.isInBibliographySection = isInBibliographySection;
64
- const isAbstractsSectionNode = (node) => node.attrs.category === 'MPSectionCategory:abstracts';
65
- const isInAbstractsSection = ($pos) => {
66
- for (let i = $pos.depth; i > 0; i--) {
67
- const node = $pos.node(i);
68
- if (isAbstractsSectionNode(node)) {
69
- return true;
70
- }
71
- }
72
- return false;
73
- };
74
- exports.isInAbstractsSection = isInAbstractsSection;
75
64
  const findParentNodeClosestToPos = ($pos, predicate) => {
76
65
  for (let i = $pos.depth; i > 0; i--) {
77
66
  const node = $pos.node(i);
@@ -94,16 +83,3 @@ const getTrimmedTextContent = (node, querySelector) => {
94
83
  return (_b = (_a = node.querySelector(querySelector)) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim();
95
84
  };
96
85
  exports.getTrimmedTextContent = getTrimmedTextContent;
97
- function modelsEqual(model, model2) {
98
- for (const v in model) {
99
- for (const v2 in model2) {
100
- const prepV = typeof v == 'object' ? JSON.stringify(v) : v;
101
- const prepV2 = typeof v2 == 'object' ? JSON.stringify(v2) : v2;
102
- if (prepV !== prepV2) {
103
- return false;
104
- }
105
- }
106
- }
107
- return true;
108
- }
109
- exports.modelsEqual = modelsEqual;
@@ -32,20 +32,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
32
32
  exports.schema = void 0;
33
33
  const prosemirror_model_1 = require("prosemirror-model");
34
34
  const marks_1 = require("./marks");
35
+ const abstracts_1 = require("./nodes/abstracts");
35
36
  const affiliation_1 = require("./nodes/affiliation");
36
- const affiliations_section_1 = require("./nodes/affiliations_section");
37
+ const affiliations_1 = require("./nodes/affiliations");
37
38
  const attribution_1 = require("./nodes/attribution");
39
+ const backmatter_1 = require("./nodes/backmatter");
38
40
  const bibliography_element_1 = require("./nodes/bibliography_element");
39
41
  const bibliography_item_1 = require("./nodes/bibliography_item");
40
42
  const bibliography_section_1 = require("./nodes/bibliography_section");
41
43
  const blockquote_element_1 = require("./nodes/blockquote_element");
44
+ const body_1 = require("./nodes/body");
42
45
  const caption_1 = require("./nodes/caption");
43
46
  const caption_title_1 = require("./nodes/caption_title");
44
47
  const citation_1 = require("./nodes/citation");
45
48
  const comment_1 = require("./nodes/comment");
46
- const comment_list_1 = require("./nodes/comment_list");
49
+ const comments_1 = require("./nodes/comments");
47
50
  const contributor_1 = require("./nodes/contributor");
48
- const contributors_section_1 = require("./nodes/contributors_section");
51
+ const contributors_1 = require("./nodes/contributors");
49
52
  const cross_reference_1 = require("./nodes/cross_reference");
50
53
  const doc_1 = require("./nodes/doc");
51
54
  const equation_1 = require("./nodes/equation");
@@ -62,15 +65,14 @@ const highlight_marker_1 = require("./nodes/highlight_marker");
62
65
  const inline_equation_1 = require("./nodes/inline_equation");
63
66
  const inline_footnote_1 = require("./nodes/inline_footnote");
64
67
  const keyword_1 = require("./nodes/keyword");
68
+ const keyword_group_1 = require("./nodes/keyword_group");
69
+ const keywords_1 = require("./nodes/keywords");
65
70
  const keywords_element_1 = require("./nodes/keywords_element");
66
- const keywords_group_1 = require("./nodes/keywords_group");
67
- const keywords_section_1 = require("./nodes/keywords_section");
68
71
  const link_1 = require("./nodes/link");
69
72
  const list_1 = require("./nodes/list");
70
73
  const listing_1 = require("./nodes/listing");
71
74
  const listing_element_1 = require("./nodes/listing_element");
72
75
  const manuscript_1 = require("./nodes/manuscript");
73
- const meta_section_1 = require("./nodes/meta_section");
74
76
  const missing_figure_1 = require("./nodes/missing_figure");
75
77
  const paragraph_1 = require("./nodes/paragraph");
76
78
  const placeholder_1 = require("./nodes/placeholder");
@@ -91,7 +93,7 @@ const toc_section_1 = require("./nodes/toc_section");
91
93
  __exportStar(require("./groups"), exports);
92
94
  __exportStar(require("./types"), exports);
93
95
  __exportStar(require("./nodes/comment"), exports);
94
- __exportStar(require("./nodes/comment_list"), exports);
96
+ __exportStar(require("./nodes/comments"), exports);
95
97
  __exportStar(require("./nodes/attribution"), exports);
96
98
  __exportStar(require("./nodes/bibliography_item"), exports);
97
99
  __exportStar(require("./nodes/bibliography_element"), exports);
@@ -117,7 +119,7 @@ __exportStar(require("./nodes/inline_equation"), exports);
117
119
  __exportStar(require("./nodes/inline_footnote"), exports);
118
120
  __exportStar(require("./nodes/keyword"), exports);
119
121
  __exportStar(require("./nodes/keywords_element"), exports);
120
- __exportStar(require("./nodes/keywords_section"), exports);
122
+ __exportStar(require("./nodes/keywords"), exports);
121
123
  __exportStar(require("./nodes/link"), exports);
122
124
  __exportStar(require("./nodes/list"), exports);
123
125
  __exportStar(require("./nodes/listing"), exports);
@@ -138,12 +140,11 @@ __exportStar(require("./nodes/text"), exports);
138
140
  __exportStar(require("./nodes/toc_element"), exports);
139
141
  __exportStar(require("./nodes/toc_section"), exports);
140
142
  __exportStar(require("./nodes/affiliation"), exports);
141
- __exportStar(require("./nodes/meta_section"), exports);
142
143
  __exportStar(require("./nodes/contributor"), exports);
143
144
  __exportStar(require("./nodes/table_element_footer"), exports);
144
145
  __exportStar(require("./nodes/title"), exports);
145
- __exportStar(require("./nodes/affiliations_section"), exports);
146
- __exportStar(require("./nodes/contributors_section"), exports);
146
+ __exportStar(require("./nodes/affiliations"), exports);
147
+ __exportStar(require("./nodes/contributors"), exports);
147
148
  exports.schema = new prosemirror_model_1.Schema({
148
149
  marks: {
149
150
  bold: marks_1.bold,
@@ -160,7 +161,7 @@ exports.schema = new prosemirror_model_1.Schema({
160
161
  },
161
162
  nodes: {
162
163
  comment: comment_1.comment,
163
- comment_list: comment_list_1.commentList,
164
+ comments: comments_1.comments,
164
165
  attribution: attribution_1.attribution,
165
166
  bibliography_item: bibliography_item_1.bibliographyItem,
166
167
  bibliography_element: bibliography_element_1.bibliographyElement,
@@ -170,6 +171,9 @@ exports.schema = new prosemirror_model_1.Schema({
170
171
  caption: caption_1.caption,
171
172
  caption_title: caption_title_1.captionTitle,
172
173
  citation: citation_1.citation,
174
+ abstracts: abstracts_1.abstracts,
175
+ body: body_1.body,
176
+ backmatter: backmatter_1.backmatter,
173
177
  cross_reference: cross_reference_1.crossReference,
174
178
  doc: doc_1.doc,
175
179
  equation: equation_1.equation,
@@ -187,8 +191,8 @@ exports.schema = new prosemirror_model_1.Schema({
187
191
  inline_footnote: inline_footnote_1.inlineFootnote,
188
192
  keyword: keyword_1.keyword,
189
193
  keywords_element: keywords_element_1.keywordsElement,
190
- keywords_section: keywords_section_1.keywordsSection,
191
- keywords_group: keywords_group_1.keywordsGroup,
194
+ keywords: keywords_1.keywords,
195
+ keyword_group: keyword_group_1.keywordGroup,
192
196
  link: link_1.link,
193
197
  list_item: list_1.listItem,
194
198
  listing: listing_1.listing,
@@ -215,11 +219,10 @@ exports.schema = new prosemirror_model_1.Schema({
215
219
  toc_element: toc_element_1.tocElement,
216
220
  toc_section: toc_section_1.tocSection,
217
221
  affiliation: affiliation_1.affiliation,
218
- meta_section: meta_section_1.metaSection,
219
222
  contributor: contributor_1.contributor,
220
223
  table_element_footer: table_element_footer_1.tableElementFooter,
221
224
  title: title_1.title,
222
- affiliations_section: affiliations_section_1.affiliationsSection,
223
- contributors_section: contributors_section_1.contributorsSection,
225
+ affiliations: affiliations_1.affiliations,
226
+ contributors: contributors_1.contributors,
224
227
  },
225
228
  });
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2019 Atypon Systems LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.abstracts = void 0;
19
+ exports.abstracts = {
20
+ content: 'sections*',
21
+ atom: true,
22
+ attrs: {
23
+ id: { default: '' },
24
+ },
25
+ group: 'block',
26
+ toDOM: () => ['div', { class: 'abstracts' }, 0],
27
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2023 Atypon Systems LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.affiliations = void 0;
19
+ exports.affiliations = {
20
+ content: 'affiliation*',
21
+ attrs: {
22
+ id: { default: '' },
23
+ },
24
+ group: 'block',
25
+ selectable: false,
26
+ toDOM: () => ['div', { class: 'affiliations' }, 0],
27
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2019 Atypon Systems LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.backmatter = void 0;
19
+ exports.backmatter = {
20
+ content: 'sections*',
21
+ atom: true,
22
+ attrs: {
23
+ id: { default: '' },
24
+ },
25
+ group: 'block',
26
+ toDOM: () => ['div', { class: 'backmatter' }, 0],
27
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2019 Atypon Systems LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.body = void 0;
19
+ exports.body = {
20
+ content: 'sections*',
21
+ atom: true,
22
+ attrs: {
23
+ id: { default: '' },
24
+ },
25
+ group: 'block',
26
+ toDOM: () => ['div', { class: 'body' }, 0],
27
+ };
@@ -22,38 +22,33 @@ exports.citation = {
22
22
  draggable: true,
23
23
  atom: true,
24
24
  attrs: {
25
- rid: { default: '' },
25
+ id: { default: '' },
26
+ rids: { default: [] },
26
27
  contents: { default: '' },
27
28
  selectedText: { default: '' },
28
29
  dataTracked: { default: null },
29
- embeddedCitationItems: { default: [] },
30
30
  },
31
31
  parseDOM: [
32
32
  {
33
33
  tag: 'span.citation[data-reference-id]',
34
34
  getAttrs: (p) => {
35
+ var _a;
35
36
  const dom = p;
36
- const attr = {
37
- rid: dom.getAttribute('data-reference-id'),
37
+ return {
38
+ id: dom.getAttribute('data-id'),
39
+ rids: ((_a = dom.getAttribute('data-reference-id')) === null || _a === void 0 ? void 0 : _a.split(/\s+/)) || [],
38
40
  contents: dom.innerHTML,
39
41
  };
40
- const embeddedCitationAttr = dom.getAttribute('data-reference-embedded-citation');
41
- if (embeddedCitationAttr) {
42
- attr['embeddedCitationItems'] = JSON.parse(embeddedCitationAttr);
43
- }
44
- return attr;
45
42
  },
46
43
  },
47
44
  ],
48
45
  toDOM: (node) => {
49
- const citationNode = node;
46
+ const citation = node;
50
47
  const dom = document.createElement('span');
51
48
  dom.className = 'citation';
52
- dom.setAttribute('data-reference-id', citationNode.attrs.rid);
53
- if (citationNode.attrs.embeddedCitationItems) {
54
- dom.setAttribute('data-reference-embedded-citation', JSON.stringify(citationNode.attrs.embeddedCitationItems));
55
- }
56
- dom.innerHTML = citationNode.attrs.contents;
49
+ dom.setAttribute('data-id', citation.attrs.id);
50
+ dom.setAttribute('data-reference-id', citation.attrs.rids.join(' '));
51
+ dom.innerHTML = node.attrs.contents;
57
52
  return dom;
58
53
  },
59
54
  };
@@ -15,11 +15,11 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.commentList = void 0;
19
- exports.commentList = {
18
+ exports.comments = void 0;
19
+ exports.comments = {
20
20
  content: 'comment*',
21
21
  attrs: {
22
- id: { default: 'COMMENT_LIST' },
22
+ id: { default: '' },
23
23
  },
24
- toDOM: () => ['section', 0],
24
+ toDOM: () => ['div', { class: 'comments' }, 0],
25
25
  };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2023 Atypon Systems LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.contributors = void 0;
19
+ exports.contributors = {
20
+ content: 'contributor*',
21
+ attrs: {
22
+ id: { default: '' },
23
+ },
24
+ group: 'block',
25
+ selectable: false,
26
+ toDOM: () => ['div', { class: 'contributors' }, 0],
27
+ };
@@ -15,12 +15,13 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.metaSection = void 0;
19
- exports.metaSection = {
20
- content: 'comment_list',
18
+ exports.coreSection = void 0;
19
+ exports.coreSection = {
20
+ content: 'sections*',
21
+ atom: true,
21
22
  attrs: {
22
- id: { default: 'META_SECTION' },
23
+ id: { default: '' },
23
24
  },
24
- group: 'block sections',
25
+ group: 'block',
25
26
  toDOM: () => ['section', 0],
26
27
  };
@@ -22,7 +22,7 @@ exports.crossReference = {
22
22
  draggable: true,
23
23
  atom: true,
24
24
  attrs: {
25
- rid: { default: '' },
25
+ rids: { default: [] },
26
26
  label: { default: '' },
27
27
  customLabel: { default: '' },
28
28
  dataTracked: { default: null },
@@ -31,9 +31,10 @@ exports.crossReference = {
31
31
  {
32
32
  tag: 'span.cross-reference',
33
33
  getAttrs: (p) => {
34
+ var _a;
34
35
  const dom = p;
35
36
  return {
36
- rid: dom.getAttribute('data-reference-id'),
37
+ rids: ((_a = dom.getAttribute('data-reference-id')) === null || _a === void 0 ? void 0 : _a.split(/\s+/)) || [],
37
38
  label: dom.textContent,
38
39
  };
39
40
  },
@@ -45,7 +46,7 @@ exports.crossReference = {
45
46
  'span',
46
47
  {
47
48
  class: 'cross-reference',
48
- 'data-reference-id': crossReferenceNode.attrs.rid,
49
+ 'data-reference-id': crossReferenceNode.attrs.rids.join(' '),
49
50
  },
50
51
  [
51
52
  'span',
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.isInlineFootnoteNode = exports.inlineFootnote = void 0;
19
19
  exports.inlineFootnote = {
20
20
  attrs: {
21
- rid: { default: '' },
21
+ rids: { default: [] },
22
22
  contents: { default: '' },
23
23
  dataTracked: { default: null },
24
24
  },
@@ -30,20 +30,21 @@ exports.inlineFootnote = {
30
30
  {
31
31
  tag: 'span.footnote',
32
32
  getAttrs: (p) => {
33
+ var _a;
33
34
  const dom = p;
34
35
  return {
35
- rid: dom.getAttribute('data-reference-id'),
36
+ rids: ((_a = dom.getAttribute('data-reference-id')) === null || _a === void 0 ? void 0 : _a.split(/\s+/)) || [],
36
37
  contents: dom.textContent,
37
38
  };
38
39
  },
39
40
  },
40
41
  ],
41
42
  toDOM: (node) => {
42
- const inlineFootnoteNode = node;
43
+ const footnoteNode = node;
43
44
  const dom = document.createElement('span');
44
45
  dom.className = 'footnote';
45
- dom.setAttribute('data-reference-id', inlineFootnoteNode.attrs.rid);
46
- dom.textContent = inlineFootnoteNode.attrs.contents;
46
+ dom.setAttribute('data-reference-id', footnoteNode.attrs.rids.join(''));
47
+ dom.textContent = footnoteNode.attrs.contents;
47
48
  return dom;
48
49
  },
49
50
  };
@@ -21,7 +21,6 @@ exports.keyword = {
21
21
  content: 'inline*',
22
22
  attrs: {
23
23
  id: { default: '' },
24
- contents: { default: '' },
25
24
  dataTracked: { default: null },
26
25
  comments: { default: null },
27
26
  },