@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.
- package/dist/cjs/jats/exporter/citeproc.js +1 -1
- package/dist/cjs/jats/importer/jats-dom-parser.js +3 -0
- package/dist/cjs/schema/nodes/affiliation.js +0 -1
- package/dist/cjs/schema/nodes/contributor.js +0 -1
- package/dist/cjs/schema/nodes/list.js +0 -5
- package/dist/cjs/schema/nodes/table.js +3 -3
- package/dist/cjs/schema/nodes/table_col.js +0 -5
- package/dist/cjs/version.js +1 -1
- package/dist/es/jats/exporter/citeproc.js +1 -1
- package/dist/es/jats/importer/jats-dom-parser.js +3 -0
- package/dist/es/schema/nodes/affiliation.js +0 -1
- package/dist/es/schema/nodes/contributor.js +0 -1
- package/dist/es/schema/nodes/list.js +0 -5
- package/dist/es/schema/nodes/table.js +3 -3
- package/dist/es/schema/nodes/table_col.js +0 -5
- package/dist/es/version.js +1 -1
- package/dist/types/schema/nodes/bibliography_item.d.ts +1 -1
- package/dist/types/schema/nodes/list.d.ts +0 -1
- package/dist/types/schema/nodes/table_col.d.ts +0 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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
|
}
|
|
@@ -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), {
|
|
91
|
-
exports.tableCell = Object.assign(Object.assign({}, tableNodes.table_cell), { attrs: Object.assign(Object.assign({}, tableNodes.table_cell.attrs), {
|
|
92
|
-
exports.tableHeader = Object.assign(Object.assign({}, tableNodes.table_header), { attrs: Object.assign(Object.assign({}, tableNodes.table_header.attrs), {
|
|
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
|
};
|
package/dist/cjs/version.js
CHANGED
|
@@ -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
|
|
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
|
}
|
|
@@ -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), {
|
|
88
|
-
export const tableCell = Object.assign(Object.assign({}, tableNodes.table_cell), { attrs: Object.assign(Object.assign({}, tableNodes.table_cell.attrs), {
|
|
89
|
-
export const tableHeader = Object.assign(Object.assign({}, tableNodes.table_header), { attrs: Object.assign(Object.assign({}, tableNodes.table_header.attrs), {
|
|
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
|
};
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "3.1.
|
|
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;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.1.
|
|
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.
|
|
4
|
+
"version": "3.1.2",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|