@cj-tech-master/excelts 9.4.2 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (618) hide show
  1. package/dist/browser/index.browser.d.ts +8 -5
  2. package/dist/browser/index.browser.js +19 -1
  3. package/dist/browser/index.d.ts +4 -2
  4. package/dist/browser/index.js +9 -1
  5. package/dist/browser/modules/excel/chart/cache-populator.d.ts +49 -0
  6. package/dist/browser/modules/excel/chart/cache-populator.js +1171 -0
  7. package/dist/browser/modules/excel/chart/chart-api.d.ts +92 -0
  8. package/dist/browser/modules/excel/chart/chart-api.js +364 -0
  9. package/dist/browser/modules/excel/chart/chart-builder.d.ts +48 -0
  10. package/dist/browser/modules/excel/chart/chart-builder.js +2432 -0
  11. package/dist/browser/modules/excel/chart/chart-ex-builder.d.ts +36 -0
  12. package/dist/browser/modules/excel/chart/chart-ex-builder.js +903 -0
  13. package/dist/browser/modules/excel/chart/chart-ex-parser.d.ts +8 -0
  14. package/dist/browser/modules/excel/chart/chart-ex-parser.js +1205 -0
  15. package/dist/browser/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
  16. package/dist/browser/modules/excel/chart/chart-ex-renderer.js +5352 -0
  17. package/dist/browser/modules/excel/chart/chart-ex-types.d.ts +531 -0
  18. package/dist/browser/modules/excel/chart/chart-ex-types.js +11 -0
  19. package/dist/browser/modules/excel/chart/chart-images.d.ts +78 -0
  20. package/dist/browser/modules/excel/chart/chart-images.js +363 -0
  21. package/dist/browser/modules/excel/chart/chart-presets.d.ts +392 -0
  22. package/dist/browser/modules/excel/chart/chart-presets.js +179 -0
  23. package/dist/browser/modules/excel/chart/chart-renderer.d.ts +550 -0
  24. package/dist/browser/modules/excel/chart/chart-renderer.js +6440 -0
  25. package/dist/browser/modules/excel/chart/chart-sidecar.d.ts +21 -0
  26. package/dist/browser/modules/excel/chart/chart-sidecar.js +427 -0
  27. package/dist/browser/modules/excel/chart/chart-utils.d.ts +306 -0
  28. package/dist/browser/modules/excel/chart/chart-utils.js +821 -0
  29. package/dist/browser/modules/excel/chart/chart.d.ts +504 -0
  30. package/dist/browser/modules/excel/chart/chart.js +1320 -0
  31. package/dist/browser/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
  32. package/dist/browser/modules/excel/chart/glyph-rasterizer.js +658 -0
  33. package/dist/browser/modules/excel/chart/index.d.ts +54 -0
  34. package/dist/browser/modules/excel/chart/index.js +46 -0
  35. package/dist/browser/modules/excel/chart/install.d.ts +44 -0
  36. package/dist/browser/modules/excel/chart/install.js +91 -0
  37. package/dist/browser/modules/excel/chart/shape-properties.d.ts +156 -0
  38. package/dist/browser/modules/excel/chart/shape-properties.js +1557 -0
  39. package/dist/browser/modules/excel/chart/stroke-font.d.ts +36 -0
  40. package/dist/browser/modules/excel/chart/stroke-font.js +1556 -0
  41. package/dist/browser/modules/excel/chart/topojson.d.ts +98 -0
  42. package/dist/browser/modules/excel/chart/topojson.js +236 -0
  43. package/dist/browser/modules/excel/chart/types.d.ts +2559 -0
  44. package/dist/browser/modules/excel/chart/types.js +8 -0
  45. package/dist/browser/modules/excel/chart-host-registry.d.ts +157 -0
  46. package/dist/browser/modules/excel/chart-host-registry.js +90 -0
  47. package/dist/browser/modules/excel/chartsheet.d.ts +102 -0
  48. package/dist/browser/modules/excel/chartsheet.js +196 -0
  49. package/dist/browser/modules/excel/defined-names.d.ts +35 -0
  50. package/dist/browser/modules/excel/defined-names.js +44 -4
  51. package/dist/browser/modules/excel/errors.d.ts +6 -0
  52. package/dist/browser/modules/excel/errors.js +9 -0
  53. package/dist/browser/modules/excel/form-control.d.ts +6 -0
  54. package/dist/browser/modules/excel/form-control.js +17 -0
  55. package/dist/browser/modules/excel/image.js +12 -2
  56. package/dist/browser/modules/excel/pivot-chart.d.ts +7 -0
  57. package/dist/browser/modules/excel/pivot-chart.js +53 -0
  58. package/dist/browser/modules/excel/pivot-table.d.ts +55 -0
  59. package/dist/browser/modules/excel/pivot-table.js +35 -0
  60. package/dist/browser/modules/excel/range.js +5 -1
  61. package/dist/browser/modules/excel/sparkline/index.d.ts +7 -0
  62. package/dist/browser/modules/excel/sparkline/index.js +7 -0
  63. package/dist/browser/modules/excel/sparkline/sparkline.d.ts +206 -0
  64. package/dist/browser/modules/excel/sparkline/sparkline.js +750 -0
  65. package/dist/browser/modules/excel/stream/worksheet-writer.js +3 -2
  66. package/dist/browser/modules/excel/table.js +42 -6
  67. package/dist/browser/modules/excel/types.d.ts +72 -0
  68. package/dist/browser/modules/excel/utils/address.d.ts +18 -0
  69. package/dist/browser/modules/excel/utils/address.js +28 -0
  70. package/dist/browser/modules/excel/utils/drawing-utils.js +11 -6
  71. package/dist/browser/modules/excel/utils/guid.d.ts +15 -0
  72. package/dist/browser/modules/excel/utils/guid.js +35 -0
  73. package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +74 -0
  74. package/dist/browser/modules/excel/utils/ooxml-paths.js +206 -9
  75. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
  76. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
  77. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
  78. package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
  79. package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
  80. package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
  81. package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
  82. package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
  83. package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
  84. package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
  85. package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
  86. package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
  87. package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
  88. package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
  89. package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
  90. package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
  91. package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
  92. package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
  93. package/dist/browser/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
  94. package/dist/browser/modules/excel/utils/ooxml-validator/check-table.js +177 -0
  95. package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
  96. package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
  97. package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
  98. package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
  99. package/dist/browser/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
  100. package/dist/browser/modules/excel/utils/ooxml-validator/context.js +191 -0
  101. package/dist/browser/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
  102. package/dist/browser/modules/excel/utils/ooxml-validator/index.js +102 -0
  103. package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
  104. package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
  105. package/dist/browser/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
  106. package/dist/browser/modules/excel/utils/ooxml-validator/reporter.js +61 -0
  107. package/dist/browser/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
  108. package/dist/browser/modules/excel/utils/ooxml-validator/types.js +12 -0
  109. package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
  110. package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
  111. package/dist/browser/modules/excel/workbook.browser.d.ts +248 -30
  112. package/dist/browser/modules/excel/workbook.browser.js +966 -31
  113. package/dist/browser/modules/excel/workbook.d.ts +43 -0
  114. package/dist/browser/modules/excel/workbook.js +48 -0
  115. package/dist/browser/modules/excel/worksheet.d.ts +157 -3
  116. package/dist/browser/modules/excel/worksheet.js +394 -35
  117. package/dist/browser/modules/excel/xlsx/rel-type.d.ts +40 -0
  118. package/dist/browser/modules/excel/xlsx/rel-type.js +41 -1
  119. package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
  120. package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  121. package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  122. package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  123. package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
  124. package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
  125. package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
  126. package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
  127. package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
  128. package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  129. package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  130. package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
  131. package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  132. package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
  133. package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
  134. package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
  135. package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  136. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
  137. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  138. package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
  139. package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  140. package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
  141. package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
  142. package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
  143. package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  144. package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
  145. package/dist/browser/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  146. package/dist/browser/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  147. package/dist/browser/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
  148. package/dist/browser/modules/excel/xlsx/xform/xsd-values.js +101 -0
  149. package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
  150. package/dist/browser/modules/excel/xlsx/xlsx.browser.js +4422 -78
  151. package/dist/browser/modules/pdf/builder/document-builder.d.ts +74 -0
  152. package/dist/browser/modules/pdf/builder/document-builder.js +507 -2
  153. package/dist/browser/modules/pdf/builder/pdf-editor.js +48 -3
  154. package/dist/browser/modules/pdf/excel-bridge.d.ts +69 -0
  155. package/dist/browser/modules/pdf/excel-bridge.js +683 -12
  156. package/dist/browser/modules/pdf/font/font-manager.d.ts +25 -0
  157. package/dist/browser/modules/pdf/font/font-manager.js +39 -0
  158. package/dist/browser/modules/pdf/index.d.ts +5 -2
  159. package/dist/browser/modules/pdf/index.js +3 -1
  160. package/dist/browser/modules/pdf/render/chart-surface.d.ts +33 -0
  161. package/dist/browser/modules/pdf/render/chart-surface.js +200 -0
  162. package/dist/browser/modules/pdf/render/layout-engine.d.ts +22 -1
  163. package/dist/browser/modules/pdf/render/layout-engine.js +436 -56
  164. package/dist/browser/modules/pdf/render/page-renderer.js +169 -28
  165. package/dist/browser/modules/pdf/render/pdf-exporter.js +117 -7
  166. package/dist/browser/modules/pdf/types.d.ts +227 -23
  167. package/dist/browser/modules/pdf/types.js +4 -0
  168. package/dist/browser/modules/pdf/word-bridge.d.ts +47 -0
  169. package/dist/browser/modules/pdf/word-bridge.js +304 -0
  170. package/dist/browser/modules/word/constants.d.ts +179 -0
  171. package/dist/browser/modules/word/constants.js +231 -0
  172. package/dist/browser/modules/word/content-types.d.ts +27 -0
  173. package/dist/browser/modules/word/content-types.js +53 -0
  174. package/dist/browser/modules/word/digital-signatures.d.ts +87 -0
  175. package/dist/browser/modules/word/digital-signatures.js +134 -0
  176. package/dist/browser/modules/word/document.d.ts +728 -0
  177. package/dist/browser/modules/word/document.js +1795 -0
  178. package/dist/browser/modules/word/docx-packager.d.ts +14 -0
  179. package/dist/browser/modules/word/docx-packager.js +822 -0
  180. package/dist/browser/modules/word/docx-reader.d.ts +11 -0
  181. package/dist/browser/modules/word/docx-reader.js +4929 -0
  182. package/dist/browser/modules/word/encryption.d.ts +102 -0
  183. package/dist/browser/modules/word/encryption.js +274 -0
  184. package/dist/browser/modules/word/errors.d.ts +49 -0
  185. package/dist/browser/modules/word/errors.js +68 -0
  186. package/dist/browser/modules/word/font-obfuscation.d.ts +31 -0
  187. package/dist/browser/modules/word/font-obfuscation.js +83 -0
  188. package/dist/browser/modules/word/html-renderer.d.ts +38 -0
  189. package/dist/browser/modules/word/html-renderer.js +782 -0
  190. package/dist/browser/modules/word/index.base.d.ts +19 -0
  191. package/dist/browser/modules/word/index.base.js +51 -0
  192. package/dist/browser/modules/word/index.browser.d.ts +4 -0
  193. package/dist/browser/modules/word/index.browser.js +4 -0
  194. package/dist/browser/modules/word/index.d.ts +4 -0
  195. package/dist/browser/modules/word/index.js +4 -0
  196. package/dist/browser/modules/word/internal-utils.d.ts +23 -0
  197. package/dist/browser/modules/word/internal-utils.js +54 -0
  198. package/dist/browser/modules/word/relationships.d.ts +31 -0
  199. package/dist/browser/modules/word/relationships.js +56 -0
  200. package/dist/browser/modules/word/types.d.ts +2325 -0
  201. package/dist/browser/modules/word/types.js +10 -0
  202. package/dist/browser/modules/word/units.d.ts +49 -0
  203. package/dist/browser/modules/word/units.js +111 -0
  204. package/dist/browser/modules/word/writers/chart-writer.d.ts +10 -0
  205. package/dist/browser/modules/word/writers/chart-writer.js +385 -0
  206. package/dist/browser/modules/word/writers/checkbox-writer.d.ts +9 -0
  207. package/dist/browser/modules/word/writers/checkbox-writer.js +42 -0
  208. package/dist/browser/modules/word/writers/comment-writer.d.ts +15 -0
  209. package/dist/browser/modules/word/writers/comment-writer.js +70 -0
  210. package/dist/browser/modules/word/writers/document-writer.d.ts +16 -0
  211. package/dist/browser/modules/word/writers/document-writer.js +461 -0
  212. package/dist/browser/modules/word/writers/footnote-writer.d.ts +11 -0
  213. package/dist/browser/modules/word/writers/footnote-writer.js +72 -0
  214. package/dist/browser/modules/word/writers/header-footer-writer.d.ts +13 -0
  215. package/dist/browser/modules/word/writers/header-footer-writer.js +129 -0
  216. package/dist/browser/modules/word/writers/image-writer.d.ts +10 -0
  217. package/dist/browser/modules/word/writers/image-writer.js +185 -0
  218. package/dist/browser/modules/word/writers/math-writer.d.ts +9 -0
  219. package/dist/browser/modules/word/writers/math-writer.js +428 -0
  220. package/dist/browser/modules/word/writers/numbering-writer.d.ts +10 -0
  221. package/dist/browser/modules/word/writers/numbering-writer.js +125 -0
  222. package/dist/browser/modules/word/writers/paragraph-writer.d.ts +13 -0
  223. package/dist/browser/modules/word/writers/paragraph-writer.js +516 -0
  224. package/dist/browser/modules/word/writers/parts-writer.d.ts +26 -0
  225. package/dist/browser/modules/word/writers/parts-writer.js +660 -0
  226. package/dist/browser/modules/word/writers/run-writer.d.ts +15 -0
  227. package/dist/browser/modules/word/writers/run-writer.js +649 -0
  228. package/dist/browser/modules/word/writers/section-writer.d.ts +10 -0
  229. package/dist/browser/modules/word/writers/section-writer.js +238 -0
  230. package/dist/browser/modules/word/writers/styles-writer.d.ts +10 -0
  231. package/dist/browser/modules/word/writers/styles-writer.js +242 -0
  232. package/dist/browser/modules/word/writers/table-writer.d.ts +10 -0
  233. package/dist/browser/modules/word/writers/table-writer.js +503 -0
  234. package/dist/browser/modules/word/writers/textbox-writer.d.ts +9 -0
  235. package/dist/browser/modules/word/writers/textbox-writer.js +53 -0
  236. package/dist/browser/modules/word/writers/toc-writer.d.ts +9 -0
  237. package/dist/browser/modules/word/writers/toc-writer.js +79 -0
  238. package/dist/browser/modules/xml/encode.d.ts +56 -7
  239. package/dist/browser/modules/xml/encode.js +157 -11
  240. package/dist/cjs/index.js +13 -2
  241. package/dist/cjs/modules/excel/chart/cache-populator.js +1178 -0
  242. package/dist/cjs/modules/excel/chart/chart-api.js +371 -0
  243. package/dist/cjs/modules/excel/chart/chart-builder.js +2440 -0
  244. package/dist/cjs/modules/excel/chart/chart-ex-builder.js +907 -0
  245. package/dist/cjs/modules/excel/chart/chart-ex-parser.js +1208 -0
  246. package/dist/cjs/modules/excel/chart/chart-ex-renderer.js +5364 -0
  247. package/dist/cjs/modules/excel/chart/chart-ex-types.js +12 -0
  248. package/dist/cjs/modules/excel/chart/chart-images.js +366 -0
  249. package/dist/cjs/modules/excel/chart/chart-presets.js +184 -0
  250. package/dist/cjs/modules/excel/chart/chart-renderer.js +6450 -0
  251. package/dist/cjs/modules/excel/chart/chart-sidecar.js +433 -0
  252. package/dist/cjs/modules/excel/chart/chart-utils.js +845 -0
  253. package/dist/cjs/modules/excel/chart/chart.js +1324 -0
  254. package/dist/cjs/modules/excel/chart/glyph-rasterizer.js +664 -0
  255. package/dist/cjs/modules/excel/chart/index.js +101 -0
  256. package/dist/cjs/modules/excel/chart/install.js +95 -0
  257. package/dist/cjs/modules/excel/chart/shape-properties.js +1577 -0
  258. package/dist/cjs/modules/excel/chart/stroke-font.js +1559 -0
  259. package/dist/cjs/modules/excel/chart/topojson.js +239 -0
  260. package/dist/cjs/modules/excel/chart/types.js +9 -0
  261. package/dist/cjs/modules/excel/chart-host-registry.js +96 -0
  262. package/dist/cjs/modules/excel/chartsheet.js +199 -0
  263. package/dist/cjs/modules/excel/defined-names.js +44 -4
  264. package/dist/cjs/modules/excel/errors.js +11 -1
  265. package/dist/cjs/modules/excel/form-control.js +17 -0
  266. package/dist/cjs/modules/excel/image.js +12 -2
  267. package/dist/cjs/modules/excel/pivot-chart.js +56 -0
  268. package/dist/cjs/modules/excel/pivot-table.js +35 -0
  269. package/dist/cjs/modules/excel/range.js +5 -1
  270. package/dist/cjs/modules/excel/sparkline/index.js +23 -0
  271. package/dist/cjs/modules/excel/sparkline/sparkline.js +756 -0
  272. package/dist/cjs/modules/excel/stream/worksheet-writer.js +3 -2
  273. package/dist/cjs/modules/excel/table.js +42 -6
  274. package/dist/cjs/modules/excel/utils/address.js +29 -0
  275. package/dist/cjs/modules/excel/utils/drawing-utils.js +11 -6
  276. package/dist/cjs/modules/excel/utils/guid.js +38 -0
  277. package/dist/cjs/modules/excel/utils/ooxml-paths.js +246 -9
  278. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +103 -0
  279. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart.js +2128 -0
  280. package/dist/cjs/modules/excel/utils/ooxml-validator/check-chartsheet.js +29 -0
  281. package/dist/cjs/modules/excel/utils/ooxml-validator/check-content-types.js +184 -0
  282. package/dist/cjs/modules/excel/utils/ooxml-validator/check-drawing.js +270 -0
  283. package/dist/cjs/modules/excel/utils/ooxml-validator/check-pivot.js +107 -0
  284. package/dist/cjs/modules/excel/utils/ooxml-validator/check-relationships.js +188 -0
  285. package/dist/cjs/modules/excel/utils/ooxml-validator/check-structure.js +60 -0
  286. package/dist/cjs/modules/excel/utils/ooxml-validator/check-styles.js +92 -0
  287. package/dist/cjs/modules/excel/utils/ooxml-validator/check-table.js +180 -0
  288. package/dist/cjs/modules/excel/utils/ooxml-validator/check-workbook.js +166 -0
  289. package/dist/cjs/modules/excel/utils/ooxml-validator/check-worksheet.js +572 -0
  290. package/dist/cjs/modules/excel/utils/ooxml-validator/context.js +196 -0
  291. package/dist/cjs/modules/excel/utils/ooxml-validator/index.js +105 -0
  292. package/dist/cjs/modules/excel/utils/ooxml-validator/path-utils.js +168 -0
  293. package/dist/cjs/modules/excel/utils/ooxml-validator/reporter.js +66 -0
  294. package/dist/cjs/modules/excel/utils/ooxml-validator/types.js +13 -0
  295. package/dist/cjs/modules/excel/utils/ooxml-validator/xml-utils.js +110 -0
  296. package/dist/cjs/modules/excel/workbook.browser.js +973 -38
  297. package/dist/cjs/modules/excel/workbook.js +48 -0
  298. package/dist/cjs/modules/excel/worksheet.js +393 -34
  299. package/dist/cjs/modules/excel/xlsx/rel-type.js +41 -1
  300. package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  301. package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  302. package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  303. package/dist/cjs/modules/excel/xlsx/xform/chart/chart-space-xform.js +6003 -0
  304. package/dist/cjs/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +219 -0
  305. package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +149 -10
  306. package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  307. package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  308. package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  309. package/dist/cjs/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +228 -0
  310. package/dist/cjs/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  311. package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  312. package/dist/cjs/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  313. package/dist/cjs/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +444 -0
  314. package/dist/cjs/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  315. package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +195 -19
  316. package/dist/cjs/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  317. package/dist/cjs/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  318. package/dist/cjs/modules/excel/xlsx/xform/xsd-values.js +106 -0
  319. package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +4420 -76
  320. package/dist/cjs/modules/pdf/builder/document-builder.js +506 -1
  321. package/dist/cjs/modules/pdf/builder/pdf-editor.js +48 -3
  322. package/dist/cjs/modules/pdf/excel-bridge.js +684 -12
  323. package/dist/cjs/modules/pdf/font/font-manager.js +39 -0
  324. package/dist/cjs/modules/pdf/index.js +5 -1
  325. package/dist/cjs/modules/pdf/render/chart-surface.js +203 -0
  326. package/dist/cjs/modules/pdf/render/layout-engine.js +437 -56
  327. package/dist/cjs/modules/pdf/render/page-renderer.js +169 -28
  328. package/dist/cjs/modules/pdf/render/pdf-exporter.js +115 -5
  329. package/dist/cjs/modules/pdf/types.js +5 -0
  330. package/dist/cjs/modules/pdf/word-bridge.js +307 -0
  331. package/dist/cjs/modules/word/constants.js +234 -0
  332. package/dist/cjs/modules/word/content-types.js +57 -0
  333. package/dist/cjs/modules/word/digital-signatures.js +140 -0
  334. package/dist/cjs/modules/word/document.js +1909 -0
  335. package/dist/cjs/modules/word/docx-packager.js +825 -0
  336. package/dist/cjs/modules/word/docx-reader.js +4932 -0
  337. package/dist/cjs/modules/word/encryption.js +282 -0
  338. package/dist/cjs/modules/word/errors.js +88 -0
  339. package/dist/cjs/modules/word/font-obfuscation.js +88 -0
  340. package/dist/cjs/modules/word/html-renderer.js +785 -0
  341. package/dist/cjs/modules/word/index.base.js +199 -0
  342. package/dist/cjs/modules/word/index.browser.js +20 -0
  343. package/dist/cjs/modules/word/index.js +20 -0
  344. package/dist/cjs/modules/word/internal-utils.js +59 -0
  345. package/dist/cjs/modules/word/relationships.js +60 -0
  346. package/dist/cjs/modules/word/types.js +11 -0
  347. package/dist/cjs/modules/word/units.js +135 -0
  348. package/dist/cjs/modules/word/writers/chart-writer.js +388 -0
  349. package/dist/cjs/modules/word/writers/checkbox-writer.js +45 -0
  350. package/dist/cjs/modules/word/writers/comment-writer.js +74 -0
  351. package/dist/cjs/modules/word/writers/document-writer.js +465 -0
  352. package/dist/cjs/modules/word/writers/footnote-writer.js +76 -0
  353. package/dist/cjs/modules/word/writers/header-footer-writer.js +134 -0
  354. package/dist/cjs/modules/word/writers/image-writer.js +188 -0
  355. package/dist/cjs/modules/word/writers/math-writer.js +431 -0
  356. package/dist/cjs/modules/word/writers/numbering-writer.js +128 -0
  357. package/dist/cjs/modules/word/writers/paragraph-writer.js +521 -0
  358. package/dist/cjs/modules/word/writers/parts-writer.js +671 -0
  359. package/dist/cjs/modules/word/writers/run-writer.js +655 -0
  360. package/dist/cjs/modules/word/writers/section-writer.js +241 -0
  361. package/dist/cjs/modules/word/writers/styles-writer.js +245 -0
  362. package/dist/cjs/modules/word/writers/table-writer.js +506 -0
  363. package/dist/cjs/modules/word/writers/textbox-writer.js +56 -0
  364. package/dist/cjs/modules/word/writers/toc-writer.js +82 -0
  365. package/dist/cjs/modules/xml/encode.js +158 -11
  366. package/dist/esm/index.browser.js +20 -2
  367. package/dist/esm/index.js +9 -1
  368. package/dist/esm/modules/excel/chart/cache-populator.js +1171 -0
  369. package/dist/esm/modules/excel/chart/chart-api.js +364 -0
  370. package/dist/esm/modules/excel/chart/chart-builder.js +2432 -0
  371. package/dist/esm/modules/excel/chart/chart-ex-builder.js +903 -0
  372. package/dist/esm/modules/excel/chart/chart-ex-parser.js +1205 -0
  373. package/dist/esm/modules/excel/chart/chart-ex-renderer.js +5352 -0
  374. package/dist/esm/modules/excel/chart/chart-ex-types.js +11 -0
  375. package/dist/esm/modules/excel/chart/chart-images.js +363 -0
  376. package/dist/esm/modules/excel/chart/chart-presets.js +179 -0
  377. package/dist/esm/modules/excel/chart/chart-renderer.js +6440 -0
  378. package/dist/esm/modules/excel/chart/chart-sidecar.js +427 -0
  379. package/dist/esm/modules/excel/chart/chart-utils.js +821 -0
  380. package/dist/esm/modules/excel/chart/chart.js +1320 -0
  381. package/dist/esm/modules/excel/chart/glyph-rasterizer.js +658 -0
  382. package/dist/esm/modules/excel/chart/index.js +46 -0
  383. package/dist/esm/modules/excel/chart/install.js +91 -0
  384. package/dist/esm/modules/excel/chart/shape-properties.js +1557 -0
  385. package/dist/esm/modules/excel/chart/stroke-font.js +1556 -0
  386. package/dist/esm/modules/excel/chart/topojson.js +236 -0
  387. package/dist/esm/modules/excel/chart/types.js +8 -0
  388. package/dist/esm/modules/excel/chart-host-registry.js +90 -0
  389. package/dist/esm/modules/excel/chartsheet.js +196 -0
  390. package/dist/esm/modules/excel/defined-names.js +44 -4
  391. package/dist/esm/modules/excel/errors.js +9 -0
  392. package/dist/esm/modules/excel/form-control.js +17 -0
  393. package/dist/esm/modules/excel/image.js +12 -2
  394. package/dist/esm/modules/excel/pivot-chart.js +53 -0
  395. package/dist/esm/modules/excel/pivot-table.js +35 -0
  396. package/dist/esm/modules/excel/range.js +5 -1
  397. package/dist/esm/modules/excel/sparkline/index.js +7 -0
  398. package/dist/esm/modules/excel/sparkline/sparkline.js +750 -0
  399. package/dist/esm/modules/excel/stream/worksheet-writer.js +3 -2
  400. package/dist/esm/modules/excel/table.js +42 -6
  401. package/dist/esm/modules/excel/utils/address.js +28 -0
  402. package/dist/esm/modules/excel/utils/drawing-utils.js +11 -6
  403. package/dist/esm/modules/excel/utils/guid.js +35 -0
  404. package/dist/esm/modules/excel/utils/ooxml-paths.js +206 -9
  405. package/dist/esm/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
  406. package/dist/esm/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
  407. package/dist/esm/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
  408. package/dist/esm/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
  409. package/dist/esm/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
  410. package/dist/esm/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
  411. package/dist/esm/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
  412. package/dist/esm/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
  413. package/dist/esm/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
  414. package/dist/esm/modules/excel/utils/ooxml-validator/check-table.js +177 -0
  415. package/dist/esm/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
  416. package/dist/esm/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
  417. package/dist/esm/modules/excel/utils/ooxml-validator/context.js +191 -0
  418. package/dist/esm/modules/excel/utils/ooxml-validator/index.js +102 -0
  419. package/dist/esm/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
  420. package/dist/esm/modules/excel/utils/ooxml-validator/reporter.js +61 -0
  421. package/dist/esm/modules/excel/utils/ooxml-validator/types.js +12 -0
  422. package/dist/esm/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
  423. package/dist/esm/modules/excel/workbook.browser.js +969 -34
  424. package/dist/esm/modules/excel/workbook.js +48 -0
  425. package/dist/esm/modules/excel/worksheet.js +394 -35
  426. package/dist/esm/modules/excel/xlsx/rel-type.js +41 -1
  427. package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
  428. package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
  429. package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
  430. package/dist/esm/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
  431. package/dist/esm/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
  432. package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
  433. package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
  434. package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
  435. package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
  436. package/dist/esm/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
  437. package/dist/esm/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
  438. package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
  439. package/dist/esm/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
  440. package/dist/esm/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
  441. package/dist/esm/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
  442. package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
  443. package/dist/esm/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
  444. package/dist/esm/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
  445. package/dist/esm/modules/excel/xlsx/xform/xsd-values.js +101 -0
  446. package/dist/esm/modules/excel/xlsx/xlsx.browser.js +4422 -78
  447. package/dist/esm/modules/pdf/builder/document-builder.js +507 -2
  448. package/dist/esm/modules/pdf/builder/pdf-editor.js +48 -3
  449. package/dist/esm/modules/pdf/excel-bridge.js +683 -12
  450. package/dist/esm/modules/pdf/font/font-manager.js +39 -0
  451. package/dist/esm/modules/pdf/index.js +3 -1
  452. package/dist/esm/modules/pdf/render/chart-surface.js +200 -0
  453. package/dist/esm/modules/pdf/render/layout-engine.js +436 -56
  454. package/dist/esm/modules/pdf/render/page-renderer.js +169 -28
  455. package/dist/esm/modules/pdf/render/pdf-exporter.js +117 -7
  456. package/dist/esm/modules/pdf/types.js +4 -0
  457. package/dist/esm/modules/pdf/word-bridge.js +304 -0
  458. package/dist/esm/modules/word/constants.js +231 -0
  459. package/dist/esm/modules/word/content-types.js +53 -0
  460. package/dist/esm/modules/word/digital-signatures.js +134 -0
  461. package/dist/esm/modules/word/document.js +1795 -0
  462. package/dist/esm/modules/word/docx-packager.js +822 -0
  463. package/dist/esm/modules/word/docx-reader.js +4929 -0
  464. package/dist/esm/modules/word/encryption.js +274 -0
  465. package/dist/esm/modules/word/errors.js +68 -0
  466. package/dist/esm/modules/word/font-obfuscation.js +83 -0
  467. package/dist/esm/modules/word/html-renderer.js +782 -0
  468. package/dist/esm/modules/word/index.base.js +51 -0
  469. package/dist/esm/modules/word/index.browser.js +4 -0
  470. package/dist/esm/modules/word/index.js +4 -0
  471. package/dist/esm/modules/word/internal-utils.js +54 -0
  472. package/dist/esm/modules/word/relationships.js +56 -0
  473. package/dist/esm/modules/word/types.js +10 -0
  474. package/dist/esm/modules/word/units.js +111 -0
  475. package/dist/esm/modules/word/writers/chart-writer.js +385 -0
  476. package/dist/esm/modules/word/writers/checkbox-writer.js +42 -0
  477. package/dist/esm/modules/word/writers/comment-writer.js +70 -0
  478. package/dist/esm/modules/word/writers/document-writer.js +461 -0
  479. package/dist/esm/modules/word/writers/footnote-writer.js +72 -0
  480. package/dist/esm/modules/word/writers/header-footer-writer.js +129 -0
  481. package/dist/esm/modules/word/writers/image-writer.js +185 -0
  482. package/dist/esm/modules/word/writers/math-writer.js +428 -0
  483. package/dist/esm/modules/word/writers/numbering-writer.js +125 -0
  484. package/dist/esm/modules/word/writers/paragraph-writer.js +516 -0
  485. package/dist/esm/modules/word/writers/parts-writer.js +660 -0
  486. package/dist/esm/modules/word/writers/run-writer.js +649 -0
  487. package/dist/esm/modules/word/writers/section-writer.js +238 -0
  488. package/dist/esm/modules/word/writers/styles-writer.js +242 -0
  489. package/dist/esm/modules/word/writers/table-writer.js +503 -0
  490. package/dist/esm/modules/word/writers/textbox-writer.js +53 -0
  491. package/dist/esm/modules/word/writers/toc-writer.js +79 -0
  492. package/dist/esm/modules/xml/encode.js +157 -11
  493. package/dist/iife/excelts.iife.js +11789 -687
  494. package/dist/iife/excelts.iife.js.map +1 -1
  495. package/dist/iife/excelts.iife.min.js +52 -44
  496. package/dist/types/index.browser.d.ts +8 -5
  497. package/dist/types/index.d.ts +4 -2
  498. package/dist/types/modules/excel/chart/cache-populator.d.ts +49 -0
  499. package/dist/types/modules/excel/chart/chart-api.d.ts +92 -0
  500. package/dist/types/modules/excel/chart/chart-builder.d.ts +48 -0
  501. package/dist/types/modules/excel/chart/chart-ex-builder.d.ts +36 -0
  502. package/dist/types/modules/excel/chart/chart-ex-parser.d.ts +8 -0
  503. package/dist/types/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
  504. package/dist/types/modules/excel/chart/chart-ex-types.d.ts +531 -0
  505. package/dist/types/modules/excel/chart/chart-images.d.ts +78 -0
  506. package/dist/types/modules/excel/chart/chart-presets.d.ts +392 -0
  507. package/dist/types/modules/excel/chart/chart-renderer.d.ts +550 -0
  508. package/dist/types/modules/excel/chart/chart-sidecar.d.ts +21 -0
  509. package/dist/types/modules/excel/chart/chart-utils.d.ts +306 -0
  510. package/dist/types/modules/excel/chart/chart.d.ts +504 -0
  511. package/dist/types/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
  512. package/dist/types/modules/excel/chart/index.d.ts +54 -0
  513. package/dist/types/modules/excel/chart/install.d.ts +44 -0
  514. package/dist/types/modules/excel/chart/shape-properties.d.ts +156 -0
  515. package/dist/types/modules/excel/chart/stroke-font.d.ts +36 -0
  516. package/dist/types/modules/excel/chart/topojson.d.ts +98 -0
  517. package/dist/types/modules/excel/chart/types.d.ts +2559 -0
  518. package/dist/types/modules/excel/chart-host-registry.d.ts +157 -0
  519. package/dist/types/modules/excel/chartsheet.d.ts +102 -0
  520. package/dist/types/modules/excel/defined-names.d.ts +35 -0
  521. package/dist/types/modules/excel/errors.d.ts +6 -0
  522. package/dist/types/modules/excel/form-control.d.ts +6 -0
  523. package/dist/types/modules/excel/pivot-chart.d.ts +7 -0
  524. package/dist/types/modules/excel/pivot-table.d.ts +55 -0
  525. package/dist/types/modules/excel/sparkline/index.d.ts +7 -0
  526. package/dist/types/modules/excel/sparkline/sparkline.d.ts +206 -0
  527. package/dist/types/modules/excel/types.d.ts +72 -0
  528. package/dist/types/modules/excel/utils/address.d.ts +18 -0
  529. package/dist/types/modules/excel/utils/guid.d.ts +15 -0
  530. package/dist/types/modules/excel/utils/ooxml-paths.d.ts +74 -0
  531. package/dist/types/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
  532. package/dist/types/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
  533. package/dist/types/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
  534. package/dist/types/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
  535. package/dist/types/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
  536. package/dist/types/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
  537. package/dist/types/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
  538. package/dist/types/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
  539. package/dist/types/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
  540. package/dist/types/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
  541. package/dist/types/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
  542. package/dist/types/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
  543. package/dist/types/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
  544. package/dist/types/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
  545. package/dist/types/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
  546. package/dist/types/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
  547. package/dist/types/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
  548. package/dist/types/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
  549. package/dist/types/modules/excel/workbook.browser.d.ts +248 -30
  550. package/dist/types/modules/excel/workbook.d.ts +43 -0
  551. package/dist/types/modules/excel/worksheet.d.ts +157 -3
  552. package/dist/types/modules/excel/xlsx/rel-type.d.ts +40 -0
  553. package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
  554. package/dist/types/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
  555. package/dist/types/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
  556. package/dist/types/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
  557. package/dist/types/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
  558. package/dist/types/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
  559. package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
  560. package/dist/types/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
  561. package/dist/types/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
  562. package/dist/types/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
  563. package/dist/types/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
  564. package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
  565. package/dist/types/modules/pdf/builder/document-builder.d.ts +74 -0
  566. package/dist/types/modules/pdf/excel-bridge.d.ts +69 -0
  567. package/dist/types/modules/pdf/font/font-manager.d.ts +25 -0
  568. package/dist/types/modules/pdf/index.d.ts +5 -2
  569. package/dist/types/modules/pdf/render/chart-surface.d.ts +33 -0
  570. package/dist/types/modules/pdf/render/layout-engine.d.ts +22 -1
  571. package/dist/types/modules/pdf/types.d.ts +227 -23
  572. package/dist/types/modules/pdf/word-bridge.d.ts +47 -0
  573. package/dist/types/modules/word/constants.d.ts +179 -0
  574. package/dist/types/modules/word/content-types.d.ts +27 -0
  575. package/dist/types/modules/word/digital-signatures.d.ts +87 -0
  576. package/dist/types/modules/word/document.d.ts +728 -0
  577. package/dist/types/modules/word/docx-packager.d.ts +14 -0
  578. package/dist/types/modules/word/docx-reader.d.ts +11 -0
  579. package/dist/types/modules/word/encryption.d.ts +102 -0
  580. package/dist/types/modules/word/errors.d.ts +49 -0
  581. package/dist/types/modules/word/font-obfuscation.d.ts +31 -0
  582. package/dist/types/modules/word/html-renderer.d.ts +38 -0
  583. package/dist/types/modules/word/index.base.d.ts +19 -0
  584. package/dist/types/modules/word/index.browser.d.ts +4 -0
  585. package/dist/types/modules/word/index.d.ts +4 -0
  586. package/dist/types/modules/word/internal-utils.d.ts +23 -0
  587. package/dist/types/modules/word/relationships.d.ts +31 -0
  588. package/dist/types/modules/word/types.d.ts +2325 -0
  589. package/dist/types/modules/word/units.d.ts +49 -0
  590. package/dist/types/modules/word/writers/chart-writer.d.ts +10 -0
  591. package/dist/types/modules/word/writers/checkbox-writer.d.ts +9 -0
  592. package/dist/types/modules/word/writers/comment-writer.d.ts +15 -0
  593. package/dist/types/modules/word/writers/document-writer.d.ts +16 -0
  594. package/dist/types/modules/word/writers/footnote-writer.d.ts +11 -0
  595. package/dist/types/modules/word/writers/header-footer-writer.d.ts +13 -0
  596. package/dist/types/modules/word/writers/image-writer.d.ts +10 -0
  597. package/dist/types/modules/word/writers/math-writer.d.ts +9 -0
  598. package/dist/types/modules/word/writers/numbering-writer.d.ts +10 -0
  599. package/dist/types/modules/word/writers/paragraph-writer.d.ts +13 -0
  600. package/dist/types/modules/word/writers/parts-writer.d.ts +26 -0
  601. package/dist/types/modules/word/writers/run-writer.d.ts +15 -0
  602. package/dist/types/modules/word/writers/section-writer.d.ts +10 -0
  603. package/dist/types/modules/word/writers/styles-writer.d.ts +10 -0
  604. package/dist/types/modules/word/writers/table-writer.d.ts +10 -0
  605. package/dist/types/modules/word/writers/textbox-writer.d.ts +9 -0
  606. package/dist/types/modules/word/writers/toc-writer.d.ts +9 -0
  607. package/dist/types/modules/xml/encode.d.ts +56 -7
  608. package/package.json +29 -11
  609. package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +0 -48
  610. package/dist/browser/modules/excel/utils/ooxml-validator.js +0 -493
  611. package/dist/browser/modules/excel/utils/passthrough-manager.d.ts +0 -77
  612. package/dist/browser/modules/excel/utils/passthrough-manager.js +0 -129
  613. package/dist/cjs/modules/excel/utils/ooxml-validator.js +0 -499
  614. package/dist/cjs/modules/excel/utils/passthrough-manager.js +0 -133
  615. package/dist/esm/modules/excel/utils/ooxml-validator.js +0 -493
  616. package/dist/esm/modules/excel/utils/passthrough-manager.js +0 -129
  617. package/dist/types/modules/excel/utils/ooxml-validator.d.ts +0 -48
  618. package/dist/types/modules/excel/utils/passthrough-manager.d.ts +0 -77
