@manuscripts/transform 3.1.1-LEAN-4533.0 → 3.1.2

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.
@@ -34,7 +34,7 @@ const initJats = () => {
34
34
  const type = getPublicationType(item);
35
35
  str = str.trim();
36
36
  if (labelOnly.test(str)) {
37
- return `<ref id="${normalizeID(id)}">${str}<mixed-citation publication-type="${type}">${item.literal}</mixed-citation></ref>`;
37
+ return `<ref id="${normalizeID(id)}">${str}<mixed-citation specific-use="unstructured-citation">${item.literal}</mixed-citation></ref>`;
38
38
  }
39
39
  else if (str.includes('mixed-citation')) {
40
40
  return `<ref id="${normalizeID(id)}">${str.replace('%%TYPE%%', type)}</ref>`;
@@ -133,6 +133,9 @@ class JATSDOMParser {
133
133
  this.getRefType = (element) => {
134
134
  const citation = element.querySelector('element-citation, mixed-citation');
135
135
  const type = citation === null || citation === void 0 ? void 0 : citation.getAttribute('publication-type');
136
+ if ((citation === null || citation === void 0 ? void 0 : citation.getAttribute('specific-use')) === 'unstructured-citation') {
137
+ return 'literal';
138
+ }
136
139
  if (!type) {
137
140
  return 'article-journal';
138
141
  }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isAffiliationNode = exports.affiliation = void 0;
4
4
  exports.affiliation = {
5
5
  content: 'inline*',
6
- atom: true,
7
6
  attrs: {
8
7
  id: { default: '' },
9
8
  institution: { default: '' },
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isContributorNode = exports.contributor = void 0;
4
4
  exports.contributor = {
5
5
  content: 'inline*',
6
- atom: true,
7
6
  attrs: {
8
7
  id: { default: '' },
9
8
  role: { default: '' },
@@ -51,7 +51,6 @@ exports.listItem = {
51
51
  defining: true,
52
52
  attrs: {
53
53
  placeholder: { default: 'List item' },
54
- id: { default: '' },
55
54
  dataTracked: { default: null },
56
55
  },
57
56
  parseDOM: [
@@ -61,7 +60,6 @@ exports.listItem = {
61
60
  const dom = p;
62
61
  return {
63
62
  placeholder: dom.getAttribute('data-placeholder-text') || '',
64
- id: dom.getAttribute('id') || '',
65
63
  };
66
64
  },
67
65
  },
@@ -72,9 +70,6 @@ exports.listItem = {
72
70
  if (listItemNode.attrs.placeholder) {
73
71
  attrs['data-placeholder-text'] = listItemNode.attrs.placeholder;
74
72
  }
75
- if (listItemNode.attrs.id) {
76
- attrs['id'] = listItemNode.attrs.id;
77
- }
78
73
  return ['li', attrs, 0];
79
74
  },
80
75
  };
@@ -87,6 +87,6 @@ exports.table = {
87
87
  ];
88
88
  },
89
89
  };
90
- exports.tableRow = Object.assign(Object.assign({}, tableNodes.table_row), { attrs: Object.assign(Object.assign({}, tableNodes.table_row.attrs), { id: { default: '' }, dataTracked: { default: null } }) });
91
- exports.tableCell = Object.assign(Object.assign({}, tableNodes.table_cell), { attrs: Object.assign(Object.assign({}, tableNodes.table_cell.attrs), { id: { default: '' }, dataTracked: { default: null } }) });
92
- exports.tableHeader = Object.assign(Object.assign({}, tableNodes.table_header), { attrs: Object.assign(Object.assign({}, tableNodes.table_header.attrs), { id: { default: '' }, dataTracked: { default: null } }) });
90
+ exports.tableRow = Object.assign(Object.assign({}, tableNodes.table_row), { attrs: Object.assign(Object.assign({}, tableNodes.table_row.attrs), { dataTracked: { default: null } }) });
91
+ exports.tableCell = Object.assign(Object.assign({}, tableNodes.table_cell), { attrs: Object.assign(Object.assign({}, tableNodes.table_cell.attrs), { dataTracked: { default: null } }) });
92
+ exports.tableHeader = Object.assign(Object.assign({}, tableNodes.table_header), { attrs: Object.assign(Object.assign({}, tableNodes.table_header.attrs), { dataTracked: { default: null } }) });
@@ -31,7 +31,6 @@ exports.tableColGroup = {
31
31
  exports.tableCol = {
32
32
  attrs: {
33
33
  width: { default: '' },
34
- id: { default: '' },
35
34
  },
36
35
  group: 'block',
37
36
  parseDOM: [
@@ -41,7 +40,6 @@ exports.tableCol = {
41
40
  const dom = p;
42
41
  return {
43
42
  width: dom.getAttribute('width'),
44
- id: dom.getAttribute('id'),
45
43
  };
46
44
  },
47
45
  },
@@ -52,9 +50,6 @@ exports.tableCol = {
52
50
  if (tableColNode.attrs.width) {
53
51
  attrs['width'] = tableColNode.attrs.width;
54
52
  }
55
- if (tableColNode.attrs.id) {
56
- attrs['id'] = tableColNode.attrs.id;
57
- }
58
53
  return ['col', attrs];
59
54
  },
60
55
  };
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "3.1.1-LEAN-4533.0";
4
+ exports.VERSION = "3.1.2";
@@ -28,7 +28,7 @@ export const initJats = () => {
28
28
  const type = getPublicationType(item);
29
29
  str = str.trim();
30
30
  if (labelOnly.test(str)) {
31
- return `<ref id="${normalizeID(id)}">${str}<mixed-citation publication-type="${type}">${item.literal}</mixed-citation></ref>`;
31
+ return `<ref id="${normalizeID(id)}">${str}<mixed-citation specific-use="unstructured-citation">${item.literal}</mixed-citation></ref>`;
32
32
  }
33
33
  else if (str.includes('mixed-citation')) {
34
34
  return `<ref id="${normalizeID(id)}">${str.replace('%%TYPE%%', type)}</ref>`;
@@ -130,6 +130,9 @@ export class JATSDOMParser {
130
130
  this.getRefType = (element) => {
131
131
  const citation = element.querySelector('element-citation, mixed-citation');
132
132
  const type = citation === null || citation === void 0 ? void 0 : citation.getAttribute('publication-type');
133
+ if ((citation === null || citation === void 0 ? void 0 : citation.getAttribute('specific-use')) === 'unstructured-citation') {
134
+ return 'literal';
135
+ }
133
136
  if (!type) {
134
137
  return 'article-journal';
135
138
  }
@@ -1,6 +1,5 @@
1
1
  export const affiliation = {
2
2
  content: 'inline*',
3
- atom: true,
4
3
  attrs: {
5
4
  id: { default: '' },
6
5
  institution: { default: '' },
@@ -1,6 +1,5 @@
1
1
  export const contributor = {
2
2
  content: 'inline*',
3
- atom: true,
4
3
  attrs: {
5
4
  id: { default: '' },
6
5
  role: { default: '' },
@@ -48,7 +48,6 @@ export const listItem = {
48
48
  defining: true,
49
49
  attrs: {
50
50
  placeholder: { default: 'List item' },
51
- id: { default: '' },
52
51
  dataTracked: { default: null },
53
52
  },
54
53
  parseDOM: [
@@ -58,7 +57,6 @@ export const listItem = {
58
57
  const dom = p;
59
58
  return {
60
59
  placeholder: dom.getAttribute('data-placeholder-text') || '',
61
- id: dom.getAttribute('id') || '',
62
60
  };
63
61
  },
64
62
  },
@@ -69,9 +67,6 @@ export const listItem = {
69
67
  if (listItemNode.attrs.placeholder) {
70
68
  attrs['data-placeholder-text'] = listItemNode.attrs.placeholder;
71
69
  }
72
- if (listItemNode.attrs.id) {
73
- attrs['id'] = listItemNode.attrs.id;
74
- }
75
70
  return ['li', attrs, 0];
76
71
  },
77
72
  };
@@ -84,6 +84,6 @@ export const table = {
84
84
  ];
85
85
  },
86
86
  };
87
- export const tableRow = Object.assign(Object.assign({}, tableNodes.table_row), { attrs: Object.assign(Object.assign({}, tableNodes.table_row.attrs), { id: { default: '' }, dataTracked: { default: null } }) });
88
- export const tableCell = Object.assign(Object.assign({}, tableNodes.table_cell), { attrs: Object.assign(Object.assign({}, tableNodes.table_cell.attrs), { id: { default: '' }, dataTracked: { default: null } }) });
89
- export const tableHeader = Object.assign(Object.assign({}, tableNodes.table_header), { attrs: Object.assign(Object.assign({}, tableNodes.table_header.attrs), { id: { default: '' }, dataTracked: { default: null } }) });
87
+ export const tableRow = Object.assign(Object.assign({}, tableNodes.table_row), { attrs: Object.assign(Object.assign({}, tableNodes.table_row.attrs), { dataTracked: { default: null } }) });
88
+ export const tableCell = Object.assign(Object.assign({}, tableNodes.table_cell), { attrs: Object.assign(Object.assign({}, tableNodes.table_cell.attrs), { dataTracked: { default: null } }) });
89
+ export const tableHeader = Object.assign(Object.assign({}, tableNodes.table_header), { attrs: Object.assign(Object.assign({}, tableNodes.table_header.attrs), { dataTracked: { default: null } }) });
@@ -28,7 +28,6 @@ export const tableColGroup = {
28
28
  export const tableCol = {
29
29
  attrs: {
30
30
  width: { default: '' },
31
- id: { default: '' },
32
31
  },
33
32
  group: 'block',
34
33
  parseDOM: [
@@ -38,7 +37,6 @@ export const tableCol = {
38
37
  const dom = p;
39
38
  return {
40
39
  width: dom.getAttribute('width'),
41
- id: dom.getAttribute('id'),
42
40
  };
43
41
  },
44
42
  },
@@ -49,9 +47,6 @@ export const tableCol = {
49
47
  if (tableColNode.attrs.width) {
50
48
  attrs['width'] = tableColNode.attrs.width;
51
49
  }
52
- if (tableColNode.attrs.id) {
53
- attrs['id'] = tableColNode.attrs.id;
54
- }
55
50
  return ['col', attrs];
56
51
  },
57
52
  };
@@ -1 +1 @@
1
- export const VERSION = "3.1.1-LEAN-4533.0";
1
+ export const VERSION = "3.1.2";
@@ -16,7 +16,7 @@
16
16
  /// <reference types="csl" />
17
17
  import { NodeSpec } from 'prosemirror-model';
18
18
  import { ManuscriptNode } from '../types';
19
- export type BibliographyItemType = 'article-journal' | 'book' | 'chapter' | 'confproc' | 'thesis' | 'webpage' | 'other' | 'standard' | 'dataset' | 'preprint';
19
+ export type BibliographyItemType = 'article-journal' | 'book' | 'chapter' | 'confproc' | 'thesis' | 'webpage' | 'other' | 'standard' | 'dataset' | 'preprint' | 'literal';
20
20
  export interface BibliographyItemAttrs {
21
21
  id: string;
22
22
  type: BibliographyItemType;
@@ -12,7 +12,6 @@ export declare const list: NodeSpec;
12
12
  export interface ListItemNode extends ManuscriptNode {
13
13
  attrs: {
14
14
  placeholder: string;
15
- id: string;
16
15
  };
17
16
  }
18
17
  export declare const listItem: NodeSpec;
@@ -18,7 +18,6 @@ import { ManuscriptNode } from '../types';
18
18
  export interface TableColNode extends ManuscriptNode {
19
19
  attrs: {
20
20
  width: string;
21
- id: string;
22
21
  };
23
22
  }
24
23
  export declare const tableColGroup: NodeSpec;
@@ -1 +1 @@
1
- export declare const VERSION = "3.1.1-LEAN-4533.0";
1
+ export declare const VERSION = "3.1.2";
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": "3.1.1-LEAN-4533.0",
4
+ "version": "3.1.2",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",