@manuscripts/transform 2.1.9-LEAN-3321 → 2.1.10

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.
@@ -338,6 +338,7 @@ const nodes = [
338
338
  const element = node;
339
339
  return {
340
340
  id: element.getAttribute('id'),
341
+ listStyleType: element.getAttribute('list-type'),
341
342
  };
342
343
  },
343
344
  },
@@ -639,7 +639,14 @@ class JATSExporter {
639
639
  0,
640
640
  ],
641
641
  blockquote_element: () => ['disp-quote', { 'content-type': 'quote' }, 0],
642
- bullet_list: () => ['list', { 'list-type': 'bullet' }, 0],
642
+ bullet_list: (node) => {
643
+ var _a;
644
+ return [
645
+ 'list',
646
+ { 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'bullet' },
647
+ 0,
648
+ ];
649
+ },
643
650
  caption: () => ['p', 0],
644
651
  caption_title: (node) => {
645
652
  if (!node.textContent) {
@@ -25,6 +25,7 @@ exports.bulletList = {
25
25
  id: { default: '' },
26
26
  paragraphStyle: { default: '' },
27
27
  dataTracked: { default: null },
28
+ listStyleType: { default: null },
28
29
  },
29
30
  parseDOM: [
30
31
  {
@@ -33,6 +34,7 @@ exports.bulletList = {
33
34
  const dom = p;
34
35
  return {
35
36
  id: dom.getAttribute('id'),
37
+ listStyleType: dom.getAttribute('list-type'),
36
38
  };
37
39
  },
38
40
  },
@@ -44,6 +46,7 @@ exports.bulletList = {
44
46
  'ul',
45
47
  {
46
48
  id: bulletListNode.attrs.id,
49
+ 'list-type': bulletListNode.attrs.listStyleType,
47
50
  class: (0, attributes_1.buildElementClass)(bulletListNode.attrs),
48
51
  'data-object-type': json_schema_1.ObjectTypes.ListElement,
49
52
  },
@@ -19,6 +19,7 @@ exports.tableCol = exports.tableColGroup = void 0;
19
19
  exports.tableColGroup = {
20
20
  content: 'table_col+',
21
21
  group: 'block',
22
+ tableRole: 'colgroup',
22
23
  parseDOM: [
23
24
  {
24
25
  tag: 'colgroup',
@@ -33,6 +34,7 @@ exports.tableCol = {
33
34
  width: { default: '' },
34
35
  },
35
36
  group: 'block',
37
+ tableRole: 'col',
36
38
  parseDOM: [
37
39
  {
38
40
  tag: 'col',
@@ -19,9 +19,8 @@ exports.tableElementFooter = void 0;
19
19
  exports.tableElementFooter = {
20
20
  attrs: {
21
21
  id: { default: '' },
22
- dataTracked: { default: null }
23
22
  },
24
- content: '(paragraph | footnotes_element)*',
23
+ content: '(paragraph | footnotes_element)+',
25
24
  group: 'block element',
26
25
  toDOM: () => ['table-wrap-foot', 0],
27
26
  };
@@ -399,6 +399,7 @@ class Decoder {
399
399
  return this.parseContents(model.contents || '<ul></ul>', undefined, this.getComments(model), {
400
400
  topNode: schema_1.schema.nodes.bullet_list.create({
401
401
  id: model._id,
402
+ listStyleType: model.listStyleType,
402
403
  paragraphStyle: model.paragraphStyle,
403
404
  }),
404
405
  });
@@ -329,6 +329,7 @@ const encoders = {
329
329
  bullet_list: (node) => ({
330
330
  elementType: 'ul',
331
331
  contents: listContents(node),
332
+ listStyleType: node.attrs.listStyleType,
332
333
  paragraphStyle: node.attrs.paragraphStyle || undefined,
333
334
  }),
334
335
  listing: (node) => ({
@@ -332,6 +332,7 @@ const nodes = [
332
332
  const element = node;
333
333
  return {
334
334
  id: element.getAttribute('id'),
335
+ listStyleType: element.getAttribute('list-type'),
335
336
  };
336
337
  },
337
338
  },
@@ -631,7 +631,14 @@ export class JATSExporter {
631
631
  0,
632
632
  ],
633
633
  blockquote_element: () => ['disp-quote', { 'content-type': 'quote' }, 0],
634
- bullet_list: () => ['list', { 'list-type': 'bullet' }, 0],
634
+ bullet_list: (node) => {
635
+ var _a;
636
+ return [
637
+ 'list',
638
+ { 'list-type': (_a = node.attrs.listStyleType) !== null && _a !== void 0 ? _a : 'bullet' },
639
+ 0,
640
+ ];
641
+ },
635
642
  caption: () => ['p', 0],
636
643
  caption_title: (node) => {
637
644
  if (!node.textContent) {
@@ -22,6 +22,7 @@ export const bulletList = {
22
22
  id: { default: '' },
23
23
  paragraphStyle: { default: '' },
24
24
  dataTracked: { default: null },
25
+ listStyleType: { default: null },
25
26
  },
26
27
  parseDOM: [
27
28
  {
@@ -30,6 +31,7 @@ export const bulletList = {
30
31
  const dom = p;
31
32
  return {
32
33
  id: dom.getAttribute('id'),
34
+ listStyleType: dom.getAttribute('list-type'),
33
35
  };
34
36
  },
35
37
  },
@@ -41,6 +43,7 @@ export const bulletList = {
41
43
  'ul',
42
44
  {
43
45
  id: bulletListNode.attrs.id,
46
+ 'list-type': bulletListNode.attrs.listStyleType,
44
47
  class: buildElementClass(bulletListNode.attrs),
45
48
  'data-object-type': ObjectTypes.ListElement,
46
49
  },
@@ -16,6 +16,7 @@
16
16
  export const tableColGroup = {
17
17
  content: 'table_col+',
18
18
  group: 'block',
19
+ tableRole: 'colgroup',
19
20
  parseDOM: [
20
21
  {
21
22
  tag: 'colgroup',
@@ -30,6 +31,7 @@ export const tableCol = {
30
31
  width: { default: '' },
31
32
  },
32
33
  group: 'block',
34
+ tableRole: 'col',
33
35
  parseDOM: [
34
36
  {
35
37
  tag: 'col',
@@ -16,9 +16,8 @@
16
16
  export const tableElementFooter = {
17
17
  attrs: {
18
18
  id: { default: '' },
19
- dataTracked: { default: null }
20
19
  },
21
- content: '(paragraph | footnotes_element)*',
20
+ content: '(paragraph | footnotes_element)+',
22
21
  group: 'block element',
23
22
  toDOM: () => ['table-wrap-foot', 0],
24
23
  };
@@ -390,6 +390,7 @@ export class Decoder {
390
390
  return this.parseContents(model.contents || '<ul></ul>', undefined, this.getComments(model), {
391
391
  topNode: schema.nodes.bullet_list.create({
392
392
  id: model._id,
393
+ listStyleType: model.listStyleType,
393
394
  paragraphStyle: model.paragraphStyle,
394
395
  }),
395
396
  });
@@ -321,6 +321,7 @@ const encoders = {
321
321
  bullet_list: (node) => ({
322
322
  elementType: 'ul',
323
323
  contents: listContents(node),
324
+ listStyleType: node.attrs.listStyleType,
324
325
  paragraphStyle: node.attrs.paragraphStyle || undefined,
325
326
  }),
326
327
  listing: (node) => ({
@@ -19,6 +19,7 @@ export interface BulletListNode extends ManuscriptNode {
19
19
  attrs: {
20
20
  id: string;
21
21
  paragraphStyle: string;
22
+ listStyleType: string;
22
23
  };
23
24
  }
24
25
  export declare const bulletList: NodeSpec;
@@ -13,12 +13,12 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { NodeSpec } from 'prosemirror-model';
17
- import { ManuscriptNode } from '../types';
16
+ import { ManuscriptNode, TableNodeSpec } from '../types';
17
+ export type TableColGroupNode = ManuscriptNode;
18
18
  export interface TableColNode extends ManuscriptNode {
19
19
  attrs: {
20
20
  width: string;
21
21
  };
22
22
  }
23
- export declare const tableColGroup: NodeSpec;
24
- export declare const tableCol: NodeSpec;
23
+ export declare const tableColGroup: TableNodeSpec;
24
+ export declare const tableCol: TableNodeSpec;
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.1.9-LEAN-3321",
4
+ "version": "2.1.10",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -29,8 +29,8 @@
29
29
  "version": "yarn build"
30
30
  },
31
31
  "dependencies": {
32
- "@manuscripts/json-schema": "^2.2.6",
33
- "@manuscripts/library": "^1.3.5",
32
+ "@manuscripts/json-schema": "^2.2.7",
33
+ "@manuscripts/library": "^1.3.6",
34
34
  "debug": "^4.3.4",
35
35
  "jszip": "^3.10.1",
36
36
  "mime": "^3.0.0",