@cj-tech-master/excelts 9.4.2 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.browser.d.ts +8 -5
- package/dist/browser/index.browser.js +19 -1
- package/dist/browser/index.d.ts +4 -2
- package/dist/browser/index.js +9 -1
- package/dist/browser/modules/excel/chart/cache-populator.d.ts +49 -0
- package/dist/browser/modules/excel/chart/cache-populator.js +1171 -0
- package/dist/browser/modules/excel/chart/chart-api.d.ts +92 -0
- package/dist/browser/modules/excel/chart/chart-api.js +364 -0
- package/dist/browser/modules/excel/chart/chart-builder.d.ts +48 -0
- package/dist/browser/modules/excel/chart/chart-builder.js +2432 -0
- package/dist/browser/modules/excel/chart/chart-ex-builder.d.ts +36 -0
- package/dist/browser/modules/excel/chart/chart-ex-builder.js +903 -0
- package/dist/browser/modules/excel/chart/chart-ex-parser.d.ts +8 -0
- package/dist/browser/modules/excel/chart/chart-ex-parser.js +1205 -0
- package/dist/browser/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
- package/dist/browser/modules/excel/chart/chart-ex-renderer.js +5352 -0
- package/dist/browser/modules/excel/chart/chart-ex-types.d.ts +531 -0
- package/dist/browser/modules/excel/chart/chart-ex-types.js +11 -0
- package/dist/browser/modules/excel/chart/chart-images.d.ts +78 -0
- package/dist/browser/modules/excel/chart/chart-images.js +363 -0
- package/dist/browser/modules/excel/chart/chart-presets.d.ts +392 -0
- package/dist/browser/modules/excel/chart/chart-presets.js +179 -0
- package/dist/browser/modules/excel/chart/chart-renderer.d.ts +550 -0
- package/dist/browser/modules/excel/chart/chart-renderer.js +6440 -0
- package/dist/browser/modules/excel/chart/chart-sidecar.d.ts +21 -0
- package/dist/browser/modules/excel/chart/chart-sidecar.js +427 -0
- package/dist/browser/modules/excel/chart/chart-utils.d.ts +306 -0
- package/dist/browser/modules/excel/chart/chart-utils.js +821 -0
- package/dist/browser/modules/excel/chart/chart.d.ts +504 -0
- package/dist/browser/modules/excel/chart/chart.js +1320 -0
- package/dist/browser/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
- package/dist/browser/modules/excel/chart/glyph-rasterizer.js +658 -0
- package/dist/browser/modules/excel/chart/index.d.ts +54 -0
- package/dist/browser/modules/excel/chart/index.js +46 -0
- package/dist/browser/modules/excel/chart/install.d.ts +44 -0
- package/dist/browser/modules/excel/chart/install.js +91 -0
- package/dist/browser/modules/excel/chart/shape-properties.d.ts +156 -0
- package/dist/browser/modules/excel/chart/shape-properties.js +1557 -0
- package/dist/browser/modules/excel/chart/stroke-font.d.ts +36 -0
- package/dist/browser/modules/excel/chart/stroke-font.js +1556 -0
- package/dist/browser/modules/excel/chart/topojson.d.ts +98 -0
- package/dist/browser/modules/excel/chart/topojson.js +236 -0
- package/dist/browser/modules/excel/chart/types.d.ts +2559 -0
- package/dist/browser/modules/excel/chart/types.js +8 -0
- package/dist/browser/modules/excel/chart-host-registry.d.ts +157 -0
- package/dist/browser/modules/excel/chart-host-registry.js +90 -0
- package/dist/browser/modules/excel/chartsheet.d.ts +102 -0
- package/dist/browser/modules/excel/chartsheet.js +196 -0
- package/dist/browser/modules/excel/defined-names.d.ts +35 -0
- package/dist/browser/modules/excel/defined-names.js +44 -4
- package/dist/browser/modules/excel/errors.d.ts +6 -0
- package/dist/browser/modules/excel/errors.js +9 -0
- package/dist/browser/modules/excel/form-control.d.ts +6 -0
- package/dist/browser/modules/excel/form-control.js +17 -0
- package/dist/browser/modules/excel/image.js +12 -2
- package/dist/browser/modules/excel/pivot-chart.d.ts +7 -0
- package/dist/browser/modules/excel/pivot-chart.js +53 -0
- package/dist/browser/modules/excel/pivot-table.d.ts +55 -0
- package/dist/browser/modules/excel/pivot-table.js +35 -0
- package/dist/browser/modules/excel/range.js +5 -1
- package/dist/browser/modules/excel/sparkline/index.d.ts +7 -0
- package/dist/browser/modules/excel/sparkline/index.js +7 -0
- package/dist/browser/modules/excel/sparkline/sparkline.d.ts +206 -0
- package/dist/browser/modules/excel/sparkline/sparkline.js +750 -0
- package/dist/browser/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/browser/modules/excel/table.js +42 -6
- package/dist/browser/modules/excel/types.d.ts +72 -0
- package/dist/browser/modules/excel/utils/address.d.ts +18 -0
- package/dist/browser/modules/excel/utils/address.js +28 -0
- package/dist/browser/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/browser/modules/excel/utils/guid.d.ts +15 -0
- package/dist/browser/modules/excel/utils/guid.js +35 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +74 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.js +206 -9
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-table.js +177 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/context.js +191 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/index.js +102 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/reporter.js +61 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/types.js +12 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
- package/dist/browser/modules/excel/workbook.browser.d.ts +248 -30
- package/dist/browser/modules/excel/workbook.browser.js +966 -31
- package/dist/browser/modules/excel/workbook.d.ts +43 -0
- package/dist/browser/modules/excel/workbook.js +48 -0
- package/dist/browser/modules/excel/worksheet.d.ts +157 -3
- package/dist/browser/modules/excel/worksheet.js +394 -35
- package/dist/browser/modules/excel/xlsx/rel-type.d.ts +40 -0
- package/dist/browser/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
- package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
- package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
- package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
- package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
- package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
- package/dist/browser/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/browser/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/browser/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
- package/dist/browser/modules/excel/xlsx/xform/xsd-values.js +101 -0
- package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +4422 -78
- package/dist/browser/modules/pdf/builder/document-builder.d.ts +74 -0
- package/dist/browser/modules/pdf/builder/document-builder.js +507 -2
- package/dist/browser/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/browser/modules/pdf/excel-bridge.d.ts +69 -0
- package/dist/browser/modules/pdf/excel-bridge.js +683 -12
- package/dist/browser/modules/pdf/font/font-manager.d.ts +25 -0
- package/dist/browser/modules/pdf/font/font-manager.js +39 -0
- package/dist/browser/modules/pdf/index.d.ts +5 -2
- package/dist/browser/modules/pdf/index.js +3 -1
- package/dist/browser/modules/pdf/render/chart-surface.d.ts +33 -0
- package/dist/browser/modules/pdf/render/chart-surface.js +200 -0
- package/dist/browser/modules/pdf/render/layout-engine.d.ts +22 -1
- package/dist/browser/modules/pdf/render/layout-engine.js +436 -56
- package/dist/browser/modules/pdf/render/page-renderer.js +169 -28
- package/dist/browser/modules/pdf/render/pdf-exporter.js +117 -7
- package/dist/browser/modules/pdf/types.d.ts +227 -23
- package/dist/browser/modules/pdf/types.js +4 -0
- package/dist/browser/modules/pdf/word-bridge.d.ts +47 -0
- package/dist/browser/modules/pdf/word-bridge.js +304 -0
- package/dist/browser/modules/word/constants.d.ts +179 -0
- package/dist/browser/modules/word/constants.js +231 -0
- package/dist/browser/modules/word/content-types.d.ts +27 -0
- package/dist/browser/modules/word/content-types.js +53 -0
- package/dist/browser/modules/word/digital-signatures.d.ts +87 -0
- package/dist/browser/modules/word/digital-signatures.js +134 -0
- package/dist/browser/modules/word/document.d.ts +728 -0
- package/dist/browser/modules/word/document.js +1795 -0
- package/dist/browser/modules/word/docx-packager.d.ts +14 -0
- package/dist/browser/modules/word/docx-packager.js +822 -0
- package/dist/browser/modules/word/docx-reader.d.ts +11 -0
- package/dist/browser/modules/word/docx-reader.js +4929 -0
- package/dist/browser/modules/word/encryption.d.ts +102 -0
- package/dist/browser/modules/word/encryption.js +274 -0
- package/dist/browser/modules/word/errors.d.ts +49 -0
- package/dist/browser/modules/word/errors.js +68 -0
- package/dist/browser/modules/word/font-obfuscation.d.ts +31 -0
- package/dist/browser/modules/word/font-obfuscation.js +83 -0
- package/dist/browser/modules/word/html-renderer.d.ts +38 -0
- package/dist/browser/modules/word/html-renderer.js +782 -0
- package/dist/browser/modules/word/index.base.d.ts +19 -0
- package/dist/browser/modules/word/index.base.js +51 -0
- package/dist/browser/modules/word/index.browser.d.ts +4 -0
- package/dist/browser/modules/word/index.browser.js +4 -0
- package/dist/browser/modules/word/index.d.ts +4 -0
- package/dist/browser/modules/word/index.js +4 -0
- package/dist/browser/modules/word/internal-utils.d.ts +23 -0
- package/dist/browser/modules/word/internal-utils.js +54 -0
- package/dist/browser/modules/word/relationships.d.ts +31 -0
- package/dist/browser/modules/word/relationships.js +56 -0
- package/dist/browser/modules/word/types.d.ts +2325 -0
- package/dist/browser/modules/word/types.js +10 -0
- package/dist/browser/modules/word/units.d.ts +49 -0
- package/dist/browser/modules/word/units.js +111 -0
- package/dist/browser/modules/word/writers/chart-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/chart-writer.js +385 -0
- package/dist/browser/modules/word/writers/checkbox-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/checkbox-writer.js +42 -0
- package/dist/browser/modules/word/writers/comment-writer.d.ts +15 -0
- package/dist/browser/modules/word/writers/comment-writer.js +70 -0
- package/dist/browser/modules/word/writers/document-writer.d.ts +16 -0
- package/dist/browser/modules/word/writers/document-writer.js +461 -0
- package/dist/browser/modules/word/writers/footnote-writer.d.ts +11 -0
- package/dist/browser/modules/word/writers/footnote-writer.js +72 -0
- package/dist/browser/modules/word/writers/header-footer-writer.d.ts +13 -0
- package/dist/browser/modules/word/writers/header-footer-writer.js +129 -0
- package/dist/browser/modules/word/writers/image-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/image-writer.js +185 -0
- package/dist/browser/modules/word/writers/math-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/math-writer.js +428 -0
- package/dist/browser/modules/word/writers/numbering-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/numbering-writer.js +125 -0
- package/dist/browser/modules/word/writers/paragraph-writer.d.ts +13 -0
- package/dist/browser/modules/word/writers/paragraph-writer.js +516 -0
- package/dist/browser/modules/word/writers/parts-writer.d.ts +26 -0
- package/dist/browser/modules/word/writers/parts-writer.js +660 -0
- package/dist/browser/modules/word/writers/run-writer.d.ts +15 -0
- package/dist/browser/modules/word/writers/run-writer.js +649 -0
- package/dist/browser/modules/word/writers/section-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/section-writer.js +238 -0
- package/dist/browser/modules/word/writers/styles-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/styles-writer.js +242 -0
- package/dist/browser/modules/word/writers/table-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/table-writer.js +503 -0
- package/dist/browser/modules/word/writers/textbox-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/textbox-writer.js +53 -0
- package/dist/browser/modules/word/writers/toc-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/toc-writer.js +79 -0
- package/dist/browser/modules/xml/encode.d.ts +56 -7
- package/dist/browser/modules/xml/encode.js +157 -11
- package/dist/cjs/index.js +13 -2
- package/dist/cjs/modules/excel/chart/cache-populator.js +1178 -0
- package/dist/cjs/modules/excel/chart/chart-api.js +371 -0
- package/dist/cjs/modules/excel/chart/chart-builder.js +2440 -0
- package/dist/cjs/modules/excel/chart/chart-ex-builder.js +907 -0
- package/dist/cjs/modules/excel/chart/chart-ex-parser.js +1208 -0
- package/dist/cjs/modules/excel/chart/chart-ex-renderer.js +5364 -0
- package/dist/cjs/modules/excel/chart/chart-ex-types.js +12 -0
- package/dist/cjs/modules/excel/chart/chart-images.js +366 -0
- package/dist/cjs/modules/excel/chart/chart-presets.js +184 -0
- package/dist/cjs/modules/excel/chart/chart-renderer.js +6450 -0
- package/dist/cjs/modules/excel/chart/chart-sidecar.js +433 -0
- package/dist/cjs/modules/excel/chart/chart-utils.js +845 -0
- package/dist/cjs/modules/excel/chart/chart.js +1324 -0
- package/dist/cjs/modules/excel/chart/glyph-rasterizer.js +664 -0
- package/dist/cjs/modules/excel/chart/index.js +101 -0
- package/dist/cjs/modules/excel/chart/install.js +95 -0
- package/dist/cjs/modules/excel/chart/shape-properties.js +1577 -0
- package/dist/cjs/modules/excel/chart/stroke-font.js +1559 -0
- package/dist/cjs/modules/excel/chart/topojson.js +239 -0
- package/dist/cjs/modules/excel/chart/types.js +9 -0
- package/dist/cjs/modules/excel/chart-host-registry.js +96 -0
- package/dist/cjs/modules/excel/chartsheet.js +199 -0
- package/dist/cjs/modules/excel/defined-names.js +44 -4
- package/dist/cjs/modules/excel/errors.js +11 -1
- package/dist/cjs/modules/excel/form-control.js +17 -0
- package/dist/cjs/modules/excel/image.js +12 -2
- package/dist/cjs/modules/excel/pivot-chart.js +56 -0
- package/dist/cjs/modules/excel/pivot-table.js +35 -0
- package/dist/cjs/modules/excel/range.js +5 -1
- package/dist/cjs/modules/excel/sparkline/index.js +23 -0
- package/dist/cjs/modules/excel/sparkline/sparkline.js +756 -0
- package/dist/cjs/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/cjs/modules/excel/table.js +42 -6
- package/dist/cjs/modules/excel/utils/address.js +29 -0
- package/dist/cjs/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/cjs/modules/excel/utils/guid.js +38 -0
- package/dist/cjs/modules/excel/utils/ooxml-paths.js +246 -9
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +103 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart.js +2128 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chartsheet.js +29 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-content-types.js +184 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-drawing.js +270 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-pivot.js +107 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-relationships.js +188 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-structure.js +60 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-styles.js +92 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-table.js +180 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-workbook.js +166 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-worksheet.js +572 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/context.js +196 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/index.js +105 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/path-utils.js +168 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/reporter.js +66 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/types.js +13 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/xml-utils.js +110 -0
- package/dist/cjs/modules/excel/workbook.browser.js +973 -38
- package/dist/cjs/modules/excel/workbook.js +48 -0
- package/dist/cjs/modules/excel/worksheet.js +393 -34
- package/dist/cjs/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/cjs/modules/excel/xlsx/xform/chart/chart-space-xform.js +6003 -0
- package/dist/cjs/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +219 -0
- package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +149 -10
- package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/cjs/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +228 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/cjs/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/cjs/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +444 -0
- package/dist/cjs/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +195 -19
- package/dist/cjs/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/cjs/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/cjs/modules/excel/xlsx/xform/xsd-values.js +106 -0
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +4420 -76
- package/dist/cjs/modules/pdf/builder/document-builder.js +506 -1
- package/dist/cjs/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/cjs/modules/pdf/excel-bridge.js +684 -12
- package/dist/cjs/modules/pdf/font/font-manager.js +39 -0
- package/dist/cjs/modules/pdf/index.js +5 -1
- package/dist/cjs/modules/pdf/render/chart-surface.js +203 -0
- package/dist/cjs/modules/pdf/render/layout-engine.js +437 -56
- package/dist/cjs/modules/pdf/render/page-renderer.js +169 -28
- package/dist/cjs/modules/pdf/render/pdf-exporter.js +115 -5
- package/dist/cjs/modules/pdf/types.js +5 -0
- package/dist/cjs/modules/pdf/word-bridge.js +307 -0
- package/dist/cjs/modules/word/constants.js +234 -0
- package/dist/cjs/modules/word/content-types.js +57 -0
- package/dist/cjs/modules/word/digital-signatures.js +140 -0
- package/dist/cjs/modules/word/document.js +1909 -0
- package/dist/cjs/modules/word/docx-packager.js +825 -0
- package/dist/cjs/modules/word/docx-reader.js +4932 -0
- package/dist/cjs/modules/word/encryption.js +282 -0
- package/dist/cjs/modules/word/errors.js +88 -0
- package/dist/cjs/modules/word/font-obfuscation.js +88 -0
- package/dist/cjs/modules/word/html-renderer.js +785 -0
- package/dist/cjs/modules/word/index.base.js +199 -0
- package/dist/cjs/modules/word/index.browser.js +20 -0
- package/dist/cjs/modules/word/index.js +20 -0
- package/dist/cjs/modules/word/internal-utils.js +59 -0
- package/dist/cjs/modules/word/relationships.js +60 -0
- package/dist/cjs/modules/word/types.js +11 -0
- package/dist/cjs/modules/word/units.js +135 -0
- package/dist/cjs/modules/word/writers/chart-writer.js +388 -0
- package/dist/cjs/modules/word/writers/checkbox-writer.js +45 -0
- package/dist/cjs/modules/word/writers/comment-writer.js +74 -0
- package/dist/cjs/modules/word/writers/document-writer.js +465 -0
- package/dist/cjs/modules/word/writers/footnote-writer.js +76 -0
- package/dist/cjs/modules/word/writers/header-footer-writer.js +134 -0
- package/dist/cjs/modules/word/writers/image-writer.js +188 -0
- package/dist/cjs/modules/word/writers/math-writer.js +431 -0
- package/dist/cjs/modules/word/writers/numbering-writer.js +128 -0
- package/dist/cjs/modules/word/writers/paragraph-writer.js +521 -0
- package/dist/cjs/modules/word/writers/parts-writer.js +671 -0
- package/dist/cjs/modules/word/writers/run-writer.js +655 -0
- package/dist/cjs/modules/word/writers/section-writer.js +241 -0
- package/dist/cjs/modules/word/writers/styles-writer.js +245 -0
- package/dist/cjs/modules/word/writers/table-writer.js +506 -0
- package/dist/cjs/modules/word/writers/textbox-writer.js +56 -0
- package/dist/cjs/modules/word/writers/toc-writer.js +82 -0
- package/dist/cjs/modules/xml/encode.js +158 -11
- package/dist/esm/index.browser.js +20 -2
- package/dist/esm/index.js +9 -1
- package/dist/esm/modules/excel/chart/cache-populator.js +1171 -0
- package/dist/esm/modules/excel/chart/chart-api.js +364 -0
- package/dist/esm/modules/excel/chart/chart-builder.js +2432 -0
- package/dist/esm/modules/excel/chart/chart-ex-builder.js +903 -0
- package/dist/esm/modules/excel/chart/chart-ex-parser.js +1205 -0
- package/dist/esm/modules/excel/chart/chart-ex-renderer.js +5352 -0
- package/dist/esm/modules/excel/chart/chart-ex-types.js +11 -0
- package/dist/esm/modules/excel/chart/chart-images.js +363 -0
- package/dist/esm/modules/excel/chart/chart-presets.js +179 -0
- package/dist/esm/modules/excel/chart/chart-renderer.js +6440 -0
- package/dist/esm/modules/excel/chart/chart-sidecar.js +427 -0
- package/dist/esm/modules/excel/chart/chart-utils.js +821 -0
- package/dist/esm/modules/excel/chart/chart.js +1320 -0
- package/dist/esm/modules/excel/chart/glyph-rasterizer.js +658 -0
- package/dist/esm/modules/excel/chart/index.js +46 -0
- package/dist/esm/modules/excel/chart/install.js +91 -0
- package/dist/esm/modules/excel/chart/shape-properties.js +1557 -0
- package/dist/esm/modules/excel/chart/stroke-font.js +1556 -0
- package/dist/esm/modules/excel/chart/topojson.js +236 -0
- package/dist/esm/modules/excel/chart/types.js +8 -0
- package/dist/esm/modules/excel/chart-host-registry.js +90 -0
- package/dist/esm/modules/excel/chartsheet.js +196 -0
- package/dist/esm/modules/excel/defined-names.js +44 -4
- package/dist/esm/modules/excel/errors.js +9 -0
- package/dist/esm/modules/excel/form-control.js +17 -0
- package/dist/esm/modules/excel/image.js +12 -2
- package/dist/esm/modules/excel/pivot-chart.js +53 -0
- package/dist/esm/modules/excel/pivot-table.js +35 -0
- package/dist/esm/modules/excel/range.js +5 -1
- package/dist/esm/modules/excel/sparkline/index.js +7 -0
- package/dist/esm/modules/excel/sparkline/sparkline.js +750 -0
- package/dist/esm/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/esm/modules/excel/table.js +42 -6
- package/dist/esm/modules/excel/utils/address.js +28 -0
- package/dist/esm/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/esm/modules/excel/utils/guid.js +35 -0
- package/dist/esm/modules/excel/utils/ooxml-paths.js +206 -9
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-table.js +177 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/context.js +191 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/index.js +102 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/reporter.js +61 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/types.js +12 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
- package/dist/esm/modules/excel/workbook.browser.js +969 -34
- package/dist/esm/modules/excel/workbook.js +48 -0
- package/dist/esm/modules/excel/worksheet.js +394 -35
- package/dist/esm/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/esm/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
- package/dist/esm/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
- package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
- package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/esm/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/esm/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/esm/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
- package/dist/esm/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
- package/dist/esm/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/esm/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/esm/modules/excel/xlsx/xform/xsd-values.js +101 -0
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +4422 -78
- package/dist/esm/modules/pdf/builder/document-builder.js +507 -2
- package/dist/esm/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/esm/modules/pdf/excel-bridge.js +683 -12
- package/dist/esm/modules/pdf/font/font-manager.js +39 -0
- package/dist/esm/modules/pdf/index.js +3 -1
- package/dist/esm/modules/pdf/render/chart-surface.js +200 -0
- package/dist/esm/modules/pdf/render/layout-engine.js +436 -56
- package/dist/esm/modules/pdf/render/page-renderer.js +169 -28
- package/dist/esm/modules/pdf/render/pdf-exporter.js +117 -7
- package/dist/esm/modules/pdf/types.js +4 -0
- package/dist/esm/modules/pdf/word-bridge.js +304 -0
- package/dist/esm/modules/word/constants.js +231 -0
- package/dist/esm/modules/word/content-types.js +53 -0
- package/dist/esm/modules/word/digital-signatures.js +134 -0
- package/dist/esm/modules/word/document.js +1795 -0
- package/dist/esm/modules/word/docx-packager.js +822 -0
- package/dist/esm/modules/word/docx-reader.js +4929 -0
- package/dist/esm/modules/word/encryption.js +274 -0
- package/dist/esm/modules/word/errors.js +68 -0
- package/dist/esm/modules/word/font-obfuscation.js +83 -0
- package/dist/esm/modules/word/html-renderer.js +782 -0
- package/dist/esm/modules/word/index.base.js +51 -0
- package/dist/esm/modules/word/index.browser.js +4 -0
- package/dist/esm/modules/word/index.js +4 -0
- package/dist/esm/modules/word/internal-utils.js +54 -0
- package/dist/esm/modules/word/relationships.js +56 -0
- package/dist/esm/modules/word/types.js +10 -0
- package/dist/esm/modules/word/units.js +111 -0
- package/dist/esm/modules/word/writers/chart-writer.js +385 -0
- package/dist/esm/modules/word/writers/checkbox-writer.js +42 -0
- package/dist/esm/modules/word/writers/comment-writer.js +70 -0
- package/dist/esm/modules/word/writers/document-writer.js +461 -0
- package/dist/esm/modules/word/writers/footnote-writer.js +72 -0
- package/dist/esm/modules/word/writers/header-footer-writer.js +129 -0
- package/dist/esm/modules/word/writers/image-writer.js +185 -0
- package/dist/esm/modules/word/writers/math-writer.js +428 -0
- package/dist/esm/modules/word/writers/numbering-writer.js +125 -0
- package/dist/esm/modules/word/writers/paragraph-writer.js +516 -0
- package/dist/esm/modules/word/writers/parts-writer.js +660 -0
- package/dist/esm/modules/word/writers/run-writer.js +649 -0
- package/dist/esm/modules/word/writers/section-writer.js +238 -0
- package/dist/esm/modules/word/writers/styles-writer.js +242 -0
- package/dist/esm/modules/word/writers/table-writer.js +503 -0
- package/dist/esm/modules/word/writers/textbox-writer.js +53 -0
- package/dist/esm/modules/word/writers/toc-writer.js +79 -0
- package/dist/esm/modules/xml/encode.js +157 -11
- package/dist/iife/excelts.iife.js +11789 -687
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +52 -44
- package/dist/types/index.browser.d.ts +8 -5
- package/dist/types/index.d.ts +4 -2
- package/dist/types/modules/excel/chart/cache-populator.d.ts +49 -0
- package/dist/types/modules/excel/chart/chart-api.d.ts +92 -0
- package/dist/types/modules/excel/chart/chart-builder.d.ts +48 -0
- package/dist/types/modules/excel/chart/chart-ex-builder.d.ts +36 -0
- package/dist/types/modules/excel/chart/chart-ex-parser.d.ts +8 -0
- package/dist/types/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
- package/dist/types/modules/excel/chart/chart-ex-types.d.ts +531 -0
- package/dist/types/modules/excel/chart/chart-images.d.ts +78 -0
- package/dist/types/modules/excel/chart/chart-presets.d.ts +392 -0
- package/dist/types/modules/excel/chart/chart-renderer.d.ts +550 -0
- package/dist/types/modules/excel/chart/chart-sidecar.d.ts +21 -0
- package/dist/types/modules/excel/chart/chart-utils.d.ts +306 -0
- package/dist/types/modules/excel/chart/chart.d.ts +504 -0
- package/dist/types/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
- package/dist/types/modules/excel/chart/index.d.ts +54 -0
- package/dist/types/modules/excel/chart/install.d.ts +44 -0
- package/dist/types/modules/excel/chart/shape-properties.d.ts +156 -0
- package/dist/types/modules/excel/chart/stroke-font.d.ts +36 -0
- package/dist/types/modules/excel/chart/topojson.d.ts +98 -0
- package/dist/types/modules/excel/chart/types.d.ts +2559 -0
- package/dist/types/modules/excel/chart-host-registry.d.ts +157 -0
- package/dist/types/modules/excel/chartsheet.d.ts +102 -0
- package/dist/types/modules/excel/defined-names.d.ts +35 -0
- package/dist/types/modules/excel/errors.d.ts +6 -0
- package/dist/types/modules/excel/form-control.d.ts +6 -0
- package/dist/types/modules/excel/pivot-chart.d.ts +7 -0
- package/dist/types/modules/excel/pivot-table.d.ts +55 -0
- package/dist/types/modules/excel/sparkline/index.d.ts +7 -0
- package/dist/types/modules/excel/sparkline/sparkline.d.ts +206 -0
- package/dist/types/modules/excel/types.d.ts +72 -0
- package/dist/types/modules/excel/utils/address.d.ts +18 -0
- package/dist/types/modules/excel/utils/guid.d.ts +15 -0
- package/dist/types/modules/excel/utils/ooxml-paths.d.ts +74 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
- package/dist/types/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
- package/dist/types/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
- package/dist/types/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
- package/dist/types/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
- package/dist/types/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
- package/dist/types/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
- package/dist/types/modules/excel/workbook.browser.d.ts +248 -30
- package/dist/types/modules/excel/workbook.d.ts +43 -0
- package/dist/types/modules/excel/worksheet.d.ts +157 -3
- package/dist/types/modules/excel/xlsx/rel-type.d.ts +40 -0
- package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
- package/dist/types/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
- package/dist/types/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
- package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
- package/dist/types/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
- package/dist/types/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
- package/dist/types/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
- package/dist/types/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
- package/dist/types/modules/pdf/builder/document-builder.d.ts +74 -0
- package/dist/types/modules/pdf/excel-bridge.d.ts +69 -0
- package/dist/types/modules/pdf/font/font-manager.d.ts +25 -0
- package/dist/types/modules/pdf/index.d.ts +5 -2
- package/dist/types/modules/pdf/render/chart-surface.d.ts +33 -0
- package/dist/types/modules/pdf/render/layout-engine.d.ts +22 -1
- package/dist/types/modules/pdf/types.d.ts +227 -23
- package/dist/types/modules/pdf/word-bridge.d.ts +47 -0
- package/dist/types/modules/word/constants.d.ts +179 -0
- package/dist/types/modules/word/content-types.d.ts +27 -0
- package/dist/types/modules/word/digital-signatures.d.ts +87 -0
- package/dist/types/modules/word/document.d.ts +728 -0
- package/dist/types/modules/word/docx-packager.d.ts +14 -0
- package/dist/types/modules/word/docx-reader.d.ts +11 -0
- package/dist/types/modules/word/encryption.d.ts +102 -0
- package/dist/types/modules/word/errors.d.ts +49 -0
- package/dist/types/modules/word/font-obfuscation.d.ts +31 -0
- package/dist/types/modules/word/html-renderer.d.ts +38 -0
- package/dist/types/modules/word/index.base.d.ts +19 -0
- package/dist/types/modules/word/index.browser.d.ts +4 -0
- package/dist/types/modules/word/index.d.ts +4 -0
- package/dist/types/modules/word/internal-utils.d.ts +23 -0
- package/dist/types/modules/word/relationships.d.ts +31 -0
- package/dist/types/modules/word/types.d.ts +2325 -0
- package/dist/types/modules/word/units.d.ts +49 -0
- package/dist/types/modules/word/writers/chart-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/checkbox-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/comment-writer.d.ts +15 -0
- package/dist/types/modules/word/writers/document-writer.d.ts +16 -0
- package/dist/types/modules/word/writers/footnote-writer.d.ts +11 -0
- package/dist/types/modules/word/writers/header-footer-writer.d.ts +13 -0
- package/dist/types/modules/word/writers/image-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/math-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/numbering-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/paragraph-writer.d.ts +13 -0
- package/dist/types/modules/word/writers/parts-writer.d.ts +26 -0
- package/dist/types/modules/word/writers/run-writer.d.ts +15 -0
- package/dist/types/modules/word/writers/section-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/styles-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/table-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/textbox-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/toc-writer.d.ts +9 -0
- package/dist/types/modules/xml/encode.d.ts +56 -7
- package/package.json +29 -11
- package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +0 -48
- package/dist/browser/modules/excel/utils/ooxml-validator.js +0 -493
- package/dist/browser/modules/excel/utils/passthrough-manager.d.ts +0 -77
- package/dist/browser/modules/excel/utils/passthrough-manager.js +0 -129
- package/dist/cjs/modules/excel/utils/ooxml-validator.js +0 -499
- package/dist/cjs/modules/excel/utils/passthrough-manager.js +0 -133
- package/dist/esm/modules/excel/utils/ooxml-validator.js +0 -493
- package/dist/esm/modules/excel/utils/passthrough-manager.js +0 -129
- package/dist/types/modules/excel/utils/ooxml-validator.d.ts +0 -48
- package/dist/types/modules/excel/utils/passthrough-manager.d.ts +0 -77
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DOCX Writers - Document Body
|
|
4
|
+
*
|
|
5
|
+
* Renders the main word/document.xml part including all block-level
|
|
6
|
+
* content types: paragraphs, tables, floating images, TOC, math,
|
|
7
|
+
* text boxes, and structured document tags.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.CHART_RID_REGISTRY = void 0;
|
|
11
|
+
exports.renderDocument = renderDocument;
|
|
12
|
+
const constants_1 = require("../constants");
|
|
13
|
+
const checkbox_writer_1 = require("./checkbox-writer");
|
|
14
|
+
const image_writer_1 = require("./image-writer");
|
|
15
|
+
const math_writer_1 = require("./math-writer");
|
|
16
|
+
const paragraph_writer_1 = require("./paragraph-writer");
|
|
17
|
+
const parts_writer_1 = require("./parts-writer");
|
|
18
|
+
const section_writer_1 = require("./section-writer");
|
|
19
|
+
const table_writer_1 = require("./table-writer");
|
|
20
|
+
const textbox_writer_1 = require("./textbox-writer");
|
|
21
|
+
const toc_writer_1 = require("./toc-writer");
|
|
22
|
+
/** Render a structured document tag. */
|
|
23
|
+
function renderSdt(xml, sdt) {
|
|
24
|
+
xml.openNode("w:sdt");
|
|
25
|
+
if (sdt.properties) {
|
|
26
|
+
xml.openNode("w:sdtPr");
|
|
27
|
+
const p = sdt.properties;
|
|
28
|
+
// Auto-assign ID if not provided (Word strongly expects unique IDs)
|
|
29
|
+
const sdtId = p.id ?? nextAutoSdtId();
|
|
30
|
+
xml.leafNode("w:id", { "w:val": String(sdtId) });
|
|
31
|
+
if (p.tag) {
|
|
32
|
+
xml.leafNode("w:tag", { "w:val": p.tag });
|
|
33
|
+
}
|
|
34
|
+
if (p.alias) {
|
|
35
|
+
xml.leafNode("w:alias", { "w:val": p.alias });
|
|
36
|
+
}
|
|
37
|
+
// Lock: combine lockContent + lockSdt
|
|
38
|
+
if (p.lockContent && p.lockSdt) {
|
|
39
|
+
xml.leafNode("w:lock", { "w:val": "sdtContentLocked" });
|
|
40
|
+
}
|
|
41
|
+
else if (p.lockContent) {
|
|
42
|
+
xml.leafNode("w:lock", { "w:val": "contentLocked" });
|
|
43
|
+
}
|
|
44
|
+
else if (p.lockSdt) {
|
|
45
|
+
xml.leafNode("w:lock", { "w:val": "sdtLocked" });
|
|
46
|
+
}
|
|
47
|
+
// Appearance (w15:appearance for modern SDTs)
|
|
48
|
+
if (p.appearance) {
|
|
49
|
+
xml.leafNode("w15:appearance", { "w15:val": p.appearance });
|
|
50
|
+
}
|
|
51
|
+
else if (p.showAs) {
|
|
52
|
+
// Back-compat mapping of legacy showAs
|
|
53
|
+
const mapped = p.showAs === "boundingBox" ? "boundingBox" : p.showAs === "startEnd" ? "tags" : "hidden";
|
|
54
|
+
xml.leafNode("w15:appearance", { "w15:val": mapped });
|
|
55
|
+
}
|
|
56
|
+
// Show placeholder toggle
|
|
57
|
+
if (p.showingPlaceholder) {
|
|
58
|
+
xml.leafNode("w:showingPlcHdr");
|
|
59
|
+
}
|
|
60
|
+
if (p.placeholder) {
|
|
61
|
+
xml.openNode("w:placeholder");
|
|
62
|
+
xml.leafNode("w:docPart", { "w:val": p.placeholder });
|
|
63
|
+
xml.closeNode();
|
|
64
|
+
}
|
|
65
|
+
if (p.temporary) {
|
|
66
|
+
xml.leafNode("w:temporary");
|
|
67
|
+
}
|
|
68
|
+
if (p.dataBinding) {
|
|
69
|
+
const bindAttrs = {
|
|
70
|
+
"w:xpath": p.dataBinding.xpath,
|
|
71
|
+
"w:storeItemID": p.dataBinding.storeItemId
|
|
72
|
+
};
|
|
73
|
+
if (p.dataBinding.prefixMappings) {
|
|
74
|
+
bindAttrs["w:prefixMappings"] = p.dataBinding.prefixMappings;
|
|
75
|
+
}
|
|
76
|
+
xml.leafNode("w:dataBinding", bindAttrs);
|
|
77
|
+
}
|
|
78
|
+
// Type discriminator markers
|
|
79
|
+
if (p.plainText) {
|
|
80
|
+
xml.leafNode("w:text");
|
|
81
|
+
}
|
|
82
|
+
if (p.richText) {
|
|
83
|
+
xml.leafNode("w:richText");
|
|
84
|
+
}
|
|
85
|
+
if (p.picture) {
|
|
86
|
+
xml.leafNode("w:picture");
|
|
87
|
+
}
|
|
88
|
+
if (p.group) {
|
|
89
|
+
xml.leafNode("w:group");
|
|
90
|
+
}
|
|
91
|
+
if (p.equation) {
|
|
92
|
+
xml.leafNode("w:equation");
|
|
93
|
+
}
|
|
94
|
+
if (p.citation) {
|
|
95
|
+
xml.leafNode("w:citation");
|
|
96
|
+
}
|
|
97
|
+
if (p.bibliography) {
|
|
98
|
+
xml.leafNode("w:bibliography");
|
|
99
|
+
}
|
|
100
|
+
if (p.repeatingSectionItem) {
|
|
101
|
+
xml.leafNode("w15:repeatingSectionItem");
|
|
102
|
+
}
|
|
103
|
+
if (p.repeatingSection) {
|
|
104
|
+
// w15:repeatingSection has child elements (not attributes) per the schema
|
|
105
|
+
const rs = p.repeatingSection;
|
|
106
|
+
const hasChildren = rs.sectionTitle !== undefined || rs.allowInsertDelete !== undefined;
|
|
107
|
+
if (hasChildren) {
|
|
108
|
+
xml.openNode("w15:repeatingSection");
|
|
109
|
+
if (rs.sectionTitle !== undefined) {
|
|
110
|
+
xml.leafNode("w15:sectionTitle", { "w15:val": rs.sectionTitle });
|
|
111
|
+
}
|
|
112
|
+
if (rs.allowInsertDelete === false) {
|
|
113
|
+
xml.leafNode("w15:doNotAllowInsertDeleteSection");
|
|
114
|
+
}
|
|
115
|
+
xml.closeNode();
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
xml.leafNode("w15:repeatingSection");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Checkbox (w14 extension)
|
|
122
|
+
if (p.checkbox) {
|
|
123
|
+
xml.openNode("w14:checkbox");
|
|
124
|
+
xml.leafNode("w14:checked", p.checkbox.checked ? { "w14:val": "1" } : { "w14:val": "0" });
|
|
125
|
+
if (p.checkbox.checkedChar || p.checkbox.checkedFont) {
|
|
126
|
+
const cAttrs = {};
|
|
127
|
+
if (p.checkbox.checkedChar) {
|
|
128
|
+
cAttrs["w14:val"] = p.checkbox.checkedChar;
|
|
129
|
+
}
|
|
130
|
+
if (p.checkbox.checkedFont) {
|
|
131
|
+
cAttrs["w14:font"] = p.checkbox.checkedFont;
|
|
132
|
+
}
|
|
133
|
+
xml.leafNode("w14:checkedState", cAttrs);
|
|
134
|
+
}
|
|
135
|
+
if (p.checkbox.uncheckedChar || p.checkbox.uncheckedFont) {
|
|
136
|
+
const uAttrs = {};
|
|
137
|
+
if (p.checkbox.uncheckedChar) {
|
|
138
|
+
uAttrs["w14:val"] = p.checkbox.uncheckedChar;
|
|
139
|
+
}
|
|
140
|
+
if (p.checkbox.uncheckedFont) {
|
|
141
|
+
uAttrs["w14:font"] = p.checkbox.uncheckedFont;
|
|
142
|
+
}
|
|
143
|
+
xml.leafNode("w14:uncheckedState", uAttrs);
|
|
144
|
+
}
|
|
145
|
+
xml.closeNode();
|
|
146
|
+
}
|
|
147
|
+
// Dropdown list
|
|
148
|
+
if (p.dropdownList) {
|
|
149
|
+
xml.openNode("w:dropDownList");
|
|
150
|
+
for (const item of p.dropdownList) {
|
|
151
|
+
const attrs = { "w:value": item.value };
|
|
152
|
+
if (item.displayText) {
|
|
153
|
+
attrs["w:displayText"] = item.displayText;
|
|
154
|
+
}
|
|
155
|
+
xml.leafNode("w:listItem", attrs);
|
|
156
|
+
}
|
|
157
|
+
xml.closeNode();
|
|
158
|
+
}
|
|
159
|
+
// ComboBox
|
|
160
|
+
if (p.comboBox) {
|
|
161
|
+
xml.openNode("w:comboBox");
|
|
162
|
+
for (const item of p.comboBox) {
|
|
163
|
+
const attrs = { "w:value": item.value };
|
|
164
|
+
if (item.displayText) {
|
|
165
|
+
attrs["w:displayText"] = item.displayText;
|
|
166
|
+
}
|
|
167
|
+
xml.leafNode("w:listItem", attrs);
|
|
168
|
+
}
|
|
169
|
+
xml.closeNode();
|
|
170
|
+
}
|
|
171
|
+
// Date picker
|
|
172
|
+
if (p.date) {
|
|
173
|
+
const dateAttrs = {};
|
|
174
|
+
if (p.date.fullDate) {
|
|
175
|
+
dateAttrs["w:fullDate"] = p.date.fullDate;
|
|
176
|
+
}
|
|
177
|
+
xml.openNode("w:date", Object.keys(dateAttrs).length > 0 ? dateAttrs : undefined);
|
|
178
|
+
if (p.date.dateFormat) {
|
|
179
|
+
xml.leafNode("w:dateFormat", { "w:val": p.date.dateFormat });
|
|
180
|
+
}
|
|
181
|
+
if (p.date.lid) {
|
|
182
|
+
xml.leafNode("w:lid", { "w:val": p.date.lid });
|
|
183
|
+
}
|
|
184
|
+
if (p.date.storeMappedDataAs) {
|
|
185
|
+
xml.leafNode("w:storeMappedDataAs", { "w:val": p.date.storeMappedDataAs });
|
|
186
|
+
}
|
|
187
|
+
xml.closeNode();
|
|
188
|
+
}
|
|
189
|
+
xml.closeNode();
|
|
190
|
+
}
|
|
191
|
+
xml.openNode("w:sdtContent");
|
|
192
|
+
for (const child of sdt.content) {
|
|
193
|
+
if ("type" in child) {
|
|
194
|
+
if (child.type === "paragraph") {
|
|
195
|
+
(0, paragraph_writer_1.renderParagraph)(xml, child);
|
|
196
|
+
}
|
|
197
|
+
else if (child.type === "table") {
|
|
198
|
+
(0, table_writer_1.renderTable)(xml, child);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
xml.closeNode();
|
|
203
|
+
xml.closeNode();
|
|
204
|
+
}
|
|
205
|
+
/** Render a block-level content element. */
|
|
206
|
+
function renderBodyContent(xml, content) {
|
|
207
|
+
switch (content.type) {
|
|
208
|
+
case "paragraph":
|
|
209
|
+
(0, paragraph_writer_1.renderParagraph)(xml, content);
|
|
210
|
+
break;
|
|
211
|
+
case "table":
|
|
212
|
+
(0, table_writer_1.renderTable)(xml, content);
|
|
213
|
+
break;
|
|
214
|
+
case "floatingImage":
|
|
215
|
+
(0, image_writer_1.renderFloatingImage)(xml, content);
|
|
216
|
+
break;
|
|
217
|
+
case "tableOfContents":
|
|
218
|
+
(0, toc_writer_1.renderTableOfContents)(xml, content);
|
|
219
|
+
break;
|
|
220
|
+
case "math":
|
|
221
|
+
(0, math_writer_1.renderMathBlock)(xml, content);
|
|
222
|
+
break;
|
|
223
|
+
case "textBox":
|
|
224
|
+
(0, textbox_writer_1.renderTextBox)(xml, content);
|
|
225
|
+
break;
|
|
226
|
+
case "sdt":
|
|
227
|
+
renderSdt(xml, content);
|
|
228
|
+
break;
|
|
229
|
+
case "checkBox":
|
|
230
|
+
(0, checkbox_writer_1.renderCheckBox)(xml, content);
|
|
231
|
+
break;
|
|
232
|
+
case "drawingShape":
|
|
233
|
+
renderDrawingShape(xml, content);
|
|
234
|
+
break;
|
|
235
|
+
case "opaqueDrawing":
|
|
236
|
+
renderOpaqueDrawing(xml, content);
|
|
237
|
+
break;
|
|
238
|
+
case "chart":
|
|
239
|
+
renderChartDrawing(xml, content);
|
|
240
|
+
break;
|
|
241
|
+
case "altChunk":
|
|
242
|
+
xml.leafNode("w:altChunk", { "r:id": content.rId });
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** Render the complete word/document.xml. */
|
|
247
|
+
function renderDocument(xml, doc) {
|
|
248
|
+
xml.openXml(constants_1.STD_DOC_ATTRIBUTES);
|
|
249
|
+
xml.openNode("w:document", constants_1.DOCUMENT_NAMESPACES);
|
|
250
|
+
// Document background (must come before w:body)
|
|
251
|
+
if (doc.background) {
|
|
252
|
+
(0, parts_writer_1.renderDocumentBackground)(xml, doc.background);
|
|
253
|
+
}
|
|
254
|
+
xml.openNode("w:body");
|
|
255
|
+
for (const content of doc.body) {
|
|
256
|
+
renderBodyContent(xml, content);
|
|
257
|
+
}
|
|
258
|
+
// Final section properties (goes directly in w:body)
|
|
259
|
+
if (doc.sectionProperties) {
|
|
260
|
+
(0, section_writer_1.renderSectionProperties)(xml, doc.sectionProperties);
|
|
261
|
+
}
|
|
262
|
+
xml.closeNode(); // w:body
|
|
263
|
+
xml.closeNode(); // w:document
|
|
264
|
+
}
|
|
265
|
+
// =============================================================================
|
|
266
|
+
// DrawingML Shape Writer
|
|
267
|
+
// =============================================================================
|
|
268
|
+
function renderDrawingShape(xml, shape) {
|
|
269
|
+
// If rawXml is available, use it for round-trip fidelity
|
|
270
|
+
if (shape.rawXml) {
|
|
271
|
+
xml.writeRaw(shape.rawXml);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
// Wrap in w:p > w:r > w:drawing > wp:anchor > a:graphic > a:graphicData > wps:wsp
|
|
275
|
+
xml.openNode("w:p");
|
|
276
|
+
xml.openNode("w:r");
|
|
277
|
+
xml.openNode("w:drawing");
|
|
278
|
+
const anchorAttrs = {
|
|
279
|
+
distT: "0",
|
|
280
|
+
distB: "0",
|
|
281
|
+
distL: "114300",
|
|
282
|
+
distR: "114300",
|
|
283
|
+
simplePos: "0",
|
|
284
|
+
relativeHeight: "251658240",
|
|
285
|
+
behindDoc: shape.behindDoc ? "1" : "0",
|
|
286
|
+
locked: "0",
|
|
287
|
+
layoutInCell: "1",
|
|
288
|
+
allowOverlap: "1"
|
|
289
|
+
};
|
|
290
|
+
xml.openNode("wp:anchor", anchorAttrs);
|
|
291
|
+
xml.leafNode("wp:simplePos", { x: "0", y: "0" });
|
|
292
|
+
// Horizontal position
|
|
293
|
+
const hp = shape.horizontalPosition;
|
|
294
|
+
xml.openNode("wp:positionH", {
|
|
295
|
+
relativeFrom: hp?.relativeTo ?? "column"
|
|
296
|
+
});
|
|
297
|
+
if (hp?.align) {
|
|
298
|
+
xml.openNode("wp:align");
|
|
299
|
+
xml.writeText(hp.align);
|
|
300
|
+
xml.closeNode();
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
xml.openNode("wp:posOffset");
|
|
304
|
+
xml.writeText(String(hp?.offset ?? 0));
|
|
305
|
+
xml.closeNode();
|
|
306
|
+
}
|
|
307
|
+
xml.closeNode(); // wp:positionH
|
|
308
|
+
// Vertical position
|
|
309
|
+
const vp = shape.verticalPosition;
|
|
310
|
+
xml.openNode("wp:positionV", {
|
|
311
|
+
relativeFrom: vp?.relativeTo ?? "paragraph"
|
|
312
|
+
});
|
|
313
|
+
if (vp?.align) {
|
|
314
|
+
xml.openNode("wp:align");
|
|
315
|
+
xml.writeText(vp.align);
|
|
316
|
+
xml.closeNode();
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
xml.openNode("wp:posOffset");
|
|
320
|
+
xml.writeText(String(vp?.offset ?? 0));
|
|
321
|
+
xml.closeNode();
|
|
322
|
+
}
|
|
323
|
+
xml.closeNode(); // wp:positionV
|
|
324
|
+
xml.leafNode("wp:extent", {
|
|
325
|
+
cx: String(shape.width),
|
|
326
|
+
cy: String(shape.height)
|
|
327
|
+
});
|
|
328
|
+
xml.leafNode("wp:effectExtent", { l: "0", t: "0", r: "0", b: "0" });
|
|
329
|
+
// Wrap
|
|
330
|
+
const wrap = shape.wrap;
|
|
331
|
+
if (!wrap || wrap.style === "none") {
|
|
332
|
+
xml.leafNode("wp:wrapNone");
|
|
333
|
+
}
|
|
334
|
+
else if (wrap.style === "square") {
|
|
335
|
+
xml.leafNode("wp:wrapSquare", { wrapText: wrap.side ?? "bothSides" });
|
|
336
|
+
}
|
|
337
|
+
else if (wrap.style === "tight") {
|
|
338
|
+
xml.leafNode("wp:wrapTight", { wrapText: wrap.side ?? "bothSides" });
|
|
339
|
+
}
|
|
340
|
+
else if (wrap.style === "topAndBottom") {
|
|
341
|
+
xml.leafNode("wp:wrapTopAndBottom");
|
|
342
|
+
}
|
|
343
|
+
const docPrAttrs = { id: "1", name: shape.name ?? "Shape" };
|
|
344
|
+
if (shape.altText) {
|
|
345
|
+
docPrAttrs["descr"] = shape.altText;
|
|
346
|
+
}
|
|
347
|
+
xml.leafNode("wp:docPr", docPrAttrs);
|
|
348
|
+
xml.openNode("a:graphic", { "xmlns:a": constants_1.NS_A });
|
|
349
|
+
xml.openNode("a:graphicData", { uri: constants_1.NS_WPS });
|
|
350
|
+
xml.openNode("wps:wsp");
|
|
351
|
+
// Shape properties
|
|
352
|
+
xml.openNode("wps:spPr");
|
|
353
|
+
// Transform
|
|
354
|
+
xml.openNode("a:xfrm", shape.rotation ? { rot: String(shape.rotation) } : {});
|
|
355
|
+
xml.leafNode("a:off", { x: "0", y: "0" });
|
|
356
|
+
xml.leafNode("a:ext", { cx: String(shape.width), cy: String(shape.height) });
|
|
357
|
+
xml.closeNode(); // a:xfrm
|
|
358
|
+
// Preset geometry
|
|
359
|
+
xml.openNode("a:prstGeom", { prst: shape.shapeType });
|
|
360
|
+
xml.leafNode("a:avLst");
|
|
361
|
+
xml.closeNode(); // a:prstGeom
|
|
362
|
+
// Fill
|
|
363
|
+
if (shape.noFill) {
|
|
364
|
+
xml.leafNode("a:noFill");
|
|
365
|
+
}
|
|
366
|
+
else if (shape.fillColor) {
|
|
367
|
+
xml.openNode("a:solidFill");
|
|
368
|
+
xml.leafNode("a:srgbClr", { val: shape.fillColor });
|
|
369
|
+
xml.closeNode();
|
|
370
|
+
}
|
|
371
|
+
// Outline
|
|
372
|
+
const lnAttrs = {};
|
|
373
|
+
if (shape.outlineWidth) {
|
|
374
|
+
lnAttrs["w"] = String(shape.outlineWidth);
|
|
375
|
+
}
|
|
376
|
+
if (shape.outlineColor || shape.noOutline) {
|
|
377
|
+
xml.openNode("a:ln", lnAttrs);
|
|
378
|
+
if (shape.noOutline) {
|
|
379
|
+
xml.leafNode("a:noFill");
|
|
380
|
+
}
|
|
381
|
+
else if (shape.outlineColor) {
|
|
382
|
+
xml.openNode("a:solidFill");
|
|
383
|
+
xml.leafNode("a:srgbClr", { val: shape.outlineColor });
|
|
384
|
+
xml.closeNode();
|
|
385
|
+
}
|
|
386
|
+
xml.closeNode(); // a:ln
|
|
387
|
+
}
|
|
388
|
+
xml.closeNode(); // wps:spPr
|
|
389
|
+
// Text body
|
|
390
|
+
if (shape.textContent && shape.textContent.length > 0) {
|
|
391
|
+
xml.openNode("wps:txbx");
|
|
392
|
+
xml.openNode("w:txbxContent");
|
|
393
|
+
for (const para of shape.textContent) {
|
|
394
|
+
(0, paragraph_writer_1.renderParagraph)(xml, para);
|
|
395
|
+
}
|
|
396
|
+
xml.closeNode(); // w:txbxContent
|
|
397
|
+
xml.closeNode(); // wps:txbx
|
|
398
|
+
}
|
|
399
|
+
// Body properties (required)
|
|
400
|
+
xml.leafNode("wps:bodyPr");
|
|
401
|
+
xml.closeNode(); // wps:wsp
|
|
402
|
+
xml.closeNode(); // a:graphicData
|
|
403
|
+
xml.closeNode(); // a:graphic
|
|
404
|
+
xml.closeNode(); // wp:anchor
|
|
405
|
+
xml.closeNode(); // w:drawing
|
|
406
|
+
xml.closeNode(); // w:r
|
|
407
|
+
xml.closeNode(); // w:p
|
|
408
|
+
}
|
|
409
|
+
// =============================================================================
|
|
410
|
+
// Opaque Drawing Writer
|
|
411
|
+
// =============================================================================
|
|
412
|
+
function renderOpaqueDrawing(xml, drawing) {
|
|
413
|
+
xml.openNode("w:p");
|
|
414
|
+
xml.openNode("w:r");
|
|
415
|
+
xml.writeRaw(drawing.rawXml);
|
|
416
|
+
xml.closeNode(); // w:r
|
|
417
|
+
xml.closeNode(); // w:p
|
|
418
|
+
}
|
|
419
|
+
// =============================================================================
|
|
420
|
+
// Chart Drawing Writer (inline chart reference)
|
|
421
|
+
// =============================================================================
|
|
422
|
+
/**
|
|
423
|
+
* Registry mapping ChartContent → rId. Populated by packager before rendering.
|
|
424
|
+
* Uses a WeakMap so chart contents can be garbage collected.
|
|
425
|
+
*/
|
|
426
|
+
exports.CHART_RID_REGISTRY = new WeakMap();
|
|
427
|
+
/** Auto-incrementing SDT ID counter. */
|
|
428
|
+
let _autoSdtIdCounter = 100000000;
|
|
429
|
+
function nextAutoSdtId() {
|
|
430
|
+
return _autoSdtIdCounter++;
|
|
431
|
+
}
|
|
432
|
+
function renderChartDrawing(xml, content) {
|
|
433
|
+
const rId = exports.CHART_RID_REGISTRY.get(content) ?? "rId0";
|
|
434
|
+
const cx = content.chart.width ?? 5486400; // 6 inches default
|
|
435
|
+
const cy = content.chart.height ?? 3200400; // 3.5 inches default
|
|
436
|
+
xml.openNode("w:p");
|
|
437
|
+
xml.openNode("w:r");
|
|
438
|
+
xml.openNode("w:drawing");
|
|
439
|
+
xml.openNode("wp:inline", { distT: "0", distB: "0", distL: "0", distR: "0" });
|
|
440
|
+
xml.leafNode("wp:extent", { cx: String(cx), cy: String(cy) });
|
|
441
|
+
xml.leafNode("wp:effectExtent", { l: "0", t: "0", r: "0", b: "0" });
|
|
442
|
+
xml.leafNode("wp:docPr", {
|
|
443
|
+
id: "1",
|
|
444
|
+
name: content.name ?? "Chart",
|
|
445
|
+
...(content.altText ? { descr: content.altText } : {})
|
|
446
|
+
});
|
|
447
|
+
xml.leafNode("wp:cNvGraphicFramePr");
|
|
448
|
+
xml.openNode("a:graphic", {
|
|
449
|
+
"xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main"
|
|
450
|
+
});
|
|
451
|
+
xml.openNode("a:graphicData", {
|
|
452
|
+
uri: "http://schemas.openxmlformats.org/drawingml/2006/chart"
|
|
453
|
+
});
|
|
454
|
+
xml.leafNode("c:chart", {
|
|
455
|
+
"xmlns:c": "http://schemas.openxmlformats.org/drawingml/2006/chart",
|
|
456
|
+
"xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
|
|
457
|
+
"r:id": rId
|
|
458
|
+
});
|
|
459
|
+
xml.closeNode(); // a:graphicData
|
|
460
|
+
xml.closeNode(); // a:graphic
|
|
461
|
+
xml.closeNode(); // wp:inline
|
|
462
|
+
xml.closeNode(); // w:drawing
|
|
463
|
+
xml.closeNode(); // w:r
|
|
464
|
+
xml.closeNode(); // w:p
|
|
465
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DOCX Writers - Footnotes & Endnotes
|
|
4
|
+
*
|
|
5
|
+
* Renders word/footnotes.xml and word/endnotes.xml parts.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.renderFootnotes = renderFootnotes;
|
|
9
|
+
exports.renderEndnotes = renderEndnotes;
|
|
10
|
+
const constants_1 = require("../constants");
|
|
11
|
+
const paragraph_writer_1 = require("./paragraph-writer");
|
|
12
|
+
/** Render the default separator/continuation separator entries (required by Word). */
|
|
13
|
+
function renderDefaultSeparators(xml, elementName) {
|
|
14
|
+
// Separator (id=-1)
|
|
15
|
+
xml.openNode(elementName, { "w:type": "separator", "w:id": "-1" });
|
|
16
|
+
xml.openNode("w:p");
|
|
17
|
+
xml.openNode("w:r");
|
|
18
|
+
xml.leafNode("w:separator");
|
|
19
|
+
xml.closeNode();
|
|
20
|
+
xml.closeNode();
|
|
21
|
+
xml.closeNode();
|
|
22
|
+
// Continuation separator (id=0)
|
|
23
|
+
xml.openNode(elementName, { "w:type": "continuationSeparator", "w:id": "0" });
|
|
24
|
+
xml.openNode("w:p");
|
|
25
|
+
xml.openNode("w:r");
|
|
26
|
+
xml.leafNode("w:continuationSeparator");
|
|
27
|
+
xml.closeNode();
|
|
28
|
+
xml.closeNode();
|
|
29
|
+
xml.closeNode();
|
|
30
|
+
}
|
|
31
|
+
/** Render a single footnote/endnote entry. */
|
|
32
|
+
function renderNote(xml, elementName, note) {
|
|
33
|
+
const attrs = { "w:id": String(note.id) };
|
|
34
|
+
if (note.type && note.type !== "normal") {
|
|
35
|
+
attrs["w:type"] = note.type;
|
|
36
|
+
}
|
|
37
|
+
xml.openNode(elementName, attrs);
|
|
38
|
+
for (const para of note.content) {
|
|
39
|
+
(0, paragraph_writer_1.renderParagraph)(xml, para);
|
|
40
|
+
}
|
|
41
|
+
xml.closeNode();
|
|
42
|
+
}
|
|
43
|
+
/** Render word/footnotes.xml. */
|
|
44
|
+
function renderFootnotes(xml, footnotes) {
|
|
45
|
+
xml.openXml(constants_1.STD_DOC_ATTRIBUTES);
|
|
46
|
+
xml.openNode("w:footnotes", {
|
|
47
|
+
"xmlns:w": constants_1.NS_W,
|
|
48
|
+
"xmlns:r": constants_1.NS_R
|
|
49
|
+
});
|
|
50
|
+
// If the caller already provided separator entries (by having any id <= 0), use those.
|
|
51
|
+
// Otherwise, synthesize the default separators.
|
|
52
|
+
const hasSeparators = footnotes.some(fn => fn.id <= 0);
|
|
53
|
+
if (!hasSeparators) {
|
|
54
|
+
renderDefaultSeparators(xml, "w:footnote");
|
|
55
|
+
}
|
|
56
|
+
for (const fn of footnotes) {
|
|
57
|
+
renderNote(xml, "w:footnote", fn);
|
|
58
|
+
}
|
|
59
|
+
xml.closeNode();
|
|
60
|
+
}
|
|
61
|
+
/** Render word/endnotes.xml. */
|
|
62
|
+
function renderEndnotes(xml, endnotes) {
|
|
63
|
+
xml.openXml(constants_1.STD_DOC_ATTRIBUTES);
|
|
64
|
+
xml.openNode("w:endnotes", {
|
|
65
|
+
"xmlns:w": constants_1.NS_W,
|
|
66
|
+
"xmlns:r": constants_1.NS_R
|
|
67
|
+
});
|
|
68
|
+
const hasSeparators = endnotes.some(en => en.id <= 0);
|
|
69
|
+
if (!hasSeparators) {
|
|
70
|
+
renderDefaultSeparators(xml, "w:endnote");
|
|
71
|
+
}
|
|
72
|
+
for (const en of endnotes) {
|
|
73
|
+
renderNote(xml, "w:endnote", en);
|
|
74
|
+
}
|
|
75
|
+
xml.closeNode();
|
|
76
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DOCX Writers - Headers & Footers
|
|
4
|
+
*
|
|
5
|
+
* Renders word/header{N}.xml and word/footer{N}.xml parts.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.renderHeader = renderHeader;
|
|
9
|
+
exports.renderFooter = renderFooter;
|
|
10
|
+
exports.renderWatermarkHeader = renderWatermarkHeader;
|
|
11
|
+
const constants_1 = require("../constants");
|
|
12
|
+
const paragraph_writer_1 = require("./paragraph-writer");
|
|
13
|
+
const table_writer_1 = require("./table-writer");
|
|
14
|
+
/** Render content blocks (shared between header and footer). */
|
|
15
|
+
function renderContent(xml, content) {
|
|
16
|
+
for (const child of content.children) {
|
|
17
|
+
if (child.type === "paragraph") {
|
|
18
|
+
(0, paragraph_writer_1.renderParagraph)(xml, child);
|
|
19
|
+
}
|
|
20
|
+
else if (child.type === "table") {
|
|
21
|
+
(0, table_writer_1.renderTable)(xml, child);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Render a header part (word/header{N}.xml). */
|
|
26
|
+
function renderHeader(xml, content) {
|
|
27
|
+
xml.openXml(constants_1.STD_DOC_ATTRIBUTES);
|
|
28
|
+
xml.openNode("w:hdr", {
|
|
29
|
+
"xmlns:w": constants_1.NS_W,
|
|
30
|
+
"xmlns:r": constants_1.NS_R
|
|
31
|
+
});
|
|
32
|
+
renderContent(xml, content);
|
|
33
|
+
xml.closeNode();
|
|
34
|
+
}
|
|
35
|
+
/** Render a footer part (word/footer{N}.xml). */
|
|
36
|
+
function renderFooter(xml, content) {
|
|
37
|
+
xml.openXml(constants_1.STD_DOC_ATTRIBUTES);
|
|
38
|
+
xml.openNode("w:ftr", {
|
|
39
|
+
"xmlns:w": constants_1.NS_W,
|
|
40
|
+
"xmlns:r": constants_1.NS_R
|
|
41
|
+
});
|
|
42
|
+
renderContent(xml, content);
|
|
43
|
+
xml.closeNode();
|
|
44
|
+
}
|
|
45
|
+
/** Render a header part containing a watermark. */
|
|
46
|
+
function renderWatermarkHeader(xml, watermark, imageRId) {
|
|
47
|
+
xml.openXml(constants_1.STD_DOC_ATTRIBUTES);
|
|
48
|
+
xml.openNode("w:hdr", {
|
|
49
|
+
"xmlns:w": constants_1.NS_W,
|
|
50
|
+
"xmlns:r": constants_1.NS_R,
|
|
51
|
+
"xmlns:v": constants_1.NS_V,
|
|
52
|
+
"xmlns:o": constants_1.NS_O,
|
|
53
|
+
"xmlns:w10": constants_1.NS_W10
|
|
54
|
+
});
|
|
55
|
+
// Watermark goes in a paragraph with a single pict run
|
|
56
|
+
xml.openNode("w:p");
|
|
57
|
+
xml.openNode("w:pPr");
|
|
58
|
+
xml.openNode("w:pStyle");
|
|
59
|
+
xml.closeNode();
|
|
60
|
+
xml.closeNode(); // pPr
|
|
61
|
+
xml.openNode("w:r");
|
|
62
|
+
xml.openNode("w:pict");
|
|
63
|
+
if (watermark.type === "text") {
|
|
64
|
+
renderTextWatermarkVml(xml, watermark);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
renderImageWatermarkVml(xml, watermark, imageRId);
|
|
68
|
+
}
|
|
69
|
+
xml.closeNode(); // pict
|
|
70
|
+
xml.closeNode(); // r
|
|
71
|
+
xml.closeNode(); // p
|
|
72
|
+
xml.closeNode(); // hdr
|
|
73
|
+
}
|
|
74
|
+
function renderTextWatermarkVml(xml, wm) {
|
|
75
|
+
const color = wm.color ?? "C0C0C0";
|
|
76
|
+
const font = wm.font ?? "Calibri";
|
|
77
|
+
const fontSize = wm.fontSize ?? 1; // half-points; Word uses pt string in style
|
|
78
|
+
const fontPt = fontSize / 2;
|
|
79
|
+
const rotation = wm.rotation ?? -45;
|
|
80
|
+
const opacity = wm.semiTransparent !== false ? ".5" : "1";
|
|
81
|
+
// VML shape for text watermark (PowerWash / WASHOUT style)
|
|
82
|
+
xml.leafNode("v:shapetype", {
|
|
83
|
+
id: "_x0000_t136",
|
|
84
|
+
coordsize: "21600,21600",
|
|
85
|
+
"o:spt": "136",
|
|
86
|
+
path: "m@7,l@8,m@5,21600l@6,21600e"
|
|
87
|
+
});
|
|
88
|
+
const style = `position:absolute;margin-left:0;margin-top:0;width:468pt;height:234pt;` +
|
|
89
|
+
`rotation:${rotation};z-index:-251658752;mso-position-horizontal:center;` +
|
|
90
|
+
`mso-position-horizontal-relative:margin;mso-position-vertical:center;` +
|
|
91
|
+
`mso-position-vertical-relative:margin`;
|
|
92
|
+
xml.openNode("v:shape", {
|
|
93
|
+
id: "PowerPlusWaterMarkObject",
|
|
94
|
+
"o:spid": "_x0000_s2049",
|
|
95
|
+
type: "#_x0000_t136",
|
|
96
|
+
style,
|
|
97
|
+
"o:allowincell": "f",
|
|
98
|
+
fillcolor: `#${color}`,
|
|
99
|
+
stroked: "f"
|
|
100
|
+
});
|
|
101
|
+
xml.leafNode("v:fill", { opacity });
|
|
102
|
+
xml.leafNode("v:textpath", {
|
|
103
|
+
style: `font-family:"${font}";font-size:${fontPt}pt`,
|
|
104
|
+
string: wm.text
|
|
105
|
+
});
|
|
106
|
+
xml.leafNode("w10:wrap", { anchorx: "margin", anchory: "margin" });
|
|
107
|
+
xml.closeNode(); // v:shape
|
|
108
|
+
}
|
|
109
|
+
function renderImageWatermarkVml(xml, wm, rId) {
|
|
110
|
+
const scale = wm.scale ?? 100;
|
|
111
|
+
const rid = rId ?? wm.rId;
|
|
112
|
+
const style = `position:absolute;margin-left:0;margin-top:0;width:0;height:0;` +
|
|
113
|
+
`z-index:-251658752;mso-position-horizontal:center;` +
|
|
114
|
+
`mso-position-horizontal-relative:margin;mso-position-vertical:center;` +
|
|
115
|
+
`mso-position-vertical-relative:margin`;
|
|
116
|
+
xml.openNode("v:shape", {
|
|
117
|
+
id: "PowerPlusWaterMarkObject",
|
|
118
|
+
"o:spid": "_x0000_s2050",
|
|
119
|
+
type: "",
|
|
120
|
+
style,
|
|
121
|
+
"o:allowincell": "f"
|
|
122
|
+
});
|
|
123
|
+
const gain = wm.washout !== false ? "19661f" : "65536f";
|
|
124
|
+
const blacklevel = wm.washout !== false ? "22938f" : "0";
|
|
125
|
+
xml.leafNode("v:imagedata", {
|
|
126
|
+
"r:id": rid,
|
|
127
|
+
"o:title": "",
|
|
128
|
+
gain,
|
|
129
|
+
blacklevel,
|
|
130
|
+
...(scale !== 100 ? { "o:detectmouseclick": "t" } : {})
|
|
131
|
+
});
|
|
132
|
+
xml.leafNode("w10:wrap", { anchorx: "margin", anchory: "margin" });
|
|
133
|
+
xml.closeNode(); // v:shape
|
|
134
|
+
}
|