@manuscripts/transform 1.5.7 → 1.5.8-LEAN-3030
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/index.js +1 -1
- package/dist/cjs/jats/importer/index.js +1 -3
- package/dist/cjs/jats/importer/jats-body-dom-parser.js +23 -227
- package/dist/cjs/jats/importer/jats-body-transformations.js +110 -201
- package/dist/cjs/jats/importer/jats-comments.js +100 -98
- package/dist/cjs/jats/importer/jats-front-parser.js +87 -81
- package/dist/cjs/jats/importer/jats-journal-meta-parser.js +51 -39
- package/dist/cjs/jats/importer/jats-parser-utils.js +17 -56
- package/dist/cjs/jats/importer/jats-reference-parser.js +24 -79
- package/dist/cjs/jats/importer/jats-references.js +34 -0
- package/dist/cjs/jats/importer/parse-jats-article.js +67 -173
- package/dist/cjs/jats/index.js +1 -3
- package/dist/cjs/jats/jats-exporter.js +33 -54
- package/dist/cjs/lib/section-group-type.js +30 -0
- package/dist/cjs/lib/utils.js +23 -1
- package/dist/cjs/schema/index.js +20 -17
- package/dist/cjs/schema/nodes/abstracts.js +27 -0
- package/dist/cjs/schema/nodes/affiliations.js +27 -0
- package/dist/cjs/schema/nodes/backmatter.js +27 -0
- package/dist/cjs/schema/nodes/body.js +27 -0
- package/dist/cjs/schema/nodes/citation.js +10 -15
- package/dist/cjs/schema/nodes/{comment_list.js → comments.js} +4 -4
- package/dist/cjs/schema/nodes/contributors.js +27 -0
- package/dist/cjs/schema/nodes/{meta_section.js → core_section.js} +6 -5
- package/dist/cjs/schema/nodes/cross_reference.js +4 -3
- package/dist/cjs/schema/nodes/inline_footnote.js +6 -5
- package/dist/cjs/schema/nodes/keyword.js +0 -1
- package/dist/cjs/schema/nodes/{keywords_group.js → keyword_group.js} +6 -6
- package/dist/cjs/schema/nodes/{keywords_section.js → keywords.js} +7 -7
- package/dist/cjs/schema/nodes/keywords_element.js +1 -1
- package/dist/cjs/schema/nodes/manuscript.js +5 -2
- package/dist/cjs/transformer/builders.js +9 -86
- package/dist/cjs/transformer/decode.js +143 -162
- package/dist/cjs/transformer/encode.js +54 -45
- package/dist/cjs/transformer/highlight-markers.js +4 -4
- package/dist/cjs/transformer/html.js +5 -20
- package/dist/cjs/transformer/node-names.js +1 -1
- package/dist/cjs/transformer/node-title.js +1 -1
- package/dist/cjs/transformer/node-types.js +7 -6
- package/dist/cjs/transformer/object-types.js +1 -2
- package/dist/cjs/transformer/section-category.js +35 -17
- package/dist/es/index.js +1 -1
- package/dist/es/jats/importer/index.js +1 -1
- package/dist/es/jats/importer/jats-body-dom-parser.js +23 -227
- package/dist/es/jats/importer/jats-body-transformations.js +111 -202
- package/dist/es/jats/importer/jats-comments.js +97 -96
- package/dist/es/jats/importer/jats-front-parser.js +88 -82
- package/dist/es/jats/importer/jats-journal-meta-parser.js +51 -39
- package/dist/es/jats/importer/jats-parser-utils.js +16 -54
- package/dist/es/jats/importer/jats-reference-parser.js +27 -82
- package/dist/es/jats/importer/jats-references.js +30 -0
- package/dist/es/jats/importer/parse-jats-article.js +70 -174
- package/dist/es/jats/index.js +1 -1
- package/dist/es/jats/jats-exporter.js +33 -54
- package/dist/es/lib/section-group-type.js +27 -0
- package/dist/es/lib/utils.js +20 -0
- package/dist/es/schema/index.js +21 -18
- package/dist/es/schema/nodes/abstracts.js +24 -0
- package/dist/es/schema/nodes/affiliations.js +24 -0
- package/dist/es/schema/nodes/backmatter.js +24 -0
- package/dist/es/schema/nodes/body.js +24 -0
- package/dist/es/schema/nodes/citation.js +10 -15
- package/dist/es/schema/nodes/{comment_list.js → comments.js} +3 -3
- package/dist/es/schema/nodes/contributors.js +24 -0
- package/dist/es/schema/nodes/{meta_section.js → core_section.js} +5 -4
- package/dist/es/schema/nodes/cross_reference.js +4 -3
- package/dist/es/schema/nodes/inline_footnote.js +6 -5
- package/dist/es/schema/nodes/keyword.js +0 -1
- package/dist/es/schema/nodes/{keywords_group.js → keyword_group.js} +4 -4
- package/dist/es/schema/nodes/{keywords_section.js → keywords.js} +5 -5
- package/dist/es/schema/nodes/keywords_element.js +1 -1
- package/dist/es/schema/nodes/manuscript.js +3 -1
- package/dist/es/transformer/builders.js +6 -73
- package/dist/es/transformer/decode.js +143 -161
- package/dist/es/transformer/encode.js +57 -48
- package/dist/es/transformer/highlight-markers.js +1 -1
- package/dist/es/transformer/html.js +5 -20
- package/dist/es/transformer/node-names.js +1 -1
- package/dist/es/transformer/node-title.js +1 -1
- package/dist/es/transformer/node-types.js +7 -6
- package/dist/es/transformer/object-types.js +0 -1
- package/dist/es/transformer/section-category.js +33 -15
- package/dist/types/index.d.ts +1 -1
- package/dist/types/jats/importer/index.d.ts +1 -1
- package/dist/types/jats/importer/jats-body-transformations.d.ts +16 -19
- package/dist/types/jats/importer/jats-comments.d.ts +13 -9
- package/dist/types/jats/importer/jats-front-parser.d.ts +35 -12
- package/dist/types/jats/importer/jats-journal-meta-parser.d.ts +4 -4
- package/dist/types/jats/importer/jats-parser-utils.d.ts +1 -6
- package/dist/types/jats/importer/jats-reference-parser.d.ts +2 -6
- package/dist/types/jats/importer/jats-references.d.ts +12 -0
- package/dist/types/jats/importer/parse-jats-article.d.ts +5 -17
- package/dist/types/jats/index.d.ts +1 -1
- package/dist/types/lib/section-group-type.d.ts +31 -0
- package/dist/types/lib/utils.d.ts +4 -1
- package/dist/types/schema/index.d.ts +4 -5
- package/dist/types/schema/nodes/{meta_section.d.ts → abstracts.d.ts} +1 -9
- package/dist/types/schema/nodes/affiliations.d.ts +17 -0
- package/dist/types/schema/nodes/backmatter.d.ts +17 -0
- package/dist/types/schema/nodes/body.d.ts +17 -0
- package/dist/types/schema/nodes/citation.d.ts +3 -5
- package/dist/types/schema/nodes/comments.d.ts +17 -0
- package/dist/types/schema/nodes/contributors.d.ts +17 -0
- package/dist/types/schema/nodes/core_section.d.ts +17 -0
- package/dist/types/schema/nodes/cross_reference.d.ts +1 -1
- package/dist/types/schema/nodes/inline_footnote.d.ts +1 -1
- package/dist/types/schema/nodes/keyword.d.ts +0 -1
- package/dist/types/schema/nodes/{contributors_element.d.ts → keyword_group.d.ts} +3 -4
- package/dist/types/schema/nodes/{comment_list.d.ts → keywords.d.ts} +3 -2
- package/dist/types/schema/nodes/manuscript.d.ts +1 -0
- package/dist/types/schema/types.d.ts +1 -1
- package/dist/types/transformer/builders.d.ts +2 -14
- package/dist/types/transformer/decode.d.ts +7 -9
- package/dist/types/transformer/encode.d.ts +1 -1
- package/dist/types/transformer/highlight-markers.d.ts +1 -0
- package/dist/types/transformer/object-types.d.ts +1 -2
- package/dist/types/transformer/section-category.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/lib/core-section-categories.js +0 -29
- package/dist/cjs/schema/nodes/affiliations_section.js +0 -36
- package/dist/cjs/schema/nodes/contributors_element.js +0 -49
- package/dist/cjs/schema/nodes/contributors_section.js +0 -36
- package/dist/es/lib/core-section-categories.js +0 -26
- package/dist/es/schema/nodes/affiliations_section.js +0 -32
- package/dist/es/schema/nodes/contributors_element.js +0 -46
- package/dist/es/schema/nodes/contributors_section.js +0 -32
- package/dist/types/lib/core-section-categories.d.ts +0 -8
- package/dist/types/schema/nodes/affiliations_section.d.ts +0 -11
- package/dist/types/schema/nodes/contributors_section.d.ts +0 -12
- package/dist/types/schema/nodes/keywords_group.d.ts +0 -26
- package/dist/types/schema/nodes/keywords_section.d.ts +0 -26
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const coreSectionCategories = [
|
|
2
|
-
{
|
|
3
|
-
_id: 'MPSectionCategory:abstracts',
|
|
4
|
-
name: 'Abstracts',
|
|
5
|
-
desc: 'Abstracts section for grouping',
|
|
6
|
-
objectType: 'MPSectionCategory',
|
|
7
|
-
titles: [],
|
|
8
|
-
priority: 120,
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
_id: 'MPSectionCategory:backmatter',
|
|
12
|
-
name: 'Backmatter',
|
|
13
|
-
desc: 'Backmatter section for grouping',
|
|
14
|
-
objectType: 'MPSectionCategory',
|
|
15
|
-
titles: [],
|
|
16
|
-
priority: 180,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
_id: 'MPSectionCategory:body',
|
|
20
|
-
name: 'Body',
|
|
21
|
-
desc: 'Body section for grouping',
|
|
22
|
-
objectType: 'MPSectionCategory',
|
|
23
|
-
titles: [],
|
|
24
|
-
priority: 200,
|
|
25
|
-
},
|
|
26
|
-
];
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export const affiliationsSection = {
|
|
2
|
-
content: 'section_title? affiliation*',
|
|
3
|
-
attrs: {
|
|
4
|
-
id: { default: 'META_SECTION_AFFILLIATIONS' },
|
|
5
|
-
dataTracked: { default: null },
|
|
6
|
-
},
|
|
7
|
-
group: 'block sections',
|
|
8
|
-
selectable: false,
|
|
9
|
-
parseDOM: [
|
|
10
|
-
{
|
|
11
|
-
tag: 'section.affiliations',
|
|
12
|
-
getAttrs: (section) => {
|
|
13
|
-
const dom = section;
|
|
14
|
-
return {
|
|
15
|
-
contents: dom.innerHTML,
|
|
16
|
-
};
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
toDOM: (node) => {
|
|
21
|
-
const affiliationsSectionNode = node;
|
|
22
|
-
return [
|
|
23
|
-
'section',
|
|
24
|
-
{
|
|
25
|
-
class: 'affiliations',
|
|
26
|
-
id: affiliationsSectionNode.attrs.id,
|
|
27
|
-
},
|
|
28
|
-
0
|
|
29
|
-
];
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export const isAffiliationsSectionNode = (node) => node.type === node.type.schema.nodes.affiliations_section;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 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
|
-
export const contributorsElement = {
|
|
17
|
-
content: 'contributor*',
|
|
18
|
-
attrs: {
|
|
19
|
-
id: { default: '' },
|
|
20
|
-
contents: { default: '' },
|
|
21
|
-
dataTracked: { default: null },
|
|
22
|
-
},
|
|
23
|
-
group: 'block element',
|
|
24
|
-
selectable: false,
|
|
25
|
-
parseDOM: [
|
|
26
|
-
{
|
|
27
|
-
tag: 'div.manuscript-contributors',
|
|
28
|
-
getAttrs: () => {
|
|
29
|
-
return {
|
|
30
|
-
contents: '',
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
toDOM: (node) => {
|
|
36
|
-
const contributorsElementNode = node;
|
|
37
|
-
return [
|
|
38
|
-
'div',
|
|
39
|
-
{
|
|
40
|
-
class: 'manuscript-contributors',
|
|
41
|
-
id: contributorsElementNode.attrs.id,
|
|
42
|
-
},
|
|
43
|
-
0,
|
|
44
|
-
];
|
|
45
|
-
},
|
|
46
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export const contributorsSection = {
|
|
2
|
-
content: 'section_title? contributor*',
|
|
3
|
-
attrs: {
|
|
4
|
-
id: { default: 'META_SECTION_CONTRIBUTORS' },
|
|
5
|
-
dataTracked: { default: null },
|
|
6
|
-
contents: { default: '' },
|
|
7
|
-
},
|
|
8
|
-
group: 'block sections',
|
|
9
|
-
selectable: false,
|
|
10
|
-
parseDOM: [
|
|
11
|
-
{
|
|
12
|
-
tag: 'section.contributors',
|
|
13
|
-
getAttrs: () => {
|
|
14
|
-
return {
|
|
15
|
-
contents: '',
|
|
16
|
-
};
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
toDOM: (node) => {
|
|
21
|
-
const contributorsSectionNode = node;
|
|
22
|
-
return [
|
|
23
|
-
'section',
|
|
24
|
-
{
|
|
25
|
-
class: 'contributors',
|
|
26
|
-
id: contributorsSectionNode.attrs.id,
|
|
27
|
-
},
|
|
28
|
-
0,
|
|
29
|
-
];
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export const isContributorsSectionNode = (node) => node.type === node.type.schema.nodes.contributors_section;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NodeSpec } from 'prosemirror-model';
|
|
2
|
-
import { ManuscriptNode } from '../types';
|
|
3
|
-
interface Attrs {
|
|
4
|
-
id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface AffiliationsSectionNode extends ManuscriptNode {
|
|
7
|
-
attrs: Attrs;
|
|
8
|
-
}
|
|
9
|
-
export declare const affiliationsSection: NodeSpec;
|
|
10
|
-
export declare const isAffiliationsSectionNode: (node: ManuscriptNode) => node is AffiliationsSectionNode;
|
|
11
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { NodeSpec } from 'prosemirror-model';
|
|
2
|
-
import { ManuscriptNode } from '../types';
|
|
3
|
-
interface Attrs {
|
|
4
|
-
id: string;
|
|
5
|
-
contents: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ContributorsSectionNode extends ManuscriptNode {
|
|
8
|
-
attrs: Attrs;
|
|
9
|
-
}
|
|
10
|
-
export declare const contributorsSection: NodeSpec;
|
|
11
|
-
export declare const isContributorsSectionNode: (node: ManuscriptNode) => node is ContributorsSectionNode;
|
|
12
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 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
|
-
import { NodeSpec } from 'prosemirror-model';
|
|
17
|
-
import { ManuscriptNode } from '../types';
|
|
18
|
-
interface Attrs {
|
|
19
|
-
id: string;
|
|
20
|
-
}
|
|
21
|
-
export interface KeywordsGroupNode extends ManuscriptNode {
|
|
22
|
-
attrs: Attrs;
|
|
23
|
-
}
|
|
24
|
-
export declare const keywordsGroup: NodeSpec;
|
|
25
|
-
export declare const isKeywordsGroupNode: (node: ManuscriptNode) => node is KeywordsGroupNode;
|
|
26
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 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
|
-
import { NodeSpec } from 'prosemirror-model';
|
|
17
|
-
import { ManuscriptNode } from '../types';
|
|
18
|
-
interface Attrs {
|
|
19
|
-
id: string;
|
|
20
|
-
}
|
|
21
|
-
export interface KeywordsSectionNode extends ManuscriptNode {
|
|
22
|
-
attrs: Attrs;
|
|
23
|
-
}
|
|
24
|
-
export declare const keywordsSection: NodeSpec;
|
|
25
|
-
export declare const isKeywordsSectionNode: (node: ManuscriptNode) => node is KeywordsSectionNode;
|
|
26
|
-
export {};
|