@manuscripts/transform 3.0.15-LEAN-4146.4 → 3.0.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/importer/jats-transformations.js +5 -20
- package/dist/cjs/jats/importer/parse-jats-article.js +0 -1
- package/dist/cjs/schema/nodes/caption.js +0 -1
- package/dist/cjs/schema/nodes/caption_title.js +0 -1
- package/dist/cjs/version.js +1 -1
- package/dist/es/jats/importer/jats-transformations.js +4 -18
- package/dist/es/jats/importer/parse-jats-article.js +1 -2
- package/dist/es/schema/nodes/caption.js +0 -1
- package/dist/es/schema/nodes/caption_title.js +0 -1
- package/dist/es/version.js +1 -1
- package/dist/types/jats/importer/jats-transformations.d.ts +0 -1
- package/dist/types/lib/table-cell-styles.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.fixTables = exports.orderTableFootnote = exports.moveReferencesToBackmatter = exports.createSupplementaryMaterialsSection = exports.createKeywordsSection = exports.moveCaptionsToEnd = exports.createBackmatter = exports.createAbstracts = exports.createBody = exports.createBoxedElementSection = exports.moveAbstracts = exports.moveAffiliations = exports.moveContributors = exports.moveAwards = exports.moveAuthorNotes = exports.moveTitle = exports.ensureSection = void 0;
|
|
19
19
|
const deafults_1 = require("../../lib/deafults");
|
|
20
20
|
const section_group_type_1 = require("../../lib/section-group-type");
|
|
21
21
|
const transformer_1 = require("../../transformer");
|
|
@@ -116,8 +116,12 @@ exports.moveAbstracts = moveAbstracts;
|
|
|
116
116
|
const createBoxedElementSection = (body, createElement) => {
|
|
117
117
|
const boxedTexts = body.querySelectorAll('boxed-text');
|
|
118
118
|
for (const boxedText of boxedTexts) {
|
|
119
|
+
const boxElementId = boxedText.getAttribute('id');
|
|
119
120
|
const boxElementSec = createElement('sec');
|
|
120
121
|
boxElementSec.setAttribute('sec-type', 'box-element');
|
|
122
|
+
if (boxElementId) {
|
|
123
|
+
boxElementSec.setAttribute('id', boxElementId);
|
|
124
|
+
}
|
|
121
125
|
const title = createElement('title');
|
|
122
126
|
title.textContent = 'BoxElement';
|
|
123
127
|
boxElementSec.append(title);
|
|
@@ -395,22 +399,3 @@ const fixTables = (doc, body, createElement) => {
|
|
|
395
399
|
});
|
|
396
400
|
};
|
|
397
401
|
exports.fixTables = fixTables;
|
|
398
|
-
const addCaptionsToFigures = (doc, createElement) => {
|
|
399
|
-
const figs = doc.querySelectorAll('fig');
|
|
400
|
-
figs.forEach((fig) => {
|
|
401
|
-
var _a;
|
|
402
|
-
const caption = fig.querySelector('caption');
|
|
403
|
-
if (!caption) {
|
|
404
|
-
const caption = createElement('caption');
|
|
405
|
-
const title = createElement('title');
|
|
406
|
-
caption.appendChild(title);
|
|
407
|
-
fig.appendChild(caption);
|
|
408
|
-
}
|
|
409
|
-
const title = fig.querySelector('caption > title');
|
|
410
|
-
if (!title) {
|
|
411
|
-
const title = createElement('title');
|
|
412
|
-
(_a = fig.querySelector('caption')) === null || _a === void 0 ? void 0 : _a.appendChild(title);
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
};
|
|
416
|
-
exports.addCaptionsToFigures = addCaptionsToFigures;
|
|
@@ -28,7 +28,6 @@ const processJATS = (doc) => {
|
|
|
28
28
|
if (!front) {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
(0, jats_transformations_1.addCaptionsToFigures)(doc, createElement);
|
|
32
31
|
(0, jats_transformations_1.moveTitle)(front, createElement);
|
|
33
32
|
(0, jats_transformations_1.moveContributors)(front, createElement);
|
|
34
33
|
(0, jats_transformations_1.moveAffiliations)(front, createElement);
|
package/dist/cjs/version.js
CHANGED
|
@@ -106,8 +106,12 @@ export const moveAbstracts = (doc, group, createElement) => {
|
|
|
106
106
|
export const createBoxedElementSection = (body, createElement) => {
|
|
107
107
|
const boxedTexts = body.querySelectorAll('boxed-text');
|
|
108
108
|
for (const boxedText of boxedTexts) {
|
|
109
|
+
const boxElementId = boxedText.getAttribute('id');
|
|
109
110
|
const boxElementSec = createElement('sec');
|
|
110
111
|
boxElementSec.setAttribute('sec-type', 'box-element');
|
|
112
|
+
if (boxElementId) {
|
|
113
|
+
boxElementSec.setAttribute('id', boxElementId);
|
|
114
|
+
}
|
|
111
115
|
const title = createElement('title');
|
|
112
116
|
title.textContent = 'BoxElement';
|
|
113
117
|
boxElementSec.append(title);
|
|
@@ -375,21 +379,3 @@ export const fixTables = (doc, body, createElement) => {
|
|
|
375
379
|
}
|
|
376
380
|
});
|
|
377
381
|
};
|
|
378
|
-
export const addCaptionsToFigures = (doc, createElement) => {
|
|
379
|
-
const figs = doc.querySelectorAll('fig');
|
|
380
|
-
figs.forEach((fig) => {
|
|
381
|
-
var _a;
|
|
382
|
-
const caption = fig.querySelector('caption');
|
|
383
|
-
if (!caption) {
|
|
384
|
-
const caption = createElement('caption');
|
|
385
|
-
const title = createElement('title');
|
|
386
|
-
caption.appendChild(title);
|
|
387
|
-
fig.appendChild(caption);
|
|
388
|
-
}
|
|
389
|
-
const title = fig.querySelector('caption > title');
|
|
390
|
-
if (!title) {
|
|
391
|
-
const title = createElement('title');
|
|
392
|
-
(_a = fig.querySelector('caption')) === null || _a === void 0 ? void 0 : _a.appendChild(title);
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
};
|
|
@@ -17,7 +17,7 @@ import { markComments } from './jats-comments';
|
|
|
17
17
|
import { jatsDOMParser } from './jats-dom-parser';
|
|
18
18
|
import { parseJournal } from './jats-journal-meta-parser';
|
|
19
19
|
import { updateDocumentIDs } from './jats-parser-utils';
|
|
20
|
-
import {
|
|
20
|
+
import { createAbstracts, createBackmatter, createBody, createBoxedElementSection, createKeywordsSection, createSupplementaryMaterialsSection, ensureSection, fixTables, moveAffiliations, moveAuthorNotes, moveAwards, moveCaptionsToEnd, moveContributors, moveReferencesToBackmatter, moveTitle, orderTableFootnote, } from './jats-transformations';
|
|
21
21
|
const processJATS = (doc) => {
|
|
22
22
|
const createElement = createElementFn(doc);
|
|
23
23
|
markComments(doc);
|
|
@@ -25,7 +25,6 @@ const processJATS = (doc) => {
|
|
|
25
25
|
if (!front) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
addCaptionsToFigures(doc, createElement);
|
|
29
28
|
moveTitle(front, createElement);
|
|
30
29
|
moveContributors(front, createElement);
|
|
31
30
|
moveAffiliations(front, createElement);
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "3.0.
|
|
1
|
+
export const VERSION = "3.0.18";
|
|
@@ -31,4 +31,3 @@ export declare const createSupplementaryMaterialsSection: (document: Document, b
|
|
|
31
31
|
export declare const moveReferencesToBackmatter: (body: Element, back: Element, createElement: CreateElement) => void;
|
|
32
32
|
export declare const orderTableFootnote: (doc: Document, body: Element) => void;
|
|
33
33
|
export declare const fixTables: (doc: Document, body: Element, createElement: CreateElement) => void;
|
|
34
|
-
export declare const addCaptionsToFigures: (doc: Document, createElement: CreateElement) => void;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare const TABLE_CELL_STYLES: readonly ["backgroundColor", "border-top", "border-right", "border-bottom", "border-left", "verticalAlign", "textAlign"];
|
|
17
|
-
export type TableCellStyleKey =
|
|
17
|
+
export type TableCellStyleKey = typeof TABLE_CELL_STYLES[number];
|
|
18
18
|
export declare const serializeTableCellStyles: (styles: {
|
|
19
19
|
backgroundColor?: string | null | undefined;
|
|
20
20
|
"border-top"?: string | null | undefined;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.0.
|
|
1
|
+
export declare const VERSION = "3.0.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": "3.0.
|
|
4
|
+
"version": "3.0.18",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|