ooxml-core 0.3.0 → 0.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 (496) hide show
  1. package/NOTICE +2 -0
  2. package/README.md +15 -14
  3. package/dist/docx/embedded.cjs +23 -6
  4. package/dist/docx/embedded.mjs +23 -6
  5. package/dist/docx/index.cjs +23 -6
  6. package/dist/docx/index.mjs +23 -6
  7. package/dist/docx/load/index.cjs +34 -17
  8. package/dist/docx/load/index.mjs +34 -17
  9. package/dist/docx/parse-table.d.ts.map +1 -1
  10. package/dist/docx/write-table-properties.d.ts +3 -1
  11. package/dist/docx/write-table-properties.d.ts.map +1 -1
  12. package/dist/docx/write-table.d.ts.map +1 -1
  13. package/dist/index.cjs +2076 -14
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.mjs +2076 -15
  17. package/dist/math/index.cjs +2050 -0
  18. package/dist/math/index.d.ts +15 -0
  19. package/dist/math/index.d.ts.map +1 -0
  20. package/dist/math/index.mjs +1985 -0
  21. package/dist/math/latex-omml-siblings.d.ts +21 -0
  22. package/dist/math/latex-omml-siblings.d.ts.map +1 -0
  23. package/dist/math/latex-omml-symbols.d.ts +42 -0
  24. package/dist/math/latex-omml-symbols.d.ts.map +1 -0
  25. package/dist/math/latex-to-omml-commands.d.ts +9 -0
  26. package/dist/math/latex-to-omml-commands.d.ts.map +1 -0
  27. package/dist/math/latex-to-omml-constructs.d.ts +39 -0
  28. package/dist/math/latex-to-omml-constructs.d.ts.map +1 -0
  29. package/dist/math/latex-to-omml-environments.d.ts +28 -0
  30. package/dist/math/latex-to-omml-environments.d.ts.map +1 -0
  31. package/dist/math/latex-to-omml.d.ts +9 -0
  32. package/dist/math/latex-to-omml.d.ts.map +1 -0
  33. package/dist/math/omml-color.d.ts +11 -0
  34. package/dist/math/omml-color.d.ts.map +1 -0
  35. package/dist/math/omml-dom.d.ts +7 -0
  36. package/dist/math/omml-dom.d.ts.map +1 -0
  37. package/dist/math/omml-mathml-converters.d.ts +39 -0
  38. package/dist/math/omml-mathml-converters.d.ts.map +1 -0
  39. package/dist/math/omml-mathml-helpers.d.ts +23 -0
  40. package/dist/math/omml-mathml-helpers.d.ts.map +1 -0
  41. package/dist/math/omml-node.d.ts +7 -0
  42. package/dist/math/omml-node.d.ts.map +1 -0
  43. package/dist/math/omml-to-latex-helpers.d.ts +41 -0
  44. package/dist/math/omml-to-latex-helpers.d.ts.map +1 -0
  45. package/dist/math/omml-to-latex-layout.d.ts +18 -0
  46. package/dist/math/omml-to-latex-layout.d.ts.map +1 -0
  47. package/dist/math/omml-to-latex.d.ts +6 -0
  48. package/dist/math/omml-to-latex.d.ts.map +1 -0
  49. package/dist/math/omml-to-mathml.d.ts +21 -0
  50. package/dist/math/omml-to-mathml.d.ts.map +1 -0
  51. package/dist/opc/index.cjs +18 -1
  52. package/dist/opc/index.mjs +18 -1
  53. package/dist/opc/relationship-types.d.ts +17 -0
  54. package/dist/opc/relationship-types.d.ts.map +1 -1
  55. package/dist/pptx/cli/index.cjs +122 -105
  56. package/dist/pptx/cli/index.mjs +122 -105
  57. package/dist/pptx/index.cjs +144 -127
  58. package/dist/pptx/index.d.ts +8 -8
  59. package/dist/pptx/index.d.ts.map +1 -1
  60. package/dist/pptx/index.mjs +144 -127
  61. package/dist/visio/geometry.d.ts.map +1 -1
  62. package/dist/visio/index.cjs +66 -6
  63. package/dist/visio/index.mjs +66 -6
  64. package/dist/visio/rounded-geometry.d.ts +9 -0
  65. package/dist/visio/rounded-geometry.d.ts.map +1 -1
  66. package/dist/xlsx/address.d.ts +42 -0
  67. package/dist/xlsx/address.d.ts.map +1 -0
  68. package/dist/xlsx/cell-styles.d.ts +25 -0
  69. package/dist/xlsx/cell-styles.d.ts.map +1 -0
  70. package/dist/xlsx/cells.d.ts +25 -0
  71. package/dist/xlsx/cells.d.ts.map +1 -0
  72. package/dist/xlsx/edit/annotations.d.ts +17 -0
  73. package/dist/xlsx/edit/annotations.d.ts.map +1 -0
  74. package/dist/xlsx/edit/band-formulas.d.ts +9 -0
  75. package/dist/xlsx/edit/band-formulas.d.ts.map +1 -0
  76. package/dist/xlsx/edit/borders.d.ts +8 -0
  77. package/dist/xlsx/edit/borders.d.ts.map +1 -0
  78. package/dist/xlsx/edit/calc-mode.d.ts +11 -0
  79. package/dist/xlsx/edit/calc-mode.d.ts.map +1 -0
  80. package/dist/xlsx/edit/cell-shift.d.ts +11 -0
  81. package/dist/xlsx/edit/cell-shift.d.ts.map +1 -0
  82. package/dist/xlsx/edit/cell-style.d.ts +9 -0
  83. package/dist/xlsx/edit/cell-style.d.ts.map +1 -0
  84. package/dist/xlsx/edit/cell-values.d.ts +21 -0
  85. package/dist/xlsx/edit/cell-values.d.ts.map +1 -0
  86. package/dist/xlsx/edit/charts.d.ts +22 -0
  87. package/dist/xlsx/edit/charts.d.ts.map +1 -0
  88. package/dist/xlsx/edit/clipboard-html-parse.d.ts +12 -0
  89. package/dist/xlsx/edit/clipboard-html-parse.d.ts.map +1 -0
  90. package/dist/xlsx/edit/clipboard-html.d.ts +8 -0
  91. package/dist/xlsx/edit/clipboard-html.d.ts.map +1 -0
  92. package/dist/xlsx/edit/clipboard-text.d.ts +8 -0
  93. package/dist/xlsx/edit/clipboard-text.d.ts.map +1 -0
  94. package/dist/xlsx/edit/clipboard.d.ts +16 -0
  95. package/dist/xlsx/edit/clipboard.d.ts.map +1 -0
  96. package/dist/xlsx/edit/columns.d.ts +11 -0
  97. package/dist/xlsx/edit/columns.d.ts.map +1 -0
  98. package/dist/xlsx/edit/conditional-formats.d.ts +17 -0
  99. package/dist/xlsx/edit/conditional-formats.d.ts.map +1 -0
  100. package/dist/xlsx/edit/context.d.ts +42 -0
  101. package/dist/xlsx/edit/context.d.ts.map +1 -0
  102. package/dist/xlsx/edit/deps.d.ts +4 -0
  103. package/dist/xlsx/edit/deps.d.ts.map +1 -0
  104. package/dist/xlsx/edit/dimensions.d.ts +13 -0
  105. package/dist/xlsx/edit/dimensions.d.ts.map +1 -0
  106. package/dist/xlsx/edit/drawings.d.ts +10 -0
  107. package/dist/xlsx/edit/drawings.d.ts.map +1 -0
  108. package/dist/xlsx/edit/duplicates.d.ts +17 -0
  109. package/dist/xlsx/edit/duplicates.d.ts.map +1 -0
  110. package/dist/xlsx/edit/fill-series.d.ts +16 -0
  111. package/dist/xlsx/edit/fill-series.d.ts.map +1 -0
  112. package/dist/xlsx/edit/fill.d.ts +14 -0
  113. package/dist/xlsx/edit/fill.d.ts.map +1 -0
  114. package/dist/xlsx/edit/filter.d.ts +17 -0
  115. package/dist/xlsx/edit/filter.d.ts.map +1 -0
  116. package/dist/xlsx/edit/find.d.ts +17 -0
  117. package/dist/xlsx/edit/find.d.ts.map +1 -0
  118. package/dist/xlsx/edit/format.d.ts +13 -0
  119. package/dist/xlsx/edit/format.d.ts.map +1 -0
  120. package/dist/xlsx/edit/history.d.ts +75 -0
  121. package/dist/xlsx/edit/history.d.ts.map +1 -0
  122. package/dist/xlsx/edit/index.d.ts +23 -0
  123. package/dist/xlsx/edit/index.d.ts.map +1 -0
  124. package/dist/xlsx/edit/merge.d.ts +11 -0
  125. package/dist/xlsx/edit/merge.d.ts.map +1 -0
  126. package/dist/xlsx/edit/outline.d.ts +14 -0
  127. package/dist/xlsx/edit/outline.d.ts.map +1 -0
  128. package/dist/xlsx/edit/page.d.ts +11 -0
  129. package/dist/xlsx/edit/page.d.ts.map +1 -0
  130. package/dist/xlsx/edit/protection.d.ts +26 -0
  131. package/dist/xlsx/edit/protection.d.ts.map +1 -0
  132. package/dist/xlsx/edit/range-math.d.ts +33 -0
  133. package/dist/xlsx/edit/range-math.d.ts.map +1 -0
  134. package/dist/xlsx/edit/row-autofit.d.ts +17 -0
  135. package/dist/xlsx/edit/row-autofit.d.ts.map +1 -0
  136. package/dist/xlsx/edit/session-calc.d.ts +24 -0
  137. package/dist/xlsx/edit/session-calc.d.ts.map +1 -0
  138. package/dist/xlsx/edit/session.d.ts +5 -0
  139. package/dist/xlsx/edit/session.d.ts.map +1 -0
  140. package/dist/xlsx/edit/sheets.d.ts +19 -0
  141. package/dist/xlsx/edit/sheets.d.ts.map +1 -0
  142. package/dist/xlsx/edit/shift-formulas.d.ts +14 -0
  143. package/dist/xlsx/edit/shift-formulas.d.ts.map +1 -0
  144. package/dist/xlsx/edit/shift-sheet.d.ts +15 -0
  145. package/dist/xlsx/edit/shift-sheet.d.ts.map +1 -0
  146. package/dist/xlsx/edit/sort.d.ts +17 -0
  147. package/dist/xlsx/edit/sort.d.ts.map +1 -0
  148. package/dist/xlsx/edit/structure.d.ts +10 -0
  149. package/dist/xlsx/edit/structure.d.ts.map +1 -0
  150. package/dist/xlsx/edit/table-edits.d.ts +25 -0
  151. package/dist/xlsx/edit/table-edits.d.ts.map +1 -0
  152. package/dist/xlsx/edit/table-rows.d.ts +11 -0
  153. package/dist/xlsx/edit/table-rows.d.ts.map +1 -0
  154. package/dist/xlsx/edit/tables.d.ts +11 -0
  155. package/dist/xlsx/edit/tables.d.ts.map +1 -0
  156. package/dist/xlsx/edit/test-context.d.ts +15 -0
  157. package/dist/xlsx/edit/test-context.d.ts.map +1 -0
  158. package/dist/xlsx/edit/types-clipboard.d.ts +66 -0
  159. package/dist/xlsx/edit/types-clipboard.d.ts.map +1 -0
  160. package/dist/xlsx/edit/types.d.ts +188 -0
  161. package/dist/xlsx/edit/types.d.ts.map +1 -0
  162. package/dist/xlsx/edit/validation.d.ts +21 -0
  163. package/dist/xlsx/edit/validation.d.ts.map +1 -0
  164. package/dist/xlsx/edit/view.d.ts +12 -0
  165. package/dist/xlsx/edit/view.d.ts.map +1 -0
  166. package/dist/xlsx/formula/array-context.d.ts +7 -0
  167. package/dist/xlsx/formula/array-context.d.ts.map +1 -0
  168. package/dist/xlsx/formula/ast.d.ts +108 -0
  169. package/dist/xlsx/formula/ast.d.ts.map +1 -0
  170. package/dist/xlsx/formula/call.d.ts +13 -0
  171. package/dist/xlsx/formula/call.d.ts.map +1 -0
  172. package/dist/xlsx/formula/coerce.d.ts +22 -0
  173. package/dist/xlsx/formula/coerce.d.ts.map +1 -0
  174. package/dist/xlsx/formula/context.d.ts +74 -0
  175. package/dist/xlsx/formula/context.d.ts.map +1 -0
  176. package/dist/xlsx/formula/date-serial.d.ts +26 -0
  177. package/dist/xlsx/formula/date-serial.d.ts.map +1 -0
  178. package/dist/xlsx/formula/engine-core.d.ts +19 -0
  179. package/dist/xlsx/formula/engine-core.d.ts.map +1 -0
  180. package/dist/xlsx/formula/engine-host.d.ts +51 -0
  181. package/dist/xlsx/formula/engine-host.d.ts.map +1 -0
  182. package/dist/xlsx/formula/engine-types.d.ts +31 -0
  183. package/dist/xlsx/formula/engine-types.d.ts.map +1 -0
  184. package/dist/xlsx/formula/engine-util.d.ts +10 -0
  185. package/dist/xlsx/formula/engine-util.d.ts.map +1 -0
  186. package/dist/xlsx/formula/engine.d.ts +6 -0
  187. package/dist/xlsx/formula/engine.d.ts.map +1 -0
  188. package/dist/xlsx/formula/evaluator.d.ts +17 -0
  189. package/dist/xlsx/formula/evaluator.d.ts.map +1 -0
  190. package/dist/xlsx/formula/functions/array-shape.d.ts +3 -0
  191. package/dist/xlsx/formula/functions/array-shape.d.ts.map +1 -0
  192. package/dist/xlsx/formula/functions/array.d.ts +6 -0
  193. package/dist/xlsx/formula/functions/array.d.ts.map +1 -0
  194. package/dist/xlsx/formula/functions/criteria.d.ts +22 -0
  195. package/dist/xlsx/formula/functions/criteria.d.ts.map +1 -0
  196. package/dist/xlsx/formula/functions/date-calc.d.ts +14 -0
  197. package/dist/xlsx/formula/functions/date-calc.d.ts.map +1 -0
  198. package/dist/xlsx/formula/functions/datetime.d.ts +3 -0
  199. package/dist/xlsx/formula/functions/datetime.d.ts.map +1 -0
  200. package/dist/xlsx/formula/functions/depreciation.d.ts +4 -0
  201. package/dist/xlsx/formula/functions/depreciation.d.ts.map +1 -0
  202. package/dist/xlsx/formula/functions/dist-core.d.ts +22 -0
  203. package/dist/xlsx/formula/functions/dist-core.d.ts.map +1 -0
  204. package/dist/xlsx/formula/functions/distributions-more.d.ts +4 -0
  205. package/dist/xlsx/formula/functions/distributions-more.d.ts.map +1 -0
  206. package/dist/xlsx/formula/functions/distributions.d.ts +3 -0
  207. package/dist/xlsx/formula/functions/distributions.d.ts.map +1 -0
  208. package/dist/xlsx/formula/functions/engineering.d.ts +3 -0
  209. package/dist/xlsx/formula/functions/engineering.d.ts.map +1 -0
  210. package/dist/xlsx/formula/functions/financial-core.d.ts +8 -0
  211. package/dist/xlsx/formula/functions/financial-core.d.ts.map +1 -0
  212. package/dist/xlsx/formula/functions/financial.d.ts +3 -0
  213. package/dist/xlsx/formula/functions/financial.d.ts.map +1 -0
  214. package/dist/xlsx/formula/functions/helpers.d.ts +44 -0
  215. package/dist/xlsx/formula/functions/helpers.d.ts.map +1 -0
  216. package/dist/xlsx/formula/functions/info.d.ts +3 -0
  217. package/dist/xlsx/formula/functions/info.d.ts.map +1 -0
  218. package/dist/xlsx/formula/functions/lambda.d.ts +3 -0
  219. package/dist/xlsx/formula/functions/lambda.d.ts.map +1 -0
  220. package/dist/xlsx/formula/functions/logical.d.ts +7 -0
  221. package/dist/xlsx/formula/functions/logical.d.ts.map +1 -0
  222. package/dist/xlsx/formula/functions/lookup-core.d.ts +32 -0
  223. package/dist/xlsx/formula/functions/lookup-core.d.ts.map +1 -0
  224. package/dist/xlsx/formula/functions/lookup.d.ts +8 -0
  225. package/dist/xlsx/formula/functions/lookup.d.ts.map +1 -0
  226. package/dist/xlsx/formula/functions/math-combin.d.ts +5 -0
  227. package/dist/xlsx/formula/functions/math-combin.d.ts.map +1 -0
  228. package/dist/xlsx/formula/functions/math-more.d.ts +4 -0
  229. package/dist/xlsx/formula/functions/math-more.d.ts.map +1 -0
  230. package/dist/xlsx/formula/functions/math-sum.d.ts +6 -0
  231. package/dist/xlsx/formula/functions/math-sum.d.ts.map +1 -0
  232. package/dist/xlsx/formula/functions/math.d.ts +7 -0
  233. package/dist/xlsx/formula/functions/math.d.ts.map +1 -0
  234. package/dist/xlsx/formula/functions/matrix.d.ts +3 -0
  235. package/dist/xlsx/formula/functions/matrix.d.ts.map +1 -0
  236. package/dist/xlsx/formula/functions/reference.d.ts +3 -0
  237. package/dist/xlsx/formula/functions/reference.d.ts.map +1 -0
  238. package/dist/xlsx/formula/functions/registry.d.ts +8 -0
  239. package/dist/xlsx/formula/functions/registry.d.ts.map +1 -0
  240. package/dist/xlsx/formula/functions/statistical-count.d.ts +3 -0
  241. package/dist/xlsx/formula/functions/statistical-count.d.ts.map +1 -0
  242. package/dist/xlsx/formula/functions/statistical-more.d.ts +10 -0
  243. package/dist/xlsx/formula/functions/statistical-more.d.ts.map +1 -0
  244. package/dist/xlsx/formula/functions/statistical-shape.d.ts +4 -0
  245. package/dist/xlsx/formula/functions/statistical-shape.d.ts.map +1 -0
  246. package/dist/xlsx/formula/functions/statistical-spread.d.ts +4 -0
  247. package/dist/xlsx/formula/functions/statistical-spread.d.ts.map +1 -0
  248. package/dist/xlsx/formula/functions/statistical.d.ts +3 -0
  249. package/dist/xlsx/formula/functions/statistical.d.ts.map +1 -0
  250. package/dist/xlsx/formula/functions/stats-core.d.ts +30 -0
  251. package/dist/xlsx/formula/functions/stats-core.d.ts.map +1 -0
  252. package/dist/xlsx/formula/functions/text-convert.d.ts +4 -0
  253. package/dist/xlsx/formula/functions/text-convert.d.ts.map +1 -0
  254. package/dist/xlsx/formula/functions/text-extra.d.ts +3 -0
  255. package/dist/xlsx/formula/functions/text-extra.d.ts.map +1 -0
  256. package/dist/xlsx/formula/functions/text.d.ts +3 -0
  257. package/dist/xlsx/formula/functions/text.d.ts.map +1 -0
  258. package/dist/xlsx/formula/functions/types.d.ts +30 -0
  259. package/dist/xlsx/formula/functions/types.d.ts.map +1 -0
  260. package/dist/xlsx/formula/functions/workdays.d.ts +3 -0
  261. package/dist/xlsx/formula/functions/workdays.d.ts.map +1 -0
  262. package/dist/xlsx/formula/graph.d.ts +50 -0
  263. package/dist/xlsx/formula/graph.d.ts.map +1 -0
  264. package/dist/xlsx/formula/index.d.ts +14 -0
  265. package/dist/xlsx/formula/index.d.ts.map +1 -0
  266. package/dist/xlsx/formula/lexemes.d.ts +41 -0
  267. package/dist/xlsx/formula/lexemes.d.ts.map +1 -0
  268. package/dist/xlsx/formula/move.d.ts +23 -0
  269. package/dist/xlsx/formula/move.d.ts.map +1 -0
  270. package/dist/xlsx/formula/operators.d.ts +15 -0
  271. package/dist/xlsx/formula/operators.d.ts.map +1 -0
  272. package/dist/xlsx/formula/parser.d.ts +4 -0
  273. package/dist/xlsx/formula/parser.d.ts.map +1 -0
  274. package/dist/xlsx/formula/references.d.ts +36 -0
  275. package/dist/xlsx/formula/references.d.ts.map +1 -0
  276. package/dist/xlsx/formula/scc.d.ts +6 -0
  277. package/dist/xlsx/formula/scc.d.ts.map +1 -0
  278. package/dist/xlsx/formula/sheet-scan.d.ts +10 -0
  279. package/dist/xlsx/formula/sheet-scan.d.ts.map +1 -0
  280. package/dist/xlsx/formula/spill.d.ts +32 -0
  281. package/dist/xlsx/formula/spill.d.ts.map +1 -0
  282. package/dist/xlsx/formula/store.d.ts +10 -0
  283. package/dist/xlsx/formula/store.d.ts.map +1 -0
  284. package/dist/xlsx/formula/structured-to-a1.d.ts +18 -0
  285. package/dist/xlsx/formula/structured-to-a1.d.ts.map +1 -0
  286. package/dist/xlsx/formula/structured.d.ts +4 -0
  287. package/dist/xlsx/formula/structured.d.ts.map +1 -0
  288. package/dist/xlsx/formula/table-refs.d.ts +7 -0
  289. package/dist/xlsx/formula/table-refs.d.ts.map +1 -0
  290. package/dist/xlsx/formula/test-helpers.d.ts +32 -0
  291. package/dist/xlsx/formula/test-helpers.d.ts.map +1 -0
  292. package/dist/xlsx/formula/text-number.d.ts +11 -0
  293. package/dist/xlsx/formula/text-number.d.ts.map +1 -0
  294. package/dist/xlsx/formula/tokenizer.d.ts +21 -0
  295. package/dist/xlsx/formula/tokenizer.d.ts.map +1 -0
  296. package/dist/xlsx/formula/transform.d.ts +49 -0
  297. package/dist/xlsx/formula/transform.d.ts.map +1 -0
  298. package/dist/xlsx/formula/values.d.ts +63 -0
  299. package/dist/xlsx/formula/values.d.ts.map +1 -0
  300. package/dist/xlsx/index.cjs +20579 -0
  301. package/dist/xlsx/index.d.ts +14 -0
  302. package/dist/xlsx/index.d.ts.map +1 -0
  303. package/dist/xlsx/index.mjs +20396 -0
  304. package/dist/xlsx/layout/autofit.d.ts +12 -0
  305. package/dist/xlsx/layout/autofit.d.ts.map +1 -0
  306. package/dist/xlsx/layout/axis-metrics.d.ts +39 -0
  307. package/dist/xlsx/layout/axis-metrics.d.ts.map +1 -0
  308. package/dist/xlsx/layout/cell-view.d.ts +21 -0
  309. package/dist/xlsx/layout/cell-view.d.ts.map +1 -0
  310. package/dist/xlsx/layout/cf-evaluator.d.ts +26 -0
  311. package/dist/xlsx/layout/cf-evaluator.d.ts.map +1 -0
  312. package/dist/xlsx/layout/cf-helpers.d.ts +8 -0
  313. package/dist/xlsx/layout/cf-helpers.d.ts.map +1 -0
  314. package/dist/xlsx/layout/cf-values.d.ts +25 -0
  315. package/dist/xlsx/layout/cf-values.d.ts.map +1 -0
  316. package/dist/xlsx/layout/chart-colors.d.ts +6 -0
  317. package/dist/xlsx/layout/chart-colors.d.ts.map +1 -0
  318. package/dist/xlsx/layout/chart-scale.d.ts +25 -0
  319. package/dist/xlsx/layout/chart-scale.d.ts.map +1 -0
  320. package/dist/xlsx/layout/chart-svg-cartesian.d.ts +5 -0
  321. package/dist/xlsx/layout/chart-svg-cartesian.d.ts.map +1 -0
  322. package/dist/xlsx/layout/chart-svg-radial.d.ts +7 -0
  323. package/dist/xlsx/layout/chart-svg-radial.d.ts.map +1 -0
  324. package/dist/xlsx/layout/chart-svg-util.d.ts +29 -0
  325. package/dist/xlsx/layout/chart-svg-util.d.ts.map +1 -0
  326. package/dist/xlsx/layout/chart-svg.d.ts +7 -0
  327. package/dist/xlsx/layout/chart-svg.d.ts.map +1 -0
  328. package/dist/xlsx/layout/chart-view.d.ts +42 -0
  329. package/dist/xlsx/layout/chart-view.d.ts.map +1 -0
  330. package/dist/xlsx/layout/colors.d.ts +20 -0
  331. package/dist/xlsx/layout/colors.d.ts.map +1 -0
  332. package/dist/xlsx/layout/index.d.ts +21 -0
  333. package/dist/xlsx/layout/index.d.ts.map +1 -0
  334. package/dist/xlsx/layout/metrics.d.ts +41 -0
  335. package/dist/xlsx/layout/metrics.d.ts.map +1 -0
  336. package/dist/xlsx/layout/navigate.d.ts +6 -0
  337. package/dist/xlsx/layout/navigate.d.ts.map +1 -0
  338. package/dist/xlsx/layout/ref-evaluator.d.ts +16 -0
  339. package/dist/xlsx/layout/ref-evaluator.d.ts.map +1 -0
  340. package/dist/xlsx/layout/row-autofit.d.ts +17 -0
  341. package/dist/xlsx/layout/row-autofit.d.ts.map +1 -0
  342. package/dist/xlsx/layout/sheet-queries.d.ts +37 -0
  343. package/dist/xlsx/layout/sheet-queries.d.ts.map +1 -0
  344. package/dist/xlsx/layout/style-view.d.ts +18 -0
  345. package/dist/xlsx/layout/style-view.d.ts.map +1 -0
  346. package/dist/xlsx/layout/tint.d.ts +26 -0
  347. package/dist/xlsx/layout/tint.d.ts.map +1 -0
  348. package/dist/xlsx/layout/types.d.ts +106 -0
  349. package/dist/xlsx/layout/types.d.ts.map +1 -0
  350. package/dist/xlsx/layout/units.d.ts +37 -0
  351. package/dist/xlsx/layout/units.d.ts.map +1 -0
  352. package/dist/xlsx/layout/viewport.d.ts +27 -0
  353. package/dist/xlsx/layout/viewport.d.ts.map +1 -0
  354. package/dist/xlsx/load/csv.d.ts +29 -0
  355. package/dist/xlsx/load/csv.d.ts.map +1 -0
  356. package/dist/xlsx/load/detect.d.ts +22 -0
  357. package/dist/xlsx/load/detect.d.ts.map +1 -0
  358. package/dist/xlsx/load/index.cjs +15619 -0
  359. package/dist/xlsx/load/index.d.ts +4 -0
  360. package/dist/xlsx/load/index.d.ts.map +1 -0
  361. package/dist/xlsx/load/index.mjs +15603 -0
  362. package/dist/xlsx/load/legacy-xls-sheet.d.ts +14 -0
  363. package/dist/xlsx/load/legacy-xls-sheet.d.ts.map +1 -0
  364. package/dist/xlsx/load/legacy-xls-styles.d.ts +9 -0
  365. package/dist/xlsx/load/legacy-xls-styles.d.ts.map +1 -0
  366. package/dist/xlsx/load/legacy-xls.d.ts +10 -0
  367. package/dist/xlsx/load/legacy-xls.d.ts.map +1 -0
  368. package/dist/xlsx/model.d.ts +535 -0
  369. package/dist/xlsx/model.d.ts.map +1 -0
  370. package/dist/xlsx/numfmt/builtins.d.ts +15 -0
  371. package/dist/xlsx/numfmt/builtins.d.ts.map +1 -0
  372. package/dist/xlsx/numfmt/compile.d.ts +26 -0
  373. package/dist/xlsx/numfmt/compile.d.ts.map +1 -0
  374. package/dist/xlsx/numfmt/date.d.ts +34 -0
  375. package/dist/xlsx/numfmt/date.d.ts.map +1 -0
  376. package/dist/xlsx/numfmt/decimal.d.ts +27 -0
  377. package/dist/xlsx/numfmt/decimal.d.ts.map +1 -0
  378. package/dist/xlsx/numfmt/decimals.d.ts +10 -0
  379. package/dist/xlsx/numfmt/decimals.d.ts.map +1 -0
  380. package/dist/xlsx/numfmt/format.d.ts +13 -0
  381. package/dist/xlsx/numfmt/format.d.ts.map +1 -0
  382. package/dist/xlsx/numfmt/fraction.d.ts +38 -0
  383. package/dist/xlsx/numfmt/fraction.d.ts.map +1 -0
  384. package/dist/xlsx/numfmt/general.d.ts +8 -0
  385. package/dist/xlsx/numfmt/general.d.ts.map +1 -0
  386. package/dist/xlsx/numfmt/index.d.ts +8 -0
  387. package/dist/xlsx/numfmt/index.d.ts.map +1 -0
  388. package/dist/xlsx/numfmt/input-date.d.ts +16 -0
  389. package/dist/xlsx/numfmt/input-date.d.ts.map +1 -0
  390. package/dist/xlsx/numfmt/input.d.ts +23 -0
  391. package/dist/xlsx/numfmt/input.d.ts.map +1 -0
  392. package/dist/xlsx/numfmt/number.d.ts +38 -0
  393. package/dist/xlsx/numfmt/number.d.ts.map +1 -0
  394. package/dist/xlsx/numfmt/tokenizer.d.ts +6 -0
  395. package/dist/xlsx/numfmt/tokenizer.d.ts.map +1 -0
  396. package/dist/xlsx/numfmt/types.d.ts +87 -0
  397. package/dist/xlsx/numfmt/types.d.ts.map +1 -0
  398. package/dist/xlsx/read/builtin-formats.d.ts +10 -0
  399. package/dist/xlsx/read/builtin-formats.d.ts.map +1 -0
  400. package/dist/xlsx/read/chart.d.ts +7 -0
  401. package/dist/xlsx/read/chart.d.ts.map +1 -0
  402. package/dist/xlsx/read/comments.d.ts +10 -0
  403. package/dist/xlsx/read/comments.d.ts.map +1 -0
  404. package/dist/xlsx/read/conditional.d.ts +6 -0
  405. package/dist/xlsx/read/conditional.d.ts.map +1 -0
  406. package/dist/xlsx/read/dates.d.ts +6 -0
  407. package/dist/xlsx/read/dates.d.ts.map +1 -0
  408. package/dist/xlsx/read/drawing.d.ts +10 -0
  409. package/dist/xlsx/read/drawing.d.ts.map +1 -0
  410. package/dist/xlsx/read/formula-storage.d.ts +5 -0
  411. package/dist/xlsx/read/formula-storage.d.ts.map +1 -0
  412. package/dist/xlsx/read/formula-text.d.ts +15 -0
  413. package/dist/xlsx/read/formula-text.d.ts.map +1 -0
  414. package/dist/xlsx/read/index.d.ts +3 -0
  415. package/dist/xlsx/read/index.d.ts.map +1 -0
  416. package/dist/xlsx/read/load.d.ts +7 -0
  417. package/dist/xlsx/read/load.d.ts.map +1 -0
  418. package/dist/xlsx/read/metadata.d.ts +8 -0
  419. package/dist/xlsx/read/metadata.d.ts.map +1 -0
  420. package/dist/xlsx/read/package.d.ts +60 -0
  421. package/dist/xlsx/read/package.d.ts.map +1 -0
  422. package/dist/xlsx/read/print-options.d.ts +7 -0
  423. package/dist/xlsx/read/print-options.d.ts.map +1 -0
  424. package/dist/xlsx/read/shared-strings.d.ts +13 -0
  425. package/dist/xlsx/read/shared-strings.d.ts.map +1 -0
  426. package/dist/xlsx/read/sheet-data.d.ts +15 -0
  427. package/dist/xlsx/read/sheet-data.d.ts.map +1 -0
  428. package/dist/xlsx/read/sheet-props.d.ts +21 -0
  429. package/dist/xlsx/read/sheet-props.d.ts.map +1 -0
  430. package/dist/xlsx/read/style-parts.d.ts +20 -0
  431. package/dist/xlsx/read/style-parts.d.ts.map +1 -0
  432. package/dist/xlsx/read/styles.d.ts +17 -0
  433. package/dist/xlsx/read/styles.d.ts.map +1 -0
  434. package/dist/xlsx/read/tables.d.ts +4 -0
  435. package/dist/xlsx/read/tables.d.ts.map +1 -0
  436. package/dist/xlsx/read/theme.d.ts +11 -0
  437. package/dist/xlsx/read/theme.d.ts.map +1 -0
  438. package/dist/xlsx/read/workbook-part.d.ts +23 -0
  439. package/dist/xlsx/read/workbook-part.d.ts.map +1 -0
  440. package/dist/xlsx/read/worksheet.d.ts +18 -0
  441. package/dist/xlsx/read/worksheet.d.ts.map +1 -0
  442. package/dist/xlsx/read/xml-util.d.ts +28 -0
  443. package/dist/xlsx/read/xml-util.d.ts.map +1 -0
  444. package/dist/xlsx/styles.d.ts +27 -0
  445. package/dist/xlsx/styles.d.ts.map +1 -0
  446. package/dist/xlsx/time-period.d.ts +9 -0
  447. package/dist/xlsx/time-period.d.ts.map +1 -0
  448. package/dist/xlsx/workbook.d.ts +26 -0
  449. package/dist/xlsx/workbook.d.ts.map +1 -0
  450. package/dist/xlsx/write/chart-patch.d.ts +9 -0
  451. package/dist/xlsx/write/chart-patch.d.ts.map +1 -0
  452. package/dist/xlsx/write/chart.d.ts +9 -0
  453. package/dist/xlsx/write/chart.d.ts.map +1 -0
  454. package/dist/xlsx/write/comments.d.ts +23 -0
  455. package/dist/xlsx/write/comments.d.ts.map +1 -0
  456. package/dist/xlsx/write/conditional.d.ts +5 -0
  457. package/dist/xlsx/write/conditional.d.ts.map +1 -0
  458. package/dist/xlsx/write/drawing.d.ts +10 -0
  459. package/dist/xlsx/write/drawing.d.ts.map +1 -0
  460. package/dist/xlsx/write/dynamic-array.d.ts +16 -0
  461. package/dist/xlsx/write/dynamic-array.d.ts.map +1 -0
  462. package/dist/xlsx/write/index.d.ts +2 -0
  463. package/dist/xlsx/write/index.d.ts.map +1 -0
  464. package/dist/xlsx/write/package-writer.d.ts +31 -0
  465. package/dist/xlsx/write/package-writer.d.ts.map +1 -0
  466. package/dist/xlsx/write/save.d.ts +8 -0
  467. package/dist/xlsx/write/save.d.ts.map +1 -0
  468. package/dist/xlsx/write/shared-strings.d.ts +13 -0
  469. package/dist/xlsx/write/shared-strings.d.ts.map +1 -0
  470. package/dist/xlsx/write/sheet-data.d.ts +19 -0
  471. package/dist/xlsx/write/sheet-data.d.ts.map +1 -0
  472. package/dist/xlsx/write/sheet-parts.d.ts +34 -0
  473. package/dist/xlsx/write/sheet-parts.d.ts.map +1 -0
  474. package/dist/xlsx/write/sheet-props.d.ts +16 -0
  475. package/dist/xlsx/write/sheet-props.d.ts.map +1 -0
  476. package/dist/xlsx/write/snapshot.d.ts +9 -0
  477. package/dist/xlsx/write/snapshot.d.ts.map +1 -0
  478. package/dist/xlsx/write/style-xml.d.ts +13 -0
  479. package/dist/xlsx/write/style-xml.d.ts.map +1 -0
  480. package/dist/xlsx/write/styles.d.ts +24 -0
  481. package/dist/xlsx/write/styles.d.ts.map +1 -0
  482. package/dist/xlsx/write/tables.d.ts +18 -0
  483. package/dist/xlsx/write/tables.d.ts.map +1 -0
  484. package/dist/xlsx/write/theme.d.ts +9 -0
  485. package/dist/xlsx/write/theme.d.ts.map +1 -0
  486. package/dist/xlsx/write/workbook-part.d.ts +16 -0
  487. package/dist/xlsx/write/workbook-part.d.ts.map +1 -0
  488. package/dist/xlsx/write/worksheet.d.ts +6 -0
  489. package/dist/xlsx/write/worksheet.d.ts.map +1 -0
  490. package/dist/xlsx/write/xml-out.d.ts +25 -0
  491. package/dist/xlsx/write/xml-out.d.ts.map +1 -0
  492. package/dist/xml/index.cjs +16 -0
  493. package/dist/xml/index.mjs +16 -0
  494. package/dist/xml/namespaces.d.ts +16 -0
  495. package/dist/xml/namespaces.d.ts.map +1 -1
  496. package/package.json +21 -3
