@manuscripts/transform 1.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 (315) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +193 -0
  3. package/dist/cjs/errors.js +17 -0
  4. package/dist/cjs/index.js +27 -0
  5. package/dist/cjs/jats/importer/index.js +24 -0
  6. package/dist/cjs/jats/importer/jats-body-dom-parser.js +650 -0
  7. package/dist/cjs/jats/importer/jats-body-transformations.js +269 -0
  8. package/dist/cjs/jats/importer/jats-comments.js +131 -0
  9. package/dist/cjs/jats/importer/jats-front-parser.js +341 -0
  10. package/dist/cjs/jats/importer/jats-journal-meta-parser.js +77 -0
  11. package/dist/cjs/jats/importer/jats-parser-utils.js +145 -0
  12. package/dist/cjs/jats/importer/jats-reference-parser.js +180 -0
  13. package/dist/cjs/jats/importer/parse-jats-article.js +237 -0
  14. package/dist/cjs/jats/index.js +40 -0
  15. package/dist/cjs/jats/jats-exporter.js +1569 -0
  16. package/dist/cjs/jats/jats-versions.js +41 -0
  17. package/dist/cjs/lib/attributes.js +26 -0
  18. package/dist/cjs/lib/html.js +48 -0
  19. package/dist/cjs/lib/styled-content.js +28 -0
  20. package/dist/cjs/lib/table-cell-styles.js +52 -0
  21. package/dist/cjs/lib/utils.js +66 -0
  22. package/dist/cjs/mathjax/index.js +41 -0
  23. package/dist/cjs/mathjax/mathjax-packages.js +20 -0
  24. package/dist/cjs/mathjax/mathml-to-svg.js +56 -0
  25. package/dist/cjs/mathjax/tex-to-mathml.js +49 -0
  26. package/dist/cjs/mathjax/tex-to-svg.js +59 -0
  27. package/dist/cjs/schema/groups.js +31 -0
  28. package/dist/cjs/schema/index.js +195 -0
  29. package/dist/cjs/schema/marks.js +159 -0
  30. package/dist/cjs/schema/nodes/attribution.js +32 -0
  31. package/dist/cjs/schema/nodes/bibliography_element.js +44 -0
  32. package/dist/cjs/schema/nodes/bibliography_item.js +101 -0
  33. package/dist/cjs/schema/nodes/bibliography_section.js +46 -0
  34. package/dist/cjs/schema/nodes/blockquote_element.js +62 -0
  35. package/dist/cjs/schema/nodes/caption.js +52 -0
  36. package/dist/cjs/schema/nodes/caption_title.js +51 -0
  37. package/dist/cjs/schema/nodes/citation.js +52 -0
  38. package/dist/cjs/schema/nodes/comment.js +26 -0
  39. package/dist/cjs/schema/nodes/cross_reference.js +58 -0
  40. package/dist/cjs/schema/nodes/doc.js +21 -0
  41. package/dist/cjs/schema/nodes/equation.js +55 -0
  42. package/dist/cjs/schema/nodes/equation_element.js +52 -0
  43. package/dist/cjs/schema/nodes/figcaption.js +31 -0
  44. package/dist/cjs/schema/nodes/figure.js +52 -0
  45. package/dist/cjs/schema/nodes/figure_element.js +78 -0
  46. package/dist/cjs/schema/nodes/footnote.js +67 -0
  47. package/dist/cjs/schema/nodes/footnotes_element.js +54 -0
  48. package/dist/cjs/schema/nodes/footnotes_section.js +45 -0
  49. package/dist/cjs/schema/nodes/graphical_abstract_section.js +46 -0
  50. package/dist/cjs/schema/nodes/hard_break.js +30 -0
  51. package/dist/cjs/schema/nodes/highlight_marker.js +53 -0
  52. package/dist/cjs/schema/nodes/inline_equation.js +58 -0
  53. package/dist/cjs/schema/nodes/inline_footnote.js +51 -0
  54. package/dist/cjs/schema/nodes/keywords_element.js +52 -0
  55. package/dist/cjs/schema/nodes/keywords_section.js +46 -0
  56. package/dist/cjs/schema/nodes/link.js +61 -0
  57. package/dist/cjs/schema/nodes/list.js +121 -0
  58. package/dist/cjs/schema/nodes/listing.js +73 -0
  59. package/dist/cjs/schema/nodes/listing_element.js +52 -0
  60. package/dist/cjs/schema/nodes/manuscript.js +46 -0
  61. package/dist/cjs/schema/nodes/missing_figure.js +50 -0
  62. package/dist/cjs/schema/nodes/paragraph.js +63 -0
  63. package/dist/cjs/schema/nodes/placeholder.js +49 -0
  64. package/dist/cjs/schema/nodes/placeholder_element.js +48 -0
  65. package/dist/cjs/schema/nodes/pullquote_element.js +65 -0
  66. package/dist/cjs/schema/nodes/section.js +94 -0
  67. package/dist/cjs/schema/nodes/section_label.js +30 -0
  68. package/dist/cjs/schema/nodes/section_title.js +48 -0
  69. package/dist/cjs/schema/nodes/table.js +70 -0
  70. package/dist/cjs/schema/nodes/table_col.js +57 -0
  71. package/dist/cjs/schema/nodes/table_element.js +62 -0
  72. package/dist/cjs/schema/nodes/table_row.js +123 -0
  73. package/dist/cjs/schema/nodes/text.js +21 -0
  74. package/dist/cjs/schema/nodes/toc_element.js +52 -0
  75. package/dist/cjs/schema/nodes/toc_section.js +46 -0
  76. package/dist/cjs/schema/types.js +17 -0
  77. package/dist/cjs/tests.js +30 -0
  78. package/dist/cjs/transformer/builders.js +305 -0
  79. package/dist/cjs/transformer/bundles-data.js +36 -0
  80. package/dist/cjs/transformer/bundles.js +32 -0
  81. package/dist/cjs/transformer/decode.js +619 -0
  82. package/dist/cjs/transformer/document-object-types.js +31 -0
  83. package/dist/cjs/transformer/encode.js +545 -0
  84. package/dist/cjs/transformer/filename.js +27 -0
  85. package/dist/cjs/transformer/footnote-category.js +20 -0
  86. package/dist/cjs/transformer/footnotes-order.js +59 -0
  87. package/dist/cjs/transformer/highlight-markers.js +126 -0
  88. package/dist/cjs/transformer/html.js +414 -0
  89. package/dist/cjs/transformer/id.js +28 -0
  90. package/dist/cjs/transformer/index.js +54 -0
  91. package/dist/cjs/transformer/labels.js +85 -0
  92. package/dist/cjs/transformer/manuscript-dependencies.js +74 -0
  93. package/dist/cjs/transformer/model-map.js +26 -0
  94. package/dist/cjs/transformer/models.js +17 -0
  95. package/dist/cjs/transformer/node-names.js +42 -0
  96. package/dist/cjs/transformer/node-title.js +87 -0
  97. package/dist/cjs/transformer/node-types.js +62 -0
  98. package/dist/cjs/transformer/object-types.js +57 -0
  99. package/dist/cjs/transformer/project-bundle.js +86 -0
  100. package/dist/cjs/transformer/section-category.js +222 -0
  101. package/dist/cjs/transformer/serializer.js +23 -0
  102. package/dist/cjs/transformer/shared-data.js +31 -0
  103. package/dist/cjs/transformer/tei-grobid-importer.js +121 -0
  104. package/dist/cjs/transformer/timestamp.js +20 -0
  105. package/dist/cjs/transformer/update-identifiers.js +93 -0
  106. package/dist/cjs/types.js +2 -0
  107. package/dist/es/errors.js +12 -0
  108. package/dist/es/index.js +9 -0
  109. package/dist/es/jats/importer/index.js +16 -0
  110. package/dist/es/jats/importer/jats-body-dom-parser.js +644 -0
  111. package/dist/es/jats/importer/jats-body-transformations.js +266 -0
  112. package/dist/es/jats/importer/jats-comments.js +124 -0
  113. package/dist/es/jats/importer/jats-front-parser.js +335 -0
  114. package/dist/es/jats/importer/jats-journal-meta-parser.js +70 -0
  115. package/dist/es/jats/importer/jats-parser-utils.js +139 -0
  116. package/dist/es/jats/importer/jats-reference-parser.js +177 -0
  117. package/dist/es/jats/importer/parse-jats-article.js +229 -0
  118. package/dist/es/jats/index.js +18 -0
  119. package/dist/es/jats/jats-exporter.js +1561 -0
  120. package/dist/es/jats/jats-versions.js +36 -0
  121. package/dist/es/lib/attributes.js +22 -0
  122. package/dist/es/lib/html.js +43 -0
  123. package/dist/es/lib/styled-content.js +23 -0
  124. package/dist/es/lib/table-cell-styles.js +47 -0
  125. package/dist/es/lib/utils.js +59 -0
  126. package/dist/es/mathjax/index.js +12 -0
  127. package/dist/es/mathjax/mathjax-packages.js +17 -0
  128. package/dist/es/mathjax/mathml-to-svg.js +52 -0
  129. package/dist/es/mathjax/tex-to-mathml.js +45 -0
  130. package/dist/es/mathjax/tex-to-svg.js +55 -0
  131. package/dist/es/schema/groups.js +27 -0
  132. package/dist/es/schema/index.js +178 -0
  133. package/dist/es/schema/marks.js +156 -0
  134. package/dist/es/schema/nodes/attribution.js +29 -0
  135. package/dist/es/schema/nodes/bibliography_element.js +41 -0
  136. package/dist/es/schema/nodes/bibliography_item.js +98 -0
  137. package/dist/es/schema/nodes/bibliography_section.js +42 -0
  138. package/dist/es/schema/nodes/blockquote_element.js +58 -0
  139. package/dist/es/schema/nodes/caption.js +49 -0
  140. package/dist/es/schema/nodes/caption_title.js +48 -0
  141. package/dist/es/schema/nodes/citation.js +48 -0
  142. package/dist/es/schema/nodes/comment.js +23 -0
  143. package/dist/es/schema/nodes/cross_reference.js +55 -0
  144. package/dist/es/schema/nodes/doc.js +18 -0
  145. package/dist/es/schema/nodes/equation.js +52 -0
  146. package/dist/es/schema/nodes/equation_element.js +49 -0
  147. package/dist/es/schema/nodes/figcaption.js +28 -0
  148. package/dist/es/schema/nodes/figure.js +49 -0
  149. package/dist/es/schema/nodes/figure_element.js +74 -0
  150. package/dist/es/schema/nodes/footnote.js +63 -0
  151. package/dist/es/schema/nodes/footnotes_element.js +50 -0
  152. package/dist/es/schema/nodes/footnotes_section.js +41 -0
  153. package/dist/es/schema/nodes/graphical_abstract_section.js +42 -0
  154. package/dist/es/schema/nodes/hard_break.js +27 -0
  155. package/dist/es/schema/nodes/highlight_marker.js +49 -0
  156. package/dist/es/schema/nodes/inline_equation.js +55 -0
  157. package/dist/es/schema/nodes/inline_footnote.js +47 -0
  158. package/dist/es/schema/nodes/keywords_element.js +49 -0
  159. package/dist/es/schema/nodes/keywords_section.js +42 -0
  160. package/dist/es/schema/nodes/link.js +58 -0
  161. package/dist/es/schema/nodes/list.js +117 -0
  162. package/dist/es/schema/nodes/listing.js +69 -0
  163. package/dist/es/schema/nodes/listing_element.js +49 -0
  164. package/dist/es/schema/nodes/manuscript.js +43 -0
  165. package/dist/es/schema/nodes/missing_figure.js +47 -0
  166. package/dist/es/schema/nodes/paragraph.js +59 -0
  167. package/dist/es/schema/nodes/placeholder.js +46 -0
  168. package/dist/es/schema/nodes/placeholder_element.js +45 -0
  169. package/dist/es/schema/nodes/pullquote_element.js +61 -0
  170. package/dist/es/schema/nodes/section.js +90 -0
  171. package/dist/es/schema/nodes/section_label.js +26 -0
  172. package/dist/es/schema/nodes/section_title.js +44 -0
  173. package/dist/es/schema/nodes/table.js +67 -0
  174. package/dist/es/schema/nodes/table_col.js +54 -0
  175. package/dist/es/schema/nodes/table_element.js +59 -0
  176. package/dist/es/schema/nodes/table_row.js +120 -0
  177. package/dist/es/schema/nodes/text.js +18 -0
  178. package/dist/es/schema/nodes/toc_element.js +49 -0
  179. package/dist/es/schema/nodes/toc_section.js +42 -0
  180. package/dist/es/schema/types.js +16 -0
  181. package/dist/es/tests.js +28 -0
  182. package/dist/es/transformer/builders.js +261 -0
  183. package/dist/es/transformer/bundles-data.js +8 -0
  184. package/dist/es/transformer/bundles.js +27 -0
  185. package/dist/es/transformer/decode.js +608 -0
  186. package/dist/es/transformer/document-object-types.js +28 -0
  187. package/dist/es/transformer/encode.js +535 -0
  188. package/dist/es/transformer/filename.js +23 -0
  189. package/dist/es/transformer/footnote-category.js +16 -0
  190. package/dist/es/transformer/footnotes-order.js +53 -0
  191. package/dist/es/transformer/highlight-markers.js +120 -0
  192. package/dist/es/transformer/html.js +407 -0
  193. package/dist/es/transformer/id.js +23 -0
  194. package/dist/es/transformer/index.js +38 -0
  195. package/dist/es/transformer/labels.js +81 -0
  196. package/dist/es/transformer/manuscript-dependencies.js +64 -0
  197. package/dist/es/transformer/model-map.js +22 -0
  198. package/dist/es/transformer/models.js +16 -0
  199. package/dist/es/transformer/node-names.js +39 -0
  200. package/dist/es/transformer/node-title.js +82 -0
  201. package/dist/es/transformer/node-types.js +55 -0
  202. package/dist/es/transformer/object-types.js +52 -0
  203. package/dist/es/transformer/project-bundle.js +77 -0
  204. package/dist/es/transformer/section-category.js +210 -0
  205. package/dist/es/transformer/serializer.js +17 -0
  206. package/dist/es/transformer/shared-data.js +1 -0
  207. package/dist/es/transformer/tei-grobid-importer.js +115 -0
  208. package/dist/es/transformer/timestamp.js +16 -0
  209. package/dist/es/transformer/update-identifiers.js +87 -0
  210. package/dist/es/types.js +1 -0
  211. package/dist/types/errors.d.ts +6 -0
  212. package/dist/types/index.d.ts +9 -0
  213. package/dist/types/jats/importer/index.d.ts +16 -0
  214. package/dist/types/jats/importer/jats-body-dom-parser.d.ts +24 -0
  215. package/dist/types/jats/importer/jats-body-transformations.d.ts +31 -0
  216. package/dist/types/jats/importer/jats-comments.d.ts +26 -0
  217. package/dist/types/jats/importer/jats-front-parser.d.ts +62 -0
  218. package/dist/types/jats/importer/jats-journal-meta-parser.d.ts +37 -0
  219. package/dist/types/jats/importer/jats-parser-utils.d.ts +23 -0
  220. package/dist/types/jats/importer/jats-reference-parser.d.ts +23 -0
  221. package/dist/types/jats/importer/parse-jats-article.d.ts +30 -0
  222. package/dist/types/jats/index.d.ts +18 -0
  223. package/dist/types/jats/jats-exporter.d.ts +72 -0
  224. package/dist/types/jats/jats-versions.d.ts +23 -0
  225. package/dist/types/lib/attributes.d.ts +20 -0
  226. package/dist/types/lib/html.d.ts +17 -0
  227. package/dist/types/lib/styled-content.d.ts +22 -0
  228. package/dist/types/lib/table-cell-styles.d.ts +27 -0
  229. package/dist/types/lib/utils.d.ts +26 -0
  230. package/dist/types/mathjax/index.d.ts +3 -0
  231. package/dist/types/mathjax/mathjax-packages.d.ts +16 -0
  232. package/dist/types/mathjax/mathml-to-svg.d.ts +17 -0
  233. package/dist/types/mathjax/tex-to-mathml.d.ts +17 -0
  234. package/dist/types/mathjax/tex-to-svg.d.ts +17 -0
  235. package/dist/types/schema/groups.d.ts +22 -0
  236. package/dist/types/schema/index.d.ts +65 -0
  237. package/dist/types/schema/marks.d.ts +27 -0
  238. package/dist/types/schema/nodes/attribution.d.ts +21 -0
  239. package/dist/types/schema/nodes/bibliography_element.d.ts +26 -0
  240. package/dist/types/schema/nodes/bibliography_item.d.ts +36 -0
  241. package/dist/types/schema/nodes/bibliography_section.d.ts +26 -0
  242. package/dist/types/schema/nodes/blockquote_element.d.ts +28 -0
  243. package/dist/types/schema/nodes/caption.d.ts +25 -0
  244. package/dist/types/schema/nodes/caption_title.d.ts +25 -0
  245. package/dist/types/schema/nodes/citation.d.ts +27 -0
  246. package/dist/types/schema/nodes/comment.d.ts +31 -0
  247. package/dist/types/schema/nodes/cross_reference.d.ts +26 -0
  248. package/dist/types/schema/nodes/doc.d.ts +17 -0
  249. package/dist/types/schema/nodes/equation.d.ts +28 -0
  250. package/dist/types/schema/nodes/equation_element.d.ts +29 -0
  251. package/dist/types/schema/nodes/figcaption.d.ts +21 -0
  252. package/dist/types/schema/nodes/figure.d.ts +25 -0
  253. package/dist/types/schema/nodes/figure_element.d.ts +44 -0
  254. package/dist/types/schema/nodes/footnote.d.ts +32 -0
  255. package/dist/types/schema/nodes/footnotes_element.d.ts +28 -0
  256. package/dist/types/schema/nodes/footnotes_section.d.ts +26 -0
  257. package/dist/types/schema/nodes/graphical_abstract_section.d.ts +26 -0
  258. package/dist/types/schema/nodes/hard_break.d.ts +21 -0
  259. package/dist/types/schema/nodes/highlight_marker.d.ts +29 -0
  260. package/dist/types/schema/nodes/inline_equation.d.ts +28 -0
  261. package/dist/types/schema/nodes/inline_footnote.d.ts +27 -0
  262. package/dist/types/schema/nodes/keywords_element.d.ts +27 -0
  263. package/dist/types/schema/nodes/keywords_section.d.ts +26 -0
  264. package/dist/types/schema/nodes/link.d.ts +26 -0
  265. package/dist/types/schema/nodes/list.d.ts +39 -0
  266. package/dist/types/schema/nodes/listing.d.ts +33 -0
  267. package/dist/types/schema/nodes/listing_element.d.ts +29 -0
  268. package/dist/types/schema/nodes/manuscript.d.ts +23 -0
  269. package/dist/types/schema/nodes/missing_figure.d.ts +23 -0
  270. package/dist/types/schema/nodes/paragraph.d.ts +30 -0
  271. package/dist/types/schema/nodes/placeholder.d.ts +26 -0
  272. package/dist/types/schema/nodes/placeholder_element.d.ts +25 -0
  273. package/dist/types/schema/nodes/pullquote_element.d.ts +28 -0
  274. package/dist/types/schema/nodes/section.d.ts +36 -0
  275. package/dist/types/schema/nodes/section_label.d.ts +22 -0
  276. package/dist/types/schema/nodes/section_title.d.ts +22 -0
  277. package/dist/types/schema/nodes/table.d.ts +27 -0
  278. package/dist/types/schema/nodes/table_col.d.ts +24 -0
  279. package/dist/types/schema/nodes/table_element.d.ts +35 -0
  280. package/dist/types/schema/nodes/table_row.d.ts +41 -0
  281. package/dist/types/schema/nodes/text.d.ts +17 -0
  282. package/dist/types/schema/nodes/toc_element.d.ts +27 -0
  283. package/dist/types/schema/nodes/toc_section.d.ts +26 -0
  284. package/dist/types/schema/types.d.ts +45 -0
  285. package/dist/types/tests.d.ts +16 -0
  286. package/dist/types/transformer/builders.d.ts +74 -0
  287. package/dist/types/transformer/bundles-data.d.ts +3 -0
  288. package/dist/types/transformer/bundles.d.ts +3 -0
  289. package/dist/types/transformer/decode.d.ts +38 -0
  290. package/dist/types/transformer/document-object-types.d.ts +17 -0
  291. package/dist/types/transformer/encode.d.ts +29 -0
  292. package/dist/types/transformer/filename.d.ts +16 -0
  293. package/dist/types/transformer/footnote-category.d.ts +17 -0
  294. package/dist/types/transformer/footnotes-order.d.ts +23 -0
  295. package/dist/types/transformer/highlight-markers.d.ts +26 -0
  296. package/dist/types/transformer/html.d.ts +36 -0
  297. package/dist/types/transformer/id.d.ts +20 -0
  298. package/dist/types/transformer/index.d.ts +38 -0
  299. package/dist/types/transformer/labels.d.ts +24 -0
  300. package/dist/types/transformer/manuscript-dependencies.d.ts +12 -0
  301. package/dist/types/transformer/model-map.d.ts +19 -0
  302. package/dist/types/transformer/models.d.ts +48 -0
  303. package/dist/types/transformer/node-names.d.ts +17 -0
  304. package/dist/types/transformer/node-title.d.ts +19 -0
  305. package/dist/types/transformer/node-types.d.ts +22 -0
  306. package/dist/types/transformer/object-types.d.ts +29 -0
  307. package/dist/types/transformer/project-bundle.d.ts +30 -0
  308. package/dist/types/transformer/section-category.d.ts +28 -0
  309. package/dist/types/transformer/serializer.d.ts +19 -0
  310. package/dist/types/transformer/shared-data.d.ts +2 -0
  311. package/dist/types/transformer/tei-grobid-importer.d.ts +20 -0
  312. package/dist/types/transformer/timestamp.d.ts +16 -0
  313. package/dist/types/transformer/update-identifiers.d.ts +23 -0
  314. package/dist/types/types.d.ts +2 -0
  315. package/package.json +89 -0
