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.
- package/NOTICE +2 -0
- package/README.md +15 -14
- package/dist/docx/embedded.cjs +23 -6
- package/dist/docx/embedded.mjs +23 -6
- package/dist/docx/index.cjs +23 -6
- package/dist/docx/index.mjs +23 -6
- package/dist/docx/load/index.cjs +34 -17
- package/dist/docx/load/index.mjs +34 -17
- package/dist/docx/parse-table.d.ts.map +1 -1
- package/dist/docx/write-table-properties.d.ts +3 -1
- package/dist/docx/write-table-properties.d.ts.map +1 -1
- package/dist/docx/write-table.d.ts.map +1 -1
- package/dist/index.cjs +2076 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2076 -15
- package/dist/math/index.cjs +2050 -0
- package/dist/math/index.d.ts +15 -0
- package/dist/math/index.d.ts.map +1 -0
- package/dist/math/index.mjs +1985 -0
- package/dist/math/latex-omml-siblings.d.ts +21 -0
- package/dist/math/latex-omml-siblings.d.ts.map +1 -0
- package/dist/math/latex-omml-symbols.d.ts +42 -0
- package/dist/math/latex-omml-symbols.d.ts.map +1 -0
- package/dist/math/latex-to-omml-commands.d.ts +9 -0
- package/dist/math/latex-to-omml-commands.d.ts.map +1 -0
- package/dist/math/latex-to-omml-constructs.d.ts +39 -0
- package/dist/math/latex-to-omml-constructs.d.ts.map +1 -0
- package/dist/math/latex-to-omml-environments.d.ts +28 -0
- package/dist/math/latex-to-omml-environments.d.ts.map +1 -0
- package/dist/math/latex-to-omml.d.ts +9 -0
- package/dist/math/latex-to-omml.d.ts.map +1 -0
- package/dist/math/omml-color.d.ts +11 -0
- package/dist/math/omml-color.d.ts.map +1 -0
- package/dist/math/omml-dom.d.ts +7 -0
- package/dist/math/omml-dom.d.ts.map +1 -0
- package/dist/math/omml-mathml-converters.d.ts +39 -0
- package/dist/math/omml-mathml-converters.d.ts.map +1 -0
- package/dist/math/omml-mathml-helpers.d.ts +23 -0
- package/dist/math/omml-mathml-helpers.d.ts.map +1 -0
- package/dist/math/omml-node.d.ts +7 -0
- package/dist/math/omml-node.d.ts.map +1 -0
- package/dist/math/omml-to-latex-helpers.d.ts +41 -0
- package/dist/math/omml-to-latex-helpers.d.ts.map +1 -0
- package/dist/math/omml-to-latex-layout.d.ts +18 -0
- package/dist/math/omml-to-latex-layout.d.ts.map +1 -0
- package/dist/math/omml-to-latex.d.ts +6 -0
- package/dist/math/omml-to-latex.d.ts.map +1 -0
- package/dist/math/omml-to-mathml.d.ts +21 -0
- package/dist/math/omml-to-mathml.d.ts.map +1 -0
- package/dist/opc/index.cjs +18 -1
- package/dist/opc/index.mjs +18 -1
- package/dist/opc/relationship-types.d.ts +17 -0
- package/dist/opc/relationship-types.d.ts.map +1 -1
- package/dist/pptx/cli/index.cjs +122 -105
- package/dist/pptx/cli/index.mjs +122 -105
- package/dist/pptx/index.cjs +144 -127
- package/dist/pptx/index.d.ts +8 -8
- package/dist/pptx/index.d.ts.map +1 -1
- package/dist/pptx/index.mjs +144 -127
- package/dist/visio/geometry.d.ts.map +1 -1
- package/dist/visio/index.cjs +66 -6
- package/dist/visio/index.mjs +66 -6
- package/dist/visio/rounded-geometry.d.ts +9 -0
- package/dist/visio/rounded-geometry.d.ts.map +1 -1
- package/dist/xlsx/address.d.ts +42 -0
- package/dist/xlsx/address.d.ts.map +1 -0
- package/dist/xlsx/cell-styles.d.ts +25 -0
- package/dist/xlsx/cell-styles.d.ts.map +1 -0
- package/dist/xlsx/cells.d.ts +25 -0
- package/dist/xlsx/cells.d.ts.map +1 -0
- package/dist/xlsx/edit/annotations.d.ts +17 -0
- package/dist/xlsx/edit/annotations.d.ts.map +1 -0
- package/dist/xlsx/edit/band-formulas.d.ts +9 -0
- package/dist/xlsx/edit/band-formulas.d.ts.map +1 -0
- package/dist/xlsx/edit/borders.d.ts +8 -0
- package/dist/xlsx/edit/borders.d.ts.map +1 -0
- package/dist/xlsx/edit/calc-mode.d.ts +11 -0
- package/dist/xlsx/edit/calc-mode.d.ts.map +1 -0
- package/dist/xlsx/edit/cell-shift.d.ts +11 -0
- package/dist/xlsx/edit/cell-shift.d.ts.map +1 -0
- package/dist/xlsx/edit/cell-style.d.ts +9 -0
- package/dist/xlsx/edit/cell-style.d.ts.map +1 -0
- package/dist/xlsx/edit/cell-values.d.ts +21 -0
- package/dist/xlsx/edit/cell-values.d.ts.map +1 -0
- package/dist/xlsx/edit/charts.d.ts +22 -0
- package/dist/xlsx/edit/charts.d.ts.map +1 -0
- package/dist/xlsx/edit/clipboard-html-parse.d.ts +12 -0
- package/dist/xlsx/edit/clipboard-html-parse.d.ts.map +1 -0
- package/dist/xlsx/edit/clipboard-html.d.ts +8 -0
- package/dist/xlsx/edit/clipboard-html.d.ts.map +1 -0
- package/dist/xlsx/edit/clipboard-text.d.ts +8 -0
- package/dist/xlsx/edit/clipboard-text.d.ts.map +1 -0
- package/dist/xlsx/edit/clipboard.d.ts +16 -0
- package/dist/xlsx/edit/clipboard.d.ts.map +1 -0
- package/dist/xlsx/edit/columns.d.ts +11 -0
- package/dist/xlsx/edit/columns.d.ts.map +1 -0
- package/dist/xlsx/edit/conditional-formats.d.ts +17 -0
- package/dist/xlsx/edit/conditional-formats.d.ts.map +1 -0
- package/dist/xlsx/edit/context.d.ts +42 -0
- package/dist/xlsx/edit/context.d.ts.map +1 -0
- package/dist/xlsx/edit/deps.d.ts +4 -0
- package/dist/xlsx/edit/deps.d.ts.map +1 -0
- package/dist/xlsx/edit/dimensions.d.ts +13 -0
- package/dist/xlsx/edit/dimensions.d.ts.map +1 -0
- package/dist/xlsx/edit/drawings.d.ts +10 -0
- package/dist/xlsx/edit/drawings.d.ts.map +1 -0
- package/dist/xlsx/edit/duplicates.d.ts +17 -0
- package/dist/xlsx/edit/duplicates.d.ts.map +1 -0
- package/dist/xlsx/edit/fill-series.d.ts +16 -0
- package/dist/xlsx/edit/fill-series.d.ts.map +1 -0
- package/dist/xlsx/edit/fill.d.ts +14 -0
- package/dist/xlsx/edit/fill.d.ts.map +1 -0
- package/dist/xlsx/edit/filter.d.ts +17 -0
- package/dist/xlsx/edit/filter.d.ts.map +1 -0
- package/dist/xlsx/edit/find.d.ts +17 -0
- package/dist/xlsx/edit/find.d.ts.map +1 -0
- package/dist/xlsx/edit/format.d.ts +13 -0
- package/dist/xlsx/edit/format.d.ts.map +1 -0
- package/dist/xlsx/edit/history.d.ts +75 -0
- package/dist/xlsx/edit/history.d.ts.map +1 -0
- package/dist/xlsx/edit/index.d.ts +23 -0
- package/dist/xlsx/edit/index.d.ts.map +1 -0
- package/dist/xlsx/edit/merge.d.ts +11 -0
- package/dist/xlsx/edit/merge.d.ts.map +1 -0
- package/dist/xlsx/edit/outline.d.ts +14 -0
- package/dist/xlsx/edit/outline.d.ts.map +1 -0
- package/dist/xlsx/edit/page.d.ts +11 -0
- package/dist/xlsx/edit/page.d.ts.map +1 -0
- package/dist/xlsx/edit/protection.d.ts +26 -0
- package/dist/xlsx/edit/protection.d.ts.map +1 -0
- package/dist/xlsx/edit/range-math.d.ts +33 -0
- package/dist/xlsx/edit/range-math.d.ts.map +1 -0
- package/dist/xlsx/edit/row-autofit.d.ts +17 -0
- package/dist/xlsx/edit/row-autofit.d.ts.map +1 -0
- package/dist/xlsx/edit/session-calc.d.ts +24 -0
- package/dist/xlsx/edit/session-calc.d.ts.map +1 -0
- package/dist/xlsx/edit/session.d.ts +5 -0
- package/dist/xlsx/edit/session.d.ts.map +1 -0
- package/dist/xlsx/edit/sheets.d.ts +19 -0
- package/dist/xlsx/edit/sheets.d.ts.map +1 -0
- package/dist/xlsx/edit/shift-formulas.d.ts +14 -0
- package/dist/xlsx/edit/shift-formulas.d.ts.map +1 -0
- package/dist/xlsx/edit/shift-sheet.d.ts +15 -0
- package/dist/xlsx/edit/shift-sheet.d.ts.map +1 -0
- package/dist/xlsx/edit/sort.d.ts +17 -0
- package/dist/xlsx/edit/sort.d.ts.map +1 -0
- package/dist/xlsx/edit/structure.d.ts +10 -0
- package/dist/xlsx/edit/structure.d.ts.map +1 -0
- package/dist/xlsx/edit/table-edits.d.ts +25 -0
- package/dist/xlsx/edit/table-edits.d.ts.map +1 -0
- package/dist/xlsx/edit/table-rows.d.ts +11 -0
- package/dist/xlsx/edit/table-rows.d.ts.map +1 -0
- package/dist/xlsx/edit/tables.d.ts +11 -0
- package/dist/xlsx/edit/tables.d.ts.map +1 -0
- package/dist/xlsx/edit/test-context.d.ts +15 -0
- package/dist/xlsx/edit/test-context.d.ts.map +1 -0
- package/dist/xlsx/edit/types-clipboard.d.ts +66 -0
- package/dist/xlsx/edit/types-clipboard.d.ts.map +1 -0
- package/dist/xlsx/edit/types.d.ts +188 -0
- package/dist/xlsx/edit/types.d.ts.map +1 -0
- package/dist/xlsx/edit/validation.d.ts +21 -0
- package/dist/xlsx/edit/validation.d.ts.map +1 -0
- package/dist/xlsx/edit/view.d.ts +12 -0
- package/dist/xlsx/edit/view.d.ts.map +1 -0
- package/dist/xlsx/formula/array-context.d.ts +7 -0
- package/dist/xlsx/formula/array-context.d.ts.map +1 -0
- package/dist/xlsx/formula/ast.d.ts +108 -0
- package/dist/xlsx/formula/ast.d.ts.map +1 -0
- package/dist/xlsx/formula/call.d.ts +13 -0
- package/dist/xlsx/formula/call.d.ts.map +1 -0
- package/dist/xlsx/formula/coerce.d.ts +22 -0
- package/dist/xlsx/formula/coerce.d.ts.map +1 -0
- package/dist/xlsx/formula/context.d.ts +74 -0
- package/dist/xlsx/formula/context.d.ts.map +1 -0
- package/dist/xlsx/formula/date-serial.d.ts +26 -0
- package/dist/xlsx/formula/date-serial.d.ts.map +1 -0
- package/dist/xlsx/formula/engine-core.d.ts +19 -0
- package/dist/xlsx/formula/engine-core.d.ts.map +1 -0
- package/dist/xlsx/formula/engine-host.d.ts +51 -0
- package/dist/xlsx/formula/engine-host.d.ts.map +1 -0
- package/dist/xlsx/formula/engine-types.d.ts +31 -0
- package/dist/xlsx/formula/engine-types.d.ts.map +1 -0
- package/dist/xlsx/formula/engine-util.d.ts +10 -0
- package/dist/xlsx/formula/engine-util.d.ts.map +1 -0
- package/dist/xlsx/formula/engine.d.ts +6 -0
- package/dist/xlsx/formula/engine.d.ts.map +1 -0
- package/dist/xlsx/formula/evaluator.d.ts +17 -0
- package/dist/xlsx/formula/evaluator.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/array-shape.d.ts +3 -0
- package/dist/xlsx/formula/functions/array-shape.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/array.d.ts +6 -0
- package/dist/xlsx/formula/functions/array.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/criteria.d.ts +22 -0
- package/dist/xlsx/formula/functions/criteria.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/date-calc.d.ts +14 -0
- package/dist/xlsx/formula/functions/date-calc.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/datetime.d.ts +3 -0
- package/dist/xlsx/formula/functions/datetime.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/depreciation.d.ts +4 -0
- package/dist/xlsx/formula/functions/depreciation.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/dist-core.d.ts +22 -0
- package/dist/xlsx/formula/functions/dist-core.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/distributions-more.d.ts +4 -0
- package/dist/xlsx/formula/functions/distributions-more.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/distributions.d.ts +3 -0
- package/dist/xlsx/formula/functions/distributions.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/engineering.d.ts +3 -0
- package/dist/xlsx/formula/functions/engineering.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/financial-core.d.ts +8 -0
- package/dist/xlsx/formula/functions/financial-core.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/financial.d.ts +3 -0
- package/dist/xlsx/formula/functions/financial.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/helpers.d.ts +44 -0
- package/dist/xlsx/formula/functions/helpers.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/info.d.ts +3 -0
- package/dist/xlsx/formula/functions/info.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/lambda.d.ts +3 -0
- package/dist/xlsx/formula/functions/lambda.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/logical.d.ts +7 -0
- package/dist/xlsx/formula/functions/logical.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/lookup-core.d.ts +32 -0
- package/dist/xlsx/formula/functions/lookup-core.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/lookup.d.ts +8 -0
- package/dist/xlsx/formula/functions/lookup.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/math-combin.d.ts +5 -0
- package/dist/xlsx/formula/functions/math-combin.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/math-more.d.ts +4 -0
- package/dist/xlsx/formula/functions/math-more.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/math-sum.d.ts +6 -0
- package/dist/xlsx/formula/functions/math-sum.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/math.d.ts +7 -0
- package/dist/xlsx/formula/functions/math.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/matrix.d.ts +3 -0
- package/dist/xlsx/formula/functions/matrix.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/reference.d.ts +3 -0
- package/dist/xlsx/formula/functions/reference.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/registry.d.ts +8 -0
- package/dist/xlsx/formula/functions/registry.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/statistical-count.d.ts +3 -0
- package/dist/xlsx/formula/functions/statistical-count.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/statistical-more.d.ts +10 -0
- package/dist/xlsx/formula/functions/statistical-more.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/statistical-shape.d.ts +4 -0
- package/dist/xlsx/formula/functions/statistical-shape.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/statistical-spread.d.ts +4 -0
- package/dist/xlsx/formula/functions/statistical-spread.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/statistical.d.ts +3 -0
- package/dist/xlsx/formula/functions/statistical.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/stats-core.d.ts +30 -0
- package/dist/xlsx/formula/functions/stats-core.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/text-convert.d.ts +4 -0
- package/dist/xlsx/formula/functions/text-convert.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/text-extra.d.ts +3 -0
- package/dist/xlsx/formula/functions/text-extra.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/text.d.ts +3 -0
- package/dist/xlsx/formula/functions/text.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/types.d.ts +30 -0
- package/dist/xlsx/formula/functions/types.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/workdays.d.ts +3 -0
- package/dist/xlsx/formula/functions/workdays.d.ts.map +1 -0
- package/dist/xlsx/formula/graph.d.ts +50 -0
- package/dist/xlsx/formula/graph.d.ts.map +1 -0
- package/dist/xlsx/formula/index.d.ts +14 -0
- package/dist/xlsx/formula/index.d.ts.map +1 -0
- package/dist/xlsx/formula/lexemes.d.ts +41 -0
- package/dist/xlsx/formula/lexemes.d.ts.map +1 -0
- package/dist/xlsx/formula/move.d.ts +23 -0
- package/dist/xlsx/formula/move.d.ts.map +1 -0
- package/dist/xlsx/formula/operators.d.ts +15 -0
- package/dist/xlsx/formula/operators.d.ts.map +1 -0
- package/dist/xlsx/formula/parser.d.ts +4 -0
- package/dist/xlsx/formula/parser.d.ts.map +1 -0
- package/dist/xlsx/formula/references.d.ts +36 -0
- package/dist/xlsx/formula/references.d.ts.map +1 -0
- package/dist/xlsx/formula/scc.d.ts +6 -0
- package/dist/xlsx/formula/scc.d.ts.map +1 -0
- package/dist/xlsx/formula/sheet-scan.d.ts +10 -0
- package/dist/xlsx/formula/sheet-scan.d.ts.map +1 -0
- package/dist/xlsx/formula/spill.d.ts +32 -0
- package/dist/xlsx/formula/spill.d.ts.map +1 -0
- package/dist/xlsx/formula/store.d.ts +10 -0
- package/dist/xlsx/formula/store.d.ts.map +1 -0
- package/dist/xlsx/formula/structured-to-a1.d.ts +18 -0
- package/dist/xlsx/formula/structured-to-a1.d.ts.map +1 -0
- package/dist/xlsx/formula/structured.d.ts +4 -0
- package/dist/xlsx/formula/structured.d.ts.map +1 -0
- package/dist/xlsx/formula/table-refs.d.ts +7 -0
- package/dist/xlsx/formula/table-refs.d.ts.map +1 -0
- package/dist/xlsx/formula/test-helpers.d.ts +32 -0
- package/dist/xlsx/formula/test-helpers.d.ts.map +1 -0
- package/dist/xlsx/formula/text-number.d.ts +11 -0
- package/dist/xlsx/formula/text-number.d.ts.map +1 -0
- package/dist/xlsx/formula/tokenizer.d.ts +21 -0
- package/dist/xlsx/formula/tokenizer.d.ts.map +1 -0
- package/dist/xlsx/formula/transform.d.ts +49 -0
- package/dist/xlsx/formula/transform.d.ts.map +1 -0
- package/dist/xlsx/formula/values.d.ts +63 -0
- package/dist/xlsx/formula/values.d.ts.map +1 -0
- package/dist/xlsx/index.cjs +20579 -0
- package/dist/xlsx/index.d.ts +14 -0
- package/dist/xlsx/index.d.ts.map +1 -0
- package/dist/xlsx/index.mjs +20396 -0
- package/dist/xlsx/layout/autofit.d.ts +12 -0
- package/dist/xlsx/layout/autofit.d.ts.map +1 -0
- package/dist/xlsx/layout/axis-metrics.d.ts +39 -0
- package/dist/xlsx/layout/axis-metrics.d.ts.map +1 -0
- package/dist/xlsx/layout/cell-view.d.ts +21 -0
- package/dist/xlsx/layout/cell-view.d.ts.map +1 -0
- package/dist/xlsx/layout/cf-evaluator.d.ts +26 -0
- package/dist/xlsx/layout/cf-evaluator.d.ts.map +1 -0
- package/dist/xlsx/layout/cf-helpers.d.ts +8 -0
- package/dist/xlsx/layout/cf-helpers.d.ts.map +1 -0
- package/dist/xlsx/layout/cf-values.d.ts +25 -0
- package/dist/xlsx/layout/cf-values.d.ts.map +1 -0
- package/dist/xlsx/layout/chart-colors.d.ts +6 -0
- package/dist/xlsx/layout/chart-colors.d.ts.map +1 -0
- package/dist/xlsx/layout/chart-scale.d.ts +25 -0
- package/dist/xlsx/layout/chart-scale.d.ts.map +1 -0
- package/dist/xlsx/layout/chart-svg-cartesian.d.ts +5 -0
- package/dist/xlsx/layout/chart-svg-cartesian.d.ts.map +1 -0
- package/dist/xlsx/layout/chart-svg-radial.d.ts +7 -0
- package/dist/xlsx/layout/chart-svg-radial.d.ts.map +1 -0
- package/dist/xlsx/layout/chart-svg-util.d.ts +29 -0
- package/dist/xlsx/layout/chart-svg-util.d.ts.map +1 -0
- package/dist/xlsx/layout/chart-svg.d.ts +7 -0
- package/dist/xlsx/layout/chart-svg.d.ts.map +1 -0
- package/dist/xlsx/layout/chart-view.d.ts +42 -0
- package/dist/xlsx/layout/chart-view.d.ts.map +1 -0
- package/dist/xlsx/layout/colors.d.ts +20 -0
- package/dist/xlsx/layout/colors.d.ts.map +1 -0
- package/dist/xlsx/layout/index.d.ts +21 -0
- package/dist/xlsx/layout/index.d.ts.map +1 -0
- package/dist/xlsx/layout/metrics.d.ts +41 -0
- package/dist/xlsx/layout/metrics.d.ts.map +1 -0
- package/dist/xlsx/layout/navigate.d.ts +6 -0
- package/dist/xlsx/layout/navigate.d.ts.map +1 -0
- package/dist/xlsx/layout/ref-evaluator.d.ts +16 -0
- package/dist/xlsx/layout/ref-evaluator.d.ts.map +1 -0
- package/dist/xlsx/layout/row-autofit.d.ts +17 -0
- package/dist/xlsx/layout/row-autofit.d.ts.map +1 -0
- package/dist/xlsx/layout/sheet-queries.d.ts +37 -0
- package/dist/xlsx/layout/sheet-queries.d.ts.map +1 -0
- package/dist/xlsx/layout/style-view.d.ts +18 -0
- package/dist/xlsx/layout/style-view.d.ts.map +1 -0
- package/dist/xlsx/layout/tint.d.ts +26 -0
- package/dist/xlsx/layout/tint.d.ts.map +1 -0
- package/dist/xlsx/layout/types.d.ts +106 -0
- package/dist/xlsx/layout/types.d.ts.map +1 -0
- package/dist/xlsx/layout/units.d.ts +37 -0
- package/dist/xlsx/layout/units.d.ts.map +1 -0
- package/dist/xlsx/layout/viewport.d.ts +27 -0
- package/dist/xlsx/layout/viewport.d.ts.map +1 -0
- package/dist/xlsx/load/csv.d.ts +29 -0
- package/dist/xlsx/load/csv.d.ts.map +1 -0
- package/dist/xlsx/load/detect.d.ts +22 -0
- package/dist/xlsx/load/detect.d.ts.map +1 -0
- package/dist/xlsx/load/index.cjs +15619 -0
- package/dist/xlsx/load/index.d.ts +4 -0
- package/dist/xlsx/load/index.d.ts.map +1 -0
- package/dist/xlsx/load/index.mjs +15603 -0
- package/dist/xlsx/load/legacy-xls-sheet.d.ts +14 -0
- package/dist/xlsx/load/legacy-xls-sheet.d.ts.map +1 -0
- package/dist/xlsx/load/legacy-xls-styles.d.ts +9 -0
- package/dist/xlsx/load/legacy-xls-styles.d.ts.map +1 -0
- package/dist/xlsx/load/legacy-xls.d.ts +10 -0
- package/dist/xlsx/load/legacy-xls.d.ts.map +1 -0
- package/dist/xlsx/model.d.ts +535 -0
- package/dist/xlsx/model.d.ts.map +1 -0
- package/dist/xlsx/numfmt/builtins.d.ts +15 -0
- package/dist/xlsx/numfmt/builtins.d.ts.map +1 -0
- package/dist/xlsx/numfmt/compile.d.ts +26 -0
- package/dist/xlsx/numfmt/compile.d.ts.map +1 -0
- package/dist/xlsx/numfmt/date.d.ts +34 -0
- package/dist/xlsx/numfmt/date.d.ts.map +1 -0
- package/dist/xlsx/numfmt/decimal.d.ts +27 -0
- package/dist/xlsx/numfmt/decimal.d.ts.map +1 -0
- package/dist/xlsx/numfmt/decimals.d.ts +10 -0
- package/dist/xlsx/numfmt/decimals.d.ts.map +1 -0
- package/dist/xlsx/numfmt/format.d.ts +13 -0
- package/dist/xlsx/numfmt/format.d.ts.map +1 -0
- package/dist/xlsx/numfmt/fraction.d.ts +38 -0
- package/dist/xlsx/numfmt/fraction.d.ts.map +1 -0
- package/dist/xlsx/numfmt/general.d.ts +8 -0
- package/dist/xlsx/numfmt/general.d.ts.map +1 -0
- package/dist/xlsx/numfmt/index.d.ts +8 -0
- package/dist/xlsx/numfmt/index.d.ts.map +1 -0
- package/dist/xlsx/numfmt/input-date.d.ts +16 -0
- package/dist/xlsx/numfmt/input-date.d.ts.map +1 -0
- package/dist/xlsx/numfmt/input.d.ts +23 -0
- package/dist/xlsx/numfmt/input.d.ts.map +1 -0
- package/dist/xlsx/numfmt/number.d.ts +38 -0
- package/dist/xlsx/numfmt/number.d.ts.map +1 -0
- package/dist/xlsx/numfmt/tokenizer.d.ts +6 -0
- package/dist/xlsx/numfmt/tokenizer.d.ts.map +1 -0
- package/dist/xlsx/numfmt/types.d.ts +87 -0
- package/dist/xlsx/numfmt/types.d.ts.map +1 -0
- package/dist/xlsx/read/builtin-formats.d.ts +10 -0
- package/dist/xlsx/read/builtin-formats.d.ts.map +1 -0
- package/dist/xlsx/read/chart.d.ts +7 -0
- package/dist/xlsx/read/chart.d.ts.map +1 -0
- package/dist/xlsx/read/comments.d.ts +10 -0
- package/dist/xlsx/read/comments.d.ts.map +1 -0
- package/dist/xlsx/read/conditional.d.ts +6 -0
- package/dist/xlsx/read/conditional.d.ts.map +1 -0
- package/dist/xlsx/read/dates.d.ts +6 -0
- package/dist/xlsx/read/dates.d.ts.map +1 -0
- package/dist/xlsx/read/drawing.d.ts +10 -0
- package/dist/xlsx/read/drawing.d.ts.map +1 -0
- package/dist/xlsx/read/formula-storage.d.ts +5 -0
- package/dist/xlsx/read/formula-storage.d.ts.map +1 -0
- package/dist/xlsx/read/formula-text.d.ts +15 -0
- package/dist/xlsx/read/formula-text.d.ts.map +1 -0
- package/dist/xlsx/read/index.d.ts +3 -0
- package/dist/xlsx/read/index.d.ts.map +1 -0
- package/dist/xlsx/read/load.d.ts +7 -0
- package/dist/xlsx/read/load.d.ts.map +1 -0
- package/dist/xlsx/read/metadata.d.ts +8 -0
- package/dist/xlsx/read/metadata.d.ts.map +1 -0
- package/dist/xlsx/read/package.d.ts +60 -0
- package/dist/xlsx/read/package.d.ts.map +1 -0
- package/dist/xlsx/read/print-options.d.ts +7 -0
- package/dist/xlsx/read/print-options.d.ts.map +1 -0
- package/dist/xlsx/read/shared-strings.d.ts +13 -0
- package/dist/xlsx/read/shared-strings.d.ts.map +1 -0
- package/dist/xlsx/read/sheet-data.d.ts +15 -0
- package/dist/xlsx/read/sheet-data.d.ts.map +1 -0
- package/dist/xlsx/read/sheet-props.d.ts +21 -0
- package/dist/xlsx/read/sheet-props.d.ts.map +1 -0
- package/dist/xlsx/read/style-parts.d.ts +20 -0
- package/dist/xlsx/read/style-parts.d.ts.map +1 -0
- package/dist/xlsx/read/styles.d.ts +17 -0
- package/dist/xlsx/read/styles.d.ts.map +1 -0
- package/dist/xlsx/read/tables.d.ts +4 -0
- package/dist/xlsx/read/tables.d.ts.map +1 -0
- package/dist/xlsx/read/theme.d.ts +11 -0
- package/dist/xlsx/read/theme.d.ts.map +1 -0
- package/dist/xlsx/read/workbook-part.d.ts +23 -0
- package/dist/xlsx/read/workbook-part.d.ts.map +1 -0
- package/dist/xlsx/read/worksheet.d.ts +18 -0
- package/dist/xlsx/read/worksheet.d.ts.map +1 -0
- package/dist/xlsx/read/xml-util.d.ts +28 -0
- package/dist/xlsx/read/xml-util.d.ts.map +1 -0
- package/dist/xlsx/styles.d.ts +27 -0
- package/dist/xlsx/styles.d.ts.map +1 -0
- package/dist/xlsx/time-period.d.ts +9 -0
- package/dist/xlsx/time-period.d.ts.map +1 -0
- package/dist/xlsx/workbook.d.ts +26 -0
- package/dist/xlsx/workbook.d.ts.map +1 -0
- package/dist/xlsx/write/chart-patch.d.ts +9 -0
- package/dist/xlsx/write/chart-patch.d.ts.map +1 -0
- package/dist/xlsx/write/chart.d.ts +9 -0
- package/dist/xlsx/write/chart.d.ts.map +1 -0
- package/dist/xlsx/write/comments.d.ts +23 -0
- package/dist/xlsx/write/comments.d.ts.map +1 -0
- package/dist/xlsx/write/conditional.d.ts +5 -0
- package/dist/xlsx/write/conditional.d.ts.map +1 -0
- package/dist/xlsx/write/drawing.d.ts +10 -0
- package/dist/xlsx/write/drawing.d.ts.map +1 -0
- package/dist/xlsx/write/dynamic-array.d.ts +16 -0
- package/dist/xlsx/write/dynamic-array.d.ts.map +1 -0
- package/dist/xlsx/write/index.d.ts +2 -0
- package/dist/xlsx/write/index.d.ts.map +1 -0
- package/dist/xlsx/write/package-writer.d.ts +31 -0
- package/dist/xlsx/write/package-writer.d.ts.map +1 -0
- package/dist/xlsx/write/save.d.ts +8 -0
- package/dist/xlsx/write/save.d.ts.map +1 -0
- package/dist/xlsx/write/shared-strings.d.ts +13 -0
- package/dist/xlsx/write/shared-strings.d.ts.map +1 -0
- package/dist/xlsx/write/sheet-data.d.ts +19 -0
- package/dist/xlsx/write/sheet-data.d.ts.map +1 -0
- package/dist/xlsx/write/sheet-parts.d.ts +34 -0
- package/dist/xlsx/write/sheet-parts.d.ts.map +1 -0
- package/dist/xlsx/write/sheet-props.d.ts +16 -0
- package/dist/xlsx/write/sheet-props.d.ts.map +1 -0
- package/dist/xlsx/write/snapshot.d.ts +9 -0
- package/dist/xlsx/write/snapshot.d.ts.map +1 -0
- package/dist/xlsx/write/style-xml.d.ts +13 -0
- package/dist/xlsx/write/style-xml.d.ts.map +1 -0
- package/dist/xlsx/write/styles.d.ts +24 -0
- package/dist/xlsx/write/styles.d.ts.map +1 -0
- package/dist/xlsx/write/tables.d.ts +18 -0
- package/dist/xlsx/write/tables.d.ts.map +1 -0
- package/dist/xlsx/write/theme.d.ts +9 -0
- package/dist/xlsx/write/theme.d.ts.map +1 -0
- package/dist/xlsx/write/workbook-part.d.ts +16 -0
- package/dist/xlsx/write/workbook-part.d.ts.map +1 -0
- package/dist/xlsx/write/worksheet.d.ts +6 -0
- package/dist/xlsx/write/worksheet.d.ts.map +1 -0
- package/dist/xlsx/write/xml-out.d.ts +25 -0
- package/dist/xlsx/write/xml-out.d.ts.map +1 -0
- package/dist/xml/index.cjs +16 -0
- package/dist/xml/index.mjs +16 -0
- package/dist/xml/namespaces.d.ts +16 -0
- package/dist/xml/namespaces.d.ts.map +1 -1
- 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.
|
|
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)
|
|
9
9
|
[](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 `
|
|
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:**
|
|
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
|
|
package/dist/docx/embedded.cjs
CHANGED
|
@@ -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,
|
|
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")
|
|
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
|
|
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) {
|
package/dist/docx/embedded.mjs
CHANGED
|
@@ -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,
|
|
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")
|
|
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
|
|
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) {
|
package/dist/docx/index.cjs
CHANGED
|
@@ -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,
|
|
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")
|
|
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
|
|
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) {
|
package/dist/docx/index.mjs
CHANGED
|
@@ -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,
|
|
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")
|
|
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
|
|
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) {
|
package/dist/docx/load/index.cjs
CHANGED
|
@@ -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,
|
|
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")
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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) {
|