package/NOTICE CHANGED
@@ -1,3 +1,5 @@
1
1
  ooxml-core contains modern OOXML modules extracted from ChristopherVR/docx-viewer and ChristopherVR/pptx-viewer, Copyright ChristopherVR, licensed under the Apache License, Version 2.0. The Apache License text is included in LICENSE. PROVENANCE.md records where each module came from.
2
2
 
3
3
  The pptx area also contains PowerPoint glyph-advance measurements (font-advance-widths*.generated.ts: numeric widths measured through COM automation; no font software is included). Third-party runtime dependencies are listed in THIRD-PARTY-LICENSES.
4
+
5
+ The math area includes Apache-2.0 equation conversion modules extracted from ChristopherVR/pptx-viewer. Their source paths and modifications are recorded in PROVENANCE.md.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # ooxml-core
4
4
 
5
5
  **Read, edit, validate and write Office Open XML documents in TypeScript.**
6
- One package, one XML model, every format: Word, PowerPoint and the shared building blocks beneath them. Spreadsheets, Visio and more are planned.
6
+ One package, one XML model, every format: Word, PowerPoint, Excel and the shared building blocks beneath them. Visio and more are planned.
7
7
 
8
8
  [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
9
9
  [![CI](https://github.com/ChristopherVR/ooxml/actions/workflows/ci.yml/badge.svg)](https://github.com/ChristopherVR/ooxml/actions/workflows/ci.yml)
@@ -28,24 +28,25 @@ One package, one XML model, every format: Word, PowerPoint and the shared buildi
28
28
 
29
29
  ## One package, many areas
30
30
 
31
- `ooxml-core` is a **single published package**. Every area is a subpath import, so you only load what you use, and the formats are symmetrical: `docx` and `pptx` are each imported through their own subpaths, and the root entry groups only the shared building blocks by namespace.
31
+ `ooxml-core` is a **single published package**. Every area is a subpath import, so you only load what you use, and the formats are symmetrical: `docx`, `pptx` and `xlsx` are each imported through their own subpaths, and the root entry groups only the shared building blocks by namespace.
32
32
 
33
33
  ```ts
34
34
  import { parseXml } from 'ooxml-core/xml'; // one area
35
35
  import { xml, opc } from 'ooxml-core'; // or by namespace (shared building blocks)
36
36
  ```
37
37
 
38
- | Area | What it is |
39
- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
- | `xml` | The shared XML model: strict DOM parsing and serialization, namespaces, namespace-aware helpers. |
41
- | `opc` | Open Packaging Conventions: relationships, content types, part paths, zip helpers, safe hyperlinks. |
42
- | `units` | Branded EMU, twip and point types, constants and conversions. |
43
- | `color` | Hex, RGB, HSL and linear colour primitives, OOXML percent and angle parsing. |
44
- | `geometry` | DrawingML preset shapes, connection sites, clip paths, callouts and boolean shape operations. |
45
- | `diagram` | SmartArt (DiagramML), format-neutral: data model, layout/colour/quick-style parts, the cached `dsp:drawing` shape tree, relationship resolution and a loader. Used by `docx`; `pptx` re-imports its parsers. |
46
- | `collab` | Format-neutral real-time collaboration on Yjs: session and provider lifecycle, awareness/presence, transport-neutral sync (WebSocket, in-memory, any byte channel), update codecs, ordering helpers, asset sync and the product adapter seam. See `docs/collab-area.md`. |
47
- | `docx` | WordprocessingML: model, parser, preserving serializer, editing, validation. Also `/docx/embedded`. `/docx/layout` is the DOM-free pagination engine (an approximation of Word, not parity) and `/docx/load` detects and loads DOCX and legacy .doc (ole2 inlined). |
48
- | `pptx` | PresentationML: model, parser, serializer, editing, charts, SmartArt, converters, CLI, signatures. Subpaths `/pptx/converter`, `/pptx/cli`, `/pptx/signature-node`. |
38
+ | Area | What it is |
39
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
40
+ | `xml` | The shared XML model: strict DOM parsing and serialization, namespaces, namespace-aware helpers. |
41
+ | `opc` | Open Packaging Conventions: relationships, content types, part paths, zip helpers, safe hyperlinks. |
42
+ | `units` | Branded EMU, twip and point types, constants and conversions. |
43
+ | `color` | Hex, RGB, HSL and linear colour primitives, OOXML percent and angle parsing. |
44
+ | `geometry` | DrawingML preset shapes, connection sites, clip paths, callouts and boolean shape operations. |
45
+ | `diagram` | SmartArt (DiagramML), format-neutral: data model, layout/colour/quick-style parts, the cached `dsp:drawing` shape tree, relationship resolution and a loader. Used by `docx`; `pptx` re-imports its parsers. |
46
+ | `collab` | Format-neutral real-time collaboration on Yjs: session and provider lifecycle, awareness/presence, transport-neutral sync (WebSocket, in-memory, any byte channel), update codecs, ordering helpers, asset sync and the product adapter seam. See `docs/collab-area.md`. |
47
+ | `docx` | WordprocessingML: model, parser, preserving serializer, editing, validation. Also `/docx/embedded`. `/docx/layout` is the DOM-free pagination engine (an approximation of Word, not parity) and `/docx/load` detects and loads DOCX and legacy .doc (ole2 inlined). |
48
+ | `pptx` | PresentationML: model, parser, serializer, editing, charts, SmartArt, converters, CLI, signatures. Subpaths `/pptx/converter`, `/pptx/cli`, `/pptx/signature-node`. |
49
+ | `xlsx` | SpreadsheetML: workbook model, `.xlsx`/`.xlsm` reader and preserving writer, formula engine (dependency graph, dynamic arrays, 380+ functions), Excel number formats, editing commands with undo, and the DOM-free grid layout (sizes, colours, conditional formats, charts as SVG). `/xlsx/load` detects and loads `.xlsx`, `.xlsm`, legacy `.xls` (ole2 inlined) and CSV. An approximation of Excel, not parity. |
49
50
 
50
51
  Legacy binary formats (`.doc`, `.xls`, `.ppt`) and the compound-file container live in the sibling package [`ole2`](https://github.com/ChristopherVR/ole2); this package never contains binary codecs, and `ole2` never contains modern OOXML.
51
52
 
@@ -96,7 +97,7 @@ const part = resolvePartPath('word/document.xml', rels.get('rId5')!.target);
96
97
  The shared areas come first, then more formats on the same foundation:
97
98
 
98
99
  - **Shared layers:** DrawingML (fills, lines, effects, text, theme), charts, diagrams (SmartArt), maths, encryption primitives and schema-generated types, each as an area, written once for every format.
99
- - **More formats:** `xlsx` (SpreadsheetML), Visio (`.vsdx`, also an OPC package), and further Office Open XML parts as they are needed. Each arrives as its own area.
100
+ - **More formats:** Visio (`.vsdx`, also an OPC package), and further Office Open XML parts as they are needed. Each arrives as its own area.
100
101
  - **One XML model:** the `pptx` area still uses its own XML object model and is compiled with relaxed TypeScript flags while it is migrated onto the shared `xml` area and tightened. New code is strict.
101
102
  - **Collaboration:** the Yjs and sync protocol that the viewers share will live here as a `collab` area.
102
103
 
@@ -1788,6 +1788,23 @@ function patchCellBorders(doc, tc, next, base) {
1788
1788
  orderChildren(props, CELL_ORDER);
1789
1789
  if (!Array.from(props.childNodes).some((node) => node.nodeType === 1)) tc.removeChild(props);
1790
1790
  }
1791
+ function patchCellShading(doc, tc, next, base) {
1792
+ if (next.shadingFill === base?.shadingFill && JSON.stringify(next.shadingThemeFill) === JSON.stringify(base?.shadingThemeFill))
1793
+ return;
1794
+ if (next.shadingFill && next.shadingFill !== "auto" && !/^#?[0-9a-f]{6}$/i.test(next.shadingFill))
1795
+ throw new Error("Cell shading must be a six-digit RGB color or auto.");
1796
+ let props = first2(tc, "tcPr");
1797
+ if (!props) {
1798
+ props = makeW(doc, "tcPr");
1799
+ tc.insertBefore(props, tc.firstChild);
1800
+ }
1801
+ for (const old of children2(props, "shd")) props.removeChild(old);
1802
+ const built = buildCellProperties(doc, next);
1803
+ const replacement = built && first2(built, "shd");
1804
+ if (replacement) props.appendChild(replacement);
1805
+ orderChildren(props, CELL_ORDER);
1806
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1)) tc.removeChild(props);
1807
+ }
1791
1808
 
1792
1809
  // src/docx/write-table.ts
1793
1810
  function canEditTableStructure(table) {
@@ -1836,8 +1853,6 @@ var CELL_DESCRIPTOR_KEYS = [
1836
1853
  "verticalMerge",
1837
1854
  "widthTwips",
1838
1855
  "verticalAlign",
1839
- "shadingFill",
1840
- "shadingThemeFill",
1841
1856
  "margins"
1842
1857
  ];
1843
1858
  function pick(source, keys) {
@@ -1865,7 +1880,7 @@ function assertNoDescriptorEdits(table, base) {
1865
1880
  if (!source) continue;
1866
1881
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
1867
1882
  throw new Error(
1868
- "Cannot edit table cell width, merge, vertical alignment, shading, or margins on an existing cell; only cell text and borders are supported. The original DOCX package remains unchanged."
1883
+ "Cannot edit table cell width, merge, vertical alignment, or margins on an existing cell; only cell text, borders and shading are supported. The original DOCX package remains unchanged."
1869
1884
  );
1870
1885
  }
1871
1886
  }
@@ -1934,6 +1949,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
1934
1949
  throw new Error("Moving paragraphs between table cells is not supported.");
1935
1950
  const tc = source?.cell ?? makeW(doc, "tc");
1936
1951
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
1952
+ patchCellShading(doc, tc, cell, source?.model);
1937
1953
  const oldParagraphs = children2(tc, "p");
1938
1954
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
1939
1955
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -6553,14 +6569,14 @@ function parseCell(cell, parseParagraph3, id) {
6553
6569
  const vMerge = first2(props, "vMerge");
6554
6570
  if (vMerge) result.verticalMerge = getW(vMerge, "val") === "restart" ? "restart" : "continue";
6555
6571
  const tcW = first2(props, "tcW");
6556
- if (getW(tcW, "type") !== "nil") {
6572
+ if ((getW(tcW, "type") ?? "dxa") === "dxa") {
6557
6573
  const width = dxa(getW(tcW, "w"));
6558
6574
  if (width !== void 0) result.widthTwips = width;
6559
6575
  }
6560
6576
  const vAlign = enumValue(isStVerticalJc, getW(first2(props, "vAlign"), "val"), "w:tcPr/w:vAlign");
6561
6577
  if (vAlign) result.verticalAlign = vAlign;
6562
6578
  const shd = first2(props, "shd");
6563
- const fill = parseShadingFill(shd);
6579
+ const fill = parseShadingFill(shd) ?? (getW(shd, "fill") === "auto" && !getW(shd, "themeFill") ? "auto" : void 0);
6564
6580
  if (fill) result.shadingFill = fill;
6565
6581
  const themeFill = parseShadingThemeFill(shd);
6566
6582
  if (themeFill) result.shadingThemeFill = themeFill;
@@ -6629,7 +6645,8 @@ function parseTable(node, id, parseParagraph3) {
6629
6645
  }) : [];
6630
6646
  if (grid.length) table.grid = grid;
6631
6647
  const tblPr = first2(node, "tblPr");
6632
- const width = dxa(getW(first2(tblPr, "tblW"), "w"));
6648
+ const tableWidth = first2(tblPr, "tblW");
6649
+ const width = (getW(tableWidth, "type") ?? "dxa") === "dxa" ? dxa(getW(tableWidth, "w")) : void 0;
6633
6650
  if (width !== void 0) table.widthTwips = width;
6634
6651
  const justification = enumValue(isStJcTable, getW(first2(tblPr, "jc"), "val"), "w:tblPr/w:jc");
6635
6652
  if (justification) {
@@ -1782,6 +1782,23 @@ function patchCellBorders(doc, tc, next, base) {
1782
1782
  orderChildren(props, CELL_ORDER);
1783
1783
  if (!Array.from(props.childNodes).some((node) => node.nodeType === 1)) tc.removeChild(props);
1784
1784
  }
1785
+ function patchCellShading(doc, tc, next, base) {
1786
+ if (next.shadingFill === base?.shadingFill && JSON.stringify(next.shadingThemeFill) === JSON.stringify(base?.shadingThemeFill))
1787
+ return;
1788
+ if (next.shadingFill && next.shadingFill !== "auto" && !/^#?[0-9a-f]{6}$/i.test(next.shadingFill))
1789
+ throw new Error("Cell shading must be a six-digit RGB color or auto.");
1790
+ let props = first2(tc, "tcPr");
1791
+ if (!props) {
1792
+ props = makeW(doc, "tcPr");
1793
+ tc.insertBefore(props, tc.firstChild);
1794
+ }
1795
+ for (const old of children2(props, "shd")) props.removeChild(old);
1796
+ const built = buildCellProperties(doc, next);
1797
+ const replacement = built && first2(built, "shd");
1798
+ if (replacement) props.appendChild(replacement);
1799
+ orderChildren(props, CELL_ORDER);
1800
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1)) tc.removeChild(props);
1801
+ }
1785
1802
 
1786
1803
  // src/docx/write-table.ts
1787
1804
  function canEditTableStructure(table) {
@@ -1830,8 +1847,6 @@ var CELL_DESCRIPTOR_KEYS = [
1830
1847
  "verticalMerge",
1831
1848
  "widthTwips",
1832
1849
  "verticalAlign",
1833
- "shadingFill",
1834
- "shadingThemeFill",
1835
1850
  "margins"
1836
1851
  ];
1837
1852
  function pick(source, keys) {
@@ -1859,7 +1874,7 @@ function assertNoDescriptorEdits(table, base) {
1859
1874
  if (!source) continue;
1860
1875
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
1861
1876
  throw new Error(
1862
- "Cannot edit table cell width, merge, vertical alignment, shading, or margins on an existing cell; only cell text and borders are supported. The original DOCX package remains unchanged."
1877
+ "Cannot edit table cell width, merge, vertical alignment, or margins on an existing cell; only cell text, borders and shading are supported. The original DOCX package remains unchanged."
1863
1878
  );
1864
1879
  }
1865
1880
  }
@@ -1928,6 +1943,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
1928
1943
  throw new Error("Moving paragraphs between table cells is not supported.");
1929
1944
  const tc = source?.cell ?? makeW(doc, "tc");
1930
1945
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
1946
+ patchCellShading(doc, tc, cell, source?.model);
1931
1947
  const oldParagraphs = children2(tc, "p");
1932
1948
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
1933
1949
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -6547,14 +6563,14 @@ function parseCell(cell, parseParagraph3, id) {
6547
6563
  const vMerge = first2(props, "vMerge");
6548
6564
  if (vMerge) result.verticalMerge = getW(vMerge, "val") === "restart" ? "restart" : "continue";
6549
6565
  const tcW = first2(props, "tcW");
6550
- if (getW(tcW, "type") !== "nil") {
6566
+ if ((getW(tcW, "type") ?? "dxa") === "dxa") {
6551
6567
  const width = dxa(getW(tcW, "w"));
6552
6568
  if (width !== void 0) result.widthTwips = width;
6553
6569
  }
6554
6570
  const vAlign = enumValue(isStVerticalJc, getW(first2(props, "vAlign"), "val"), "w:tcPr/w:vAlign");
6555
6571
  if (vAlign) result.verticalAlign = vAlign;
6556
6572
  const shd = first2(props, "shd");
6557
- const fill = parseShadingFill(shd);
6573
+ const fill = parseShadingFill(shd) ?? (getW(shd, "fill") === "auto" && !getW(shd, "themeFill") ? "auto" : void 0);
6558
6574
  if (fill) result.shadingFill = fill;
6559
6575
  const themeFill = parseShadingThemeFill(shd);
6560
6576
  if (themeFill) result.shadingThemeFill = themeFill;
@@ -6623,7 +6639,8 @@ function parseTable(node, id, parseParagraph3) {
6623
6639
  }) : [];
6624
6640
  if (grid.length) table.grid = grid;
6625
6641
  const tblPr = first2(node, "tblPr");
6626
- const width = dxa(getW(first2(tblPr, "tblW"), "w"));
6642
+ const tableWidth = first2(tblPr, "tblW");
6643
+ const width = (getW(tableWidth, "type") ?? "dxa") === "dxa" ? dxa(getW(tableWidth, "w")) : void 0;
6627
6644
  if (width !== void 0) table.widthTwips = width;
6628
6645
  const justification = enumValue(isStJcTable, getW(first2(tblPr, "jc"), "val"), "w:tblPr/w:jc");
6629
6646
  if (justification) {
@@ -2433,6 +2433,23 @@ function patchCellBorders(doc, tc, next, base) {
2433
2433
  orderChildren(props, CELL_ORDER);
2434
2434
  if (!Array.from(props.childNodes).some((node) => node.nodeType === 1)) tc.removeChild(props);
2435
2435
  }
2436
+ function patchCellShading(doc, tc, next, base) {
2437
+ if (next.shadingFill === base?.shadingFill && JSON.stringify(next.shadingThemeFill) === JSON.stringify(base?.shadingThemeFill))
2438
+ return;
2439
+ if (next.shadingFill && next.shadingFill !== "auto" && !/^#?[0-9a-f]{6}$/i.test(next.shadingFill))
2440
+ throw new Error("Cell shading must be a six-digit RGB color or auto.");
2441
+ let props = first2(tc, "tcPr");
2442
+ if (!props) {
2443
+ props = makeW(doc, "tcPr");
2444
+ tc.insertBefore(props, tc.firstChild);
2445
+ }
2446
+ for (const old of children2(props, "shd")) props.removeChild(old);
2447
+ const built = buildCellProperties(doc, next);
2448
+ const replacement = built && first2(built, "shd");
2449
+ if (replacement) props.appendChild(replacement);
2450
+ orderChildren(props, CELL_ORDER);
2451
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1)) tc.removeChild(props);
2452
+ }
2436
2453
 
2437
2454
  // src/docx/write-table.ts
2438
2455
  function canEditTableStructure(table) {
@@ -2481,8 +2498,6 @@ var CELL_DESCRIPTOR_KEYS = [
2481
2498
  "verticalMerge",
2482
2499
  "widthTwips",
2483
2500
  "verticalAlign",
2484
- "shadingFill",
2485
- "shadingThemeFill",
2486
2501
  "margins"
2487
2502
  ];
2488
2503
  function pick(source, keys) {
@@ -2510,7 +2525,7 @@ function assertNoDescriptorEdits(table, base) {
2510
2525
  if (!source) continue;
2511
2526
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
2512
2527
  throw new Error(
2513
- "Cannot edit table cell width, merge, vertical alignment, shading, or margins on an existing cell; only cell text and borders are supported. The original DOCX package remains unchanged."
2528
+ "Cannot edit table cell width, merge, vertical alignment, or margins on an existing cell; only cell text, borders and shading are supported. The original DOCX package remains unchanged."
2514
2529
  );
2515
2530
  }
2516
2531
  }
@@ -2579,6 +2594,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
2579
2594
  throw new Error("Moving paragraphs between table cells is not supported.");
2580
2595
  const tc = source?.cell ?? makeW(doc, "tc");
2581
2596
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
2597
+ patchCellShading(doc, tc, cell, source?.model);
2582
2598
  const oldParagraphs = children2(tc, "p");
2583
2599
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
2584
2600
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -7442,14 +7458,14 @@ function parseCell(cell, parseParagraph3, id) {
7442
7458
  const vMerge = first2(props, "vMerge");
7443
7459
  if (vMerge) result.verticalMerge = getW(vMerge, "val") === "restart" ? "restart" : "continue";
7444
7460
  const tcW = first2(props, "tcW");
7445
- if (getW(tcW, "type") !== "nil") {
7461
+ if ((getW(tcW, "type") ?? "dxa") === "dxa") {
7446
7462
  const width = dxa(getW(tcW, "w"));
7447
7463
  if (width !== void 0) result.widthTwips = width;
7448
7464
  }
7449
7465
  const vAlign = enumValue(isStVerticalJc, getW(first2(props, "vAlign"), "val"), "w:tcPr/w:vAlign");
7450
7466
  if (vAlign) result.verticalAlign = vAlign;
7451
7467
  const shd = first2(props, "shd");
7452
- const fill = parseShadingFill(shd);
7468
+ const fill = parseShadingFill(shd) ?? (getW(shd, "fill") === "auto" && !getW(shd, "themeFill") ? "auto" : void 0);
7453
7469
  if (fill) result.shadingFill = fill;
7454
7470
  const themeFill = parseShadingThemeFill(shd);
7455
7471
  if (themeFill) result.shadingThemeFill = themeFill;
@@ -7518,7 +7534,8 @@ function parseTable(node, id, parseParagraph3) {
7518
7534
  }) : [];
7519
7535
  if (grid.length) table.grid = grid;
7520
7536
  const tblPr = first2(node, "tblPr");
7521
- const width = dxa(getW(first2(tblPr, "tblW"), "w"));
7537
+ const tableWidth = first2(tblPr, "tblW");
7538
+ const width = (getW(tableWidth, "type") ?? "dxa") === "dxa" ? dxa(getW(tableWidth, "w")) : void 0;
7522
7539
  if (width !== void 0) table.widthTwips = width;
7523
7540
  const justification = enumValue(isStJcTable, getW(first2(tblPr, "jc"), "val"), "w:tblPr/w:jc");
7524
7541
  if (justification) {
@@ -2427,6 +2427,23 @@ function patchCellBorders(doc, tc, next, base) {
2427
2427
  orderChildren(props, CELL_ORDER);
2428
2428
  if (!Array.from(props.childNodes).some((node) => node.nodeType === 1)) tc.removeChild(props);
2429
2429
  }
2430
+ function patchCellShading(doc, tc, next, base) {
2431
+ if (next.shadingFill === base?.shadingFill && JSON.stringify(next.shadingThemeFill) === JSON.stringify(base?.shadingThemeFill))
2432
+ return;
2433
+ if (next.shadingFill && next.shadingFill !== "auto" && !/^#?[0-9a-f]{6}$/i.test(next.shadingFill))
2434
+ throw new Error("Cell shading must be a six-digit RGB color or auto.");
2435
+ let props = first2(tc, "tcPr");
2436
+ if (!props) {
2437
+ props = makeW(doc, "tcPr");
2438
+ tc.insertBefore(props, tc.firstChild);
2439
+ }
2440
+ for (const old of children2(props, "shd")) props.removeChild(old);
2441
+ const built = buildCellProperties(doc, next);
2442
+ const replacement = built && first2(built, "shd");
2443
+ if (replacement) props.appendChild(replacement);
2444
+ orderChildren(props, CELL_ORDER);
2445
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1)) tc.removeChild(props);
2446
+ }
2430
2447
 
2431
2448
  // src/docx/write-table.ts
2432
2449
  function canEditTableStructure(table) {
@@ -2475,8 +2492,6 @@ var CELL_DESCRIPTOR_KEYS = [
2475
2492
  "verticalMerge",
2476
2493
  "widthTwips",
2477
2494
  "verticalAlign",
2478
- "shadingFill",
2479
- "shadingThemeFill",
2480
2495
  "margins"
2481
2496
  ];
2482
2497
  function pick(source, keys) {
@@ -2504,7 +2519,7 @@ function assertNoDescriptorEdits(table, base) {
2504
2519
  if (!source) continue;
2505
2520
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
2506
2521
  throw new Error(
2507
- "Cannot edit table cell width, merge, vertical alignment, shading, or margins on an existing cell; only cell text and borders are supported. The original DOCX package remains unchanged."
2522
+ "Cannot edit table cell width, merge, vertical alignment, or margins on an existing cell; only cell text, borders and shading are supported. The original DOCX package remains unchanged."
2508
2523
  );
2509
2524
  }
2510
2525
  }
@@ -2573,6 +2588,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
2573
2588
  throw new Error("Moving paragraphs between table cells is not supported.");
2574
2589
  const tc = source?.cell ?? makeW(doc, "tc");
2575
2590
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
2591
+ patchCellShading(doc, tc, cell, source?.model);
2576
2592
  const oldParagraphs = children2(tc, "p");
2577
2593
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
2578
2594
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -7436,14 +7452,14 @@ function parseCell(cell, parseParagraph3, id) {
7436
7452
  const vMerge = first2(props, "vMerge");
7437
7453
  if (vMerge) result.verticalMerge = getW(vMerge, "val") === "restart" ? "restart" : "continue";
7438
7454
  const tcW = first2(props, "tcW");
7439
- if (getW(tcW, "type") !== "nil") {
7455
+ if ((getW(tcW, "type") ?? "dxa") === "dxa") {
7440
7456
  const width = dxa(getW(tcW, "w"));
7441
7457
  if (width !== void 0) result.widthTwips = width;
7442
7458
  }
7443
7459
  const vAlign = enumValue(isStVerticalJc, getW(first2(props, "vAlign"), "val"), "w:tcPr/w:vAlign");
7444
7460
  if (vAlign) result.verticalAlign = vAlign;
7445
7461
  const shd = first2(props, "shd");
7446
- const fill = parseShadingFill(shd);
7462
+ const fill = parseShadingFill(shd) ?? (getW(shd, "fill") === "auto" && !getW(shd, "themeFill") ? "auto" : void 0);
7447
7463
  if (fill) result.shadingFill = fill;
7448
7464
  const themeFill = parseShadingThemeFill(shd);
7449
7465
  if (themeFill) result.shadingThemeFill = themeFill;
@@ -7512,7 +7528,8 @@ function parseTable(node, id, parseParagraph3) {
7512
7528
  }) : [];
7513
7529
  if (grid.length) table.grid = grid;
7514
7530
  const tblPr = first2(node, "tblPr");
7515
- const width = dxa(getW(first2(tblPr, "tblW"), "w"));
7531
+ const tableWidth = first2(tblPr, "tblW");
7532
+ const width = (getW(tableWidth, "type") ?? "dxa") === "dxa" ? dxa(getW(tableWidth, "w")) : void 0;
7516
7533
  if (width !== void 0) table.widthTwips = width;
7517
7534
  const justification = enumValue(isStJcTable, getW(first2(tblPr, "jc"), "val"), "w:tblPr/w:jc");
7518
7535
  if (justification) {
@@ -1034,6 +1034,23 @@ function patchCellBorders(doc, tc, next, base) {
1034
1034
  orderChildren(props, CELL_ORDER);
1035
1035
  if (!Array.from(props.childNodes).some((node) => node.nodeType === 1)) tc.removeChild(props);
1036
1036
  }
1037
+ function patchCellShading(doc, tc, next, base) {
1038
+ if (next.shadingFill === base?.shadingFill && JSON.stringify(next.shadingThemeFill) === JSON.stringify(base?.shadingThemeFill))
1039
+ return;
1040
+ if (next.shadingFill && next.shadingFill !== "auto" && !/^#?[0-9a-f]{6}$/i.test(next.shadingFill))
1041
+ throw new Error("Cell shading must be a six-digit RGB color or auto.");
1042
+ let props = first2(tc, "tcPr");
1043
+ if (!props) {
1044
+ props = makeW(doc, "tcPr");
1045
+ tc.insertBefore(props, tc.firstChild);
1046
+ }
1047
+ for (const old of children2(props, "shd")) props.removeChild(old);
1048
+ const built = buildCellProperties(doc, next);
1049
+ const replacement = built && first2(built, "shd");
1050
+ if (replacement) props.appendChild(replacement);
1051
+ orderChildren(props, CELL_ORDER);
1052
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1)) tc.removeChild(props);
1053
+ }
1037
1054
 
1038
1055
  // src/docx/write-table.ts
1039
1056
  function canEditTableStructure(table) {
@@ -1082,8 +1099,6 @@ var CELL_DESCRIPTOR_KEYS = [
1082
1099
  "verticalMerge",
1083
1100
  "widthTwips",
1084
1101
  "verticalAlign",
1085
- "shadingFill",
1086
- "shadingThemeFill",
1087
1102
  "margins"
1088
1103
  ];
1089
1104
  function pick(source, keys) {
@@ -1111,7 +1126,7 @@ function assertNoDescriptorEdits(table, base) {
1111
1126
  if (!source) continue;
1112
1127
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
1113
1128
  throw new Error(
1114
- "Cannot edit table cell width, merge, vertical alignment, shading, or margins on an existing cell; only cell text and borders are supported. The original DOCX package remains unchanged."
1129
+ "Cannot edit table cell width, merge, vertical alignment, or margins on an existing cell; only cell text, borders and shading are supported. The original DOCX package remains unchanged."
1115
1130
  );
1116
1131
  }
1117
1132
  }
@@ -1180,6 +1195,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
1180
1195
  throw new Error("Moving paragraphs between table cells is not supported.");
1181
1196
  const tc = source?.cell ?? makeW(doc, "tc");
1182
1197
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
1198
+ patchCellShading(doc, tc, cell, source?.model);
1183
1199
  const oldParagraphs = children2(tc, "p");
1184
1200
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
1185
1201
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -6464,14 +6480,14 @@ function parseCell(cell, parseParagraph3, id) {
6464
6480
  const vMerge = first2(props, "vMerge");
6465
6481
  if (vMerge) result.verticalMerge = getW(vMerge, "val") === "restart" ? "restart" : "continue";
6466
6482
  const tcW = first2(props, "tcW");
6467
- if (getW(tcW, "type") !== "nil") {
6483
+ if ((getW(tcW, "type") ?? "dxa") === "dxa") {
6468
6484
  const width = dxa(getW(tcW, "w"));
6469
6485
  if (width !== void 0) result.widthTwips = width;
6470
6486
  }
6471
6487
  const vAlign = enumValue(isStVerticalJc, getW(first2(props, "vAlign"), "val"), "w:tcPr/w:vAlign");
6472
6488
  if (vAlign) result.verticalAlign = vAlign;
6473
6489
  const shd = first2(props, "shd");
6474
- const fill = parseShadingFill(shd);
6490
+ const fill = parseShadingFill(shd) ?? (getW(shd, "fill") === "auto" && !getW(shd, "themeFill") ? "auto" : void 0);
6475
6491
  if (fill) result.shadingFill = fill;
6476
6492
  const themeFill = parseShadingThemeFill(shd);
6477
6493
  if (themeFill) result.shadingThemeFill = themeFill;
@@ -6540,7 +6556,8 @@ function parseTable(node, id, parseParagraph3) {
6540
6556
  }) : [];
6541
6557
  if (grid.length) table.grid = grid;
6542
6558
  const tblPr = first2(node, "tblPr");
6543
- const width = dxa(getW(first2(tblPr, "tblW"), "w"));
6559
+ const tableWidth = first2(tblPr, "tblW");
6560
+ const width = (getW(tableWidth, "type") ?? "dxa") === "dxa" ? dxa(getW(tableWidth, "w")) : void 0;
6544
6561
  if (width !== void 0) table.widthTwips = width;
6545
6562
  const justification = enumValue(isStJcTable, getW(first2(tblPr, "jc"), "val"), "w:tblPr/w:jc");
6546
6563
  if (justification) {
@@ -7634,7 +7651,7 @@ function createDocument() {
7634
7651
  };
7635
7652
  }
7636
7653
 
7637
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fib.js
7654
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fib.js
7638
7655
  var FC_LCB_INDEX = {
7639
7656
  plcfbteChpx: 12,
7640
7657
  plcfbtePapx: 13,
@@ -7703,7 +7720,7 @@ function patchDocFib(wordDoc, fib, patch) {
7703
7720
  view.setUint32(papxOff + 4, patch.plcfbtePapx.lcb, true);
7704
7721
  }
7705
7722
 
7706
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-parser-types.js
7723
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole2-parser-types.js
7707
7724
  var OLE_MAGIC = new Uint8Array([208, 207, 17, 224, 161, 177, 26, 225]);
7708
7725
  var ENDOFCHAIN = 4294967294;
7709
7726
  var FREESECT = 4294967295;
@@ -7721,7 +7738,7 @@ var Ole2ParseError = class extends Error {
7721
7738
  }
7722
7739
  };
7723
7740
 
7724
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-parser-read.js
7741
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole2-parser-read.js
7725
7742
  function parseOle2(buffer) {
7726
7743
  const data = new Uint8Array(buffer);
7727
7744
  const view = new DataView(buffer);
@@ -7899,7 +7916,7 @@ function parseOle2(buffer) {
7899
7916
  return { entries, getStream };
7900
7917
  }
7901
7918
 
7902
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-parser-write-helpers.js
7919
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole2-parser-write-helpers.js
7903
7920
  function compareDirEntryNames(a, b) {
7904
7921
  if (a.length !== b.length) {
7905
7922
  return a.length - b.length;
@@ -7945,7 +7962,7 @@ function writeInt32Sectors(outBytes, int32Data, firstSector, numSectors, sectorS
7945
7962
  }
7946
7963
  }
7947
7964
 
7948
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-parser-write-serialize.js
7965
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole2-parser-write-serialize.js
7949
7966
  function writeHeader(outView, outBytes, params) {
7950
7967
  outBytes.set(OLE_MAGIC, 0);
7951
7968
  outView.setUint16(24, 62, true);
@@ -8037,7 +8054,7 @@ function writeStreamSectors(outBytes, streamData, chain, sectorSize) {
8037
8054
  }
8038
8055
  }
8039
8056
 
8040
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole2-parser-write.js
8057
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole2-parser-write.js
8041
8058
  function buildOle2(streams, rootClsid, miniStreamCutoff = 4096) {
8042
8059
  const sectorSize = 512;
8043
8060
  const miniSectorSize = 64;
@@ -8203,7 +8220,7 @@ function buildOle2(streams, rootClsid, miniStreamCutoff = 4096) {
8203
8220
  return output;
8204
8221
  }
8205
8222
 
8206
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-cfb.js
8223
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole-document-doc-cfb.js
8207
8224
  function unwrapDocBytes(bytes) {
8208
8225
  if (bytes.length < 8 || bytes[0] !== 208 || bytes[1] !== 207 || bytes[2] !== 17 || bytes[3] !== 224 || bytes[4] !== 161 || bytes[5] !== 177 || bytes[6] !== 26 || bytes[7] !== 225) {
8209
8226
  return void 0;
@@ -8244,7 +8261,7 @@ function unwrapDocBytes(bytes) {
8244
8261
  }
8245
8262
  }
8246
8263
 
8247
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fkp.js
8264
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole-document-doc-fkp.js
8248
8265
  var PAGE_SIZE = 512;
8249
8266
  function parseBteTable(tableStream, at) {
8250
8267
  const view = new DataView(tableStream.buffer, tableStream.byteOffset, tableStream.byteLength);
@@ -8352,7 +8369,7 @@ function buildSingleRunChpxPage(fcStart, fcEnd, blob) {
8352
8369
  return page;
8353
8370
  }
8354
8371
 
8355
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-cp1252.js
8372
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole-document-doc-cp1252.js
8356
8373
  var CP1252_HIGH_BLOCK = [
8357
8374
  8364,
8358
8375
  129,
@@ -8420,7 +8437,7 @@ function encodeCp1252(text) {
8420
8437
  return Uint8Array.from(bytes);
8421
8438
  }
8422
8439
 
8423
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-pieces.js
8440
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole-document-doc-pieces.js
8424
8441
  var CLXT_PRC = 1;
8425
8442
  var CLXT_PCDT = 2;
8426
8443
  function parsePieceTable(tableStream, clx) {
@@ -8582,7 +8599,7 @@ function buildClxBytes(pieces) {
8582
8599
  return bytes;
8583
8600
  }
8584
8601
 
8585
- // node_modules/.bun/@christophervr+ole2@0.3.0/node_modules/@christophervr/ole2/dist/ole-document-doc-editor.js
8602
+ // node_modules/.bun/@christophervr+ole2@0.4.0/node_modules/@christophervr/ole2/dist/ole-document-doc-editor.js
8586
8603
  var RISKY_PLCF_INDICES = [3, 4, 5, 16, 17, 18, 19, 20];
8587
8604
  var RISKY_STTB_INDICES = [21, 22, 23];
8588
8605
  function hasUnsupportedFeatures(wordDoc, fib) {