@@ -0,0 +1,45 @@
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.isFootnotesSectionNode = exports.footnotesSection = void 0;
19
+ exports.footnotesSection = {
20
+ content: 'section_title (footnotes_element | placeholder_element)+',
21
+ attrs: {
22
+ id: { default: '' },
23
+ dataTracked: { default: null },
24
+ },
25
+ group: 'block sections',
26
+ selectable: false,
27
+ parseDOM: [
28
+ {
29
+ tag: 'section.footnotes',
30
+ },
31
+ ],
32
+ toDOM: (node) => {
33
+ const footnotesSectionNode = node;
34
+ return [
35
+ 'section',
36
+ {
37
+ id: footnotesSectionNode.attrs.id,
38
+ class: 'footnotes',
39
+ },
40
+ 0,
41
+ ];
42
+ },
43
+ };
44
+ const isFootnotesSectionNode = (node) => node.type === node.type.schema.nodes.footnotes_section;
45
+ exports.isFootnotesSectionNode = isFootnotesSectionNode;
@@ -0,0 +1,46 @@
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.isGraphicalAbstractSectionNode = exports.graphicalAbstractSection = void 0;
19
+ exports.graphicalAbstractSection = {
20
+ content: 'section_title (figure_element | placeholder)',
21
+ attrs: {
22
+ id: { default: '' },
23
+ category: { default: '' },
24
+ },
25
+ group: 'block sections',
26
+ selectable: false,
27
+ parseDOM: [
28
+ {
29
+ tag: 'section.graphical-abstract',
30
+ },
31
+ ],
32
+ toDOM: (node) => {
33
+ const graphicalAbstractSectionNode = node;
34
+ return [
35
+ 'section',
36
+ {
37
+ id: graphicalAbstractSectionNode.attrs.id,
38
+ class: 'graphical-abstract',
39
+ spellcheck: 'false',
40
+ },
41
+ 0,
42
+ ];
43
+ },
44
+ };
45
+ const isGraphicalAbstractSectionNode = (node) => node.type === node.type.schema.nodes.graphical_abstract_section;
46
+ exports.isGraphicalAbstractSectionNode = isGraphicalAbstractSectionNode;
@@ -0,0 +1,30 @@
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.hardBreak = void 0;
19
+ exports.hardBreak = {
20
+ inline: true,
21
+ group: 'inline',
22
+ selectable: false,
23
+ attrs: {
24
+ dataTracked: { default: null },
25
+ },
26
+ parseDOM: [{ tag: 'br' }],
27
+ toDOM() {
28
+ return ['br'];
29
+ },
30
+ };
@@ -0,0 +1,53 @@
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.isHighlightMarkerNode = exports.highlightMarker = void 0;
19
+ exports.highlightMarker = {
20
+ inline: true,
21
+ group: 'inline',
22
+ atom: true,
23
+ attrs: {
24
+ id: { default: '' },
25
+ tid: { default: '' },
26
+ position: { default: '' },
27
+ dataTracked: { default: null },
28
+ },
29
+ parseDOM: [
30
+ {
31
+ tag: 'span.highlight-marker',
32
+ getAttrs: (p) => {
33
+ const dom = p;
34
+ return {
35
+ id: dom.getAttribute('id'),
36
+ tid: dom.getAttribute('data-target-id'),
37
+ position: dom.getAttribute('data-position'),
38
+ };
39
+ },
40
+ },
41
+ ],
42
+ toDOM: (node) => {
43
+ const highlightMarkerNode = node;
44
+ const dom = document.createElement('span');
45
+ dom.className = 'highlight-marker';
46
+ dom.setAttribute('id', highlightMarkerNode.attrs.id);
47
+ dom.setAttribute('data-target-id', highlightMarkerNode.attrs.tid);
48
+ dom.setAttribute('data-position', highlightMarkerNode.attrs.position);
49
+ return dom;
50
+ },
51
+ };
52
+ const isHighlightMarkerNode = (node) => node.type === node.type.schema.nodes.highlight_marker;
53
+ exports.isHighlightMarkerNode = isHighlightMarkerNode;
@@ -0,0 +1,58 @@
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.inlineEquation = void 0;
19
+ const manuscripts_json_schema_1 = require("@manuscripts/manuscripts-json-schema");
20
+ exports.inlineEquation = {
21
+ attrs: {
22
+ id: { default: '' },
23
+ MathMLRepresentation: { default: '' },
24
+ SVGRepresentation: { default: '' },
25
+ TeXRepresentation: { default: '' },
26
+ dataTracked: { default: null },
27
+ },
28
+ atom: true,
29
+ inline: true,
30
+ draggable: true,
31
+ group: 'inline',
32
+ parseDOM: [
33
+ {
34
+ tag: `span.${manuscripts_json_schema_1.ObjectTypes.InlineMathFragment}`,
35
+ getAttrs: (p) => {
36
+ const dom = p;
37
+ return {
38
+ id: dom.getAttribute('id'),
39
+ MathMLRepresentation: dom.getAttribute('data-mathml-representation') || '',
40
+ SVGRepresentation: dom.innerHTML || '',
41
+ TeXRepresentation: dom.getAttribute('data-tex-representation') || '',
42
+ };
43
+ },
44
+ },
45
+ ],
46
+ toDOM: (node) => {
47
+ const inlineEquationNode = node;
48
+ const dom = document.createElement('span');
49
+ dom.classList.add(manuscripts_json_schema_1.ObjectTypes.InlineMathFragment);
50
+ dom.setAttribute('id', inlineEquationNode.attrs.id);
51
+ dom.setAttribute('data-tex-representation', inlineEquationNode.attrs.TeXRepresentation);
52
+ if (inlineEquationNode.attrs.MathMLRepresentation) {
53
+ dom.setAttribute('data-mathml-representation', inlineEquationNode.attrs.MathMLRepresentation);
54
+ }
55
+ dom.innerHTML = inlineEquationNode.attrs.SVGRepresentation;
56
+ return dom;
57
+ },
58
+ };
@@ -0,0 +1,51 @@
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.isInlineFootnoteNode = exports.inlineFootnote = void 0;
19
+ exports.inlineFootnote = {
20
+ attrs: {
21
+ rid: { default: '' },
22
+ contents: { default: '' },
23
+ dataTracked: { default: null },
24
+ },
25
+ atom: true,
26
+ inline: true,
27
+ draggable: true,
28
+ group: 'inline',
29
+ parseDOM: [
30
+ {
31
+ tag: 'span.footnote',
32
+ getAttrs: (p) => {
33
+ const dom = p;
34
+ return {
35
+ rid: dom.getAttribute('data-reference-id'),
36
+ contents: dom.textContent,
37
+ };
38
+ },
39
+ },
40
+ ],
41
+ toDOM: (node) => {
42
+ const inlineFootnoteNode = node;
43
+ const dom = document.createElement('span');
44
+ dom.className = 'footnote';
45
+ dom.setAttribute('data-reference-id', inlineFootnoteNode.attrs.rid);
46
+ dom.textContent = inlineFootnoteNode.attrs.contents;
47
+ return dom;
48
+ },
49
+ };
50
+ const isInlineFootnoteNode = (node) => node.type === node.type.schema.nodes.inline_footnote;
51
+ exports.isInlineFootnoteNode = isInlineFootnoteNode;
@@ -0,0 +1,52 @@
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.keywordsElement = void 0;
19
+ const html_1 = require("../../lib/html");
20
+ const createBodyElement = (node) => {
21
+ const dom = document.createElement('div');
22
+ dom.className = 'manuscript-keywords';
23
+ dom.id = node.attrs.id;
24
+ return dom;
25
+ };
26
+ exports.keywordsElement = {
27
+ atom: true,
28
+ attrs: {
29
+ id: { default: '' },
30
+ contents: { default: '' },
31
+ paragraphStyle: { default: '' },
32
+ dataTracked: { default: null },
33
+ },
34
+ group: 'block element',
35
+ selectable: false,
36
+ parseDOM: [
37
+ {
38
+ tag: 'div.manuscript-keywords',
39
+ getAttrs: (div) => {
40
+ const dom = div;
41
+ return {
42
+ contents: dom.innerHTML,
43
+ };
44
+ },
45
+ },
46
+ ],
47
+ toDOM: (node) => {
48
+ const keywordsElementNode = node;
49
+ return ((0, html_1.nodeFromHTML)(keywordsElementNode.attrs.contents) ||
50
+ createBodyElement(keywordsElementNode));
51
+ },
52
+ };
@@ -0,0 +1,46 @@
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.isKeywordsSectionNode = exports.keywordsSection = void 0;
19
+ exports.keywordsSection = {
20
+ content: 'section_title (keywords_element | placeholder_element)',
21
+ attrs: {
22
+ id: { default: '' },
23
+ dataTracked: { default: null },
24
+ },
25
+ group: 'block sections',
26
+ selectable: false,
27
+ parseDOM: [
28
+ {
29
+ tag: 'section.keywords',
30
+ },
31
+ ],
32
+ toDOM: (node) => {
33
+ const keywordsSectionNode = node;
34
+ return [
35
+ 'section',
36
+ {
37
+ id: keywordsSectionNode.attrs.id,
38
+ class: 'keywords',
39
+ spellcheck: 'false',
40
+ },
41
+ 0,
42
+ ];
43
+ },
44
+ };
45
+ const isKeywordsSectionNode = (node) => node.type === node.type.schema.nodes.keywords_section;
46
+ exports.isKeywordsSectionNode = isKeywordsSectionNode;
@@ -0,0 +1,61 @@
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.link = void 0;
19
+ exports.link = {
20
+ content: 'text*',
21
+ marks: '',
22
+ attrs: {
23
+ href: { default: '' },
24
+ title: { default: '' },
25
+ dataTracked: { default: null },
26
+ },
27
+ inline: true,
28
+ group: 'inline',
29
+ draggable: true,
30
+ atom: true,
31
+ parseDOM: [
32
+ {
33
+ tag: 'a[href]',
34
+ getAttrs: (a) => {
35
+ const dom = a;
36
+ return {
37
+ href: dom.getAttribute('href') || '',
38
+ title: dom.getAttribute('title') || '',
39
+ };
40
+ },
41
+ },
42
+ {
43
+ tag: 'span.citation[data-href]',
44
+ getAttrs: (span) => {
45
+ const dom = span;
46
+ return {
47
+ href: dom.getAttribute('data-href') || '',
48
+ };
49
+ },
50
+ priority: 80,
51
+ },
52
+ ],
53
+ toDOM: (node) => {
54
+ const { href, title } = node.attrs;
55
+ const attrs = { href };
56
+ if (title) {
57
+ attrs.title = title;
58
+ }
59
+ return ['a', attrs, 0];
60
+ },
61
+ };
@@ -0,0 +1,121 @@
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.isListNode = exports.listItem = exports.orderedList = exports.bulletList = void 0;
19
+ const manuscripts_json_schema_1 = require("@manuscripts/manuscripts-json-schema");
20
+ const attributes_1 = require("../../lib/attributes");
21
+ exports.bulletList = {
22
+ content: 'list_item+',
23
+ group: 'block list element',
24
+ attrs: {
25
+ id: { default: '' },
26
+ paragraphStyle: { default: '' },
27
+ dataTracked: { default: null },
28
+ },
29
+ parseDOM: [
30
+ {
31
+ tag: 'ul',
32
+ getAttrs: (p) => {
33
+ const dom = p;
34
+ return {
35
+ id: dom.getAttribute('id'),
36
+ };
37
+ },
38
+ },
39
+ ],
40
+ toDOM: (node) => {
41
+ const bulletListNode = node;
42
+ return bulletListNode.attrs.id
43
+ ? [
44
+ 'ul',
45
+ {
46
+ id: bulletListNode.attrs.id,
47
+ class: (0, attributes_1.buildElementClass)(bulletListNode.attrs),
48
+ 'data-object-type': manuscripts_json_schema_1.ObjectTypes.ListElement,
49
+ },
50
+ 0,
51
+ ]
52
+ : ['ul', 0];
53
+ },
54
+ };
55
+ exports.orderedList = {
56
+ content: 'list_item+',
57
+ group: 'block list element',
58
+ attrs: {
59
+ id: { default: '' },
60
+ paragraphStyle: { default: '' },
61
+ dataTracked: { default: null },
62
+ },
63
+ parseDOM: [
64
+ {
65
+ tag: 'ol',
66
+ getAttrs: (p) => {
67
+ const dom = p;
68
+ return {
69
+ id: dom.getAttribute('id'),
70
+ };
71
+ },
72
+ },
73
+ ],
74
+ toDOM: (node) => {
75
+ const orderedListNode = node;
76
+ return orderedListNode.attrs.id
77
+ ? [
78
+ 'ol',
79
+ {
80
+ id: orderedListNode.attrs.id,
81
+ class: (0, attributes_1.buildElementClass)(orderedListNode.attrs),
82
+ 'data-object-type': manuscripts_json_schema_1.ObjectTypes.ListElement,
83
+ },
84
+ 0,
85
+ ]
86
+ : ['ol', 0];
87
+ },
88
+ };
89
+ exports.listItem = {
90
+ content: 'paragraph? (paragraph | list)+',
91
+ group: 'block',
92
+ defining: true,
93
+ attrs: {
94
+ placeholder: { default: 'List item' },
95
+ dataTracked: { default: null },
96
+ },
97
+ parseDOM: [
98
+ {
99
+ tag: 'li',
100
+ getAttrs: (p) => {
101
+ const dom = p;
102
+ return {
103
+ placeholder: dom.getAttribute('data-placeholder-text') || '',
104
+ };
105
+ },
106
+ },
107
+ ],
108
+ toDOM: (node) => {
109
+ const listItemNode = node;
110
+ const attrs = {};
111
+ if (listItemNode.attrs.placeholder) {
112
+ attrs['data-placeholder-text'] = listItemNode.attrs.placeholder;
113
+ }
114
+ return ['li', attrs, 0];
115
+ },
116
+ };
117
+ const isListNode = (node) => {
118
+ const { nodes } = node.type.schema;
119
+ return node.type === nodes.bullet_list || node.type === nodes.ordered_list;
120
+ };
121
+ exports.isListNode = isListNode;
@@ -0,0 +1,73 @@
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.isListingNode = exports.listing = void 0;
19
+ const manuscripts_json_schema_1 = require("@manuscripts/manuscripts-json-schema");
20
+ exports.listing = {
21
+ attrs: {
22
+ id: { default: '' },
23
+ contents: { default: '' },
24
+ language: { default: '' },
25
+ languageKey: { default: 'null' },
26
+ isExpanded: { default: false },
27
+ isExecuting: { default: false },
28
+ dataTracked: { default: null },
29
+ comments: { default: null },
30
+ },
31
+ draggable: false,
32
+ selectable: false,
33
+ group: 'block',
34
+ parseDOM: [
35
+ {
36
+ tag: `pre.${manuscripts_json_schema_1.ObjectTypes.Listing}`,
37
+ preserveWhitespace: 'full',
38
+ getAttrs: (p) => {
39
+ const node = p;
40
+ return {
41
+ contents: node.textContent,
42
+ language: node.getAttribute('language'),
43
+ languageKey: node.getAttribute('languageKey'),
44
+ };
45
+ },
46
+ priority: 100,
47
+ },
48
+ {
49
+ tag: 'pre',
50
+ preserveWhitespace: 'full',
51
+ getAttrs: (p) => {
52
+ const node = p;
53
+ return {
54
+ contents: node.getAttribute('code') || node.textContent,
55
+ languageKey: node.getAttribute('language'),
56
+ };
57
+ },
58
+ priority: 90,
59
+ },
60
+ ],
61
+ toDOM: (node) => {
62
+ const listingNode = node;
63
+ const dom = document.createElement('div');
64
+ dom.setAttribute('id', listingNode.attrs.id);
65
+ dom.classList.add(manuscripts_json_schema_1.ObjectTypes.Listing);
66
+ dom.setAttribute('data-language', listingNode.attrs.language);
67
+ dom.setAttribute('data-languageKey', listingNode.attrs.languageKey);
68
+ dom.textContent = listingNode.attrs.contents;
69
+ return dom;
70
+ },
71
+ };
72
+ const isListingNode = (node) => node.type === node.type.schema.nodes.listing;
73
+ exports.isListingNode = isListingNode;