@manuscripts/transform 3.0.10-date-fix.0 → 3.0.10

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 (32) hide show
  1. package/dist/cjs/index.js +1 -0
  2. package/dist/cjs/jats/exporter/jats-exporter.js +8 -10
  3. package/dist/cjs/jats/importer/jats-dom-parser.js +0 -1
  4. package/dist/cjs/lib/footnotes.js +63 -0
  5. package/dist/cjs/lib/utils.js +4 -2
  6. package/dist/cjs/schema/nodes/general_table_footnote.js +3 -1
  7. package/dist/cjs/schema/nodes/inline_footnote.js +5 -5
  8. package/dist/cjs/schema/nodes/table_element.js +3 -1
  9. package/dist/cjs/schema/nodes/table_element_footer.js +3 -1
  10. package/dist/cjs/transformer/id.js +6 -4
  11. package/dist/cjs/version.js +1 -1
  12. package/dist/es/index.js +1 -0
  13. package/dist/es/jats/exporter/jats-exporter.js +8 -10
  14. package/dist/es/jats/importer/jats-dom-parser.js +0 -1
  15. package/dist/es/lib/footnotes.js +56 -0
  16. package/dist/es/lib/utils.js +2 -1
  17. package/dist/es/schema/nodes/general_table_footnote.js +1 -0
  18. package/dist/es/schema/nodes/inline_footnote.js +5 -5
  19. package/dist/es/schema/nodes/table_element.js +1 -0
  20. package/dist/es/schema/nodes/table_element_footer.js +1 -0
  21. package/dist/es/transformer/id.js +6 -4
  22. package/dist/es/version.js +1 -1
  23. package/dist/types/index.d.ts +1 -0
  24. package/dist/types/jats/exporter/jats-exporter.d.ts +1 -0
  25. package/dist/types/lib/footnotes.d.ts +5 -0
  26. package/dist/types/lib/utils.d.ts +1 -0
  27. package/dist/types/schema/nodes/general_table_footnote.d.ts +2 -1
  28. package/dist/types/schema/nodes/inline_footnote.d.ts +1 -1
  29. package/dist/types/schema/nodes/table_element.d.ts +1 -0
  30. package/dist/types/schema/nodes/table_element_footer.d.ts +1 -0
  31. package/dist/types/version.d.ts +1 -1
  32. package/package.json +1 -1
package/dist/cjs/index.js CHANGED
@@ -22,6 +22,7 @@ __exportStar(require("./jats"), exports);
22
22
  __exportStar(require("./jats/types"), exports);
23
23
  __exportStar(require("./lib/section-group-type"), exports);
24
24
  __exportStar(require("./lib/table-cell-styles"), exports);
25
+ __exportStar(require("./lib/footnotes"), exports);
25
26
  __exportStar(require("./lib/utils"), exports);
26
27
  __exportStar(require("./schema"), exports);
27
28
  var migrate_1 = require("./schema/migration/migrate");
@@ -25,6 +25,7 @@ const debug_1 = __importDefault(require("debug"));
25
25
  const prosemirror_model_1 = require("prosemirror-model");
26
26
  const prosemirror_utils_1 = require("prosemirror-utils");
27
27
  const w3c_xmlserializer_1 = __importDefault(require("w3c-xmlserializer"));
28
+ const footnotes_1 = require("../../lib/footnotes");
28
29
  const html_1 = require("../../lib/html");
29
30
  const schema_1 = require("../../schema");
30
31
  const transformer_1 = require("../../transformer");
