@manuscripts/transform 2.0.4-LEAN-3092 → 2.0.4-LEAN-3083
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 -0
- package/dist/cjs/jats/importer/jats-body-dom-parser.js +72 -24
- package/dist/cjs/jats/jats-exporter.js +37 -17
- package/dist/cjs/mathjax/index.js +41 -0
- package/dist/cjs/mathjax/mathjax-packages.js +20 -0
- package/dist/cjs/mathjax/mathml-to-svg.js +70 -0
- package/dist/cjs/mathjax/tex-to-mathml.js +49 -0
- package/dist/cjs/mathjax/tex-to-svg.js +59 -0
- package/dist/cjs/schema/index.js +1 -0
- package/dist/cjs/schema/nodes/affiliation.js +2 -0
- package/dist/cjs/schema/nodes/contributor.js +2 -0
- package/dist/cjs/schema/nodes/equation.js +14 -12
- package/dist/cjs/schema/nodes/equation_element.js +5 -4
- package/dist/cjs/schema/nodes/inline_equation.js +16 -12
- package/dist/cjs/transformer/builders.js +8 -1
- package/dist/cjs/transformer/decode.js +11 -4
- package/dist/cjs/transformer/encode.js +28 -4
- package/dist/cjs/transformer/node-types.js +1 -0
- package/dist/cjs/transformer/object-types.js +1 -0
- package/dist/es/index.js +1 -0
- package/dist/es/jats/importer/jats-body-dom-parser.js +73 -25
- package/dist/es/jats/jats-exporter.js +37 -17
- package/dist/es/mathjax/index.js +12 -0
- package/dist/es/mathjax/mathjax-packages.js +17 -0
- package/dist/es/mathjax/mathml-to-svg.js +66 -0
- package/dist/es/mathjax/tex-to-mathml.js +45 -0
- package/dist/es/mathjax/tex-to-svg.js +55 -0
- package/dist/es/schema/index.js +1 -0
- package/dist/es/schema/nodes/affiliation.js +2 -0
- package/dist/es/schema/nodes/contributor.js +2 -0
- package/dist/es/schema/nodes/equation.js +14 -12
- package/dist/es/schema/nodes/equation_element.js +5 -4
- package/dist/es/schema/nodes/inline_equation.js +16 -12
- package/dist/es/transformer/builders.js +6 -0
- package/dist/es/transformer/decode.js +11 -4
- package/dist/es/transformer/encode.js +28 -4
- package/dist/es/transformer/node-types.js +1 -0
- package/dist/es/transformer/object-types.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/mathjax/index.d.ts +3 -0
- package/dist/types/mathjax/mathjax-packages.d.ts +16 -0
- package/dist/types/mathjax/mathml-to-svg.d.ts +17 -0
- package/dist/types/mathjax/tex-to-mathml.d.ts +17 -0
- package/dist/types/mathjax/tex-to-svg.d.ts +17 -0
- package/dist/types/schema/index.d.ts +1 -0
- package/dist/types/schema/nodes/affiliation.d.ts +2 -0
- package/dist/types/schema/nodes/contributor.d.ts +4 -2
- package/dist/types/schema/nodes/equation.d.ts +4 -3
- package/dist/types/schema/nodes/equation_element.d.ts +2 -1
- package/dist/types/schema/nodes/inline_equation.d.ts +4 -4
- package/dist/types/transformer/builders.d.ts +2 -1
- package/package.json +5 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ©
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -17,8 +17,9 @@ import { ObjectTypes } from '@manuscripts/json-schema';
|
|
|
17
17
|
export const equation = {
|
|
18
18
|
attrs: {
|
|
19
19
|
id: { default: '' },
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
MathMLStringRepresentation: { default: '' },
|
|
21
|
+
SVGStringRepresentation: { default: '' },
|
|
22
|
+
TeXRepresentation: { default: '' },
|
|
22
23
|
dataTracked: { default: null },
|
|
23
24
|
},
|
|
24
25
|
group: 'block',
|
|
@@ -26,25 +27,26 @@ export const equation = {
|
|
|
26
27
|
{
|
|
27
28
|
tag: `div.${ObjectTypes.Equation}`,
|
|
28
29
|
getAttrs: (p) => {
|
|
29
|
-
const
|
|
30
|
+
const dom = p;
|
|
30
31
|
return {
|
|
31
|
-
id:
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
id: dom.getAttribute('id'),
|
|
33
|
+
MathMLStringRepresentation: dom.getAttribute('data-mathml-string-representation'),
|
|
34
|
+
SVGStringRepresentation: dom.innerHTML,
|
|
35
|
+
TeXRepresentation: dom.getAttribute('data-tex-representation'),
|
|
34
36
|
};
|
|
35
37
|
},
|
|
36
38
|
},
|
|
37
39
|
],
|
|
38
40
|
toDOM: (node) => {
|
|
39
41
|
const equationNode = node;
|
|
40
|
-
const { id, contents, format } = equationNode.attrs;
|
|
41
42
|
const dom = document.createElement('div');
|
|
43
|
+
dom.setAttribute('id', equationNode.attrs.id);
|
|
42
44
|
dom.classList.add(ObjectTypes.Equation);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
dom.setAttribute('data-equation-format', format);
|
|
45
|
+
if (equationNode.attrs.MathMLStringRepresentation) {
|
|
46
|
+
dom.setAttribute('data-mathml-string-representation', equationNode.attrs.MathMLStringRepresentation);
|
|
46
47
|
}
|
|
47
|
-
dom.
|
|
48
|
+
dom.setAttribute('data-tex-representation', equationNode.attrs.TeXRepresentation);
|
|
49
|
+
dom.innerHTML = equationNode.attrs.SVGStringRepresentation;
|
|
48
50
|
return dom;
|
|
49
51
|
},
|
|
50
52
|
};
|
|
@@ -14,10 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export const equationElement = {
|
|
17
|
-
content: '(equation | placeholder)',
|
|
17
|
+
content: '(equation | placeholder) figcaption',
|
|
18
18
|
attrs: {
|
|
19
19
|
id: { default: '' },
|
|
20
|
-
|
|
20
|
+
suppressCaption: { default: true },
|
|
21
|
+
suppressTitle: { default: undefined },
|
|
21
22
|
dataTracked: { default: null },
|
|
22
23
|
comments: { default: null },
|
|
23
24
|
},
|
|
@@ -25,7 +26,7 @@ export const equationElement = {
|
|
|
25
26
|
group: 'block element',
|
|
26
27
|
parseDOM: [
|
|
27
28
|
{
|
|
28
|
-
tag: '
|
|
29
|
+
tag: 'figure.equation',
|
|
29
30
|
getAttrs: (p) => {
|
|
30
31
|
const dom = p;
|
|
31
32
|
return {
|
|
@@ -37,7 +38,7 @@ export const equationElement = {
|
|
|
37
38
|
toDOM: (node) => {
|
|
38
39
|
const equationElementNode = node;
|
|
39
40
|
return [
|
|
40
|
-
'
|
|
41
|
+
'figure',
|
|
41
42
|
{
|
|
42
43
|
class: 'equation',
|
|
43
44
|
id: equationElementNode.attrs.id,
|
|
@@ -13,39 +13,43 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
16
17
|
export const inlineEquation = {
|
|
17
18
|
attrs: {
|
|
19
|
+
id: { default: '' },
|
|
20
|
+
MathMLRepresentation: { default: '' },
|
|
21
|
+
SVGRepresentation: { default: '' },
|
|
22
|
+
TeXRepresentation: { default: '' },
|
|
18
23
|
dataTracked: { default: null },
|
|
19
|
-
comments: { default: null },
|
|
20
|
-
contents: { default: '' },
|
|
21
|
-
format: { default: '' },
|
|
22
24
|
},
|
|
23
|
-
selectable: false,
|
|
24
25
|
atom: true,
|
|
25
26
|
inline: true,
|
|
26
27
|
draggable: true,
|
|
27
28
|
group: 'inline',
|
|
28
29
|
parseDOM: [
|
|
29
30
|
{
|
|
30
|
-
tag: `span.
|
|
31
|
+
tag: `span.${ObjectTypes.InlineMathFragment}`,
|
|
31
32
|
getAttrs: (p) => {
|
|
32
33
|
const dom = p;
|
|
33
34
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
id: dom.getAttribute('id'),
|
|
36
|
+
MathMLRepresentation: dom.getAttribute('data-mathml-representation') || '',
|
|
37
|
+
SVGRepresentation: dom.innerHTML || '',
|
|
38
|
+
TeXRepresentation: dom.getAttribute('data-tex-representation') || '',
|
|
36
39
|
};
|
|
37
40
|
},
|
|
38
41
|
},
|
|
39
42
|
],
|
|
40
43
|
toDOM: (node) => {
|
|
41
44
|
const inlineEquationNode = node;
|
|
42
|
-
const { contents, format } = inlineEquationNode.attrs;
|
|
43
45
|
const dom = document.createElement('span');
|
|
44
|
-
dom.classList.add(
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
dom.classList.add(ObjectTypes.InlineMathFragment);
|
|
47
|
+
dom.setAttribute('id', inlineEquationNode.attrs.id);
|
|
48
|
+
dom.setAttribute('data-tex-representation', inlineEquationNode.attrs.TeXRepresentation);
|
|
49
|
+
if (inlineEquationNode.attrs.MathMLRepresentation) {
|
|
50
|
+
dom.setAttribute('data-mathml-representation', inlineEquationNode.attrs.MathMLRepresentation);
|
|
47
51
|
}
|
|
48
|
-
dom.innerHTML =
|
|
52
|
+
dom.innerHTML = inlineEquationNode.attrs.SVGRepresentation;
|
|
49
53
|
return dom;
|
|
50
54
|
},
|
|
51
55
|
};
|
|
@@ -95,6 +95,12 @@ export const buildNote = (target, source, contents = '') => ({
|
|
|
95
95
|
source,
|
|
96
96
|
contents,
|
|
97
97
|
});
|
|
98
|
+
export const buildInlineMathFragment = (containingObject, TeXRepresentation) => ({
|
|
99
|
+
_id: generateID(ObjectTypes.InlineMathFragment),
|
|
100
|
+
objectType: ObjectTypes.InlineMathFragment,
|
|
101
|
+
containingObject: containingObject || undefined,
|
|
102
|
+
TeXRepresentation,
|
|
103
|
+
});
|
|
98
104
|
export const buildFootnote = (containingObject, contents, kind = 'footnote') => ({
|
|
99
105
|
_id: generateID(ObjectTypes.Footnote),
|
|
100
106
|
objectType: ObjectTypes.Footnote,
|
|
@@ -262,8 +262,9 @@ export class Decoder {
|
|
|
262
262
|
const model = data;
|
|
263
263
|
return schema.nodes.equation.createChecked({
|
|
264
264
|
id: model._id,
|
|
265
|
-
|
|
266
|
-
|
|
265
|
+
MathMLStringRepresentation: model.MathMLStringRepresentation,
|
|
266
|
+
SVGStringRepresentation: model.SVGStringRepresentation,
|
|
267
|
+
TeXRepresentation: model.TeXRepresentation,
|
|
267
268
|
});
|
|
268
269
|
},
|
|
269
270
|
[ObjectTypes.EquationElement]: (data) => {
|
|
@@ -282,10 +283,12 @@ export class Decoder {
|
|
|
282
283
|
else {
|
|
283
284
|
throw new MissingElement(model.containedObjectID);
|
|
284
285
|
}
|
|
286
|
+
const figcaption = this.getFigcaption(model);
|
|
285
287
|
return schema.nodes.equation_element.createChecked({
|
|
286
288
|
id: model._id,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
+
suppressCaption: Boolean(model.suppressCaption),
|
|
290
|
+
suppressTitle: Boolean(model.suppressTitle === undefined ? true : model.suppressTitle),
|
|
291
|
+
}, [equation, figcaption]);
|
|
289
292
|
},
|
|
290
293
|
[ObjectTypes.FootnotesElement]: (data) => {
|
|
291
294
|
const foonotesElementModel = data;
|
|
@@ -606,6 +609,8 @@ export class Decoder {
|
|
|
606
609
|
addressLine3: model.addressLine3,
|
|
607
610
|
postCode: model.postCode,
|
|
608
611
|
country: model.country,
|
|
612
|
+
county: model.county,
|
|
613
|
+
city: model.city,
|
|
609
614
|
email: model.email,
|
|
610
615
|
department: model.department,
|
|
611
616
|
priority: model.priority,
|
|
@@ -617,6 +622,8 @@ export class Decoder {
|
|
|
617
622
|
id: model._id,
|
|
618
623
|
role: model.role,
|
|
619
624
|
affiliations: model.affiliations,
|
|
625
|
+
email: model.email,
|
|
626
|
+
isJointContributor: model.isJointContributor,
|
|
620
627
|
bibliographicName: model.bibliographicName,
|
|
621
628
|
userID: model.userID,
|
|
622
629
|
invitationID: model.invitationID,
|
|
@@ -54,6 +54,12 @@ const listContents = (node) => {
|
|
|
54
54
|
}
|
|
55
55
|
return serializeToXML(output);
|
|
56
56
|
};
|
|
57
|
+
const svgDefs = (svg) => {
|
|
58
|
+
const template = document.createElement('template');
|
|
59
|
+
template.innerHTML = svg.trim();
|
|
60
|
+
const defs = template.content.querySelector('defs');
|
|
61
|
+
return defs ? serializeToXML(defs) : undefined;
|
|
62
|
+
};
|
|
57
63
|
const tableRowDisplayStyle = (tagName, parent) => {
|
|
58
64
|
switch (tagName) {
|
|
59
65
|
case 'thead':
|
|
@@ -339,12 +345,20 @@ const encoders = {
|
|
|
339
345
|
: false,
|
|
340
346
|
}),
|
|
341
347
|
equation: (node) => ({
|
|
342
|
-
|
|
343
|
-
|
|
348
|
+
MathMLStringRepresentation: node.attrs.MathMLStringRepresentation || undefined,
|
|
349
|
+
TeXRepresentation: node.attrs.TeXRepresentation,
|
|
350
|
+
SVGStringRepresentation: node.attrs.SVGStringRepresentation,
|
|
344
351
|
}),
|
|
345
352
|
equation_element: (node) => ({
|
|
346
353
|
containedObjectID: attributeOfNodeType(node, 'equation', 'id'),
|
|
347
|
-
|
|
354
|
+
caption: inlineContentOfChildNodeType(node, node.type.schema.nodes.figcaption, node.type.schema.nodes.caption),
|
|
355
|
+
title: inlineContentOfChildNodeType(node, node.type.schema.nodes.figcaption, node.type.schema.nodes.caption_title, false),
|
|
356
|
+
elementType: 'p',
|
|
357
|
+
suppressCaption: Boolean(node.attrs.suppressCaption) || undefined,
|
|
358
|
+
suppressTitle: node.attrs.suppressTitle === undefined ||
|
|
359
|
+
node.attrs.suppressTitle === true
|
|
360
|
+
? undefined
|
|
361
|
+
: false,
|
|
348
362
|
}),
|
|
349
363
|
figure: (node) => ({
|
|
350
364
|
contentType: node.attrs.contentType || undefined,
|
|
@@ -391,6 +405,12 @@ const encoders = {
|
|
|
391
405
|
.map((childNode) => childNode.attrs.id)
|
|
392
406
|
.filter((id) => id),
|
|
393
407
|
}),
|
|
408
|
+
inline_equation: (node, parent) => ({
|
|
409
|
+
containingObject: parent.attrs.id,
|
|
410
|
+
TeXRepresentation: node.attrs.TeXRepresentation,
|
|
411
|
+
SVGRepresentation: node.attrs.SVGRepresentation,
|
|
412
|
+
SVGGlyphs: svgDefs(node.attrs.SVGRepresentation),
|
|
413
|
+
}),
|
|
394
414
|
keyword: (node, parent) => ({
|
|
395
415
|
containedGroup: parent.attrs.id,
|
|
396
416
|
name: keywordContents(node),
|
|
@@ -482,6 +502,8 @@ const encoders = {
|
|
|
482
502
|
addressLine3: node.attrs.addressLine3,
|
|
483
503
|
postCode: node.attrs.postCode,
|
|
484
504
|
country: node.attrs.country,
|
|
505
|
+
county: node.attrs.county,
|
|
506
|
+
city: node.attrs.city,
|
|
485
507
|
email: node.attrs.email,
|
|
486
508
|
priority: node.attrs.priority,
|
|
487
509
|
}),
|
|
@@ -492,6 +514,7 @@ const encoders = {
|
|
|
492
514
|
userID: node.attrs.userID,
|
|
493
515
|
invitationID: node.attrs.invitationID,
|
|
494
516
|
isCorresponding: node.attrs.isCorresponding,
|
|
517
|
+
isJointContributor: node.attrs.isJointContributor,
|
|
495
518
|
ORCIDIdentifier: node.attrs.ORCIDIdentifier,
|
|
496
519
|
footnote: node.attrs.footnote,
|
|
497
520
|
corresp: node.attrs.corresp,
|
|
@@ -551,7 +574,8 @@ export const encode = (node) => {
|
|
|
551
574
|
if (placeholderTypes.includes(child.type)) {
|
|
552
575
|
return;
|
|
553
576
|
}
|
|
554
|
-
if (parent.type === schema.nodes.paragraph
|
|
577
|
+
if (parent.type === schema.nodes.paragraph &&
|
|
578
|
+
child.type !== schema.nodes.inline_equation) {
|
|
555
579
|
return;
|
|
556
580
|
}
|
|
557
581
|
const { model, markers } = modelFromNode(child, parent, path, priority);
|
|
@@ -36,6 +36,7 @@ export const nodeTypesMap = new Map([
|
|
|
36
36
|
[schema.nodes.footnotes_section, ObjectTypes.Section],
|
|
37
37
|
[schema.nodes.graphical_abstract_section, ObjectTypes.Section],
|
|
38
38
|
[schema.nodes.highlight_marker, ObjectTypes.HighlightMarker],
|
|
39
|
+
[schema.nodes.inline_equation, ObjectTypes.InlineMathFragment],
|
|
39
40
|
[schema.nodes.keyword, ObjectTypes.Keyword],
|
|
40
41
|
[schema.nodes.keywords_element, ObjectTypes.KeywordsElement],
|
|
41
42
|
[schema.nodes.keywords, ObjectTypes.Section],
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const convertMathMLToSVG: (mathml: string, display: boolean) => Promise<string | null>;
|
|
2
|
+
export declare const convertTeXToMathML: (tex: string, display: boolean) => Promise<string | null>;
|
|
3
|
+
export declare const convertTeXToSVG: (tex: string, display: boolean) => Promise<string | null>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const packages: string[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import 'mathjax-full/js/util/entities/all';
|
|
17
|
+
export declare const convertMathMLToSVG: (mathml: string, display: boolean) => string | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import 'mathjax-full/js/util/entities/all';
|
|
17
|
+
export declare const convertTeXToMathML: (tex: string, display: boolean) => string | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import 'mathjax-full/js/util/entities/all';
|
|
17
|
+
export declare const convertTeXToSVG: (tex: string, display: boolean) => string | null;
|
|
@@ -40,6 +40,7 @@ export * from './nodes/footnotes_section';
|
|
|
40
40
|
export * from './nodes/graphical_abstract_section';
|
|
41
41
|
export * from './nodes/hard_break';
|
|
42
42
|
export * from './nodes/highlight_marker';
|
|
43
|
+
export * from './nodes/inline_equation';
|
|
43
44
|
export * from './nodes/inline_footnote';
|
|
44
45
|
export * from './nodes/keyword';
|
|
45
46
|
export * from './nodes/keywords_element';
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BibliographicName } from '@manuscripts/json-schema';
|
|
2
2
|
import { NodeSpec } from 'prosemirror-model';
|
|
3
3
|
import { ManuscriptNode } from '../types';
|
|
4
4
|
interface Attrs {
|
|
5
5
|
id: string;
|
|
6
6
|
role: string;
|
|
7
|
-
affiliations:
|
|
7
|
+
affiliations: string[];
|
|
8
8
|
bibliographicName: BibliographicName;
|
|
9
9
|
userID: string;
|
|
10
|
+
email: string;
|
|
10
11
|
invitationID: string;
|
|
11
12
|
isCorresponding: boolean;
|
|
12
13
|
ORCIDIdentifier: string;
|
|
13
14
|
priority: number;
|
|
15
|
+
isJointContributor: boolean;
|
|
14
16
|
}
|
|
15
17
|
export interface ContributorNode extends ManuscriptNode {
|
|
16
18
|
attrs: Attrs;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ©
|
|
2
|
+
* © 2019 Atypon Systems LLC
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -17,8 +17,9 @@ import { NodeSpec } from 'prosemirror-model';
|
|
|
17
17
|
import { ManuscriptNode } from '../types';
|
|
18
18
|
interface Attrs {
|
|
19
19
|
id: string;
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
MathMLStringRepresentation: string;
|
|
21
|
+
SVGStringRepresentation: string;
|
|
22
|
+
TeXRepresentation: string;
|
|
22
23
|
}
|
|
23
24
|
export interface EquationNode extends ManuscriptNode {
|
|
24
25
|
attrs: Attrs;
|
|
@@ -18,7 +18,8 @@ import { ManuscriptNode } from '../types';
|
|
|
18
18
|
import { CommentNode } from './comment';
|
|
19
19
|
interface Attrs {
|
|
20
20
|
id: string;
|
|
21
|
-
|
|
21
|
+
suppressCaption: boolean;
|
|
22
|
+
suppressTitle?: boolean;
|
|
22
23
|
comments?: CommentNode[];
|
|
23
24
|
}
|
|
24
25
|
export interface EquationElementNode extends ManuscriptNode {
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { NodeSpec } from 'prosemirror-model';
|
|
17
17
|
import { ManuscriptNode } from '../types';
|
|
18
|
-
import { CommentNode } from './comment';
|
|
19
18
|
interface Attrs {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
id: string;
|
|
20
|
+
MathMLRepresentation: string;
|
|
21
|
+
SVGRepresentation: string;
|
|
22
|
+
TeXRepresentation: string;
|
|
23
23
|
}
|
|
24
24
|
export interface InlineEquationNode extends ManuscriptNode {
|
|
25
25
|
attrs: Attrs;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Affiliation, Attribution, BibliographicDate, BibliographicName, BibliographyElement, BibliographyItem, Color, CommentAnnotation, Contribution, Contributor, ContributorRole, Corresponding, ElementsOrder, EmbeddedModel, Figure, Footnote, FootnotesOrder, Journal, Keyword, KeywordGroup, Manuscript, ManuscriptNote, ObjectTypes, ParagraphElement, Project, Section, Supplement, Titles } from '@manuscripts/json-schema';
|
|
16
|
+
import { Affiliation, Attribution, BibliographicDate, BibliographicName, BibliographyElement, BibliographyItem, Color, CommentAnnotation, Contribution, Contributor, ContributorRole, Corresponding, ElementsOrder, EmbeddedModel, Figure, Footnote, FootnotesOrder, InlineMathFragment, Journal, Keyword, KeywordGroup, Manuscript, ManuscriptNote, ObjectTypes, ParagraphElement, Project, Section, Supplement, Titles } from '@manuscripts/json-schema';
|
|
17
17
|
import { FootnotesOrderIndexList } from './footnotes-order';
|
|
18
18
|
import { CommentSelector, ManuscriptModel, ModelAttachment } from './models';
|
|
19
19
|
export type Build<T> = Pick<T, Exclude<keyof T, keyof ManuscriptModel>> & {
|
|
@@ -44,6 +44,7 @@ export declare const buildAffiliation: (institution: string, priority?: number)
|
|
|
44
44
|
export declare const buildSupplementaryMaterial: (title: string, href: string) => Build<Supplement>;
|
|
45
45
|
export declare const buildComment: (target: string, contents?: string, selector?: CommentSelector, contributions?: Contribution[], annotationColor?: string) => Build<CommentAnnotation>;
|
|
46
46
|
export declare const buildNote: (target: string, source: 'EMAIL' | 'EDITOR' | 'DASHBOARD', contents?: string) => Build<ManuscriptNote>;
|
|
47
|
+
export declare const buildInlineMathFragment: (containingObject: string, TeXRepresentation: string) => Build<InlineMathFragment>;
|
|
47
48
|
export declare const buildFootnote: (containingObject: string, contents: string, kind?: 'footnote' | 'endnote') => Build<Footnote>;
|
|
48
49
|
export declare const buildFootnotesOrder: (footnotesList: FootnotesOrderIndexList) => Build<FootnotesOrder>;
|
|
49
50
|
export declare const buildCorresp: (contents: string) => Build<Corresponding>;
|
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": "2.0.4-LEAN-
|
|
4
|
+
"version": "2.0.4-LEAN-3083",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -29,10 +29,11 @@
|
|
|
29
29
|
"version": "yarn build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@manuscripts/json-schema": "^2.2.2
|
|
33
|
-
"@manuscripts/library": "
|
|
32
|
+
"@manuscripts/json-schema": "^2.2.2",
|
|
33
|
+
"@manuscripts/library": "1.3.2",
|
|
34
34
|
"debug": "^4.3.4",
|
|
35
35
|
"jszip": "^3.10.1",
|
|
36
|
+
"mathjax-full": "^3.2.2",
|
|
36
37
|
"mime": "^3.0.0",
|
|
37
38
|
"prosemirror-model": "^1.18.3",
|
|
38
39
|
"uuid": "^9.0.0",
|
|
@@ -77,4 +78,4 @@
|
|
|
77
78
|
"rimraf": "^3.0.2",
|
|
78
79
|
"typescript": "^4.0.5"
|
|
79
80
|
}
|
|
80
|
-
}
|
|
81
|
+
}
|