@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.
Files changed (131) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/jats/importer/index.js +1 -3
  3. package/dist/cjs/jats/importer/jats-body-dom-parser.js +23 -227
  4. package/dist/cjs/jats/importer/jats-body-transformations.js +110 -201
  5. package/dist/cjs/jats/importer/jats-comments.js +100 -98
  6. package/dist/cjs/jats/importer/jats-front-parser.js +87 -81
  7. package/dist/cjs/jats/importer/jats-journal-meta-parser.js +51 -39
  8. package/dist/cjs/jats/importer/jats-parser-utils.js +17 -56
  9. package/dist/cjs/jats/importer/jats-reference-parser.js +24 -79
  10. package/dist/cjs/jats/importer/jats-references.js +34 -0
  11. package/dist/cjs/jats/importer/parse-jats-article.js +67 -173
  12. package/dist/cjs/jats/index.js +1 -3
  13. package/dist/cjs/jats/jats-exporter.js +33 -54
  14. package/dist/cjs/lib/section-group-type.js +30 -0
  15. package/dist/cjs/lib/utils.js +23 -1
  16. package/dist/cjs/schema/index.js +20 -17
  17. package/dist/cjs/schema/nodes/abstracts.js +27 -0
  18. package/dist/cjs/schema/nodes/affiliations.js +27 -0
  19. package/dist/cjs/schema/nodes/backmatter.js +27 -0
  20. package/dist/cjs/schema/nodes/body.js +27 -0
  21. package/dist/cjs/schema/nodes/citation.js +10 -15
  22. package/dist/cjs/schema/nodes/{comment_list.js → comments.js} +4 -4
  23. package/dist/cjs/schema/nodes/contributors.js +27 -0
  24. package/dist/cjs/schema/nodes/{meta_section.js → core_section.js} +6 -5
  25. package/dist/cjs/schema/nodes/cross_reference.js +4 -3
  26. package/dist/cjs/schema/nodes/inline_footnote.js +6 -5
  27. package/dist/cjs/schema/nodes/keyword.js +0 -1
  28. package/dist/cjs/schema/nodes/{keywords_group.js → keyword_group.js} +6 -6
  29. package/dist/cjs/schema/nodes/{keywords_section.js → keywords.js} +7 -7
  30. package/dist/cjs/schema/nodes/keywords_element.js +1 -1
  31. package/dist/cjs/schema/nodes/manuscript.js +5 -2
  32. package/dist/cjs/transformer/builders.js +9 -86
  33. package/dist/cjs/transformer/decode.js +143 -162
  34. package/dist/cjs/transformer/encode.js +54 -45
  35. package/dist/cjs/transformer/highlight-markers.js +4 -4
  36. package/dist/cjs/transformer/html.js +5 -20
  37. package/dist/cjs/transformer/node-names.js +1 -1
  38. package/dist/cjs/transformer/node-title.js +1 -1
  39. package/dist/cjs/transformer/node-types.js +7 -6
  40. package/dist/cjs/transformer/object-types.js +1 -2
  41. package/dist/cjs/transformer/section-category.js +35 -17
  42. package/dist/es/index.js +1 -1
  43. package/dist/es/jats/importer/index.js +1 -1
  44. package/dist/es/jats/importer/jats-body-dom-parser.js +23 -227
  45. package/dist/es/jats/importer/jats-body-transformations.js +111 -202
  46. package/dist/es/jats/importer/jats-comments.js +97 -96
  47. package/dist/es/jats/importer/jats-front-parser.js +88 -82
  48. package/dist/es/jats/importer/jats-journal-meta-parser.js +51 -39
  49. package/dist/es/jats/importer/jats-parser-utils.js +16 -54
  50. package/dist/es/jats/importer/jats-reference-parser.js +27 -82
  51. package/dist/es/jats/importer/jats-references.js +30 -0
  52. package/dist/es/jats/importer/parse-jats-article.js +70 -174
  53. package/dist/es/jats/index.js +1 -1
  54. package/dist/es/jats/jats-exporter.js +33 -54
  55. package/dist/es/lib/section-group-type.js +27 -0
  56. package/dist/es/lib/utils.js +20 -0
  57. package/dist/es/schema/index.js +21 -18
  58. package/dist/es/schema/nodes/abstracts.js +24 -0
  59. package/dist/es/schema/nodes/affiliations.js +24 -0
  60. package/dist/es/schema/nodes/backmatter.js +24 -0
  61. package/dist/es/schema/nodes/body.js +24 -0
  62. package/dist/es/schema/nodes/citation.js +10 -15
  63. package/dist/es/schema/nodes/{comment_list.js → comments.js} +3 -3
  64. package/dist/es/schema/nodes/contributors.js +24 -0
  65. package/dist/es/schema/nodes/{meta_section.js → core_section.js} +5 -4
  66. package/dist/es/schema/nodes/cross_reference.js +4 -3
  67. package/dist/es/schema/nodes/inline_footnote.js +6 -5
  68. package/dist/es/schema/nodes/keyword.js +0 -1
  69. package/dist/es/schema/nodes/{keywords_group.js → keyword_group.js} +4 -4
  70. package/dist/es/schema/nodes/{keywords_section.js → keywords.js} +5 -5
  71. package/dist/es/schema/nodes/keywords_element.js +1 -1
  72. package/dist/es/schema/nodes/manuscript.js +3 -1
  73. package/dist/es/transformer/builders.js +6 -73
  74. package/dist/es/transformer/decode.js +143 -161
  75. package/dist/es/transformer/encode.js +57 -48
  76. package/dist/es/transformer/highlight-markers.js +1 -1
  77. package/dist/es/transformer/html.js +5 -20
  78. package/dist/es/transformer/node-names.js +1 -1
  79. package/dist/es/transformer/node-title.js +1 -1
  80. package/dist/es/transformer/node-types.js +7 -6
  81. package/dist/es/transformer/object-types.js +0 -1
  82. package/dist/es/transformer/section-category.js +33 -15
  83. package/dist/types/index.d.ts +1 -1
  84. package/dist/types/jats/importer/index.d.ts +1 -1
  85. package/dist/types/jats/importer/jats-body-transformations.d.ts +16 -19
  86. package/dist/types/jats/importer/jats-comments.d.ts +13 -9
  87. package/dist/types/jats/importer/jats-front-parser.d.ts +35 -12
  88. package/dist/types/jats/importer/jats-journal-meta-parser.d.ts +4 -4
  89. package/dist/types/jats/importer/jats-parser-utils.d.ts +1 -6
  90. package/dist/types/jats/importer/jats-reference-parser.d.ts +2 -6
  91. package/dist/types/jats/importer/jats-references.d.ts +12 -0
  92. package/dist/types/jats/importer/parse-jats-article.d.ts +5 -17
  93. package/dist/types/jats/index.d.ts +1 -1
  94. package/dist/types/lib/section-group-type.d.ts +31 -0
  95. package/dist/types/lib/utils.d.ts +4 -1
  96. package/dist/types/schema/index.d.ts +4 -5
  97. package/dist/types/schema/nodes/{meta_section.d.ts → abstracts.d.ts} +1 -9
  98. package/dist/types/schema/nodes/affiliations.d.ts +17 -0
  99. package/dist/types/schema/nodes/backmatter.d.ts +17 -0
  100. package/dist/types/schema/nodes/body.d.ts +17 -0
  101. package/dist/types/schema/nodes/citation.d.ts +3 -5
  102. package/dist/types/schema/nodes/comments.d.ts +17 -0
  103. package/dist/types/schema/nodes/contributors.d.ts +17 -0
  104. package/dist/types/schema/nodes/core_section.d.ts +17 -0
  105. package/dist/types/schema/nodes/cross_reference.d.ts +1 -1
  106. package/dist/types/schema/nodes/inline_footnote.d.ts +1 -1
  107. package/dist/types/schema/nodes/keyword.d.ts +0 -1
  108. package/dist/types/schema/nodes/{contributors_element.d.ts → keyword_group.d.ts} +3 -4
  109. package/dist/types/schema/nodes/{comment_list.d.ts → keywords.d.ts} +3 -2
  110. package/dist/types/schema/nodes/manuscript.d.ts +1 -0
  111. package/dist/types/schema/types.d.ts +1 -1
  112. package/dist/types/transformer/builders.d.ts +2 -14
  113. package/dist/types/transformer/decode.d.ts +7 -9
  114. package/dist/types/transformer/encode.d.ts +1 -1
  115. package/dist/types/transformer/highlight-markers.d.ts +1 -0
  116. package/dist/types/transformer/object-types.d.ts +1 -2
  117. package/dist/types/transformer/section-category.d.ts +1 -1
  118. package/package.json +1 -1
  119. package/dist/cjs/lib/core-section-categories.js +0 -29
  120. package/dist/cjs/schema/nodes/affiliations_section.js +0 -36
  121. package/dist/cjs/schema/nodes/contributors_element.js +0 -49
  122. package/dist/cjs/schema/nodes/contributors_section.js +0 -36
  123. package/dist/es/lib/core-section-categories.js +0 -26
  124. package/dist/es/schema/nodes/affiliations_section.js +0 -32
  125. package/dist/es/schema/nodes/contributors_element.js +0 -46
  126. package/dist/es/schema/nodes/contributors_section.js +0 -32
  127. package/dist/types/lib/core-section-categories.d.ts +0 -8
  128. package/dist/types/schema/nodes/affiliations_section.d.ts +0 -11
  129. package/dist/types/schema/nodes/contributors_section.d.ts +0 -12
  130. package/dist/types/schema/nodes/keywords_group.d.ts +0 -26
  131. package/dist/types/schema/nodes/keywords_section.d.ts +0 -26
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * © 2023 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 type SectionGroupType = {
17
+ _id: string;
18
+ title: string;
19
+ };
20
+ export declare const abstractsType: {
21
+ _id: string;
22
+ title: string;
23
+ };
24
+ export declare const bodyType: {
25
+ _id: string;
26
+ title: string;
27
+ };
28
+ export declare const backmatterType: {
29
+ _id: string;
30
+ title: string;
31
+ };
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { Model } from '@manuscripts/json-schema';
16
17
  import { Node as ProsemirrorNode, ResolvedPos } from 'prosemirror-model';
