@manuscripts/transform 1.5.8 → 2.0.0

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 (133) 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 +34 -55
  14. package/dist/cjs/lib/section-group-type.js +30 -0
  15. package/dist/cjs/lib/utils.js +1 -25
  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 +147 -176
  34. package/dist/cjs/transformer/encode.js +66 -67
  35. package/dist/cjs/transformer/highlight-markers.js +48 -36
  36. package/dist/cjs/transformer/html.js +7 -23
  37. package/dist/cjs/transformer/labels.js +3 -17
  38. package/dist/cjs/transformer/node-names.js +1 -1
  39. package/dist/cjs/transformer/node-title.js +1 -1
  40. package/dist/cjs/transformer/node-types.js +7 -6
  41. package/dist/cjs/transformer/object-types.js +1 -2
  42. package/dist/cjs/transformer/section-category.js +31 -31
  43. package/dist/es/index.js +1 -1
  44. package/dist/es/jats/importer/index.js +1 -1
  45. package/dist/es/jats/importer/jats-body-dom-parser.js +23 -227
  46. package/dist/es/jats/importer/jats-body-transformations.js +111 -202
  47. package/dist/es/jats/importer/jats-comments.js +97 -96
  48. package/dist/es/jats/importer/jats-front-parser.js +88 -82
  49. package/dist/es/jats/importer/jats-journal-meta-parser.js +51 -39
  50. package/dist/es/jats/importer/jats-parser-utils.js +16 -54
  51. package/dist/es/jats/importer/jats-reference-parser.js +27 -82
  52. package/dist/es/jats/importer/jats-references.js +30 -0
  53. package/dist/es/jats/importer/parse-jats-article.js +70 -174
  54. package/dist/es/jats/index.js +1 -1
  55. package/dist/es/jats/jats-exporter.js +34 -55
  56. package/dist/es/lib/section-group-type.js +27 -0
  57. package/dist/es/lib/utils.js +0 -22
  58. package/dist/es/schema/index.js +21 -18
  59. package/dist/es/schema/nodes/abstracts.js +24 -0
  60. package/dist/es/schema/nodes/affiliations.js +24 -0
  61. package/dist/es/schema/nodes/backmatter.js +24 -0
  62. package/dist/es/schema/nodes/body.js +24 -0
  63. package/dist/es/schema/nodes/citation.js +10 -15
  64. package/dist/es/schema/nodes/{comment_list.js → comments.js} +3 -3
  65. package/dist/es/schema/nodes/contributors.js +24 -0
  66. package/dist/es/schema/nodes/{meta_section.js → core_section.js} +5 -4
  67. package/dist/es/schema/nodes/cross_reference.js +4 -3
  68. package/dist/es/schema/nodes/inline_footnote.js +6 -5
  69. package/dist/es/schema/nodes/keyword.js +0 -1
  70. package/dist/es/schema/nodes/{keywords_group.js → keyword_group.js} +4 -4
  71. package/dist/es/schema/nodes/{keywords_section.js → keywords.js} +5 -5
  72. package/dist/es/schema/nodes/keywords_element.js +1 -1
  73. package/dist/es/schema/nodes/manuscript.js +3 -1
  74. package/dist/es/transformer/builders.js +6 -73
  75. package/dist/es/transformer/decode.js +147 -175
  76. package/dist/es/transformer/encode.js +70 -71
  77. package/dist/es/transformer/highlight-markers.js +44 -32
  78. package/dist/es/transformer/html.js +7 -23
  79. package/dist/es/transformer/labels.js +3 -17
  80. package/dist/es/transformer/node-names.js +1 -1
  81. package/dist/es/transformer/node-title.js +1 -1
  82. package/dist/es/transformer/node-types.js +7 -6
  83. package/dist/es/transformer/object-types.js +0 -1
  84. package/dist/es/transformer/section-category.js +29 -29
  85. package/dist/types/index.d.ts +1 -1
  86. package/dist/types/jats/importer/index.d.ts +1 -1
  87. package/dist/types/jats/importer/jats-body-transformations.d.ts +16 -19
  88. package/dist/types/jats/importer/jats-comments.d.ts +13 -9
  89. package/dist/types/jats/importer/jats-front-parser.d.ts +35 -12
  90. package/dist/types/jats/importer/jats-journal-meta-parser.d.ts +4 -4
  91. package/dist/types/jats/importer/jats-parser-utils.d.ts +1 -6
  92. package/dist/types/jats/importer/jats-reference-parser.d.ts +2 -6
  93. package/dist/types/jats/importer/jats-references.d.ts +12 -0
  94. package/dist/types/jats/importer/parse-jats-article.d.ts +5 -17
  95. package/dist/types/jats/index.d.ts +1 -1
  96. package/dist/types/lib/section-group-type.d.ts +23 -0
  97. package/dist/types/lib/utils.d.ts +1 -4
  98. package/dist/types/schema/index.d.ts +4 -5
  99. package/dist/types/schema/nodes/{meta_section.d.ts → abstracts.d.ts} +1 -9
  100. package/dist/types/schema/nodes/affiliations.d.ts +17 -0
  101. package/dist/types/schema/nodes/backmatter.d.ts +17 -0
  102. package/dist/types/schema/nodes/body.d.ts +17 -0
  103. package/dist/types/schema/nodes/citation.d.ts +3 -5
  104. package/dist/types/schema/nodes/comments.d.ts +17 -0
  105. package/dist/types/schema/nodes/contributors.d.ts +17 -0
  106. package/dist/types/schema/nodes/core_section.d.ts +17 -0
  107. package/dist/types/schema/nodes/cross_reference.d.ts +1 -1
  108. package/dist/types/schema/nodes/inline_footnote.d.ts +1 -1
  109. package/dist/types/schema/nodes/keyword.d.ts +0 -1
  110. package/dist/types/schema/nodes/{contributors_element.d.ts → keyword_group.d.ts} +3 -4
  111. package/dist/types/schema/nodes/{comment_list.d.ts → keywords.d.ts} +3 -2
  112. package/dist/types/schema/nodes/manuscript.d.ts +1 -0
  113. package/dist/types/schema/types.d.ts +1 -1
  114. package/dist/types/transformer/builders.d.ts +2 -14
  115. package/dist/types/transformer/decode.d.ts +5 -9
  116. package/dist/types/transformer/encode.d.ts +4 -4
  117. package/dist/types/transformer/highlight-markers.d.ts +7 -2
  118. package/dist/types/transformer/object-types.d.ts +1 -2
  119. package/dist/types/transformer/section-category.d.ts +4 -3
  120. package/package.json +1 -6
  121. package/dist/cjs/lib/core-section-categories.js +0 -29
  122. package/dist/cjs/schema/nodes/affiliations_section.js +0 -36
  123. package/dist/cjs/schema/nodes/contributors_element.js +0 -49
  124. package/dist/cjs/schema/nodes/contributors_section.js +0 -36
  125. package/dist/es/lib/core-section-categories.js +0 -26
  126. package/dist/es/schema/nodes/affiliations_section.js +0 -32
  127. package/dist/es/schema/nodes/contributors_element.js +0 -46
  128. package/dist/es/schema/nodes/contributors_section.js +0 -32
  129. package/dist/types/lib/core-section-categories.d.ts +0 -8
  130. package/dist/types/schema/nodes/affiliations_section.d.ts +0 -11
  131. package/dist/types/schema/nodes/contributors_section.d.ts +0 -12
  132. package/dist/types/schema/nodes/keywords_group.d.ts +0 -26
  133. package/dist/types/schema/nodes/keywords_section.d.ts +0 -26
