@manuscripts/transform 4.3.36 → 4.3.37
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/README.md +1 -1
- package/dist/cjs/jats/__tests__/data/section-categories.js +5 -1
- package/dist/cjs/jats/exporter/jats-exporter.js +1 -1
- package/dist/cjs/jats/importer/jats-transformations.js +14 -8
- package/dist/cjs/jats/importer/parse-jats-article.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/es/jats/__tests__/data/section-categories.js +5 -1
- package/dist/es/jats/exporter/jats-exporter.js +1 -1
- package/dist/es/jats/importer/jats-transformations.js +14 -8
- package/dist/es/jats/importer/parse-jats-article.js +1 -1
- package/dist/es/version.js +1 -1
- package/dist/types/jats/importer/jats-transformations.d.ts +2 -2
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,7 +89,11 @@ exports.sectionCategories = [
|
|
|
89
89
|
'competing interests',
|
|
90
90
|
],
|
|
91
91
|
label: 'Conflict of Interest',
|
|
92
|
-
titles: [
|
|
92
|
+
titles: [
|
|
93
|
+
'Conflict of Interest Statement',
|
|
94
|
+
'COI Statement',
|
|
95
|
+
'Competing Interests',
|
|
96
|
+
],
|
|
93
97
|
group: 'backmatter',
|
|
94
98
|
isUnique: true,
|
|
95
99
|
},
|
|
@@ -1057,7 +1057,7 @@ class JATSExporter {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
this.appendElement($contrib, 'role', credit.vocabTerm, {
|
|
1059
1059
|
'vocab-identifier': 'http://credit.niso.org/',
|
|
1060
|
-
|
|
1060
|
+
vocab: 'CRediT',
|
|
1061
1061
|
'vocab-term': credit.vocabTerm,
|
|
1062
1062
|
'vocab-term-identifier': url,
|
|
1063
1063
|
});
|
|
@@ -115,10 +115,10 @@ const moveAffiliations = (front, createElement) => {
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
exports.moveAffiliations = moveAffiliations;
|
|
118
|
-
const moveAbstracts = (front, group, createElement) => {
|
|
118
|
+
const moveAbstracts = (front, group, createElement, sectionCategories) => {
|
|
119
119
|
const abstracts = front.querySelectorAll('article-meta > abstract, article-meta > trans-abstract');
|
|
120
120
|
abstracts.forEach((abstract) => {
|
|
121
|
-
const sec = createAbstractSection(abstract, createElement);
|
|
121
|
+
const sec = createAbstractSection(abstract, createElement, sectionCategories);
|
|
122
122
|
removeNodeFromParent(abstract);
|
|
123
123
|
group.appendChild(sec);
|
|
124
124
|
});
|
|
@@ -148,9 +148,9 @@ const createBody = (doc, body, createElement) => {
|
|
|
148
148
|
body.append(group);
|
|
149
149
|
};
|
|
150
150
|
exports.createBody = createBody;
|
|
151
|
-
const createAbstracts = (front, body, createElement) => {
|
|
151
|
+
const createAbstracts = (front, body, createElement, sectionCategories) => {
|
|
152
152
|
const group = createSectionGroup('abstracts', createElement);
|
|
153
|
-
(0, exports.moveAbstracts)(front, group, createElement);
|
|
153
|
+
(0, exports.moveAbstracts)(front, group, createElement, sectionCategories);
|
|
154
154
|
body.insertBefore(group, body.lastElementChild);
|
|
155
155
|
};
|
|
156
156
|
exports.createAbstracts = createAbstracts;
|
|
@@ -221,7 +221,7 @@ const moveCaptionsToEnd = (body) => {
|
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
exports.moveCaptionsToEnd = moveCaptionsToEnd;
|
|
224
|
-
const createAbstractSection = (abstract, createElement) => {
|
|
224
|
+
const createAbstractSection = (abstract, createElement, sectionCategories) => {
|
|
225
225
|
const abstractType = abstract.getAttribute('abstract-type');
|
|
226
226
|
const sectionType = abstractType ? `abstract-${abstractType}` : 'abstract';
|
|
227
227
|
let section = createElement('sec');
|
|
@@ -235,9 +235,15 @@ const createAbstractSection = (abstract, createElement) => {
|
|
|
235
235
|
section.setAttribute('sec-type', sectionType);
|
|
236
236
|
if (!abstract.querySelector(':scope > title')) {
|
|
237
237
|
const title = createElement('title');
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
const category = sectionCategories?.find((c) => c.id === sectionType || c.synonyms.includes(sectionType));
|
|
239
|
+
if (category?.titles[0]) {
|
|
240
|
+
title.textContent = category.titles[0];
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
title.textContent = abstractType
|
|
244
|
+
? `${capitalizeFirstLetter(abstractType.split('-').join(' '))} Abstract`
|
|
245
|
+
: 'Abstract';
|
|
246
|
+
}
|
|
241
247
|
section.appendChild(title);
|
|
242
248
|
}
|
|
243
249
|
while (abstract.firstChild) {
|
|
@@ -46,7 +46,7 @@ const processJATS = (doc, sectionCategories) => {
|
|
|
46
46
|
}
|
|
47
47
|
(0, jats_transformations_1.moveCaptionsToEnd)(body);
|
|
48
48
|
(0, jats_transformations_1.createBody)(doc, body, createElement);
|
|
49
|
-
(0, jats_transformations_1.createAbstracts)(front, body, createElement);
|
|
49
|
+
(0, jats_transformations_1.createAbstracts)(front, body, createElement, sectionCategories);
|
|
50
50
|
(0, jats_transformations_1.createBackmatter)(doc, body, sectionCategories, createElement);
|
|
51
51
|
(0, jats_transformations_1.createSupplementaryMaterialsSection)(doc, body, createElement);
|
|
52
52
|
(0, jats_transformations_1.createKeywordsSection)(doc, body, createElement);
|
package/dist/cjs/version.js
CHANGED
|
@@ -86,7 +86,11 @@ export const sectionCategories = [
|
|
|
86
86
|
'competing interests',
|
|
87
87
|
],
|
|
88
88
|
label: 'Conflict of Interest',
|
|
89
|
-
titles: [
|
|
89
|
+
titles: [
|
|
90
|
+
'Conflict of Interest Statement',
|
|
91
|
+
'COI Statement',
|
|
92
|
+
'Competing Interests',
|
|
93
|
+
],
|
|
90
94
|
group: 'backmatter',
|
|
91
95
|
isUnique: true,
|
|
92
96
|
},
|
|
@@ -1017,7 +1017,7 @@ export class JATSExporter {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
this.appendElement($contrib, 'role', credit.vocabTerm, {
|
|
1019
1019
|
'vocab-identifier': 'http://credit.niso.org/',
|
|
1020
|
-
|
|
1020
|
+
vocab: 'CRediT',
|
|
1021
1021
|
'vocab-term': credit.vocabTerm,
|
|
1022
1022
|
'vocab-term-identifier': url,
|
|
1023
1023
|
});
|
|
@@ -105,10 +105,10 @@ export const moveAffiliations = (front, createElement) => {
|
|
|
105
105
|
front.parentNode?.insertBefore(affiliations, front);
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
export const moveAbstracts = (front, group, createElement) => {
|
|
108
|
+
export const moveAbstracts = (front, group, createElement, sectionCategories) => {
|
|
109
109
|
const abstracts = front.querySelectorAll('article-meta > abstract, article-meta > trans-abstract');
|
|
110
110
|
abstracts.forEach((abstract) => {
|
|
111
|
-
const sec = createAbstractSection(abstract, createElement);
|
|
111
|
+
const sec = createAbstractSection(abstract, createElement, sectionCategories);
|
|
112
112
|
removeNodeFromParent(abstract);
|
|
113
113
|
group.appendChild(sec);
|
|
114
114
|
});
|
|
@@ -135,9 +135,9 @@ export const createBody = (doc, body, createElement) => {
|
|
|
135
135
|
});
|
|
136
136
|
body.append(group);
|
|
137
137
|
};
|
|
138
|
-
export const createAbstracts = (front, body, createElement) => {
|
|
138
|
+
export const createAbstracts = (front, body, createElement, sectionCategories) => {
|
|
139
139
|
const group = createSectionGroup('abstracts', createElement);
|
|
140
|
-
moveAbstracts(front, group, createElement);
|
|
140
|
+
moveAbstracts(front, group, createElement, sectionCategories);
|
|
141
141
|
body.insertBefore(group, body.lastElementChild);
|
|
142
142
|
};
|
|
143
143
|
export const createBackmatter = (doc, body, sectionCategories, createElement) => {
|
|
@@ -205,7 +205,7 @@ export const moveCaptionsToEnd = (body) => {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
};
|
|
208
|
-
const createAbstractSection = (abstract, createElement) => {
|
|
208
|
+
const createAbstractSection = (abstract, createElement, sectionCategories) => {
|
|
209
209
|
const abstractType = abstract.getAttribute('abstract-type');
|
|
210
210
|
const sectionType = abstractType ? `abstract-${abstractType}` : 'abstract';
|
|
211
211
|
let section = createElement('sec');
|
|
@@ -219,9 +219,15 @@ const createAbstractSection = (abstract, createElement) => {
|
|
|
219
219
|
section.setAttribute('sec-type', sectionType);
|
|
220
220
|
if (!abstract.querySelector(':scope > title')) {
|
|
221
221
|
const title = createElement('title');
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
const category = sectionCategories?.find((c) => c.id === sectionType || c.synonyms.includes(sectionType));
|
|
223
|
+
if (category?.titles[0]) {
|
|
224
|
+
title.textContent = category.titles[0];
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
title.textContent = abstractType
|
|
228
|
+
? `${capitalizeFirstLetter(abstractType.split('-').join(' '))} Abstract`
|
|
229
|
+
: 'Abstract';
|
|
230
|
+
}
|
|
225
231
|
section.appendChild(title);
|
|
226
232
|
}
|
|
227
233
|
while (abstract.firstChild) {
|
|
@@ -43,7 +43,7 @@ const processJATS = (doc, sectionCategories) => {
|
|
|
43
43
|
}
|
|
44
44
|
moveCaptionsToEnd(body);
|
|
45
45
|
createBody(doc, body, createElement);
|
|
46
|
-
createAbstracts(front, body, createElement);
|
|
46
|
+
createAbstracts(front, body, createElement, sectionCategories);
|
|
47
47
|
createBackmatter(doc, body, sectionCategories, createElement);
|
|
48
48
|
createSupplementaryMaterialsSection(doc, body, createElement);
|
|
49
49
|
createKeywordsSection(doc, body, createElement);
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "4.3.
|
|
1
|
+
export const VERSION = "4.3.37";
|
|
@@ -22,10 +22,10 @@ export declare const moveAuthorNotes: (front: Element, createElement: CreateElem
|
|
|
22
22
|
export declare const moveAwards: (front: Element) => void;
|
|
23
23
|
export declare const moveContributors: (front: Element, createElement: CreateElement) => void;
|
|
24
24
|
export declare const moveAffiliations: (front: Element, createElement: CreateElement) => void;
|
|
25
|
-
export declare const moveAbstracts: (front: Element, group: Element, createElement: CreateElement) => void;
|
|
25
|
+
export declare const moveAbstracts: (front: Element, group: Element, createElement: CreateElement, sectionCategories?: SectionCategory[]) => void;
|
|
26
26
|
export declare const moveHeroImage: (doc: Document) => void;
|
|
27
27
|
export declare const createBody: (doc: Document, body: Element, createElement: CreateElement) => void;
|
|
28
|
-
export declare const createAbstracts: (front: Element, body: Element, createElement: CreateElement) => void;
|
|
28
|
+
export declare const createAbstracts: (front: Element, body: Element, createElement: CreateElement, sectionCategories?: SectionCategory[]) => void;
|
|
29
29
|
export declare const createBackmatter: (doc: Document, body: Element, sectionCategories: SectionCategory[], createElement: CreateElement) => void;
|
|
30
30
|
export declare const moveCaptionsToEnd: (body: Element) => void;
|
|
31
31
|
export declare const createKeywordsSection: (document: Document, body: Element, createElement: CreateElement) => void;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.3.
|
|
1
|
+
export declare const VERSION = "4.3.37";
|
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.3.
|
|
4
|
+
"version": "4.3.37",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|