@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,228 @@
1
+ "use strict";
2
+ /**
3
+ * GraphicFrameXform — handles `xdr:graphicFrame` elements in drawing XML.
4
+ *
5
+ * A graphicFrame is the container for embedded objects such as charts.
6
+ * The OOXML structure:
7
+ *
8
+ * <xdr:graphicFrame macro="">
9
+ * <xdr:nvGraphicFramePr>
10
+ * <xdr:cNvPr id="2" name="Chart 1"/>
11
+ * <xdr:cNvGraphicFramePr/>
12
+ * </xdr:nvGraphicFramePr>
13
+ * <xdr:xfrm>
14
+ * <a:off x="0" y="0"/>
15
+ * <a:ext cx="0" cy="0"/>
16
+ * </xdr:xfrm>
17
+ * <a:graphic>
18
+ * <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart">
19
+ * <c:chart xmlns:c="..." xmlns:r="..." r:id="rId1"/>
20
+ * </a:graphicData>
21
+ * </a:graphic>
22
+ * </xdr:graphicFrame>
23
+ */
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.GraphicFrameXform = void 0;
26
+ const base_xform_1 = require("../base-xform.js");
27
+ const uuid_1 = require("../../../../../utils/uuid.js");
28
+ const CHART_URI = "http://schemas.openxmlformats.org/drawingml/2006/chart";
29
+ const CHART_EX_URI = "http://schemas.microsoft.com/office/drawing/2014/chartex";
30
+ // URI identifying the Office `creationId` extension registered on
31
+ // `xdr:cNvPr`. This GUID is the Microsoft-assigned registry value
32
+ // for the extension — every Office-authored drawing carries the
33
+ // same uri on this element.
34
+ const CREATION_ID_EXT_URI = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}";
35
+ class GraphicFrameXform extends base_xform_1.BaseXform {
36
+ constructor() {
37
+ super(...arguments);
38
+ // SAX parse state
39
+ this._inNvPr = false;
40
+ this._inGraphicData = false;
41
+ /** Raw XML capture for a:extLst inside xdr:cNvPr */
42
+ this._extLstCapture = null;
43
+ }
44
+ get tag() {
45
+ return "xdr:graphicFrame";
46
+ }
47
+ prepare(model, options) {
48
+ if (model.index === undefined) {
49
+ model.index = options.index + 1;
50
+ }
51
+ }
52
+ render(xmlStream, model) {
53
+ xmlStream.openNode(this.tag, { macro: "" });
54
+ // Non-visual properties
55
+ xmlStream.openNode("xdr:nvGraphicFramePr");
56
+ // Microsoft Excel starts `xdr:cNvPr/@id` at 2 (id 1 is
57
+ // reserved for the anchor's own non-visual drawing id slot
58
+ // internal to Office's drawing engine). Mirror the convention
59
+ // here so freshly-authored drawings round-trip byte-for-byte
60
+ // against Excel's output. Loaded files retain whatever id they
61
+ // carried at parse time via `model.index`.
62
+ const cNvPrId = model.index ?? 2;
63
+ const cNvPrName = model.name ?? `Chart ${cNvPrId}`;
64
+ if (model.cNvPrExtLst) {
65
+ xmlStream.openNode("xdr:cNvPr", {
66
+ id: cNvPrId,
67
+ name: cNvPrName
68
+ });
69
+ xmlStream.writeRaw(model.cNvPrExtLst);
70
+ xmlStream.closeNode(); // xdr:cNvPr
71
+ }
72
+ else if (model.isChartEx) {
73
+ // ChartEx drawings — auto-generate Microsoft's standard
74
+ // `<a:extLst>` with an `<a16:creationId>` extension so
75
+ // Excel 2019+ can track the drawing across sessions.
76
+ // Without this extension, strict Excel builds have been
77
+ // observed to reject the drawing part on load with
78
+ // "Removed Part: /xl/drawings/drawingN.xml (Drawing shape)"
79
+ // even when the chartEx reference inside is otherwise
80
+ // valid. A random UUID suffices — the id only has to be
81
+ // stable within a given saved file; it isn't a content
82
+ // address.
83
+ xmlStream.openNode("xdr:cNvPr", {
84
+ id: cNvPrId,
85
+ name: cNvPrName
86
+ });
87
+ xmlStream.openNode("a:extLst");
88
+ xmlStream.openNode("a:ext", { uri: CREATION_ID_EXT_URI });
89
+ xmlStream.leafNode("a16:creationId", {
90
+ "xmlns:a16": "http://schemas.microsoft.com/office/drawing/2014/main",
91
+ id: `{${(0, uuid_1.uuidV4)().toUpperCase()}}`
92
+ });
93
+ xmlStream.closeNode(); // a:ext
94
+ xmlStream.closeNode(); // a:extLst
95
+ xmlStream.closeNode(); // xdr:cNvPr
96
+ }
97
+ else {
98
+ xmlStream.leafNode("xdr:cNvPr", {
99
+ id: cNvPrId,
100
+ name: cNvPrName
101
+ });
102
+ }
103
+ xmlStream.leafNode("xdr:cNvGraphicFramePr");
104
+ xmlStream.closeNode(); // xdr:nvGraphicFramePr
105
+ // Transform (position/size handled by anchor, so use zeros)
106
+ xmlStream.openNode("xdr:xfrm");
107
+ xmlStream.leafNode("a:off", { x: 0, y: 0 });
108
+ xmlStream.leafNode("a:ext", { cx: 0, cy: 0 });
109
+ xmlStream.closeNode(); // xdr:xfrm
110
+ // Graphic
111
+ xmlStream.openNode("a:graphic");
112
+ if (model.isChartEx) {
113
+ xmlStream.openNode("a:graphicData", { uri: CHART_EX_URI });
114
+ xmlStream.leafNode("cx:chart", {
115
+ "xmlns:cx": CHART_EX_URI,
116
+ "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
117
+ "r:id": model.rId
118
+ });
119
+ }
120
+ else {
121
+ xmlStream.openNode("a:graphicData", {
122
+ uri: model.graphicDataUri ?? CHART_URI
123
+ });
124
+ xmlStream.leafNode("c:chart", {
125
+ "xmlns:c": "http://schemas.openxmlformats.org/drawingml/2006/chart",
126
+ "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
127
+ "r:id": model.rId
128
+ });
129
+ }
130
+ xmlStream.closeNode(); // a:graphicData
131
+ xmlStream.closeNode(); // a:graphic
132
+ xmlStream.closeNode(); // xdr:graphicFrame
133
+ }
134
+ parseOpen(node) {
135
+ // Raw XML capture mode for extLst
136
+ if (this._extLstCapture) {
137
+ const attrs = Object.entries(node.attributes || {})
138
+ .map(([k, v]) => ` ${k}="${v}"`)
139
+ .join("");
140
+ if (node.isSelfClosing) {
141
+ this._extLstCapture.parts.push(`<${node.name}${attrs}/>`);
142
+ this._extLstCapture.skipNextClose = true;
143
+ }
144
+ else {
145
+ this._extLstCapture.parts.push(`<${node.name}${attrs}>`);
146
+ this._extLstCapture.depth++;
147
+ }
148
+ return true;
149
+ }
150
+ switch (node.name) {
151
+ case this.tag:
152
+ this.reset();
153
+ this.model = {};
154
+ this._extLstCapture = null;
155
+ break;
156
+ case "xdr:cNvPr":
157
+ this._inNvPr = true;
158
+ this.model.index = parseInt(node.attributes.id, 10) || undefined;
159
+ this.model.name = node.attributes.name;
160
+ break;
161
+ case "a:extLst":
162
+ if (this._inNvPr) {
163
+ // Start capturing raw XML
164
+ const attrs = Object.entries(node.attributes || {})
165
+ .map(([k, v]) => ` ${k}="${v}"`)
166
+ .join("");
167
+ this._extLstCapture = {
168
+ depth: 1,
169
+ parts: [`<a:extLst${attrs}>`],
170
+ skipNextClose: false
171
+ };
172
+ return true;
173
+ }
174
+ break;
175
+ case "a:graphicData":
176
+ this._inGraphicData = true;
177
+ this.model.graphicDataUri = node.attributes.uri;
178
+ break;
179
+ case "c:chart":
180
+ if (this._inGraphicData) {
181
+ this.model.rId = node.attributes["r:id"];
182
+ }
183
+ break;
184
+ case "cx:chart":
185
+ if (this._inGraphicData) {
186
+ this.model.rId = node.attributes["r:id"];
187
+ this.model.isChartEx = true;
188
+ }
189
+ break;
190
+ default:
191
+ break;
192
+ }
193
+ return true;
194
+ }
195
+ parseText(text) {
196
+ if (this._extLstCapture && text) {
197
+ this._extLstCapture.parts.push(text);
198
+ }
199
+ }
200
+ parseClose(name) {
201
+ if (this._extLstCapture) {
202
+ if (this._extLstCapture.skipNextClose) {
203
+ this._extLstCapture.skipNextClose = false;
204
+ return true;
205
+ }
206
+ this._extLstCapture.parts.push(`</${name}>`);
207
+ this._extLstCapture.depth--;
208
+ if (this._extLstCapture.depth === 0) {
209
+ this.model.cNvPrExtLst = this._extLstCapture.parts.join("");
210
+ this._extLstCapture = null;
211
+ }
212
+ return true;
213
+ }
214
+ switch (name) {
215
+ case this.tag:
216
+ return false;
217
+ case "xdr:cNvPr":
218
+ this._inNvPr = false;
219
+ return true;
220
+ case "a:graphicData":
221
+ this._inGraphicData = false;
222
+ return true;
223
+ default:
224
+ return true;
225
+ }
226
+ }
227
+ }
228
+ exports.GraphicFrameXform = GraphicFrameXform;
@@ -4,6 +4,7 @@ exports.OneCellAnchorXform = void 0;
4
4
  const base_cell_anchor_xform_1 = require("./base-cell-anchor-xform.js");
