@manuscripts/transform 2.3.36 → 2.3.37-LEAN-3911.1

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 (113) hide show
  1. package/dist/cjs/jats/importer/create-article-node.js +31 -0
  2. package/dist/cjs/jats/importer/index.js +3 -3
  3. package/dist/cjs/jats/importer/jats-body-transformations.js +70 -0
  4. package/dist/cjs/jats/importer/jats-comments.js +27 -104
  5. package/dist/cjs/jats/importer/{jats-body-dom-parser.js → jats-dom-parser.js} +229 -9
  6. package/dist/cjs/jats/importer/jats-front-transformations.js +262 -0
  7. package/dist/cjs/jats/importer/jats-journal-meta-parser.js +8 -1
  8. package/dist/cjs/jats/importer/jats-parser-utils.js +39 -5
  9. package/dist/cjs/jats/importer/jats-reference-parser.js +16 -27
  10. package/dist/cjs/jats/importer/jats-references.js +18 -18
  11. package/dist/cjs/jats/importer/parse-jats-article.js +42 -78
  12. package/dist/cjs/jats/index.js +4 -3
  13. package/dist/cjs/jats/jats-exporter.js +253 -366
  14. package/dist/cjs/{transformer → jats}/labels.js +3 -3
  15. package/dist/cjs/lib/utils.js +9 -1
  16. package/dist/cjs/transformer/id.js +10 -5
  17. package/dist/cjs/transformer/index.js +0 -18
  18. package/dist/cjs/version.js +1 -1
  19. package/dist/{cjs/transformer/serializer.js → es/jats/importer/create-article-node.js} +12 -8
  20. package/dist/es/jats/importer/index.js +2 -1
  21. package/dist/es/jats/importer/jats-body-transformations.js +70 -0
  22. package/dist/es/jats/importer/jats-comments.js +26 -101
  23. package/dist/es/jats/importer/{jats-body-dom-parser.js → jats-dom-parser.js} +230 -10
  24. package/dist/es/jats/importer/jats-front-transformations.js +259 -0
  25. package/dist/es/jats/importer/jats-journal-meta-parser.js +6 -0
  26. package/dist/es/jats/importer/jats-parser-utils.js +40 -6
  27. package/dist/es/jats/importer/jats-reference-parser.js +16 -27
  28. package/dist/es/jats/importer/jats-references.js +18 -18
  29. package/dist/es/jats/importer/parse-jats-article.js +43 -77
  30. package/dist/es/jats/index.js +3 -1
  31. package/dist/es/jats/jats-exporter.js +255 -368
  32. package/dist/es/{transformer → jats}/labels.js +3 -3
  33. package/dist/es/lib/utils.js +7 -0
  34. package/dist/es/transformer/id.js +8 -3
  35. package/dist/es/transformer/index.js +0 -16
  36. package/dist/es/version.js +1 -1
  37. package/dist/{cjs/transformer/models.js → types/jats/importer/create-article-node.d.ts} +3 -3
  38. package/dist/types/jats/importer/index.d.ts +2 -1
  39. package/dist/types/jats/importer/jats-body-transformations.d.ts +5 -0
  40. package/dist/types/jats/importer/jats-comments.d.ts +4 -10
  41. package/dist/types/jats/importer/{jats-body-dom-parser.d.ts → jats-dom-parser.d.ts} +1 -1
  42. package/dist/types/jats/importer/jats-front-transformations.d.ts +38 -0
  43. package/dist/types/jats/importer/jats-journal-meta-parser.d.ts +10 -0
  44. package/dist/types/jats/importer/jats-references.d.ts +19 -8
  45. package/dist/types/jats/importer/parse-jats-article.d.ts +12 -5
  46. package/dist/types/jats/index.d.ts +3 -1
  47. package/dist/types/jats/jats-exporter.d.ts +14 -27
  48. package/dist/types/{transformer → jats}/labels.d.ts +2 -1
  49. package/dist/types/lib/utils.d.ts +3 -0
  50. package/dist/types/schema/nodes/bibliography_item.d.ts +28 -5
  51. package/dist/types/schema/nodes/contributor.d.ts +10 -0
  52. package/dist/types/schema/nodes/keyword_group.d.ts +1 -0
  53. package/dist/types/transformer/id.d.ts +5 -2
  54. package/dist/types/transformer/index.d.ts +0 -16
  55. package/dist/types/version.d.ts +1 -1
  56. package/package.json +3 -2
  57. package/dist/cjs/__tests__/data/project-dump.json +0 -825
  58. package/dist/cjs/jats/importer/jats-front-parser.js +0 -321
  59. package/dist/cjs/transformer/__tests__/__helpers__/doc.js +0 -37
  60. package/dist/cjs/transformer/builders.js +0 -219
  61. package/dist/cjs/transformer/decode.js +0 -874
  62. package/dist/cjs/transformer/document-object-types.js +0 -31
  63. package/dist/cjs/transformer/encode.js +0 -664
  64. package/dist/cjs/transformer/footnote-category.js +0 -20
  65. package/dist/cjs/transformer/footnotes-order.js +0 -60
  66. package/dist/cjs/transformer/highlight-markers.js +0 -138
  67. package/dist/cjs/transformer/html.js +0 -400
  68. package/dist/cjs/transformer/manuscript-dependencies.js +0 -21
  69. package/dist/cjs/transformer/model-map.js +0 -26
  70. package/dist/cjs/transformer/object-types.js +0 -57
  71. package/dist/cjs/transformer/project-bundle.js +0 -94
  72. package/dist/cjs/transformer/update-identifiers.js +0 -93
  73. package/dist/es/__tests__/data/project-dump.json +0 -825
  74. package/dist/es/jats/importer/jats-front-parser.js +0 -315
  75. package/dist/es/transformer/__tests__/__helpers__/doc.js +0 -29
  76. package/dist/es/transformer/builders.js +0 -186
  77. package/dist/es/transformer/decode.js +0 -864
  78. package/dist/es/transformer/document-object-types.js +0 -28
  79. package/dist/es/transformer/encode.js +0 -654
  80. package/dist/es/transformer/footnote-category.js +0 -16
  81. package/dist/es/transformer/footnotes-order.js +0 -55
  82. package/dist/es/transformer/highlight-markers.js +0 -132
  83. package/dist/es/transformer/html.js +0 -393
  84. package/dist/es/transformer/manuscript-dependencies.js +0 -17
  85. package/dist/es/transformer/model-map.js +0 -22
  86. package/dist/es/transformer/models.js +0 -16
  87. package/dist/es/transformer/object-types.js +0 -52
  88. package/dist/es/transformer/project-bundle.js +0 -85
  89. package/dist/es/transformer/serializer.js +0 -17
  90. package/dist/es/transformer/update-identifiers.js +0 -87
  91. package/dist/types/jats/importer/jats-front-parser.d.ts +0 -84
  92. package/dist/types/transformer/__tests__/__helpers__/doc.d.ts +0 -18
  93. package/dist/types/transformer/builders.d.ts +0 -61
  94. package/dist/types/transformer/decode.d.ts +0 -51
  95. package/dist/types/transformer/document-object-types.d.ts +0 -17
  96. package/dist/types/transformer/encode.d.ts +0 -29
  97. package/dist/types/transformer/footnote-category.d.ts +0 -17
  98. package/dist/types/transformer/footnotes-order.d.ts +0 -22
  99. package/dist/types/transformer/highlight-markers.d.ts +0 -31
  100. package/dist/types/transformer/html.d.ts +0 -36
  101. package/dist/types/transformer/manuscript-dependencies.d.ts +0 -4
  102. package/dist/types/transformer/model-map.d.ts +0 -19
  103. package/dist/types/transformer/models.d.ts +0 -48
  104. package/dist/types/transformer/object-types.d.ts +0 -30
  105. package/dist/types/transformer/project-bundle.d.ts +0 -30
  106. package/dist/types/transformer/serializer.d.ts +0 -19
  107. package/dist/types/transformer/update-identifiers.d.ts +0 -23
  108. /package/dist/cjs/{transformer → jats}/filename.js +0 -0
  109. /package/dist/cjs/{transformer → jats}/timestamp.js +0 -0
  110. /package/dist/es/{transformer → jats}/filename.js +0 -0
  111. /package/dist/es/{transformer → jats}/timestamp.js +0 -0
  112. /package/dist/types/{transformer → jats}/filename.d.ts +0 -0
  113. /package/dist/types/{transformer → jats}/timestamp.d.ts +0 -0
