@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.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/jats/importer/index.js +1 -3
- package/dist/cjs/jats/importer/jats-body-dom-parser.js +23 -227
- package/dist/cjs/jats/importer/jats-body-transformations.js +110 -201
- package/dist/cjs/jats/importer/jats-comments.js +100 -98
- package/dist/cjs/jats/importer/jats-front-parser.js +87 -81
- package/dist/cjs/jats/importer/jats-journal-meta-parser.js +51 -39
- package/dist/cjs/jats/importer/jats-parser-utils.js +17 -56
- package/dist/cjs/jats/importer/jats-reference-parser.js +24 -79
- package/dist/cjs/jats/importer/jats-references.js +34 -0
- package/dist/cjs/jats/importer/parse-jats-article.js +67 -173
- package/dist/cjs/jats/index.js +1 -3
- package/dist/cjs/jats/jats-exporter.js +34 -55
- package/dist/cjs/lib/section-group-type.js +30 -0
- package/dist/cjs/lib/utils.js +1 -25
- package/dist/cjs/schema/index.js +20 -17
- package/dist/cjs/schema/nodes/abstracts.js +27 -0
- package/dist/cjs/schema/nodes/affiliations.js +27 -0
- package/dist/cjs/schema/nodes/backmatter.js +27 -0
- package/dist/cjs/schema/nodes/body.js +27 -0
- package/dist/cjs/schema/nodes/citation.js +10 -15
- package/dist/cjs/schema/nodes/{comment_list.js → comments.js} +4 -4
- package/dist/cjs/schema/nodes/contributors.js +27 -0
- package/dist/cjs/schema/nodes/{meta_section.js → core_section.js} +6 -5
- package/dist/cjs/schema/nodes/cross_reference.js +4 -3
- package/dist/cjs/schema/nodes/inline_footnote.js +6 -5
- package/dist/cjs/schema/nodes/keyword.js +0 -1
- package/dist/cjs/schema/nodes/{keywords_group.js → keyword_group.js} +6 -6
- package/dist/cjs/schema/nodes/{keywords_section.js → keywords.js} +7 -7
- package/dist/cjs/schema/nodes/keywords_element.js +1 -1
- package/dist/cjs/schema/nodes/manuscript.js +5 -2
- package/dist/cjs/transformer/builders.js +9 -86
- package/dist/cjs/transformer/decode.js +147 -176
- package/dist/cjs/transformer/encode.js +66 -67
- package/dist/cjs/transformer/highlight-markers.js +48 -36
- package/dist/cjs/transformer/html.js +7 -23
- package/dist/cjs/transformer/labels.js +3 -17
- package/dist/cjs/transformer/node-names.js +1 -1
- package/dist/cjs/transformer/node-title.js +1 -1
- package/dist/cjs/transformer/node-types.js +7 -6
- package/dist/cjs/transformer/object-types.js +1 -2
- package/dist/cjs/transformer/section-category.js +31 -31
- package/dist/es/index.js +1 -1
- package/dist/es/jats/importer/index.js +1 -1
- package/dist/es/jats/importer/jats-body-dom-parser.js +23 -227
- package/dist/es/jats/importer/jats-body-transformations.js +111 -202
- package/dist/es/jats/importer/jats-comments.js +97 -96
- package/dist/es/jats/importer/jats-front-parser.js +88 -82
- package/dist/es/jats/importer/jats-journal-meta-parser.js +51 -39
- package/dist/es/jats/importer/jats-parser-utils.js +16 -54
- package/dist/es/jats/importer/jats-reference-parser.js +27 -82
- package/dist/es/jats/importer/jats-references.js +30 -0
- package/dist/es/jats/importer/parse-jats-article.js +70 -174
- package/dist/es/jats/index.js +1 -1
- package/dist/es/jats/jats-exporter.js +34 -55
- package/dist/es/lib/section-group-type.js +27 -0
- package/dist/es/lib/utils.js +0 -22
- package/dist/es/schema/index.js +21 -18
- package/dist/es/schema/nodes/abstracts.js +24 -0
- package/dist/es/schema/nodes/affiliations.js +24 -0
- package/dist/es/schema/nodes/backmatter.js +24 -0
- package/dist/es/schema/nodes/body.js +24 -0
- package/dist/es/schema/nodes/citation.js +10 -15
- package/dist/es/schema/nodes/{comment_list.js → comments.js} +3 -3
- package/dist/es/schema/nodes/contributors.js +24 -0
- package/dist/es/schema/nodes/{meta_section.js → core_section.js} +5 -4
- package/dist/es/schema/nodes/cross_reference.js +4 -3
- package/dist/es/schema/nodes/inline_footnote.js +6 -5
- package/dist/es/schema/nodes/keyword.js +0 -1
- package/dist/es/schema/nodes/{keywords_group.js → keyword_group.js} +4 -4
- package/dist/es/schema/nodes/{keywords_section.js → keywords.js} +5 -5
- package/dist/es/schema/nodes/keywords_element.js +1 -1
- package/dist/es/schema/nodes/manuscript.js +3 -1
- package/dist/es/transformer/builders.js +6 -73
- package/dist/es/transformer/decode.js +147 -175
- package/dist/es/transformer/encode.js +70 -71
- package/dist/es/transformer/highlight-markers.js +44 -32
- package/dist/es/transformer/html.js +7 -23
- package/dist/es/transformer/labels.js +3 -17
- package/dist/es/transformer/node-names.js +1 -1
- package/dist/es/transformer/node-title.js +1 -1
- package/dist/es/transformer/node-types.js +7 -6
- package/dist/es/transformer/object-types.js +0 -1
- package/dist/es/transformer/section-category.js +29 -29
- package/dist/types/index.d.ts +1 -1
- package/dist/types/jats/importer/index.d.ts +1 -1
- package/dist/types/jats/importer/jats-body-transformations.d.ts +16 -19
- package/dist/types/jats/importer/jats-comments.d.ts +13 -9
- package/dist/types/jats/importer/jats-front-parser.d.ts +35 -12
- package/dist/types/jats/importer/jats-journal-meta-parser.d.ts +4 -4
- package/dist/types/jats/importer/jats-parser-utils.d.ts +1 -6
- package/dist/types/jats/importer/jats-reference-parser.d.ts +2 -6
- package/dist/types/jats/importer/jats-references.d.ts +12 -0
- package/dist/types/jats/importer/parse-jats-article.d.ts +5 -17
- package/dist/types/jats/index.d.ts +1 -1
- package/dist/types/lib/section-group-type.d.ts +23 -0
- package/dist/types/lib/utils.d.ts +1 -4
- package/dist/types/schema/index.d.ts +4 -5
- package/dist/types/schema/nodes/{meta_section.d.ts → abstracts.d.ts} +1 -9
- package/dist/types/schema/nodes/affiliations.d.ts +17 -0
- package/dist/types/schema/nodes/backmatter.d.ts +17 -0
- package/dist/types/schema/nodes/body.d.ts +17 -0
- package/dist/types/schema/nodes/citation.d.ts +3 -5
- package/dist/types/schema/nodes/comments.d.ts +17 -0
- package/dist/types/schema/nodes/contributors.d.ts +17 -0
- package/dist/types/schema/nodes/core_section.d.ts +17 -0
- package/dist/types/schema/nodes/cross_reference.d.ts +1 -1
- package/dist/types/schema/nodes/inline_footnote.d.ts +1 -1
- package/dist/types/schema/nodes/keyword.d.ts +0 -1
- package/dist/types/schema/nodes/{contributors_element.d.ts → keyword_group.d.ts} +3 -4
- package/dist/types/schema/nodes/{comment_list.d.ts → keywords.d.ts} +3 -2
- package/dist/types/schema/nodes/manuscript.d.ts +1 -0
- package/dist/types/schema/types.d.ts +1 -1
- package/dist/types/transformer/builders.d.ts +2 -14
- package/dist/types/transformer/decode.d.ts +5 -9
- package/dist/types/transformer/encode.d.ts +4 -4
- package/dist/types/transformer/highlight-markers.d.ts +7 -2
- package/dist/types/transformer/object-types.d.ts +1 -2
- package/dist/types/transformer/section-category.d.ts +4 -3
- package/package.json +1 -6
- package/dist/cjs/lib/core-section-categories.js +0 -29
- package/dist/cjs/schema/nodes/affiliations_section.js +0 -36
- package/dist/cjs/schema/nodes/contributors_element.js +0 -49
- package/dist/cjs/schema/nodes/contributors_section.js +0 -36
- package/dist/es/lib/core-section-categories.js +0 -26
- package/dist/es/schema/nodes/affiliations_section.js +0 -32
- package/dist/es/schema/nodes/contributors_element.js +0 -46
- package/dist/es/schema/nodes/contributors_section.js +0 -32
- package/dist/types/lib/core-section-categories.d.ts +0 -8
- package/dist/types/schema/nodes/affiliations_section.d.ts +0 -11
- package/dist/types/schema/nodes/contributors_section.d.ts +0 -12
- package/dist/types/schema/nodes/keywords_group.d.ts +0 -26
- 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
|
-
|
|
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
|
-
|
|
604
|
-
|
|
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
|
-
|
|
613
|
-
|
|
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
|
-
|
|
630
|
-
|
|
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',
|
|
648
|
-
if (
|
|
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
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
return
|
|
650
|
+
const cross = node;
|
|
651
|
+
const rids = cross.attrs.rids;
|
|
652
|
+
if (!rids.length) {
|
|
653
|
+
return cross.attrs.label;
|
|
661
654
|
}
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
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
|
|
669
|
-
|
|
670
|
-
|
|
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
|
-
|
|
681
|
-
|
|
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.
|
|
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: () =>
|
|
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.
|
|
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
|
-
|
|
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
|
+
};
|
package/dist/cjs/lib/utils.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
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;
|
package/dist/cjs/schema/index.js
CHANGED
|
@@ -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
|
|
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
|
|
49
|
+
const comments_1 = require("./nodes/comments");
|
|
47
50
|
const contributor_1 = require("./nodes/contributor");
|
|
48
|
-
const
|
|
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/
|
|
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/
|
|
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/
|
|
146
|
-
__exportStar(require("./nodes/
|
|
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
|
-
|
|
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
|
-
|
|
191
|
-
|
|
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
|
-
|
|
223
|
-
|
|
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
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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
|
|
46
|
+
const citation = node;
|
|
50
47
|
const dom = document.createElement('span');
|
|
51
48
|
dom.className = 'citation';
|
|
52
|
-
dom.setAttribute('data-
|
|
53
|
-
|
|
54
|
-
|
|
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.
|
|
19
|
-
exports.
|
|
18
|
+
exports.comments = void 0;
|
|
19
|
+
exports.comments = {
|
|
20
20
|
content: 'comment*',
|
|
21
21
|
attrs: {
|
|
22
|
-
id: { default: '
|
|
22
|
+
id: { default: '' },
|
|
23
23
|
},
|
|
24
|
-
toDOM: () => ['
|
|
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.
|
|
19
|
-
exports.
|
|
20
|
-
content: '
|
|
18
|
+
exports.coreSection = void 0;
|
|
19
|
+
exports.coreSection = {
|
|
20
|
+
content: 'sections*',
|
|
21
|
+
atom: true,
|
|
21
22
|
attrs: {
|
|
22
|
-
id: { default: '
|
|
23
|
+
id: { default: '' },
|
|
23
24
|
},
|
|
24
|
-
group: 'block
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
43
|
+
const footnoteNode = node;
|
|
43
44
|
const dom = document.createElement('span');
|
|
44
45
|
dom.className = 'footnote';
|
|
45
|
-
dom.setAttribute('data-reference-id',
|
|
46
|
-
dom.textContent =
|
|
46
|
+
dom.setAttribute('data-reference-id', footnoteNode.attrs.rids.join(''));
|
|
47
|
+
dom.textContent = footnoteNode.attrs.contents;
|
|
47
48
|
return dom;
|
|
48
49
|
},
|
|
49
50
|
};
|