5
5
  const cell_position_xform_1 = require("./cell-position-xform.js");
6
6
  const ext_xform_1 = require("./ext-xform.js");
7
+ const graphic_frame_xform_1 = require("./graphic-frame-xform.js");
7
8
  const pic_xform_1 = require("./pic-xform.js");
8
9
  const static_xform_1 = require("../static-xform.js");
9
10
  class OneCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
@@ -13,6 +14,7 @@ class OneCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
13
14
  "xdr:from": new cell_position_xform_1.CellPositionXform({ tag: "xdr:from" }),
14
15
  "xdr:ext": new ext_xform_1.ExtXform({ tag: "xdr:ext" }),
15
16
  "xdr:pic": new pic_xform_1.PicXform(),
17
+ "xdr:graphicFrame": new graphic_frame_xform_1.GraphicFrameXform(),
16
18
  "xdr:clientData": new static_xform_1.StaticXform({ tag: "xdr:clientData" })
17
19
  };
18
20
  }
@@ -20,13 +22,23 @@ class OneCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
20
22
  return "xdr:oneCellAnchor";
21
23
  }
22
24
  prepare(model, options) {
23
- this.map["xdr:pic"].prepare(model.picture, options);
25
+ if (model.picture) {
26
+ this.map["xdr:pic"].prepare(model.picture, options);
27
+ }
28
+ else if (model.graphicFrame) {
29
+ this.map["xdr:graphicFrame"].prepare(model.graphicFrame, options);
30
+ }
24
31
  }
