@manuscripts/transform 1.3.11-LEAN-2147 → 1.3.11-LEAN-2712-1
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-body-dom-parser.js +2 -1
- package/dist/cjs/jats/jats-exporter.js +9 -2
- package/dist/cjs/schema/nodes/cross_reference.js +1 -6
- package/dist/cjs/schema/nodes/list.js +3 -0
- package/dist/cjs/transformer/decode.js +1 -0
- package/dist/cjs/transformer/encode.js +1 -0
- package/dist/cjs/transformer/html.js +1 -2
- package/dist/es/jats/importer/jats-body-dom-parser.js +2 -1
- package/dist/es/jats/jats-exporter.js +9 -2
- package/dist/es/schema/nodes/cross_reference.js +1 -6
- package/dist/es/schema/nodes/list.js +3 -0
- package/dist/es/transformer/decode.js +1 -0
- package/dist/es/transformer/encode.js +1 -0
- package/dist/es/transformer/html.js +1 -2
- package/dist/types/schema/nodes/cross_reference.d.ts +0 -1
- package/dist/types/schema/nodes/list.d.ts +1 -0
- package/package.json +2 -2
|
@@ -457,12 +457,13 @@ const nodes = [
|
|
|
457
457
|
},
|
|
458
458
|
},
|
|
459
459
|
{
|
|
460
|
-
tag: 'list[list-type
|
|
460
|
+
tag: 'list[list-type]',
|
|
461
461
|
node: 'ordered_list',
|
|
462
462
|
getAttrs: (node) => {
|
|
463
463
|
const element = node;
|
|
464
464
|
return {
|
|
465
465
|
id: element.getAttribute('id'),
|
|
466
|
+
listStyleType: element.getAttribute('list-type'),
|
|
466
467
|
};
|
|
467
468
|
},
|
|
468
469
|
},
|
|
@@ -689,7 +689,7 @@ class JATSExporter {
|
|
|
689
689
|
const rid = getReferencedObjectId(auxiliaryObjectReference.referencedObject);
|
|
690
690
|
xref.setAttribute('rid', rid);
|
|
691
691
|
}
|
|
692
|
-
xref.textContent = node.attrs.
|
|
692
|
+
xref.textContent = node.attrs.label;
|
|
693
693
|
return xref;
|
|
694
694
|
},
|
|
695
695
|
doc: () => '',
|
|
@@ -824,7 +824,14 @@ class JATSExporter {
|
|
|
824
824
|
graphic.setAttributeNS(XLINK_NAMESPACE, 'xlink:href', '');
|
|
825
825
|
return graphic;
|
|
826
826
|
},
|
|
827
|
-
ordered_list: () =>
|
|
827
|
+
ordered_list: (node) => {
|
|
828
|
+
var _a;
|
|
829
|
+
return [
|
|
830
|
+
'list',
|
|
831
|
+
{ 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'order' },
|
|
832
|
+
0,
|
|
833
|
+
];
|
|
834
|
+
},
|
|
828
835
|
paragraph: (node) => {
|
|
829
836
|
if (!node.childCount) {
|
|
830
837
|
return '';
|
|
@@ -24,7 +24,6 @@ exports.crossReference = {
|
|
|
24
24
|
attrs: {
|
|
25
25
|
rid: { default: '' },
|
|
26
26
|
label: { default: '' },
|
|
27
|
-
customLabel: { default: '' },
|
|
28
27
|
dataTracked: { default: null },
|
|
29
28
|
},
|
|
30
29
|
parseDOM: [
|
|
@@ -52,11 +51,7 @@ exports.crossReference = {
|
|
|
52
51
|
{
|
|
53
52
|
class: 'kind elementIndex',
|
|
54
53
|
},
|
|
55
|
-
[
|
|
56
|
-
'b',
|
|
57
|
-
crossReferenceNode.attrs.customLabel ||
|
|
58
|
-
crossReferenceNode.attrs.label,
|
|
59
|
-
],
|
|
54
|
+
['b', crossReferenceNode.attrs.label],
|
|
60
55
|
],
|
|
61
56
|
];
|
|
62
57
|
},
|
|
@@ -57,6 +57,7 @@ exports.orderedList = {
|
|
|
57
57
|
group: 'block list element',
|
|
58
58
|
attrs: {
|
|
59
59
|
id: { default: '' },
|
|
60
|
+
listStyleType: { default: null },
|
|
60
61
|
paragraphStyle: { default: '' },
|
|
61
62
|
dataTracked: { default: null },
|
|
62
63
|
},
|
|
@@ -67,6 +68,7 @@ exports.orderedList = {
|
|
|
67
68
|
const dom = p;
|
|
68
69
|
return {
|
|
69
70
|
id: dom.getAttribute('id'),
|
|
71
|
+
listStyleType: dom.getAttribute('list-type'),
|
|
70
72
|
};
|
|
71
73
|
},
|
|
72
74
|
},
|
|
@@ -78,6 +80,7 @@ exports.orderedList = {
|
|
|
78
80
|
'ol',
|
|
79
81
|
{
|
|
80
82
|
id: orderedListNode.attrs.id,
|
|
83
|
+
'list-type': orderedListNode.attrs.listStyleType,
|
|
81
84
|
class: (0, attributes_1.buildElementClass)(orderedListNode.attrs),
|
|
82
85
|
'data-object-type': json_schema_1.ObjectTypes.ListElement,
|
|
83
86
|
},
|
|
@@ -340,6 +340,7 @@ class Decoder {
|
|
|
340
340
|
return this.parseContents(model.contents || '<ol></ol>', undefined, this.getComments(model), {
|
|
341
341
|
topNode: schema_1.schema.nodes.ordered_list.create({
|
|
342
342
|
id: model._id,
|
|
343
|
+
listStyleType: model.listStyleType,
|
|
343
344
|
paragraphStyle: model.paragraphStyle,
|
|
344
345
|
comments: commentNodes.map((c) => c.attrs.id),
|
|
345
346
|
}),
|
|
@@ -228,8 +228,7 @@ class HTMLTransformer {
|
|
|
228
228
|
}
|
|
229
229
|
element.setAttribute('data-reference-ids', crossReferenceNode.attrs.rid);
|
|
230
230
|
}
|
|
231
|
-
element.textContent =
|
|
232
|
-
crossReferenceNode.attrs.customLabel || crossReferenceNode.attrs.label;
|
|
231
|
+
element.textContent = crossReferenceNode.attrs.label;
|
|
233
232
|
return element;
|
|
234
233
|
};
|
|
235
234
|
nodes.listing = (node) => {
|
|
@@ -451,12 +451,13 @@ const nodes = [
|
|
|
451
451
|
},
|
|
452
452
|
},
|
|
453
453
|
{
|
|
454
|
-
tag: 'list[list-type
|
|
454
|
+
tag: 'list[list-type]',
|
|
455
455
|
node: 'ordered_list',
|
|
456
456
|
getAttrs: (node) => {
|
|
457
457
|
const element = node;
|
|
458
458
|
return {
|
|
459
459
|
id: element.getAttribute('id'),
|
|
460
|
+
listStyleType: element.getAttribute('list-type'),
|
|
460
461
|
};
|
|
461
462
|
},
|
|
462
463
|
},
|
|
@@ -682,7 +682,7 @@ export class JATSExporter {
|
|
|
682
682
|
const rid = getReferencedObjectId(auxiliaryObjectReference.referencedObject);
|
|
683
683
|
xref.setAttribute('rid', rid);
|
|
684
684
|
}
|
|
685
|
-
xref.textContent = node.attrs.
|
|
685
|
+
xref.textContent = node.attrs.label;
|
|
686
686
|
return xref;
|
|
687
687
|
},
|
|
688
688
|
doc: () => '',
|
|
@@ -817,7 +817,14 @@ export class JATSExporter {
|
|
|
817
817
|
graphic.setAttributeNS(XLINK_NAMESPACE, 'xlink:href', '');
|
|
818
818
|
return graphic;
|
|
819
819
|
},
|
|
820
|
-
ordered_list: () =>
|
|
820
|
+
ordered_list: (node) => {
|
|
821
|
+
var _a;
|
|
822
|
+
return [
|
|
823
|
+
'list',
|
|
824
|
+
{ 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'order' },
|
|
825
|
+
0,
|
|
826
|
+
];
|
|
827
|
+
},
|
|
821
828
|
paragraph: (node) => {
|
|
822
829
|
if (!node.childCount) {
|
|
823
830
|
return '';
|
|
@@ -21,7 +21,6 @@ export const crossReference = {
|
|
|
21
21
|
attrs: {
|
|
22
22
|
rid: { default: '' },
|
|
23
23
|
label: { default: '' },
|
|
24
|
-
customLabel: { default: '' },
|
|
25
24
|
dataTracked: { default: null },
|
|
26
25
|
},
|
|
27
26
|
parseDOM: [
|
|
@@ -49,11 +48,7 @@ export const crossReference = {
|
|
|
49
48
|
{
|
|
50
49
|
class: 'kind elementIndex',
|
|
51
50
|
},
|
|
52
|
-
[
|
|
53
|
-
'b',
|
|
54
|
-
crossReferenceNode.attrs.customLabel ||
|
|
55
|
-
crossReferenceNode.attrs.label,
|
|
56
|
-
],
|
|
51
|
+
['b', crossReferenceNode.attrs.label],
|
|
57
52
|
],
|
|
58
53
|
];
|
|
59
54
|
},
|
|
@@ -54,6 +54,7 @@ export const orderedList = {
|
|
|
54
54
|
group: 'block list element',
|
|
55
55
|
attrs: {
|
|
56
56
|
id: { default: '' },
|
|
57
|
+
listStyleType: { default: null },
|
|
57
58
|
paragraphStyle: { default: '' },
|
|
58
59
|
dataTracked: { default: null },
|
|
59
60
|
},
|
|
@@ -64,6 +65,7 @@ export const orderedList = {
|
|
|
64
65
|
const dom = p;
|
|
65
66
|
return {
|
|
66
67
|
id: dom.getAttribute('id'),
|
|
68
|
+
listStyleType: dom.getAttribute('list-type'),
|
|
67
69
|
};
|
|
68
70
|
},
|
|
69
71
|
},
|
|
@@ -75,6 +77,7 @@ export const orderedList = {
|
|
|
75
77
|
'ol',
|
|
76
78
|
{
|
|
77
79
|
id: orderedListNode.attrs.id,
|
|
80
|
+
'list-type': orderedListNode.attrs.listStyleType,
|
|
78
81
|
class: buildElementClass(orderedListNode.attrs),
|
|
79
82
|
'data-object-type': ObjectTypes.ListElement,
|
|
80
83
|
},
|
|
@@ -330,6 +330,7 @@ export class Decoder {
|
|
|
330
330
|
return this.parseContents(model.contents || '<ol></ol>', undefined, this.getComments(model), {
|
|
331
331
|
topNode: schema.nodes.ordered_list.create({
|
|
332
332
|
id: model._id,
|
|
333
|
+
listStyleType: model.listStyleType,
|
|
333
334
|
paragraphStyle: model.paragraphStyle,
|
|
334
335
|
comments: commentNodes.map((c) => c.attrs.id),
|
|
335
336
|
}),
|
|
@@ -222,8 +222,7 @@ export class HTMLTransformer {
|
|
|
222
222
|
}
|
|
223
223
|
element.setAttribute('data-reference-ids', crossReferenceNode.attrs.rid);
|
|
224
224
|
}
|
|
225
|
-
element.textContent =
|
|
226
|
-
crossReferenceNode.attrs.customLabel || crossReferenceNode.attrs.label;
|
|
225
|
+
element.textContent = crossReferenceNode.attrs.label;
|
|
227
226
|
return element;
|
|
228
227
|
};
|
|
229
228
|
nodes.listing = (node) => {
|
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.3.11-LEAN-
|
|
4
|
+
"version": "1.3.11-LEAN-2712-1",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"version": "yarn build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@manuscripts/json-schema": "^2.1.1",
|
|
32
|
+
"@manuscripts/json-schema": "^2.1.1-LEAN-2712",
|
|
33
33
|
"debug": "^4.3.4",
|
|
34
34
|
"jszip": "^3.10.1",
|
|
35
35
|
"mathjax-full": "^3.2.2",
|