@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.
Files changed (54) hide show
  1. package/dist/cjs/index.js +2 -1
  2. package/dist/cjs/jats/exporter/jats-exporter.js +7 -9
  3. package/dist/cjs/jats/importer/jats-dom-parser.js +949 -969
  4. package/dist/cjs/jats/importer/jats-transformations.js +14 -9
  5. package/dist/cjs/jats/importer/parse-jats-article.js +5 -7
  6. package/dist/cjs/lib/{section-categories.js → section-group-type.js} +14 -4
  7. package/dist/cjs/lib/table-cell-styles.js +52 -0
  8. package/dist/cjs/schema/index.js +0 -6
  9. package/dist/cjs/schema/migration/migration-scripts/3.0.12.js +18 -0
  10. package/dist/cjs/schema/migration/migration-scripts/index.js +2 -2
  11. package/dist/cjs/transformer/index.js +1 -0
  12. package/dist/cjs/transformer/node-names.js +0 -1
  13. package/dist/cjs/transformer/node-title.js +0 -1
  14. package/dist/cjs/transformer/node-types.js +0 -2
  15. package/dist/cjs/transformer/section-category.js +263 -0
  16. package/dist/cjs/version.js +1 -1
  17. package/dist/es/index.js +2 -1
  18. package/dist/es/jats/exporter/jats-exporter.js +8 -10
  19. package/dist/es/jats/importer/jats-dom-parser.js +948 -967
  20. package/dist/es/jats/importer/jats-transformations.js +14 -9
  21. package/dist/es/jats/importer/parse-jats-article.js +6 -8
  22. package/dist/es/lib/{section-categories.js → section-group-type.js} +13 -2
  23. package/dist/es/lib/table-cell-styles.js +47 -0
  24. package/dist/es/schema/index.js +0 -6
  25. package/dist/es/schema/migration/migration-scripts/3.0.12.js +14 -0
  26. package/dist/es/schema/migration/migration-scripts/index.js +2 -2
  27. package/dist/es/transformer/index.js +1 -0
  28. package/dist/es/transformer/node-names.js +0 -1
  29. package/dist/es/transformer/node-title.js +0 -1
  30. package/dist/es/transformer/node-types.js +0 -2
  31. package/dist/es/transformer/section-category.js +249 -0
  32. package/dist/es/version.js +1 -1
  33. package/dist/types/index.d.ts +2 -1
  34. package/dist/types/jats/importer/jats-dom-parser.d.ts +9 -24
  35. package/dist/types/jats/importer/jats-transformations.d.ts +1 -2
  36. package/dist/types/jats/importer/parse-jats-article.d.ts +2 -2
  37. package/dist/types/{schema/nodes/toc_element.d.ts → lib/section-group-type.d.ts} +9 -12
  38. package/dist/types/lib/table-cell-styles.d.ts +27 -0
  39. package/dist/types/schema/index.d.ts +0 -2
  40. package/dist/types/schema/migration/migration-scripts/{3.0.14.d.ts → 3.0.12.d.ts} +1 -3
  41. package/dist/types/schema/migration/migration-scripts/index.d.ts +2 -2
  42. package/dist/types/schema/types.d.ts +2 -22
  43. package/dist/types/transformer/index.d.ts +1 -0
  44. package/dist/types/transformer/section-category.d.ts +31 -0
  45. package/dist/types/version.d.ts +1 -1
  46. package/package.json +1 -1
  47. package/dist/cjs/schema/migration/migration-scripts/3.0.14.js +0 -25
  48. package/dist/cjs/schema/nodes/toc_element.js +0 -51
  49. package/dist/cjs/schema/nodes/toc_section.js +0 -46
  50. package/dist/es/schema/migration/migration-scripts/3.0.14.js +0 -23
  51. package/dist/es/schema/nodes/toc_element.js +0 -48
  52. package/dist/es/schema/nodes/toc_section.js +0 -42
  53. package/dist/types/lib/section-categories.d.ts +0 -17
  54. 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="acknowledgements"]');
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
- 'coi-statement',
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="coi-statement"]');
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
  }