25
32
  render(xmlStream, model) {
26
33
  xmlStream.openNode(this.tag, { editAs: model.range.editAs ?? "oneCell" });
27
34
  this.map["xdr:from"].render(xmlStream, model.range.tl);
28
35
  this.map["xdr:ext"].render(xmlStream, model.range.ext);
29
- this.map["xdr:pic"].render(xmlStream, model.picture);
36
+ if (model.picture) {
37
+ this.map["xdr:pic"].render(xmlStream, model.picture);
38
+ }
39
+ else if (model.graphicFrame) {
40
+ this.map["xdr:graphicFrame"].render(xmlStream, model.graphicFrame);
41
+ }
30
42
  this.map["xdr:clientData"].render(xmlStream, {});
31
43
  xmlStream.closeNode();
32
44
  }
@@ -42,6 +54,7 @@ class OneCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
42
54
  this.model.range.tl = this.map["xdr:from"].model;
43
55
  this.model.range.ext = this.map["xdr:ext"].model;
44
56
  this.model.picture = this.map["xdr:pic"].model;
57
+ this.model.graphicFrame = this.map["xdr:graphicFrame"].model;
45
58
  return false;
46
59
  default:
47
60
  // could be some unrecognised tags
@@ -49,7 +62,9 @@ class OneCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
49
62
  }