@@ -0,0 +1,845 @@
1
+ "use strict";
2
+ /**
3
+ * Shared helpers for the chart preview renderers.
4
+ *
5
+ * Both `chart-renderer.ts` (classic `c:chart`) and
6
+ * `chart-ex-renderer.ts` (ChartEx `cx:chart`) used to carry their own
7
+ * copies of the same handful of math / colour / formatting helpers. The
8
+ * duplicates had drifted over time — subtle differences in NaN guards,
9
+ * hex normalisation, theme palettes, etc. — so a fix in one file
10
+ * silently left the other buggy. This module is the single authoritative
11
+ * home for the helpers shared between the two renderers (plus a few
12
+ * internals — `escapeXml`, `escapeXmlAttr` — that had identical copies
13
+ * scattered across the chart pipeline).
14
+ *
15
+ * Design constraints:
16
+ *
17
+ * - **Zero dependencies on chart-renderer / chart-ex-renderer** so
18
+ * this module sits below them in the import graph and does not
19
+ * create cycles. Types-only imports from `./types` are fine.
20
+ * - **Behaviour-preserving** compared with the consolidated
21
+ * implementations. The old files had two classes of helper:
22
+ * (1) strictly identical duplicates and (2) near-duplicates where
23
+ * one version was more defensive than the other. For the latter we
24
+ * kept the defensive variant — graceful degradation on malformed
25
+ * input is always the safer choice for a preview path.
26
+ * - **Structural rect typing**. The renderers use two different
27
+ * concrete rect types (`ChartSceneRect` in chart-renderer,
28
+ * `SvgRect` in chart-ex-renderer) that share the same shape.
29
+ * Helpers here take structural `{ x: number; y: number; width:
30
+ * number; height: number }` so both renderers can call them
31
+ * directly without adapters.
32
+ */
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.PRESET_COLOR_HEX_TABLE = exports.escapeXmlAttr = exports.GRID_COLOR = exports.AXIS_COLOR = exports.COLORS = exports.DEFAULT_HEIGHT = exports.DEFAULT_WIDTH = void 0;
35
+ exports.themeIndexToName = themeIndexToName;
36
+ exports.clamp01 = clamp01;
37
+ exports.valueToY = valueToY;
38
+ exports.valueToX = valueToX;
39
+ exports.polar = polar;
40
+ exports.insetRect = insetRect;
41
+ exports.fmt = fmt;
42
+ exports.fmtNumAttr = fmtNumAttr;
43
+ exports.fmtNumText = fmtNumText;
44
+ exports.formatNumber = formatNumber;
45
+ exports.escapeXml = escapeXml;
46
+ exports.normalizeHex6 = normalizeHex6;
47
+ exports.withAlpha = withAlpha;
48
+ exports.interpolateColor = interpolateColor;
49
+ exports.hexToPdfColor = hexToPdfColor;
50
+ exports.hexToPdfColorWithAlpha = hexToPdfColorWithAlpha;
51
+ exports.resolveChartColor = resolveChartColor;
52
+ exports.previewShapeFillColor = previewShapeFillColor;
53
+ exports.previewShapeLineColor = previewShapeLineColor;
54
+ exports.previewShapeLineWidthPx = previewShapeLineWidthPx;
55
+ const encode_1 = require("../../xml/encode.js");
56
+ // ============================================================================
57
+ // Shared render constants
58
+ // ============================================================================
59
+ /** Default SVG / PNG / PDF canvas width when the caller omits `options.width`. */
60
+ exports.DEFAULT_WIDTH = 640;
61
+ /** Default SVG / PNG / PDF canvas height when the caller omits `options.height`. */
62
+ exports.DEFAULT_HEIGHT = 360;
63
+ /**
64
+ * Default series colour rotation. Matches the Excel 2019+ Office theme
65
+ * accent1..accent6 palette so a brand-new workbook with no theme XML
66
+ * still renders with the colours Excel would have used.
67
+ */
68
+ exports.COLORS = ["#4472C4", "#ED7D31", "#A5A5A5", "#FFC000", "#5B9BD5", "#70AD47"];
69
+ /** Dark grey for axis lines / frame strokes. */
70
+ exports.AXIS_COLOR = "#444444";
71
+ /** Light grey for gridlines. */
72
+ exports.GRID_COLOR = "#D9D9D9";
73
+ /**
74
+ * Preview-grade DrawingML theme palette (`CT_ColorMapping` order:
75
+ * `dk1` / `lt1` / `dk2` / `lt2` / `accent1..6` / `hlink` / `folHlink`).
76
+ * Values match the Office defaults Excel 2019+ ships with (the "Office"
77
+ * theme). The renderer only consults this when a chart references a
78
+ * theme colour but no `<a:clrScheme>` has been resolved — the full
79
+ * theme lookup chain requires the workbook's `theme.xml`, which the
80
+ * preview path deliberately does not load. Authors who need exact
81
+ * theme-accurate colours should rasterise with a tool that resolves
82
+ * the theme.
83
+ */
84
+ const THEME_PREVIEW_PALETTE = Object.freeze([
85
+ "#000000", // dk1 / tx1
86
+ "#FFFFFF", // lt1 / bg1
87
+ "#44546A", // dk2 / tx2
88
+ "#E7E6E6", // lt2 / bg2
89
+ "#4472C4", // accent1
90
+ "#ED7D31", // accent2
91
+ "#A5A5A5", // accent3
92
+ "#FFC000", // accent4
93
+ "#5B9BD5", // accent5
94
+ "#70AD47", // accent6
95
+ "#0563C1", // hlink
96
+ "#954F72" // folHlink
97
+ ]);
98
+ /**
99
+ * DrawingML theme slot names in the canonical order used by
100
+ * `CT_ColorMapping` (ECMA-376 §20.1.2.3.29). Both parser and writer
101
+ * use this single list so every round-trip picks the same variant of
102
+ * the dk/tx and lt/bg alias pairs (we canonicalise to `dk…` / `lt…`).
103
+ *
104
+ * The parser folds `tx1/bg1/tx2/bg2` into the same indices as
105
+ * `dk1/lt1/dk2/lt2` (they are aliases in the OOXML colour-mapping
106
+ * schema) — see `shape-properties.ts:parseColorFromXml`. The output
107
+ * form therefore uses `dk1/lt1/dk2/lt2`, which is semantically
108
+ * identical to the input.
109
+ */
110
+ const THEME_NAMES = Object.freeze([
111
+ "dk1",
112
+ "lt1",
113
+ "dk2",
114
+ "lt2",
115
+ "accent1",
116
+ "accent2",
117
+ "accent3",
118
+ "accent4",
119
+ "accent5",
120
+ "accent6",
121
+ "hlink",
122
+ "folHlink"
123
+ ]);
124
+ /**
125
+ * Convert a theme-palette index (`ChartColor.theme`) back to its
126
+ * DrawingML `schemeClr` token. Out-of-range indices fall back to
127
+ * `"dk1"` so a malformed model still produces parseable XML Excel
128
+ * renders as the first theme slot rather than XML that contains an
129
+ * `undefined` literal.
130
+ */
131
+ function themeIndexToName(index) {
132
+ return THEME_NAMES[index] ?? "dk1";
133
+ }
134
+ // ============================================================================
135
+ // Math helpers
136
+ // ============================================================================
137
+ /**
138
+ * Clamp to the closed interval `[0, 1]`. Non-finite input collapses to
139
+ * `0` rather than propagating `NaN` — downstream callers use the
140
+ * result as an interpolation parameter where `NaN` would paint black.
141
+ */
142
+ function clamp01(value) {
143
+ if (!Number.isFinite(value)) {
144
+ return 0;
145
+ }
146
+ if (value < 0) {
147
+ return 0;
148
+ }
149
+ if (value > 1) {
150
+ return 1;
151
+ }
152
+ return value;
153
+ }
154
+ /**
155
+ * Map a data-space value onto the plot area's y coordinate space (SVG
156
+ * y grows downward, so large `value` ends up near the top of the
157
+ * plot). Guards against `max === min` — a single-point dataset or a
158
+ * range that collapsed for any reason would otherwise produce `NaN`.
159
+ */
160
+ function valueToY(value, min, max, plot) {
161
+ const span = max - min;
162
+ if (!Number.isFinite(span) || span === 0) {
163
+ return plot.y + plot.height / 2;
164
+ }
165
+ return plot.y + plot.height - ((value - min) / span) * plot.height;
166
+ }
167
+ /**
168
+ * Map a data-space value onto the plot area's x coordinate space. Same
169
+ * `max === min` guard as {@link valueToY}.
170
+ */
171
+ function valueToX(value, min, max, plot) {
172
+ const span = max - min;
173
+ if (!Number.isFinite(span) || span === 0) {
174
+ return plot.x + plot.width / 2;
175
+ }
176
+ return plot.x + ((value - min) / span) * plot.width;
177
+ }
178
+ /** Convert polar `(radius, angle)` to Cartesian around `(cx, cy)`. */
179
+ function polar(cx, cy, radius, angle) {
180
+ return { x: cx + Math.cos(angle) * radius, y: cy + Math.sin(angle) * radius };
181
+ }
182
+ /**
183
+ * Shrink a rect by `amount` on each side (uniform inset). Non-finite
184
+ * inputs collapse to zero on all four components rather than
185
+ * propagating `NaN` — `Math.max(0, NaN)` returns `NaN` per ECMAScript,
186
+ * and a `NaN` width feeding downstream math (e.g. `valueToX`) cascades
187
+ * into every rendered coordinate.
188
+ */
189
+ function insetRect(rect, amount) {
190
+ const safeAmount = Number.isFinite(amount) ? amount : 0;
191
+ const x = Number.isFinite(rect.x) ? rect.x + safeAmount : 0;
192
+ const y = Number.isFinite(rect.y) ? rect.y + safeAmount : 0;
193
+ const w = Number.isFinite(rect.width) ? rect.width - safeAmount * 2 : 0;
194
+ const h = Number.isFinite(rect.height) ? rect.height - safeAmount * 2 : 0;
195
+ return {
196
+ x,
197
+ y,
198
+ width: w > 0 ? w : 0,
199
+ height: h > 0 ? h : 0
200
+ };
201
+ }
202
+ // ============================================================================
203
+ // Number formatting
204
+ // ============================================================================
205
+ /**
206
+ * Format a number for SVG attribute values and inline XML. Two-decimal
207
+ * precision with trailing `.00` stripped (`1.00 → "1"`, `1.50 →
208
+ * "1.50"` — we intentionally keep the second zero to avoid widening the
209
+ * diff against Excel's own byte output on round-trips). Non-finite
210
+ * input returns `"0"` — `Number.toFixed(NaN)` produces the literal
211
+ * string `"NaN"`, which is invalid inside SVG attribute values and
212
+ * breaks downstream parsers.
213
+ */
214
+ function fmt(value) {
215
+ if (!Number.isFinite(value)) {
216
+ return "0";
217
+ }
218
+ return value.toFixed(2).replace(/\.00$/, "");
219
+ }
220
+ /**
221
+ * Format a numeric attribute value for XML emission. Returns an empty
222
+ * string for `undefined` / `NaN` / `±Infinity` — non-finite values would
223
+ * otherwise serialise as literal `"NaN"` / `"Infinity"` text, which no
224
+ * XSD validator accepts as `xsd:double` and downstream parsers reject.
225
+ * Emit an empty string so the caller's attribute-inclusion guard
226
+ * (`if (attrs.length > 0)` or explicit `!== undefined` check) drops
227
+ * the attribute entirely rather than stamping garbage into the wire
228
+ * format.
229
+ *
230
+ * Uses JavaScript's default `toString()` which is round-trip-safe per
231
+ * IEEE 754 (no precision drift) for both integer and fractional input.
232
+ */
233
+ function fmtNumAttr(value) {
234
+ if (value === undefined || !Number.isFinite(value)) {
235
+ return "";
236
+ }
237
+ return String(value);
238
+ }
239
+ /**
240
+ * Format a numeric text-node value. Same semantics as {@link fmtNumAttr},
241
+ * but for use inside element content (e.g. `<cx:pt>42.5</cx:pt>`).
242
+ * Non-finite values become `"0"` — a text node must be non-empty to
243
+ * keep the element well-formed, and `0` is the least-surprising
244
+ * fallback for a blank / error cell (matches how most OOXML readers
245
+ * treat empty numeric `<c:v>`).
246
+ */
247
+ function fmtNumText(value) {
248
+ if (!Number.isFinite(value)) {
249
+ return "0";
250
+ }
251
+ return String(value);
252
+ }
253
+ /**
254
+ * Format a number for user-visible axis tick labels.
255
+ *
256
+ * - Integer values → plain digits (`42` → `"42"`).
257
+ * - `|value| < 0.01` but non-zero → scientific notation with three
258
+ * significant figures (`1.00e-3`). Two-decimal mantissa keeps the
259
+ * label compact while preserving enough precision that tick values
260
+ * remain distinguishable; a single-digit mantissa would collapse
261
+ * consecutive ticks like `1.1e-3` and `1.4e-3` to the same label.
262
+ * - Otherwise → single decimal (`toFixed(1)`).
263
+ * - Non-finite input → `""` (tick position still drawn without
264
+ * label, keeping the chart legible while flagging the upstream
265
+ * computation bug on inspection).
266
+ *
267
+ * This is the "axis-label" formatter — it's intentionally compact and
268
+ * does not apply OOXML number formats. Callers that need the authored
269
+ * format code should resolve it upstream.
270
+ */
271
+ function formatNumber(value) {
272
+ if (!Number.isFinite(value)) {
273
+ return "";
274
+ }
275
+ if (Number.isInteger(value)) {
276
+ return String(value);
277
+ }
278
+ const abs = Math.abs(value);
279
+ if (abs !== 0 && abs < 0.01) {
280
+ return value.toExponential(2);
281
+ }
282
+ return value.toFixed(1);
283
+ }
284
+ // ============================================================================
285
+ // XML escaping
286
+ // ============================================================================
287
+ //
288
+ // Split into two distinct helpers with different semantics:
289
+ //
290
+ // - `escapeXml` (text content) — escapes `&<>` only. Excel itself
291
+ // writes apostrophes and double-quotes unescaped inside text
292
+ // content (see Excel-authored pivot source names like
293
+ // `<c:name>'Sheet'!Pivot1</c:name>`), so escaping them would make
294
+ // our output diverge visibly at the byte level and break string
295
+ // consumers that do literal matches on quoted sheet names.
296
+ //
297
+ // - `escapeXmlAttr` (attribute values) — full `xmlEncodeAttr` from
298
+ // `@xml/encode`: escapes `&<>"'`, strips C0/C1 control chars and
299
+ // lone surrogates, and encodes `\t\n\r` as numeric character
300
+ // references so attribute round-trip preserves whitespace (XML 1.0
301
+ // §3.3.3 attribute-value normalisation would otherwise flatten
302
+ // them to a single space).
303
+ //
304
+ // chart-renderer, chart-ex-renderer, chart-ex-parser, chart-sidecar
305
+ // and the chart-space xform previously carried five subtly-different
306
+ // local copies; this module is now the single authoritative home for
307
+ // both helpers.
308
+ /**
309
+ * Escape XML text content — `&`, `<`, `>` become `&amp;`, `&lt;`,
310
+ * `&gt;` respectively. XML-illegal characters are stripped up front
311
+ * via the shared {@link stripXmlIllegalChars} helper — that covers
312
+ * the forbidden C0 controls (`0x00-0x08 | 0x0B | 0x0C | 0x0E-0x1F`),
313
+ * DEL (`0x7F`, project-policy strip despite being technically legal
314
+ * XML), lone UTF-16 surrogate halves, and the `0xFFFE` / `0xFFFF`
315
+ * noncharacters.
316
+ *
317
+ * Apostrophe and double-quote pass through unescaped — both are legal
318
+ * inside text content and leaving them alone preserves Excel's byte
319
+ * output (`<c:name>'Sheet'!Pivot1</c:name>` with literal quotes).
320
+ *
321
+ * We keep this separate from {@link xmlEncode} in `@xml/encode`
322
+ * because that helper escapes all five reserved entities; the chart
323
+ * module prefers byte-level parity with Excel's own output, which
324
+ * leaves `'` / `"` alone in text context.
325
+ */
326
+ function escapeXml(value) {
327
+ // Fast path: most chart text is plain ASCII / BMP with no control
328
+ // chars. A quick scan tells us whether to enter the slow path or
329
+ // just run the cheap three-replace chain. Valid surrogate pairs
330
+ // (any emoji / non-BMP CJK character) must be skipped intact — a
331
+ // naive "any high surrogate triggers strip" would force the slow
332
+ // path on every string containing one, defeating the fast-path.
333
+ let needsStrip = false;
334
+ const len = value.length;
335
+ for (let i = 0; i < len; i++) {
336
+ const code = value.charCodeAt(i);
337
+ if (code < 32) {
338
+ if (code !== 9 && code !== 10 && code !== 13) {
339
+ needsStrip = true;
340
+ break;
341
+ }
342
+ }
343
+ else if (code >= 0xd800 && code <= 0xdbff) {
344
+ const next = i + 1 < len ? value.charCodeAt(i + 1) : 0;
345
+ if (next >= 0xdc00 && next <= 0xdfff) {
346
+ // Valid surrogate pair — consume both halves.
347
+ i++;
348
+ }
349
+ else {
350
+ needsStrip = true;
351
+ break;
352
+ }
353
+ }
354
+ else if (code >= 0xdc00 && code <= 0xdfff) {
355
+ // Lone low surrogate.
356
+ needsStrip = true;
357
+ break;
358
+ }
359
+ else if (code === 0x7f || code === 0xfffe || code === 0xffff) {
360
+ needsStrip = true;
361
+ break;
362
+ }
363
+ }
364
+ const sanitised = needsStrip ? stripXmlIllegalChars(value) : value;
365
+ return sanitised.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
366
+ }
367
+ /**
368
+ * Strip characters that can't appear in XML 1.0 content or attribute
369
+ * values. Re-exported from `@xml/encode` so the chart module and the
370
+ * XML module share a single source of truth; previously each carried a
371
+ * local copy with comment-level disagreements (one called DEL a C1
372
+ * control, the other called it "XML-forbidden" — both inaccurate).
373
+ * See {@link stripXmlIllegalChars} in `@xml/encode` for the canonical
374
+ * rules.
375
+ */
376
+ function stripXmlIllegalChars(value) {
377
+ return (0, encode_1.stripXmlIllegalChars)(value);
378
+ }
379
+ var encode_2 = require("../../xml/encode.js");
380
+ Object.defineProperty(exports, "escapeXmlAttr", { enumerable: true, get: function () { return encode_2.xmlEncodeAttr; } });
381
+ // ============================================================================
382
+ // Hex colour helpers
383
+ // ============================================================================
384
+ /**
385
+ * Normalise any supported hex input to a 6-digit uppercase value
386
+ * (without the leading `#`). Accepts:
387
+ *
388
+ * - 3-digit shorthand `#FFF` → `FFFFFF` (each nibble duplicated).
389
+ * - 4-digit shorthand `#FFFA` with alpha → `FFFFFF` (alpha dropped;
390
+ * renderer encodes alpha separately).
391
+ * - 6-digit `#112233`.
392
+ * - 8-digit `#11223344` with alpha → `112233` (alpha dropped).
393
+ *
394
+ * Returns `undefined` when the input cannot be coerced — lets callers
395
+ * fall back to a default colour rather than emit `#NaNNaNNaN`.
396
+ */
397
+ function normalizeHex6(hex) {
398
+ if (!hex) {
399
+ return undefined;
400
+ }
401
+ const clean = hex.replace(/^#/, "").toUpperCase();
402
+ if (/^[0-9A-F]{6}([0-9A-F]{2})?$/.test(clean)) {
403
+ return clean.slice(0, 6);
404
+ }
405
+ if (/^[0-9A-F]{3}([0-9A-F])?$/.test(clean)) {
406
+ return clean
407
+ .slice(0, 3)
408
+ .split("")
409
+ .map(ch => ch + ch)
410
+ .join("");
411
+ }
412
+ return undefined;
413
+ }
414
+ /**
415
+ * Extract the alpha channel from a hex colour string (if present) as
416
+ * a fraction in `[0, 1]`. Accepts `#RGBA` and `#RRGGBBAA`; the 3-
417
+ * and 6-digit forms have no alpha and return `undefined`.
418
+ */
419
+ function hexAlpha(hex) {
420
+ if (!hex) {
421
+ return undefined;
422
+ }
423
+ const clean = hex.replace(/^#/, "").toUpperCase();
424
+ if (/^[0-9A-F]{8}$/.test(clean)) {
425
+ return parseInt(clean.slice(6, 8), 16) / 255;
426
+ }
427
+ if (/^[0-9A-F]{4}$/.test(clean)) {
428
+ const aNibble = clean[3];
429
+ return parseInt(aNibble + aNibble, 16) / 255;
430
+ }
431
+ return undefined;
432
+ }
433
+ /**
434
+ * White-blend `hex` by `alpha` — a cheap opacity approximation for
435
+ * SVG surfaces that don't support per-element `fill-opacity`. Accepts
436
+ * 3/4/6/8-digit hex; returns the input untouched for anything else
437
+ * rather than emit `"#NaNNaNNaN"`.
438
+ */
439
+ function withAlpha(hex, alpha) {
440
+ const body = normalizeHex6(hex);
441
+ if (!body) {
442
+ return hex;
443
+ }
444
+ const safeAlpha = Number.isFinite(alpha) ? Math.max(0, Math.min(1, alpha)) : 1;
445
+ const mix = (component) => {
446
+ const value = parseInt(component, 16);
447
+ return Math.round(value * safeAlpha + 255 * (1 - safeAlpha))
448
+ .toString(16)
449
+ .padStart(2, "0")
450
+ .toUpperCase();
451
+ };
452
+ return `#${mix(body.slice(0, 2))}${mix(body.slice(2, 4))}${mix(body.slice(4, 6))}`;
453
+ }
454
+ /**
455
+ * Linearly interpolate between two hex colours. `t` is clamped to
456
+ * `[0, 1]`; non-finite `t` falls back to `0`. Malformed hex inputs
457
+ * degrade gracefully (prefer the end colour when `t >= 0.5`; prefer
458
+ * the start colour otherwise) so one bad input channel never produces
459
+ * `"#NaNNaNNaN"`.
460
+ */
461
+ function interpolateColor(a, b, t) {
462
+ const ca = normalizeHex6(a);
463
+ const cb = normalizeHex6(b);
464
+ const clamped = clamp01(t);
465
+ if (!ca || !cb) {
466
+ return `#${clamped >= 0.5 ? (cb ?? ca ?? "000000") : (ca ?? cb ?? "000000")}`;
467
+ }
468
+ const mix = (i) => {
469
+ // `ca` / `cb` have been normalised to exactly 6 hex digits by
470
+ // `normalizeHex6`, so `parseInt(..., 16)` on a 2-char slice cannot
471
+ // produce `NaN`. We rely on that invariant — don't add a
472
+ // defensive-looking guard that masks a real upstream regression.
473
+ const av = parseInt(ca.slice(i, i + 2), 16);
474
+ const bv = parseInt(cb.slice(i, i + 2), 16);
475
+ return Math.round(av + (bv - av) * clamped)
476
+ .toString(16)
477
+ .padStart(2, "0")
478
+ .toUpperCase();
479
+ };
480
+ return `#${mix(0)}${mix(2)}${mix(4)}`;
481
+ }
482
+ /**
483
+ * Convert a hex colour string to a {@link PdfColor}. Preserves an
484
+ * explicit alpha byte when the caller supplied 4- or 8-digit hex —
485
+ * PDF surfaces that honour `PdfColor.a` (notably `PdfPageBuilder` via
486
+ * `/ExtGState`) then produce real translucency. Malformed input
487
+ * degrades to opaque black rather than producing `NaN` channels, which
488
+ * would emit broken PDF content.
489
+ */
490
+ function hexToPdfColor(hex) {
491
+ const clean = normalizeHex6(hex);
492
+ if (!clean) {
493
+ return { r: 0, g: 0, b: 0 };
494
+ }
495
+ const alpha = hexAlpha(hex);
496
+ const base = {
497
+ r: parseInt(clean.slice(0, 2), 16) / 255,
498
+ g: parseInt(clean.slice(2, 4), 16) / 255,
499
+ b: parseInt(clean.slice(4, 6), 16) / 255
500
+ };
501
+ return alpha !== undefined ? { ...base, a: alpha } : base;
502
+ }
503
+ /**
504
+ * Like {@link hexToPdfColor} but attaches an explicit alpha value.
505
+ * Callers use this to mirror the SVG path's `withAlpha(color, 0.35)`
506
+ * pattern on the PDF bridge: the hex itself stays opaque, `a` carries
507
+ * the transparency the SVG would paint by white-blending.
508
+ */
509
+ function hexToPdfColorWithAlpha(hex, alpha) {
510
+ return { ...hexToPdfColor(hex), a: clamp01(alpha) };
511
+ }
512
+ // ============================================================================
513
+ // Shape-properties preview helpers
514
+ // ============================================================================
515
+ /**
516
+ * Resolve a {@link ChartColor} into a preview-grade hex colour. Accepts
517
+ * every DrawingML colour variant Excel emits — `srgb`, `theme` (looked
518
+ * up in {@link THEME_PREVIEW_PALETTE}), `sysClr` (the two Excel keeps
519
+ * meaningful in the preview — `windowText` / `window`), and `prstClr`
520
+ * (the ~140-entry {@link PRESET_COLOR_HEX_TABLE}). Returns `undefined`
521
+ * when the colour is absent or references something this preview cannot
522
+ * resolve (an unknown preset / sysClr, or a theme index outside the
523
+ * 12-entry palette). Callers that need a default coalesce with `??`.
524
+ *
525
+ * Shared by fill, line, and text-property resolvers so a file that
526
+ * sets, say, a gridline colour via `<a:schemeClr val="accent3"/>`
527
+ * paints the correct accent-3 hex — previously the line/text paths
528
+ * only honoured `srgbClr` and silently fell back to the renderer's
529
+ * default grey.
530
+ *
531
+ * Colour modifiers (`tint`, `shade`, `lumMod`, `lumOff`, `alpha`,
532
+ * `satMod`) are intentionally NOT applied — the preview path doesn't
533
+ * model the DrawingML blend pipeline, and approximating one component
534
+ * in isolation produces visibly-wrong results. Authors who need
535
+ * exact theme-derived colours should rasterise with a full DrawingML
536
+ * renderer.
537
+ */
538
+ function resolveChartColor(color) {
539
+ if (!color) {
540
+ return undefined;
541
+ }
542
+ if (typeof color.srgb === "string") {
543
+ // Validate: OOXML `ST_HexBinary3` is a 6-digit hex (RGB) but we
544
+ // tolerate a leading `#` for backward compatibility. Also honour
545
+ // the 8-digit `RRGGBBAA` form Excel uses when encoding alpha
546
+ // inside the hex — drop the alpha for the preview (alpha is
547
+ // surfaced separately as `color.alpha` on the structured model).
548
+ //
549
+ // If `srgb` is set but malformed, return `undefined` rather than
550
+ // falling through to `theme` / `sysClr` / `prstClr`. Legitimate
551
+ // DrawingML colours set exactly one of those fields, so a
552
+ // fall-through only ever helps malformed data — and when it does,
553
+ // it silently substitutes a different colour source than the
554
+ // author wrote, which is worse than coalescing to a default.
555
+ const clean = color.srgb.replace(/^#/, "");
556
+ if (/^[0-9a-fA-F]{6}$/.test(clean)) {
557
+ return `#${clean.toUpperCase()}`;
558
+ }
559
+ if (/^[0-9a-fA-F]{8}$/.test(clean)) {
560
+ return `#${clean.slice(0, 6).toUpperCase()}`;
561
+ }
562
+ return undefined;
563
+ }
564
+ if (typeof color.theme === "number") {
565
+ // `Number.isInteger` guards against `NaN`, `Infinity`, fractional
566
+ // values, and negative indices — any of which would slip past
567
+ // `typeof === "number"` but produce `undefined` on index access,
568
+ // silently skipping the sysClr / prstClr fallbacks below. On a
569
+ // malformed or out-of-range theme index, fall through so the
570
+ // caller's default resolution still runs.
571
+ if (Number.isInteger(color.theme) &&
572
+ color.theme >= 0 &&
573
+ color.theme < THEME_PREVIEW_PALETTE.length) {
574
+ return THEME_PREVIEW_PALETTE[color.theme];
575
+ }
576
+ }
577
+ if (typeof color.schemeName === "string") {
578
+ // `schemeName` carries a DrawingML scheme token that couldn't be
579
+ // mapped onto a theme slot. The preview has no concept of
580
+ // placeholder colours (e.g. `phClr`), so fall back to `undefined`
581
+ // — caller coalesces to a default. Returning `undefined` here is
582
+ // preferable to guessing a theme colour that may not match the
583
+ // author's intent on a real `<a:clrScheme>` resolver.
584
+ return undefined;
585
+ }
586
+ if (typeof color.sysClr === "string") {
587
+ if (color.sysClr === "windowText") {
588
+ return "#000000";
589
+ }
590
+ if (color.sysClr === "window") {
591
+ return "#FFFFFF";
592
+ }
593
+ return undefined;
594
+ }
595
+ if (typeof color.prstClr === "string") {
596
+ const hex = exports.PRESET_COLOR_HEX_TABLE[color.prstClr];
597
+ return hex ? `#${hex}` : undefined;
598
+ }
599
+ return undefined;
600
+ }
601
+ /**
602
+ * Resolve a {@link ChartFill} into a preview-grade hex colour. Recognises
603
+ * the four `<a:solidFill>` children Excel writes (`srgbClr`, `schemeClr`,
604
+ * `sysClr`, `prstClr`) via the shared {@link resolveChartColor} resolver
605
+ * and the {@link THEME_PREVIEW_PALETTE} / {@link PRESET_COLOR_HEX_TABLE}
606
+ * lookup tables for the theme / preset variants.
607
+ *
608
+ * When the fill cannot be resolved (no fill set, empty `solidFill`,
609
+ * unknown preset / system colour), returns `fallback`. Callers that
610
+ * want `undefined` for misses should pass `undefined` as the fallback;
611
+ * callers that want a palette rotation entry should resolve the
612
+ * fallback themselves and pass it in. This unifies what used to be
613
+ * two almost-identical helpers (`colorFromShapeFill` in
614
+ * chart-renderer.ts and `shapeFillColor` in chart-ex-renderer.ts).
615
+ */
616
+ function previewShapeFillColor(fill, fallback) {
617
+ return resolveChartColor(fill?.solid) ?? fallback;
618
+ }
619
+ /**
620
+ * Resolve a {@link ShapeProperties.ln} stroke colour to a preview-grade
621
+ * hex string. Honours every DrawingML colour variant on the line's own
622
+ * `<a:solidFill>` via {@link resolveChartColor} — previously only
623
+ * `srgbClr` was read, which silently reverted every theme / preset /
624
+ * sysClr line colour (gridlines, axes, trendlines, error bars) to the
625
+ * renderer's default grey on load.
626
+ */
627
+ function previewShapeLineColor(line) {
628
+ return resolveChartColor(line?.color);
629
+ }
630
+ /**
631
+ * Resolve a {@link ShapeProperties.ln} stroke width (OOXML EMU) to a
632
+ * preview pixel width. OOXML stores line widths in EMU (1 pt = 12 700
633
+ * EMU); the preview clamps to a minimum of 0.5 px so a tiny authored
634
+ * width still renders as a visible stroke.
635
+ */
636
+ function previewShapeLineWidthPx(line) {
637
+ return typeof line?.width === "number" ? Math.max(0.5, line.width / 12700) : undefined;
638
+ }
639
+ // ============================================================================
640
+ // Preset colours (DrawingML `ST_PresetColorVal`)
641
+ // ============================================================================
642
+ /**
643
+ * DrawingML preset colour table (`ST_PresetColorVal` from the OOXML
644
+ * schema). ~140 named colours — superset of HTML's X11 palette. The
645
+ * renderers resolve `<a:prstClr val="…"/>` through this table so
646
+ * template-built workbooks with preset colour references (`darkRed`,
647
+ * `navy`, `forestGreen`, …) render with the correct hex instead of
648
+ * rotating through the default series palette.
649
+ *
650
+ * Previously this lived on `chart-renderer.ts` and was imported by
651
+ * `chart-ex-renderer.ts`. Moved here so it sits below both renderers
652
+ * in the import graph.
653
+ */
654
+ exports.PRESET_COLOR_HEX_TABLE = Object.freeze({
655
+ aliceBlue: "F0F8FF",
656
+ antiqueWhite: "FAEBD7",
657
+ aqua: "00FFFF",
658
+ aquamarine: "7FFFD4",
659
+ azure: "F0FFFF",
660
+ beige: "F5F5DC",
661
+ bisque: "FFE4C4",
662
+ black: "000000",
663
+ blanchedAlmond: "FFEBCD",
664
+ blue: "0000FF",
665
+ blueViolet: "8A2BE2",
666
+ brown: "A52A2A",
667
+ burlyWood: "DEB887",
668
+ cadetBlue: "5F9EA0",
669
+ chartreuse: "7FFF00",
670
+ chocolate: "D2691E",
671
+ coral: "FF7F50",
672
+ cornflowerBlue: "6495ED",
673
+ cornsilk: "FFF8DC",
674
+ crimson: "DC143C",
675
+ cyan: "00FFFF",
676
+ darkBlue: "00008B",
677
+ darkCyan: "008B8B",
678
+ darkGoldenrod: "B8860B",
679
+ darkGray: "A9A9A9",
680
+ darkGreen: "006400",
681
+ darkGrey: "A9A9A9",
682
+ darkKhaki: "BDB76B",
683
+ darkMagenta: "8B008B",
684
+ darkOliveGreen: "556B2F",
685
+ darkOrange: "FF8C00",
686
+ darkOrchid: "9932CC",
687
+ darkRed: "8B0000",
688
+ darkSalmon: "E9967A",
689
+ darkSeaGreen: "8FBC8F",
690
+ darkSlateBlue: "483D8B",
691
+ darkSlateGray: "2F4F4F",
692
+ darkSlateGrey: "2F4F4F",
693
+ darkTurquoise: "00CED1",
694
+ darkViolet: "9400D3",
695
+ deepPink: "FF1493",
696
+ deepSkyBlue: "00BFFF",
697
+ dimGray: "696969",
698
+ dimGrey: "696969",
699
+ dkBlue: "00008B",
700
+ dkCyan: "008B8B",
701
+ dkGoldenrod: "B8860B",
702
+ dkGray: "A9A9A9",
703
+ dkGreen: "006400",
704
+ dkGrey: "A9A9A9",
705
+ dkKhaki: "BDB76B",
706
+ dkMagenta: "8B008B",
707
+ dkOliveGreen: "556B2F",
708
+ dkOrange: "FF8C00",
709
+ dkOrchid: "9932CC",
710
+ dkRed: "8B0000",
711
+ dkSalmon: "E9967A",
712
+ dkSeaGreen: "8FBC8F",
713
+ dkSlateBlue: "483D8B",
714
+ dkSlateGray: "2F4F4F",
715
+ dkSlateGrey: "2F4F4F",
716
+ dkTurquoise: "00CED1",
717
+ dkViolet: "9400D3",
718
+ dodgerBlue: "1E90FF",
719
+ firebrick: "B22222",
720
+ floralWhite: "FFFAF0",
721
+ forestGreen: "228B22",
722
+ fuchsia: "FF00FF",
723
+ gainsboro: "DCDCDC",
724
+ ghostWhite: "F8F8FF",
725
+ gold: "FFD700",
726
+ goldenrod: "DAA520",
727
+ gray: "808080",
728
+ green: "008000",
729
+ greenYellow: "ADFF2F",
730
+ grey: "808080",
731
+ honeydew: "F0FFF0",
732
+ hotPink: "FF69B4",
733
+ indianRed: "CD5C5C",
734
+ indigo: "4B0082",
735
+ ivory: "FFFFF0",
736
+ khaki: "F0E68C",
737
+ lavender: "E6E6FA",
738
+ lavenderBlush: "FFF0F5",
739
+ lawnGreen: "7CFC00",
740
+ lemonChiffon: "FFFACD",
741
+ lightBlue: "ADD8E6",
742
+ lightCoral: "F08080",
743
+ lightCyan: "E0FFFF",
744
+ lightGoldenrodYellow: "FAFAD2",
745
+ lightGray: "D3D3D3",
746
+ lightGreen: "90EE90",
747
+ lightGrey: "D3D3D3",
748
+ lightPink: "FFB6C1",
749
+ lightSalmon: "FFA07A",
750
+ lightSeaGreen: "20B2AA",
751
+ lightSkyBlue: "87CEFA",
752
+ lightSlateGray: "778899",
753
+ lightSlateGrey: "778899",
754
+ lightSteelBlue: "B0C4DE",
755
+ lightYellow: "FFFFE0",
756
+ ltBlue: "ADD8E6",
757
+ ltCoral: "F08080",
758
+ ltCyan: "E0FFFF",
759
+ ltGoldenrodYellow: "FAFAD2",
760
+ ltGray: "D3D3D3",
761
+ ltGreen: "90EE90",
762
+ ltGrey: "D3D3D3",
763
+ ltPink: "FFB6C1",
764
+ ltSalmon: "FFA07A",
765
+ ltSeaGreen: "20B2AA",
766
+ ltSkyBlue: "87CEFA",
767
+ ltSlateGray: "778899",
768
+ ltSlateGrey: "778899",
769
+ ltSteelBlue: "B0C4DE",
770
+ ltYellow: "FFFFE0",
771
+ lime: "00FF00",
772
+ limeGreen: "32CD32",
773
+ linen: "FAF0E6",
774
+ magenta: "FF00FF",
775
+ maroon: "800000",
776
+ medAquamarine: "66CDAA",
777
+ medBlue: "0000CD",
778
+ medOrchid: "BA55D3",
779
+ medPurple: "9370DB",
780
+ medSeaGreen: "3CB371",
781
+ medSlateBlue: "7B68EE",
782
+ medSpringGreen: "00FA9A",
783
+ medTurquoise: "48D1CC",
784
+ medVioletRed: "C71585",
785
+ mediumAquamarine: "66CDAA",
786
+ mediumBlue: "0000CD",
787
+ mediumOrchid: "BA55D3",
788
+ mediumPurple: "9370DB",
789
+ mediumSeaGreen: "3CB371",
790
+ mediumSlateBlue: "7B68EE",
791
+ mediumSpringGreen: "00FA9A",
792
+ mediumTurquoise: "48D1CC",
793
+ mediumVioletRed: "C71585",
794
+ midnightBlue: "191970",
795
+ mintCream: "F5FFFA",
796
+ mistyRose: "FFE4E1",
797
+ moccasin: "FFE4B5",
798
+ navajoWhite: "FFDEAD",
799
+ navy: "000080",
800
+ oldLace: "FDF5E6",
801
+ olive: "808000",
802
+ oliveDrab: "6B8E23",
803
+ orange: "FFA500",
804
+ orangeRed: "FF4500",
805
+ orchid: "DA70D6",
806
+ paleGoldenrod: "EEE8AA",
807
+ paleGreen: "98FB98",
808
+ paleTurquoise: "AFEEEE",
809
+ paleVioletRed: "DB7093",
810
+ papayaWhip: "FFEFD5",
811
+ peachPuff: "FFDAB9",
812
+ peru: "CD853F",
813
+ pink: "FFC0CB",
814
+ plum: "DDA0DD",
815
+ powderBlue: "B0E0E6",
816
+ purple: "800080",
817
+ red: "FF0000",
818
+ rosyBrown: "BC8F8F",
819
+ royalBlue: "4169E1",
820
+ saddleBrown: "8B4513",
821
+ salmon: "FA8072",
822
+ sandyBrown: "F4A460",
823
+ seaGreen: "2E8B57",
824
+ seaShell: "FFF5EE",
825
+ sienna: "A0522D",
826
+ silver: "C0C0C0",
827
+ skyBlue: "87CEEB",
828
+ slateBlue: "6A5ACD",
829
+ slateGray: "708090",
830
+ slateGrey: "708090",
831
+ snow: "FFFAFA",
832
+ springGreen: "00FF7F",
833
+ steelBlue: "4682B4",
834
+ tan: "D2B48C",
835
+ teal: "008080",
836
+ thistle: "D8BFD8",
837
+ tomato: "FF6347",
838
+ turquoise: "40E0D0",
839
+ violet: "EE82EE",
840
+ wheat: "F5DEB3",
841
+ white: "FFFFFF",
842
+ whiteSmoke: "F5F5F5",
843
+ yellow: "FFFF00",
844
+ yellowGreen: "9ACD32"
845
+ });