@@ -13,20 +13,43 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Journal } from '@manuscripts/json-schema';
17
16
  export declare const jatsFrontParser: {
18
- parseCounts(counts: Element | null | undefined): {
17
+ parseTitles(element: Element | null, createElement: (tagName: string) => HTMLElement): import("../../transformer").Build<import("@manuscripts/json-schema/dist/types").Titles>;
18
+ parseCounts(counts: Element | null): {
19
19
  wordCount: number | undefined;
20
20
  figureCount: number | undefined;
21
21
  tableCount: number | undefined;
22
22
  equationCount: number | undefined;
23
23
  referencesCount: number | undefined;
24
24
  genericCounts: {
25
- count: number;
25
+ count: number | undefined;
26
26
  countType: string;
27
27
  }[] | undefined;
28
28
  } | undefined;
29
- parseJournal(journalMeta: Element | null): Partial<Journal>;
29
+ parseJournal(element: Element | null): {
30
+ title: string | undefined;
31
+ templateID?: string | undefined;
32
+ ISSNs: {
33
+ [k: string]: any;
34
+ ISSN: string;
35
+ publicationType?: string | undefined;
36
+ }[];
37
+ abbreviatedTitles: {
38
+ [k: string]: any;
39
+ abbreviatedTitle: string;
40
+ abbrevType?: string | undefined;
41
+ }[];
42
+ journalIdentifiers: {
43
+ [k: string]: any;
44
+ journalID: string;
45
+ journalIDType?: string | undefined;
46
+ }[];
47
+ submittable?: boolean | undefined;
48
+ publisherName: string | undefined;
49
+ _id: string;
50
+ objectType: string;
51
+ contributions?: import("@manuscripts/json-schema/dist/types").Contribution[] | undefined;
52
+ };
30
53
  parseDates(historyNode: Element | null): {
31
54
  acceptanceDate?: number | undefined;
32
55
  correctionDate?: number | undefined;
@@ -35,18 +58,18 @@ export declare const jatsFrontParser: {
35
58
  revisionReceiveDate?: number | undefined;
36
59
  receiveDate?: number | undefined;
37
60
  } | undefined;
38
- parseSupplements(supplementNodes: Element[] | null): import("../../transformer").Build<import("@manuscripts/json-schema").Supplement>[];
39
- parseAffiliationNodes(affiliationNodes: Element[]): {
40
- affiliations: import("../../transformer").Build<import("@manuscripts/json-schema").Affiliation>[];
61
+ parseSupplements(elements: Element[] | null): import("../../transformer").Build<import("@manuscripts/json-schema/dist/types").Supplement>[];
62
+ parseAffiliations(elements: Element[]): {
63
+ affiliations: import("../../transformer").Build<import("@manuscripts/json-schema/dist/types").Affiliation>[];
41
64
  affiliationIDs: Map<string, string>;
42
65
  };
43
- parseFootnoteNodes(footnoteNodes: Element[]): {
44
- footnotes: import("../../transformer").Build<import("@manuscripts/json-schema").Footnote>[];
66
+ parseAuthorNotes(elements: Element[]): {
67
+ footnotes: import("../../transformer").Build<import("@manuscripts/json-schema/dist/types").Footnote>[];
45
68
  footnoteIDs: Map<string, string>;
46
69
  };
47
- parseCorrespNodes(correspNodes: Element[]): {
48
- correspondingList: import("../../transformer").Build<import("@manuscripts/json-schema").Corresponding>[];
70
+ parseCorresp(elements: Element[]): {
71
+ correspondingList: import("../../transformer").Build<import("@manuscripts/json-schema/dist/types").Corresponding>[];
49
72
  correspondingIDs: Map<string, string>;
50
73
  };
51
- parseAuthorNodes(authorNodes: Element[], affiliationIDs: Map<string, string>, footnoteIDs: Map<string, string>, correspondingIDs: Map<string, string>): import("../../transformer").Build<import("@manuscripts/json-schema").Contributor>[];
74
+ parseContributors(elements: Element[], affiliationIDs: Map<string, string>, footnoteIDs: Map<string, string>, correspondingIDs: Map<string, string>): import("../../transformer").Build<import("@manuscripts/json-schema/dist/types").Contributor>[];
52
75
  };
@@ -25,10 +25,10 @@ export type JournalIdentifier = {
25
25
  journalID: string;
26
26
  journalIDType?: string;
27
27
  };
28
- export declare const parseJournalIdentifiers: (journalMeta: Element) => Array<JournalIdentifier>;
29
- export declare const parseJournalAbbreviatedTitles: (journalMeta: Element) => Array<AbbreviatedTitle>;
30
- export declare const parseJournalISSNs: (journalMeta: Element) => Array<ISSN>;
31
- export declare const parseJournalMeta: (journalMeta: Element) => {
28
+ export declare const parseJournalIdentifiers: (element: Element | null) => JournalIdentifier[];
29
+ export declare const parseJournalAbbreviatedTitles: (element: Element | null) => AbbreviatedTitle[];
30
+ export declare const parseJournalISSNs: (element: Element | null) => ISSN[];
31
+ export declare const parseJournalMeta: (element: Element | null) => {
32
32
  abbreviatedTitles: AbbreviatedTitle[];
33
33
  journalIdentifiers: JournalIdentifier[];
34
34
  ISSNs: ISSN[];
@@ -13,11 +13,6 @@
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';
17
16
  import { ManuscriptNode } from '../../schema';
18
- export declare function flatten<T>(arrays: T[][]): T[];
19
- export declare const fixBodyPMNode: (output: ManuscriptNode, models: Model[], referenceIdsMap?: Map<string, string>) => {
20
- warnings: string[];
21
- replacements: Map<string, string>;
22
- };
17
+ export declare const updateDocumentIDs: (node: ManuscriptNode, replacements: Map<string, string>) => string[];
23
18
  export declare const htmlFromJatsNode: (element: Element | undefined | null, createElement: (tagName: string) => HTMLElement) => string | undefined;
@@ -13,11 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { References } from './jats-references';
16
17
  export declare const jatsReferenceParser: {
17
- parseReferences(referenceNodes: Element[], createElement: (tagName: string) => HTMLElement): {
18
- references: import("../../transformer/builders").Build<import("@manuscripts/json-schema").BibliographyItem>[];
19
- referenceIDs: Map<string, string>;
20
- referenceQueries: Map<string, string[]>;
21
- };
22
- parseCrossReferences(crossReferenceNodes: Element[], referenceIDs: Map<string, string>): (import("../../transformer/builders").Build<import("@manuscripts/json-schema").AuxiliaryObjectReference> | import("../../transformer/builders").Build<import("@manuscripts/json-schema").Citation>)[];
18
+ parseReferences(elements: Element[], createElement: (tagName: string) => HTMLElement): References;
23
19
  };
@@ -0,0 +1,12 @@
1
+ import { BibliographyItem } from '@manuscripts/json-schema';
2
+ import { JATSComment } from './jats-comments';
3
+ export declare class References {
4
+ items: Map<string, BibliographyItem>;
5
+ IDs: Map<string, string>;
6
+ comments: Map<string, JATSComment[]>;
7
+ constructor();
8
+ add(item: BibliographyItem, id: string | null, comments: JATSComment[]): void;
9
+ getBibliographyItems(): BibliographyItem[];
10
+ getComments(id: string): JATSComment[];
11
+ private getValue;
12
+ }
@@ -13,20 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Affiliation, BibliographyItem, Contributor, ElementsOrder, FootnotesOrder, Model } from '@manuscripts/json-schema';
17
- import { ManuscriptNode } from '../../schema';
18
- import { Build } from '../../transformer/builders';
19
- export declare const parseJATSFront: (front: Element) => Promise<{
20
- models: Model[];
21
- authors: Build<Contributor>[];
22
- affiliations: Build<Affiliation>[];
23
- }>;
24
- export declare const parseJATSReferences: (back: Element | null, body: Element | null, createElement: (tagName: string) => HTMLElement) => {
25
- references: Model[];
26
- crossReferences: Model[];
27
- referenceQueriesMap: Map<string, string[]> | undefined;
28
- referenceIdsMap: Map<string, string> | undefined;
29
- };
30
- export declare const parseJATSBody: (document: Document, body: Element, bibliographyItems: BibliographyItem[] | null, authors: Build<Contributor>[], affiliations: Build<Affiliation>[], refModels: Model[], referenceIdsMap: Map<string, string> | undefined, footnotesOrder?: FootnotesOrder) => ManuscriptNode;
31
- export declare const parseJATSArticle: (doc: Document) => Promise<Model[]>;
32
- export declare const getElementsOrder: (node: ManuscriptNode) => ElementsOrder[];
16
+ import { Model } from '@manuscripts/json-schema';
17
+ import { References } from './jats-references';
18
+ export declare const parseJATSFront: (doc: Document, front: Element) => Model[];
19
+ export declare const parseJATSBody: (doc: Document, body: Element, references?: References) => IterableIterator<Model>;
20
+ export declare const parseJATSArticle: (doc: Document) => Model[];
@@ -13,6 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export { parseJATSFront, parseJATSReferences, parseJATSBody, parseJATSArticle, getElementsOrder, } from './importer';
16
+ export { parseJATSFront, parseJATSBody, parseJATSArticle } from './importer';
17
17
  export * from './jats-exporter';
18
18
  export * from './jats-versions';
@@ -0,0 +1,23 @@
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 SectionGroupTypeID = 'abstracts' | 'body' | 'backmatter';
17
+ export type SectionGroupType = {
18
+ _id: SectionGroupTypeID;
19
+ title: string;
20
+ };
21
+ export declare const abstractsType: SectionGroupType;
22
+ export declare const bodyType: SectionGroupType;
23
+ export declare const backmatterType: SectionGroupType;
@@ -13,19 +13,16 @@
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';
17
16
  import { Node as ProsemirrorNode, ResolvedPos } from 'prosemirror-model';
18
17
  import { ManuscriptEditorState, ManuscriptNode } from '../schema';
19
18
  export declare function iterateChildren(node: ManuscriptNode, recurse?: boolean): Iterable<ManuscriptNode>;
20
19
  export declare const findNodePositions: (state: ManuscriptEditorState, predicate: (node: ManuscriptNode) => boolean) => number[];
21
20
  export declare const isInGraphicalAbstractSection: ($pos: ResolvedPos) => boolean;
22
21
  export declare const isInBibliographySection: ($pos: ResolvedPos) => boolean;
23
- export declare const isInAbstractsSection: ($pos: ResolvedPos) => boolean;
24
22
  export declare const findParentNodeClosestToPos: ($pos: ResolvedPos, predicate: (node: ProsemirrorNode) => boolean) => {
25
23
  pos: number;
26
24
  start: number;
27
25
  depth: number;
28
26
  node: ProsemirrorNode;
29
27
  } | undefined;
30
- export declare const getTrimmedTextContent: (node: Element | Document, querySelector: string) => string | null | undefined;
31
- export declare function modelsEqual(model: Model, model2: Model): boolean;
28
+ export declare const getTrimmedTextContent: (node: Element | Document | null, querySelector: string) => string | null | undefined;
@@ -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,18 @@ 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 createContentSections;
33
+ private createCommentNodes;
36
34
  private getComments;
37
35
  private extractListing;
38
36
  constructor(modelMap: Map<string, Model>, allowMissingElements?: boolean);
@@ -41,11 +39,9 @@ export declare class Decoder {
41
39
  createArticleNode: (manuscriptID?: string) => ManuscriptNode;
42
40
  addGeneratedLabels: (sections: Section[]) => Section[];
43
41
  parseContents: (contents: string, wrapper?: string, commentAnnotations?: CommentAnnotation[], options?: ParseOptions) => ManuscriptNode;
44
- private getKeywords;
45
42
  private getManuscriptID;
46
43
  private getFigcaption;
47
44
  private createTable;
48
45
  private createTableElementFooter;
49
46
  private createListing;
50
- private getKeywordGroups;
51
47
  }
@@ -13,17 +13,17 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { CommentAnnotation, Model } from '@manuscripts/json-schema';
16
+ import { Model } from '@manuscripts/json-schema';
17
17
  import { ManuscriptNode } from '../schema';
18
- import { Build } from './builders';
18
+ import { CommentMarker } from './highlight-markers';
19
19
  export declare const inlineContents: (node: ManuscriptNode) => string;
20
20
  export declare const inlineText: (node: ManuscriptNode) => string;
21
21
  export declare const modelFromNode: (node: ManuscriptNode, parent: ManuscriptNode, path: string[], priority: PrioritizedValue) => {
22
22
  model: Model;
23
- comments: Build<CommentAnnotation>[];
23
+ markers: CommentMarker[];
24
24
  };
25
25
  interface PrioritizedValue {
26
26
  value: number;
27
27
  }
28
- export declare const encode: (node: ManuscriptNode, preserveWithRepeatedID?: boolean) => Map<string, Model>;
28
+ export declare const encode: (node: ManuscriptNode) => Map<string, Model>;
29
29
  export {};
@@ -14,13 +14,18 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { CommentAnnotation, Model } from '@manuscripts/json-schema';
17
- import { Build } from './builders';
18
17
  export type HighlightableField = 'title' | 'caption' | 'contents';
18
+ export declare const highlightableFields: HighlightableField[];
19
19
  export declare const isHighlightableModel: (model: Model) => model is HighlightableModel;
20
20
  export interface HighlightableModel extends Model {
21
21
  contents?: string;
22
22
  title?: string;
23
23
  caption?: string;
24
24
  }
25
- export declare const extractHighlightMarkers: (model: HighlightableModel, commentAnnotationsMap: Map<string, Build<CommentAnnotation>>) => void;
25
+ export type CommentMarker = {
26
+ _id: string;
27
+ from: number;
28
+ to: number;
29
+ };
30
+ export declare const extractCommentMarkers: (model: Model) => CommentMarker[];
26
31
  export declare const insertHighlightMarkers: (contents: string, commentAnnotations: CommentAnnotation[]) => 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;