@@ -1,48 +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 { Model, UserProfile } from '@manuscripts/json-schema';
17
- import { ManuscriptNode } from '../schema';
18
- export interface Attachment {
19
- id: string;
20
- data: Blob | ArrayBuffer;
21
- type: string;
22
- }
23
- export interface ModelAttachment {
24
- attachment?: Attachment;
25
- }
26
- export type ModelWithAttachment = Model & ModelAttachment;
27
- export interface UserProfileWithAvatar extends UserProfile {
28
- avatar?: string;
29
- }
30
- export interface ContainedProps {
31
- containerID: string;
32
- }
33
- export type ContainedModel = Model & ContainedProps;
34
- export interface ManuscriptProps {
35
- manuscriptID: string;
36
- }
37
- export type ManuscriptModel = ContainedModel & ManuscriptProps;
38
- export interface CommentSelector {
39
- from: number;
40
- to: number;
41
- }
42
- export interface PlaceholderElement extends ContainedModel {
43
- elementType: 'p';
44
- }
45
- export interface Selected {
46
- pos: number;
47
- node: ManuscriptNode;
48
- }
@@ -1,30 +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 { CommentAnnotation, Figure, Keyword, Manuscript, Model, ObjectTypes, Table } from '@manuscripts/json-schema';
17
- import { ManuscriptModel } from './models';
18
- export declare enum ExtraObjectTypes {
19
- PlaceholderElement = "MPPlaceholderElement",
20
- GeneralTableFootnote = "MPGeneralTableFootnote"
21
- }
22
- export declare const elementObjects: ObjectTypes[];
23
- export declare const manuscriptObjects: ObjectTypes[];
24
- export declare const isManuscriptModel: (model: Model) => model is ManuscriptModel;
25
- export declare const hasObjectType: <T extends Model>(objectType: string) => (model: Model) => model is T;
26
- export declare const isFigure: (model: Model) => model is Figure;
27
- export declare const isManuscript: (model: Model) => model is Manuscript;
28
- export declare const isTable: (model: Model) => model is Table;
29
- export declare const isCommentAnnotation: (model: Model) => model is CommentAnnotation;
30
- export declare const isKeyword: (model: Model) => model is Keyword;
@@ -1,30 +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 { Journal, Manuscript, Model, ObjectTypes, Titles } from '@manuscripts/json-schema';
17
- import { ManuscriptModel } from './models';
18
- export interface ProjectBundle {
19
- version: string;
20
- data: Model[];
21
- }
22
- export declare const parseProjectBundle: (projectBundle: ProjectBundle, manuscriptID?: string) => {
23
- doc: import("prosemirror-model").Node;
24
- modelMap: Map<string, Model>;
25
- };
26
- export declare const findManuscript: (modelMap: Map<string, Model>) => Manuscript;
27
- export declare const findJournal: (modelMap: Map<string, Model>) => Journal | null;
28
- export declare const findManuscriptModelByType: <T extends ManuscriptModel>(modelMap: Map<string, Model>, manuscript: Manuscript, objectType: ObjectTypes) => T | undefined;
29
- export declare const findManuscriptById: (modelMap: Map<string, Model>, manuscriptID: string) => Manuscript;
30
- export declare const findTitles: (modelMap: Map<string, Model>) => Titles;
@@ -1,19 +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 serializeToString from 'w3c-xmlserializer';
17
- export declare const xmlSerializer: {
18
- serializeToString: typeof serializeToString;
19
- };
@@ -1,23 +0,0 @@
1
- /*!
2
- * © 2020 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { Model } from '@manuscripts/json-schema';
17
- import JSZip from 'jszip';
18
- export declare const updateIdentifiers: (data: Model[]) => Promise<{
19
- data: Model[];
20
- idMap: Map<string, string>;
21
- }>;
22
- export declare const updateAttachmentPath: (oldPath: string, idMap: Map<string, string>) => string | undefined;
23
- export declare const updateAttachments: (zip: JSZip, idMap: Map<string, string>) => Promise<void>;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes