@manuscripts/transform 3.0.64 → 3.0.66
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 +6 -4
- package/dist/cjs/jats/exporter/labels.js +6 -0
- package/dist/cjs/jats/importer/jats-dom-parser.js +5 -0
- package/dist/cjs/version.js +1 -1
- package/dist/es/jats/exporter/jats-exporter.js +6 -4
- package/dist/es/jats/exporter/labels.js +6 -0
- package/dist/es/jats/importer/jats-dom-parser.js +5 -0
- package/dist/es/version.js +1 -1
- package/dist/types/schema/nodes/box_element.d.ts +2 -3
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -963,7 +963,10 @@ class JATSExporter {
|
|
|
963
963
|
const createBoxElement = (node) => {
|
|
964
964
|
const element = createElement(node, 'boxed-text');
|
|
965
965
|
appendLabels(element, node);
|
|
966
|
-
|
|
966
|
+
const child = node.firstChild;
|
|
967
|
+
if ((child === null || child === void 0 ? void 0 : child.type) === schema_1.schema.nodes.figcaption) {
|
|
968
|
+
appendChildNodeOfType(element, node, node.type.schema.nodes.figcaption);
|
|
969
|
+
}
|
|
967
970
|
processChildNodes(element, node, node.type.schema.nodes.section);
|
|
968
971
|
return element;
|
|
969
972
|
};
|
|
@@ -1227,10 +1230,9 @@ class JATSExporter {
|
|
|
1227
1230
|
};
|
|
1228
1231
|
this.appendParagraphToElement = (paragraph, element) => {
|
|
1229
1232
|
const parsedDoc = new DOMParser().parseFromString(paragraph.textContent, 'text/html');
|
|
1230
|
-
|
|
1231
|
-
if (parsedParagraph) {
|
|
1233
|
+
if (parsedDoc.body.innerHTML.length) {
|
|
1232
1234
|
const paragraphEl = this.createElement('p');
|
|
1233
|
-
paragraphEl.innerHTML =
|
|
1235
|
+
paragraphEl.innerHTML = parsedDoc.body.innerHTML;
|
|
1234
1236
|
paragraphEl.setAttribute('id', normalizeID(paragraph.attrs.id));
|
|
1235
1237
|
element.appendChild(paragraphEl);
|
|
1236
1238
|
}
|
|
@@ -51,6 +51,12 @@ const buildTargets = (node) => {
|
|
|
51
51
|
if (parent && excludedTypes.includes(parent.type)) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
+
if (node.type === schema_1.schema.nodes.box_element) {
|
|
55
|
+
const child = node.firstChild;
|
|
56
|
+
if (!child || child.type !== schema_1.schema.nodes.figcaption) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
54
60
|
const label = buildLabel(node.type);
|
|
55
61
|
targets.set(node.attrs.id, {
|
|
56
62
|
type: node.type.name,
|
package/dist/cjs/version.js
CHANGED
|
@@ -955,7 +955,10 @@ export class JATSExporter {
|
|
|
955
955
|
const createBoxElement = (node) => {
|
|
956
956
|
const element = createElement(node, 'boxed-text');
|
|
957
957
|
appendLabels(element, node);
|
|
958
|
-
|
|
958
|
+
const child = node.firstChild;
|
|
959
|
+
if ((child === null || child === void 0 ? void 0 : child.type) === schema.nodes.figcaption) {
|
|
960
|
+
appendChildNodeOfType(element, node, node.type.schema.nodes.figcaption);
|
|
961
|
+
}
|
|
959
962
|
processChildNodes(element, node, node.type.schema.nodes.section);
|
|
960
963
|
return element;
|
|
961
964
|
};
|
|
@@ -1219,10 +1222,9 @@ export class JATSExporter {
|
|
|
1219
1222
|
};
|
|
1220
1223
|
this.appendParagraphToElement = (paragraph, element) => {
|
|
1221
1224
|
const parsedDoc = new DOMParser().parseFromString(paragraph.textContent, 'text/html');
|
|
1222
|
-
|
|
1223
|
-
if (parsedParagraph) {
|
|
1225
|
+
if (parsedDoc.body.innerHTML.length) {
|
|
1224
1226
|
const paragraphEl = this.createElement('p');
|
|
1225
|
-
paragraphEl.innerHTML =
|
|
1227
|
+
paragraphEl.innerHTML = parsedDoc.body.innerHTML;
|
|
1226
1228
|
paragraphEl.setAttribute('id', normalizeID(paragraph.attrs.id));
|
|
1227
1229
|
element.appendChild(paragraphEl);
|
|
1228
1230
|
}
|
|
@@ -48,6 +48,12 @@ export const buildTargets = (node) => {
|
|
|
48
48
|
if (parent && excludedTypes.includes(parent.type)) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
+
if (node.type === schema.nodes.box_element) {
|
|
52
|
+
const child = node.firstChild;
|
|
53
|
+
if (!child || child.type !== schema.nodes.figcaption) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
51
57
|
const label = buildLabel(node.type);
|
|
52
58
|
targets.set(node.attrs.id, {
|
|
53
59
|
type: node.type.name,
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "3.0.
|
|
1
|
+
export const VERSION = "3.0.66";
|
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { NodeSpec } from 'prosemirror-model';
|
|
17
17
|
import { ManuscriptNode } from '../types';
|
|
18
|
-
interface
|
|
18
|
+
export interface BoxElementAttrs {
|
|
19
19
|
id: string;
|
|
20
20
|
}
|
|
21
21
|
export interface BoxElementNode extends ManuscriptNode {
|
|
22
|
-
attrs:
|
|
22
|
+
attrs: BoxElementAttrs;
|
|
23
23
|
}
|
|
24
24
|
export declare const box_element: NodeSpec;
|
|
25
|
-
export {};
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.0.
|
|
1
|
+
export declare const VERSION = "3.0.66";
|
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.66",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|