@manuscripts/transform 1.4.1-LIT-537312-2 → 1.4.2
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/schema/nodes/bibliography_element.js +1 -1
- package/dist/cjs/schema/nodes/comment.js +1 -1
- package/dist/cjs/schema/nodes/contributor.js +3 -3
- package/dist/cjs/transformer/decode.js +3 -0
- package/dist/cjs/transformer/encode.js +1 -1
- package/dist/es/schema/nodes/bibliography_element.js +1 -1
- package/dist/es/schema/nodes/comment.js +1 -1
- package/dist/es/schema/nodes/contributor.js +3 -3
- package/dist/es/transformer/decode.js +3 -0
- package/dist/es/transformer/encode.js +1 -1
- package/package.json +2 -2
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.bibliographyElement = void 0;
|
|
19
19
|
exports.bibliographyElement = {
|
|
20
|
-
content: 'bibliography_item
|
|
20
|
+
content: '(bibliography_item | placeholder)+',
|
|
21
21
|
attrs: {
|
|
22
22
|
id: { default: '' },
|
|
23
23
|
contents: { default: '' },
|
|
@@ -21,7 +21,7 @@ exports.comment = {
|
|
|
21
21
|
id: { default: '' },
|
|
22
22
|
contents: { default: '' },
|
|
23
23
|
target: { default: '' },
|
|
24
|
-
selector: { default:
|
|
24
|
+
selector: { default: undefined },
|
|
25
25
|
resolved: { default: false },
|
|
26
26
|
contributions: { default: [] },
|
|
27
27
|
originalText: { default: '' },
|
|
@@ -7,9 +7,9 @@ exports.contributor = {
|
|
|
7
7
|
role: { default: '' },
|
|
8
8
|
affiliations: { default: [] },
|
|
9
9
|
bibliographicName: { default: {} },
|
|
10
|
-
userID: { default:
|
|
11
|
-
invitationID: { default:
|
|
10
|
+
userID: { default: undefined },
|
|
11
|
+
invitationID: { default: undefined },
|
|
12
12
|
isCorresponding: { default: undefined },
|
|
13
|
-
ORCIDIdentifier: { default:
|
|
13
|
+
ORCIDIdentifier: { default: undefined },
|
|
14
14
|
},
|
|
15
15
|
};
|
|
@@ -140,6 +140,9 @@ class Decoder {
|
|
|
140
140
|
return references.push(this.decode(referenceModel));
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
|
+
if (!references.length) {
|
|
144
|
+
references.push(schema_1.schema.nodes.placeholder.createAndFill());
|
|
145
|
+
}
|
|
143
146
|
return schema_1.schema.nodes.bibliography_element.createChecked({
|
|
144
147
|
id: model._id,
|
|
145
148
|
contents: '',
|
|
@@ -476,7 +476,7 @@ const encoders = {
|
|
|
476
476
|
}),
|
|
477
477
|
table_element: (node) => ({
|
|
478
478
|
containedObjectID: attributeOfNodeType(node, 'table', 'id'),
|
|
479
|
-
tableElementFooterID: attributeOfNodeType(node, 'table_element_footer', 'id'),
|
|
479
|
+
tableElementFooterID: attributeOfNodeType(node, 'table_element_footer', 'id') || undefined,
|
|
480
480
|
caption: inlineContentOfChildNodeType(node, node.type.schema.nodes.figcaption, node.type.schema.nodes.caption),
|
|
481
481
|
title: inlineContentOfChildNodeType(node, node.type.schema.nodes.figcaption, node.type.schema.nodes.caption_title, false),
|
|
482
482
|
elementType: 'table',
|
|
@@ -18,7 +18,7 @@ export const comment = {
|
|
|
18
18
|
id: { default: '' },
|
|
19
19
|
contents: { default: '' },
|
|
20
20
|
target: { default: '' },
|
|
21
|
-
selector: { default:
|
|
21
|
+
selector: { default: undefined },
|
|
22
22
|
resolved: { default: false },
|
|
23
23
|
contributions: { default: [] },
|
|
24
24
|
originalText: { default: '' },
|
|
@@ -4,9 +4,9 @@ export const contributor = {
|
|
|
4
4
|
role: { default: '' },
|
|
5
5
|
affiliations: { default: [] },
|
|
6
6
|
bibliographicName: { default: {} },
|
|
7
|
-
userID: { default:
|
|
8
|
-
invitationID: { default:
|
|
7
|
+
userID: { default: undefined },
|
|
8
|
+
invitationID: { default: undefined },
|
|
9
9
|
isCorresponding: { default: undefined },
|
|
10
|
-
ORCIDIdentifier: { default:
|
|
10
|
+
ORCIDIdentifier: { default: undefined },
|
|
11
11
|
},
|
|
12
12
|
};
|
|
@@ -130,6 +130,9 @@ export class Decoder {
|
|
|
130
130
|
return references.push(this.decode(referenceModel));
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
+
if (!references.length) {
|
|
134
|
+
references.push(schema.nodes.placeholder.createAndFill());
|
|
135
|
+
}
|
|
133
136
|
return schema.nodes.bibliography_element.createChecked({
|
|
134
137
|
id: model._id,
|
|
135
138
|
contents: '',
|
|
@@ -468,7 +468,7 @@ const encoders = {
|
|
|
468
468
|
}),
|
|
469
469
|
table_element: (node) => ({
|
|
470
470
|
containedObjectID: attributeOfNodeType(node, 'table', 'id'),
|
|
471
|
-
tableElementFooterID: attributeOfNodeType(node, 'table_element_footer', 'id'),
|
|
471
|
+
tableElementFooterID: attributeOfNodeType(node, 'table_element_footer', 'id') || undefined,
|
|
472
472
|
caption: inlineContentOfChildNodeType(node, node.type.schema.nodes.figcaption, node.type.schema.nodes.caption),
|
|
473
473
|
title: inlineContentOfChildNodeType(node, node.type.schema.nodes.figcaption, node.type.schema.nodes.caption_title, false),
|
|
474
474
|
elementType: 'table',
|
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": "1.4.
|
|
4
|
+
"version": "1.4.2",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -82,4 +82,4 @@
|
|
|
82
82
|
"prosemirror-state": "^1.4.2",
|
|
83
83
|
"prosemirror-view": "^1.29.1"
|
|
84
84
|
}
|
|
85
|
-
}
|
|
85
|
+
}
|