50
63
  }
51
64
  reconcile(model, options) {
52
- model.medium = this.reconcilePicture(model.picture, options);
65
+ if (model.picture) {
66
+ model.medium = this.reconcilePicture(model.picture, options);
67
+ }
53
68
  }
54
69
  }
55
70
  exports.OneCellAnchorXform = OneCellAnchorXform;
@@ -3,17 +3,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TwoCellAnchorXform = void 0;
4
4
  const base_cell_anchor_xform_1 = require("./base-cell-anchor-xform.js");
5
5
  const cell_position_xform_1 = require("./cell-position-xform.js");
6
+ const graphic_frame_xform_1 = require("./graphic-frame-xform.js");
6
7
  const pic_xform_1 = require("./pic-xform.js");
7
8
  const sp_xform_1 = require("./sp-xform.js");
8
9
  const static_xform_1 = require("../static-xform.js");
9
10
  class TwoCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
10
11
  constructor() {
11
12
  super();
13
+ // Parse state for the inner `<mc:AlternateContent>` block that
14
+ // chartEx drawings place in the shape slot of a `<xdr:twoCellAnchor>`.
15
+ // See `render()` for the canonical layout. When `_inFallback`
16
+ // flips on we swallow every open/close/text until the matching
17
+ // `</mc:Fallback>` — the Fallback contents are a legacy-Excel
18
+ // placeholder shape that structured consumers don't need to
19
+ // surface; `alternateContent.requires` on the model is enough
20
+ // to re-emit it verbatim on save.
21
+ this._acDepth = 0;
22
+ this._inFallback = false;
23
+ this._fallbackDepth = 0;
24
+ this._choiceRequires = undefined;
12
25
  this.map = {
13
26
  "xdr:from": new cell_position_xform_1.CellPositionXform({ tag: "xdr:from" }),
14
27
  "xdr:to": new cell_position_xform_1.CellPositionXform({ tag: "xdr:to" }),
15
28
  "xdr:pic": new pic_xform_1.PicXform(),
16
29
  "xdr:sp": new sp_xform_1.SpXform(),
30
+ "xdr:graphicFrame": new graphic_frame_xform_1.GraphicFrameXform(),
17
31
  "xdr:clientData": new static_xform_1.StaticXform({ tag: "xdr:clientData" })
18
32
  };
19
33
  }
@@ -24,40 +38,304 @@ class TwoCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
24
38
  if (model.picture) {
25
39
  this.map["xdr:pic"].prepare(model.picture, options);
26
40
  }
41
+ else if (model.graphicFrame) {
42
+ this.map["xdr:graphicFrame"].prepare(model.graphicFrame, options);
43
+ }
27
44
  }
