@fiduswriter/document 0.1.0-alpha.2 → 0.1.0-alpha.4

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 (410) hide show
  1. package/README.md +22 -1
  2. package/dist/bibliography/common.d.ts +92 -0
  3. package/dist/bibliography/common.d.ts.map +1 -0
  4. package/dist/bibliography/common.js +85 -0
  5. package/dist/bibliography/common.js.map +1 -0
  6. package/dist/bibliography/csl_bib.d.ts +3 -0
  7. package/dist/bibliography/csl_bib.d.ts.map +1 -0
  8. package/dist/bibliography/csl_bib.js +131 -0
  9. package/dist/bibliography/csl_bib.js.map +1 -0
  10. package/dist/citations/citeproc_sys.d.ts +13 -0
  11. package/dist/citations/citeproc_sys.d.ts.map +1 -0
  12. package/dist/citations/citeproc_sys.js +43 -0
  13. package/dist/citations/citeproc_sys.js.map +1 -0
  14. package/dist/citations/format.d.ts +23 -0
  15. package/dist/citations/format.d.ts.map +1 -0
  16. package/dist/citations/format.js +161 -0
  17. package/dist/citations/format.js.map +1 -0
  18. package/dist/editor/e2ee/encryptor.d.ts +123 -0
  19. package/dist/editor/e2ee/encryptor.d.ts.map +1 -0
  20. package/dist/editor/e2ee/encryptor.js +201 -0
  21. package/dist/editor/e2ee/encryptor.js.map +1 -0
  22. package/dist/exporter/docx/citations.d.ts +21 -0
  23. package/dist/exporter/docx/citations.d.ts.map +1 -0
  24. package/dist/exporter/docx/citations.js +154 -0
  25. package/dist/exporter/docx/citations.js.map +1 -0
  26. package/dist/exporter/docx/comments.d.ts +18 -0
  27. package/dist/exporter/docx/comments.d.ts.map +1 -0
  28. package/dist/exporter/docx/comments.js +137 -0
  29. package/dist/exporter/docx/comments.js.map +1 -0
  30. package/dist/exporter/docx/footnotes.d.ts +42 -0
  31. package/dist/exporter/docx/footnotes.d.ts.map +1 -0
  32. package/dist/exporter/docx/footnotes.js +182 -0
  33. package/dist/exporter/docx/footnotes.js.map +1 -0
  34. package/dist/exporter/docx/images.d.ts +14 -0
  35. package/dist/exporter/docx/images.d.ts.map +1 -0
  36. package/dist/exporter/docx/images.js +86 -0
  37. package/dist/exporter/docx/images.js.map +1 -0
  38. package/dist/exporter/docx/index.d.ts +22 -0
  39. package/dist/exporter/docx/index.d.ts.map +1 -0
  40. package/dist/exporter/docx/index.js +107 -0
  41. package/dist/exporter/docx/index.js.map +1 -0
  42. package/dist/exporter/docx/lists.d.ts +33 -0
  43. package/dist/exporter/docx/lists.d.ts.map +1 -0
  44. package/dist/exporter/docx/lists.js +229 -0
  45. package/dist/exporter/docx/lists.js.map +1 -0
  46. package/dist/exporter/docx/math.d.ts +13 -0
  47. package/dist/exporter/docx/math.d.ts.map +1 -0
  48. package/dist/exporter/docx/math.js +42 -0
  49. package/dist/exporter/docx/math.js.map +1 -0
  50. package/dist/exporter/docx/metadata.d.ts +14 -0
  51. package/dist/exporter/docx/metadata.d.ts.map +1 -0
  52. package/dist/exporter/docx/metadata.js +239 -0
  53. package/dist/exporter/docx/metadata.js.map +1 -0
  54. package/dist/exporter/docx/rels.d.ts +25 -0
  55. package/dist/exporter/docx/rels.d.ts.map +1 -0
  56. package/dist/exporter/docx/rels.js +168 -0
  57. package/dist/exporter/docx/rels.js.map +1 -0
  58. package/dist/exporter/docx/render.d.ts +20 -0
  59. package/dist/exporter/docx/render.d.ts.map +1 -0
  60. package/dist/exporter/docx/render.js +774 -0
  61. package/dist/exporter/docx/render.js.map +1 -0
  62. package/dist/exporter/docx/richtext.d.ts +25 -0
  63. package/dist/exporter/docx/richtext.d.ts.map +1 -0
  64. package/dist/exporter/docx/richtext.js +1052 -0
  65. package/dist/exporter/docx/richtext.js.map +1 -0
  66. package/dist/exporter/docx/tables.d.ts +14 -0
  67. package/dist/exporter/docx/tables.d.ts.map +1 -0
  68. package/dist/exporter/docx/tables.js +109 -0
  69. package/dist/exporter/docx/tables.js.map +1 -0
  70. package/dist/exporter/docx/tools.d.ts +3 -0
  71. package/dist/exporter/docx/tools.d.ts.map +1 -0
  72. package/dist/exporter/docx/tools.js +48 -0
  73. package/dist/exporter/docx/tools.js.map +1 -0
  74. package/dist/exporter/epub/index.d.ts +11 -0
  75. package/dist/exporter/epub/index.d.ts.map +1 -0
  76. package/dist/exporter/epub/index.js +102 -0
  77. package/dist/exporter/epub/index.js.map +1 -0
  78. package/dist/exporter/epub/templates.d.ts +32 -0
  79. package/dist/exporter/epub/templates.d.ts.map +1 -0
  80. package/dist/exporter/epub/templates.js +95 -0
  81. package/dist/exporter/epub/templates.js.map +1 -0
  82. package/dist/exporter/epub/tools.d.ts +5 -0
  83. package/dist/exporter/epub/tools.d.ts.map +1 -0
  84. package/dist/exporter/epub/tools.js +81 -0
  85. package/dist/exporter/epub/tools.js.map +1 -0
  86. package/dist/exporter/html/citations.d.ts +27 -0
  87. package/dist/exporter/html/citations.d.ts.map +1 -0
  88. package/dist/exporter/html/citations.js +91 -0
  89. package/dist/exporter/html/citations.js.map +1 -0
  90. package/dist/exporter/html/convert.d.ts +100 -0
  91. package/dist/exporter/html/convert.d.ts.map +1 -0
  92. package/dist/exporter/html/convert.js +718 -0
  93. package/dist/exporter/html/convert.js.map +1 -0
  94. package/dist/exporter/html/index.d.ts +61 -0
  95. package/dist/exporter/html/index.d.ts.map +1 -0
  96. package/dist/exporter/html/index.js +134 -0
  97. package/dist/exporter/html/index.js.map +1 -0
  98. package/dist/exporter/html/templates.d.ts +10 -0
  99. package/dist/exporter/html/templates.d.ts.map +1 -0
  100. package/dist/exporter/html/templates.js +21 -0
  101. package/dist/exporter/html/templates.js.map +1 -0
  102. package/dist/exporter/html/tools.d.ts +2 -0
  103. package/dist/exporter/html/tools.d.ts.map +1 -0
  104. package/dist/exporter/html/tools.js +49 -0
  105. package/dist/exporter/html/tools.js.map +1 -0
  106. package/dist/exporter/jats/bibliography.d.ts +2 -0
  107. package/dist/exporter/jats/bibliography.d.ts.map +1 -0
  108. package/dist/exporter/jats/bibliography.js +153 -0
  109. package/dist/exporter/jats/bibliography.js.map +1 -0
  110. package/dist/exporter/jats/citations.d.ts +14 -0
  111. package/dist/exporter/jats/citations.d.ts.map +1 -0
  112. package/dist/exporter/jats/citations.js +83 -0
  113. package/dist/exporter/jats/citations.js.map +1 -0
  114. package/dist/exporter/jats/convert.d.ts +45 -0
  115. package/dist/exporter/jats/convert.d.ts.map +1 -0
  116. package/dist/exporter/jats/convert.js +799 -0
  117. package/dist/exporter/jats/convert.js.map +1 -0
  118. package/dist/exporter/jats/index.d.ts +19 -0
  119. package/dist/exporter/jats/index.d.ts.map +1 -0
  120. package/dist/exporter/jats/index.js +66 -0
  121. package/dist/exporter/jats/index.js.map +1 -0
  122. package/dist/exporter/jats/templates.d.ts +16 -0
  123. package/dist/exporter/jats/templates.d.ts.map +1 -0
  124. package/dist/exporter/jats/templates.js +25 -0
  125. package/dist/exporter/jats/templates.js.map +1 -0
  126. package/dist/exporter/jats/text.d.ts +3 -0
  127. package/dist/exporter/jats/text.d.ts.map +1 -0
  128. package/dist/exporter/jats/text.js +72 -0
  129. package/dist/exporter/jats/text.js.map +1 -0
  130. package/dist/exporter/latex/convert.d.ts +27 -0
  131. package/dist/exporter/latex/convert.d.ts.map +1 -0
  132. package/dist/exporter/latex/convert.js +865 -0
  133. package/dist/exporter/latex/convert.js.map +1 -0
  134. package/dist/exporter/latex/escape_latex.d.ts +2 -0
  135. package/dist/exporter/latex/escape_latex.d.ts.map +1 -0
  136. package/dist/exporter/latex/escape_latex.js +20 -0
  137. package/dist/exporter/latex/escape_latex.js.map +1 -0
  138. package/dist/exporter/latex/index.d.ts +23 -0
  139. package/dist/exporter/latex/index.d.ts.map +1 -0
  140. package/dist/exporter/latex/index.js +57 -0
  141. package/dist/exporter/latex/index.js.map +1 -0
  142. package/dist/exporter/latex/readme.d.ts +2 -0
  143. package/dist/exporter/latex/readme.d.ts.map +1 -0
  144. package/dist/exporter/latex/readme.js +23 -0
  145. package/dist/exporter/latex/readme.js.map +1 -0
  146. package/dist/exporter/native/shrink.d.ts +21 -0
  147. package/dist/exporter/native/shrink.d.ts.map +1 -0
  148. package/dist/exporter/native/shrink.js +115 -0
  149. package/dist/exporter/native/shrink.js.map +1 -0
  150. package/dist/exporter/odt/citations.d.ts +18 -0
  151. package/dist/exporter/odt/citations.d.ts.map +1 -0
  152. package/dist/exporter/odt/citations.js +87 -0
  153. package/dist/exporter/odt/citations.js.map +1 -0
  154. package/dist/exporter/odt/footnotes.d.ts +25 -0
  155. package/dist/exporter/odt/footnotes.d.ts.map +1 -0
  156. package/dist/exporter/odt/footnotes.js +112 -0
  157. package/dist/exporter/odt/footnotes.js.map +1 -0
  158. package/dist/exporter/odt/images.d.ts +13 -0
  159. package/dist/exporter/odt/images.d.ts.map +1 -0
  160. package/dist/exporter/odt/images.js +98 -0
  161. package/dist/exporter/odt/images.js.map +1 -0
  162. package/dist/exporter/odt/index.d.ts +23 -0
  163. package/dist/exporter/odt/index.d.ts.map +1 -0
  164. package/dist/exporter/odt/index.js +99 -0
  165. package/dist/exporter/odt/index.js.map +1 -0
  166. package/dist/exporter/odt/math.d.ts +13 -0
  167. package/dist/exporter/odt/math.d.ts.map +1 -0
  168. package/dist/exporter/odt/math.js +48 -0
  169. package/dist/exporter/odt/math.js.map +1 -0
  170. package/dist/exporter/odt/metadata.d.ts +14 -0
  171. package/dist/exporter/odt/metadata.d.ts.map +1 -0
  172. package/dist/exporter/odt/metadata.js +203 -0
  173. package/dist/exporter/odt/metadata.js.map +1 -0
  174. package/dist/exporter/odt/render.d.ts +24 -0
  175. package/dist/exporter/odt/render.d.ts.map +1 -0
  176. package/dist/exporter/odt/render.js +644 -0
  177. package/dist/exporter/odt/render.js.map +1 -0
  178. package/dist/exporter/odt/richtext.d.ts +22 -0
  179. package/dist/exporter/odt/richtext.d.ts.map +1 -0
  180. package/dist/exporter/odt/richtext.js +728 -0
  181. package/dist/exporter/odt/richtext.js.map +1 -0
  182. package/dist/exporter/odt/styles.d.ts +33 -0
  183. package/dist/exporter/odt/styles.d.ts.map +1 -0
  184. package/dist/exporter/odt/styles.js +348 -0
  185. package/dist/exporter/odt/styles.js.map +1 -0
  186. package/dist/exporter/odt/track.d.ts +11 -0
  187. package/dist/exporter/odt/track.d.ts.map +1 -0
  188. package/dist/exporter/odt/track.js +59 -0
  189. package/dist/exporter/odt/track.js.map +1 -0
  190. package/dist/exporter/pandoc/citations.d.ts +17 -0
  191. package/dist/exporter/pandoc/citations.d.ts.map +1 -0
  192. package/dist/exporter/pandoc/citations.js +85 -0
  193. package/dist/exporter/pandoc/citations.js.map +1 -0
  194. package/dist/exporter/pandoc/convert.d.ts +38 -0
  195. package/dist/exporter/pandoc/convert.d.ts.map +1 -0
  196. package/dist/exporter/pandoc/convert.js +881 -0
  197. package/dist/exporter/pandoc/convert.js.map +1 -0
  198. package/dist/exporter/pandoc/index.d.ts +38 -0
  199. package/dist/exporter/pandoc/index.d.ts.map +1 -0
  200. package/dist/exporter/pandoc/index.js +67 -0
  201. package/dist/exporter/pandoc/index.js.map +1 -0
  202. package/dist/exporter/pandoc/readme.d.ts +2 -0
  203. package/dist/exporter/pandoc/readme.d.ts.map +1 -0
  204. package/dist/exporter/pandoc/readme.js +9 -0
  205. package/dist/exporter/pandoc/readme.js.map +1 -0
  206. package/dist/exporter/pandoc/tools.d.ts +6 -0
  207. package/dist/exporter/pandoc/tools.d.ts.map +1 -0
  208. package/dist/exporter/pandoc/tools.js +52 -0
  209. package/dist/exporter/pandoc/tools.js.map +1 -0
  210. package/dist/exporter/print/index.d.ts +9 -0
  211. package/dist/exporter/print/index.d.ts.map +1 -0
  212. package/dist/exporter/print/index.js +140 -0
  213. package/dist/exporter/print/index.js.map +1 -0
  214. package/dist/exporter/tools/doc_content.d.ts +7 -0
  215. package/dist/exporter/tools/doc_content.d.ts.map +1 -0
  216. package/dist/exporter/tools/doc_content.js +129 -0
  217. package/dist/exporter/tools/doc_content.js.map +1 -0
  218. package/dist/exporter/tools/file.d.ts +2 -0
  219. package/dist/exporter/tools/file.d.ts.map +1 -0
  220. package/dist/exporter/tools/file.js +10 -0
  221. package/dist/exporter/tools/file.js.map +1 -0
  222. package/dist/exporter/tools/json.d.ts +7 -0
  223. package/dist/exporter/tools/json.d.ts.map +1 -0
  224. package/dist/exporter/tools/json.js +82 -0
  225. package/dist/exporter/tools/json.js.map +1 -0
  226. package/dist/exporter/tools/svg.d.ts +2 -0
  227. package/dist/exporter/tools/svg.d.ts.map +1 -0
  228. package/dist/exporter/tools/svg.js +26 -0
  229. package/dist/exporter/tools/svg.js.map +1 -0
  230. package/dist/exporter/tools/xml.d.ts +41 -0
  231. package/dist/exporter/tools/xml.d.ts.map +1 -0
  232. package/dist/exporter/tools/xml.js +440 -0
  233. package/dist/exporter/tools/xml.js.map +1 -0
  234. package/dist/exporter/tools/xml_zip.d.ts +20 -0
  235. package/dist/exporter/tools/xml_zip.d.ts.map +1 -0
  236. package/dist/exporter/tools/xml_zip.js +86 -0
  237. package/dist/exporter/tools/xml_zip.js.map +1 -0
  238. package/dist/exporter/tools/zip.d.ts +21 -0
  239. package/dist/exporter/tools/zip.d.ts.map +1 -0
  240. package/dist/exporter/tools/zip.js +71 -0
  241. package/dist/exporter/tools/zip.js.map +1 -0
  242. package/dist/exporter/tools/zotero_csl.d.ts +10 -0
  243. package/dist/exporter/tools/zotero_csl.d.ts.map +1 -0
  244. package/dist/exporter/tools/zotero_csl.js +78 -0
  245. package/dist/exporter/tools/zotero_csl.js.map +1 -0
  246. package/dist/importer/citations.d.ts +25 -0
  247. package/dist/importer/citations.d.ts.map +1 -0
  248. package/dist/importer/citations.js +116 -0
  249. package/dist/importer/citations.js.map +1 -0
  250. package/dist/importer/docx/citations.d.ts +65 -0
  251. package/dist/importer/docx/citations.d.ts.map +1 -0
  252. package/dist/importer/docx/citations.js +106 -0
  253. package/dist/importer/docx/citations.js.map +1 -0
  254. package/dist/importer/docx/convert.d.ts +228 -0
  255. package/dist/importer/docx/convert.d.ts.map +1 -0
  256. package/dist/importer/docx/convert.js +1226 -0
  257. package/dist/importer/docx/convert.js.map +1 -0
  258. package/dist/importer/docx/helpers.d.ts +2 -0
  259. package/dist/importer/docx/helpers.d.ts.map +1 -0
  260. package/dist/importer/docx/helpers.js +10 -0
  261. package/dist/importer/docx/helpers.js.map +1 -0
  262. package/dist/importer/docx/omml2mathml.d.ts +7 -0
  263. package/dist/importer/docx/omml2mathml.d.ts.map +1 -0
  264. package/dist/importer/docx/omml2mathml.js +1239 -0
  265. package/dist/importer/docx/omml2mathml.js.map +1 -0
  266. package/dist/importer/docx/parse.d.ts +205 -0
  267. package/dist/importer/docx/parse.d.ts.map +1 -0
  268. package/dist/importer/docx/parse.js +663 -0
  269. package/dist/importer/docx/parse.js.map +1 -0
  270. package/dist/importer/native/get_images.d.ts +11 -0
  271. package/dist/importer/native/get_images.d.ts.map +1 -0
  272. package/dist/importer/native/get_images.js +64 -0
  273. package/dist/importer/native/get_images.js.map +1 -0
  274. package/dist/importer/native/update.d.ts +6 -0
  275. package/dist/importer/native/update.d.ts.map +1 -0
  276. package/dist/importer/native/update.js +26 -0
  277. package/dist/importer/native/update.js.map +1 -0
  278. package/dist/importer/odt/citations.d.ts +47 -0
  279. package/dist/importer/odt/citations.d.ts.map +1 -0
  280. package/dist/importer/odt/citations.js +79 -0
  281. package/dist/importer/odt/citations.js.map +1 -0
  282. package/dist/importer/odt/convert.d.ts +330 -0
  283. package/dist/importer/odt/convert.d.ts.map +1 -0
  284. package/dist/importer/odt/convert.js +1506 -0
  285. package/dist/importer/odt/convert.js.map +1 -0
  286. package/dist/importer/pandoc/convert.d.ts +84 -0
  287. package/dist/importer/pandoc/convert.d.ts.map +1 -0
  288. package/dist/importer/pandoc/convert.js +777 -0
  289. package/dist/importer/pandoc/convert.js.map +1 -0
  290. package/dist/importer/pandoc/helpers.d.ts +4 -0
  291. package/dist/importer/pandoc/helpers.d.ts.map +1 -0
  292. package/dist/importer/pandoc/helpers.js +75 -0
  293. package/dist/importer/pandoc/helpers.js.map +1 -0
  294. package/dist/importer/zip_analyzer.d.ts +25 -0
  295. package/dist/importer/zip_analyzer.d.ts.map +1 -0
  296. package/dist/importer/zip_analyzer.js +84 -0
  297. package/dist/importer/zip_analyzer.js.map +1 -0
  298. package/dist/index.d.ts +2 -0
  299. package/dist/index.d.ts.map +1 -0
  300. package/dist/index.js +2 -0
  301. package/dist/index.js.map +1 -0
  302. package/dist/mathlive/opf_includes.d.ts +2 -0
  303. package/dist/mathlive/opf_includes.d.ts.map +1 -0
  304. package/dist/mathlive/opf_includes.js +25 -0
  305. package/dist/mathlive/opf_includes.js.map +1 -0
  306. package/dist/schema/common/annotate.d.ts +59 -0
  307. package/dist/schema/common/annotate.d.ts.map +1 -0
  308. package/dist/schema/common/annotate.js +75 -0
  309. package/dist/schema/common/annotate.js.map +1 -0
  310. package/dist/schema/common/base.d.ts +109 -0
  311. package/dist/schema/common/base.d.ts.map +1 -0
  312. package/dist/schema/common/base.js +109 -0
  313. package/dist/schema/common/base.js.map +1 -0
  314. package/dist/schema/common/citation.d.ts +29 -0
  315. package/dist/schema/common/citation.d.ts.map +1 -0
  316. package/dist/schema/common/citation.js +62 -0
  317. package/dist/schema/common/citation.js.map +1 -0
  318. package/dist/schema/common/equation.d.ts +18 -0
  319. package/dist/schema/common/equation.d.ts.map +1 -0
  320. package/dist/schema/common/equation.js +32 -0
  321. package/dist/schema/common/equation.js.map +1 -0
  322. package/dist/schema/common/figure.d.ts +108 -0
  323. package/dist/schema/common/figure.d.ts.map +1 -0
  324. package/dist/schema/common/figure.js +176 -0
  325. package/dist/schema/common/figure.js.map +1 -0
  326. package/dist/schema/common/heading.d.ts +33 -0
  327. package/dist/schema/common/heading.d.ts.map +1 -0
  328. package/dist/schema/common/heading.js +41 -0
  329. package/dist/schema/common/heading.js.map +1 -0
  330. package/dist/schema/common/index.d.ts +11 -0
  331. package/dist/schema/common/index.d.ts.map +1 -0
  332. package/dist/schema/common/index.js +11 -0
  333. package/dist/schema/common/index.js.map +1 -0
  334. package/dist/schema/common/list.d.ts +83 -0
  335. package/dist/schema/common/list.d.ts.map +1 -0
  336. package/dist/schema/common/list.js +92 -0
  337. package/dist/schema/common/list.js.map +1 -0
  338. package/dist/schema/common/reference.d.ts +78 -0
  339. package/dist/schema/common/reference.d.ts.map +1 -0
  340. package/dist/schema/common/reference.js +97 -0
  341. package/dist/schema/common/reference.js.map +1 -0
  342. package/dist/schema/common/table.d.ts +92 -0
  343. package/dist/schema/common/table.d.ts.map +1 -0
  344. package/dist/schema/common/table.js +85 -0
  345. package/dist/schema/common/table.js.map +1 -0
  346. package/dist/schema/common/track.d.ts +131 -0
  347. package/dist/schema/common/track.d.ts.map +1 -0
  348. package/dist/schema/common/track.js +184 -0
  349. package/dist/schema/common/track.js.map +1 -0
  350. package/dist/schema/const.d.ts +3 -0
  351. package/dist/schema/const.d.ts.map +1 -0
  352. package/{src → dist}/schema/const.js +3 -3
  353. package/dist/schema/const.js.map +1 -0
  354. package/dist/schema/convert.d.ts +3 -0
  355. package/dist/schema/convert.d.ts.map +1 -0
  356. package/dist/schema/convert.js +1215 -0
  357. package/dist/schema/convert.js.map +1 -0
  358. package/dist/schema/document/content.d.ts +137 -0
  359. package/dist/schema/document/content.d.ts.map +1 -0
  360. package/dist/schema/document/content.js +177 -0
  361. package/dist/schema/document/content.js.map +1 -0
  362. package/dist/schema/document/index.d.ts +879 -0
  363. package/dist/schema/document/index.d.ts.map +1 -0
  364. package/dist/schema/document/index.js +68 -0
  365. package/dist/schema/document/index.js.map +1 -0
  366. package/dist/schema/document/structure.d.ts +273 -0
  367. package/dist/schema/document/structure.d.ts.map +1 -0
  368. package/dist/schema/document/structure.js +445 -0
  369. package/dist/schema/document/structure.js.map +1 -0
  370. package/dist/schema/export.d.ts +880 -0
  371. package/dist/schema/export.d.ts.map +1 -0
  372. package/dist/schema/export.js +16 -0
  373. package/dist/schema/export.js.map +1 -0
  374. package/dist/schema/footnotes.d.ts +499 -0
  375. package/dist/schema/footnotes.d.ts.map +1 -0
  376. package/dist/schema/footnotes.js +88 -0
  377. package/dist/schema/footnotes.js.map +1 -0
  378. package/dist/schema/footnotes_convert.d.ts +5 -0
  379. package/dist/schema/footnotes_convert.d.ts.map +1 -0
  380. package/dist/schema/footnotes_convert.js +26 -0
  381. package/dist/schema/footnotes_convert.js.map +1 -0
  382. package/dist/schema/i18n.d.ts +586 -0
  383. package/dist/schema/i18n.d.ts.map +1 -0
  384. package/dist/schema/i18n.js +585 -0
  385. package/dist/schema/i18n.js.map +1 -0
  386. package/dist/schema/index.d.ts +6 -0
  387. package/dist/schema/index.d.ts.map +1 -0
  388. package/dist/schema/index.js +6 -0
  389. package/dist/schema/index.js.map +1 -0
  390. package/dist/schema/mini_json.d.ts +5 -0
  391. package/dist/schema/mini_json.d.ts.map +1 -0
  392. package/dist/schema/mini_json.js +50 -0
  393. package/dist/schema/mini_json.js.map +1 -0
  394. package/dist/schema/text.d.ts +2 -0
  395. package/dist/schema/text.d.ts.map +1 -0
  396. package/dist/schema/text.js +23 -0
  397. package/dist/schema/text.js.map +1 -0
  398. package/dist/types.d.ts +122 -0
  399. package/dist/types.d.ts.map +1 -0
  400. package/dist/types.js +9 -0
  401. package/dist/types.js.map +1 -0
  402. package/package.json +48 -16
  403. package/scripts/export-schema.js +1 -1
  404. package/src/exporter/tools/{file.js → file.ts} +1 -1
  405. package/src/exporter/tools/{json.js → json.ts} +30 -19
  406. package/src/global.d.ts +11 -0
  407. package/src/schema/const.ts +58 -0
  408. package/src/types.ts +136 -0
  409. package/jest.config.js +0 -24
  410. /package/src/{index.js → index.ts} +0 -0
