@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,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Reader/writer for Office 365 "threaded comments" (`<ThreadedComments>`
|
|
4
|
+
* XML root) and the workbook-level person directory (`<personList>`).
|
|
5
|
+
*
|
|
6
|
+
* Threaded comments live in a separate part tree from classic VML
|
|
7
|
+
* comments:
|
|
8
|
+
*
|
|
9
|
+
* - `xl/threadedComments/threadedComment{N}.xml` — one per sheet
|
|
10
|
+
* that has threaded comments; referenced from the sheet rels
|
|
11
|
+
* - `xl/persons/person.xml` — workbook-level person directory;
|
|
12
|
+
* referenced from the workbook rels
|
|
13
|
+
*
|
|
14
|
+
* The schema lives in Microsoft's extension namespace
|
|
15
|
+
* `http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments`
|
|
16
|
+
* (for comments) and the older `…/2018/threadedcomments` for persons
|
|
17
|
+
* (identical URI tag-shared).
|
|
18
|
+
*
|
|
19
|
+
* This module is intentionally free of runtime xform plumbing —
|
|
20
|
+
* threaded comments are a discrete part with only text content, so
|
|
21
|
+
* two small render/parse functions suffice and plug directly into
|
|
22
|
+
* `xlsx.browser.ts` and `workbook.browser.ts`.
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.renderThreadedComments = renderThreadedComments;
|
|
26
|
+
exports.parseThreadedComments = parseThreadedComments;
|
|
27
|
+
exports.renderPersonList = renderPersonList;
|
|
28
|
+
exports.parsePersonList = parsePersonList;
|
|
29
|
+
const guid_1 = require("../../../utils/guid.js");
|
|
30
|
+
const dom_1 = require("../../../../xml/dom.js");
|
|
31
|
+
const encode_1 = require("../../../../xml/encode.js");
|
|
32
|
+
const TC_NAMESPACE = "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments";
|
|
33
|
+
/**
|
|
34
|
+
* Render the threaded-comment part for a single worksheet.
|
|
35
|
+
*
|
|
36
|
+
* Input is a list of `(cellRef, comment)` pairs — the cell ref is
|
|
37
|
+
* stored as the `ref` attribute on each `<threadedComment>`, not on
|
|
38
|
+
* the public {@link ThreadedComment} type (which doesn't carry it so
|
|
39
|
+
* the same structure can be shared between the public API and the
|
|
40
|
+
* XForm).
|
|
41
|
+
*
|
|
42
|
+
* Input order is preserved — Excel relies on parent-child ordering
|
|
43
|
+
* when rendering conversation threads, so callers must keep replies
|
|
44
|
+
* after their parents.
|
|
45
|
+
*/
|
|
46
|
+
function renderThreadedComments(entries) {
|
|
47
|
+
const parts = [];
|
|
48
|
+
parts.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');
|
|
49
|
+
parts.push(`<ThreadedComments xmlns="${TC_NAMESPACE}">`);
|
|
50
|
+
for (const { ref, comment: c } of entries) {
|
|
51
|
+
const id = c.id ?? `{${(0, guid_1.synthGuid)()}}`;
|
|
52
|
+
const attrs = [`ref="${escapeAttr(ref)}"`];
|
|
53
|
+
if (c.date) {
|
|
54
|
+
attrs.push(`dT="${escapeAttr(c.date)}"`);
|
|
55
|
+
}
|
|
56
|
+
attrs.push(`personId="${escapeAttr(c.personId)}"`);
|
|
57
|
+
attrs.push(`id="${escapeAttr(id)}"`);
|
|
58
|
+
if (c.parentId) {
|
|
59
|
+
attrs.push(`parentId="${escapeAttr(c.parentId)}"`);
|
|
60
|
+
}
|
|
61
|
+
if (c.done !== undefined) {
|
|
62
|
+
attrs.push(`done="${c.done ? "1" : "0"}"`);
|
|
63
|
+
}
|
|
64
|
+
parts.push(`<threadedComment ${attrs.join(" ")}>`);
|
|
65
|
+
parts.push(`<text>${escapeXml(c.text)}</text>`);
|
|
66
|
+
if (c.mentions && c.mentions.length > 0) {
|
|
67
|
+
parts.push("<mentions>");
|
|
68
|
+
for (const m of c.mentions) {
|
|
69
|
+
// `startIndex` and `length` are `xsd:unsignedInt` per the
|
|
70
|
+
// threaded-comments schema — negative, non-integer, or
|
|
71
|
+
// non-finite values produce XML that strict validators (and
|
|
72
|
+
// Excel's own reader) reject. Fail loud with a descriptive
|
|
73
|
+
// error rather than ship a broken comment part.
|
|
74
|
+
if (!isNonNegativeInt(m.startIndex)) {
|
|
75
|
+
throw new Error(`Threaded comment mention.startIndex must be a non-negative integer; got ${m.startIndex}.`);
|
|
76
|
+
}
|
|
77
|
+
if (!isNonNegativeInt(m.length)) {
|
|
78
|
+
throw new Error(`Threaded comment mention.length must be a non-negative integer; got ${m.length}.`);
|
|
79
|
+
}
|
|
80
|
+
const mAttrs = [
|
|
81
|
+
`mentionpersonId="${escapeAttr(m.mentionPersonId)}"`,
|
|
82
|
+
`mentionId="${escapeAttr(m.mentionId ?? `{${(0, guid_1.synthGuid)()}}`)}"`,
|
|
83
|
+
`startIndex="${m.startIndex}"`,
|
|
84
|
+
`length="${m.length}"`
|
|
85
|
+
];
|
|
86
|
+
parts.push(`<mention ${mAttrs.join(" ")}/>`);
|
|
87
|
+
}
|
|
88
|
+
parts.push("</mentions>");
|
|
89
|
+
}
|
|
90
|
+
parts.push(`</threadedComment>`);
|
|
91
|
+
}
|
|
92
|
+
parts.push(`</ThreadedComments>`);
|
|
93
|
+
return parts.join("");
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Parse a `xl/threadedComments/threadedComment{N}.xml` payload into
|
|
97
|
+
* structured per-cell entries. Returns an empty array on malformed
|
|
98
|
+
* input — the caller can silently drop threaded comments rather than
|
|
99
|
+
* failing the entire workbook load.
|
|
100
|
+
*/
|
|
101
|
+
function parseThreadedComments(rawXml) {
|
|
102
|
+
let root;
|
|
103
|
+
try {
|
|
104
|
+
root = (0, dom_1.parseXml)(rawXml).root;
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
const result = [];
|
|
110
|
+
for (const el of (0, dom_1.findChildren)(root, "threadedComment")) {
|
|
111
|
+
const ref = el.attributes.ref;
|
|
112
|
+
if (!ref) {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const personId = el.attributes.personId;
|
|
116
|
+
if (!personId) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const textEl = (0, dom_1.findChild)(el, "text");
|
|
120
|
+
const mentionsEl = (0, dom_1.findChild)(el, "mentions");
|
|
121
|
+
const mentions = mentionsEl
|
|
122
|
+
? (0, dom_1.findChildren)(mentionsEl, "mention").map(m => ({
|
|
123
|
+
mentionId: m.attributes.mentionId,
|
|
124
|
+
mentionPersonId: m.attributes.mentionpersonId ?? "",
|
|
125
|
+
startIndex: parseInt(m.attributes.startIndex ?? "0", 10),
|
|
126
|
+
length: parseInt(m.attributes.length ?? "0", 10)
|
|
127
|
+
}))
|
|
128
|
+
: [];
|
|
129
|
+
const comment = {
|
|
130
|
+
personId,
|
|
131
|
+
text: textEl ? (0, dom_1.textContent)(textEl) : "",
|
|
132
|
+
...(el.attributes.id ? { id: el.attributes.id } : {}),
|
|
133
|
+
...(el.attributes.parentId ? { parentId: el.attributes.parentId } : {}),
|
|
134
|
+
...(el.attributes.dT ? { date: el.attributes.dT } : {}),
|
|
135
|
+
...(el.attributes.done !== undefined ? { done: el.attributes.done === "1" } : {}),
|
|
136
|
+
...(mentions.length > 0 ? { mentions } : {})
|
|
137
|
+
};
|
|
138
|
+
result.push({ ref, comment });
|
|
139
|
+
}
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Render the workbook-level `xl/persons/person.xml` part.
|
|
144
|
+
*/
|
|
145
|
+
function renderPersonList(persons) {
|
|
146
|
+
const parts = [];
|
|
147
|
+
parts.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');
|
|
148
|
+
parts.push(`<personList xmlns="${TC_NAMESPACE}">`);
|
|
149
|
+
for (const p of persons) {
|
|
150
|
+
const attrs = [
|
|
151
|
+
`displayName="${escapeAttr(p.displayName)}"`,
|
|
152
|
+
`id="${escapeAttr(p.id)}"`
|
|
153
|
+
];
|
|
154
|
+
if (p.userId !== undefined) {
|
|
155
|
+
attrs.push(`userId="${escapeAttr(p.userId)}"`);
|
|
156
|
+
}
|
|
157
|
+
if (p.providerId !== undefined) {
|
|
158
|
+
attrs.push(`providerId="${escapeAttr(p.providerId)}"`);
|
|
159
|
+
}
|
|
160
|
+
parts.push(`<person ${attrs.join(" ")}/>`);
|
|
161
|
+
}
|
|
162
|
+
parts.push(`</personList>`);
|
|
163
|
+
return parts.join("");
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Parse `xl/persons/person.xml` into a {@link ThreadedCommentPerson}
|
|
167
|
+
* list. Missing ids are auto-generated so downstream parts that
|
|
168
|
+
* reference the list don't accidentally collide.
|
|
169
|
+
*/
|
|
170
|
+
function parsePersonList(rawXml) {
|
|
171
|
+
let root;
|
|
172
|
+
try {
|
|
173
|
+
root = (0, dom_1.parseXml)(rawXml).root;
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
return (0, dom_1.findChildren)(root, "person")
|
|
179
|
+
.map(el => {
|
|
180
|
+
const id = el.attributes.id ?? `{${(0, guid_1.synthGuid)()}}`;
|
|
181
|
+
const displayName = el.attributes.displayName ?? "";
|
|
182
|
+
if (!displayName) {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
const entry = { id, displayName };
|
|
186
|
+
if (el.attributes.userId !== undefined) {
|
|
187
|
+
entry.userId = el.attributes.userId;
|
|
188
|
+
}
|
|
189
|
+
if (el.attributes.providerId !== undefined) {
|
|
190
|
+
entry.providerId = el.attributes.providerId;
|
|
191
|
+
}
|
|
192
|
+
return entry;
|
|
193
|
+
})
|
|
194
|
+
.filter((x) => x !== undefined);
|
|
195
|
+
}
|
|
196
|
+
function escapeXml(value) {
|
|
197
|
+
// Route through the canonical encoder so the writer strips
|
|
198
|
+
// XML-illegal control characters / lone surrogates in user-supplied
|
|
199
|
+
// comment text. The previous manual `.replace` chain only handled
|
|
200
|
+
// `& < >` and left every other hazard untouched — e.g. a pasted
|
|
201
|
+
// `\u0008` corrupted the whole `<ThreadedComments>` part on save.
|
|
202
|
+
return (0, encode_1.xmlEncode)(value);
|
|
203
|
+
}
|
|
204
|
+
function escapeAttr(value) {
|
|
205
|
+
// Attribute values additionally need `\t \n \r` encoded as
|
|
206
|
+
// numeric character references so XML attribute-value normalisation
|
|
207
|
+
// doesn't collapse them to literal spaces; a threaded comment
|
|
208
|
+
// `personId` / `id` GUID shouldn't ever contain whitespace but the
|
|
209
|
+
// `ref` / `displayName` attributes can carry user input.
|
|
210
|
+
return (0, encode_1.xmlEncodeAttr)(value);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Whether `v` is a finite non-negative integer suitable for the
|
|
214
|
+
* `xsd:unsignedInt` attributes used by the threaded-comments schema.
|
|
215
|
+
* Rejects `NaN`, `±Infinity`, negative numbers, and fractional values.
|
|
216
|
+
*/
|
|
217
|
+
function isNonNegativeInt(v) {
|
|
218
|
+
return typeof v === "number" && Number.isFinite(v) && v >= 0 && Math.floor(v) === v;
|
|
219
|
+
}
|
|
@@ -38,6 +38,14 @@ class ContentTypesXform extends base_xform_1.BaseXform {
|
|
|
38
38
|
ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
|
+
if (model.chartsheets) {
|
|
42
|
+
model.chartsheets.forEach((cs) => {
|
|
43
|
+
xmlStream.leafNode("Override", {
|
|
44
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)((0, ooxml_paths_1.chartsheetPath)(cs.sheetNo)),
|
|
45
|
+
ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml"
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
41
49
|
if ((model.pivotTables ?? []).length) {
|
|
42
50
|
// R9-B6: Deduplicate cache content types by cacheId. When multiple pivot tables
|
|
43
51
|
// share the same cache, the cache definition/records files are written only once.
|
|
@@ -125,11 +133,105 @@ class ContentTypesXform extends base_xform_1.BaseXform {
|
|
|
125
133
|
});
|
|
126
134
|
});
|
|
127
135
|
}
|
|
128
|
-
|
|
136
|
+
if (model.chartEntries) {
|
|
137
|
+
for (const [n, entry] of Object.entries(model.chartEntries)) {
|
|
138
|
+
xmlStream.leafNode("Override", {
|
|
139
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)((0, ooxml_paths_1.chartPath)(n)),
|
|
140
|
+
ContentType: "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"
|
|
141
|
+
});
|
|
142
|
+
if (entry?.userShapesXml) {
|
|
143
|
+
// `c:userShapes` overlay drawings use the same DrawingML
|
|
144
|
+
// content type as worksheet drawings — Excel distinguishes
|
|
145
|
+
// them via the relationship type, not the content-type.
|
|
146
|
+
xmlStream.leafNode("Override", {
|
|
147
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)((0, ooxml_paths_1.chartUserShapesPath)(n)),
|
|
148
|
+
ContentType: "application/vnd.openxmlformats-officedocument.drawing+xml"
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// Track every ChartEx PartName already emitted so the structured
|
|
154
|
+
// and raw entry loops can't duplicate an Override. Open Packaging
|
|
155
|
+
// mandates at most one `<Override>` per PartName — a duplicate
|
|
156
|
+
// surfaces as the "damaged workbook" dialog in Excel. Using an
|
|
157
|
+
// explicit Set also guards against any future drift in the key
|
|
158
|
+
// shape between `chartExEntries` and `chartExStructuredEntries`.
|
|
159
|
+
const chartExPartNamesEmitted = new Set();
|
|
160
|
+
if (model.chartExEntries) {
|
|
161
|
+
for (const n of Object.keys(model.chartExEntries)) {
|
|
162
|
+
const partName = (0, ooxml_paths_1.toContentTypesPartName)((0, ooxml_paths_1.chartExPath)(n));
|
|
163
|
+
if (chartExPartNamesEmitted.has(partName)) {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
chartExPartNamesEmitted.add(partName);
|
|
167
|
+
xmlStream.leafNode("Override", {
|
|
168
|
+
PartName: partName,
|
|
169
|
+
// Microsoft's canonical content type for ChartEx parts is
|
|
170
|
+
// `application/vnd.ms-office.chartex+xml` — ALL lowercase.
|
|
171
|
+
// Earlier versions of this library emitted the camel-cased
|
|
172
|
+
// `chartEx+xml` variant; Excel 2016+ is strict about this and
|
|
173
|
+
// drops any chartEx whose content-type doesn't match exactly,
|
|
174
|
+
// which cascades into "Removed Part: /xl/drawings/drawingN.xml
|
|
175
|
+
// (Drawing shape)" because the parent drawing's r:id pointer
|
|
176
|
+
// is left dangling.
|
|
177
|
+
ContentType: "application/vnd.ms-office.chartex+xml"
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (model.chartExStructuredEntries) {
|
|
182
|
+
for (const n of Object.keys(model.chartExStructuredEntries)) {
|
|
183
|
+
const partName = (0, ooxml_paths_1.toContentTypesPartName)((0, ooxml_paths_1.chartExPath)(n));
|
|
184
|
+
if (chartExPartNamesEmitted.has(partName)) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
chartExPartNamesEmitted.add(partName);
|
|
188
|
+
xmlStream.leafNode("Override", {
|
|
189
|
+
PartName: partName,
|
|
190
|
+
ContentType: "application/vnd.ms-office.chartex+xml"
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (model.chartStyles) {
|
|
195
|
+
for (const n of Object.keys(model.chartStyles)) {
|
|
196
|
+
xmlStream.leafNode("Override", {
|
|
197
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)((0, ooxml_paths_1.chartStylePath)(n)),
|
|
198
|
+
ContentType: "application/vnd.ms-office.chartstyle+xml"
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (model.chartColors) {
|
|
203
|
+
for (const n of Object.keys(model.chartColors)) {
|
|
204
|
+
xmlStream.leafNode("Override", {
|
|
205
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)((0, ooxml_paths_1.chartColorsPath)(n)),
|
|
206
|
+
ContentType: "application/vnd.ms-office.chartcolorstyle+xml"
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (model.chartExStyles) {
|
|
211
|
+
for (const n of Object.keys(model.chartExStyles)) {
|
|
212
|
+
xmlStream.leafNode("Override", {
|
|
213
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)((0, ooxml_paths_1.chartExStylePath)(n)),
|
|
214
|
+
ContentType: "application/vnd.ms-office.chartstyle+xml"
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (model.chartExColors) {
|
|
219
|
+
for (const n of Object.keys(model.chartExColors)) {
|
|
220
|
+
xmlStream.leafNode("Override", {
|
|
221
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)((0, ooxml_paths_1.chartExColorsPath)(n)),
|
|
222
|
+
ContentType: "application/vnd.ms-office.chartcolorstyle+xml"
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// VML extension is needed for comments, form controls, header
|
|
227
|
+
// watermarks, OR any chartsheet that carries a `<legacyDrawing>`
|
|
228
|
+
// reference — that last case pins a VML part body through the
|
|
229
|
+
// package without the worksheet loop declaring the extension.
|
|
129
230
|
const hasComments = model.commentRefs && model.commentRefs.length > 0;
|
|
130
231
|
const hasFormControls = model.formControlRefs && model.formControlRefs.length > 0;
|
|
131
232
|
const hasHeaderWatermark = model.hasHeaderWatermark === true;
|
|
132
|
-
|
|
233
|
+
const hasChartsheetVml = model.hasChartsheetVml === true;
|
|
234
|
+
if (hasComments || hasFormControls || hasHeaderWatermark || hasChartsheetVml) {
|
|
133
235
|
xmlStream.leafNode("Default", {
|
|
134
236
|
Extension: "vml",
|
|
135
237
|
ContentType: "application/vnd.openxmlformats-officedocument.vmlDrawing"
|
|
@@ -151,14 +253,51 @@ class ContentTypesXform extends base_xform_1.BaseXform {
|
|
|
151
253
|
});
|
|
152
254
|
}
|
|
153
255
|
}
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
256
|
+
// Office 365 threaded comments: each worksheet that has them gets
|
|
257
|
+
// its own override, and the workbook-level person directory gets
|
|
258
|
+
// one more. Writers populate `model.threadedCommentSheetIds` with
|
|
259
|
+
// the worksheet ids that need parts; absent entry means no
|
|
260
|
+
// threaded comments on that sheet.
|
|
261
|
+
const threadedCommentSheetIds = model.threadedCommentSheetIds ?? [];
|
|
262
|
+
for (const sheetId of threadedCommentSheetIds) {
|
|
263
|
+
xmlStream.leafNode("Override", {
|
|
264
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)(`xl/threadedComments/threadedComment${sheetId}.xml`),
|
|
265
|
+
ContentType: "application/vnd.ms-excel.threadedcomments+xml"
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
if (model.hasPersons) {
|
|
269
|
+
xmlStream.leafNode("Override", {
|
|
270
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)("xl/persons/person.xml"),
|
|
271
|
+
ContentType: "application/vnd.ms-excel.person+xml"
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
// Raw-passthrough parts for slicers / timelines. The path lists
|
|
275
|
+
// were populated in `prepareModel` from the workbook's captured
|
|
276
|
+
// raw parts. Content type URIs come from MS-XLSX §2.1.32 and the
|
|
277
|
+
// 2011 timeline extension addendum.
|
|
278
|
+
for (const path of model.slicerPartPaths ?? []) {
|
|
279
|
+
xmlStream.leafNode("Override", {
|
|
280
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)(path),
|
|
281
|
+
ContentType: "application/vnd.ms-excel.slicer+xml"
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
for (const path of model.slicerCachePartPaths ?? []) {
|
|
285
|
+
xmlStream.leafNode("Override", {
|
|
286
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)(path),
|
|
287
|
+
ContentType: "application/vnd.ms-excel.slicerCache+xml"
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
for (const path of model.timelinePartPaths ?? []) {
|
|
291
|
+
xmlStream.leafNode("Override", {
|
|
292
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)(path),
|
|
293
|
+
ContentType: "application/vnd.ms-excel.timeline+xml"
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
for (const path of model.timelineCachePartPaths ?? []) {
|
|
297
|
+
xmlStream.leafNode("Override", {
|
|
298
|
+
PartName: (0, ooxml_paths_1.toContentTypesPartName)(path),
|
|
299
|
+
ContentType: "application/vnd.ms-excel.timelineCache+xml"
|
|
300
|
+
});
|
|
162
301
|
}
|
|
163
302
|
xmlStream.leafNode("Override", {
|
|
164
303
|
PartName: (0, ooxml_paths_1.toContentTypesPartName)(ooxml_paths_1.OOXML_PATHS.docPropsCore),
|
|
@@ -4,6 +4,7 @@ exports.AbsoluteAnchorXform = void 0;
|
|
|
4
4
|
const base_xform_1 = require("../base-xform.js");
|
|
5
5
|
const base_cell_anchor_xform_1 = require("./base-cell-anchor-xform.js");
|
|
6
6
|
const ext_xform_1 = require("./ext-xform.js");
|
|
7
|
+
const graphic_frame_xform_1 = require("./graphic-frame-xform.js");
|
|
7
8
|
const pic_xform_1 = require("./pic-xform.js");
|
|
8
9
|
const static_xform_1 = require("../static-xform.js");
|
|
9
10
|
/** https://en.wikipedia.org/wiki/Office_Open_XML_file_formats#DrawingML */
|
|
@@ -63,6 +64,15 @@ class AbsoluteAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
|
|
|
63
64
|
"xdr:pos": new PosXform(),
|
|
64
65
|
"xdr:ext": new ext_xform_1.ExtXform({ tag: "xdr:ext" }),
|
|
65
66
|
"xdr:pic": new pic_xform_1.PicXform(),
|
|
67
|
+
// `xdr:graphicFrame` carries the chart / embedded object payload
|
|
68
|
+
// for absolute-anchor sheet drawings. The oneCell / twoCell
|
|
69
|
+
// counterparts already handled it; the absolute branch was
|
|
70
|
+
// pic-only, so a chart authored with an absolute anchor (or
|
|
71
|
+
// programmatically constructed via `{ pos, ext }`) silently
|
|
72
|
+
// dropped its graphicFrame on write — the drawing XML emitted
|
|
73
|
+
// `<xdr:absoluteAnchor><xdr:pos/><xdr:ext/><xdr:clientData/></xdr:absoluteAnchor>`
|
|
74
|
+
// with no chart reference, so the anchor was ignored on open.
|
|
75
|
+
"xdr:graphicFrame": new graphic_frame_xform_1.GraphicFrameXform(),
|
|
66
76
|
"xdr:clientData": new static_xform_1.StaticXform({ tag: "xdr:clientData" })
|
|
67
77
|
};
|
|
68
78
|
}
|
|
@@ -73,6 +83,9 @@ class AbsoluteAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
|
|
|
73
83
|
if (model.picture) {
|
|
74
84
|
this.map["xdr:pic"].prepare(model.picture, options);
|
|
75
85
|
}
|
|
86
|
+
else if (model.graphicFrame) {
|
|
87
|
+
this.map["xdr:graphicFrame"].prepare(model.graphicFrame, options);
|
|
88
|
+
}
|
|
76
89
|
}
|
|
77
90
|
render(xmlStream, model) {
|
|
78
91
|
xmlStream.openNode(this.tag);
|
|
@@ -81,6 +94,9 @@ class AbsoluteAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
|
|
|
81
94
|
if (model.picture) {
|
|
82
95
|
this.map["xdr:pic"].render(xmlStream, model.picture);
|
|
83
96
|
}
|
|
97
|
+
else if (model.graphicFrame) {
|
|
98
|
+
this.map["xdr:graphicFrame"].render(xmlStream, model.graphicFrame);
|
|
99
|
+
}
|
|
84
100
|
this.map["xdr:clientData"].render(xmlStream, {});
|
|
85
101
|
xmlStream.closeNode();
|
|
86
102
|
}
|
|
@@ -96,13 +112,16 @@ class AbsoluteAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
|
|
|
96
112
|
this.model.range.pos = this.map["xdr:pos"].model;
|
|
97
113
|
this.model.range.ext = this.map["xdr:ext"].model;
|
|
98
114
|
this.model.picture = this.map["xdr:pic"].model;
|
|
115
|
+
this.model.graphicFrame = this.map["xdr:graphicFrame"].model;
|
|
99
116
|
return false;
|
|
100
117
|
default:
|
|
101
118
|
return true;
|
|
102
119
|
}
|
|
103
120
|
}
|
|
104
121
|
reconcile(model, options) {
|
|
105
|
-
|
|
122
|
+
if (model.picture) {
|
|
123
|
+
model.medium = this.reconcilePicture(model.picture, options);
|
|
124
|
+
}
|
|
106
125
|
}
|
|
107
126
|
}
|
|
108
127
|
exports.AbsoluteAnchorXform = AbsoluteAnchorXform;
|
|
@@ -17,6 +17,15 @@ function getAnchorType(model) {
|
|
|
17
17
|
class DrawingXform extends base_xform_1.BaseXform {
|
|
18
18
|
constructor() {
|
|
19
19
|
super();
|
|
20
|
+
// mc:AlternateContent parse state
|
|
21
|
+
this._inAlternateContent = false;
|
|
22
|
+
this._acDepth = 0;
|
|
23
|
+
this._inChoice = false;
|
|
24
|
+
this._inFallback = false;
|
|
25
|
+
this._fallbackDepth = 0;
|
|
26
|
+
this._choiceRequires = undefined;
|
|
27
|
+
/** Number of anchors before entering mc:AlternateContent — used to tag new anchors */
|
|
28
|
+
this._anchorCountBeforeAC = 0;
|
|
20
29
|
this.map = {
|
|
21
30
|
"xdr:twoCellAnchor": new two_cell_anchor_xform_1.TwoCellAnchorXform(),
|
|
22
31
|
"xdr:oneCellAnchor": new one_cell_anchor_xform_1.OneCellAnchorXform(),
|
|
@@ -37,7 +46,27 @@ class DrawingXform extends base_xform_1.BaseXform {
|
|
|
37
46
|
render(xmlStream, model) {
|
|
38
47
|
const renderModel = model || this.model;
|
|
39
48
|
xmlStream.openXml(writer_1.StdDocAttributes);
|
|
40
|
-
|
|
49
|
+
// `<xdr:wsDr>` must declare every namespace prefix any descendant
|
|
50
|
+
// uses. Inline `xmlns:mc=…` declarations on a deeply nested
|
|
51
|
+
// `<mc:AlternateContent>` are legal XML and strictly sufficient for
|
|
52
|
+
// the parser, but Microsoft Excel's **drawing validator** walks the
|
|
53
|
+
// anchor tree ahead of the parser and rejects the whole drawing
|
|
54
|
+
// when it encounters an element whose prefix was not pre-declared
|
|
55
|
+
// on the wsDr root ("Removed Part: /xl/drawings/drawingN.xml
|
|
56
|
+
// part. (Drawing shape)"). Excel's own output for any drawing that
|
|
57
|
+
// hosts ChartEx content therefore declares all six prefixes —
|
|
58
|
+
// `xdr`, `a`, `r`, `c`, `mc`, `cx` — at the root.
|
|
59
|
+
//
|
|
60
|
+
// Switch to the extended namespace set whenever any anchor carries
|
|
61
|
+
// `alternateContent` metadata (form-control shapes, ChartEx
|
|
62
|
+
// charts, and their `cx1` variants all use the same wrapper). The
|
|
63
|
+
// bare `xdr` + `a` set is correct for "legacy only" drawings and
|
|
64
|
+
// round-trips byte-for-byte with Excel's output for those files.
|
|
65
|
+
const needsMcNamespaces = renderModel.anchors.some(a => !!a?.alternateContent);
|
|
66
|
+
const rootAttrs = needsMcNamespaces
|
|
67
|
+
? DrawingXform.DRAWING_ATTRIBUTES_WITH_MC
|
|
68
|
+
: DrawingXform.DRAWING_ATTRIBUTES;
|
|
69
|
+
xmlStream.openNode(this.tag, rootAttrs);
|
|
41
70
|
renderModel.anchors.forEach(item => {
|
|
42
71
|
const anchor = this.map[item.anchorType];
|
|
43
72
|
anchor.render(xmlStream, item);
|
|
@@ -45,6 +74,12 @@ class DrawingXform extends base_xform_1.BaseXform {
|
|
|
45
74
|
xmlStream.closeNode();
|
|
46
75
|
}
|
|
47
76
|
parseOpen(node) {
|
|
77
|
+
// Inside mc:Fallback — skip everything
|
|
78
|
+
if (this._inFallback) {
|
|
79
|
+
this._fallbackDepth++;
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
// Delegate to active parser
|
|
48
83
|
if (this.parser) {
|
|
49
84
|
this.parser.parseOpen(node);
|
|
50
85
|
return true;
|
|
@@ -52,11 +87,29 @@ class DrawingXform extends base_xform_1.BaseXform {
|
|
|
52
87
|
switch (node.name) {
|
|
53
88
|
case this.tag:
|
|
54
89
|
this.reset();
|
|
55
|
-
this.model = {
|
|
56
|
-
|
|
57
|
-
|
|
90
|
+
this.model = { anchors: [] };
|
|
91
|
+
break;
|
|
92
|
+
case "mc:AlternateContent":
|
|
93
|
+
this._acDepth = (this._acDepth ?? 0) + 1;
|
|
94
|
+
if (this._acDepth === 1) {
|
|
95
|
+
this._inAlternateContent = true;
|
|
96
|
+
this._anchorCountBeforeAC = this.model.anchors.length;
|
|
97
|
+
}
|
|
98
|
+
break;
|
|
99
|
+
case "mc:Choice":
|
|
100
|
+
if (this._inAlternateContent) {
|
|
101
|
+
this._inChoice = true;
|
|
102
|
+
this._choiceRequires = node.attributes?.Requires;
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case "mc:Fallback":
|
|
106
|
+
if (this._inAlternateContent) {
|
|
107
|
+
this._inFallback = true;
|
|
108
|
+
this._fallbackDepth = 1;
|
|
109
|
+
}
|
|
58
110
|
break;
|
|
59
111
|
default:
|
|
112
|
+
// Normal anchor dispatch (works both inside mc:Choice and at top level)
|
|
60
113
|
this.parser = this.map[node.name];
|
|
61
114
|
if (this.parser) {
|
|
62
115
|
this.parser.parseOpen(node);
|
|
@@ -66,11 +119,22 @@ class DrawingXform extends base_xform_1.BaseXform {
|
|
|
66
119
|
return true;
|
|
67
120
|
}
|
|
68
121
|
parseText(text) {
|
|
122
|
+
if (this._inFallback) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
69
125
|
if (this.parser) {
|
|
70
126
|
this.parser.parseText(text);
|
|
71
127
|
}
|
|
72
128
|
}
|
|
73
129
|
parseClose(name) {
|
|
130
|
+
// Inside mc:Fallback — skip until closed
|
|
131
|
+
if (this._inFallback) {
|
|
132
|
+
this._fallbackDepth--;
|
|
133
|
+
if (this._fallbackDepth === 0) {
|
|
134
|
+
this._inFallback = false;
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
74
138
|
if (this.parser) {
|
|
75
139
|
if (!this.parser.parseClose(name)) {
|
|
76
140
|
this.model.anchors.push(this.parser.model);
|
|
@@ -81,8 +145,26 @@ class DrawingXform extends base_xform_1.BaseXform {
|
|
|
81
145
|
switch (name) {
|
|
82
146
|
case this.tag:
|
|
83
147
|
return false;
|
|
148
|
+
case "mc:AlternateContent":
|
|
149
|
+
this._acDepth = (this._acDepth ?? 0) - 1;
|
|
150
|
+
if (this._acDepth <= 0) {
|
|
151
|
+
// Tag any anchors added during this mc:AlternateContent with alternateContent info
|
|
152
|
+
if (this._inAlternateContent && this._choiceRequires) {
|
|
153
|
+
const anchors = this.model.anchors;
|
|
154
|
+
for (let i = this._anchorCountBeforeAC; i < anchors.length; i++) {
|
|
155
|
+
anchors[i].alternateContent = { requires: this._choiceRequires };
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
this._inAlternateContent = false;
|
|
159
|
+
this._inChoice = false;
|
|
160
|
+
this._choiceRequires = undefined;
|
|
161
|
+
this._acDepth = 0;
|
|
162
|
+
}
|
|
163
|
+
return true;
|
|
164
|
+
case "mc:Choice":
|
|
165
|
+
this._inChoice = false;
|
|
166
|
+
return true;
|
|
84
167
|
default:
|
|
85
|
-
// could be some unrecognised tags
|
|
86
168
|
return true;
|
|
87
169
|
}
|
|
88
170
|
}
|
|
@@ -105,3 +187,25 @@ DrawingXform.DRAWING_ATTRIBUTES = {
|
|
|
105
187
|
"xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
|
|
106
188
|
"xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main"
|
|
107
189
|
};
|
|
190
|
+
/**
|
|
191
|
+
* Extended namespace set used when the drawing contains anchors
|
|
192
|
+
* wrapped in `<mc:AlternateContent>` — the ChartEx case. Excel's
|
|
193
|
+
* strict loader requires the `mc`, `r`, `c`, and `cx` prefixes at
|
|
194
|
+
* the root of `<xdr:wsDr>` before it will parse `<mc:Choice>` /
|
|
195
|
+
* `<cx:chart>` descendants. Declaring them only inside the inner
|
|
196
|
+
* `<mc:AlternateContent>` element (as earlier versions did) made
|
|
197
|
+
* Excel reject the drawing and report "Removed Part:
|
|
198
|
+
* /xl/drawings/drawingN.xml (Drawing shape)".
|
|
199
|
+
*
|
|
200
|
+
* Mirrors what Excel itself emits when it writes a drawing that
|
|
201
|
+
* hosts a ChartEx chart — see `__tests__/data/workbook-roundtrip-
|
|
202
|
+
* chartex.xlsx` (fixtures authored by Excel 2016+).
|
|
203
|
+
*/
|
|
204
|
+
DrawingXform.DRAWING_ATTRIBUTES_WITH_MC = {
|
|
205
|
+
"xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
|
|
206
|
+
"xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
|
|
207
|
+
"xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
|
|
208
|
+
"xmlns:c": "http://schemas.openxmlformats.org/drawingml/2006/chart",
|
|
209
|
+
"xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
|
|
210
|
+
"xmlns:cx": "http://schemas.microsoft.com/office/drawing/2014/chartex"
|
|
211
|
+
};
|