@manuscripts/transform 3.0.35 → 3.0.36
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 +2 -0
- package/dist/cjs/jats/exporter/labels.js +1 -0
- package/dist/cjs/jats/importer/jats-dom-parser.js +1 -1
- package/dist/cjs/jats/importer/jats-transformations.js +1 -1
- package/dist/cjs/schema/nodes/embed.js +1 -0
- package/dist/cjs/transformer/node-names.js +1 -0
- package/dist/cjs/transformer/node-title.js +1 -0
- package/dist/cjs/version.js +1 -1
- package/dist/es/jats/exporter/jats-exporter.js +2 -0
- package/dist/es/jats/exporter/labels.js +1 -0
- package/dist/es/jats/importer/jats-dom-parser.js +1 -1
- package/dist/es/jats/importer/jats-transformations.js +1 -1
- package/dist/es/schema/nodes/embed.js +1 -0
- package/dist/es/transformer/node-names.js +1 -0
- package/dist/es/transformer/node-title.js +1 -0
- package/dist/es/version.js +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -560,6 +560,8 @@ class JATSExporter {
|
|
|
560
560
|
if (mimeSubtype) {
|
|
561
561
|
mediaElement.setAttribute('mime-subtype', node.attrs.mimeSubtype);
|
|
562
562
|
}
|
|
563
|
+
appendLabels(mediaElement, node);
|
|
564
|
+
appendChildNodeOfType(mediaElement, node, node.type.schema.nodes.figcaption);
|
|
563
565
|
return mediaElement;
|
|
564
566
|
},
|
|
565
567
|
awards: () => ['funding-group', 0],
|
|
@@ -24,6 +24,7 @@ const labelledNodeTypes = [
|
|
|
24
24
|
schema_1.schema.nodes.equation_element,
|
|
25
25
|
schema_1.schema.nodes.listing_element,
|
|
26
26
|
schema_1.schema.nodes.box_element,
|
|
27
|
+
schema_1.schema.nodes.embed,
|
|
27
28
|
];
|
|
28
29
|
const excludedTypes = [schema_1.schema.nodes.graphical_abstract_section];
|
|
29
30
|
const chooseLabel = (nodeType) => {
|
|
@@ -437,7 +437,7 @@ class JATSDOMParser {
|
|
|
437
437
|
{
|
|
438
438
|
tag: 'caption',
|
|
439
439
|
node: 'figcaption',
|
|
440
|
-
context: 'figure_element/|table_element/',
|
|
440
|
+
context: 'figure_element/|table_element/|embed/',
|
|
441
441
|
getContent: (node, schema) => {
|
|
442
442
|
const element = node;
|
|
443
443
|
const content = [];
|
|
@@ -26,7 +26,7 @@ const createSectionGroup = (type, createElement) => {
|
|
|
26
26
|
return sec;
|
|
27
27
|
};
|
|
28
28
|
const addMissingCaptions = (doc, createElement) => {
|
|
29
|
-
const elements = doc.querySelectorAll('fig, table-wrap');
|
|
29
|
+
const elements = doc.querySelectorAll('fig, table-wrap, media');
|
|
30
30
|
for (const element of elements) {
|
|
31
31
|
let caption = element.querySelector('caption');
|
|
32
32
|
if (!caption) {
|
|
@@ -37,6 +37,7 @@ exports.nodeNames = new Map([
|
|
|
37
37
|
[schema_1.schema.nodes.table_header, 'Table Header'],
|
|
38
38
|
[schema_1.schema.nodes.general_table_footnote, 'General Table note'],
|
|
39
39
|
[schema_1.schema.nodes.table_element_footer, 'Table Footer'],
|
|
40
|
+
[schema_1.schema.nodes.embed, 'Media'],
|
|
40
41
|
[schema_1.schema.nodes.equation, 'Equation'],
|
|
41
42
|
[schema_1.schema.nodes.inline_equation, 'Inline Equation'],
|
|
42
43
|
[schema_1.schema.nodes.inline_footnote, 'Footnote Reference'],
|
package/dist/cjs/version.js
CHANGED
|
@@ -552,6 +552,8 @@ export class JATSExporter {
|
|
|
552
552
|
if (mimeSubtype) {
|
|
553
553
|
mediaElement.setAttribute('mime-subtype', node.attrs.mimeSubtype);
|
|
554
554
|
}
|
|
555
|
+
appendLabels(mediaElement, node);
|
|
556
|
+
appendChildNodeOfType(mediaElement, node, node.type.schema.nodes.figcaption);
|
|
555
557
|
return mediaElement;
|
|
556
558
|
},
|
|
557
559
|
awards: () => ['funding-group', 0],
|
|
@@ -434,7 +434,7 @@ export class JATSDOMParser {
|
|
|
434
434
|
{
|
|
435
435
|
tag: 'caption',
|
|
436
436
|
node: 'figcaption',
|
|
437
|
-
context: 'figure_element/|table_element/',
|
|
437
|
+
context: 'figure_element/|table_element/|embed/',
|
|
438
438
|
getContent: (node, schema) => {
|
|
439
439
|
const element = node;
|
|
440
440
|
const content = [];
|
|
@@ -23,7 +23,7 @@ const createSectionGroup = (type, createElement) => {
|
|
|
23
23
|
return sec;
|
|
24
24
|
};
|
|
25
25
|
export const addMissingCaptions = (doc, createElement) => {
|
|
26
|
-
const elements = doc.querySelectorAll('fig, table-wrap');
|
|
26
|
+
const elements = doc.querySelectorAll('fig, table-wrap, media');
|
|
27
27
|
for (const element of elements) {
|
|
28
28
|
let caption = element.querySelector('caption');
|
|
29
29
|
if (!caption) {
|
|
@@ -34,6 +34,7 @@ export const nodeNames = new Map([
|
|
|
34
34
|
[schema.nodes.table_header, 'Table Header'],
|
|
35
35
|
[schema.nodes.general_table_footnote, 'General Table note'],
|
|
36
36
|
[schema.nodes.table_element_footer, 'Table Footer'],
|
|
37
|
+
[schema.nodes.embed, 'Media'],
|
|
37
38
|
[schema.nodes.equation, 'Equation'],
|
|
38
39
|
[schema.nodes.inline_equation, 'Inline Equation'],
|
|
39
40
|
[schema.nodes.inline_footnote, 'Footnote Reference'],
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "3.0.
|
|
1
|
+
export const VERSION = "3.0.36";
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.0.
|
|
1
|
+
export declare const VERSION = "3.0.36";
|
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.36",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|