@@ -0,0 +1,123 @@
1
+ /**
2
+ * E2EE Encryptor - Handles encryption and decryption of document content
3
+ * for end-to-end encrypted documents.
4
+ *
5
+ * Uses AES-GCM (256-bit) for all encryption operations. Each encryption
6
+ * operation generates a random 12-byte IV (initialization vector) to
7
+ * ensure that encrypting the same plaintext twice produces different
8
+ * ciphertext.
9
+ *
10
+ * Encrypted data format (Appendix A of the E2EE plan):
11
+ * [IV (12 bytes)][Ciphertext (variable length)][Auth Tag (16 bytes, implicit in AES-GCM)]
12
+ *
13
+ * When stored as a string (e.g., in JSON fields), the entire structure
14
+ * is Base64-encoded.
15
+ */
16
+ export class E2EEEncryptor {
17
+ /**
18
+ * Encrypt a string with AES-GCM.
19
+ *
20
+ * @param {string} plaintext - The plaintext string to encrypt
21
+ * @param {CryptoKey} key - An AES-GCM key (from E2EEKeyManager.deriveKey)
22
+ * @returns {Promise<string>} Base64-encoded string (iv + ciphertext + auth tag)
23
+ */
24
+ static encrypt(plaintext: string, key: CryptoKey): Promise<string>;
25
+ /**
26
+ * Decrypt a Base64-encoded AES-GCM ciphertext.
27
+ *
28
+ * @param {string} ciphertextBase64 - Base64-encoded (iv + ciphertext + auth tag)
29
+ * @param {CryptoKey} key - An AES-GCM key (from E2EEKeyManager.deriveKey)
30
+ * @returns {Promise<string>} The decrypted plaintext string
31
+ */
32
+ static decrypt(ciphertextBase64: string, key: CryptoKey): Promise<string>;
33
+ /**
34
+ * Encrypt a JSON-serializable object.
35
+ *
36
+ * Serializes the object to JSON, then encrypts the JSON string.
37
+ *
38
+ * @param {Object} obj - A JSON-serializable object
39
+ * @param {CryptoKey} key - An AES-GCM key
40
+ * @returns {Promise<string>} Base64-encoded encrypted data
41
+ */
42
+ static encryptObject(obj: Object, key: CryptoKey): Promise<string>;
43
+ /**
44
+ * Decrypt to a JSON-serializable object.
45
+ *
46
+ * Decrypts the Base64-encoded ciphertext, then parses the result as JSON.
47
+ *
48
+ * @param {string} ciphertextBase64 - Base64-encoded encrypted data
49
+ * @param {CryptoKey} key - An AES-GCM key
50
+ * @returns {Promise<Object>} The decrypted and parsed object
51
+ */
52
+ static decryptObject(ciphertextBase64: string, key: CryptoKey): Promise<Object>;
53
+ /**
54
+ * Encrypt an ArrayBuffer (for images and other binary data).
55
+ *
56
+ * @param {ArrayBuffer} buffer - The binary data to encrypt
57
+ * @param {CryptoKey} key - An AES-GCM key
58
+ * @returns {Promise<string>} Base64-encoded encrypted data (iv + ciphertext)
59
+ */
60
+ static encryptBuffer(buffer: ArrayBuffer, key: CryptoKey): Promise<string>;
61
+ /**
62
+ * Decrypt to an ArrayBuffer.
63
+ *
64
+ * @param {string} ciphertextBase64 - Base64-encoded encrypted data
65
+ * @param {CryptoKey} key - An AES-GCM key
66
+ * @returns {Promise<ArrayBuffer>} The decrypted binary data
67
+ */
68
+ static decryptBuffer(ciphertextBase64: string, key: CryptoKey): Promise<ArrayBuffer>;
69
+ /**
70
+ * Encrypt an image File/Blob for upload.
71
+ *
72
+ * Reads the file as an ArrayBuffer, encrypts it, and returns
73
+ * a Blob with application/octet-stream type (since the encrypted
74
+ * data is opaque binary).
75
+ *
76
+ * @param {File|Blob} file - The image file to encrypt
77
+ * @param {CryptoKey} key - An AES-GCM key
78
+ * @returns {Promise<Blob>} An encrypted Blob with type application/octet-stream
79
+ */
80
+ static encryptImage(file: File | Blob, key: CryptoKey): Promise<Blob>;
81
+ /**
82
+ * Decrypt an encrypted image back to an ArrayBuffer.
83
+ *
84
+ * @param {string} ciphertextBase64 - Base64-encoded encrypted image data
85
+ * @param {CryptoKey} key - An AES-GCM key
86
+ * @returns {Promise<ArrayBuffer>} The decrypted image data
87
+ */
88
+ static decryptImage(ciphertextBase64: string, key: CryptoKey): Promise<ArrayBuffer>;
89
+ /**
90
+ * Decrypt a Base64-encoded ciphertext and return as a Base64 string.
91
+ *
92
+ * Useful for decrypting encrypted images that need to be stored
93
+ * as Base64 data URLs or re-exported.
94
+ *
95
+ * @param {string} ciphertextBase64 - Base64-encoded encrypted data
96
+ * @param {CryptoKey} key - An AES-GCM key
97
+ * @returns {Promise<string>} Base64-encoded decrypted data
98
+ */
99
+ static decryptBufferToBase64(ciphertextBase64: string, key: CryptoKey): Promise<string>;
100
+ /**
101
+ * Decrypt an encrypted image and return a blob URL for display.
102
+ *
103
+ * Fetches the encrypted image file from the given URL, decrypts it,
104
+ * and creates a temporary object URL that can be used as an img src.
105
+ *
106
+ * @param {string} imageUrl - The URL of the encrypted image file
107
+ * @param {CryptoKey} key - An AES-GCM key
108
+ * @param {string} mimeType - The MIME type of the decrypted image
109
+ * @returns {Promise<string>} A blob URL for the decrypted image
110
+ */
111
+ static decryptImageToUrl(imageUrl: string, key: CryptoKey, mimeType?: string): Promise<string>;
112
+ /**
113
+ * Convert a Uint8Array to a Base64-encoded string.
114
+ * @private
115
+ */
116
+ private static _uint8ArrayToBase64;
117
+ /**
118
+ * Convert a Base64-encoded string to a Uint8Array.
119
+ * @private
120
+ */
121
+ private static _base64ToUint8Array;
122
+ }
123
+ //# sourceMappingURL=encryptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryptor.d.ts","sourceRoot":"","sources":["../../../src/editor/e2ee/encryptor.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH;IACI;;;;;;OAMG;IACH,0BAJW,MAAM,OACN,SAAS,GACP,OAAO,CAAC,MAAM,CAAC,CAe3B;IAED;;;;;;OAMG;IACH,iCAJW,MAAM,OACN,SAAS,GACP,OAAO,CAAC,MAAM,CAAC,CAY3B;IAED;;;;;;;;OAQG;IACH,0BAJW,MAAM,OACN,SAAS,GACP,OAAO,CAAC,MAAM,CAAC,CAI3B;IAED;;;;;;;;OAQG;IACH,uCAJW,MAAM,OACN,SAAS,GACP,OAAO,CAAC,MAAM,CAAC,CAK3B;IAED;;;;;;OAMG;IACH,6BAJW,WAAW,OACX,SAAS,GACP,OAAO,CAAC,MAAM,CAAC,CAc3B;IAED;;;;;;OAMG;IACH,uCAJW,MAAM,OACN,SAAS,GACP,OAAO,CAAC,WAAW,CAAC,CAOhC;IAED;;;;;;;;;;OAUG;IACH,0BAJW,IAAI,GAAC,IAAI,OACT,SAAS,GACP,OAAO,CAAC,IAAI,CAAC,CAezB;IAED;;;;;;OAMG;IACH,sCAJW,MAAM,OACN,SAAS,GACP,OAAO,CAAC,WAAW,CAAC,CAIhC;IAED;;;;;;;;;OASG;IACH,+CAJW,MAAM,OACN,SAAS,GACP,OAAO,CAAC,MAAM,CAAC,CAU3B;IAED;;;;;;;;;;OAUG;IACH,mCALW,MAAM,OACN,SAAS,aACT,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAc3B;IAID;;;OAGG;IACH,mCAMC;IAED;;;OAGG;IACH,mCAOC;CACJ"}
@@ -0,0 +1,201 @@
1
+ /**
2
+ * E2EE Encryptor - Handles encryption and decryption of document content
3
+ * for end-to-end encrypted documents.
4
+ *
5
+ * Uses AES-GCM (256-bit) for all encryption operations. Each encryption
6
+ * operation generates a random 12-byte IV (initialization vector) to
7
+ * ensure that encrypting the same plaintext twice produces different
8
+ * ciphertext.
9
+ *
10
+ * Encrypted data format (Appendix A of the E2EE plan):
11
+ * [IV (12 bytes)][Ciphertext (variable length)][Auth Tag (16 bytes, implicit in AES-GCM)]
12
+ *
13
+ * When stored as a string (e.g., in JSON fields), the entire structure
14
+ * is Base64-encoded.
15
+ */
16
+ export class E2EEEncryptor {
17
+ /**
18
+ * Encrypt a string with AES-GCM.
19
+ *
20
+ * @param {string} plaintext - The plaintext string to encrypt
21
+ * @param {CryptoKey} key - An AES-GCM key (from E2EEKeyManager.deriveKey)
22
+ * @returns {Promise<string>} Base64-encoded string (iv + ciphertext + auth tag)
23
+ */
24
+ static async encrypt(plaintext, key) {
25
+ const iv = crypto.getRandomValues(new Uint8Array(12));
26
+ const encoded = new TextEncoder().encode(plaintext);
27
+ const ciphertext = await crypto.subtle.encrypt({ name: "AES-GCM", iv: iv }, key, encoded);
28
+ // Prepend IV to ciphertext for storage
29
+ const combined = new Uint8Array(iv.length + ciphertext.byteLength);
30
+ combined.set(iv, 0);
31
+ combined.set(new Uint8Array(ciphertext), iv.length);
32
+ return E2EEEncryptor._uint8ArrayToBase64(combined);
33
+ }
34
+ /**
35
+ * Decrypt a Base64-encoded AES-GCM ciphertext.
36
+ *
37
+ * @param {string} ciphertextBase64 - Base64-encoded (iv + ciphertext + auth tag)
38
+ * @param {CryptoKey} key - An AES-GCM key (from E2EEKeyManager.deriveKey)
39
+ * @returns {Promise<string>} The decrypted plaintext string
40
+ */
41
+ static async decrypt(ciphertextBase64, key) {
42
+ const combined = E2EEEncryptor._base64ToUint8Array(ciphertextBase64);
43
+ const iv = combined.slice(0, 12);
44
+ const ciphertext = combined.slice(12);
45
+ const decrypted = await crypto.subtle.decrypt({ name: "AES-GCM", iv: iv }, key, ciphertext);
46
+ return new TextDecoder().decode(decrypted);
47
+ }
48
+ /**
49
+ * Encrypt a JSON-serializable object.
50
+ *
51
+ * Serializes the object to JSON, then encrypts the JSON string.
52
+ *
53
+ * @param {Object} obj - A JSON-serializable object
54
+ * @param {CryptoKey} key - An AES-GCM key
55
+ * @returns {Promise<string>} Base64-encoded encrypted data
56
+ */
57
+ static encryptObject(obj, key) {
58
+ return E2EEEncryptor.encrypt(JSON.stringify(obj), key);
59
+ }
60
+ /**
61
+ * Decrypt to a JSON-serializable object.
62
+ *
63
+ * Decrypts the Base64-encoded ciphertext, then parses the result as JSON.
64
+ *
65
+ * @param {string} ciphertextBase64 - Base64-encoded encrypted data
66
+ * @param {CryptoKey} key - An AES-GCM key
67
+ * @returns {Promise<Object>} The decrypted and parsed object
68
+ */
69
+ static async decryptObject(ciphertextBase64, key) {
70
+ const plaintext = await E2EEEncryptor.decrypt(ciphertextBase64, key);
71
+ return JSON.parse(plaintext);
72
+ }
73
+ /**
74
+ * Encrypt an ArrayBuffer (for images and other binary data).
75
+ *
76
+ * @param {ArrayBuffer} buffer - The binary data to encrypt
77
+ * @param {CryptoKey} key - An AES-GCM key
78
+ * @returns {Promise<string>} Base64-encoded encrypted data (iv + ciphertext)
79
+ */
80
+ static async encryptBuffer(buffer, key) {
81
+ const iv = crypto.getRandomValues(new Uint8Array(12));
82
+ const ciphertext = await crypto.subtle.encrypt({ name: "AES-GCM", iv: iv }, key, buffer);
83
+ // Prepend IV to ciphertext
84
+ const combined = new Uint8Array(iv.length + ciphertext.byteLength);
85
+ combined.set(iv, 0);
86
+ combined.set(new Uint8Array(ciphertext), iv.length);
87
+ return E2EEEncryptor._uint8ArrayToBase64(combined);
88
+ }
89
+ /**
90
+ * Decrypt to an ArrayBuffer.
91
+ *
92
+ * @param {string} ciphertextBase64 - Base64-encoded encrypted data
93
+ * @param {CryptoKey} key - An AES-GCM key
94
+ * @returns {Promise<ArrayBuffer>} The decrypted binary data
95
+ */
96
+ static decryptBuffer(ciphertextBase64, key) {
97
+ const combined = E2EEEncryptor._base64ToUint8Array(ciphertextBase64);
98
+ const iv = combined.slice(0, 12);
99
+ const ciphertext = combined.slice(12);
100
+ return crypto.subtle.decrypt({ name: "AES-GCM", iv: iv }, key, ciphertext);
101
+ }
102
+ /**
103
+ * Encrypt an image File/Blob for upload.
104
+ *
105
+ * Reads the file as an ArrayBuffer, encrypts it, and returns
106
+ * a Blob with application/octet-stream type (since the encrypted
107
+ * data is opaque binary).
108
+ *
109
+ * @param {File|Blob} file - The image file to encrypt
110
+ * @param {CryptoKey} key - An AES-GCM key
111
+ * @returns {Promise<Blob>} An encrypted Blob with type application/octet-stream
112
+ */
113
+ static async encryptImage(file, key) {
114
+ const buffer = await file.arrayBuffer();
115
+ const iv = crypto.getRandomValues(new Uint8Array(12));
116
+ const ciphertext = await crypto.subtle.encrypt({ name: "AES-GCM", iv: iv }, key, buffer);
117
+ // Prepend IV to ciphertext
118
+ const combined = new Uint8Array(iv.length + ciphertext.byteLength);
119
+ combined.set(iv, 0);
120
+ combined.set(new Uint8Array(ciphertext), iv.length);
121
+ return new Blob([combined], { type: "application/octet-stream" });
122
+ }
123
+ /**
124
+ * Decrypt an encrypted image back to an ArrayBuffer.
125
+ *
126
+ * @param {string} ciphertextBase64 - Base64-encoded encrypted image data
127
+ * @param {CryptoKey} key - An AES-GCM key
128
+ * @returns {Promise<ArrayBuffer>} The decrypted image data
129
+ */
130
+ static decryptImage(ciphertextBase64, key) {
131
+ return E2EEEncryptor.decryptBuffer(ciphertextBase64, key);
132
+ }
133
+ /**
134
+ * Decrypt a Base64-encoded ciphertext and return as a Base64 string.
135
+ *
136
+ * Useful for decrypting encrypted images that need to be stored
137
+ * as Base64 data URLs or re-exported.
138
+ *
139
+ * @param {string} ciphertextBase64 - Base64-encoded encrypted data
140
+ * @param {CryptoKey} key - An AES-GCM key
141
+ * @returns {Promise<string>} Base64-encoded decrypted data
142
+ */
143
+ static async decryptBufferToBase64(ciphertextBase64, key) {
144
+ const buffer = await E2EEEncryptor.decryptBuffer(ciphertextBase64, key);
145
+ const bytes = new Uint8Array(buffer);
146
+ let binary = "";
147
+ for (let i = 0; i < bytes.length; i++) {
148
+ binary += String.fromCharCode(bytes[i]);
149
+ }
150
+ return btoa(binary);
151
+ }
152
+ /**
153
+ * Decrypt an encrypted image and return a blob URL for display.
154
+ *
155
+ * Fetches the encrypted image file from the given URL, decrypts it,
156
+ * and creates a temporary object URL that can be used as an img src.
157
+ *
158
+ * @param {string} imageUrl - The URL of the encrypted image file
159
+ * @param {CryptoKey} key - An AES-GCM key
160
+ * @param {string} mimeType - The MIME type of the decrypted image
161
+ * @returns {Promise<string>} A blob URL for the decrypted image
162
+ */
163
+ static async decryptImageToUrl(imageUrl, key, mimeType = "image/png") {
164
+ const response = await fetch(imageUrl);
165
+ const arrayBuffer = await response.arrayBuffer();
166
+ const bytes = new Uint8Array(arrayBuffer);
167
+ let binary = "";
168
+ for (let i = 0; i < bytes.length; i++) {
169
+ binary += String.fromCharCode(bytes[i]);
170
+ }
171
+ const base64 = btoa(binary);
172
+ const decrypted = await E2EEEncryptor.decryptBuffer(base64, key);
173
+ const blob = new Blob([decrypted], { type: mimeType });
174
+ return URL.createObjectURL(blob);
175
+ }
176
+ // --- Private helper methods ---
177
+ /**
178
+ * Convert a Uint8Array to a Base64-encoded string.
179
+ * @private
180
+ */
181
+ static _uint8ArrayToBase64(bytes) {
182
+ let binary = "";
183
+ for (let i = 0; i < bytes.length; i++) {
184
+ binary += String.fromCharCode(bytes[i]);
185
+ }
186
+ return btoa(binary);
187
+ }
188
+ /**
189
+ * Convert a Base64-encoded string to a Uint8Array.
190
+ * @private
191
+ */
192
+ static _base64ToUint8Array(base64) {
193
+ const binary = atob(base64);
194
+ const bytes = new Uint8Array(binary.length);
195
+ for (let i = 0; i < binary.length; i++) {
196
+ bytes[i] = binary.charCodeAt(i);
197
+ }
198
+ return bytes;
199
+ }
200
+ }
201
+ //# sourceMappingURL=encryptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryptor.js","sourceRoot":"","sources":["../../../src/editor/e2ee/encryptor.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,aAAa;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG;QAC/B,MAAM,EAAE,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAA;QACrD,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QACnD,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,CAC1C,EAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAC,EACzB,GAAG,EACH,OAAO,CACV,CAAA;QACD,uCAAuC;QACvC,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;QAClE,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QACnB,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAA;QACnD,OAAO,aAAa,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IACtD,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG;QACtC,MAAM,QAAQ,GAAG,aAAa,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAA;Q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1,21 @@
1
+ export class DOCXExporterCitations {
2
+ constructor(docContent: any, settings: any, bibDB: any, csl: any, xml: any, origCitInfos?: any[]);
3
+ docContent: any;
4
+ settings: any;
5
+ bibDB: any;
6
+ csl: any;
7
+ xml: any;
8
+ origCitInfos: any[];
9
+ citInfos: any[];
10
+ citationTexts: any[];
11
+ pmCits: any[];
12
+ citFm: boolean;
13
+ pmBib: boolean;
14
+ styleXML: boolean;
15
+ styleFilePath: string;
16
+ init(): any;
17
+ formatCitations(): any;
18
+ convertCitations(): void;
19
+ addReferenceStyle(bibInfo: any): void;
20
+ }
21
+ //# sourceMappingURL=citations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"citations.d.ts","sourceRoot":"","sources":["../../../src/exporter/docx/citations.js"],"names":[],"mappings":"AAOA;IACI,kGAeC;IAdG,gBAA4B;IAC5B,cAAwB;IACxB,WAAkB;IAClB,SAAc;IACd,SAAc;IACd,oBAAgC;IAEhC,gBAAkB;IAClB,qBAAuB;IACvB,cAAgB;IAChB,eAAkB;IAClB,eAAkB;IAClB,kBAAqB;IACrB,sBAAsC;IAG1C,YAQC;IAID,uBA+BC;IAED,yBAiCC;IAED,sCAsEC;CACJ"}
@@ -0,0 +1,154 @@
1
+ import { DOMParser, DOMSerializer } from "prosemirror-model";
2
+ import { cslBibSchema } from "../../bibliography/csl_bib.js";
3
+ import { FormatCitations } from "../../citations/format.js";
4
+ import { fnSchema } from "../../schema/footnotes.js";
5
+ import { descendantNodes } from "../tools/doc_content.js";
6
+ export class DOCXExporterCitations {
7
+ constructor(docContent, settings, bibDB, csl, xml, origCitInfos = []) {
8
+ this.docContent = docContent;
9
+ this.settings = settings;
10
+ this.bibDB = bibDB;
11
+ this.csl = csl;
12
+ this.xml = xml;
13
+ this.origCitInfos = origCitInfos;
14
+ this.citInfos = [];
15
+ this.citationTexts = [];
16
+ this.pmCits = [];
17
+ this.citFm = false;
18
+ this.pmBib = false;
19
+ this.styleXML = false;
20
+ this.styleFilePath = "word/styles.xml";
21
+ }
22
+ init() {
23
+ return this.xml
24
+ .getXml(this.styleFilePath)
25
+ .then(styleXML => {
26
+ this.styleXML = styleXML;
27
+ return Promise.resolve();
28
+ })
29
+ .then(() => this.formatCitations());
30
+ }
31
+ // Citations are highly interdependent -- so we need to format them all
32
+ // together before laying out the document.
33
+ formatCitations() {
34
+ if (this.origCitInfos.length) {
35
+ // Initial citInfos are taken from a previous run to include in bibliography,
36
+ // and they are removed before spitting out the citation entries for the given document.
37
+ // That way the bibliography should contain information from both.
38
+ this.citInfos = this.citInfos.concat(this.origCitInfos);
39
+ }
40
+ descendantNodes(this.docContent).forEach(node => {
41
+ if (node.type === "citation") {
42
+ this.citInfos.push(JSON.parse(JSON.stringify(node.attrs)));
43
+ }
44
+ });
45
+ this.citFm = new FormatCitations(this.csl, this.citInfos, this.settings.citationstyle, "", this.bibDB, false, this.settings.language);
46
+ return this.citFm.init().then(() => {
47
+ this.citationTexts = this.citFm.citationTexts;
48
+ if (this.origCitInfos.length) {
49
+ // Remove all citation texts originating from original starting citInfos
50
+ this.citationTexts.splice(0, this.origCitInfos.length);
51
+ }
52
+ this.convertCitations();
53
+ return Promise.resolve();
54
+ });
55
+ }
56
+ convertCitations() {
57
+ // There could be some formatting in the citations, so we parse them through the PM schema for final formatting.
58
+ // We need to put the citations each in a paragraph so that it works with
59
+ // the fiduswriter schema and so that the converter doesn't mash them together.
60
+ let citationsHTML = "";
61
+ this.citationTexts.forEach(ct => {
62
+ citationsHTML += `<p>${ct}</p>`;
63
+ });
64
+ if (citationsHTML.length) {
65
+ // We create a standard body footnotecontainer node, add the citations into it, and parse it back.
66
+ const fnNode = fnSchema.nodeFromJSON({ type: "footnotecontainer" });
67
+ const serializer = DOMSerializer.fromSchema(fnSchema);
68
+ const dom = serializer.serializeNode(fnNode);
69
+ dom.innerHTML = citationsHTML;
70
+ this.pmCits = DOMParser.fromSchema(fnSchema)
71
+ .parse(dom, { topNode: fnNode })
72
+ .toJSON().content;
73
+ }
74
+ // Now we do the same for the bibliography.
75
+ const cslBib = this.citFm.bibliography;
76
+ if (cslBib && cslBib[1].length > 0) {
77
+ this.addReferenceStyle(cslBib[0]);
78
+ const bibNode = cslBibSchema.nodeFromJSON({ type: "cslbib" });
79
+ const cslSerializer = DOMSerializer.fromSchema(cslBibSchema);
80
+ const dom = cslSerializer.serializeNode(bibNode);
81
+ dom.innerHTML = cslBib[1].join("");
82
+ this.pmBib = DOMParser.fromSchema(cslBibSchema)
83
+ .parse(dom, { topNode: bibNode })
84
+ .toJSON();
85
+ }
86
+ }
87
+ addReferenceStyle(bibInfo) {
88
+ const stylesEl = this.styleXML.query("w:styles");
89
+ if (!this.styleXML.query("w:style", {
90
+ "w:styleId": "BibliographyHeading"
91
+ })) {
92
+ // There is no style definition for the bibliography heading. We have to add it.
93
+ const headingStyleDef = `
94
+ <w:style w:type="paragraph" w:styleId="BibliographyHeading">
95
+ <w:name w:val="Bibliography Heading"/>
96
+ <w:basedOn w:val="Heading"/>
97
+ <w:pPr>
98
+ <w:suppressLineNumbers/>
99
+ <w:ind w:left="0" w:hanging="0"/>
100
+ </w:pPr>
101
+ <w:rPr>
102
+ <w:b/>
103
+ <w:bCs/>
104
+ <w:sz w:val="32"/>
105
+ <w:szCs w:val="32"/>
106
+ </w:rPr>
107
+ </w:style>`;
108
+ stylesEl.appendXML(headingStyleDef);
109
+ }
110
+ // The style called "Bibliography" will override any previous style
111
+ // of the same name.
112
+ const stylesParStyle = this.styleXML.query("w:style", {
113
+ "w:styleId": "Bibliography"
114
+ });
115
+ if (stylesParStyle) {
116
+ stylesParStyle.parentElement.removeChild(stylesParStyle);
117
+ }
118
+ const lineHeight = 240 * bibInfo.linespacing;
119
+ const marginBottom = 240 * bibInfo.entryspacing;
120
+ let marginLeft = 0, hangingIndent = 0, tabStops = "";
121
+ if (bibInfo.hangingindent) {
122
+ marginLeft = 720;
123
+ hangingIndent = 720;
124
+ }
125
+ else if (bibInfo["second-field-align"]) {
126
+ // We calculate 120 as roughly equivalent to one letter width.
127
+ const firstFieldWidth = (bibInfo.maxoffset + 1) * 120;
128
+ if (bibInfo["second-field-align"] === "margin") {
129
+ hangingIndent = firstFieldWidth;
130
+ tabStops =
131
+ '<w:tabs><w:tab w:val="left" w:pos="0" w:leader="none"/></w:tabs>';
132
+ }
133
+ else {
134
+ hangingIndent = firstFieldWidth;
135
+ marginLeft = firstFieldWidth;
136
+ tabStops = `<w:tabs><w:tab w:val="left" w:pos="${firstFieldWidth}" w:leader="none"/></w:tabs>`;
137
+ }
138
+ }
139
+ const styleDef = `
140
+ <w:style w:type="paragraph" w:styleId="Bibliography">
141
+ <w:name w:val="Bibliography"/>
142
+ <w:basedOn w:val="Normal"/>
143
+ <w:qFormat/>
144
+ <w:pPr>
145
+ ${tabStops}
146
+ <w:spacing w:lineRule="atLeast" w:line="${lineHeight}" w:before="0" w:after="${marginBottom}"/>
147
+ <w:ind w:left="${marginLeft}" w:hanging="${hangingIndent}"/>
148
+ </w:pPr>
149
+ <w:rPr></w:rPr>
150
+ </w:style>`;
151
+ stylesEl.appendXML(styleDef);
152
+ }
153
+ }
154
+ //# sourceMappingURL=citations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"citations.js","sourceRoot":"","sources":["../../../src/exporter/docx/citations.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAA;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAEvD,MAAM,OAAO,qBAAqB;IAC9B,YAAY,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,GAAG,EAAE;QAChE,IAAI,CAAC,UAAU,GAAG,UAAU,CAA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Q;8DACgC,UAAU,2BAA2B,YAAY;qCAC1E,UAAU,gBAAgB,aAAa;;;uBAGrD,CAAA;QAEf,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IAChC,CAAC;CACJ"}
@@ -0,0 +1,18 @@
1
+ export class DOCXExporterComments {
2
+ constructor(docContent: any, commentsDB: any, xml: any, rels: any, richtext: any);
3
+ docContent: any;
4
+ commentsDB: any;
5
+ xml: any;
6
+ rels: any;
7
+ richtext: any;
8
+ usedComments: any[];
9
+ commentsXML: boolean;
10
+ commentsExtendedXML: boolean;
11
+ commentsFilePath: string;
12
+ commentsExtendedFilePath: string;
13
+ commentIdCounter: number;
14
+ init(): Promise<void>;
15
+ addComment(id: any): void;
16
+ exportComments(): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=comments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../src/exporter/docx/comments.js"],"names":[],"mappings":"AAWA;IACI,kFAaC;IAZG,gBAA4B;IAC5B,gBAA4B;IAC5B,SAAc;IACd,UAAgB;IAChB,cAAwB;IAExB,oBAAsB;IACtB,qBAAwB;IACxB,6BAAgC;IAChC,yBAA2C;IAC3C,iCAA2D;IAC3D,yBAA0B;IAG9B,sBAuDC;IAED,0BAwEC;IAED,gCAKC;CACJ"}