@@ -139,6 +140,7 @@ class JATSExporter {
139
140
  article.appendChild(front);
140
141
  article.setAttribute('article-type', manuscriptNode.attrs.articleType || 'other');
141
142
  this.labelTargets = (0, labels_1.buildTargets)(manuscriptNode);
143
+ this.footnoteLabels = (0, footnotes_1.generateFootnoteLabels)(manuscriptNode);
142
144
  const body = this.buildBody();
143
145
  article.appendChild(body);
144
146
  const back = this.buildBack(body);
@@ -349,8 +351,8 @@ class JATSExporter {
349
351
  const date = new Date(timestamp * 1000);
350
352
  const lookup = {
351
353
  year: date.getUTCFullYear().toString(),
352
- month: (date.getMonth() + 1).toString().padStart(2, '0'),
353
- day: date.getUTCDate().toString().padStart(2, '0'),
354
+ month: date.getUTCMonth().toString(),
355
+ day: date.getUTCDate().toString(),
354
356
  };
355
357
  for (const [key, value] of Object.entries(lookup).reverse()) {
356
358
  const el = this.document.createElement(key);
@@ -701,17 +703,13 @@ class JATSExporter {
701
703
  hard_break: () => '',
702
704
  highlight_marker: () => '',
703
705
  inline_footnote: (node) => {
704
- const rids = node.attrs.rids.filter((rid) => {
705
- var _a;
706
- return (_a = (0, prosemirror_utils_1.findChildrenByAttr)(this.manuscriptNode, (attrs) => attrs.id === rid)[0]) === null || _a === void 0 ? void 0 : _a.node;
707
- });
708
- if (rids.length == 0) {
709
- return '';
710
- }
706
+ const rids = node.attrs.rids;
711
707
  const xref = this.document.createElement('xref');
712
708
  xref.setAttribute('ref-type', 'fn');
713
709
  xref.setAttribute('rid', normalizeID(rids.join(' ')));
714
- xref.textContent = node.attrs.contents;
710
+ xref.textContent = rids
711
+ .map((rid) => this.footnoteLabels.get(rid))
712
+ .join(', ');
715
713
  return xref;
716
714
  },
717
715
  keyword: () => '',
@@ -971,7 +971,6 @@ const nodes = [
971
971
  const element = node;
972
972
  return {
973
973
  rids: ((_a = element.getAttribute('rid')) === null || _a === void 0 ? void 0 : _a.split(/\s+/)) || [],
974
- contents: (0, utils_1.getTrimmedTextContent)(element),
975
974
  };
976
975
  },
977
976
  },
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateAlphaFootnoteLabel = exports.generateNumericFootnoteLabel = exports.footnoteLabelGenerator = exports.generateFootnoteLabels = void 0;
4
+ const schema_1 = require("../schema");
5
+ const generateFootnoteLabels = (doc) => {
6
+ const labels = new Map();
7
+ doc.descendants((node, pos, parent) => {
8
+ if ((0, schema_1.isFootnotesElementNode)(node) && parent) {
9
+ const generator = (0, exports.footnoteLabelGenerator)(parent);
10
+ for (let i = 0; i < node.childCount; i++) {
11
+ const footnote = node.child(i);
12
+ const label = generator(i);
13
+ labels.set(footnote.attrs.id, label);
14
+ }
15
+ return false;
16
+ }
17
+ });
18
+ return labels;
19
+ };
20
+ exports.generateFootnoteLabels = generateFootnoteLabels;
21
+ const footnoteLabelGenerator = (parent) => {
22
+ if ((0, schema_1.isTableElementFooter)(parent)) {
23
+ return exports.generateNumericFootnoteLabel;
24
+ }
25
+ else {
26
+ return exports.generateAlphaFootnoteLabel;
27
+ }
28
+ };
29
+ exports.footnoteLabelGenerator = footnoteLabelGenerator;
30
+ const generateNumericFootnoteLabel = (index) => String(index + 1);
31
+ exports.generateNumericFootnoteLabel = generateNumericFootnoteLabel;
32
+ const generateAlphaFootnoteLabel = (index) => {
33
+ const unicodeInterval = [97, 123];
34
+ const places = unicodeInterval[1] - unicodeInterval[0];
35
+ function getClassCount(n, order) {
36
+ return n * Math.pow(places, order - 1);
37
+ }
38
+ let indices = null;
39
+ for (;;) {
40
+ let current = index;
41
+ let position = 1;
42
+ while (current >= places) {
43
+ current = current / places;
44
+ position++;
45
+ }
46
+ const newIndex = Math.floor(current);
47
+ indices = indices ? indices : new Array(position).fill(0);
48
+ indices.splice(indices.length - position, 1, newIndex);
49
+ index -= getClassCount(newIndex, position);
50
+ if (position === 1) {
51
+ break;
52
+ }
53
+ }
54
+ return (indices || [])
55
+ .map((v, i, array) => {
56
+ if (array.length > 1 && i !== array.length - 1) {
57
+ return String.fromCodePoint(v + unicodeInterval[0] - 1);
58
+ }
59
+ return String.fromCodePoint(v + unicodeInterval[0]);
60
+ })
61
+ .join('');
62
+ };
63
+ exports.generateAlphaFootnoteLabel = generateAlphaFootnoteLabel;
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.dateToTimestamp = exports.getTrimmedTextContent = exports.findParentNodeClosestToPos = exports.isInBibliographySection = exports.isInGraphicalAbstractSection = exports.findNodePositions = exports.iterateChildren = void 0;
18
+ exports.dateToTimestamp = exports.timestamp = 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) {
@@ -85,6 +85,8 @@ const getTrimmedTextContent = (node, selector) => {
85
85
  : (_c = node.textContent) === null || _c === void 0 ? void 0 : _c.trim();
86
86
  };
87
87
  exports.getTrimmedTextContent = getTrimmedTextContent;
88
+ const timestamp = () => Math.floor(Date.now() / 1000);
89
+ exports.timestamp = timestamp;
88
90
  const dateToTimestamp = (dateElement) => {
89
91
  const selectors = ['year', 'month', 'day'];
90
92
  const values = [];
@@ -95,6 +97,6 @@ const dateToTimestamp = (dateElement) => {
95
97
  }
96
98
  values.push(+value);
97
99
  }
98
- return Date.UTC(values[0], values[1] - 1, values[2]) / 1000;
100
+ return Date.UTC(values[0], values[1], values[2]) / 1000;
99
101
  };
100
102
  exports.dateToTimestamp = dateToTimestamp;
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.generalTableFootnote = void 0;
18
+ exports.isGeneralTableFootnoteNode = exports.generalTableFootnote = void 0;
19
19
  exports.generalTableFootnote = {
20
20
  content: 'paragraph*',
21
21
  attrs: {
@@ -25,3 +25,5 @@ exports.generalTableFootnote = {
25
25
  group: 'block',
26
26
  toDOM: () => ['div', { class: 'general-table-footnote' }, 0],
27
27
  };
28
+ const isGeneralTableFootnoteNode = (node) => node.type === node.type.schema.nodes.general_table_footnote;
29
+ exports.isGeneralTableFootnoteNode = isGeneralTableFootnoteNode;
@@ -18,8 +18,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.isInlineFootnoteNode = exports.inlineFootnote = void 0;
19
19
  exports.inlineFootnote = {
20
20
  attrs: {
21
+ id: { default: '' },
21
22
  rids: { default: [] },
22
- contents: { default: '' },
23
23
  dataTracked: { default: null },
24
24
  },
25
25
  atom: true,
@@ -28,13 +28,13 @@ exports.inlineFootnote = {
28
28
  group: 'inline',
29
29
  parseDOM: [
30
30
  {
31
- tag: 'span.footnote',
31
+ tag: 'span.footnote-marker',
32
32
  getAttrs: (p) => {
33
33
  var _a;
34
34
  const dom = p;
35
35
  return {
36
+ id: dom.id,
36
37
  rids: ((_a = dom.getAttribute('data-reference-id')) === null || _a === void 0 ? void 0 : _a.split(/\s+/)) || [],
37
- contents: dom.textContent,
38
38
  };
39
39
  },
40
40
  },
@@ -42,9 +42,9 @@ exports.inlineFootnote = {
42
42
  toDOM: (node) => {
43
43
  const footnoteNode = node;
44
44
  const dom = document.createElement('span');
45
- dom.className = 'footnote';
45
+ dom.id = footnoteNode.attrs.id;
46
+ dom.className = 'footnote-marker';
46
47
  dom.setAttribute('data-reference-id', footnoteNode.attrs.rids.join(' '));
47
- dom.textContent = footnoteNode.attrs.contents;
48
48
  return dom;
49
49
  },
50
50
  };
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.tableElement = void 0;
18
+ exports.isTableElementNode = exports.tableElement = void 0;
19
19
  exports.tableElement = {
20
20
  content: ' figcaption? (table | placeholder) table_colgroup? table_element_footer? (listing | placeholder)',
21
21
  attrs: {
@@ -48,3 +48,5 @@ exports.tableElement = {
48
48
  ];
49
49
  },
50
50
  };
51
+ const isTableElementNode = (node) => node.type === node.type.schema.nodes.table_element;
52
+ exports.isTableElementNode = isTableElementNode;
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.tableElementFooter = void 0;
18
+ exports.isTableElementFooter = exports.tableElementFooter = void 0;
19
19
  exports.tableElementFooter = {
20
20
  attrs: {
21
21
  id: { default: '' },
@@ -25,3 +25,5 @@ exports.tableElementFooter = {
25
25
  group: 'block element',
26
26
  toDOM: () => ['table-wrap-foot', 0],
27
27
  };
28
+ const isTableElementFooter = (node) => node.type === node.type.schema.nodes.table_element_footer;
29
+ exports.isTableElementFooter = isTableElementFooter;
@@ -22,10 +22,12 @@ const generateNodeID = (type) => {
22
22
  const uniqueID = ':' + (0, uuid_1.v4)().toUpperCase();
23
23
  let name = node_types_1.nodeTypesMap.get(type);
24
24
  if (name === undefined) {
25
- name = type.name
26
- .split('_')
27
- .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
28
- .join('');
25
+ name =
26
+ 'MP' +
27
+ type.name
28
+ .split('_')
29
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
30
+ .join('');
29
31
  }
30
32
  return name + uniqueID;
31
33
  };
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "3.0.10-date-fix.0";
4
+ exports.VERSION = "3.0.10";
package/dist/es/index.js CHANGED
@@ -4,6 +4,7 @@ export * from './jats';
4
4
  export * from './jats/types';
5
5
  export * from './lib/section-group-type';
6
6
  export * from './lib/table-cell-styles';
7
+ export * from './lib/footnotes';
7
8
  export * from './lib/utils';
8
9
  export * from './schema';
9
10
  export { migrateFor } from './schema/migration/migrate';
@@ -19,6 +19,7 @@ import debug from 'debug';
19
19
  import { DOMParser as ProsemirrorDOMParser, DOMSerializer, } from 'prosemirror-model';
20
20
  import { findChildrenByAttr, findChildrenByType } from 'prosemirror-utils';
21
21
  import serializeToXML from 'w3c-xmlserializer';
22
+ import { generateFootnoteLabels } from '../../lib/footnotes';
22
23
  import { nodeFromHTML, textFromHTML } from '../../lib/html';
23
24
  import { isCitationNode, schema, } from '../../schema';
24
25
  import { chooseJatsFnType, chooseSecType, isExecutableNodeType, isNodeType, } from '../../transformer';
@@ -131,6 +132,7 @@ export class JATSExporter {
131
132
  article.appendChild(front);
132
133
  article.setAttribute('article-type', manuscriptNode.attrs.articleType || 'other');
133
134
  this.labelTargets = buildTargets(manuscriptNode);
135
+ this.footnoteLabels = generateFootnoteLabels(manuscriptNode);
134
136
  const body = this.buildBody();
135
137
  article.appendChild(body);
136
138
  const back = this.buildBack(body);
@@ -341,8 +343,8 @@ export class JATSExporter {
341
343
  const date = new Date(timestamp * 1000);
342
344
  const lookup = {
343
345
  year: date.getUTCFullYear().toString(),
344
- month: (date.getMonth() + 1).toString().padStart(2, '0'),
345
- day: date.getUTCDate().toString().padStart(2, '0'),
346
+ month: date.getUTCMonth().toString(),
347
+ day: date.getUTCDate().toString(),
346
348
  };
347
349
  for (const [key, value] of Object.entries(lookup).reverse()) {
348
350
  const el = this.document.createElement(key);
@@ -693,17 +695,13 @@ export class JATSExporter {
693
695
  hard_break: () => '',
694
696
  highlight_marker: () => '',
695
697
  inline_footnote: (node) => {
696
- const rids = node.attrs.rids.filter((rid) => {
697
- var _a;
698
- return (_a = findChildrenByAttr(this.manuscriptNode, (attrs) => attrs.id === rid)[0]) === null || _a === void 0 ? void 0 : _a.node;
699
- });
700
- if (rids.length == 0) {
701
- return '';
702
- }
698
+ const rids = node.attrs.rids;
703
699
  const xref = this.document.createElement('xref');
704
700
  xref.setAttribute('ref-type', 'fn');
705
701
  xref.setAttribute('rid', normalizeID(rids.join(' ')));
706
- xref.textContent = node.attrs.contents;
702
+ xref.textContent = rids
703
+ .map((rid) => this.footnoteLabels.get(rid))
704
+ .join(', ');
707
705
  return xref;
708
706
  },
709
707
  keyword: () => '',
@@ -965,7 +965,6 @@ const nodes = [
965
965
  const element = node;
966
966
  return {
967
967
  rids: ((_a = element.getAttribute('rid')) === null || _a === void 0 ? void 0 : _a.split(/\s+/)) || [],
968
- contents: getTrimmedTextContent(element),
969
968
  };
970
969
  },
971
970
  },
@@ -0,0 +1,56 @@
1
+ import { isFootnotesElementNode, isTableElementFooter, } from '../schema';
2
+ export const generateFootnoteLabels = (doc) => {
3
+ const labels = new Map();
4
+ doc.descendants((node, pos, parent) => {
5
+ if (isFootnotesElementNode(node) && parent) {
6
+ const generator = footnoteLabelGenerator(parent);
7
+ for (let i = 0; i < node.childCount; i++) {
8
+ const footnote = node.child(i);
9
+ const label = generator(i);
10
+ labels.set(footnote.attrs.id, label);
11
+ }
12
+ return false;
13
+ }
14
+ });
15
+ return labels;
16
+ };
17
+ export const footnoteLabelGenerator = (parent) => {
18
+ if (isTableElementFooter(parent)) {
19
+ return generateNumericFootnoteLabel;
20
+ }
21
+ else {
22
+ return generateAlphaFootnoteLabel;
23
+ }
24
+ };
25
+ export const generateNumericFootnoteLabel = (index) => String(index + 1);
26
+ export const generateAlphaFootnoteLabel = (index) => {
27
+ const unicodeInterval = [97, 123];
28
+ const places = unicodeInterval[1] - unicodeInterval[0];
29
+ function getClassCount(n, order) {
30
+ return n * Math.pow(places, order - 1);
31
+ }
32
+ let indices = null;
33
+ for (;;) {
34
+ let current = index;
35
+ let position = 1;
36
+ while (current >= places) {
37
+ current = current / places;
38
+ position++;
39
+ }
40
+ const newIndex = Math.floor(current);
41
+ indices = indices ? indices : new Array(position).fill(0);
42
+ indices.splice(indices.length - position, 1, newIndex);
43
+ index -= getClassCount(newIndex, position);
44
+ if (position === 1) {
45
+ break;
46
+ }
47
+ }
48
+ return (indices || [])
49
+ .map((v, i, array) => {
50
+ if (array.length > 1 && i !== array.length - 1) {
51
+ return String.fromCodePoint(v + unicodeInterval[0] - 1);
52
+ }
53
+ return String.fromCodePoint(v + unicodeInterval[0]);
54
+ })
55
+ .join('');
56
+ };
@@ -76,6 +76,7 @@ export const getTrimmedTextContent = (node, selector) => {
76
76
  ? (_b = (_a = node.querySelector(selector)) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim()
77
77
  : (_c = node.textContent) === null || _c === void 0 ? void 0 : _c.trim();
78
78
  };
79
+ export const timestamp = () => Math.floor(Date.now() / 1000);
79
80
  export const dateToTimestamp = (dateElement) => {
80
81
  const selectors = ['year', 'month', 'day'];
81
82
  const values = [];
@@ -86,5 +87,5 @@ export const dateToTimestamp = (dateElement) => {
86
87
  }
87
88
  values.push(+value);
88
89
  }
89
- return Date.UTC(values[0], values[1] - 1, values[2]) / 1000;
90
+ return Date.UTC(values[0], values[1], values[2]) / 1000;
90
91
  };
@@ -22,3 +22,4 @@ export const generalTableFootnote = {
22
22
  group: 'block',
23
23
  toDOM: () => ['div', { class: 'general-table-footnote' }, 0],
24
24
  };
25
+ export const isGeneralTableFootnoteNode = (node) => node.type === node.type.schema.nodes.general_table_footnote;
@@ -15,8 +15,8 @@
15
15
  */
16
16
  export const inlineFootnote = {
17
17
  attrs: {
18
+ id: { default: '' },
18
19
  rids: { default: [] },
19
- contents: { default: '' },
20
20
  dataTracked: { default: null },
21
21
  },
22
22
  atom: true,
@@ -25,13 +25,13 @@ export const inlineFootnote = {
25
25
  group: 'inline',
26
26
  parseDOM: [
27
27
  {
28
- tag: 'span.footnote',
28
+ tag: 'span.footnote-marker',
29
29
  getAttrs: (p) => {
30
30
  var _a;
31
31
  const dom = p;
32
32
  return {
33
+ id: dom.id,
33
34
  rids: ((_a = dom.getAttribute('data-reference-id')) === null || _a === void 0 ? void 0 : _a.split(/\s+/)) || [],
34
- contents: dom.textContent,
35
35
  };
36
36
  },
37
37
  },
@@ -39,9 +39,9 @@ export const inlineFootnote = {
39
39
  toDOM: (node) => {
40
40
  const footnoteNode = node;
41
41
  const dom = document.createElement('span');
42
- dom.className = 'footnote';
42
+ dom.id = footnoteNode.attrs.id;
43
+ dom.className = 'footnote-marker';
43
44
  dom.setAttribute('data-reference-id', footnoteNode.attrs.rids.join(' '));
44
- dom.textContent = footnoteNode.attrs.contents;
45
45
  return dom;
46
46
  },
47
47
  };
@@ -45,3 +45,4 @@ export const tableElement = {
45
45
  ];
46
46
  },
47
47
  };
48
+ export const isTableElementNode = (node) => node.type === node.type.schema.nodes.table_element;
@@ -22,3 +22,4 @@ export const tableElementFooter = {
22
22
  group: 'block element',
23
23
  toDOM: () => ['table-wrap-foot', 0],
24
24
  };
25
+ export const isTableElementFooter = (node) => node.type === node.type.schema.nodes.table_element_footer;
@@ -19,10 +19,12 @@ export const generateNodeID = (type) => {
19
19
  const uniqueID = ':' + uuid().toUpperCase();
20
20
  let name = nodeTypesMap.get(type);
21
21
  if (name === undefined) {
22
- name = type.name
23
- .split('_')
24
- .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
25
- .join('');
22
+ name =
23
+ 'MP' +
24
+ type.name
25
+ .split('_')
26
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
27
+ .join('');
26
28
  }
27
29
  return name + uniqueID;
28
30
  };
@@ -1 +1 @@
1
- export const VERSION = "3.0.10-date-fix.0";
1
+ export const VERSION = "3.0.10";
@@ -4,6 +4,7 @@ export * from './jats';
4
4
  export * from './jats/types';
5
5
  export * from './lib/section-group-type';
6
6
  export * from './lib/table-cell-styles';
7
+ export * from './lib/footnotes';
7
8
  export * from './lib/utils';
8
9
  export * from './schema';
9
10
  export { JSONNode, migrateFor } from './schema/migration/migrate';
@@ -45,6 +45,7 @@ export declare class JATSExporter {
45
45
  protected document: Document;
46
46
  protected serializer: DOMSerializer;
47
47
  protected labelTargets: Map<string, Target>;
48
+ protected footnoteLabels: Map<string, string>;
48
49
  protected citationTexts: Map<string, string>;
49
50
  protected citationProvider: CitationProvider;
50
51
  protected manuscriptNode: ManuscriptNode;
@@ -0,0 +1,5 @@
1
+ import { ManuscriptNode } from '../schema';
2
+ export declare const generateFootnoteLabels: (doc: ManuscriptNode) => Map<any, any>;
3
+ export declare const footnoteLabelGenerator: (parent: ManuscriptNode) => (index: number) => string;
4
+ export declare const generateNumericFootnoteLabel: (index: number) => string;
5
+ export declare const generateAlphaFootnoteLabel: (index: number) => string;
@@ -26,4 +26,5 @@ export declare const findParentNodeClosestToPos: ($pos: ResolvedPos, predicate:
26
26
  node: ProsemirrorNode;
27
27
  } | undefined;
28
28
  export declare const getTrimmedTextContent: (node: Element | Document | null, selector?: string) => string | undefined;
29
+ export declare const timestamp: () => number;
29
30
  export declare const dateToTimestamp: (dateElement: Element) => number | undefined;
@@ -18,8 +18,9 @@ import { ManuscriptNode } from '../types';
18
18
  interface Attrs {
19
19
  id: string;
20
20
  }
21
- export interface GeneralTableFootnote extends ManuscriptNode {
21
+ export interface GeneralTableFootnoteNode extends ManuscriptNode {
22
22
  attrs: Attrs;
23
23
  }
24
24
  export declare const generalTableFootnote: NodeSpec;
25
+ export declare const isGeneralTableFootnoteNode: (node: ManuscriptNode) => node is GeneralTableFootnoteNode;
25
26
  export {};
@@ -16,8 +16,8 @@
16
16
  import { NodeSpec } from 'prosemirror-model';
17
17
  import { ManuscriptNode } from '../types';
18
18
  interface Attrs {
19
+ id: string;
19
20
  rids: string[];
20
- contents: string;
21
21
  }
22
22
  export interface InlineFootnoteNode extends ManuscriptNode {
23
23
  attrs: Attrs;
@@ -22,4 +22,5 @@ export interface TableElementNode extends ManuscriptNode {
22
22
  attrs: Attrs;
23
23
  }
24
24
  export declare const tableElement: NodeSpec;
25
+ export declare const isTableElementNode: (node: ManuscriptNode) => node is TableElementNode;
25
26
  export {};
@@ -22,4 +22,5 @@ export interface TableElementFooterNode extends ManuscriptNode {
22
22
  attrs: Attrs;
23
23
  }
24
24
  export declare const tableElementFooter: NodeSpec;
25
+ export declare const isTableElementFooter: (node: ManuscriptNode) => node is TableElementFooterNode;
25
26
  export {};
@@ -1 +1 @@
1
- export declare const VERSION = "3.0.10-date-fix.0";
1
+ export declare const VERSION = "3.0.10";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/transform",
3
3
  "description": "ProseMirror transformer for Manuscripts applications",
4
- "version": "3.0.10-date-fix.0",
4
+ "version": "3.0.10",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",