office-viewer 0.1.0 → 0.1.3

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 (436) hide show
  1. package/README.md +7 -2
  2. package/esm/OpenXML.d.ts +19 -0
  3. package/esm/OpenXML.js +43 -2
  4. package/esm/Word.d.ts +132 -15
  5. package/esm/Word.js +233 -54
  6. package/esm/openxml/ContentType.js +20 -6
  7. package/esm/openxml/Settings.d.ts +10 -0
  8. package/esm/openxml/Settings.js +93 -0
  9. package/esm/openxml/Style.d.ts +1 -1
  10. package/esm/openxml/Style.js +12 -12
  11. package/esm/openxml/Theme.js +30 -6
  12. package/esm/openxml/Types.d.ts +179 -2472
  13. package/esm/openxml/drawing/Blip.d.ts +7 -0
  14. package/esm/openxml/{word/drawing → drawing}/Blip.js +2 -1
  15. package/{lib/openxml/word → esm/openxml}/drawing/BlipFill.d.ts +1 -1
  16. package/esm/openxml/{word/drawing → drawing}/BlipFill.js +1 -1
  17. package/esm/openxml/drawing/CustomGeom.d.ts +9 -0
  18. package/esm/openxml/drawing/CustomGeom.js +17 -0
  19. package/esm/openxml/drawing/Drawing.d.ts +35 -0
  20. package/esm/openxml/drawing/Drawing.js +169 -0
  21. package/esm/openxml/drawing/Geom.d.ts +11 -0
  22. package/esm/openxml/drawing/Geom.js +34 -0
  23. package/esm/openxml/drawing/Path.d.ts +37 -0
  24. package/esm/openxml/drawing/Pic.d.ts +16 -0
  25. package/esm/openxml/drawing/Pic.js +26 -0
  26. package/esm/openxml/drawing/Shape.d.ts +20 -0
  27. package/esm/openxml/drawing/ShapeProperties.d.ts +22 -0
  28. package/esm/openxml/drawing/ShapeProperties.js +119 -0
  29. package/{lib/openxml/word → esm/openxml}/drawing/Transform.d.ts +2 -1
  30. package/esm/openxml/{word/drawing → drawing}/Transform.js +7 -3
  31. package/esm/openxml/drawing/diagram/Diagram.d.ts +7 -0
  32. package/esm/openxml/drawing/diagram/Diagram.js +24 -0
  33. package/esm/openxml/drawing/diagram/Sp.d.ts +2 -0
  34. package/esm/openxml/drawing/diagram/SpTree.d.ts +5 -0
  35. package/esm/openxml/drawing/presetShape.d.ts +3 -0
  36. package/esm/openxml/drawing/presetShape.js +38785 -0
  37. package/esm/openxml/drawing/svg/arcToA.d.ts +13 -0
  38. package/esm/openxml/drawing/svg/arcToA.js +88 -0
  39. package/esm/openxml/drawing/svg/formulas.d.ts +29 -0
  40. package/esm/openxml/drawing/svg/formulas.js +103 -0
  41. package/esm/openxml/drawing/svg/generateDefines.d.ts +12 -0
  42. package/esm/openxml/drawing/svg/generateDefines.js +144 -0
  43. package/esm/openxml/drawing/svg/presetVal.d.ts +43 -0
  44. package/esm/openxml/drawing/svg/presetVal.js +53 -0
  45. package/esm/openxml/drawing/svg/shapeToSVG.d.ts +9 -0
  46. package/esm/openxml/drawing/svg/shapeToSVG.js +151 -0
  47. package/esm/openxml/math/OMath.d.ts +5 -0
  48. package/esm/openxml/math/OMath.js +12 -0
  49. package/esm/openxml/math/convertOOML.d.ts +4 -0
  50. package/esm/openxml/math/convertOOML.js +13 -0
  51. package/esm/openxml/math/xsl.d.ts +4 -0
  52. package/esm/openxml/math/xsl.js +8 -0
  53. package/esm/openxml/word/Body.js +11 -7
  54. package/esm/openxml/word/Break.js +1 -3
  55. package/esm/openxml/word/Font.d.ts +16 -0
  56. package/esm/openxml/word/Font.js +78 -0
  57. package/esm/openxml/word/FontTable.d.ts +9 -0
  58. package/esm/openxml/word/FontTable.js +34 -0
  59. package/esm/openxml/word/Header.d.ts +11 -0
  60. package/esm/openxml/word/Header.js +54 -0
  61. package/esm/openxml/word/Hyperlink.d.ts +1 -0
  62. package/esm/openxml/word/Hyperlink.js +7 -3
  63. package/esm/openxml/word/InlineText.js +1 -1
  64. package/esm/openxml/word/NoBreakHyphen.d.ts +2 -0
  65. package/esm/openxml/word/NoBreakHyphen.js +7 -0
  66. package/esm/openxml/word/Note.d.ts +12 -0
  67. package/esm/openxml/word/Note.js +48 -0
  68. package/esm/openxml/word/Paragraph.d.ts +2 -2
  69. package/esm/openxml/word/Paragraph.js +10 -9
  70. package/esm/openxml/word/Pict.d.ts +1 -2
  71. package/esm/openxml/word/Pict.js +5 -3
  72. package/esm/openxml/word/Ruby.js +1 -1
  73. package/esm/openxml/word/Run.d.ts +7 -3
  74. package/esm/openxml/word/Run.js +28 -4
  75. package/esm/openxml/word/Section.d.ts +18 -5
  76. package/esm/openxml/word/Section.js +46 -2
  77. package/esm/openxml/word/Separator.d.ts +5 -0
  78. package/esm/openxml/word/Separator.js +10 -0
  79. package/esm/openxml/word/SoftHyphen.d.ts +5 -0
  80. package/esm/openxml/word/SoftHyphen.js +10 -0
  81. package/esm/openxml/word/Table.d.ts +4 -9
  82. package/esm/openxml/word/Table.js +0 -235
  83. package/esm/openxml/word/WDocument.d.ts +1 -2
  84. package/esm/openxml/word/WDocument.js +53 -7
  85. package/esm/openxml/word/numbering/AbstractNum.js +4 -2
  86. package/esm/openxml/word/numbering/Lvl.js +10 -4
  87. package/esm/openxml/word/numbering/Num.js +12 -4
  88. package/esm/openxml/word/numbering/NumberProperties.js +2 -2
  89. package/esm/openxml/word/numbering/Numbering.js +1 -1
  90. package/esm/openxml/word/table/Tc.d.ts +1 -22
  91. package/esm/openxml/word/table/Tc.js +1 -221
  92. package/esm/openxml/word/table/Tr.d.ts +0 -5
  93. package/esm/openxml/word/table/Tr.js +0 -97
  94. package/esm/openxml/word/wps/WPG.d.ts +5 -0
  95. package/esm/openxml/word/wps/WPS.d.ts +18 -0
  96. package/esm/openxml/word/wps/WPS.js +147 -0
  97. package/esm/openxml/word/wps/WPSStyle.d.ts +10 -0
  98. package/esm/openxml/word/wps/WPSStyle.js +42 -0
  99. package/esm/package/PackageParser.d.ts +1 -1
  100. package/esm/package/XMLPackageParser.d.ts +3 -3
  101. package/esm/package/ZipPackageParser.d.ts +1 -1
  102. package/esm/package/ZipPackageParser.js +7 -8
  103. package/esm/parse/Footnotes.d.ts +3 -0
  104. package/esm/parse/Footnotes.js +25 -0
  105. package/esm/parse/colorNameMap.d.ts +6 -0
  106. package/esm/parse/colorNameMap.js +201 -0
  107. package/esm/parse/jcToTextAlign.js +1 -0
  108. package/esm/parse/mergeSdt.d.ts +4 -0
  109. package/esm/parse/mergeSdt.js +57 -0
  110. package/esm/parse/modifyColor.d.ts +1 -0
  111. package/esm/parse/modifyColor.js +106 -0
  112. package/esm/parse/parseBorder.js +2 -21
  113. package/esm/parse/parseCellMargin.d.ts +2 -0
  114. package/esm/parse/parseCellMargin.js +38 -0
  115. package/esm/parse/parseChildColor.d.ts +5 -0
  116. package/esm/parse/parseChildColor.js +66 -0
  117. package/esm/parse/parseColor.d.ts +4 -0
  118. package/esm/parse/parseColor.js +41 -46
  119. package/esm/parse/parseEndnotes.d.ts +3 -0
  120. package/esm/parse/parseEndnotes.js +25 -0
  121. package/esm/parse/parseFont.js +1 -1
  122. package/esm/parse/parseInsideBorders.d.ts +9 -0
  123. package/esm/parse/parseInsideBorders.js +24 -0
  124. package/esm/parse/parsePr.d.ts +3 -0
  125. package/esm/parse/parsePr.js +108 -11
  126. package/esm/parse/parseRelationship.js +1 -1
  127. package/esm/parse/parseSdt.d.ts +5 -0
  128. package/esm/parse/parseShape.d.ts +10 -0
  129. package/esm/parse/parseShape.js +239 -0
  130. package/esm/parse/parseSize.d.ts +2 -1
  131. package/esm/parse/parseSize.js +7 -1
  132. package/esm/parse/parseSpacing.js +1 -1
  133. package/esm/parse/parseTable.d.ts +3 -0
  134. package/esm/parse/parseTable.js +62 -0
  135. package/esm/parse/parseTablePr.d.ts +3 -0
  136. package/esm/parse/parseTablePr.js +185 -0
  137. package/esm/parse/parseTblWidth.d.ts +4 -0
  138. package/esm/parse/parseTblWidth.js +23 -0
  139. package/esm/parse/parseTc.d.ts +10 -0
  140. package/esm/parse/parseTc.js +64 -0
  141. package/esm/parse/parseTcPr.d.ts +5 -0
  142. package/esm/parse/parseTcPr.js +99 -0
  143. package/esm/parse/parseTextDirection.js +4 -6
  144. package/esm/parse/parseTr.d.ts +6 -0
  145. package/esm/parse/parseTr.js +49 -0
  146. package/esm/parse/parseTrPr.d.ts +3 -0
  147. package/esm/parse/parseTrPr.js +59 -0
  148. package/esm/render/fixAbsolutePosition.d.ts +8 -0
  149. package/esm/render/renderBody.d.ts +6 -2
  150. package/esm/render/renderBody.js +184 -30
  151. package/esm/render/renderBr.d.ts +2 -1
  152. package/esm/render/renderBr.js +4 -1
  153. package/esm/render/renderCustGeom.d.ts +4 -0
  154. package/esm/render/renderCustGeom.js +10 -0
  155. package/esm/render/renderDocument.d.ts +2 -2
  156. package/esm/render/renderDocument.js +2 -2
  157. package/esm/render/renderDrawing.d.ts +3 -2
  158. package/esm/render/renderDrawing.js +129 -24
  159. package/esm/render/renderFont.d.ts +5 -0
  160. package/esm/render/renderFont.js +39 -0
  161. package/esm/render/renderGeom.d.ts +4 -0
  162. package/esm/render/renderGeom.js +14 -0
  163. package/esm/render/renderHeader.d.ts +6 -0
  164. package/esm/render/renderHeader.js +40 -0
  165. package/esm/render/renderHyperLink.js +4 -1
  166. package/esm/render/renderInlineText.js +1 -1
  167. package/esm/render/renderInstrText.js +1 -1
  168. package/esm/render/renderMath.d.ts +3 -0
  169. package/esm/render/renderMath.js +7 -0
  170. package/esm/render/renderNoBreakHyphen.d.ts +1 -0
  171. package/esm/render/renderNoBreakHyphen.js +9 -0
  172. package/esm/render/renderNotes.d.ts +5 -0
  173. package/esm/render/renderNotes.js +77 -0
  174. package/esm/render/renderNumbering.js +8 -10
  175. package/esm/render/renderParagraph.d.ts +1 -1
  176. package/esm/render/renderParagraph.js +26 -29
  177. package/esm/render/renderPict.js +5 -10
  178. package/esm/render/renderRuby.js +1 -1
  179. package/esm/render/renderRun.d.ts +4 -2
  180. package/esm/render/renderRun.js +35 -10
  181. package/esm/render/renderSection.d.ts +3 -2
  182. package/esm/render/renderSection.js +79 -5
  183. package/esm/render/renderSeparator.d.ts +1 -0
  184. package/esm/render/renderSeparator.js +9 -0
  185. package/esm/render/renderSoftHyphen.d.ts +1 -0
  186. package/esm/render/renderSoftHyphen.js +9 -0
  187. package/esm/render/renderStyle.js +36 -35
  188. package/esm/render/renderTab.d.ts +1 -0
  189. package/esm/render/renderTab.js +4 -6
  190. package/esm/render/renderTable.js +23 -20
  191. package/esm/render/setElementStyle.js +7 -2
  192. package/esm/render/zindex.d.ts +1 -0
  193. package/esm/util/blob.js +1 -10
  194. package/esm/util/color.d.ts +48 -0
  195. package/esm/util/color.js +211 -0
  196. package/esm/util/createObject.d.ts +10 -0
  197. package/esm/util/createObject.js +48 -0
  198. package/esm/util/dom.d.ts +8 -4
  199. package/esm/util/dom.js +21 -4
  200. package/esm/util/mergeRun.js +1 -1
  201. package/esm/util/parseSides.d.ts +11 -0
  202. package/esm/util/print.d.ts +5 -0
  203. package/esm/util/print.js +54 -0
  204. package/esm/util/replaceVar.d.ts +10 -0
  205. package/esm/util/replaceVar.js +214 -0
  206. package/esm/util/xml.js +4 -1
  207. package/lib/OpenXML.d.ts +19 -0
  208. package/lib/OpenXML.js +44 -1
  209. package/lib/Word.d.ts +132 -15
  210. package/lib/Word.js +238 -59
  211. package/lib/openxml/ContentType.js +20 -6
  212. package/lib/openxml/Settings.d.ts +10 -0
  213. package/lib/openxml/Settings.js +97 -0
  214. package/lib/openxml/Style.d.ts +1 -1
  215. package/lib/openxml/Style.js +15 -15
  216. package/lib/openxml/Theme.js +31 -7
  217. package/lib/openxml/Types.d.ts +179 -2472
  218. package/lib/openxml/drawing/Blip.d.ts +7 -0
  219. package/lib/openxml/{word/drawing → drawing}/Blip.js +2 -1
  220. package/{esm/openxml/word → lib/openxml}/drawing/BlipFill.d.ts +1 -1
  221. package/lib/openxml/{word/drawing → drawing}/BlipFill.js +1 -1
  222. package/lib/openxml/drawing/CustomGeom.d.ts +9 -0
  223. package/lib/openxml/drawing/CustomGeom.js +21 -0
  224. package/lib/openxml/drawing/Drawing.d.ts +35 -0
  225. package/lib/openxml/drawing/Drawing.js +173 -0
  226. package/lib/openxml/drawing/Geom.d.ts +11 -0
  227. package/lib/openxml/drawing/Geom.js +38 -0
  228. package/lib/openxml/drawing/Path.d.ts +37 -0
  229. package/lib/openxml/drawing/Pic.d.ts +16 -0
  230. package/lib/openxml/drawing/Pic.js +30 -0
  231. package/lib/openxml/drawing/Shape.d.ts +20 -0
  232. package/lib/openxml/drawing/ShapeProperties.d.ts +22 -0
  233. package/lib/openxml/drawing/ShapeProperties.js +123 -0
  234. package/{esm/openxml/word → lib/openxml}/drawing/Transform.d.ts +2 -1
  235. package/lib/openxml/{word/drawing → drawing}/Transform.js +7 -3
  236. package/lib/openxml/drawing/diagram/Diagram.d.ts +7 -0
  237. package/lib/openxml/drawing/diagram/Diagram.js +28 -0
  238. package/lib/openxml/drawing/diagram/Sp.d.ts +2 -0
  239. package/lib/openxml/drawing/diagram/SpTree.d.ts +5 -0
  240. package/lib/openxml/drawing/presetShape.d.ts +3 -0
  241. package/lib/openxml/drawing/presetShape.js +38789 -0
  242. package/lib/openxml/drawing/svg/arcToA.d.ts +13 -0
  243. package/lib/openxml/drawing/svg/arcToA.js +92 -0
  244. package/lib/openxml/drawing/svg/formulas.d.ts +29 -0
  245. package/lib/openxml/drawing/svg/formulas.js +108 -0
  246. package/lib/openxml/drawing/svg/generateDefines.d.ts +12 -0
  247. package/lib/openxml/drawing/svg/generateDefines.js +148 -0
  248. package/lib/openxml/drawing/svg/presetVal.d.ts +43 -0
  249. package/lib/openxml/drawing/svg/presetVal.js +57 -0
  250. package/lib/openxml/drawing/svg/shapeToSVG.d.ts +9 -0
  251. package/lib/openxml/drawing/svg/shapeToSVG.js +155 -0
  252. package/lib/openxml/math/OMath.d.ts +5 -0
  253. package/lib/openxml/math/OMath.js +16 -0
  254. package/lib/openxml/math/convertOOML.d.ts +4 -0
  255. package/lib/openxml/math/convertOOML.js +17 -0
  256. package/lib/openxml/math/xsl.d.ts +4 -0
  257. package/lib/openxml/math/xsl.js +12 -0
  258. package/lib/openxml/word/Body.js +11 -7
  259. package/lib/openxml/word/Break.js +1 -3
  260. package/lib/openxml/word/Font.d.ts +16 -0
  261. package/lib/openxml/word/Font.js +83 -0
  262. package/lib/openxml/word/FontTable.d.ts +9 -0
  263. package/lib/openxml/word/FontTable.js +38 -0
  264. package/lib/openxml/word/Header.d.ts +11 -0
  265. package/lib/openxml/word/Header.js +58 -0
  266. package/lib/openxml/word/Hyperlink.d.ts +1 -0
  267. package/lib/openxml/word/Hyperlink.js +8 -4
  268. package/lib/openxml/word/InlineText.js +2 -2
  269. package/lib/openxml/word/NoBreakHyphen.d.ts +2 -0
  270. package/lib/openxml/word/NoBreakHyphen.js +11 -0
  271. package/lib/openxml/word/Note.d.ts +12 -0
  272. package/lib/openxml/word/Note.js +52 -0
  273. package/lib/openxml/word/Paragraph.d.ts +2 -2
  274. package/lib/openxml/word/Paragraph.js +11 -10
  275. package/lib/openxml/word/Pict.d.ts +1 -2
  276. package/lib/openxml/word/Pict.js +5 -3
  277. package/lib/openxml/word/Ruby.js +4 -4
  278. package/lib/openxml/word/Run.d.ts +7 -3
  279. package/lib/openxml/word/Run.js +29 -5
  280. package/lib/openxml/word/Section.d.ts +18 -5
  281. package/lib/openxml/word/Section.js +47 -3
  282. package/lib/openxml/word/Separator.d.ts +5 -0
  283. package/lib/openxml/word/Separator.js +14 -0
  284. package/lib/openxml/word/SoftHyphen.d.ts +5 -0
  285. package/lib/openxml/word/SoftHyphen.js +14 -0
  286. package/lib/openxml/word/Table.d.ts +4 -9
  287. package/lib/openxml/word/Table.js +0 -235
  288. package/lib/openxml/word/WDocument.d.ts +1 -2
  289. package/lib/openxml/word/WDocument.js +53 -7
  290. package/lib/openxml/word/numbering/AbstractNum.js +5 -3
  291. package/lib/openxml/word/numbering/Lvl.js +11 -5
  292. package/lib/openxml/word/numbering/Num.js +12 -4
  293. package/lib/openxml/word/numbering/NumberProperties.js +2 -2
  294. package/lib/openxml/word/numbering/Numbering.js +3 -3
  295. package/lib/openxml/word/table/Tc.d.ts +1 -22
  296. package/lib/openxml/word/table/Tc.js +0 -224
  297. package/lib/openxml/word/table/Tr.d.ts +0 -5
  298. package/lib/openxml/word/table/Tr.js +0 -97
  299. package/lib/openxml/word/wps/WPG.d.ts +5 -0
  300. package/lib/openxml/word/wps/WPS.d.ts +18 -0
  301. package/lib/openxml/word/wps/WPS.js +151 -0
  302. package/lib/openxml/word/wps/WPSStyle.d.ts +10 -0
  303. package/lib/openxml/word/wps/WPSStyle.js +46 -0
  304. package/lib/package/PackageParser.d.ts +1 -1
  305. package/lib/package/XMLPackageParser.d.ts +3 -3
  306. package/lib/package/ZipPackageParser.d.ts +1 -1
  307. package/lib/package/ZipPackageParser.js +7 -8
  308. package/lib/parse/Footnotes.d.ts +3 -0
  309. package/lib/parse/Footnotes.js +29 -0
  310. package/lib/parse/colorNameMap.d.ts +6 -0
  311. package/lib/parse/colorNameMap.js +205 -0
  312. package/lib/parse/jcToTextAlign.js +1 -0
  313. package/lib/parse/mergeSdt.d.ts +4 -0
  314. package/lib/parse/mergeSdt.js +61 -0
  315. package/lib/parse/modifyColor.d.ts +1 -0
  316. package/lib/parse/modifyColor.js +110 -0
  317. package/lib/parse/parseBorder.js +3 -22
  318. package/lib/parse/parseCellMargin.d.ts +2 -0
  319. package/lib/parse/parseCellMargin.js +42 -0
  320. package/lib/parse/parseChildColor.d.ts +5 -0
  321. package/lib/parse/parseChildColor.js +70 -0
  322. package/lib/parse/parseColor.d.ts +4 -0
  323. package/lib/parse/parseColor.js +41 -45
  324. package/lib/parse/parseEndnotes.d.ts +3 -0
  325. package/lib/parse/parseEndnotes.js +29 -0
  326. package/lib/parse/parseFont.js +2 -2
  327. package/lib/parse/parseInsideBorders.d.ts +9 -0
  328. package/lib/parse/parseInsideBorders.js +28 -0
  329. package/lib/parse/parsePr.d.ts +3 -0
  330. package/lib/parse/parsePr.js +109 -12
  331. package/lib/parse/parseRelationship.js +2 -2
  332. package/lib/parse/parseSdt.d.ts +5 -0
  333. package/lib/parse/parseShape.d.ts +10 -0
  334. package/lib/parse/parseShape.js +247 -0
  335. package/lib/parse/parseSize.d.ts +2 -1
  336. package/lib/parse/parseSize.js +7 -0
  337. package/lib/parse/parseSpacing.js +1 -1
  338. package/lib/parse/parseTable.d.ts +3 -0
  339. package/lib/parse/parseTable.js +66 -0
  340. package/lib/parse/parseTablePr.d.ts +3 -0
  341. package/lib/parse/parseTablePr.js +189 -0
  342. package/lib/parse/parseTblWidth.d.ts +4 -0
  343. package/lib/parse/parseTblWidth.js +27 -0
  344. package/lib/parse/parseTc.d.ts +10 -0
  345. package/lib/parse/parseTc.js +68 -0
  346. package/lib/parse/parseTcPr.d.ts +5 -0
  347. package/lib/parse/parseTcPr.js +104 -0
  348. package/lib/parse/parseTextDirection.js +4 -6
  349. package/lib/parse/parseTr.d.ts +6 -0
  350. package/lib/parse/parseTr.js +53 -0
  351. package/lib/parse/parseTrPr.d.ts +3 -0
  352. package/lib/parse/parseTrPr.js +63 -0
  353. package/lib/render/fixAbsolutePosition.d.ts +8 -0
  354. package/lib/render/renderBody.d.ts +6 -2
  355. package/lib/render/renderBody.js +183 -29
  356. package/lib/render/renderBr.d.ts +2 -1
  357. package/lib/render/renderBr.js +4 -1
  358. package/lib/render/renderCustGeom.d.ts +4 -0
  359. package/lib/render/renderCustGeom.js +14 -0
  360. package/lib/render/renderDocument.d.ts +2 -2
  361. package/lib/render/renderDocument.js +2 -2
  362. package/lib/render/renderDrawing.d.ts +3 -2
  363. package/lib/render/renderDrawing.js +129 -24
  364. package/lib/render/renderFont.d.ts +5 -0
  365. package/lib/render/renderFont.js +43 -0
  366. package/lib/render/renderGeom.d.ts +4 -0
  367. package/lib/render/renderGeom.js +18 -0
  368. package/lib/render/renderHeader.d.ts +6 -0
  369. package/lib/render/renderHeader.js +44 -0
  370. package/lib/render/renderHyperLink.js +5 -2
  371. package/lib/render/renderInlineText.js +2 -2
  372. package/lib/render/renderInstrText.js +2 -2
  373. package/lib/render/renderMath.d.ts +3 -0
  374. package/lib/render/renderMath.js +11 -0
  375. package/lib/render/renderNoBreakHyphen.d.ts +1 -0
  376. package/lib/render/renderNoBreakHyphen.js +13 -0
  377. package/lib/render/renderNotes.d.ts +5 -0
  378. package/lib/render/renderNotes.js +81 -0
  379. package/lib/render/renderNumbering.js +9 -11
  380. package/lib/render/renderParagraph.d.ts +1 -1
  381. package/lib/render/renderParagraph.js +26 -29
  382. package/lib/render/renderPict.js +5 -10
  383. package/lib/render/renderRuby.js +3 -3
  384. package/lib/render/renderRun.d.ts +4 -2
  385. package/lib/render/renderRun.js +34 -9
  386. package/lib/render/renderSection.d.ts +3 -2
  387. package/lib/render/renderSection.js +79 -5
  388. package/lib/render/renderSeparator.d.ts +1 -0
  389. package/lib/render/renderSeparator.js +13 -0
  390. package/lib/render/renderSoftHyphen.d.ts +1 -0
  391. package/lib/render/renderSoftHyphen.js +13 -0
  392. package/lib/render/renderStyle.js +37 -36
  393. package/lib/render/renderTab.d.ts +1 -0
  394. package/lib/render/renderTab.js +4 -6
  395. package/lib/render/renderTable.js +25 -22
  396. package/lib/render/setElementStyle.js +6 -1
  397. package/lib/render/zindex.d.ts +1 -0
  398. package/lib/util/blob.js +0 -10
  399. package/lib/util/color.d.ts +48 -0
  400. package/lib/util/color.js +215 -0
  401. package/lib/util/createObject.d.ts +10 -0
  402. package/lib/util/createObject.js +54 -0
  403. package/lib/util/dom.d.ts +8 -4
  404. package/lib/util/dom.js +24 -5
  405. package/lib/util/mergeRun.js +5 -5
  406. package/lib/util/parseSides.d.ts +11 -0
  407. package/lib/util/print.d.ts +5 -0
  408. package/lib/util/print.js +58 -0
  409. package/lib/util/replaceVar.d.ts +10 -0
  410. package/lib/util/replaceVar.js +219 -0
  411. package/lib/util/xml.js +4 -0
  412. package/package.json +17 -6
  413. package/esm/node_modules/tslib/tslib.es6.js +0 -120
  414. package/esm/openxml/Types.js +0 -1003
  415. package/esm/openxml/word/CustomXml.d.ts +0 -8
  416. package/esm/openxml/word/SmartTag.d.ts +0 -8
  417. package/esm/openxml/word/SmartTag.js +0 -18
  418. package/esm/openxml/word/drawing/Blip.d.ts +0 -6
  419. package/esm/openxml/word/drawing/Drawing.d.ts +0 -6
  420. package/esm/openxml/word/drawing/Drawing.js +0 -15
  421. package/esm/openxml/word/drawing/Pic.d.ts +0 -8
  422. package/esm/openxml/word/drawing/Pic.js +0 -16
  423. package/esm/openxml/word/drawing/ShapeProperties.d.ts +0 -9
  424. package/esm/openxml/word/drawing/ShapeProperties.js +0 -20
  425. package/lib/node_modules/tslib/tslib.es6.js +0 -129
  426. package/lib/openxml/Types.js +0 -1005
  427. package/lib/openxml/word/CustomXml.d.ts +0 -8
  428. package/lib/openxml/word/SmartTag.d.ts +0 -8
  429. package/lib/openxml/word/SmartTag.js +0 -22
  430. package/lib/openxml/word/drawing/Blip.d.ts +0 -6
  431. package/lib/openxml/word/drawing/Drawing.d.ts +0 -6
  432. package/lib/openxml/word/drawing/Drawing.js +0 -19
  433. package/lib/openxml/word/drawing/Pic.d.ts +0 -8
  434. package/lib/openxml/word/drawing/Pic.js +0 -20
  435. package/lib/openxml/word/drawing/ShapeProperties.d.ts +0 -9
  436. package/lib/openxml/word/drawing/ShapeProperties.js +0 -24
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib = require('tslib');
6
+
7
+ function loadIframeImages(images) {
8
+ var _this = this;
9
+ var promises = images.map(function (image) { return tslib.__awaiter(_this, void 0, void 0, function () {
10
+ return tslib.__generator(this, function (_a) {
11
+ switch (_a.label) {
12
+ case 0:
13
+ if (!(image.src && image.src !== window.location.href)) return [3 /*break*/, 2];
14
+ return [4 /*yield*/, loadIframeImage(image)];
15
+ case 1:
16
+ _a.sent();
17
+ _a.label = 2;
18
+ case 2: return [2 /*return*/];
19
+ }
20
+ });
21
+ }); });
22
+ return Promise.all(promises);
23
+ }
24
+ function loadIframeImage(image) {
25
+ return new Promise(function (resolve) {
26
+ var pollImage = function () {
27
+ !image ||
28
+ typeof image.naturalWidth === 'undefined' ||
29
+ image.naturalWidth === 0 ||
30
+ !image.complete
31
+ ? setTimeout(pollImage, 500)
32
+ : resolve();
33
+ };
34
+ pollImage();
35
+ });
36
+ }
37
+ function performPrint(iframe) {
38
+ var _a, _b;
39
+ (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.print();
40
+ (_b = iframe.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(iframe);
41
+ }
42
+ /**
43
+ * 打印 iframe,参考了 print.js 里的部分实现
44
+ * @param iframe
45
+ */
46
+ function printIframe(iframe) {
47
+ var printDocument = iframe.contentDocument;
48
+ // If printing images, wait for them to load inside the iframe
49
+ var images = printDocument.getElementsByTagName('img');
50
+ if (images.length > 0) {
51
+ loadIframeImages(Array.from(images)).then(function () { return performPrint(iframe); });
52
+ }
53
+ else {
54
+ performPrint(iframe);
55
+ }
56
+ }
57
+
58
+ exports.printIframe = printIframe;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 执行变量替换,和普通变量不同,这个支持数组,但因为是提前执行好的,没法再动态生效了
3
+ * 为了避免 word 里不必要的标签要先执行 mergeRun
4
+ */
5
+ import Word from '../Word';
6
+ /**
7
+ * 替换单个文本变量
8
+ */
9
+ export declare function replaceT(word: Word, t: Element, data: any): void;
10
+ export declare function replaceVar(word: Word, documentData: Document): void;
@@ -0,0 +1,219 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib = require('tslib');
6
+ var createObject = require('./createObject.js');
7
+
8
+ /**
9
+ * 执行变量替换,和普通变量不同,这个支持数组,但因为是提前执行好的,没法再动态生效了
10
+ * 为了避免 word 里不必要的标签要先执行 mergeRun
11
+ */
12
+ /**
13
+ * 替换单个文本变量
14
+ */
15
+ function replaceT(word, t, data) {
16
+ var text = t.textContent || '';
17
+ t.textContent = replaceText(word, text, data);
18
+ }
19
+ /**
20
+ * 替换变量文本
21
+ */
22
+ function replaceText(word, text, data) {
23
+ var evalVar = word.renderOptions.evalVar;
24
+ if (text.startsWith('{{')) {
25
+ text = text.replace(/^{{/g, '').replace(/}}$/g, '');
26
+ var result = evalVar(text, data);
27
+ if (result !== undefined && result !== null) {
28
+ return String(result);
29
+ }
30
+ else {
31
+ return '';
32
+ }
33
+ }
34
+ return text;
35
+ }
36
+ function replaceAlt(word, cNvPr, data) {
37
+ var alt = cNvPr.getAttribute('descr') || '';
38
+ cNvPr.setAttribute('descrVar', replaceText(word, alt, data));
39
+ }
40
+ /**
41
+ * 替换表格行
42
+ */
43
+ function replaceTableRow(word, tr) {
44
+ var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e;
45
+ var evalVar = word.renderOptions.evalVar;
46
+ var data = word.renderOptions.data;
47
+ var table = tr.parentNode;
48
+ var tcs = tr.getElementsByTagName('w:tc');
49
+ var hasLoop = false;
50
+ var loopArray = [];
51
+ try {
52
+ // 查找对应的循环
53
+ for (var tcs_1 = tslib.__values(tcs), tcs_1_1 = tcs_1.next(); !tcs_1_1.done; tcs_1_1 = tcs_1.next()) {
54
+ var tc = tcs_1_1.value;
55
+ var ts = tc.getElementsByTagName('w:t');
56
+ try {
57
+ for (var ts_1 = (e_2 = void 0, tslib.__values(ts)), ts_1_1 = ts_1.next(); !ts_1_1.done; ts_1_1 = ts_1.next()) {
58
+ var t = ts_1_1.value;
59
+ var text = t.textContent || '';
60
+ if (text.startsWith('{{#')) {
61
+ var arrayNameMatch = /{{#([^\}]+)}}/;
62
+ var arrayMatchResult = arrayNameMatch.exec(text);
63
+ if (arrayMatchResult && arrayMatchResult.length > 0) {
64
+ hasLoop = true;
65
+ var arrayName = arrayMatchResult[1];
66
+ var array = evalVar(arrayName, data);
67
+ if (Array.isArray(array)) {
68
+ loopArray = array;
69
+ }
70
+ // 去掉这个循环变量
71
+ t.textContent = t.textContent.replace("{{#".concat(arrayName, "}}"), '');
72
+ }
73
+ }
74
+ if (text.indexOf('{{/}}')) {
75
+ // 去掉结束变量
76
+ t.textContent = t.textContent.replace('{{/}}', '');
77
+ }
78
+ }
79
+ }
80
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
81
+ finally {
82
+ try {
83
+ if (ts_1_1 && !ts_1_1.done && (_b = ts_1.return)) _b.call(ts_1);
84
+ }
85
+ finally { if (e_2) throw e_2.error; }
86
+ }
87
+ }
88
+ }
89
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
90
+ finally {
91
+ try {
92
+ if (tcs_1_1 && !tcs_1_1.done && (_a = tcs_1.return)) _a.call(tcs_1);
93
+ }
94
+ finally { if (e_1) throw e_1.error; }
95
+ }
96
+ if (hasLoop) {
97
+ try {
98
+ // 有循环,复制多行
99
+ for (var loopArray_1 = tslib.__values(loopArray), loopArray_1_1 = loopArray_1.next(); !loopArray_1_1.done; loopArray_1_1 = loopArray_1.next()) {
100
+ var item = loopArray_1_1.value;
101
+ var newTr = cloneTr(tr);
102
+ var ts = newTr.getElementsByTagName('w:t');
103
+ // 将 item 加入上下文
104
+ var rowData = createObject.createObject(data, item);
105
+ try {
106
+ for (var ts_2 = (e_4 = void 0, tslib.__values(ts)), ts_2_1 = ts_2.next(); !ts_2_1.done; ts_2_1 = ts_2.next()) {
107
+ var t = ts_2_1.value;
108
+ replaceT(word, t, rowData);
109
+ }
110
+ }
111
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
112
+ finally {
113
+ try {
114
+ if (ts_2_1 && !ts_2_1.done && (_d = ts_2.return)) _d.call(ts_2);
115
+ }
116
+ finally { if (e_4) throw e_4.error; }
117
+ }
118
+ try {
119
+ // 替换图片里的变量
120
+ for (var _f = (e_5 = void 0, tslib.__values(newTr.getElementsByTagName('pic:cNvPr'))), _g = _f.next(); !_g.done; _g = _f.next()) {
121
+ var cNvPr = _g.value;
122
+ replaceAlt(word, cNvPr, rowData);
123
+ }
124
+ }
125
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
126
+ finally {
127
+ try {
128
+ if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
129
+ }
130
+ finally { if (e_5) throw e_5.error; }
131
+ }
132
+ table.appendChild(newTr);
133
+ }
134
+ }
135
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
136
+ finally {
137
+ try {
138
+ if (loopArray_1_1 && !loopArray_1_1.done && (_c = loopArray_1.return)) _c.call(loopArray_1);
139
+ }
140
+ finally { if (e_3) throw e_3.error; }
141
+ }
142
+ // 删除原来的行
143
+ table.removeChild(tr);
144
+ }
145
+ }
146
+ /**
147
+ * 克隆行,并进行一些清理
148
+ */
149
+ function cloneTr(tr) {
150
+ var e_6, _a, e_7, _b;
151
+ var _c;
152
+ var newTr = tr.cloneNode(true);
153
+ // 去掉 tr 里的属性,感觉可能会有问题
154
+ removeAllAttr(newTr);
155
+ var ps = [].slice.call(newTr.getElementsByTagName('w:p'));
156
+ try {
157
+ for (var ps_1 = tslib.__values(ps), ps_1_1 = ps_1.next(); !ps_1_1.done; ps_1_1 = ps_1.next()) {
158
+ var p = ps_1_1.value;
159
+ removeAllAttr(p);
160
+ }
161
+ }
162
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
163
+ finally {
164
+ try {
165
+ if (ps_1_1 && !ps_1_1.done && (_a = ps_1.return)) _a.call(ps_1);
166
+ }
167
+ finally { if (e_6) throw e_6.error; }
168
+ }
169
+ // cnfStyles 基本上都是错的所以删了
170
+ var cnfStyles = [].slice.call(newTr.getElementsByTagName('w:cnfStyle'));
171
+ try {
172
+ for (var cnfStyles_1 = tslib.__values(cnfStyles), cnfStyles_1_1 = cnfStyles_1.next(); !cnfStyles_1_1.done; cnfStyles_1_1 = cnfStyles_1.next()) {
173
+ var cnfStyle = cnfStyles_1_1.value;
174
+ (_c = cnfStyle.parentElement) === null || _c === void 0 ? void 0 : _c.removeChild(cnfStyle);
175
+ }
176
+ }
177
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
178
+ finally {
179
+ try {
180
+ if (cnfStyles_1_1 && !cnfStyles_1_1.done && (_b = cnfStyles_1.return)) _b.call(cnfStyles_1);
181
+ }
182
+ finally { if (e_7) throw e_7.error; }
183
+ }
184
+ return newTr;
185
+ }
186
+ /**
187
+ * 删掉所有属性,虽然不知道为啥有些不生效
188
+ */
189
+ function removeAllAttr(node) {
190
+ while (node.attributes.length > 0) {
191
+ node.removeAttributeNode(node.attributes[0]);
192
+ }
193
+ }
194
+ /**
195
+ * 替换表格,目前只支持行
196
+ */
197
+ function replaceTable(word, documentData) {
198
+ var e_8, _a;
199
+ var trs = [].slice.call(documentData.getElementsByTagName('w:tr'));
200
+ try {
201
+ for (var trs_1 = tslib.__values(trs), trs_1_1 = trs_1.next(); !trs_1_1.done; trs_1_1 = trs_1.next()) {
202
+ var tr = trs_1_1.value;
203
+ replaceTableRow(word, tr);
204
+ }
205
+ }
206
+ catch (e_8_1) { e_8 = { error: e_8_1 }; }
207
+ finally {
208
+ try {
209
+ if (trs_1_1 && !trs_1_1.done && (_a = trs_1.return)) _a.call(trs_1);
210
+ }
211
+ finally { if (e_8) throw e_8.error; }
212
+ }
213
+ }
214
+ function replaceVar(word, documentData) {
215
+ replaceTable(word, documentData);
216
+ }
217
+
218
+ exports.replaceT = replaceT;
219
+ exports.replaceVar = replaceVar;
package/lib/util/xml.js CHANGED
@@ -5,6 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  /**
6
6
  * 解析 xml
7
7
  */
8
+ function parseXML(content) {
9
+ return new DOMParser().parseFromString(content, 'application/xml');
10
+ }
8
11
  /**
9
12
  * 构建 xml 文本
10
13
  */
@@ -14,3 +17,4 @@ function buildXML(doc) {
14
17
  }
15
18
 
16
19
  exports.buildXML = buildXML;
20
+ exports.parseXML = parseXML;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "office-viewer",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "office 文档在线预览",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",
@@ -10,10 +10,12 @@
10
10
  "build": "npm run clean-dist && cross-env NODE_ENV=production rollup -c ",
11
11
  "test": "jest",
12
12
  "lib": "npm run clean-dist && cross-env NODE_ENV=production IS_LIB=1 rollup -c",
13
+ "update-snapshot": "jest --updateSnapshot",
13
14
  "coverage": "jest --coverage",
14
15
  "declaration": "tsc --project tsconfig-for-declaration.json --allowJs --declaration --emitDeclarationOnly --declarationDir ./lib --rootDir ./src",
15
16
  "clean-dist": "rimraf lib/** esm/**",
16
- "xsd2ts": "cd tools && ts-node --transpileOnly xsd2ts.ts"
17
+ "xsd2ts": "cd tools && ts-node --transpileOnly xsd2ts.ts",
18
+ "conver-preset": "cd tools && ts-node --transpileOnly converDrawingML.ts"
17
19
  },
18
20
  "exports": {
19
21
  ".": {
@@ -39,7 +41,8 @@
39
41
  },
40
42
  "homepage": "https://github.com/baidu/amis#readme",
41
43
  "dependencies": {
42
- "fflate": "^0.7.4"
44
+ "fflate": "^0.7.4",
45
+ "tslib": "^2.3.1"
43
46
  },
44
47
  "devDependencies": {
45
48
  "@rollup/plugin-commonjs": "^22.0.2",
@@ -47,18 +50,26 @@
47
50
  "@rollup/plugin-node-resolve": "^14.1.0",
48
51
  "@rollup/plugin-typescript": "^8.3.4",
49
52
  "@types/jest": "^28.1.0",
53
+ "@testing-library/jest-dom": "^5.16.4",
50
54
  "amis-formula": "^2.7.2",
55
+ "fast-xml-parser": "4.1.3",
51
56
  "jest": "^29.0.3",
57
+ "jest-environment-jsdom": "^29.0.3",
58
+ "rollup": "^2.60.2",
59
+ "rollup-plugin-terser": "^7.0.2",
52
60
  "ts-jest": "^29.0.2",
53
61
  "ts-loader": "^9.2.3",
54
62
  "ts-node": "^10.4.0",
55
63
  "typescript": "^4.3.5",
56
- "rollup": "^2.60.2",
57
- "rollup-plugin-terser": "^7.0.2",
58
- "vite": "^3.2.2"
64
+ "xml-formatter": "^3.3.2"
59
65
  },
60
66
  "jest": {
61
67
  "testEnvironment": "jsdom",
68
+ "collectCoverage": true,
69
+ "coverageReporters": [
70
+ "text",
71
+ "cobertura"
72
+ ],
62
73
  "collectCoverageFrom": [
63
74
  "src/**/*"
64
75
  ],
@@ -1,120 +0,0 @@
1
- /******************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
- /* global Reflect, Promise */
16
-
17
- var extendStatics = function(d, b) {
18
- extendStatics = Object.setPrototypeOf ||
19
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
20
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
21
- return extendStatics(d, b);
22
- };
23
-
24
- function __extends(d, b) {
25
- if (typeof b !== "function" && b !== null)
26
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
27
- extendStatics(d, b);
28
- function __() { this.constructor = d; }
29
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
30
- }
31
-
32
- var __assign = function() {
33
- __assign = Object.assign || function __assign(t) {
34
- for (var s, i = 1, n = arguments.length; i < n; i++) {
35
- s = arguments[i];
36
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
37
- }
38
- return t;
39
- };
40
- return __assign.apply(this, arguments);
41
- };
42
-
43
- function __awaiter(thisArg, _arguments, P, generator) {
44
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
45
- return new (P || (P = Promise))(function (resolve, reject) {
46
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
47
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
49
- step((generator = generator.apply(thisArg, _arguments || [])).next());
50
- });
51
- }
52
-
53
- function __generator(thisArg, body) {
54
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
55
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
56
- function verb(n) { return function (v) { return step([n, v]); }; }
57
- function step(op) {
58
- if (f) throw new TypeError("Generator is already executing.");
59
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
60
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
61
- if (y = 0, t) op = [op[0] & 2, t.value];
62
- switch (op[0]) {
63
- case 0: case 1: t = op; break;
64
- case 4: _.label++; return { value: op[1], done: false };
65
- case 5: _.label++; y = op[1]; op = [0]; continue;
66
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
67
- default:
68
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
69
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
70
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
71
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
72
- if (t[2]) _.ops.pop();
73
- _.trys.pop(); continue;
74
- }
75
- op = body.call(thisArg, _);
76
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
77
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
78
- }
79
- }
80
-
81
- function __values(o) {
82
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
83
- if (m) return m.call(o);
84
- if (o && typeof o.length === "number") return {
85
- next: function () {
86
- if (o && i >= o.length) o = void 0;
87
- return { value: o && o[i++], done: !o };
88
- }
89
- };
90
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
91
- }
92
-
93
- function __read(o, n) {
94
- var m = typeof Symbol === "function" && o[Symbol.iterator];
95
- if (!m) return o;
96
- var i = m.call(o), r, ar = [], e;
97
- try {
98
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
99
- }
100
- catch (error) { e = { error: error }; }
101
- finally {
102
- try {
103
- if (r && !r.done && (m = i["return"])) m.call(i);
104
- }
105
- finally { if (e) throw e.error; }
106
- }
107
- return ar;
108
- }
109
-
110
- function __spreadArray(to, from, pack) {
111
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
112
- if (ar || !(i in from)) {
113
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
114
- ar[i] = from[i];
115
- }
116
- }
117
- return to.concat(ar || Array.prototype.slice.call(from));
118
- }
119
-
120
- export { __assign, __awaiter, __extends, __generator, __read, __spreadArray, __values };