@manuscripts/transform 4.3.21 → 4.3.23
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/README.md +2 -2
- package/dist/cjs/jats/__tests__/jats-exporter.test.js +11 -45
- package/dist/cjs/jats/__tests__/jats-importer.test.js +54 -76
- package/dist/cjs/jats/__tests__/jats-roundtrip.test.js +1 -2
- package/dist/cjs/jats/__tests__/utils.js +4 -17
- package/dist/cjs/jats/exporter/jats-exporter.js +190 -271
- package/dist/cjs/jats/importer/jats-dom-parser.js +16 -42
- package/dist/cjs/jats/importer/jats-parser-utils.js +5 -29
- package/dist/cjs/jats/importer/parse-jats-article.js +1 -6
- package/dist/cjs/schema/__tests__/docs.js +1830 -0
- package/dist/cjs/schema/__tests__/migration.test.js +3 -37
- package/dist/cjs/schema/migration/migration-scripts/4.3.12.js +39 -0
- package/dist/cjs/schema/migration/migration-scripts/index.js +2 -0
- package/dist/cjs/schema/nodes/blockquote_element.js +0 -2
- package/dist/cjs/schema/nodes/comment.js +2 -1
- package/dist/cjs/schema/nodes/contributor.js +11 -11
- package/dist/cjs/schema/nodes/equation.js +1 -3
- package/dist/cjs/schema/nodes/list.js +0 -2
- package/dist/cjs/schema/nodes/listing.js +1 -3
- package/dist/cjs/schema/nodes/paragraph.js +0 -2
- package/dist/cjs/schema/nodes/pullquote_element.js +0 -2
- package/dist/cjs/transformer/id.js +2 -14
- package/dist/cjs/transformer/node-names.js +6 -1
- package/dist/cjs/transformer/node-types.js +1 -47
- package/dist/cjs/version.js +1 -1
- package/dist/es/jats/__tests__/jats-exporter.test.js +11 -45
- package/dist/es/jats/__tests__/jats-importer.test.js +54 -76
- package/dist/es/jats/__tests__/jats-roundtrip.test.js +1 -2
- package/dist/es/jats/__tests__/utils.js +4 -17
- package/dist/es/jats/exporter/jats-exporter.js +190 -271
- package/dist/es/jats/importer/jats-dom-parser.js +16 -42
- package/dist/es/jats/importer/jats-parser-utils.js +6 -30
- package/dist/es/jats/importer/parse-jats-article.js +1 -6
- package/dist/es/schema/__tests__/docs.js +1827 -0
- package/dist/es/schema/__tests__/migration.test.js +3 -4
- package/dist/es/schema/migration/migration-scripts/4.3.12.js +37 -0
- package/dist/es/schema/migration/migration-scripts/index.js +2 -0
- package/dist/es/schema/nodes/blockquote_element.js +0 -2
- package/dist/es/schema/nodes/comment.js +2 -1
- package/dist/es/schema/nodes/contributor.js +11 -11
- package/dist/es/schema/nodes/equation.js +1 -3
- package/dist/es/schema/nodes/list.js +0 -2
- package/dist/es/schema/nodes/listing.js +1 -3
- package/dist/es/schema/nodes/paragraph.js +0 -2
- package/dist/es/schema/nodes/pullquote_element.js +0 -2
- package/dist/es/transformer/id.js +2 -14
- package/dist/es/transformer/node-names.js +4 -0
- package/dist/es/transformer/node-types.js +1 -47
- package/dist/es/version.js +1 -1
- package/dist/types/jats/__tests__/utils.d.ts +1 -11
- package/dist/types/jats/exporter/jats-exporter.d.ts +5 -10
- package/dist/types/jats/importer/jats-dom-parser.d.ts +0 -15
- package/dist/types/jats/importer/parse-jats-article.d.ts +1 -11
- package/dist/types/schema/__tests__/docs.d.ts +2 -0
- package/dist/types/schema/migration/migration-scripts/4.3.12.d.ts +8 -0
- package/dist/types/schema/migration/migration-scripts/index.d.ts +2 -1
- package/dist/types/schema/nodes/comment.d.ts +2 -2
- package/dist/types/schema/nodes/contributor.d.ts +11 -21
- package/dist/types/schema/types.d.ts +22 -0
- package/dist/types/transformer/node-names.d.ts +1 -0
- package/dist/types/transformer/node-types.d.ts +0 -2
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/dist/cjs/jats/importer/jats-journal-meta-parser.js +0 -103
- package/dist/cjs/lib/styled-content.js +0 -28
- package/dist/es/jats/importer/jats-journal-meta-parser.js +0 -95
- package/dist/es/lib/styled-content.js +0 -23
- package/dist/types/jats/importer/jats-journal-meta-parser.d.ts +0 -46
- package/dist/types/lib/styled-content.d.ts +0 -22
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as prevPackage from 'migration-base';
|
|
2
1
|
import { migrateFor } from '../migration/migrate';
|
|
2
|
+
import { v2_3_20 } from './docs';
|
|
3
3
|
describe('Prosemirror migration schema', () => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
expect(() => migrateFor(oldDoc, prevPackage.getVersion())).not.toThrow();
|
|
4
|
+
test('Migrating doc from version 2.3.20 to the current', () => {
|
|
5
|
+
expect(() => migrateFor(v2_3_20, '2.3.20')).not.toThrow();
|
|
7
6
|
});
|
|
8
7
|
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
class Migration4312 {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.fromVersion = '4.3.11';
|
|
4
|
+
this.toVersion = '4.3.12';
|
|
5
|
+
}
|
|
6
|
+
migrateNode(node) {
|
|
7
|
+
if (node.type === 'contributor') {
|
|
8
|
+
if (node.attrs.affiliations) {
|
|
9
|
+
node.attrs.affiliationIDs = node.attrs.affiliations;
|
|
10
|
+
delete node.attrs.affiliations;
|
|
11
|
+
}
|
|
12
|
+
if (Array.isArray(node.attrs.corresp)) {
|
|
13
|
+
node.attrs.correspIDs = node.attrs.corresp.map((c) => c.correspID);
|
|
14
|
+
delete node.attrs.corresp;
|
|
15
|
+
}
|
|
16
|
+
if (Array.isArray(node.attrs.footnote)) {
|
|
17
|
+
node.attrs.footnoteIDs = node.attrs.footnote.map((f) => f.noteID);
|
|
18
|
+
delete node.attrs.footnote;
|
|
19
|
+
}
|
|
20
|
+
node.attrs.given = node.attrs.bibliographicName.given;
|
|
21
|
+
node.attrs.family = node.attrs.bibliographicName.family;
|
|
22
|
+
node.attrs.suffix = node.attrs.bibliographicName.suffix;
|
|
23
|
+
node.attrs.ORCID = node.attrs.ORCIDIdentifier;
|
|
24
|
+
delete node.attrs.bibliographicName;
|
|
25
|
+
delete node.attrs.userID;
|
|
26
|
+
delete node.attrs.ORCIDIdentifier;
|
|
27
|
+
}
|
|
28
|
+
if (node.type === 'comment') {
|
|
29
|
+
const contribution = node.attrs.contributions[0];
|
|
30
|
+
node.attrs.userID = contribution.profileID;
|
|
31
|
+
node.attrs.timestamp = contribution.timestamp;
|
|
32
|
+
delete node.attrs.contributions;
|
|
33
|
+
}
|
|
34
|
+
return node;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export default Migration4312;
|
|
@@ -24,6 +24,7 @@ import Migration3055 from './3.0.55';
|
|
|
24
24
|
import Migration3056 from './3.0.56';
|
|
25
25
|
import Migration4213 from './4.2.13';
|
|
26
26
|
import Migration4215 from './4.2.15';
|
|
27
|
+
import Migration4312 from './4.3.12';
|
|
27
28
|
const migrations = [
|
|
28
29
|
new Migration125(),
|
|
29
30
|
new Migration2322(),
|
|
@@ -36,5 +37,6 @@ const migrations = [
|
|
|
36
37
|
new Migration3056(),
|
|
37
38
|
new Migration4213(),
|
|
38
39
|
new Migration4215(),
|
|
40
|
+
new Migration4312(),
|
|
39
41
|
];
|
|
40
42
|
export default migrations;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
17
16
|
export const blockquoteElement = {
|
|
18
17
|
content: 'paragraph+ attribution',
|
|
19
18
|
attrs: {
|
|
@@ -45,7 +44,6 @@ export const blockquoteElement = {
|
|
|
45
44
|
if (blockquoteElementNode.attrs.id) {
|
|
46
45
|
attrs.id = blockquoteElementNode.attrs.id;
|
|
47
46
|
}
|
|
48
|
-
attrs['data-object-type'] = ObjectTypes.QuoteElement;
|
|
49
47
|
if (blockquoteElementNode.attrs.placeholder) {
|
|
50
48
|
attrs['data-placeholder-text'] = blockquoteElementNode.attrs.placeholder;
|
|
51
49
|
}
|
|
@@ -20,7 +20,8 @@ export const comment = {
|
|
|
20
20
|
target: { default: '' },
|
|
21
21
|
selector: { default: undefined },
|
|
22
22
|
resolved: { default: false },
|
|
23
|
-
|
|
23
|
+
userID: { default: '' },
|
|
24
|
+
timestamp: { default: 0 },
|
|
24
25
|
originalText: { default: '' },
|
|
25
26
|
},
|
|
26
27
|
};
|
|
@@ -4,21 +4,21 @@ export const contributor = {
|
|
|
4
4
|
attrs: {
|
|
5
5
|
id: { default: '' },
|
|
6
6
|
role: { default: '' },
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
correspIDs: { default: [] },
|
|
8
|
+
affiliationIDs: { default: [] },
|
|
9
|
+
footnoteIDs: { default: [] },
|
|
10
|
+
given: { default: undefined },
|
|
11
|
+
family: { default: undefined },
|
|
12
|
+
prefix: { default: undefined },
|
|
13
|
+
suffix: { default: undefined },
|
|
14
|
+
email: { default: undefined },
|
|
15
|
+
ORCID: { default: undefined },
|
|
16
|
+
isCorresponding: { default: false },
|
|
17
|
+
isJointContributor: { default: false },
|
|
17
18
|
priority: { default: undefined },
|
|
18
19
|
creditRoles: { default: [] },
|
|
19
20
|
dataTracked: { default: null },
|
|
20
21
|
contents: { default: '' },
|
|
21
|
-
prefix: { default: '' },
|
|
22
22
|
},
|
|
23
23
|
group: 'block',
|
|
24
24
|
toDOM: (node) => {
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
17
16
|
export const equation = {
|
|
18
17
|
attrs: {
|
|
19
18
|
id: { default: '' },
|
|
@@ -24,7 +23,7 @@ export const equation = {
|
|
|
24
23
|
group: 'block',
|
|
25
24
|
parseDOM: [
|
|
26
25
|
{
|
|
27
|
-
tag: `div
|
|
26
|
+
tag: `div.MPEquation`,
|
|
28
27
|
getAttrs: (p) => {
|
|
29
28
|
const htmlEl = p;
|
|
30
29
|
return {
|
|
@@ -39,7 +38,6 @@ export const equation = {
|
|
|
39
38
|
const equationNode = node;
|
|
40
39
|
const { id, contents, format } = equationNode.attrs;
|
|
41
40
|
const dom = document.createElement('div');
|
|
42
|
-
dom.classList.add(ObjectTypes.Equation);
|
|
43
41
|
dom.setAttribute('id', id);
|
|
44
42
|
if (format) {
|
|
45
43
|
dom.setAttribute('data-equation-format', format);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
2
1
|
export const list = {
|
|
3
2
|
content: 'list_item+',
|
|
4
3
|
group: 'block list element',
|
|
@@ -36,7 +35,6 @@ export const list = {
|
|
|
36
35
|
{
|
|
37
36
|
id: list.attrs.id,
|
|
38
37
|
'list-type': list.attrs.listStyleType,
|
|
39
|
-
'data-object-type': ObjectTypes.ListElement,
|
|
40
38
|
},
|
|
41
39
|
0,
|
|
42
40
|
];
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
17
16
|
export const listing = {
|
|
18
17
|
attrs: {
|
|
19
18
|
id: { default: '' },
|
|
@@ -29,7 +28,7 @@ export const listing = {
|
|
|
29
28
|
group: 'block',
|
|
30
29
|
parseDOM: [
|
|
31
30
|
{
|
|
32
|
-
tag:
|
|
31
|
+
tag: 'pre.MPListing',
|
|
33
32
|
preserveWhitespace: 'full',
|
|
34
33
|
getAttrs: (p) => {
|
|
35
34
|
const node = p;
|
|
@@ -58,7 +57,6 @@ export const listing = {
|
|
|
58
57
|
const listingNode = node;
|
|
59
58
|
const dom = document.createElement('div');
|
|
60
59
|
dom.setAttribute('id', listingNode.attrs.id);
|
|
61
|
-
dom.classList.add(ObjectTypes.Listing);
|
|
62
60
|
dom.setAttribute('data-language', listingNode.attrs.language);
|
|
63
61
|
dom.setAttribute('data-languageKey', listingNode.attrs.languageKey);
|
|
64
62
|
dom.textContent = listingNode.attrs.contents;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
17
16
|
export const paragraph = {
|
|
18
17
|
content: 'inline*',
|
|
19
18
|
attrs: {
|
|
@@ -45,7 +44,6 @@ export const paragraph = {
|
|
|
45
44
|
if (paragraphNode.attrs.id) {
|
|
46
45
|
attrs.id = paragraphNode.attrs.id;
|
|
47
46
|
}
|
|
48
|
-
attrs['data-object-type'] = ObjectTypes.ParagraphElement;
|
|
49
47
|
if (paragraphNode.attrs.placeholder) {
|
|
50
48
|
attrs['data-placeholder-text'] = paragraphNode.attrs.placeholder;
|
|
51
49
|
}
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
17
16
|
export const pullquoteElement = {
|
|
18
17
|
content: 'quote_image? paragraph+ attribution',
|
|
19
18
|
attrs: {
|
|
@@ -46,7 +45,6 @@ export const pullquoteElement = {
|
|
|
46
45
|
attrs.id = pullquoteElementNode.attrs.id;
|
|
47
46
|
}
|
|
48
47
|
attrs.class = 'pullquote';
|
|
49
|
-
attrs['data-object-type'] = ObjectTypes.QuoteElement;
|
|
50
48
|
if (pullquoteElementNode.attrs.placeholder) {
|
|
51
49
|
attrs['data-placeholder-text'] = pullquoteElementNode.attrs.placeholder;
|
|
52
50
|
}
|
|
@@ -14,17 +14,5 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { v4 as uuid } from 'uuid';
|
|
17
|
-
import {
|
|
18
|
-
export const generateNodeID = (type) => {
|
|
19
|
-
const uniqueID = ':' + uuid().toUpperCase();
|
|
20
|
-
let name = nodeTypesMap.get(type);
|
|
21
|
-
if (name === undefined) {
|
|
22
|
-
name =
|
|
23
|
-
'MP' +
|
|
24
|
-
type.name
|
|
25
|
-
.split('_')
|
|
26
|
-
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
27
|
-
.join('');
|
|
28
|
-
}
|
|
29
|
-
return name + uniqueID;
|
|
30
|
-
};
|
|
17
|
+
import { typeName } from './node-names';
|
|
18
|
+
export const generateNodeID = (type) => `MP${typeName(type)}:${uuid()}`;
|
|
@@ -62,3 +62,7 @@ export const nodeNames = new Map([
|
|
|
62
62
|
[schema.nodes.supplements, 'Supplements'],
|
|
63
63
|
[schema.nodes.attachments, 'Main Document'],
|
|
64
64
|
]);
|
|
65
|
+
export const typeName = (type) => type.name
|
|
66
|
+
.split('_')
|
|
67
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
68
|
+
.join('');
|
|
@@ -13,53 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import { GROUP_ELEMENT, GROUP_EXECUTABLE, GROUP_SECTION, hasGroup, schema, } from '../schema';
|
|
18
|
-
export const nodeTypesMap = new Map([
|
|
19
|
-
[schema.nodes.abstracts, ObjectTypes.Section],
|
|
20
|
-
[schema.nodes.body, ObjectTypes.Section],
|
|
21
|
-
[schema.nodes.backmatter, ObjectTypes.Section],
|
|
22
|
-
[schema.nodes.comment, ObjectTypes.CommentAnnotation],
|
|
23
|
-
[schema.nodes.bibliography_item, ObjectTypes.BibliographyItem],
|
|
24
|
-
[schema.nodes.bibliography_element, ObjectTypes.BibliographyElement],
|
|
25
|
-
[schema.nodes.bibliography_section, ObjectTypes.Section],
|
|
26
|
-
[schema.nodes.blockquote_element, ObjectTypes.QuoteElement],
|
|
27
|
-
[schema.nodes.list, ObjectTypes.ListElement],
|
|
28
|
-
[schema.nodes.citation, ObjectTypes.Citation],
|
|
29
|
-
[schema.nodes.equation, ObjectTypes.Equation],
|
|
30
|
-
[schema.nodes.equation_element, ObjectTypes.EquationElement],
|
|
31
|
-
[schema.nodes.figure, ObjectTypes.Figure],
|
|
32
|
-
[schema.nodes.missing_figure, ObjectTypes.MissingFigure],
|
|
33
|
-
[schema.nodes.figure_element, ObjectTypes.FigureElement],
|
|
34
|
-
[schema.nodes.footnote, ObjectTypes.Footnote],
|
|
35
|
-
[schema.nodes.footnotes_element, ObjectTypes.FootnotesElement],
|
|
36
|
-
[schema.nodes.footnotes_section, ObjectTypes.Section],
|
|
37
|
-
[schema.nodes.graphical_abstract_section, ObjectTypes.Section],
|
|
38
|
-
[schema.nodes.trans_graphical_abstract, ObjectTypes.Section],
|
|
39
|
-
[schema.nodes.highlight_marker, ObjectTypes.HighlightMarker],
|
|
40
|
-
[schema.nodes.keyword, ObjectTypes.Keyword],
|
|
41
|
-
[schema.nodes.keywords_element, ObjectTypes.KeywordsElement],
|
|
42
|
-
[schema.nodes.keywords, ObjectTypes.Section],
|
|
43
|
-
[schema.nodes.keyword_group, ObjectTypes.KeywordGroup],
|
|
44
|
-
[schema.nodes.listing, ObjectTypes.Listing],
|
|
45
|
-
[schema.nodes.listing_element, ObjectTypes.ListingElement],
|
|
46
|
-
[schema.nodes.manuscript, ObjectTypes.Manuscript],
|
|
47
|
-
[schema.nodes.paragraph, ObjectTypes.ParagraphElement],
|
|
48
|
-
[schema.nodes.pullquote_element, ObjectTypes.QuoteElement],
|
|
49
|
-
[schema.nodes.section, ObjectTypes.Section],
|
|
50
|
-
[schema.nodes.table, ObjectTypes.Table],
|
|
51
|
-
[schema.nodes.table_element, ObjectTypes.TableElement],
|
|
52
|
-
[schema.nodes.affiliation, ObjectTypes.Affiliation],
|
|
53
|
-
[schema.nodes.contributor, ObjectTypes.Contributor],
|
|
54
|
-
[schema.nodes.table_element_footer, ObjectTypes.TableElementFooter],
|
|
55
|
-
[schema.nodes.contributors, ObjectTypes.Section],
|
|
56
|
-
[schema.nodes.affiliations, ObjectTypes.Section],
|
|
57
|
-
[schema.nodes.title, ObjectTypes.Titles],
|
|
58
|
-
[schema.nodes.supplement, ObjectTypes.Supplement],
|
|
59
|
-
[schema.nodes.author_notes, ObjectTypes.AuthorNotes],
|
|
60
|
-
[schema.nodes.corresp, ObjectTypes.Corresponding],
|
|
61
|
-
[schema.nodes.box_element, ObjectTypes.Section],
|
|
62
|
-
]);
|
|
16
|
+
import { GROUP_ELEMENT, GROUP_EXECUTABLE, GROUP_SECTION, hasGroup, } from '../schema';
|
|
63
17
|
export const isExecutableNodeType = (type) => hasGroup(type, GROUP_EXECUTABLE);
|
|
64
18
|
export const isElementNodeType = (type) => hasGroup(type, GROUP_ELEMENT);
|
|
65
19
|
export const isSectionNodeType = (type) => hasGroup(type, GROUP_SECTION);
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "4.3.
|
|
1
|
+
export const VERSION = "4.3.23";
|
|
@@ -15,17 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Node, NodeType } from 'prosemirror-model';
|
|
17
17
|
import { ManuscriptNode } from '../../schema';
|
|
18
|
-
export declare const createNodeFromJATS: (fileName: string) => Promise<
|
|
19
|
-
node: import("../../schema").ActualManuscriptNode;
|
|
20
|
-
journal: {
|
|
21
|
-
objectType: import("@manuscripts/json-schema").ObjectTypes;
|
|
22
|
-
abbreviatedTitles: import("../importer/jats-journal-meta-parser").AbbreviatedTitle[];
|
|
23
|
-
journalIdentifiers: import("../importer/jats-journal-meta-parser").JournalIdentifier[];
|
|
24
|
-
ISSNs: import("../importer/jats-journal-meta-parser").ISSN[];
|
|
25
|
-
publisherName: string | undefined;
|
|
26
|
-
title: string | undefined;
|
|
27
|
-
} | undefined;
|
|
28
|
-
}>;
|
|
18
|
+
export declare const createNodeFromJATS: (fileName: string) => Promise<import("../../schema").ActualManuscriptNode>;
|
|
29
19
|
export declare const changeIDs: (node: ManuscriptNode) => void;
|
|
30
20
|
export declare const findNodesByType: (node: Node, type: NodeType, descend?: boolean) => Node[];
|
|
31
21
|
export declare const findNodeByType: (node: Node, type: NodeType, descend?: boolean) => Node;
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import { type NodeType, DOMSerializer } from 'prosemirror-model';
|
|
16
|
+
import { DOMSerializer, type NodeType } from 'prosemirror-model';
|
|
18
17
|
import { ManuscriptNode } from '../../schema';
|
|
19
18
|
import { IDGenerator } from '../types';
|
|
20
19
|
import { Version } from './jats-versions';
|
|
@@ -28,7 +27,6 @@ export type CSLOptions = {
|
|
|
28
27
|
};
|
|
29
28
|
export type ExportOptions = {
|
|
30
29
|
version?: Version;
|
|
31
|
-
journal?: Journal;
|
|
32
30
|
csl: CSLOptions;
|
|
33
31
|
};
|
|
34
32
|
export declare class JATSExporter {
|
|
@@ -49,7 +47,7 @@ export declare class JATSExporter {
|
|
|
49
47
|
private nodeFromJATS;
|
|
50
48
|
protected rewriteIDs: (generator?: IDGenerator) => Promise<void>;
|
|
51
49
|
protected setTitleContent: (element: HTMLElement, title: string) => void;
|
|
52
|
-
protected buildFront: (
|
|
50
|
+
protected buildFront: () => HTMLElement;
|
|
53
51
|
protected buildDateElement: (timestamp: number, type: string) => HTMLElement;
|
|
54
52
|
protected buildCountingElement: (tagName: string, count: number | undefined) => HTMLElement | undefined;
|
|
55
53
|
protected buildBody: () => HTMLElement;
|
|
@@ -59,15 +57,12 @@ export declare class JATSExporter {
|
|
|
59
57
|
protected createSerializer: () => void;
|
|
60
58
|
private createEquation;
|
|
61
59
|
protected serializeNode: (node: ManuscriptNode) => Node;
|
|
62
|
-
private validateContributor;
|
|
63
60
|
private buildContributors;
|
|
64
61
|
private buildContributorName;
|
|
65
62
|
private createAuthorNotesElement;
|
|
66
|
-
private
|
|
67
|
-
private
|
|
68
|
-
private
|
|
69
|
-
private appendParagraphToElement;
|
|
70
|
-
private appendFootnoteToElement;
|
|
63
|
+
private writeCorresp;
|
|
64
|
+
private writeParagraph;
|
|
65
|
+
private writeFootnote;
|
|
71
66
|
private buildKeywords;
|
|
72
67
|
private fixBody;
|
|
73
68
|
private changeTag;
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2020 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
1
|
import { ParseOptions, Schema } from 'prosemirror-model';
|
|
17
2
|
import { SectionCategory } from '../../schema';
|
|
18
3
|
export declare class JATSDOMParser {
|
|
@@ -14,14 +14,4 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { ActualManuscriptNode, SectionCategory } from '../../schema';
|
|
17
|
-
export declare const parseJATSArticle: (doc: Document, sectionCategories: SectionCategory[], template?: string) =>
|
|
18
|
-
node: ActualManuscriptNode;
|
|
19
|
-
journal: {
|
|
20
|
-
objectType: import("@manuscripts/json-schema").ObjectTypes;
|
|
21
|
-
abbreviatedTitles: import("./jats-journal-meta-parser").AbbreviatedTitle[];
|
|
22
|
-
journalIdentifiers: import("./jats-journal-meta-parser").JournalIdentifier[];
|
|
23
|
-
ISSNs: import("./jats-journal-meta-parser").ISSN[];
|
|
24
|
-
publisherName: string | undefined;
|
|
25
|
-
title: string | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
};
|
|
17
|
+
export declare const parseJATSArticle: (doc: Document, sectionCategories: SectionCategory[], template?: string) => ActualManuscriptNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JSONProsemirrorNode } from '../../../types';
|
|
2
|
+
import { MigrationScript } from '../migration-script';
|
|
3
|
+
declare class Migration4312 implements MigrationScript {
|
|
4
|
+
fromVersion: string;
|
|
5
|
+
toVersion: string;
|
|
6
|
+
migrateNode(node: JSONProsemirrorNode): JSONProsemirrorNode;
|
|
7
|
+
}
|
|
8
|
+
export default Migration4312;
|
|
@@ -24,5 +24,6 @@ import Migration3055 from './3.0.55';
|
|
|
24
24
|
import Migration3056 from './3.0.56';
|
|
25
25
|
import Migration4213 from './4.2.13';
|
|
26
26
|
import Migration4215 from './4.2.15';
|
|
27
|
-
|
|
27
|
+
import Migration4312 from './4.3.12';
|
|
28
|
+
declare const migrations: (Migration125 | Migration2322 | Migration3012 | Migration3021 | Migration3030 | Migration3031 | Migration3041 | Migration3055 | Migration3056 | Migration4213 | Migration4215 | Migration4312)[];
|
|
28
29
|
export default migrations;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Contribution } from '@manuscripts/json-schema';
|
|
17
16
|
import { NodeSpec } from 'prosemirror-model';
|
|
18
17
|
import { ManuscriptNode } from '../types';
|
|
19
18
|
export interface CommentAttrs {
|
|
@@ -25,7 +24,8 @@ export interface CommentAttrs {
|
|
|
25
24
|
to: number;
|
|
26
25
|
};
|
|
27
26
|
resolved?: boolean;
|
|
28
|
-
|
|
27
|
+
userID: string;
|
|
28
|
+
timestamp: number;
|
|
29
29
|
originalText?: string;
|
|
30
30
|
}
|
|
31
31
|
export interface CommentNode extends ManuscriptNode {
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
import { BibliographicName } from '@manuscripts/json-schema';
|
|
2
1
|
import { NodeSpec } from 'prosemirror-model';
|
|
3
2
|
import { CreditVocabTerm } from '../../lib/credit-roles';
|
|
4
3
|
import { ManuscriptNode } from '../types';
|
|
5
|
-
export type ContributorCorresp = {
|
|
6
|
-
correspID: string;
|
|
7
|
-
correspLabel: string;
|
|
8
|
-
};
|
|
9
|
-
export type ContributorFootnote = {
|
|
10
|
-
noteID: string;
|
|
11
|
-
noteLabel: string;
|
|
12
|
-
};
|
|
13
4
|
export type CreditRole = {
|
|
14
5
|
vocabTerm: CreditVocabTerm;
|
|
15
6
|
};
|
|
16
|
-
interface
|
|
7
|
+
export interface ContributorAttrs {
|
|
17
8
|
id: string;
|
|
18
9
|
role: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
correspIDs: string[];
|
|
11
|
+
affiliationIDs: string[];
|
|
12
|
+
footnoteIDs: string[];
|
|
13
|
+
given?: string;
|
|
14
|
+
family?: string;
|
|
15
|
+
prefix?: string;
|
|
16
|
+
suffix?: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
ORCID?: string;
|
|
25
19
|
isCorresponding: boolean;
|
|
26
|
-
ORCIDIdentifier: string;
|
|
27
20
|
priority: number;
|
|
28
21
|
isJointContributor: boolean;
|
|
29
|
-
footnote: ContributorFootnote[];
|
|
30
|
-
prefix: string;
|
|
31
22
|
creditRoles?: CreditRole[];
|
|
32
23
|
}
|
|
33
24
|
export interface ContributorNode extends ManuscriptNode {
|
|
34
|
-
attrs:
|
|
25
|
+
attrs: ContributorAttrs;
|
|
35
26
|
}
|
|
36
27
|
export declare const contributor: NodeSpec;
|
|
37
28
|
export declare const isContributorNode: (node: ManuscriptNode) => node is ContributorNode;
|
|
38
|
-
export {};
|
|
@@ -59,6 +59,28 @@ export type ManuscriptTemplate = {
|
|
|
59
59
|
articleType: string;
|
|
60
60
|
hiddenNodeTypes?: string[];
|
|
61
61
|
};
|
|
62
|
+
export interface UserProfile {
|
|
63
|
+
_id: string;
|
|
64
|
+
userID: string;
|
|
65
|
+
given?: string;
|
|
66
|
+
family?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface Project {
|
|
69
|
+
_id: string;
|
|
70
|
+
owners: string[];
|
|
71
|
+
writers: string[];
|
|
72
|
+
editors?: string[];
|
|
73
|
+
annotators?: string[];
|
|
74
|
+
proofers?: string[];
|
|
75
|
+
viewers: string[];
|
|
76
|
+
updatedAt: number;
|
|
77
|
+
}
|
|
78
|
+
export interface Bundle {
|
|
79
|
+
_id: string;
|
|
80
|
+
csl: {
|
|
81
|
+
_id: string;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
62
84
|
export type MarkRule = ParseRule & {
|
|
63
85
|
mark: Marks | null;
|
|
64
86
|
};
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
17
16
|
import { ManuscriptNode, ManuscriptNodeType, Nodes } from '../schema';
|
|
18
|
-
export declare const nodeTypesMap: Map<ManuscriptNodeType, ObjectTypes>;
|
|
19
17
|
export declare const isExecutableNodeType: (type: ManuscriptNodeType) => boolean;
|
|
20
18
|
export declare const isElementNodeType: (type: ManuscriptNodeType) => boolean;
|
|
21
19
|
export declare const isSectionNodeType: (type: ManuscriptNodeType) => boolean;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.3.
|
|
1
|
+
export declare const VERSION = "4.3.23";
|
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": "4.3.
|
|
4
|
+
"version": "4.3.23",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"version": "pnpm build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@manuscripts/json-schema": "2.2.12",
|
|
33
32
|
"citeproc": "2.4.63",
|
|
34
33
|
"jszip": "3.10.1",
|
|
35
34
|
"lodash": "4.17.21",
|
|
@@ -48,6 +47,7 @@
|
|
|
48
47
|
"@eslint/js": "9.39.1",
|
|
49
48
|
"@jats4r/dtds": "0.0.10",
|
|
50
49
|
"@manuscripts/eslint-config": "0.5.1",
|
|
50
|
+
"@types/csl": "npm:csl-json@0.1.0",
|
|
51
51
|
"@types/jest": "30.0.0",
|
|
52
52
|
"@types/lodash": "4.17.16",
|
|
53
53
|
"@types/mime": "3.0.4",
|