17
18
  import { ManuscriptEditorState, ManuscriptNode } from '../schema';
18
19
  export declare function iterateChildren(node: ManuscriptNode, recurse?: boolean): Iterable<ManuscriptNode>;
@@ -26,4 +27,6 @@ export declare const findParentNodeClosestToPos: ($pos: ResolvedPos, predicate:
26
27
  depth: number;
27
28
  node: ProsemirrorNode;
28
29
  } | undefined;
29
- export declare const getTrimmedTextContent: (node: Element | Document, querySelector: string) => string | null | undefined;
30
+ export declare const getTrimmedTextContent: (node: Element | Document | null, querySelector: string) => string | null | undefined;
31
+ export declare const groupBy: <T, K extends string | number | symbol>(list: T[], getKey: (item: T) => K) => Record<K, T[]>;
32
+ export declare function modelsEqual(model: Model, model2: Model): boolean;
@@ -18,7 +18,7 @@ import { Marks, Nodes } from './types';
18
18
  export * from './groups';
19
19
  export * from './types';
20
20
  export * from './nodes/comment';
21
- export * from './nodes/comment_list';
21
+ export * from './nodes/comments';
22
22
  export * from './nodes/attribution';
23
23
  export * from './nodes/bibliography_item';
24
24
  export * from './nodes/bibliography_element';
