@manuscripts/transform 4.2.16 → 4.2.18
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/jats/exporter/jats-exporter.js +17 -13
- package/dist/cjs/jats/importer/jats-dom-parser.js +12 -2
- package/dist/cjs/schema/nodes/subtitles.js +1 -0
- package/dist/cjs/version.js +1 -1
- package/dist/es/jats/exporter/jats-exporter.js +17 -13
- package/dist/es/jats/importer/jats-dom-parser.js +12 -2
- package/dist/es/schema/nodes/subtitles.js +1 -0
- package/dist/es/version.js +1 -1
- package/dist/types/jats/exporter/jats-exporter.d.ts +1 -1
- package/dist/types/jats/importer/jats-dom-parser.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1158,6 +1158,23 @@ class JATSExporter {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
1160
|
};
|
|
1161
|
+
this.buildContributorName = (contributor) => {
|
|
1162
|
+
const { given, family } = contributor.attrs.bibliographicName;
|
|
1163
|
+
if (Boolean(given) !== Boolean(family)) {
|
|
1164
|
+
return this.createElement('string-name', given || family);
|
|
1165
|
+
}
|
|
1166
|
+
const name = this.createElement('name');
|
|
1167
|
+
if (contributor.attrs.bibliographicName.family) {
|
|
1168
|
+
this.appendElement(name, 'surname', contributor.attrs.bibliographicName.family);
|
|
1169
|
+
}
|
|
1170
|
+
if (contributor.attrs.bibliographicName.given) {
|
|
1171
|
+
this.appendElement(name, 'given-names', contributor.attrs.bibliographicName.given);
|
|
1172
|
+
}
|
|
1173
|
+
if (contributor.attrs.prefix) {
|
|
1174
|
+
this.appendElement(name, 'prefix', contributor.attrs.prefix);
|
|
1175
|
+
}
|
|
1176
|
+
return name;
|
|
1177
|
+
};
|
|
1161
1178
|
this.createAuthorNotesElement = () => {
|
|
1162
1179
|
const authorNotesEl = this.createElement('author-notes');
|
|
1163
1180
|
const authorNotesNode = this.getFirstChildOfType(schema_1.schema.nodes.author_notes);
|
|
@@ -1426,19 +1443,6 @@ class JATSExporter {
|
|
|
1426
1443
|
article.appendChild(floatsGroup);
|
|
1427
1444
|
}
|
|
1428
1445
|
};
|
|
1429
|
-
this.buildContributorName = (contributor) => {
|
|
1430
|
-
const name = this.createElement('name');
|
|
1431
|
-
if (contributor.attrs.bibliographicName.family) {
|
|
1432
|
-
this.appendElement(name, 'surname', contributor.attrs.bibliographicName.family);
|
|
1433
|
-
}
|
|
1434
|
-
if (contributor.attrs.bibliographicName.given) {
|
|
1435
|
-
this.appendElement(name, 'given-names', contributor.attrs.bibliographicName.given);
|
|
1436
|
-
}
|
|
1437
|
-
if (contributor.attrs.prefix) {
|
|
1438
|
-
this.appendElement(name, 'prefix', contributor.attrs.prefix);
|
|
1439
|
-
}
|
|
1440
|
-
return name;
|
|
1441
|
-
};
|
|
1442
1446
|
}
|
|
1443
1447
|
getFirstChildOfType(type, node) {
|
|
1444
1448
|
return this.getChildrenOfType(type, node)[0];
|
|
@@ -131,6 +131,16 @@ class JATSDOMParser {
|
|
|
131
131
|
this.getAddressLine = (element, index) => {
|
|
132
132
|
return ((0, utils_1.getTrimmedTextContent)(element, `addr-line:nth-of-type(${index})`) || '');
|
|
133
133
|
};
|
|
134
|
+
this.getSurname = (element) => {
|
|
135
|
+
const surname = (0, utils_1.getTrimmedTextContent)(element, 'surname');
|
|
136
|
+
if (surname) {
|
|
137
|
+
return surname;
|
|
138
|
+
}
|
|
139
|
+
const stringName = element.querySelector('string-name');
|
|
140
|
+
if (stringName && !stringName.querySelector('given-names')) {
|
|
141
|
+
return (0, utils_1.getTrimmedTextContent)(element, 'string-name');
|
|
142
|
+
}
|
|
143
|
+
};
|
|
134
144
|
this.getRefType = (element) => {
|
|
135
145
|
const citation = element.querySelector('element-citation, mixed-citation');
|
|
136
146
|
const type = citation?.getAttribute('publication-type');
|
|
@@ -409,8 +419,8 @@ class JATSDOMParser {
|
|
|
409
419
|
? element.getAttribute('corresp') === 'yes'
|
|
410
420
|
: undefined,
|
|
411
421
|
bibliographicName: {
|
|
412
|
-
given: (0, utils_1.getTrimmedTextContent)(element, '
|
|
413
|
-
family:
|
|
422
|
+
given: (0, utils_1.getTrimmedTextContent)(element, 'given-names'),
|
|
423
|
+
family: this.getSurname(element),
|
|
414
424
|
ObjectType: json_schema_1.ObjectTypes.BibliographicName,
|
|
415
425
|
},
|
|
416
426
|
ORCIDIdentifier: (0, utils_1.getTrimmedTextContent)(element, 'contrib-id[contrib-id-type="orcid"]'),
|
package/dist/cjs/version.js
CHANGED
|
@@ -1118,6 +1118,23 @@ export class JATSExporter {
|
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
1120
|
};
|
|
1121
|
+
this.buildContributorName = (contributor) => {
|
|
1122
|
+
const { given, family } = contributor.attrs.bibliographicName;
|
|
1123
|
+
if (Boolean(given) !== Boolean(family)) {
|
|
1124
|
+
return this.createElement('string-name', given || family);
|
|
1125
|
+
}
|
|
1126
|
+
const name = this.createElement('name');
|
|
1127
|
+
if (contributor.attrs.bibliographicName.family) {
|
|
1128
|
+
this.appendElement(name, 'surname', contributor.attrs.bibliographicName.family);
|
|
1129
|
+
}
|
|
1130
|
+
if (contributor.attrs.bibliographicName.given) {
|
|
1131
|
+
this.appendElement(name, 'given-names', contributor.attrs.bibliographicName.given);
|
|
1132
|
+
}
|
|
1133
|
+
if (contributor.attrs.prefix) {
|
|
1134
|
+
this.appendElement(name, 'prefix', contributor.attrs.prefix);
|
|
1135
|
+
}
|
|
1136
|
+
return name;
|
|
1137
|
+
};
|
|
1121
1138
|
this.createAuthorNotesElement = () => {
|
|
1122
1139
|
const authorNotesEl = this.createElement('author-notes');
|
|
1123
1140
|
const authorNotesNode = this.getFirstChildOfType(schema.nodes.author_notes);
|
|
@@ -1386,19 +1403,6 @@ export class JATSExporter {
|
|
|
1386
1403
|
article.appendChild(floatsGroup);
|
|
1387
1404
|
}
|
|
1388
1405
|
};
|
|
1389
|
-
this.buildContributorName = (contributor) => {
|
|
1390
|
-
const name = this.createElement('name');
|
|
1391
|
-
if (contributor.attrs.bibliographicName.family) {
|
|
1392
|
-
this.appendElement(name, 'surname', contributor.attrs.bibliographicName.family);
|
|
1393
|
-
}
|
|
1394
|
-
if (contributor.attrs.bibliographicName.given) {
|
|
1395
|
-
this.appendElement(name, 'given-names', contributor.attrs.bibliographicName.given);
|
|
1396
|
-
}
|
|
1397
|
-
if (contributor.attrs.prefix) {
|
|
1398
|
-
this.appendElement(name, 'prefix', contributor.attrs.prefix);
|
|
1399
|
-
}
|
|
1400
|
-
return name;
|
|
1401
|
-
};
|
|
1402
1406
|
}
|
|
1403
1407
|
getFirstChildOfType(type, node) {
|
|
1404
1408
|
return this.getChildrenOfType(type, node)[0];
|
|
@@ -128,6 +128,16 @@ export class JATSDOMParser {
|
|
|
128
128
|
this.getAddressLine = (element, index) => {
|
|
129
129
|
return (getTrimmedTextContent(element, `addr-line:nth-of-type(${index})`) || '');
|
|
130
130
|
};
|
|
131
|
+
this.getSurname = (element) => {
|
|
132
|
+
const surname = getTrimmedTextContent(element, 'surname');
|
|
133
|
+
if (surname) {
|
|
134
|
+
return surname;
|
|
135
|
+
}
|
|
136
|
+
const stringName = element.querySelector('string-name');
|
|
137
|
+
if (stringName && !stringName.querySelector('given-names')) {
|
|
138
|
+
return getTrimmedTextContent(element, 'string-name');
|
|
139
|
+
}
|
|
140
|
+
};
|
|
131
141
|
this.getRefType = (element) => {
|
|
132
142
|
const citation = element.querySelector('element-citation, mixed-citation');
|
|
133
143
|
const type = citation?.getAttribute('publication-type');
|
|
@@ -406,8 +416,8 @@ export class JATSDOMParser {
|
|
|
406
416
|
? element.getAttribute('corresp') === 'yes'
|
|
407
417
|
: undefined,
|
|
408
418
|
bibliographicName: {
|
|
409
|
-
given: getTrimmedTextContent(element, '
|
|
410
|
-
family:
|
|
419
|
+
given: getTrimmedTextContent(element, 'given-names'),
|
|
420
|
+
family: this.getSurname(element),
|
|
411
421
|
ObjectType: ObjectTypes.BibliographicName,
|
|
412
422
|
},
|
|
413
423
|
ORCIDIdentifier: getTrimmedTextContent(element, 'contrib-id[contrib-id-type="orcid"]'),
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "4.2.
|
|
1
|
+
export const VERSION = "4.2.18";
|
|
@@ -61,6 +61,7 @@ export declare class JATSExporter {
|
|
|
61
61
|
protected serializeNode: (node: ManuscriptNode) => Node;
|
|
62
62
|
private validateContributor;
|
|
63
63
|
private buildContributors;
|
|
64
|
+
private buildContributorName;
|
|
64
65
|
private createAuthorNotesElement;
|
|
65
66
|
private appendModelsToAuthorNotes;
|
|
66
67
|
private appendCorrespondingToElement;
|
|
@@ -84,7 +85,6 @@ export declare class JATSExporter {
|
|
|
84
85
|
private moveSectionsToBack;
|
|
85
86
|
sectionToFootnote: (section: Element, fnType: string) => HTMLElement;
|
|
86
87
|
private moveFloatsGroup;
|
|
87
|
-
private buildContributorName;
|
|
88
88
|
private moveCoiStatementToAuthorNotes;
|
|
89
89
|
private updateFootnoteTypes;
|
|
90
90
|
private fillEmptyElements;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.2.
|
|
1
|
+
export declare const VERSION = "4.2.18";
|
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": "4.2.
|
|
4
|
+
"version": "4.2.18",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|