@manuscripts/transform 1.3.10 → 1.3.11-LEAN-2712
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 +1 -0
- package/dist/cjs/jats/jats-exporter.js +8 -1
- 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/es/jats/importer/jats-body-dom-parser.js +1 -0
- package/dist/es/jats/jats-exporter.js +8 -1
- 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/types/schema/nodes/list.d.ts +1 -0
- package/package.json +2 -2
|
@@ -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 '';
|
|
@@ -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
|
}),
|
|
@@ -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 '';
|
|
@@ -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
|
}),
|
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.
|
|
4
|
+
"version": "1.3.11-LEAN-2712",
|
|
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.
|
|
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",
|