@@ -44,7 +44,7 @@ export * from './nodes/inline_equation';
44
44
  export * from './nodes/inline_footnote';
45
45
  export * from './nodes/keyword';
46
46
  export * from './nodes/keywords_element';
47
- export * from './nodes/keywords_section';
47
+ export * from './nodes/keywords';
48
48
  export * from './nodes/link';
49
49
  export * from './nodes/list';
50
50
  export * from './nodes/listing';
@@ -65,10 +65,9 @@ export * from './nodes/text';
65
65
  export * from './nodes/toc_element';
66
66
  export * from './nodes/toc_section';
67
67
  export * from './nodes/affiliation';
68
- export * from './nodes/meta_section';
69
68
  export * from './nodes/contributor';
70
69
  export * from './nodes/table_element_footer';
71
70
  export * from './nodes/title';
72
- export * from './nodes/affiliations_section';
73
- export * from './nodes/contributors_section';
71
+ export * from './nodes/affiliations';
72
+ export * from './nodes/contributors';
74
73
  export declare const schema: Schema<Nodes, Marks>;
@@ -14,12 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { NodeSpec } from 'prosemirror-model';
17
- import { ManuscriptNode } from '../types';
18
- interface Attrs {
19
- id: string;
20
- }
21
- export interface MetaSectionNode extends ManuscriptNode {
22
- attrs: Attrs;
23
- }
24
- export declare const metaSection: NodeSpec;
25
- export {};
17
+ export declare const abstracts: NodeSpec;
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * © 2023 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
+ export declare const affiliations: NodeSpec;
@@ -0,0 +1,17 @@
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
+ export declare const backmatter: NodeSpec;
@@ -0,0 +1,17 @@
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
+ export declare const body: NodeSpec;
@@ -16,12 +16,10 @@
16
16
  import { NodeSpec } from 'prosemirror-model';
17
17
  import { ManuscriptNode } from '../types';
18
18
  interface Attrs {
19
- rid: string;
19
+ id: string;
20
+ rids: string[];
20
21
  contents: string;
21
- embeddedCitationItems: {
22
- id: string;
23
- bibliographyItem: string;
24
- }[];
22
+ selectedText: string;
25
23
  }
