@manuscripts/transform 2.3.5-LEAN-3607.0 → 2.3.5-LEAN-3608.3

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.
@@ -332,19 +332,8 @@ const nodes = [
332
332
  ignore: true,
333
333
  },
334
334
  {
335
- tag: 'list[list-type=bullet]',
336
- node: 'bullet_list',
337
- getAttrs: (node) => {
338
- const element = node;
339
- return {
340
- id: element.getAttribute('id'),
341
- listStyleType: element.getAttribute('list-type'),
342
- };
343
- },
344
- },
345
- {
346
- tag: 'list[list-type]',
347
- node: 'ordered_list',
335
+ tag: 'list',
336
+ node: 'list',
348
337
  getAttrs: (node) => {
349
338
  const element = node;
350
339
  return {
@@ -620,11 +620,14 @@ class JATSExporter {
620
620
  0,
621
621
  ],
622
622
  blockquote_element: () => ['disp-quote', { 'content-type': 'quote' }, 0],
623
- bullet_list: (node) => {
623
+ list: (node) => {
624
624
  var _a;
625
625
  return [
626
626
  'list',
627
- { 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'bullet' },
627
+ {
628
+ 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'bullet',
629
+ type: node.attrs.type,
630
+ },
628
631
  0,
629
632
  ];
630
633
  },
@@ -781,14 +784,6 @@ class JATSExporter {
781
784
  graphic.setAttributeNS(XLINK_NAMESPACE, 'xlink:href', '');
782
785
  return graphic;
783
786
  },
784
- ordered_list: (node) => {
785
- var _a;
786
- return [
787
- 'list',
788
- { 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'order' },
789
- 0,
790
- ];
791
- },
792
787
  paragraph: (node) => {
793
788
  if (!node.childCount) {
794
789
  return '';
@@ -170,7 +170,7 @@ exports.schema = new prosemirror_model_1.Schema({
170
170
  bibliography_element: bibliography_element_1.bibliographyElement,
171
171
  bibliography_section: bibliography_section_1.bibliographySection,
172
172
  blockquote_element: blockquote_element_1.blockquoteElement,
173
- bullet_list: list_1.bulletList,
173
+ list: list_1.list,
174
174
  caption: caption_1.caption,
175
175
  caption_title: caption_title_1.captionTitle,
176
176
  citation: citation_1.citation,
@@ -202,7 +202,6 @@ exports.schema = new prosemirror_model_1.Schema({
202
202
  listing_element: listing_element_1.listingElement,
203
203
  manuscript: manuscript_1.manuscript,
204
204
  missing_figure: missing_figure_1.missingFigure,
205
- ordered_list: list_1.orderedList,
206
205
  paragraph: paragraph_1.paragraph,
207
206
  placeholder: placeholder_1.placeholder,
208
207
  placeholder_element: placeholder_element_1.placeholderElement,
@@ -15,10 +15,19 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.isListNode = exports.listItem = exports.orderedList = exports.bulletList = void 0;
18
+ exports.isListNode = exports.listItem = exports.list = exports.JATS_HTML_LIST_STYLE_MAPPING = void 0;
19
19
  const json_schema_1 = require("@manuscripts/json-schema");
20
20
  const attributes_1 = require("../../lib/attributes");
21
- exports.bulletList = {
21
+ exports.JATS_HTML_LIST_STYLE_MAPPING = {
22
+ simple: { style: 'none', type: 'ul' },
23
+ bullet: { style: 'disc', type: 'ul' },
24
+ order: { style: 'decimal', type: 'ol' },
25
+ 'alpha-lower': { style: 'lower-alpha', type: 'ol' },
26
+ 'alpha-upper': { style: 'upper-alpha', type: 'ol' },
27
+ 'roman-lower': { style: 'lower-roman', type: 'ol' },
28
+ 'roman-upper': { style: 'upper-roman', type: 'ol' },
29
+ };
30
+ exports.list = {
22
31
  content: 'list_item+',
23
32
  group: 'block list element',
24
33
  attrs: {
@@ -38,33 +47,6 @@ exports.bulletList = {
38
47
  };
39
48
  },
40
49
  },
41
- ],
42
- toDOM: (node) => {
43
- const bulletListNode = node;
44
- return bulletListNode.attrs.id
45
- ? [
46
- 'ul',
47
- {
48
- id: bulletListNode.attrs.id,
49
- 'list-type': bulletListNode.attrs.listStyleType,
50
- class: (0, attributes_1.buildElementClass)(bulletListNode.attrs),
51
- 'data-object-type': json_schema_1.ObjectTypes.ListElement,
52
- },
53
- 0,
54
- ]
55
- : ['ul', 0];
56
- },
57
- };
58
- exports.orderedList = {
59
- content: 'list_item+',
60
- group: 'block list element',
61
- attrs: {
62
- id: { default: '' },
63
- listStyleType: { default: null },
64
- paragraphStyle: { default: '' },
65
- dataTracked: { default: null },
66
- },
67
- parseDOM: [
68
50
  {
69
51
  tag: 'ol',
70
52
  getAttrs: (p) => {
@@ -77,19 +59,28 @@ exports.orderedList = {
77
59
  },
78
60
  ],
79
61
  toDOM: (node) => {
80
- const orderedListNode = node;
81
- return orderedListNode.attrs.id
62
+ const ListNode = node;
63
+ return exports.JATS_HTML_LIST_STYLE_MAPPING[ListNode.attrs.listStyleType].type === 'ul'
82
64
  ? [
83
- 'ol',
65
+ 'ul',
84
66
  {
85
- id: orderedListNode.attrs.id,
86
- 'list-type': orderedListNode.attrs.listStyleType,
87
- class: (0, attributes_1.buildElementClass)(orderedListNode.attrs),
67
+ id: ListNode.attrs.id,
68
+ 'list-type': ListNode.attrs.listStyleType,
69
+ class: (0, attributes_1.buildElementClass)(ListNode.attrs),
88
70
  'data-object-type': json_schema_1.ObjectTypes.ListElement,
89
71
  },
90
72
  0,
91
73
  ]
92
- : ['ol', 0];
74
+ : [
75
+ 'ol',
76
+ {
77
+ id: ListNode.attrs.id,
78
+ 'list-type': ListNode.attrs.listStyleType,
79
+ class: (0, attributes_1.buildElementClass)(ListNode.attrs),
80
+ 'data-object-type': json_schema_1.ObjectTypes.ListElement,
81
+ },
82
+ 0,
83
+ ];
93
84
  },
94
85
  };
95
86
  exports.listItem = {
@@ -117,19 +108,11 @@ exports.listItem = {
117
108
  if (listItemNode.attrs.placeholder) {
118
109
  attrs['data-placeholder-text'] = listItemNode.attrs.placeholder;
119
110
  }
120
- const dataTracked = listItemNode.attrs.dataTracked;
121
- if (dataTracked && dataTracked.length) {
122
- const { id, status, operation } = dataTracked[0];
123
- attrs['data-track-id'] = id;
124
- attrs['data-track-status'] = status;
125
- attrs['data-track-op'] = operation;
126
- attrs['class'] = `${status} ${operation}`;
127
- }
128
111
  return ['li', attrs, 0];
129
112
  },
130
113
  };
131
114
  const isListNode = (node) => {
132
115
  const { nodes } = node.type.schema;
133
- return node.type === nodes.bullet_list || node.type === nodes.ordered_list;
116
+ return node.type === nodes.list;
134
117
  };
135
118
  exports.isListNode = isListNode;
@@ -390,18 +390,18 @@ class Decoder {
390
390
  switch (model.elementType) {
391
391
  case 'ol':
392
392
  return this.parseContents(model.contents || '<ol></ol>', undefined, this.getComments(model), {
393
- topNode: schema_1.schema.nodes.ordered_list.create({
393
+ topNode: schema_1.schema.nodes.list.create({
394
394
  id: model._id,
395
- listStyleType: model.listStyleType,
395
+ listStyleType: model.listStyleType || 'order',
396
396
  paragraphStyle: model.paragraphStyle,
397
397
  comments: comments.map((c) => c.attrs.id),
398
398
  }),
399
399
  });
400
400
  case 'ul':
401
401
  return this.parseContents(model.contents || '<ul></ul>', undefined, this.getComments(model), {
402
- topNode: schema_1.schema.nodes.bullet_list.create({
402
+ topNode: schema_1.schema.nodes.list.create({
403
403
  id: model._id,
404
- listStyleType: model.listStyleType,
404
+ listStyleType: model.listStyleType || 'bullet',
405
405
  paragraphStyle: model.paragraphStyle,
406
406
  }),
407
407
  });
@@ -326,8 +326,8 @@ const encoders = {
326
326
  placeholderInnerHTML: node.attrs.placeholder || '',
327
327
  quoteType: 'block',
328
328
  }),
329
- bullet_list: (node) => ({
330
- elementType: 'ul',
329
+ list: (node) => ({
330
+ elementType: schema_1.JATS_HTML_LIST_STYLE_MAPPING[node.attrs.listStyleType].type,
331
331
  contents: listContents(node),
332
332
  listStyleType: node.attrs.listStyleType,
333
333
  paragraphStyle: node.attrs.paragraphStyle || undefined,
@@ -420,12 +420,6 @@ const encoders = {
420
420
  missing_figure: (node) => ({
421
421
  position: node.attrs.position || undefined,
422
422
  }),
423
- ordered_list: (node) => ({
424
- elementType: 'ol',
425
- contents: listContents(node),
426
- listStyleType: node.attrs.listStyleType,
427
- paragraphStyle: node.attrs.paragraphStyle || undefined,
428
- }),
429
423
  paragraph: (node) => ({
430
424
  elementType: 'p',
431
425
  contents: contents(node),
@@ -27,8 +27,7 @@ exports.nodeNames = new Map([
27
27
  [schema_1.schema.nodes.figure_element, 'Figure'],
28
28
  [schema_1.schema.nodes.footnote, 'Footnote'],
29
29
  [schema_1.schema.nodes.footnotes_element, 'Notes'],
30
- [schema_1.schema.nodes.bullet_list, 'Bullet List'],
31
- [schema_1.schema.nodes.ordered_list, 'Ordered List'],
30
+ [schema_1.schema.nodes.list, 'List'],
32
31
  [schema_1.schema.nodes.manuscript, 'Manuscript'],
33
32
  [schema_1.schema.nodes.paragraph, 'Paragraph'],
34
33
  [schema_1.schema.nodes.section, 'Section'],
@@ -56,8 +56,7 @@ const nodeTitle = (node) => {
56
56
  return snippetOfNodeType(node, nodes.section_title);
57
57
  case nodes.footnotes_element:
58
58
  return node.attrs.collateByKind === 'footnote' ? 'Footnotes' : 'Endnotes';
59
- case nodes.ordered_list:
60
- case nodes.bullet_list:
59
+ case nodes.list:
61
60
  case nodes.blockquote_element:
62
61
  case nodes.footnote:
63
62
  case nodes.pullquote_element:
@@ -27,7 +27,7 @@ exports.nodeTypesMap = new Map([
27
27
  [schema_1.schema.nodes.bibliography_element, json_schema_1.ObjectTypes.BibliographyElement],
28
28
  [schema_1.schema.nodes.bibliography_section, json_schema_1.ObjectTypes.Section],
29
29
  [schema_1.schema.nodes.blockquote_element, json_schema_1.ObjectTypes.QuoteElement],
30
- [schema_1.schema.nodes.bullet_list, json_schema_1.ObjectTypes.ListElement],
30
+ [schema_1.schema.nodes.list, json_schema_1.ObjectTypes.ListElement],
31
31
  [schema_1.schema.nodes.citation, json_schema_1.ObjectTypes.Citation],
32
32
  [schema_1.schema.nodes.equation, json_schema_1.ObjectTypes.Equation],
33
33
  [schema_1.schema.nodes.equation_element, json_schema_1.ObjectTypes.EquationElement],
@@ -46,7 +46,6 @@ exports.nodeTypesMap = new Map([
46
46
  [schema_1.schema.nodes.listing, json_schema_1.ObjectTypes.Listing],
47
47
  [schema_1.schema.nodes.listing_element, json_schema_1.ObjectTypes.ListingElement],
48
48
  [schema_1.schema.nodes.manuscript, json_schema_1.ObjectTypes.Manuscript],
49
- [schema_1.schema.nodes.ordered_list, json_schema_1.ObjectTypes.ListElement],
50
49
  [schema_1.schema.nodes.paragraph, json_schema_1.ObjectTypes.ParagraphElement],
51
50
  [schema_1.schema.nodes.pullquote_element, json_schema_1.ObjectTypes.QuoteElement],
52
51
  [schema_1.schema.nodes.section, json_schema_1.ObjectTypes.Section],
@@ -326,19 +326,8 @@ const nodes = [
326
326
  ignore: true,
327
327
  },
328
328
  {
329
- tag: 'list[list-type=bullet]',
330
- node: 'bullet_list',
331
- getAttrs: (node) => {
332
- const element = node;
333
- return {
334
- id: element.getAttribute('id'),
335
- listStyleType: element.getAttribute('list-type'),
336
- };
337
- },
338
- },
339
- {
340
- tag: 'list[list-type]',
341
- node: 'ordered_list',
329
+ tag: 'list',
330
+ node: 'list',
342
331
  getAttrs: (node) => {
343
332
  const element = node;
344
333
  return {
@@ -612,11 +612,14 @@ export class JATSExporter {
612
612
  0,
613
613
  ],
614
614
  blockquote_element: () => ['disp-quote', { 'content-type': 'quote' }, 0],
615
- bullet_list: (node) => {
615
+ list: (node) => {
616
616
  var _a;
617
617
  return [
618
618
  'list',
619
- { 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'bullet' },
619
+ {
620
+ 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'bullet',
621
+ type: node.attrs.type,
622
+ },
620
623
  0,
621
624
  ];
622
625
  },
@@ -773,14 +776,6 @@ export class JATSExporter {
773
776
  graphic.setAttributeNS(XLINK_NAMESPACE, 'xlink:href', '');
774
777
  return graphic;
775
778
  },
776
- ordered_list: (node) => {
777
- var _a;
778
- return [
779
- 'list',
780
- { 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'order' },
781
- 0,
782
- ];
783
- },
784
779
  paragraph: (node) => {
785
780
  if (!node.childCount) {
786
781
  return '';
@@ -54,7 +54,7 @@ import { keywordGroup } from './nodes/keyword_group';
54
54
  import { keywords } from './nodes/keywords';
55
55
  import { keywordsElement } from './nodes/keywords_element';
56
56
  import { link } from './nodes/link';
57
- import { bulletList, listItem, orderedList } from './nodes/list';
57
+ import { list, listItem } from './nodes/list';
58
58
  import { listing } from './nodes/listing';
59
59
  import { listingElement } from './nodes/listing_element';
60
60
  import { manuscript } from './nodes/manuscript';
@@ -153,7 +153,7 @@ export const schema = new Schema({
153
153
  bibliography_element: bibliographyElement,
154
154
  bibliography_section: bibliographySection,
155
155
  blockquote_element: blockquoteElement,
156
- bullet_list: bulletList,
156
+ list: list,
157
157
  caption,
158
158
  caption_title: captionTitle,
159
159
  citation,
@@ -185,7 +185,6 @@ export const schema = new Schema({
185
185
  listing_element: listingElement,
186
186
  manuscript,
187
187
  missing_figure: missingFigure,
188
- ordered_list: orderedList,
189
188
  paragraph,
190
189
  placeholder,
191
190
  placeholder_element: placeholderElement,
@@ -15,7 +15,16 @@
15
15
  */
16
16
  import { ObjectTypes } from '@manuscripts/json-schema';
17
17
  import { buildElementClass } from '../../lib/attributes';
18
- export const bulletList = {
18
+ export const JATS_HTML_LIST_STYLE_MAPPING = {
19
+ simple: { style: 'none', type: 'ul' },
20
+ bullet: { style: 'disc', type: 'ul' },
21
+ order: { style: 'decimal', type: 'ol' },
22
+ 'alpha-lower': { style: 'lower-alpha', type: 'ol' },
23
+ 'alpha-upper': { style: 'upper-alpha', type: 'ol' },
24
+ 'roman-lower': { style: 'lower-roman', type: 'ol' },
25
+ 'roman-upper': { style: 'upper-roman', type: 'ol' },
26
+ };
27
+ export const list = {
19
28
  content: 'list_item+',
20
29
  group: 'block list element',
21
30
  attrs: {
@@ -35,33 +44,6 @@ export const bulletList = {
35
44
  };
36
45
  },
37
46
  },
38
- ],
39
- toDOM: (node) => {
40
- const bulletListNode = node;
41
- return bulletListNode.attrs.id
42
- ? [
43
- 'ul',
44
- {
45
- id: bulletListNode.attrs.id,
46
- 'list-type': bulletListNode.attrs.listStyleType,
47
- class: buildElementClass(bulletListNode.attrs),
48
- 'data-object-type': ObjectTypes.ListElement,
49
- },
50
- 0,
51
- ]
52
- : ['ul', 0];
53
- },
54
- };
55
- export const orderedList = {
56
- content: 'list_item+',
57
- group: 'block list element',
58
- attrs: {
59
- id: { default: '' },
60
- listStyleType: { default: null },
61
- paragraphStyle: { default: '' },
62
- dataTracked: { default: null },
63
- },
64
- parseDOM: [
65
47
  {
66
48
  tag: 'ol',
67
49
  getAttrs: (p) => {
@@ -74,19 +56,28 @@ export const orderedList = {
74
56
  },
75
57
  ],
76
58
  toDOM: (node) => {
77
- const orderedListNode = node;
78
- return orderedListNode.attrs.id
59
+ const ListNode = node;
60
+ return JATS_HTML_LIST_STYLE_MAPPING[ListNode.attrs.listStyleType].type === 'ul'
79
61
  ? [
80
- 'ol',
62
+ 'ul',
81
63
  {
82
- id: orderedListNode.attrs.id,
83
- 'list-type': orderedListNode.attrs.listStyleType,
84
- class: buildElementClass(orderedListNode.attrs),
64
+ id: ListNode.attrs.id,
65
+ 'list-type': ListNode.attrs.listStyleType,
66
+ class: buildElementClass(ListNode.attrs),
85
67
  'data-object-type': ObjectTypes.ListElement,
86
68
  },
87
69
  0,
88
70
  ]
89
- : ['ol', 0];
71
+ : [
72
+ 'ol',
73
+ {
74
+ id: ListNode.attrs.id,
75
+ 'list-type': ListNode.attrs.listStyleType,
76
+ class: buildElementClass(ListNode.attrs),
77
+ 'data-object-type': ObjectTypes.ListElement,
78
+ },
79
+ 0,
80
+ ];
90
81
  },
91
82
  };
92
83
  export const listItem = {
@@ -114,18 +105,10 @@ export const listItem = {
114
105
  if (listItemNode.attrs.placeholder) {
115
106
  attrs['data-placeholder-text'] = listItemNode.attrs.placeholder;
116
107
  }
117
- const dataTracked = listItemNode.attrs.dataTracked;
118
- if (dataTracked && dataTracked.length) {
119
- const { id, status, operation } = dataTracked[0];
120
- attrs['data-track-id'] = id;
121
- attrs['data-track-status'] = status;
122
- attrs['data-track-op'] = operation;
123
- attrs['class'] = `${status} ${operation}`;
124
- }
125
108
  return ['li', attrs, 0];
126
109
  },
127
110
  };
128
111
  export const isListNode = (node) => {
129
112
  const { nodes } = node.type.schema;
130
- return node.type === nodes.bullet_list || node.type === nodes.ordered_list;
113
+ return node.type === nodes.list;
131
114
  };
@@ -381,18 +381,18 @@ export class Decoder {
381
381
  switch (model.elementType) {
382
382
  case 'ol':
383
383
  return this.parseContents(model.contents || '<ol></ol>', undefined, this.getComments(model), {
384
- topNode: schema.nodes.ordered_list.create({
384
+ topNode: schema.nodes.list.create({
385
385
  id: model._id,
386
- listStyleType: model.listStyleType,
386
+ listStyleType: model.listStyleType || 'order',
387
387
  paragraphStyle: model.paragraphStyle,
388
388
  comments: comments.map((c) => c.attrs.id),
389
389
  }),
390
390
  });
391
391
  case 'ul':
392
392
  return this.parseContents(model.contents || '<ul></ul>', undefined, this.getComments(model), {
393
- topNode: schema.nodes.bullet_list.create({
393
+ topNode: schema.nodes.list.create({
394
394
  id: model._id,
395
- listStyleType: model.listStyleType,
395
+ listStyleType: model.listStyleType || 'bullet',
396
396
  paragraphStyle: model.paragraphStyle,
397
397
  }),
398
398
  });
@@ -16,7 +16,7 @@
16
16
  import { DOMSerializer } from 'prosemirror-model';
17
17
  import serializeToXML from 'w3c-xmlserializer';
18
18
  import { iterateChildren } from '../lib/utils';
19
- import { hasGroup, isHighlightMarkerNode, isManuscriptNode, isSectionNode, schema, } from '../schema';
19
+ import { hasGroup, isHighlightMarkerNode, isManuscriptNode, isSectionNode, JATS_HTML_LIST_STYLE_MAPPING, schema, } from '../schema';
20
20
  import { auxiliaryObjectTypes, buildAttribution, buildElementsOrder, buildFootnotesOrder, } from './builders';
21
21
  import { extractCommentMarkers } from './highlight-markers';
22
22
  import { nodeTypesMap } from './node-types';
@@ -318,8 +318,8 @@ const encoders = {
318
318
  placeholderInnerHTML: node.attrs.placeholder || '',
319
319
  quoteType: 'block',
320
320
  }),
321
- bullet_list: (node) => ({
322
- elementType: 'ul',
321
+ list: (node) => ({
322
+ elementType: JATS_HTML_LIST_STYLE_MAPPING[node.attrs.listStyleType].type,
323
323
  contents: listContents(node),
324
324
  listStyleType: node.attrs.listStyleType,
325
325
  paragraphStyle: node.attrs.paragraphStyle || undefined,
@@ -412,12 +412,6 @@ const encoders = {
412
412
  missing_figure: (node) => ({
413
413
  position: node.attrs.position || undefined,
414
414
  }),
415
- ordered_list: (node) => ({
416
- elementType: 'ol',
417
- contents: listContents(node),
418
- listStyleType: node.attrs.listStyleType,
419
- paragraphStyle: node.attrs.paragraphStyle || undefined,
420
- }),
421
415
  paragraph: (node) => ({
422
416
  elementType: 'p',
423
417
  contents: contents(node),
@@ -24,8 +24,7 @@ export const nodeNames = new Map([
24
24
  [schema.nodes.figure_element, 'Figure'],
25
25
  [schema.nodes.footnote, 'Footnote'],
26
26
  [schema.nodes.footnotes_element, 'Notes'],
27
- [schema.nodes.bullet_list, 'Bullet List'],
28
- [schema.nodes.ordered_list, 'Ordered List'],
27
+ [schema.nodes.list, 'List'],
29
28
  [schema.nodes.manuscript, 'Manuscript'],
30
29
  [schema.nodes.paragraph, 'Paragraph'],
31
30
  [schema.nodes.section, 'Section'],
@@ -53,8 +53,7 @@ export const nodeTitle = (node) => {
53
53
  return snippetOfNodeType(node, nodes.section_title);
54
54
  case nodes.footnotes_element:
55
55
  return node.attrs.collateByKind === 'footnote' ? 'Footnotes' : 'Endnotes';
56
- case nodes.ordered_list:
57
- case nodes.bullet_list:
56
+ case nodes.list:
58
57
  case nodes.blockquote_element:
59
58
  case nodes.footnote:
60
59
  case nodes.pullquote_element:
@@ -24,7 +24,7 @@ export const nodeTypesMap = new Map([
24
24
  [schema.nodes.bibliography_element, ObjectTypes.BibliographyElement],
25
25
  [schema.nodes.bibliography_section, ObjectTypes.Section],
26
26
  [schema.nodes.blockquote_element, ObjectTypes.QuoteElement],
27
- [schema.nodes.bullet_list, ObjectTypes.ListElement],
27
+ [schema.nodes.list, ObjectTypes.ListElement],
28
28
  [schema.nodes.citation, ObjectTypes.Citation],
29
29
  [schema.nodes.equation, ObjectTypes.Equation],
30
30
  [schema.nodes.equation_element, ObjectTypes.EquationElement],
@@ -43,7 +43,6 @@ export const nodeTypesMap = new Map([
43
43
  [schema.nodes.listing, ObjectTypes.Listing],
44
44
  [schema.nodes.listing_element, ObjectTypes.ListingElement],
45
45
  [schema.nodes.manuscript, ObjectTypes.Manuscript],
46
- [schema.nodes.ordered_list, ObjectTypes.ListElement],
47
46
  [schema.nodes.paragraph, ObjectTypes.ParagraphElement],
48
47
  [schema.nodes.pullquote_element, ObjectTypes.QuoteElement],
49
48
  [schema.nodes.section, ObjectTypes.Section],
@@ -13,30 +13,28 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { ListElement } from '@manuscripts/json-schema';
16
17
  import { NodeSpec } from 'prosemirror-model';
17
- import { DataTrackedAttrs, ManuscriptNode } from '../types';
18
- export interface BulletListNode extends ManuscriptNode {
19
- attrs: {
20
- id: string;
21
- paragraphStyle: string;
22
- listStyleType: string;
18
+ import { ManuscriptNode } from '../types';
19
+ export type JatsStyleType = NonNullable<ListElement['listStyleType']>;
20
+ export declare const JATS_HTML_LIST_STYLE_MAPPING: {
21
+ [key in JatsStyleType]: {
22
+ style: string;
23
+ type: string;
23
24
  };
24
- }
25
- export declare const bulletList: NodeSpec;
26
- export interface OrderedListNode extends ManuscriptNode {
25
+ };
26
+ export interface ListNode extends ManuscriptNode {
27
27
  attrs: {
28
28
  id: string;
29
- listStyleType: string;
30
29
  paragraphStyle: string;
30
+ listStyleType: string;
31
31
  };
32
32
  }
33
- export declare const orderedList: NodeSpec;
33
+ export declare const list: NodeSpec;
34
34
  export interface ListItemNode extends ManuscriptNode {
35
35
  attrs: {
36
36
  placeholder: string;
37
- dataTracked?: DataTrackedAttrs[];
38
37
  };
39
38
  }
40
39
  export declare const listItem: NodeSpec;
41
- export type ListNode = BulletListNode | OrderedListNode;
42
40
  export declare const isListNode: (node: ManuscriptNode) => node is ListNode;
@@ -17,7 +17,7 @@ import { Fragment, Mark as ProsemirrorMark, MarkType, Node as ProsemirrorNode, N
17
17
  import { EditorState, NodeSelection, Plugin, TextSelection, Transaction } from 'prosemirror-state';
18
18
  import { EditorView, NodeView } from 'prosemirror-view';
19
19
  export type Marks = 'bold' | 'code' | 'italic' | 'smallcaps' | 'strikethrough' | 'styled' | 'subscript' | 'superscript' | 'underline' | 'tracked_insert' | 'tracked_delete';
20
- export type Nodes = 'attribution' | 'bibliography_item' | 'bibliography_element' | 'bibliography_section' | 'blockquote_element' | 'bullet_list' | 'caption' | 'caption_title' | 'comment' | 'comments' | 'citation' | 'cross_reference' | 'doc' | 'equation' | 'equation_element' | 'figcaption' | 'figure' | 'graphical_abstract_section' | 'figure_element' | 'footnote' | 'footnotes_element' | 'footnotes_section' | 'hard_break' | 'highlight_marker' | 'inline_equation' | 'inline_footnote' | 'keyword' | 'keywords_element' | 'keyword_group' | 'keywords' | 'link' | 'list_item' | 'listing' | 'listing_element' | 'manuscript' | 'abstracts' | 'body' | 'backmatter' | 'missing_figure' | 'ordered_list' | 'paragraph' | 'placeholder' | 'placeholder_element' | 'pullquote_element' | 'section' | 'section_label' | 'section_title' | 'section_title_plain' | 'table' | 'table_cell' | 'table_element' | 'table_row' | 'table_colgroup' | 'table_col' | 'table_header' | 'text' | 'toc_element' | 'toc_section' | 'affiliation' | 'contributor' | 'table_element_footer' | 'title' | 'affiliations' | 'contributors' | 'supplements' | 'supplement' | 'author_notes' | 'corresp';
20
+ export type Nodes = 'attribution' | 'bibliography_item' | 'bibliography_element' | 'bibliography_section' | 'blockquote_element' | 'list' | 'caption' | 'caption_title' | 'comment' | 'comments' | 'citation' | 'cross_reference' | 'doc' | 'equation' | 'equation_element' | 'figcaption' | 'figure' | 'graphical_abstract_section' | 'figure_element' | 'footnote' | 'footnotes_element' | 'footnotes_section' | 'hard_break' | 'highlight_marker' | 'inline_equation' | 'inline_footnote' | 'keyword' | 'keywords_element' | 'keyword_group' | 'keywords' | 'link' | 'list_item' | 'listing' | 'listing_element' | 'manuscript' | 'abstracts' | 'body' | 'backmatter' | 'missing_figure' | 'paragraph' | 'placeholder' | 'placeholder_element' | 'pullquote_element' | 'section' | 'section_label' | 'section_title' | 'section_title_plain' | 'table' | 'table_cell' | 'table_element' | 'table_row' | 'table_colgroup' | 'table_col' | 'table_header' | 'text' | 'toc_element' | 'toc_section' | 'affiliation' | 'contributor' | 'table_element_footer' | 'title' | 'affiliations' | 'contributors' | 'supplements' | 'supplement' | 'author_notes' | 'corresp';
21
21
  export type ManuscriptSchema = Schema<Nodes, Marks>;
22
22
  export type ManuscriptEditorState = EditorState;
23
23
  export type ManuscriptEditorView = EditorView;
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": "2.3.5-LEAN-3607.0",
4
+ "version": "2.3.5-LEAN-3608.3",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",