@manuscripts/transform 3.0.19 → 3.0.21-LEAN-3961.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 -2
- package/dist/cjs/jats/exporter/jats-exporter.js +11 -10
- package/dist/cjs/jats/importer/jats-dom-parser.js +972 -949
- package/dist/cjs/jats/importer/jats-transformations.js +9 -14
- package/dist/cjs/jats/importer/parse-jats-article.js +7 -5
- package/dist/cjs/lib/{section-group-type.js → section-categories.js} +4 -14
- package/dist/cjs/schema/migration/migration-scripts/3.0.15.js +25 -0
- package/dist/cjs/schema/migration/migration-scripts/index.js +2 -0
- package/dist/cjs/schema/nodes/figure_element.js +1 -0
- package/dist/cjs/transformer/index.js +0 -1
- package/dist/cjs/version.js +1 -1
- package/dist/es/index.js +1 -2
- package/dist/es/jats/exporter/jats-exporter.js +12 -11
- package/dist/es/jats/importer/jats-dom-parser.js +970 -948
- package/dist/es/jats/importer/jats-transformations.js +9 -14
- package/dist/es/jats/importer/parse-jats-article.js +8 -6
- package/dist/es/lib/{section-group-type.js → section-categories.js} +2 -13
- package/dist/es/schema/migration/migration-scripts/3.0.15.js +23 -0
- package/dist/es/schema/migration/migration-scripts/index.js +2 -0
- package/dist/es/schema/nodes/figure_element.js +1 -0
- package/dist/es/transformer/index.js +0 -1
- package/dist/es/version.js +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/jats/importer/jats-dom-parser.d.ts +24 -9
- package/dist/types/jats/importer/jats-transformations.d.ts +2 -1
- package/dist/types/jats/importer/parse-jats-article.d.ts +2 -2
- package/dist/types/lib/{section-group-type.d.ts → section-categories.d.ts} +3 -9
- package/dist/types/schema/migration/migration-scripts/3.0.15.d.ts +9 -0
- package/dist/types/schema/migration/migration-scripts/index.d.ts +2 -1
- package/dist/types/schema/nodes/figure_element.d.ts +1 -0
- package/dist/types/schema/types.d.ts +21 -1
- package/dist/types/transformer/index.d.ts +0 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/lib/table-cell-styles.js +0 -52
- package/dist/cjs/transformer/section-category.js +0 -263
- package/dist/es/lib/table-cell-styles.js +0 -47
- package/dist/es/transformer/section-category.js +0 -249
- package/dist/types/lib/table-cell-styles.d.ts +0 -27
- package/dist/types/transformer/section-category.d.ts +0 -31
package/dist/cjs/index.js
CHANGED
|
@@ -20,10 +20,9 @@ var getVersion_1 = require("./getVersion");
|
|
|
20
20
|
Object.defineProperty(exports, "getVersion", { enumerable: true, get: function () { return getVersion_1.getVersion; } });
|
|
21
21
|
__exportStar(require("./jats"), exports);
|
|
22
22
|
__exportStar(require("./jats/types"), exports);
|
|
23
|
-
__exportStar(require("./lib/section-group-type"), exports);
|
|
24
|
-
__exportStar(require("./lib/table-cell-styles"), exports);
|
|
25
23
|
__exportStar(require("./lib/footnotes"), exports);
|
|
26
24
|
__exportStar(require("./lib/utils"), exports);
|
|
25
|
+
__exportStar(require("./lib/section-categories"), exports);
|
|
27
26
|
__exportStar(require("./schema"), exports);
|
|
28
27
|
var migrate_1 = require("./schema/migration/migrate");
|
|
29
28
|
Object.defineProperty(exports, "migrateFor", { enumerable: true, get: function () { return migrate_1.migrateFor; } });
|
|
@@ -679,7 +679,7 @@ class JATSExporter {
|
|
|
679
679
|
}
|
|
680
680
|
return graphic;
|
|
681
681
|
},
|
|
682
|
-
figure_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.figure
|
|
682
|
+
figure_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.figure),
|
|
683
683
|
footnote: (node) => {
|
|
684
684
|
const attrs = {};
|
|
685
685
|
if (node.attrs.id) {
|
|
@@ -740,7 +740,7 @@ class JATSExporter {
|
|
|
740
740
|
code.textContent = node.attrs.contents;
|
|
741
741
|
return code;
|
|
742
742
|
},
|
|
743
|
-
listing_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.listing
|
|
743
|
+
listing_element: (node) => createFigureElement(node, 'fig', node.type.schema.nodes.listing),
|
|
744
744
|
manuscript: (node) => ['article', { id: normalizeID(node.attrs.id) }, 0],
|
|
745
745
|
missing_figure: () => {
|
|
746
746
|
const graphic = this.document.createElement('graphic');
|
|
@@ -784,7 +784,7 @@ class JATSExporter {
|
|
|
784
784
|
id: normalizeID(node.attrs.id),
|
|
785
785
|
};
|
|
786
786
|
if (node.attrs.category) {
|
|
787
|
-
attrs['sec-type'] =
|
|
787
|
+
attrs['sec-type'] = node.attrs.category;
|
|
788
788
|
}
|
|
789
789
|
return ['sec', attrs, 0];
|
|
790
790
|
},
|
|
@@ -912,8 +912,9 @@ class JATSExporter {
|
|
|
912
912
|
processChildNodes(element, node, node.type.schema.nodes.section);
|
|
913
913
|
return element;
|
|
914
914
|
};
|
|
915
|
-
const createFigureElement = (node, nodeName, contentNodeType
|
|
915
|
+
const createFigureElement = (node, nodeName, contentNodeType) => {
|
|
916
916
|
const element = createElement(node, nodeName);
|
|
917
|
+
const figType = node.attrs.type;
|
|
917
918
|
if (figType) {
|
|
918
919
|
element.setAttribute('fig-type', figType);
|
|
919
920
|
}
|
|
@@ -1236,7 +1237,7 @@ class JATSExporter {
|
|
|
1236
1237
|
break;
|
|
1237
1238
|
}
|
|
1238
1239
|
case 'table': {
|
|
1239
|
-
this.fixTable(childNode
|
|
1240
|
+
this.fixTable(childNode);
|
|
1240
1241
|
break;
|
|
1241
1242
|
}
|
|
1242
1243
|
}
|
|
@@ -1257,7 +1258,7 @@ class JATSExporter {
|
|
|
1257
1258
|
node.replaceWith(clone);
|
|
1258
1259
|
return clone;
|
|
1259
1260
|
};
|
|
1260
|
-
this.fixTable = (table
|
|
1261
|
+
this.fixTable = (table) => {
|
|
1261
1262
|
let tbody;
|
|
1262
1263
|
Array.from(table.childNodes).forEach((child) => {
|
|
1263
1264
|
if (child instanceof Element && child.tagName.toLowerCase() === 'tbody') {
|
|
@@ -1384,7 +1385,7 @@ class JATSExporter {
|
|
|
1384
1385
|
if (availabilitySection) {
|
|
1385
1386
|
back.insertBefore(availabilitySection, back.firstChild);
|
|
1386
1387
|
}
|
|
1387
|
-
const section = body.querySelector('sec[sec-type="
|
|
1388
|
+
const section = body.querySelector('sec[sec-type="acknowledgements"]');
|
|
1388
1389
|
if (section) {
|
|
1389
1390
|
const ack = this.document.createElement('ack');
|
|
1390
1391
|
while (section.firstChild) {
|
|
@@ -1421,7 +1422,7 @@ class JATSExporter {
|
|
|
1421
1422
|
'supported-by',
|
|
1422
1423
|
'financial-disclosure',
|
|
1423
1424
|
'ethics-statement',
|
|
1424
|
-
'
|
|
1425
|
+
'coi-statement',
|
|
1425
1426
|
];
|
|
1426
1427
|
const sections = body.querySelectorAll('sec');
|
|
1427
1428
|
for (const currentSection of sections) {
|
|
@@ -1572,7 +1573,7 @@ class JATSExporter {
|
|
|
1572
1573
|
const fnGroups = back.querySelectorAll('fn-group');
|
|
1573
1574
|
fnGroups.forEach((fnGroup) => {
|
|
1574
1575
|
if (fnGroup) {
|
|
1575
|
-
const coiStatement = fnGroup.querySelector('fn[fn-type="
|
|
1576
|
+
const coiStatement = fnGroup.querySelector('fn[fn-type="coi-statement"]');
|
|
1576
1577
|
if (coiStatement) {
|
|
1577
1578
|
const authorNotes = this.document.createElement('author-notes');
|
|
1578
1579
|
authorNotes.append(coiStatement);
|
|
@@ -1614,7 +1615,7 @@ class JATSExporter {
|
|
|
1614
1615
|
footnotes.forEach((fn) => {
|
|
1615
1616
|
const fnType = fn.getAttribute('fn-type');
|
|
1616
1617
|
if (fnType) {
|
|
1617
|
-
fn.setAttribute('fn-type',
|
|
1618
|
+
fn.setAttribute('fn-type', fnType);
|
|
1618
1619
|
}
|
|
1619
1620
|
});
|
|
1620
1621
|
}
|