@fiduswriter/document 0.1.0-alpha.3 → 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,663 @@
1
+ import { xmlDOM } from "../../exporter/tools/xml.js";
2
+ import { randomCommentId } from "../../schema/common/index.js";
3
+ const DEFAULT_STYLES_XML = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
4
+ <w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
5
+ </w:styles>`;
6
+ export class DocxParser {
7
+ constructor(zip) {
8
+ this.zip = zip;
9
+ this.styles = {};
10
+ this.numbering = {};
11
+ this.comments = {};
12
+ this.footnotes = {};
13
+ this.endnotes = {};
14
+ this.relationships = {};
15
+ this.images = {};
16
+ this.coreDoc = null;
17
+ this.document = null;
18
+ }
19
+ init() {
20
+ return this.parseStyles()
21
+ .then(() => this.parseNumbering())
22
+ .then(() => this.parseComments())
23
+ .then(() => this.parseCommentsExtended())
24
+ .then(() => this.parseFootnotes())
25
+ .then(() => this.parseEndnotes())
26
+ .then(() => this.parseRelationships())
27
+ .then(() => this.parseImages())
28
+ .then(() => this.parseCoreDoc())
29
+ .then(() => this.parseCustomDoc())
30
+ .then(() => this.parseDocument());
31
+ }
32
+ async parseStyles() {
33
+ try {
34
+ const content = await this.zip
35
+ .file("word/styles.xml")
36
+ ?.async("string");
37
+ const stylesDoc = xmlDOM(content || DEFAULT_STYLES_XML);
38
+ const styles = stylesDoc.queryAll("w:style");
39
+ styles.forEach(style => {
40
+ const id = style.getAttribute("w:styleId");
41
+ const type = style.getAttribute("w:type");
42
+ const name = style.query("w:name")?.getAttribute("w:val");
43
+ const basedOn = style.query("w:basedOn")?.getAttribute("w:val");
44
+ this.styles[id] = {
45
+ id,
46
+ type,
47
+ name,
48
+ isHeading: (id && /heading\d+/i.test(id)) ||
49
+ (basedOn && /heading\d+/i.test(basedOn)),
50
+ isCaption: (id && /caption/i.test(id)) ||
51
+ (basedOn && /caption/i.test(basedOn)),
52
+ level: id ? parseInt(id.match(/\d+/)?.[0] || 0) : 0,
53
+ basedOn,
54
+ paragraphProps: this.extractParagraphProperties(style),
55
+ runProps: this.extractRunProperties(style)
56
+ };
57
+ });
58
+ }
59
+ catch (err) {
60
+ console.warn("Could not parse styles", err);
61
+ }
62
+ }
63
+ isCodeStyle(styleId) {
64
+ let current = styleId;
65
+ const visited = new Set();
66
+ while (current && !visited.has(current)) {
67
+ visited.add(current);
68
+ const style = this.styles[current];
69
+ if (!style) {
70
+ return false;
71
+ }
72
+ const name = style.name?.toLowerCase() || "";
73
+ if (/^code(\s|$)/i.test(style.id) ||
74
+ name === "code" ||
75
+ name.includes("code") ||
76
+ /^html(\s|$)/i.test(style.id) ||
77
+ /^pre(\s|$)/i.test(style.id)) {
78
+ return true;
79
+ }
80
+ // Check font family on the style
81
+ if (style.runProps?.fontFamily) {
82
+ const fontFamily = style.runProps.fontFamily.toLowerCase();
83
+ const monospacePatterns = [
84
+ "courier",
85
+ "consolas",
86
+ "monaco",
87
+ "menlo",
88
+ "lucida console",
89
+ "liberation mono",
90
+ "dejavu sans mono",
91
+ "bitstream vera sans mono",
92
+ "source code pro",
93
+ "fira code",
94
+ "ubuntu mono",
95
+ "droid sans mono",
96
+ "monospace"
97
+ ];
98
+ if (monospacePatterns.some(p => fontFamily.includes(p))) {
99
+ return true;
100
+ }
101
+ }
102
+ current = style.basedOn;
103
+ }
104
+ return false;
105
+ }
106
+ extractParagraphProperties(style) {
107
+ const pPr = style.query("w:pPr");
108
+ if (!pPr) {
109
+ return {};
110
+ }
111
+ return {
112
+ indent: this.extractIndentation(pPr),
113
+ alignment: pPr.query("w:jc")?.getAttribute("w:val"),
114
+ numbering: this.extractNumbering(pPr),
115
+ keepNext: Boolean(pPr.query("w:keepNext"))
116
+ };
117
+ }
118
+ extractIndentation(pPr) {
119
+ const ind = pPr.query("w:ind");
120
+ if (!ind) {
121
+ return {};
122
+ }
123
+ return {
124
+ left: parseInt(ind.getAttribute("w:left") || ind.getAttribute("w:start") || "0"),
125
+ right: parseInt(ind.getAttribute("w:right") || ind.getAttribute("w:end") || "0"),
126
+ hanging: parseInt(ind.getAttribute("w:hanging") || "0"),
127
+ firstLine: parseInt(ind.getAttribute("w:firstLine") || "0")
128
+ };
129
+ }
130
+ extractNumbering(pPr) {
131
+ const numPr = pPr.query("w:numPr");
132
+ if (!numPr) {
133
+ return null;
134
+ }
135
+ return {
136
+ id: numPr.query("w:numId")?.getAttribute("w:val"),
137
+ level: parseInt(numPr.query("w:ilvl")?.getAttribute("w:val") || "0")
138
+ };
139
+ }
140
+ extractRunProperties(rPr) {
141
+ if (!rPr) {
142
+ return {};
143
+ }
144
+ return {
145
+ bold: Boolean(rPr.query("w:b")),
146
+ italic: Boolean(rPr.query("w:i")),
147
+ underline: rPr.query("w:u")?.getAttribute("w:val") || false,
148
+ strike: Boolean(rPr.query("w:strike")),
149
+ smallCaps: Boolean(rPr.query("w:smallCaps")),
150
+ vertAlign: rPr.query("w:vertAlign")?.getAttribute("w:val") || false,
151
+ fontSize: parseInt(rPr.query("w:sz")?.getAttribute("w:val") || "0") / 2,
152
+ color: rPr.query("w:color")?.getAttribute("w:val") || false,
153
+ fontFamily: rPr.query("w:rFonts")?.getAttribute("w:ascii") || false
154
+ };
155
+ }
156
+ async parseNumbering() {
157
+ try {
158
+ const content = await this.zip
159
+ .file("word/numbering.xml")
160
+ ?.async("string");
161
+ if (!content) {
162
+ return;
163
+ }
164
+ const numberingDoc = xmlDOM(content);
165
+ // Parse abstract numbering definitions
166
+ const abstractNums = numberingDoc.queryAll("w:abstractNum");
167
+ const abstractNumbering = {};
168
+ abstractNums.forEach(abstractNum => {
169
+ const id = abstractNum.getAttribute("w:abstractNumId");
170
+ const levels = abstractNum.queryAll("w:lvl").map(lvl => ({
171
+ level: lvl.getAttribute("w:ilvl"),
172
+ format: lvl.query("w:numFmt")?.getAttribute("w:val"),
173
+ text: lvl.query("w:lvlText")?.getAttribute("w:val"),
174
+ start: parseInt(lvl.query("w:start")?.getAttribute("w:val") || "1")
175
+ }));
176
+ abstractNumbering[id] = levels;
177
+ });
178
+ // Parse numbering instances
179
+ const nums = numberingDoc.queryAll("w:num");
180
+ nums.forEach(num => {
181
+ const numId = num.getAttribute("w:numId");
182
+ const abstractNumId = num
183
+ .query("w:abstractNumId")
184
+ ?.getAttribute("w:val");
185
+ this.numbering[numId] = {
186
+ abstractId: abstractNumId,
187
+ levels: abstractNumbering[abstractNumId] || [],
188
+ overrides: this.extractNumberingOverrides(num)
189
+ };
190
+ });
191
+ }
192
+ catch (err) {
193
+ console.warn("Could not parse numbering", err);
194
+ }
195
+ }
196
+ extractNumberingOverrides(num) {
197
+ return num.queryAll("w:lvlOverride").map(override => ({
198
+ level: override.getAttribute("w:ilvl"),
199
+ start: parseInt(override.query("w:startOverride")?.getAttribute("w:val") || "1")
200
+ }));
201
+ }
202
+ async parseComments() {
203
+ try {
204
+ const content = await this.zip
205
+ .file("word/comments.xml")
206
+ ?.async("string");
207
+ if (!content) {
208
+ return;
209
+ }
210
+ const commentsDoc = xmlDOM(content);
211
+ const commentList = commentsDoc.queryAll("w:comment");
212
+ // First pass: parse all comments into the expected format
213
+ commentList.forEach(comment => {
214
+ const id = comment.getAttribute("w:id");
215
+ const dateStr = comment.getAttribute("w:date");
216
+ this.comments[id] = {
217
+ user: 0,
218
+ username: comment.getAttribute("w:author") || gettext("Unknown"),
219
+ date: dateStr ? new Date(dateStr).getTime() : Date.now(),
220
+ comment: this.extractCommentContent(comment),
221
+ answers: [],
222
+ resolved: false,
223
+ isMajor: false
224
+ };
225
+ });
226
+ }
227
+ catch (err) {
228
+ console.warn("Could not parse comments", err);
229
+ }
230
+ }
231
+ async parseCommentsExtended() {
232
+ try {
233
+ const content = await this.zip
234
+ .file("word/commentsExtended.xml")
235
+ ?.async("string");
236
+ if (!content) {
237
+ return;
238
+ }
239
+ const commentsExDoc = xmlDOM(content);
240
+ const extendedEntries = commentsExDoc.queryAll("w15:commentEx");
241
+ if (!extendedEntries.length) {
242
+ return;
243
+ }
244
+ // Parse extended entries into main (no parentParaId) and answer entries
245
+ const mainEntries = [];
246
+ const answerEntries = [];
247
+ extendedEntries.forEach(entry => {
248
+ const paraId = entry.getAttribute("w15:paraId");
249
+ const done = entry.getAttribute("w15:done") === "1";
250
+ const paraIdParent = entry.getAttribute("w15:paraIdParent");
251
+ if (paraId) {
252
+ if (paraIdParent) {
253
+ answerEntries.push({
254
+ paraId,
255
+ parentParaId: paraIdParent,
256
+ done
257
+ });
258
+ }
259
+ else {
260
+ mainEntries.push({ paraId, done });
261
+ }
262
+ }
263
+ });
264
+ // Map resolved status to comments by position/order.
265
+ // Main comments are written first in comments.xml, and their
266
+ // extended entries appear first in commentsExtended.xml.
267
+ const commentIds = Object.keys(this.comments)
268
+ .map(Number)
269
+ .sort((a, b) => a - b)
270
+ .map(String);
271
+ // Track which comment IDs are parents vs answers
272
+ const parentCommentIds = [];
273
+ commentIds.forEach((commentId, index) => {
274
+ if (index < mainEntries.length) {
275
+ // This is a main comment - apply resolved status
276
+ this.comments[commentId].resolved = mainEntries[index].done;
277
+ parentCommentIds.push(commentId);
278
+ }
279
+ else {
280
+ // This is an answer comment - group under nearest parent
281
+ const answerComment = this.comments[commentId];
282
+ if (answerComment) {
283
+ // Find the parent - answers are written right after
284
+ // their parent comment in comments.xml
285
+ const answerIndex = index - mainEntries.length;
286
+ const answerEntry = answerEntries[answerIndex];
287
+ if (answerEntry) {
288
+ // Map answer to its parent comment
289
+ const parentId = parentCommentIds.length
290
+ ? parentCommentIds[parentCommentIds.length - 1]
291
+ : null;
292
+ if (parentId && this.comments[parentId]) {
293
+ this.comments[parentId].answers.push({
294
+ id: randomCommentId(),
295
+ user: 0,
296
+ username: answerComment.username,
297
+ date: answerComment.date,
298
+ answer: answerComment.comment
299
+ });
300
+ // Remove the answer from top-level
301
+ delete this.comments[commentId];
302
+ }
303
+ }
304
+ }
305
+ }
306
+ });
307
+ }
308
+ catch (err) {
309
+ console.warn("Could not parse comments extended", err);
310
+ }
311
+ }
312
+ extractCommentContent(comment) {
313
+ const content = [];
314
+ comment.queryAll("w:p").forEach(p => {
315
+ content.push({
316
+ type: "paragraph",
317
+ content: this.extractParagraphContent(p)
318
+ });
319
+ });
320
+ return content;
321
+ }
322
+ async parseFootnotes() {
323
+ try {
324
+ const content = await this.zip
325
+ .file("word/footnotes.xml")
326
+ ?.async("string");
327
+ if (!content) {
328
+ return;
329
+ }
330
+ const footnotesDoc = xmlDOM(content);
331
+ footnotesDoc.queryAll("w:footnote").forEach(footnote => {
332
+ const id = footnote.getAttribute("w:id");
333
+ if (id === "0" || id === "-1") {
334
+ return; // Skip separator footnotes
335
+ }
336
+ this.footnotes[id] = {
337
+ id,
338
+ content: this.extractBlockContent(footnote)
339
+ };
340
+ });
341
+ }
342
+ catch (err) {
343
+ console.warn("Could not parse footnotes", err);
344
+ }
345
+ }
346
+ // async parseFootnotes() {
347
+ // try {
348
+ // const content = await this.zip
349
+ // .file("word/footnotes.xml")
350
+ // ?.async("string")
351
+ // if (!content) {
352
+ // return
353
+ // }
354
+ // const footnotesDoc = xmlDOM(content)
355
+ // footnotesDoc.queryAll("w:footnote").forEach(footnote => {
356
+ // const id = footnote.getAttribute("w:id")
357
+ // if (id === "0" || id === "-1") {
358
+ // return // Skip separator footnotes
359
+ // }
360
+ // // Process each paragraph in the footnote
361
+ // const paragraphs = []
362
+ // footnote.queryAll("w:p").forEach(p => {
363
+ // paragraphs.push({
364
+ // type: "paragraph",
365
+ // content: this.extractParagraphContent(p)
366
+ // })
367
+ // })
368
+ // this.footnotes[id] = {
369
+ // id,
370
+ // content: paragraphs
371
+ // }
372
+ // })
373
+ // } catch (err) {
374
+ // console.warn("Could not parse footnotes", err)
375
+ // }
376
+ // }
377
+ // extractParagraphContent(p) {
378
+ // const content = []
379
+ // // Handle field codes (for cross-references)
380
+ // const fieldRuns = []
381
+ // let currentFieldCode = null
382
+ // let collectingField = false
383
+ // p.queryAll("w:r").forEach(r => {
384
+ // const fieldChar = r.query("w:fldChar")
385
+ // if (fieldChar) {
386
+ // const type = fieldChar.getAttribute("w:fldCharType")
387
+ // if (type === "begin") {
388
+ // collectingField = true
389
+ // currentFieldCode = { code: "", result: "" }
390
+ // } else if (type === "separate") {
391
+ // collectingField = false
392
+ // } else if (type === "end") {
393
+ // if (currentFieldCode) {
394
+ // fieldRuns.push(currentFieldCode)
395
+ // currentFieldCode = null
396
+ // }
397
+ // }
398
+ // } else if (collectingField && currentFieldCode) {
399
+ // const instrText = r.query("w:instrText")
400
+ // if (instrText) {
401
+ // currentFieldCode.code += instrText.textContent
402
+ // }
403
+ // } else if (currentFieldCode) {
404
+ // const text = r.query("w:t")?.textContent
405
+ // if (text) {
406
+ // currentFieldCode.result += text
407
+ // }
408
+ // }
409
+ // // Normal text processing
410
+ // const text = r.query("w:t")?.textContent
411
+ // if (!text && !r.query("w:drawing") && !r.query("w:pict")) {
412
+ // // Check for breaks
413
+ // if (r.query("w:br")) {
414
+ // content.push({ type: "hard_break" })
415
+ // }
416
+ // return
417
+ // }
418
+ // // Check for hyperlinks
419
+ // const hyperlink = r.closest("w:hyperlink")
420
+ // if (hyperlink && !r.query("w:drawing") && !r.query("w:pict")) {
421
+ // // This will be handled separately
422
+ // return
423
+ // }
424
+ // const rPr = r.query("w:rPr")
425
+ // const formatting = rPr ? this.extractRunProperties(rPr) : {}
426
+ // if (text) {
427
+ // content.push({
428
+ // type: "text",
429
+ // text,
430
+ // marks: this.createMarksFromFormatting(formatting)
431
+ // })
432
+ // }
433
+ // })
434
+ // // Process hyperlinks in the paragraph
435
+ // p.queryAll("w:hyperlink").forEach(hyperlink => {
436
+ // const rId = hyperlink.getAttribute("r:id")
437
+ // const anchor = hyperlink.getAttribute("w:anchor")
438
+ // // Collect all text from the hyperlink
439
+ // let linkText = ""
440
+ // hyperlink.queryAll("w:r").forEach(r => {
441
+ // const t = r.query("w:t")
442
+ // if (t) {
443
+ // linkText += t.textContent
444
+ // }
445
+ // })
446
+ // if (linkText) {
447
+ // let href = "#"
448
+ // if (rId && this.relationships[rId]) {
449
+ // href = this.relationships[rId].target
450
+ // } else if (anchor) {
451
+ // href = `#${anchor}`
452
+ // }
453
+ // content.push({
454
+ // type: "text",
455
+ // text: linkText,
456
+ // marks: [{
457
+ // type: "link",
458
+ // attrs: {
459
+ // href,
460
+ // title: linkText
461
+ // }
462
+ // }]
463
+ // })
464
+ // }
465
+ // })
466
+ // // Process field runs for cross-references
467
+ // fieldRuns.forEach(field => {
468
+ // if (field.code.startsWith("REF ")) {
469
+ // const target = field.code.substring(4).trim().split(/\s+/)[0]
470
+ // content.push({
471
+ // type: "cross_reference",
472
+ // attrs: {
473
+ // id: target,
474
+ // title: field.result || target
475
+ // }
476
+ // })
477
+ // }
478
+ // })
479
+ // // Handle equations
480
+ // const oMath = p.query("m:oMath")
481
+ // if (oMath) {
482
+ // // Very basic LaTeX conversion (would need a proper OMML to LaTeX converter)
483
+ // const latex = "x^2" // Placeholder - should use a proper converter
484
+ // content.push({
485
+ // type: "equation",
486
+ // attrs: {
487
+ // equation: latex
488
+ // }
489
+ // })
490
+ // }
491
+ // return content
492
+ // }
493
+ async parseEndnotes() {
494
+ try {
495
+ const content = await this.zip
496
+ .file("word/endnotes.xml")
497
+ ?.async("string");
498
+ if (!content) {
499
+ return;
500
+ }
501
+ const endnotesDoc = xmlDOM(content);
502
+ endnotesDoc.queryAll("w:endnote").forEach(endnote => {
503
+ const id = endnote.getAttribute("w:id");
504
+ if (id === "0" || id === "-1") {
505
+ return; // Skip separator endnotes
506
+ }
507
+ this.endnotes[id] = {
508
+ id,
509
+ content: this.extractBlockContent(endnote)
510
+ };
511
+ });
512
+ }
513
+ catch (err) {
514
+ console.warn("Could not parse endnotes", err);
515
+ }
516
+ }
517
+ async parseRelationships() {
518
+ try {
519
+ const content = await this.zip
520
+ .file("word/_rels/document.xml.rels")
521
+ ?.async("string");
522
+ if (!content) {
523
+ return;
524
+ }
525
+ const relsDoc = xmlDOM(content);
526
+ relsDoc.queryAll("Relationship").forEach(rel => {
527
+ const id = rel.getAttribute("Id");
528
+ this.relationships[id] = {
529
+ id,
530
+ type: rel.getAttribute("Type"),
531
+ target: rel.getAttribute("Target")
532
+ };
533
+ });
534
+ }
535
+ catch (err) {
536
+ console.warn("Could not parse relationships", err);
537
+ }
538
+ }
539
+ async parseImages() {
540
+ // Find and extract image files
541
+ const imageFiles = Object.keys(this.zip.files).filter(path => path.startsWith("word/media/"));
542
+ for (const path of imageFiles) {
543
+ try {
544
+ const blob = await this.zip.file(path).async("blob");
545
+ const filename = path.split("/").pop();
546
+ const content = this.addMimeType(blob, filename);
547
+ this.images[filename] = content;
548
+ }
549
+ catch (err) {
550
+ console.warn(`Could not parse image ${path}`, err);
551
+ }
552
+ }
553
+ }
554
+ addMimeType(blob, filename) {
555
+ return new File([blob], filename, {
556
+ type: this.getImageFileType(filename)
557
+ });
558
+ }
559
+ getImageFileType(filename) {
560
+ const ext = filename.split(".").pop().toLowerCase();
561
+ switch (ext) {
562
+ case "avif":
563
+ case "avifs":
564
+ return "image/avif";
565
+ case "png":
566
+ return "image/png";
567
+ case "jpg":
568
+ case "jpeg":
569
+ return "image/jpeg";
570
+ case "gif":
571
+ return "image/gif";
572
+ case "svg":
573
+ return "image/svg+xml";
574
+ case "webp":
575
+ return "image/webp";
576
+ default:
577
+ return "image/png"; // Default fallback
578
+ }
579
+ }
580
+ extractBlockContent(node) {
581
+ const content = [];
582
+ node.queryAll("w:p").forEach(p => {
583
+ content.push({
584
+ type: "paragraph",
585
+ content: this.extractParagraphContent(p)
586
+ });
587
+ });
588
+ return content;
589
+ }
590
+ extractParagraphContent(p) {
591
+ const content = [];
592
+ p.queryAll("w:r").forEach(r => {
593
+ const text = r.query("w:t")?.textContent;
594
+ if (!text) {
595
+ return;
596
+ }
597
+ const rPr = r.query("w:rPr");
598
+ const formatting = rPr ? this.extractRunProperties(rPr) : {};
599
+ content.push({
600
+ type: "text",
601
+ text,
602
+ marks: this.createMarksFromFormatting(formatting)
603
+ });
604
+ });
605
+ return content;
606
+ }
607
+ createMarksFromFormatting(formatting) {
608
+ const marks = [];
609
+ if (formatting.bold) {
610
+ marks.push({ type: "strong" });
611
+ }
612
+ if (formatting.italic) {
613
+ marks.push({ type: "em" });
614
+ }
615
+ if (formatting.underline) {
616
+ marks.push({ type: "underline" });
617
+ }
618
+ return marks;
619
+ }
620
+ async parseCoreDoc() {
621
+ try {
622
+ const content = await this.zip
623
+ .file("docProps/core.xml")
624
+ ?.async("string");
625
+ if (!content) {
626
+ return;
627
+ }
628
+ this.coreDoc = xmlDOM(content);
629
+ }
630
+ catch (err) {
631
+ console.warn("Could not parse core doc", err);
632
+ }
633
+ }
634
+ async parseCustomDoc() {
635
+ try {
636
+ const content = await this.zip
637
+ .file("docProps/custom.xml")
638
+ ?.async("string");
639
+ if (!content) {
640
+ return;
641
+ }
642
+ this.customDoc = xmlDOM(content);
643
+ }
644
+ catch (err) {
645
+ console.warn("Could not parse custom doc", err);
646
+ }
647
+ }
648
+ async parseDocument() {
649
+ try {
650
+ const content = await this.zip
651
+ .file("word/document.xml")
652
+ ?.async("string");
653
+ if (!content) {
654
+ return;
655
+ }
656
+ this.document = xmlDOM(content);
657
+ }
658
+ catch (err) {
659
+ console.warn("Could not parse document", err);
660
+ }
661
+ }
662
+ }
663
+ //# sourceMappingURL=parse.js.map