@manuscripts/transform 3.0.14-LEAN-3961.0 → 3.0.14
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 +2 -1
- package/dist/cjs/jats/exporter/jats-exporter.js +7 -9
- package/dist/cjs/jats/importer/jats-dom-parser.js +949 -969
- package/dist/cjs/jats/importer/jats-transformations.js +14 -9
- package/dist/cjs/jats/importer/parse-jats-article.js +5 -7
- package/dist/cjs/lib/{section-categories.js → section-group-type.js} +14 -4
- package/dist/cjs/lib/table-cell-styles.js +52 -0
- package/dist/cjs/schema/index.js +0 -6
- package/dist/cjs/schema/migration/migration-scripts/3.0.12.js +18 -0
- package/dist/cjs/schema/migration/migration-scripts/index.js +2 -2
- package/dist/cjs/transformer/index.js +1 -0
- package/dist/cjs/transformer/node-names.js +0 -1
- package/dist/cjs/transformer/node-title.js +0 -1
- package/dist/cjs/transformer/node-types.js +0 -2
- package/dist/cjs/transformer/section-category.js +263 -0
- package/dist/cjs/version.js +1 -1
- package/dist/es/index.js +2 -1
- package/dist/es/jats/exporter/jats-exporter.js +8 -10
- package/dist/es/jats/importer/jats-dom-parser.js +948 -967
- package/dist/es/jats/importer/jats-transformations.js +14 -9
- package/dist/es/jats/importer/parse-jats-article.js +6 -8
- package/dist/es/lib/{section-categories.js → section-group-type.js} +13 -2
- package/dist/es/lib/table-cell-styles.js +47 -0
- package/dist/es/schema/index.js +0 -6
- package/dist/es/schema/migration/migration-scripts/3.0.12.js +14 -0
- package/dist/es/schema/migration/migration-scripts/index.js +2 -2
- package/dist/es/transformer/index.js +1 -0
- package/dist/es/transformer/node-names.js +0 -1
- package/dist/es/transformer/node-title.js +0 -1
- package/dist/es/transformer/node-types.js +0 -2
- package/dist/es/transformer/section-category.js +249 -0
- package/dist/es/version.js +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/jats/importer/jats-dom-parser.d.ts +9 -24
- package/dist/types/jats/importer/jats-transformations.d.ts +1 -2
- package/dist/types/jats/importer/parse-jats-article.d.ts +2 -2
- package/dist/types/{schema/nodes/toc_element.d.ts → lib/section-group-type.d.ts} +9 -12
- package/dist/types/lib/table-cell-styles.d.ts +27 -0
- package/dist/types/schema/index.d.ts +0 -2
- package/dist/types/schema/migration/migration-scripts/{3.0.14.d.ts → 3.0.12.d.ts} +1 -3
- package/dist/types/schema/migration/migration-scripts/index.d.ts +2 -2
- package/dist/types/schema/types.d.ts +2 -22
- package/dist/types/transformer/index.d.ts +1 -0
- package/dist/types/transformer/section-category.d.ts +31 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/schema/migration/migration-scripts/3.0.14.js +0 -25
- package/dist/cjs/schema/nodes/toc_element.js +0 -51
- package/dist/cjs/schema/nodes/toc_section.js +0 -46
- package/dist/es/schema/migration/migration-scripts/3.0.14.js +0 -23
- package/dist/es/schema/nodes/toc_element.js +0 -48
- package/dist/es/schema/nodes/toc_section.js +0 -42
- package/dist/types/lib/section-categories.d.ts +0 -17
- package/dist/types/schema/nodes/toc_section.d.ts +0 -26
package/dist/cjs/index.js
CHANGED
|
@@ -20,9 +20,10 @@ 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);
|
|
23
25
|
__exportStar(require("./lib/footnotes"), exports);
|
|
24
26
|
__exportStar(require("./lib/utils"), exports);
|
|
25
|
-
__exportStar(require("./lib/section-categories"), exports);
|
|
26
27
|
__exportStar(require("./schema"), exports);
|
|
27
28
|
var migrate_1 = require("./schema/migration/migrate");
|
|
28
29
|
Object.defineProperty(exports, "migrateFor", { enumerable: true, get: function () { return migrate_1.migrateFor; } });
|
|
@@ -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'] = node.attrs.category;
|
|
787
|
+
attrs['sec-type'] = (0, transformer_1.chooseSecType)(node.attrs.category);
|
|
788
788
|
}
|
|
789
789
|
return ['sec', attrs, 0];
|
|
790
790
|
},
|
|
@@ -811,8 +811,6 @@ class JATSExporter {
|
|
|
811
811
|
table_col: (node) => ['col', { width: node.attrs.width }],
|
|
812
812
|
table_colgroup: () => ['colgroup', 0],
|
|
813
813
|
text: (node) => node.text,
|
|
814
|
-
toc_element: () => '',
|
|
815
|
-
toc_section: () => '',
|
|
816
814
|
comment: () => '',
|
|
817
815
|
};
|
|
818
816
|
const marks = {
|
|
@@ -1238,7 +1236,7 @@ class JATSExporter {
|
|
|
1238
1236
|
break;
|
|
1239
1237
|
}
|
|
1240
1238
|
case 'table': {
|
|
1241
|
-
this.fixTable(childNode);
|
|
1239
|
+
this.fixTable(childNode, node);
|
|
1242
1240
|
break;
|
|
1243
1241
|
}
|
|
1244
1242
|
}
|
|
@@ -1259,7 +1257,7 @@ class JATSExporter {
|
|
|
1259
1257
|
node.replaceWith(clone);
|
|
1260
1258
|
return clone;
|
|
1261
1259
|
};
|
|
1262
|
-
this.fixTable = (table) => {
|
|
1260
|
+
this.fixTable = (table, node) => {
|
|
1263
1261
|
let tbody;
|
|
1264
1262
|
Array.from(table.childNodes).forEach((child) => {
|
|
1265
1263
|
if (child instanceof Element && child.tagName.toLowerCase() === 'tbody') {
|
|
@@ -1386,7 +1384,7 @@ class JATSExporter {
|
|
|
1386
1384
|
if (availabilitySection) {
|
|
1387
1385
|
back.insertBefore(availabilitySection, back.firstChild);
|
|
1388
1386
|
}
|
|
1389
|
-
const section = body.querySelector('sec[sec-type="
|
|
1387
|
+
const section = body.querySelector('sec[sec-type="acknowledgments"]');
|
|
1390
1388
|
if (section) {
|
|
1391
1389
|
const ack = this.document.createElement('ack');
|
|
1392
1390
|
while (section.firstChild) {
|
|
@@ -1423,7 +1421,7 @@ class JATSExporter {
|
|
|
1423
1421
|
'supported-by',
|
|
1424
1422
|
'financial-disclosure',
|
|
1425
1423
|
'ethics-statement',
|
|
1426
|
-
'
|
|
1424
|
+
'competing-interests',
|
|
1427
1425
|
];
|
|
1428
1426
|
const sections = body.querySelectorAll('sec');
|
|
1429
1427
|
for (const currentSection of sections) {
|
|
@@ -1574,7 +1572,7 @@ class JATSExporter {
|
|
|
1574
1572
|
const fnGroups = back.querySelectorAll('fn-group');
|
|
1575
1573
|
fnGroups.forEach((fnGroup) => {
|
|
1576
1574
|
if (fnGroup) {
|
|
1577
|
-
const coiStatement = fnGroup.querySelector('fn[fn-type="
|
|
1575
|
+
const coiStatement = fnGroup.querySelector('fn[fn-type="competing-interests"]');
|
|
1578
1576
|
if (coiStatement) {
|
|
1579
1577
|
const authorNotes = this.document.createElement('author-notes');
|
|
1580
1578
|
authorNotes.append(coiStatement);
|
|
@@ -1616,7 +1614,7 @@ class JATSExporter {
|
|
|
1616
1614
|
footnotes.forEach((fn) => {
|
|
1617
1615
|
const fnType = fn.getAttribute('fn-type');
|
|
1618
1616
|
if (fnType) {
|
|
1619
|
-
fn.setAttribute('fn-type', fnType);
|
|
1617
|
+
fn.setAttribute('fn-type', (0, transformer_1.chooseJatsFnType)(fnType));
|
|
1620
1618
|
}
|
|
1621
1619
|
});
|
|
1622
1620
|
}
|