26
24
  export interface CitationNode extends ManuscriptNode {
27
25
  attrs: Attrs;
@@ -0,0 +1,17 @@
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
+ export declare const comments: NodeSpec;
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * © 2023 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
+ export declare const contributors: NodeSpec;
@@ -0,0 +1,17 @@
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
+ export declare const coreSection: NodeSpec;
@@ -16,7 +16,7 @@
16
16
  import { NodeSpec } from 'prosemirror-model';
17
17
  import { ManuscriptNode } from '../types';
18
18
  interface Attrs {
19
- rid: string;
19
+ rids: string[];
20
20
  label: string;
21
21
  customLabel: string;
22
22
  }
@@ -16,7 +16,7 @@
16
16
  import { NodeSpec } from 'prosemirror-model';
17
17
  import { ManuscriptNode } from '../types';
18
18
  interface Attrs {
19
- rid: string;
19
+ rids: string[];
20
20
  contents: string;
21
21
  }
22
22
  export interface InlineFootnoteNode extends ManuscriptNode {
@@ -18,7 +18,6 @@ import { ManuscriptNode } from '../types';
18
18
  import { CommentNode } from './comment';
19
19
  interface Attrs {
20
20
  id: string;
21
- contents: string;
22
21
  comments?: CommentNode[];
23
22
  }
24
23
  export interface KeywordNode extends ManuscriptNode {
@@ -16,12 +16,11 @@
16
16
  import { NodeSpec } from 'prosemirror-model';
17
17
  import { ManuscriptNode } from '../types';
18
18
  interface Attrs {
19
- contents: string;
20
19
  id: string;
21
- paragraphStyle?: string;
22
20
  }
23
- export interface ContributorsElementNode extends ManuscriptNode {
21
+ export interface KeywordGroupNode extends ManuscriptNode {
24
22
  attrs: Attrs;
25
23
  }
26
- export declare const contributorsElement: NodeSpec;
24
+ export declare const keywordGroup: NodeSpec;
25
+ export declare const isKeywordGroupNode: (node: ManuscriptNode) => node is KeywordGroupNode;
27
26
  export {};
@@ -18,8 +18,9 @@ import { ManuscriptNode } from '../types';
18
18
  interface Attrs {
19
19
  id: string;
20
20
  }
21
- export interface CommentListNode extends ManuscriptNode {
21
+ export interface KeywordsNode extends ManuscriptNode {
22
22
  attrs: Attrs;
23
23
  }
24
- export declare const commentList: NodeSpec;
24
+ export declare const keywords: NodeSpec;
25
+ export declare const isKeywordsNode: (node: ManuscriptNode) => node is KeywordsNode;
25
26
  export {};
@@ -21,3 +21,4 @@ export interface ActualManuscriptNode extends ManuscriptNode {
21
21
  };
22
22
  }
23
23
  export declare const manuscript: NodeSpec;
24
+ export declare const isManuscriptNode: (node: ManuscriptNode) => node is import("prosemirror-model").Node;
@@ -17,7 +17,7 @@ import { Fragment, Mark as ProsemirrorMark, MarkType, Node as ProsemirrorNode, N
17
17
  import { EditorState, NodeSelection, Plugin, TextSelection, Transaction } from 'prosemirror-state';
18
18
  import { EditorView, NodeView } from 'prosemirror-view';
19
19
  export type Marks = 'bold' | 'code' | 'italic' | 'smallcaps' | 'strikethrough' | 'styled' | 'subscript' | 'superscript' | 'underline' | 'tracked_insert' | 'tracked_delete';
20
- export type Nodes = 'attribution' | 'bibliography_item' | 'bibliography_element' | 'bibliography_section' | 'blockquote_element' | 'bullet_list' | 'caption' | 'caption_title' | 'comment' | 'comment_list' | 'citation' | 'cross_reference' | 'doc' | 'equation' | 'equation_element' | 'figcaption' | 'figure' | 'graphical_abstract_section' | 'figure_element' | 'footnote' | 'footnotes_element' | 'footnotes_section' | 'hard_break' | 'highlight_marker' | 'inline_equation' | 'inline_footnote' | 'keyword' | 'keywords_element' | 'keywords_group' | 'keywords_section' | 'link' | 'list_item' | 'listing' | 'listing_element' | 'manuscript' | 'missing_figure' | 'ordered_list' | 'paragraph' | 'placeholder' | 'placeholder_element' | 'pullquote_element' | 'section' | 'section_label' | 'section_title' | 'section_title_plain' | 'table' | 'table_body' | 'table_cell' | 'table_element' | 'table_row' | 'table_colgroup' | 'table_col' | 'text' | 'toc_element' | 'toc_section' | 'affiliation' | 'meta_section' | 'contributor' | 'table_element_footer' | 'title' | 'affiliations_section' | 'contributors_section';
20
+ export type Nodes = 'attribution' | 'bibliography_item' | 'bibliography_element' | 'bibliography_section' | 'blockquote_element' | 'bullet_list' | 'caption' | 'caption_title' | 'comment' | 'comments' | 'citation' | 'cross_reference' | 'doc' | 'equation' | 'equation_element' | 'figcaption' | 'figure' | 'graphical_abstract_section' | 'figure_element' | 'footnote' | 'footnotes_element' | 'footnotes_section' | 'hard_break' | 'highlight_marker' | 'inline_equation' | 'inline_footnote' | 'keyword' | 'keywords_element' | 'keyword_group' | 'keywords' | 'link' | 'list_item' | 'listing' | 'listing_element' | 'manuscript' | 'abstracts' | 'body' | 'backmatter' | 'missing_figure' | 'ordered_list' | 'paragraph' | 'placeholder' | 'placeholder_element' | 'pullquote_element' | 'section' | 'section_label' | 'section_title' | 'section_title_plain' | 'table' | 'table_body' | 'table_cell' | 'table_element' | 'table_row' | 'table_colgroup' | 'table_col' | 'text' | 'toc_element' | 'toc_section' | 'affiliation' | 'contributor' | 'table_element_footer' | 'title' | 'affiliations' | 'contributors';
21
21
  export type ManuscriptSchema = Schema<Nodes, Marks>;
22
22
  export type ManuscriptEditorState = EditorState;
23
23
  export type ManuscriptEditorView = EditorView;
@@ -13,11 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Affiliation, Attribution, AuxiliaryObjectReference, BibliographicDate, BibliographicName, BibliographyItem, Citation, CitationItem, Color, CommentAnnotation, Contribution, Contributor, ContributorRole, Corresponding, ElementsOrder, EmbeddedModel, Figure, Footnote, FootnotesOrder, Highlight, HighlightMarker, InlineMathFragment, InlineStyle, Journal, Keyword, KeywordGroup, LibraryCollection, Manuscript, ManuscriptKeyword, ManuscriptNote, ObjectTypes, ParagraphElement, Project, RequirementsValidation, RequirementsValidationData, Section, StatusLabel, Supplement, Titles, UserProfileAffiliation } from '@manuscripts/json-schema';
16
+ import { Affiliation, Attribution, BibliographicDate, BibliographicName, BibliographyElement, BibliographyItem, Color, CommentAnnotation, Contribution, Contributor, ContributorRole, Corresponding, ElementsOrder, EmbeddedModel, Figure, Footnote, FootnotesOrder, InlineMathFragment, Journal, Keyword, KeywordGroup, Manuscript, ManuscriptNote, ObjectTypes, ParagraphElement, Project, Section, Supplement, Titles } from '@manuscripts/json-schema';
17
17
  import { FootnotesOrderIndexList } from './footnotes-order';
18
18
  import { CommentSelector, ManuscriptModel, ModelAttachment } from './models';
19
- export declare const DEFAULT_BUNDLE = "MPBundle:www-zotero-org-styles-nature";
20
- export declare const DEFAULT_PAGE_LAYOUT = "MPPageLayout:defaultA4";
21
19
  export type Build<T> = Pick<T, Exclude<keyof T, keyof ManuscriptModel>> & {
22
20
  _id: string;
23
21
  objectType: string;
@@ -34,24 +32,18 @@ export declare const buildContributor: (bibliographicName: BibliographicName, ro
34
32
  export declare const buildBibliographyItem: (data: Partial<Build<BibliographyItem>>) => Build<BibliographyItem>;
35
33
  export declare const buildBibliographicName: (data: Partial<BibliographicName>) => BuildEmbedded<BibliographicName, ObjectTypes.BibliographicName>;
36
34
  export declare const buildBibliographicDate: (data: Partial<BibliographicDate>) => BuildEmbedded<BibliographicDate, ObjectTypes.BibliographicDate>;
37
- export declare const buildAuxiliaryObjectReference: (containingObject: string, rids: string[]) => Build<AuxiliaryObjectReference>;
38
- export declare const buildEmbeddedCitationItem: (bibliographyItem: string) => CitationItem;
39
- export declare const buildCitation: (containingObject: string, embeddedCitationItems: string[]) => Build<Citation>;
35
+ export declare const buildBibliographyElement: (bibliographyItems: BibliographyItem[]) => Build<BibliographyElement>;
40
36
  export declare const buildKeyword: (name: string) => Build<Keyword>;
41
37
  export declare const buildKeywordGroup: (attributes: {
42
38
  type?: string;
43
39
  title?: string;
44
40
  label?: string;
45
41
  }) => Build<KeywordGroup>;
46
- export declare const buildManuscriptKeyword: (name: string) => Build<ManuscriptKeyword>;
47
- export declare const buildLibraryCollection: (owner: string, name: string) => Build<LibraryCollection>;
48
42
  export declare const buildFigure: (blob: Blob) => Build<Figure & ModelAttachment>;
49
43
  export declare const buildAffiliation: (institution: string, priority?: number) => Build<Affiliation>;
50
44
  export declare const buildSupplementaryMaterial: (title: string, href: string) => Build<Supplement>;
51
- export declare const buildUserProfileAffiliation: (institution: string, priority?: number) => Build<UserProfileAffiliation>;
52
45
  export declare const buildComment: (target: string, contents?: string, selector?: CommentSelector, contributions?: Contribution[], annotationColor?: string) => Build<CommentAnnotation>;
53
46
  export declare const buildNote: (target: string, source: 'EMAIL' | 'EDITOR' | 'DASHBOARD', contents?: string) => Build<ManuscriptNote>;
54
- export declare const buildValidation: (results: RequirementsValidationData[]) => Build<RequirementsValidation>;
55
47
  export declare const buildInlineMathFragment: (containingObject: string, TeXRepresentation: string) => Build<InlineMathFragment>;
56
48
  export declare const buildFootnote: (containingObject: string, contents: string, kind?: 'footnote' | 'endnote') => Build<Footnote>;
57
49
  export declare const buildFootnotesOrder: (footnotesList: FootnotesOrderIndexList) => Build<FootnotesOrder>;
@@ -59,14 +51,10 @@ export declare const buildCorresp: (contents: string) => Build<Corresponding>;
59
51
  export declare const buildSection: (priority?: number, path?: string[]) => Build<Section>;
60
52
  export declare const buildParagraph: (placeholderInnerHTML: string) => Build<ParagraphElement>;
61
53
  export declare const buildColor: (value: string, priority: number) => Build<Color>;
62
- export declare const buildHighlight: () => Build<Highlight>;
63
- export declare const buildHighlightMarker: (highlightID: string, start: boolean, offset: number, field: 'caption' | 'contents' | 'title') => Build<HighlightMarker>;
64
54
  export declare const buildContribution: (profileID: string) => Contribution;
65
55
  export declare const buildContributorRole: (name: string) => Build<ContributorRole>;
66
- export declare const buildInlineStyle: (priority: number, title?: string) => Build<InlineStyle>;
67
56
  export declare const buildAttribution: () => Build<Attribution>;
68
57
  export declare const buildJournal: () => Build<Journal>;
69
- export declare const buildStatusLabel: (name: string) => Build<StatusLabel>;
70
58
  export type AuxiliaryObjects = 'MPFigureElement' | 'MPTableElement' | 'MPListingElement' | 'MPEquationElement';
71
59
  export declare const auxiliaryObjectTypes: Set<import("prosemirror-model").NodeType>;
72
60
  export declare const buildElementsOrder: (elementType: AuxiliaryObjects) => Build<ElementsOrder>;
@@ -19,20 +19,20 @@ import { ManuscriptNode } from '../schema';
19
19
  export declare const getModelData: <T extends Model>(model: Model) => T;
20
20
  export declare const getModelsByType: <T extends Model>(modelMap: Map<string, Model>, objectType: string) => T[];
21
21
  export declare const sortSectionsByPriority: (a: Section, b: Section) => number;
22
- export declare const isManuscriptNode: (model: ManuscriptNode | null) => model is import("prosemirror-model").Node;
23
22
  export declare class Decoder {
24
23
  private readonly modelMap;
25
24
  private readonly allowMissingElements;
26
25
  private comments;
27
26
  private creators;
28
- private createMetaSectionNode;
29
- private createCommentListNode;
30
- private handleMissingRootSectionNodes;
31
- private createAffiliationSectionNode;
32
- private createContributorSectionNode;
33
27
  private createTitleNode;
34
- private createRootSectionNodes;
28
+ private createAffiliationsNode;
29
+ private createContributorsNode;
30
+ private createKeywordsNode;
35
31
  private createCommentsNode;
32
+ private createRootSectionNodes;
33
+ private ensureCoreSectionsExist;
34
+ private createAndFill;
35
+ private createCommentNodes;
36
36
  private getComments;
37
37
  private extractListing;
38
38
  constructor(modelMap: Map<string, Model>, allowMissingElements?: boolean);
@@ -41,11 +41,9 @@ export declare class Decoder {
41
41
  createArticleNode: (manuscriptID?: string) => ManuscriptNode;
42
42
  addGeneratedLabels: (sections: Section[]) => Section[];
43
43
  parseContents: (contents: string, wrapper?: string, commentAnnotations?: CommentAnnotation[], options?: ParseOptions) => ManuscriptNode;
44
- private getKeywords;
45
44
  private getManuscriptID;
46
45
  private getFigcaption;
47
46
  private createTable;
48
47
  private createTableElementFooter;
49
48
  private createListing;
50
- private getKeywordGroups;
51
49
  }
@@ -25,5 +25,5 @@ export declare const modelFromNode: (node: ManuscriptNode, parent: ManuscriptNod
25
25
  interface PrioritizedValue {
26
26
  value: number;
27
27
  }
28
- export declare const encode: (node: ManuscriptNode) => Map<string, Model>;
28
+ export declare const encode: (node: ManuscriptNode, preserveWithRepeatedID?: boolean) => Map<string, Model>;
29
29
  export {};
@@ -16,6 +16,7 @@
16
16
  import { CommentAnnotation, Model } from '@manuscripts/json-schema';
17
17
  import { Build } from './builders';
18
18
  export type HighlightableField = 'title' | 'caption' | 'contents';
19
+ export declare const highlightableFields: HighlightableField[];
19
20
  export declare const isHighlightableModel: (model: Model) => model is HighlightableModel;
20
21
  export interface HighlightableModel extends Model {
21
22
  contents?: string;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { CommentAnnotation, Figure, Keyword, Manuscript, Model, ObjectTypes, Table } from '@manuscripts/json-schema';
17
- import { ManuscriptModel, UserProfileWithAvatar } from './models';
17
+ import { ManuscriptModel } from './models';
18
18
  export declare enum ExtraObjectTypes {
19
19
  PlaceholderElement = "MPPlaceholderElement"
20
20
  }
@@ -25,6 +25,5 @@ export declare const hasObjectType: <T extends Model>(objectType: string) => (mo
25
25
  export declare const isFigure: (model: Model) => model is Figure;
26
26
  export declare const isManuscript: (model: Model) => model is Manuscript;
27
27
  export declare const isTable: (model: Model) => model is Table;
28
- export declare const isUserProfile: (model: Model) => model is UserProfileWithAvatar;
29
28
  export declare const isCommentAnnotation: (model: Model) => model is CommentAnnotation;
30
29
  export declare const isKeyword: (model: Model) => model is Keyword;
@@ -15,7 +15,6 @@
15
15
  */
16
16
  import { Element } from '@manuscripts/json-schema';
17
17
  import { ManuscriptNode, ManuscriptNodeType } from '../schema';
18
- export declare const getCoreSectionTitles: (sectionCategory: SectionCategory) => string[];
19
18
  export declare const isAnySectionNode: (node: ManuscriptNode) => boolean;
20
19
  export type SectionCategory = 'MPSectionCategory:abstract' | 'MPSectionCategory:abstract-teaser' | 'MPSectionCategory:abstract-graphical' | 'MPSectionCategory:acknowledgement' | 'MPSectionCategory:availability' | 'MPSectionCategory:bibliography' | 'MPSectionCategory:conclusions' | 'MPSectionCategory:discussion' | 'MPSectionCategory:endnotes' | 'MPSectionCategory:introduction' | 'MPSectionCategory:keywords' | 'MPSectionCategory:materials-method' | 'MPSectionCategory:results' | 'MPSectionCategory:toc' | 'MPSectionCategory:floating-element' | 'MPSectionCategory:appendices' | 'MPSectionCategory:competing-interests' | 'MPSectionCategory:financial-disclosure' | 'MPSectionCategory:con' | 'MPSectionCategory:deceased' | 'MPSectionCategory:equal' | 'MPSectionCategory:present-address' | 'MPSectionCategory:presented-at' | 'MPSectionCategory:previously-at' | 'MPSectionCategory:supplementary-material' | 'MPSectionCategory:supported-by' | 'MPSectionCategory:ethics-statement' | 'MPSectionCategory:body' | 'MPSectionCategory:abstracts' | 'MPSectionCategory:backmatter' | 'MPSectionCategory:affiliations' | 'MPSectionCategory:contributors';
21
20
  export type SecType = 'abstract' | 'abstract-teaser' | 'abstract-graphical' | 'acknowledgments' | 'availability' | 'bibliography' | 'conclusions' | 'data-availability' | 'discussion' | 'endnotes' | 'intro' | 'keywords' | 'materials' | 'methods' | 'results' | 'toc' | 'floating-element' | 'appendices' | 'competing-interests' | 'financial-disclosure' | 'con' | 'deceased' | 'equal' | 'present-address' | 'presented-at' | 'previously-at' | 'supplementary-material' | 'supported-by' | 'ethics-statement' | 'abstracts' | 'body' | 'backmatter' | 'affiliations' | 'contributors';
@@ -25,6 +24,7 @@ export declare const guessSectionCategory: (elements: Element[]) => SectionCateg
25
24
  export declare const buildSectionCategory: (node: ManuscriptNode) => SectionCategory | undefined;
26
25
  export declare const chooseJatsFnType: (footnoteType: string) => string;
27
26
  export declare const chooseSecType: (sectionCategory: SectionCategory) => SecType;
27
+ export declare const chooseCoreSectionBySection: (section: string) => string;
28
28
  export declare const chooseSectionCategoryByType: (secType: string) => SectionCategory | undefined;
29
29
  export declare const chooseSectionCategory: (section: HTMLElement) => SectionCategory | undefined;
30
30
  export declare const chooseSectionCategoryFromTitle: (title: string | null) => SectionCategory | undefined;
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": "1.5.7",
4
+ "version": "1.5.8-LEAN-3030",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.coreSectionCategories = void 0;
4
- exports.coreSectionCategories = [
5
- {
6
- _id: 'MPSectionCategory:abstracts',
7
- name: 'Abstracts',
8
- desc: 'Abstracts section for grouping',
9
- objectType: 'MPSectionCategory',
10
- titles: [],
11
- priority: 120,
12
- },
13
- {
14
- _id: 'MPSectionCategory:backmatter',
15
- name: 'Backmatter',
16
- desc: 'Backmatter section for grouping',
17
- objectType: 'MPSectionCategory',
18
- titles: [],
19
- priority: 180,
20
- },
21
- {
22
- _id: 'MPSectionCategory:body',
23
- name: 'Body',
24
- desc: 'Body section for grouping',
25
- objectType: 'MPSectionCategory',
26
- titles: [],
27
- priority: 200,
28
- },
29
- ];
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isAffiliationsSectionNode = exports.affiliationsSection = void 0;
4
- exports.affiliationsSection = {
5
- content: 'section_title? affiliation*',
6
- attrs: {
7
- id: { default: 'META_SECTION_AFFILLIATIONS' },
8
- dataTracked: { default: null },
9
- },
10
- group: 'block sections',
11
- selectable: false,
12
- parseDOM: [
13
- {
14
- tag: 'section.affiliations',
15
- getAttrs: (section) => {
16
- const dom = section;
17
- return {
18
- contents: dom.innerHTML,
19
- };
20
- },
21
- },
22
- ],
23
- toDOM: (node) => {
24
- const affiliationsSectionNode = node;
25
- return [
26
- 'section',
27
- {
28
- class: 'affiliations',
29
- id: affiliationsSectionNode.attrs.id,
30
- },
31
- 0
32
- ];
33
- },
34
- };
35
- const isAffiliationsSectionNode = (node) => node.type === node.type.schema.nodes.affiliations_section;
36
- exports.isAffiliationsSectionNode = isAffiliationsSectionNode;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- /*!
3
- * © 2019 Atypon Systems LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.contributorsElement = void 0;
19
- exports.contributorsElement = {
20
- content: 'contributor*',
21
- attrs: {
22
- id: { default: '' },
23
- contents: { default: '' },
24
- dataTracked: { default: null },
25
- },
26
- group: 'block element',
27
- selectable: false,
28
- parseDOM: [
29
- {
30
- tag: 'div.manuscript-contributors',
31
- getAttrs: () => {
32
- return {
33
- contents: '',
34
- };
35
- },
36
- },
37
- ],
38
- toDOM: (node) => {
39
- const contributorsElementNode = node;
40
- return [
41
- 'div',
42
- {
43
- class: 'manuscript-contributors',
44
- id: contributorsElementNode.attrs.id,
45
- },
46
- 0,
47
- ];
48
- },
49
- };
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isContributorsSectionNode = exports.contributorsSection = void 0;
4
- exports.contributorsSection = {
5
- content: 'section_title? contributor*',
6
- attrs: {
7
- id: { default: 'META_SECTION_CONTRIBUTORS' },
8
- dataTracked: { default: null },
9
- contents: { default: '' },
10
- },
11
- group: 'block sections',
12
- selectable: false,
13
- parseDOM: [
14
- {
15
- tag: 'section.contributors',
16
- getAttrs: () => {
17
- return {
18
- contents: '',
19
- };
20
- },
21
- },
22
- ],
23
- toDOM: (node) => {
24
- const contributorsSectionNode = node;
25
- return [
26
- 'section',
27
- {
28
- class: 'contributors',
29
- id: contributorsSectionNode.attrs.id,
30
- },
31
- 0,
32
- ];
33
- },
34
- };
35
- const isContributorsSectionNode = (node) => node.type === node.type.schema.nodes.contributors_section;
36
- exports.isContributorsSectionNode = isContributorsSectionNode;