28
45
  render(xmlStream, model) {
29
- const wrapAlternateContent = !!model.alternateContent;
30
- if (wrapAlternateContent) {
46
+ // ChartEx anchors (sunburst, treemap, funnel, waterfall, boxplot,
47
+ // histogram, region map, …) MUST be wrapped in
48
+ // `<mc:AlternateContent>`. ChartEx is a Microsoft extension that
49
+ // was never in the base OOXML spec; Excel's strict loader
50
+ // rejects a bare `<xdr:graphicFrame><cx:chart/>` anchor with
51
+ // "Removed Part: /xl/drawings/drawingN.xml (Drawing shape)".
52
+ //
53
+ // CRITICAL: Excel emits `<mc:AlternateContent>` as the SHAPE slot
54
+ // INSIDE the `<xdr:twoCellAnchor>`, between `<xdr:to>` and
55
+ // `<xdr:clientData>` — NOT around the whole anchor. The Choice
56
+ // carries the `<xdr:graphicFrame>` and the Fallback carries the
57
+ // `<xdr:sp>`; they share the single `<xdr:from>`/`<xdr:to>` of
58
+ // the outer anchor. This is how Microsoft Excel itself writes
59
+ // chartEx drawings — see `tmp/ttttt.xlsx` (Excel 2021-authored)
60
+ // for the canonical byte layout. Earlier revisions of this file
61
+ // wrapped the ENTIRE anchor in `<mc:AlternateContent>` and
62
+ // duplicated `<xdr:from>`/`<xdr:to>` in both Choice and
63
+ // Fallback. Excel's strict loader rejected that nesting even
64
+ // though MC substitution rules permit it in theory — the
65
+ // "Removed Part: drawing1.xml" repair dialog users saw on open
66
+ // was caused by this exact mis-nesting.
67
+ //
68
+ // Canonical structure:
69
+ //
70
+ // <xdr:twoCellAnchor>
71
+ // <xdr:from>…</xdr:from>
72
+ // <xdr:to>…</xdr:to>
73
+ // <mc:AlternateContent>
74
+ // <mc:Choice Requires="cx1" xmlns:cx1="…/2015/9/8/chartex">
75
+ // <xdr:graphicFrame>…<cx:chart/>…</xdr:graphicFrame>
76
+ // </mc:Choice>
77
+ // <mc:Fallback>
78
+ // <xdr:sp>…placeholder…</xdr:sp>
79
+ // </mc:Fallback>
80
+ // </mc:AlternateContent>
81
+ // <xdr:clientData/>
82
+ // </xdr:twoCellAnchor>
83
+ //
84
+ // The Fallback MUST NOT be empty — an empty fallback is spec-legal
85
+ // but Excel's validator treats an empty-choice+empty-fallback
86
+ // pair as "collapses to nothing" and drops the drawing. The
87
+ // placeholder shape we emit mirrors the "This chart isn't
88
+ // available in your version of Excel" message Office uses.
89
+ //
90
+ // The `a14`-requires branch (form-control shapes) uses the LEGACY
91
+ // wrap-the-whole-anchor form with an empty Fallback. That form
92
+ // was fine for 2010-era form controls and round-tripping code
93
+ // still depends on it; it is NOT the chartEx shape.
94
+ const requires = model.alternateContent?.requires;
95
+ const isChartEx = requires === "cx1" || requires === "cx";
96
+ const wrapAnchorInAc = !!requires && !isChartEx;
97
+ if (wrapAnchorInAc) {
98
+ // Legacy wrap-the-whole-anchor path (form controls, etc.)
31
99
  xmlStream.openNode("mc:AlternateContent", {
32
100
  "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006"
33
101
  });
34
102
  xmlStream.openNode("mc:Choice", {
35
- Requires: model.alternateContent?.requires,
36
- ...(model.alternateContent?.requires === "a14"
37
- ? {
38
- "xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main"
39
- }
103
+ Requires: requires,
104
+ ...(requires === "a14"
105
+ ? { "xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main" }
40
106
  : {})
41
107
  });
42
108
  }
43
- xmlStream.openNode(this.tag, { editAs: model.range.editAs ?? "oneCell" });
109
+ const editAs = model.range.editAs ?? (model.graphicFrame ? undefined : "oneCell");
110
+ // `editAs="twoCell"` is the default per the CT_TwoCellAnchor
111
+ // schema — Microsoft Excel omits the attribute in this case.
112
+ // Emitting it anyway is spec-valid but byte-diverges from
113
+ // Excel's own output for chartEx drawings, so suppress it when
114
+ // the effective value is the default.
115
+ const emitEditAs = editAs && editAs !== "twoCell" ? { editAs } : {};
116
+ xmlStream.openNode(this.tag, emitEditAs);
44
117
  this.map["xdr:from"].render(xmlStream, model.range.tl);
45
118
  this.map["xdr:to"].render(xmlStream, model.range.br);
46
- if (model.picture) {
119
+ if (isChartEx) {
120
+ // ChartEx: wrap the graphicFrame/shape INSIDE the anchor in
121
+ // mc:AlternateContent, matching Excel's emitted layout.
122
+ this.renderChartExAlternateContent(xmlStream, model);
123
+ }
124
+ else if (model.picture) {
47
125
  this.map["xdr:pic"].render(xmlStream, model.picture);
48
126
  }
127
+ else if (model.graphicFrame) {
128
+ this.map["xdr:graphicFrame"].render(xmlStream, model.graphicFrame);
129
+ }
49
130
  else if (model.shape) {
50
131
  this.map["xdr:sp"].render(xmlStream, model.shape);
51
132
  }
52
133
  this.map["xdr:clientData"].render(xmlStream, {});
53
- xmlStream.closeNode();
54
- if (wrapAlternateContent) {
134
+ xmlStream.closeNode(); // xdr:twoCellAnchor
135
+ if (wrapAnchorInAc) {
55
136
  xmlStream.closeNode(); // mc:Choice
56
137
  xmlStream.leafNode("mc:Fallback");
57
138
  xmlStream.closeNode(); // mc:AlternateContent
58
139
  }
59
140
  }
141
+ /**
142
+ * Emit the ChartEx `<mc:AlternateContent>` block that occupies the
143
+ * shape slot inside a `<xdr:twoCellAnchor>` — between `<xdr:to>`
144
+ * and `<xdr:clientData>`.
145
+ *
146
+ * Structure mirrors Microsoft Excel's own output:
147
+ *
148
+ * <mc:AlternateContent>
149
+ * <mc:Choice Requires="cx1" xmlns:cx1="…/2015/9/8/chartex">
150
+ * <xdr:graphicFrame>…<cx:chart/>…</xdr:graphicFrame>
151
+ * </mc:Choice>
152
+ * <mc:Fallback>
153
+ * <xdr:sp>…placeholder shape…</xdr:sp>
154
+ * </mc:Fallback>
155
+ * </mc:AlternateContent>
156
+ *
157
+ * Both the Choice graphicFrame and the Fallback shape inherit
158
+ * sizing from the outer `<xdr:from>`/`<xdr:to>` cell range — they
159
+ * do NOT each re-declare the anchor; there is only one anchor.
160
+ */
161
+ renderChartExAlternateContent(xmlStream, model) {
162
+ xmlStream.openNode("mc:AlternateContent", {
163
+ "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006"
164
+ });
165
+ xmlStream.openNode("mc:Choice", {
166
+ "xmlns:cx1": "http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",
167
+ Requires: "cx1"
168
+ });
169
+ if (model.graphicFrame) {
170
+ this.map["xdr:graphicFrame"].render(xmlStream, model.graphicFrame);
171
+ }
172
+ xmlStream.closeNode(); // mc:Choice
173
+ xmlStream.openNode("mc:Fallback");
174
+ this.renderChartExFallbackShape(xmlStream, model);
175
+ xmlStream.closeNode(); // mc:Fallback
176
+ xmlStream.closeNode(); // mc:AlternateContent
177
+ }
178
+ /**
179
+ * Emit the placeholder `<xdr:sp>` that lives inside the
180
+ * `<mc:Fallback>` of a ChartEx anchor. Legacy Excel (2010/2013)
181
+ * and non-Microsoft loaders that don't understand the `cx1`
182
+ * namespace render this in place of the `cx:chart`.
183
+ *
184
+ * Matches Microsoft Excel's convention: cNvPr id=0 / empty name
185
+ * (a deliberate placeholder, not a real drawing object), a white
186
+ * rectangle sized to the anchor's cell range, and the localizable
187
+ * "This chart isn't available" message. The shape's own xfrm
188
+ * carries concrete EMU values rather than zeros because the
189
+ * Fallback expansion is meant to be rendered standalone — a
190
+ * zero-size shape would collapse and Excel 2016+ flags that as
191
+ * "drawing shape" validation failure even though the outer
192
+ * twoCellAnchor provides sizing.
193
+ */
194
+ renderChartExFallbackShape(xmlStream, model) {
195
+ xmlStream.openNode("xdr:sp", { macro: "", textlink: "" });
196
+ xmlStream.openNode("xdr:nvSpPr");
197
+ // `id=0`, empty name — Microsoft's convention for Fallback
198
+ // placeholders. Using a real numeric id here would conflict with
199
+ // the real graphicFrame id in Choice on loaders that scan both
200
+ // branches during validation.
201
+ xmlStream.leafNode("xdr:cNvPr", { id: 0, name: "" });
202
+ xmlStream.openNode("xdr:cNvSpPr");
203
+ xmlStream.leafNode("a:spLocks", { noTextEdit: 1 });
204
+ xmlStream.closeNode(); // xdr:cNvSpPr
205
+ xmlStream.closeNode(); // xdr:nvSpPr
206
+ xmlStream.openNode("xdr:spPr");
207
+ xmlStream.openNode("a:xfrm");
208
+ // Non-zero placeholder geometry. Excel expects the fallback
209
+ // shape to have a concrete size even though the outer
210
+ // twoCellAnchor already pins its bounds to from/to. Using
211
+ // 6"×4" (5486400 × 3657600 EMU) here — the dimensions Excel
212
+ // uses in its own fallback shapes. The position (3917950,
213
+ // 698500) roughly tracks Excel's offset for the same fallback
214
+ // shape (the exact values don't matter for validation; they
215
+ // only affect legacy-client rendering).
216
+ xmlStream.leafNode("a:off", { x: 3917950, y: 698500 });
217
+ xmlStream.leafNode("a:ext", { cx: 5486400, cy: 3657600 });
218
+ xmlStream.closeNode(); // a:xfrm
219
+ xmlStream.openNode("a:prstGeom", { prst: "rect" });
220
+ xmlStream.leafNode("a:avLst");
221
+ xmlStream.closeNode(); // a:prstGeom
222
+ xmlStream.openNode("a:solidFill");
223
+ xmlStream.leafNode("a:prstClr", { val: "white" });
224
+ xmlStream.closeNode(); // a:solidFill
225
+ xmlStream.openNode("a:ln", { w: 1 });
226
+ xmlStream.openNode("a:solidFill");
227
+ xmlStream.leafNode("a:prstClr", { val: "black" });
228
+ xmlStream.closeNode(); // a:solidFill
229
+ xmlStream.closeNode(); // a:ln
230
+ xmlStream.closeNode(); // xdr:spPr
231
+ xmlStream.openNode("xdr:txBody");
232
+ xmlStream.leafNode("a:bodyPr", { vertOverflow: "clip", horzOverflow: "clip" });
233
+ xmlStream.leafNode("a:lstStyle");
234
+ xmlStream.openNode("a:p");
235
+ xmlStream.openNode("a:r");
236
+ xmlStream.leafNode("a:rPr", { lang: "en-US", sz: 1100 });
237
+ xmlStream.openNode("a:t");
238
+ xmlStream.writeText("This chart isn't available in your version of Excel.\n\n" +
239
+ "Editing this shape or saving this workbook into a different file format will permanently break the chart.");
240
+ xmlStream.closeNode(); // a:t
241
+ xmlStream.closeNode(); // a:r
242
+ xmlStream.closeNode(); // a:p
243
+ xmlStream.closeNode(); // xdr:txBody
244
+ xmlStream.closeNode(); // xdr:sp
245
+ }
246
+ parseOpen(node) {
247
+ // Swallow everything inside `<mc:Fallback>` — it is a legacy
248
+ // placeholder shape the writer regenerates verbatim.
249
+ if (this._inFallback) {
250
+ this._fallbackDepth++;
251
+ return true;
252
+ }
253
+ // Intercept the MC substitution elements. The children of
254
+ // `<mc:Choice>` (a `<xdr:graphicFrame>`, typically) should be
255
+ // parsed by the existing xforms as if the wrapper weren't there.
256
+ switch (node.name) {
257
+ case "mc:AlternateContent":
258
+ this._acDepth++;
259
+ return true;
260
+ case "mc:Choice":
261
+ if (this._acDepth > 0) {
262
+ this._choiceRequires = node.attributes?.Requires;
263
+ }
264
+ return true;
265
+ case "mc:Fallback":
266
+ if (this._acDepth > 0) {
267
+ this._inFallback = true;
268
+ this._fallbackDepth = 1;
269
+ }
270
+ return true;
271
+ default:
272
+ break;
273
+ }
274
+ if (this.parser) {
275
+ this.parser.parseOpen(node);
276
+ return true;
277
+ }
278
+ switch (node.name) {
279
+ case this.tag:
280
+ this.reset();
281
+ this.model = {
282
+ range: {
283
+ editAs: node.attributes.editAs
284
+ }
285
+ };
286
+ this._acDepth = 0;
287
+ this._inFallback = false;
288
+ this._fallbackDepth = 0;
289
+ this._choiceRequires = undefined;
290
+ break;
291
+ default:
292
+ this.parser = this.map[node.name];
293
+ if (this.parser) {
294
+ this.parser.parseOpen(node);
295
+ }
296
+ break;
297
+ }
298
+ return true;
299
+ }
300
+ parseText(text) {
301
+ if (this._inFallback) {
302
+ return;
303
+ }
304
+ if (this.parser) {
305
+ this.parser.parseText(text);
306
+ }
307
+ }
60
308
  parseClose(name) {
309
+ // Close matching against the inner `<mc:Fallback>` skip window
310
+ // first. `_fallbackDepth` tracks nested opens inside the
311
+ // fallback shape (xdr:sp → xdr:spPr → …); only when it drops
312
+ // back to zero do we exit skip mode.
313
+ if (this._inFallback) {
314
+ this._fallbackDepth--;
315
+ if (this._fallbackDepth === 0) {
316
+ this._inFallback = false;
317
+ }
318
+ return true;
319
+ }
320
+ switch (name) {
321
+ case "mc:AlternateContent":
322
+ this._acDepth--;
323
+ if (this._acDepth <= 0) {
324
+ this._acDepth = 0;
325
+ // Tag the anchor model with the Requires value so the
326
+ // writer re-emits the MC wrapper on save.
327
+ if (this._choiceRequires) {
328
+ this.model.alternateContent = { requires: this._choiceRequires };
329
+ }
330
+ this._choiceRequires = undefined;
331
+ }
332
+ return true;
333
+ case "mc:Choice":
334
+ case "mc:Fallback":
335
+ return true;
336
+ default:
337
+ break;
338
+ }
61
339
  if (this.parser) {
62
340
  if (!this.parser.parseClose(name)) {
63
341
  this.parser = undefined;
@@ -69,6 +347,7 @@ class TwoCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
69
347
  this.model.range.tl = this.map["xdr:from"].model;
70
348
  this.model.range.br = this.map["xdr:to"].model;
71
349
  this.model.picture = this.map["xdr:pic"].model;
350
+ this.model.graphicFrame = this.map["xdr:graphicFrame"].model;
72
351
  return false;
73
352
  default:
74
353
  // could be some unrecognised tags
@@ -76,7 +355,10 @@ class TwoCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
76
355
  }
77
356
  }
78
357
  reconcile(model, options) {
79
- model.medium = this.reconcilePicture(model.picture, options);
358
+ if (model.picture) {
359
+ model.medium = this.reconcilePicture(model.picture, options);
360
+ }
361
+ // graphicFrame reconciliation handled at DrawingXform level
80
362
  }
81
363
  }
82
364
  exports.TwoCellAnchorXform = TwoCellAnchorXform;