@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.
@@ -463,6 +463,7 @@ const nodes = [
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
  },
@@ -824,7 +824,14 @@ class JATSExporter {
824
824
  graphic.setAttributeNS(XLINK_NAMESPACE, 'xlink:href', '');
825
825
  return graphic;
826
826
  },
827
- ordered_list: () => ['list', { 'list-type': 'order' }, 0],
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
  }),
@@ -436,6 +436,7 @@ const encoders = {
436
436
  ordered_list: (node) => ({
437
437
  elementType: 'ol',
438
438
  contents: listContents(node),
439
+ listStyleType: node.attrs.listStyleType,
439
440
  paragraphStyle: node.attrs.paragraphStyle || undefined,
440
441
  }),
441
442
  paragraph: (node) => ({
@@ -457,6 +457,7 @@ const nodes = [
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
  },
@@ -817,7 +817,14 @@ export class JATSExporter {
817
817
  graphic.setAttributeNS(XLINK_NAMESPACE, 'xlink:href', '');
818
818
  return graphic;
819
819
  },
820
- ordered_list: () => ['list', { 'list-type': 'order' }, 0],
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
  }),
@@ -428,6 +428,7 @@ const encoders = {
428
428
  ordered_list: (node) => ({
429
429
  elementType: 'ol',
430
430
  contents: listContents(node),
431
+ listStyleType: node.attrs.listStyleType,
431
432
  paragraphStyle: node.attrs.paragraphStyle || undefined,
432
433
  }),
433
434
  paragraph: (node) => ({
@@ -25,6 +25,7 @@ export declare const bulletList: NodeSpec;
25
25
  export interface OrderedListNode extends ManuscriptNode {
26
26
  attrs: {
27
27
  id: string;
28
+ listStyleType: string;
28
29
  paragraphStyle: string;
29
30
  };
30
31
  }
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.10",
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.0",
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",