@cj-tech-master/excelts 9.4.2-canary.20260425155718.b3d09e9 → 9.4.2
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/modules/excel/form-control.d.ts +0 -6
- package/dist/browser/modules/excel/form-control.js +0 -17
- package/dist/browser/modules/excel/image.js +2 -12
- package/dist/browser/modules/excel/range.js +1 -5
- package/dist/browser/modules/excel/stream/worksheet-writer.js +2 -3
- package/dist/browser/modules/excel/table.js +2 -30
- package/dist/browser/modules/excel/utils/drawing-utils.js +4 -4
- package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +0 -28
- package/dist/browser/modules/excel/utils/ooxml-paths.js +0 -110
- package/dist/browser/modules/excel/utils/passthrough-manager.d.ts +77 -0
- package/dist/browser/modules/excel/utils/passthrough-manager.js +129 -0
- package/dist/browser/modules/excel/workbook.browser.d.ts +8 -65
- package/dist/browser/modules/excel/workbook.browser.js +9 -95
- package/dist/browser/modules/excel/worksheet.d.ts +2 -73
- package/dist/browser/modules/excel/worksheet.js +6 -193
- package/dist/browser/modules/excel/xlsx/rel-type.d.ts +0 -6
- package/dist/browser/modules/excel/xlsx/rel-type.js +1 -7
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +9 -27
- package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +10 -53
- 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 +0 -8
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +4 -66
- package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +1 -3
- package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +3 -18
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +0 -2
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +2 -20
- package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +0 -1
- package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +2 -38
- package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +15 -119
- package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +19 -14
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +75 -324
- package/dist/browser/modules/pdf/index.d.ts +0 -3
- package/dist/browser/modules/pdf/index.js +0 -2
- package/dist/cjs/modules/excel/form-control.js +0 -17
- package/dist/cjs/modules/excel/image.js +2 -12
- package/dist/cjs/modules/excel/range.js +1 -5
- package/dist/cjs/modules/excel/stream/worksheet-writer.js +2 -3
- package/dist/cjs/modules/excel/table.js +2 -30
- package/dist/cjs/modules/excel/utils/drawing-utils.js +4 -4
- package/dist/cjs/modules/excel/utils/ooxml-paths.js +0 -138
- package/dist/cjs/modules/excel/utils/passthrough-manager.js +133 -0
- package/dist/cjs/modules/excel/workbook.browser.js +9 -95
- package/dist/cjs/modules/excel/worksheet.js +6 -193
- package/dist/cjs/modules/excel/xlsx/rel-type.js +1 -7
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +9 -27
- package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +9 -52
- 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 +4 -66
- package/dist/cjs/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +3 -18
- package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +2 -20
- package/dist/cjs/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +2 -38
- package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +14 -118
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +74 -323
- package/dist/cjs/modules/pdf/index.js +1 -4
- package/dist/esm/modules/excel/form-control.js +0 -17
- package/dist/esm/modules/excel/image.js +2 -12
- package/dist/esm/modules/excel/range.js +1 -5
- package/dist/esm/modules/excel/stream/worksheet-writer.js +2 -3
- package/dist/esm/modules/excel/table.js +2 -30
- package/dist/esm/modules/excel/utils/drawing-utils.js +4 -4
- package/dist/esm/modules/excel/utils/ooxml-paths.js +0 -110
- package/dist/esm/modules/excel/utils/passthrough-manager.js +129 -0
- package/dist/esm/modules/excel/workbook.browser.js +9 -95
- package/dist/esm/modules/excel/worksheet.js +6 -193
- package/dist/esm/modules/excel/xlsx/rel-type.js +1 -7
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +9 -27
- package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +10 -53
- 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 +4 -66
- package/dist/esm/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +3 -18
- package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +2 -20
- package/dist/esm/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +2 -38
- package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +15 -119
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +75 -324
- package/dist/esm/modules/pdf/index.js +0 -2
- package/dist/iife/excelts.iife.js +264 -6156
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +35 -49
- package/dist/types/modules/excel/form-control.d.ts +0 -6
- package/dist/types/modules/excel/utils/ooxml-paths.d.ts +0 -28
- package/dist/types/modules/excel/utils/passthrough-manager.d.ts +77 -0
- package/dist/types/modules/excel/workbook.browser.d.ts +8 -65
- package/dist/types/modules/excel/worksheet.d.ts +2 -73
- package/dist/types/modules/excel/xlsx/rel-type.d.ts +0 -6
- package/dist/types/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +0 -8
- package/dist/types/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +1 -3
- package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +0 -2
- package/dist/types/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +0 -1
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +19 -14
- package/dist/types/modules/pdf/index.d.ts +0 -3
- package/package.json +2 -21
- package/dist/browser/modules/excel/chart/cache-populator.d.ts +0 -33
- package/dist/browser/modules/excel/chart/cache-populator.js +0 -319
- package/dist/browser/modules/excel/chart/chart-builder.d.ts +0 -19
- package/dist/browser/modules/excel/chart/chart-builder.js +0 -1395
- package/dist/browser/modules/excel/chart/chart-ex-builder.d.ts +0 -11
- package/dist/browser/modules/excel/chart/chart-ex-builder.js +0 -177
- package/dist/browser/modules/excel/chart/chart-ex-renderer.d.ts +0 -13
- package/dist/browser/modules/excel/chart/chart-ex-renderer.js +0 -549
- package/dist/browser/modules/excel/chart/chart-ex-types.d.ts +0 -283
- package/dist/browser/modules/excel/chart/chart-ex-types.js +0 -11
- package/dist/browser/modules/excel/chart/chart-sidecar.d.ts +0 -23
- package/dist/browser/modules/excel/chart/chart-sidecar.js +0 -164
- package/dist/browser/modules/excel/chart/chart.d.ts +0 -225
- package/dist/browser/modules/excel/chart/chart.js +0 -458
- package/dist/browser/modules/excel/chart/index.d.ts +0 -14
- package/dist/browser/modules/excel/chart/index.js +0 -10
- package/dist/browser/modules/excel/chart/shape-properties.d.ts +0 -75
- package/dist/browser/modules/excel/chart/shape-properties.js +0 -851
- package/dist/browser/modules/excel/chart/types.d.ts +0 -1855
- package/dist/browser/modules/excel/chart/types.js +0 -8
- package/dist/browser/modules/excel/sparkline/index.d.ts +0 -7
- package/dist/browser/modules/excel/sparkline/index.js +0 -7
- package/dist/browser/modules/excel/sparkline/sparkline.d.ts +0 -156
- package/dist/browser/modules/excel/sparkline/sparkline.js +0 -361
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +0 -150
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.js +0 -4311
- package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +0 -54
- package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +0 -186
- package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +0 -56
- package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +0 -122
- package/dist/browser/modules/pdf/word-bridge.d.ts +0 -47
- package/dist/browser/modules/pdf/word-bridge.js +0 -304
- package/dist/browser/modules/word/constants.d.ts +0 -179
- package/dist/browser/modules/word/constants.js +0 -231
- package/dist/browser/modules/word/content-types.d.ts +0 -27
- package/dist/browser/modules/word/content-types.js +0 -53
- package/dist/browser/modules/word/digital-signatures.d.ts +0 -87
- package/dist/browser/modules/word/digital-signatures.js +0 -134
- package/dist/browser/modules/word/document.d.ts +0 -728
- package/dist/browser/modules/word/document.js +0 -1795
- package/dist/browser/modules/word/docx-packager.d.ts +0 -14
- package/dist/browser/modules/word/docx-packager.js +0 -822
- package/dist/browser/modules/word/docx-reader.d.ts +0 -11
- package/dist/browser/modules/word/docx-reader.js +0 -4929
- package/dist/browser/modules/word/encryption.d.ts +0 -102
- package/dist/browser/modules/word/encryption.js +0 -274
- package/dist/browser/modules/word/errors.d.ts +0 -49
- package/dist/browser/modules/word/errors.js +0 -68
- package/dist/browser/modules/word/font-obfuscation.d.ts +0 -31
- package/dist/browser/modules/word/font-obfuscation.js +0 -83
- package/dist/browser/modules/word/html-renderer.d.ts +0 -38
- package/dist/browser/modules/word/html-renderer.js +0 -782
- package/dist/browser/modules/word/index.base.d.ts +0 -19
- package/dist/browser/modules/word/index.base.js +0 -51
- package/dist/browser/modules/word/index.browser.d.ts +0 -4
- package/dist/browser/modules/word/index.browser.js +0 -4
- package/dist/browser/modules/word/index.d.ts +0 -4
- package/dist/browser/modules/word/index.js +0 -4
- package/dist/browser/modules/word/internal-utils.d.ts +0 -23
- package/dist/browser/modules/word/internal-utils.js +0 -54
- package/dist/browser/modules/word/relationships.d.ts +0 -31
- package/dist/browser/modules/word/relationships.js +0 -56
- package/dist/browser/modules/word/types.d.ts +0 -2325
- package/dist/browser/modules/word/types.js +0 -10
- package/dist/browser/modules/word/units.d.ts +0 -49
- package/dist/browser/modules/word/units.js +0 -111
- package/dist/browser/modules/word/writers/chart-writer.d.ts +0 -10
- package/dist/browser/modules/word/writers/chart-writer.js +0 -385
- package/dist/browser/modules/word/writers/checkbox-writer.d.ts +0 -9
- package/dist/browser/modules/word/writers/checkbox-writer.js +0 -42
- package/dist/browser/modules/word/writers/comment-writer.d.ts +0 -15
- package/dist/browser/modules/word/writers/comment-writer.js +0 -70
- package/dist/browser/modules/word/writers/document-writer.d.ts +0 -16
- package/dist/browser/modules/word/writers/document-writer.js +0 -461
- package/dist/browser/modules/word/writers/footnote-writer.d.ts +0 -11
- package/dist/browser/modules/word/writers/footnote-writer.js +0 -72
- package/dist/browser/modules/word/writers/header-footer-writer.d.ts +0 -13
- package/dist/browser/modules/word/writers/header-footer-writer.js +0 -129
- package/dist/browser/modules/word/writers/image-writer.d.ts +0 -10
- package/dist/browser/modules/word/writers/image-writer.js +0 -185
- package/dist/browser/modules/word/writers/math-writer.d.ts +0 -9
- package/dist/browser/modules/word/writers/math-writer.js +0 -428
- package/dist/browser/modules/word/writers/numbering-writer.d.ts +0 -10
- package/dist/browser/modules/word/writers/numbering-writer.js +0 -125
- package/dist/browser/modules/word/writers/paragraph-writer.d.ts +0 -13
- package/dist/browser/modules/word/writers/paragraph-writer.js +0 -516
- package/dist/browser/modules/word/writers/parts-writer.d.ts +0 -26
- package/dist/browser/modules/word/writers/parts-writer.js +0 -660
- package/dist/browser/modules/word/writers/run-writer.d.ts +0 -15
- package/dist/browser/modules/word/writers/run-writer.js +0 -649
- package/dist/browser/modules/word/writers/section-writer.d.ts +0 -10
- package/dist/browser/modules/word/writers/section-writer.js +0 -238
- package/dist/browser/modules/word/writers/styles-writer.d.ts +0 -10
- package/dist/browser/modules/word/writers/styles-writer.js +0 -242
- package/dist/browser/modules/word/writers/table-writer.d.ts +0 -10
- package/dist/browser/modules/word/writers/table-writer.js +0 -503
- package/dist/browser/modules/word/writers/textbox-writer.d.ts +0 -9
- package/dist/browser/modules/word/writers/textbox-writer.js +0 -53
- package/dist/browser/modules/word/writers/toc-writer.d.ts +0 -9
- package/dist/browser/modules/word/writers/toc-writer.js +0 -79
- package/dist/cjs/modules/excel/chart/cache-populator.js +0 -324
- package/dist/cjs/modules/excel/chart/chart-builder.js +0 -1399
- package/dist/cjs/modules/excel/chart/chart-ex-builder.js +0 -180
- package/dist/cjs/modules/excel/chart/chart-ex-renderer.js +0 -552
- package/dist/cjs/modules/excel/chart/chart-ex-types.js +0 -12
- package/dist/cjs/modules/excel/chart/chart-sidecar.js +0 -169
- package/dist/cjs/modules/excel/chart/chart.js +0 -462
- package/dist/cjs/modules/excel/chart/index.js +0 -36
- package/dist/cjs/modules/excel/chart/shape-properties.js +0 -865
- package/dist/cjs/modules/excel/chart/types.js +0 -9
- package/dist/cjs/modules/excel/sparkline/index.js +0 -23
- package/dist/cjs/modules/excel/sparkline/sparkline.js +0 -366
- package/dist/cjs/modules/excel/xlsx/xform/chart/chart-space-xform.js +0 -4314
- package/dist/cjs/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +0 -189
- package/dist/cjs/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +0 -125
- package/dist/cjs/modules/pdf/word-bridge.js +0 -307
- package/dist/cjs/modules/word/constants.js +0 -234
- package/dist/cjs/modules/word/content-types.js +0 -57
- package/dist/cjs/modules/word/digital-signatures.js +0 -140
- package/dist/cjs/modules/word/document.js +0 -1909
- package/dist/cjs/modules/word/docx-packager.js +0 -825
- package/dist/cjs/modules/word/docx-reader.js +0 -4932
- package/dist/cjs/modules/word/encryption.js +0 -282
- package/dist/cjs/modules/word/errors.js +0 -88
- package/dist/cjs/modules/word/font-obfuscation.js +0 -88
- package/dist/cjs/modules/word/html-renderer.js +0 -785
- package/dist/cjs/modules/word/index.base.js +0 -199
- package/dist/cjs/modules/word/index.browser.js +0 -20
- package/dist/cjs/modules/word/index.js +0 -20
- package/dist/cjs/modules/word/internal-utils.js +0 -59
- package/dist/cjs/modules/word/relationships.js +0 -60
- package/dist/cjs/modules/word/types.js +0 -11
- package/dist/cjs/modules/word/units.js +0 -135
- package/dist/cjs/modules/word/writers/chart-writer.js +0 -388
- package/dist/cjs/modules/word/writers/checkbox-writer.js +0 -45
- package/dist/cjs/modules/word/writers/comment-writer.js +0 -74
- package/dist/cjs/modules/word/writers/document-writer.js +0 -465
- package/dist/cjs/modules/word/writers/footnote-writer.js +0 -76
- package/dist/cjs/modules/word/writers/header-footer-writer.js +0 -134
- package/dist/cjs/modules/word/writers/image-writer.js +0 -188
- package/dist/cjs/modules/word/writers/math-writer.js +0 -431
- package/dist/cjs/modules/word/writers/numbering-writer.js +0 -128
- package/dist/cjs/modules/word/writers/paragraph-writer.js +0 -521
- package/dist/cjs/modules/word/writers/parts-writer.js +0 -671
- package/dist/cjs/modules/word/writers/run-writer.js +0 -655
- package/dist/cjs/modules/word/writers/section-writer.js +0 -241
- package/dist/cjs/modules/word/writers/styles-writer.js +0 -245
- package/dist/cjs/modules/word/writers/table-writer.js +0 -506
- package/dist/cjs/modules/word/writers/textbox-writer.js +0 -56
- package/dist/cjs/modules/word/writers/toc-writer.js +0 -82
- package/dist/esm/modules/excel/chart/cache-populator.js +0 -319
- package/dist/esm/modules/excel/chart/chart-builder.js +0 -1395
- package/dist/esm/modules/excel/chart/chart-ex-builder.js +0 -177
- package/dist/esm/modules/excel/chart/chart-ex-renderer.js +0 -549
- package/dist/esm/modules/excel/chart/chart-ex-types.js +0 -11
- package/dist/esm/modules/excel/chart/chart-sidecar.js +0 -164
- package/dist/esm/modules/excel/chart/chart.js +0 -458
- package/dist/esm/modules/excel/chart/index.js +0 -10
- package/dist/esm/modules/excel/chart/shape-properties.js +0 -851
- package/dist/esm/modules/excel/chart/types.js +0 -8
- package/dist/esm/modules/excel/sparkline/index.js +0 -7
- package/dist/esm/modules/excel/sparkline/sparkline.js +0 -361
- package/dist/esm/modules/excel/xlsx/xform/chart/chart-space-xform.js +0 -4311
- package/dist/esm/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +0 -186
- package/dist/esm/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +0 -122
- package/dist/esm/modules/pdf/word-bridge.js +0 -304
- package/dist/esm/modules/word/constants.js +0 -231
- package/dist/esm/modules/word/content-types.js +0 -53
- package/dist/esm/modules/word/digital-signatures.js +0 -134
- package/dist/esm/modules/word/document.js +0 -1795
- package/dist/esm/modules/word/docx-packager.js +0 -822
- package/dist/esm/modules/word/docx-reader.js +0 -4929
- package/dist/esm/modules/word/encryption.js +0 -274
- package/dist/esm/modules/word/errors.js +0 -68
- package/dist/esm/modules/word/font-obfuscation.js +0 -83
- package/dist/esm/modules/word/html-renderer.js +0 -782
- package/dist/esm/modules/word/index.base.js +0 -51
- package/dist/esm/modules/word/index.browser.js +0 -4
- package/dist/esm/modules/word/index.js +0 -4
- package/dist/esm/modules/word/internal-utils.js +0 -54
- package/dist/esm/modules/word/relationships.js +0 -56
- package/dist/esm/modules/word/types.js +0 -10
- package/dist/esm/modules/word/units.js +0 -111
- package/dist/esm/modules/word/writers/chart-writer.js +0 -385
- package/dist/esm/modules/word/writers/checkbox-writer.js +0 -42
- package/dist/esm/modules/word/writers/comment-writer.js +0 -70
- package/dist/esm/modules/word/writers/document-writer.js +0 -461
- package/dist/esm/modules/word/writers/footnote-writer.js +0 -72
- package/dist/esm/modules/word/writers/header-footer-writer.js +0 -129
- package/dist/esm/modules/word/writers/image-writer.js +0 -185
- package/dist/esm/modules/word/writers/math-writer.js +0 -428
- package/dist/esm/modules/word/writers/numbering-writer.js +0 -125
- package/dist/esm/modules/word/writers/paragraph-writer.js +0 -516
- package/dist/esm/modules/word/writers/parts-writer.js +0 -660
- package/dist/esm/modules/word/writers/run-writer.js +0 -649
- package/dist/esm/modules/word/writers/section-writer.js +0 -238
- package/dist/esm/modules/word/writers/styles-writer.js +0 -242
- package/dist/esm/modules/word/writers/table-writer.js +0 -503
- package/dist/esm/modules/word/writers/textbox-writer.js +0 -53
- package/dist/esm/modules/word/writers/toc-writer.js +0 -79
- package/dist/types/modules/excel/chart/cache-populator.d.ts +0 -33
- package/dist/types/modules/excel/chart/chart-builder.d.ts +0 -19
- package/dist/types/modules/excel/chart/chart-ex-builder.d.ts +0 -11
- package/dist/types/modules/excel/chart/chart-ex-renderer.d.ts +0 -13
- package/dist/types/modules/excel/chart/chart-ex-types.d.ts +0 -283
- package/dist/types/modules/excel/chart/chart-sidecar.d.ts +0 -23
- package/dist/types/modules/excel/chart/chart.d.ts +0 -225
- package/dist/types/modules/excel/chart/index.d.ts +0 -14
- package/dist/types/modules/excel/chart/shape-properties.d.ts +0 -75
- package/dist/types/modules/excel/chart/types.d.ts +0 -1855
- package/dist/types/modules/excel/sparkline/index.d.ts +0 -7
- package/dist/types/modules/excel/sparkline/sparkline.d.ts +0 -156
- package/dist/types/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +0 -150
- package/dist/types/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +0 -54
- package/dist/types/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +0 -56
- package/dist/types/modules/pdf/word-bridge.d.ts +0 -47
- package/dist/types/modules/word/constants.d.ts +0 -179
- package/dist/types/modules/word/content-types.d.ts +0 -27
- package/dist/types/modules/word/digital-signatures.d.ts +0 -87
- package/dist/types/modules/word/document.d.ts +0 -728
- package/dist/types/modules/word/docx-packager.d.ts +0 -14
- package/dist/types/modules/word/docx-reader.d.ts +0 -11
- package/dist/types/modules/word/encryption.d.ts +0 -102
- package/dist/types/modules/word/errors.d.ts +0 -49
- package/dist/types/modules/word/font-obfuscation.d.ts +0 -31
- package/dist/types/modules/word/html-renderer.d.ts +0 -38
- package/dist/types/modules/word/index.base.d.ts +0 -19
- package/dist/types/modules/word/index.browser.d.ts +0 -4
- package/dist/types/modules/word/index.d.ts +0 -4
- package/dist/types/modules/word/internal-utils.d.ts +0 -23
- package/dist/types/modules/word/relationships.d.ts +0 -31
- package/dist/types/modules/word/types.d.ts +0 -2325
- package/dist/types/modules/word/units.d.ts +0 -49
- package/dist/types/modules/word/writers/chart-writer.d.ts +0 -10
- package/dist/types/modules/word/writers/checkbox-writer.d.ts +0 -9
- package/dist/types/modules/word/writers/comment-writer.d.ts +0 -15
- package/dist/types/modules/word/writers/document-writer.d.ts +0 -16
- package/dist/types/modules/word/writers/footnote-writer.d.ts +0 -11
- package/dist/types/modules/word/writers/header-footer-writer.d.ts +0 -13
- package/dist/types/modules/word/writers/image-writer.d.ts +0 -10
- package/dist/types/modules/word/writers/math-writer.d.ts +0 -9
- package/dist/types/modules/word/writers/numbering-writer.d.ts +0 -10
- package/dist/types/modules/word/writers/paragraph-writer.d.ts +0 -13
- package/dist/types/modules/word/writers/parts-writer.d.ts +0 -26
- package/dist/types/modules/word/writers/run-writer.d.ts +0 -15
- package/dist/types/modules/word/writers/section-writer.d.ts +0 -10
- package/dist/types/modules/word/writers/styles-writer.d.ts +0 -10
- package/dist/types/modules/word/writers/table-writer.d.ts +0 -10
- package/dist/types/modules/word/writers/textbox-writer.d.ts +0 -9
- package/dist/types/modules/word/writers/toc-writer.d.ts +0 -9
|
@@ -97,12 +97,6 @@ declare class FormCheckbox {
|
|
|
97
97
|
worksheet: Worksheet;
|
|
98
98
|
model: FormCheckboxModel;
|
|
99
99
|
constructor(worksheet: Worksheet, range: FormControlRange, options?: FormCheckboxOptions);
|
|
100
|
-
/**
|
|
101
|
-
* Rebuild a FormCheckbox from a previously-serialised model (e.g. round-tripped
|
|
102
|
-
* via `worksheet.model`). The model is adopted as-is; no range parsing or shape
|
|
103
|
-
* id reassignment is performed.
|
|
104
|
-
*/
|
|
105
|
-
static fromModel(worksheet: Worksheet, model: FormCheckboxModel): FormCheckbox;
|
|
106
100
|
/**
|
|
107
101
|
* Get the checked state
|
|
108
102
|
*/
|
|
@@ -51,23 +51,6 @@ class FormCheckbox {
|
|
|
51
51
|
print: options?.print ?? false
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Rebuild a FormCheckbox from a previously-serialised model (e.g. round-tripped
|
|
56
|
-
* via `worksheet.model`). The model is adopted as-is; no range parsing or shape
|
|
57
|
-
* id reassignment is performed.
|
|
58
|
-
*/
|
|
59
|
-
static fromModel(worksheet, model) {
|
|
60
|
-
const cb = Object.create(FormCheckbox.prototype);
|
|
61
|
-
cb.worksheet = worksheet;
|
|
62
|
-
// Defensive shallow clone: the caller should not be able to mutate the
|
|
63
|
-
// underlying anchor objects through the original reference.
|
|
64
|
-
cb.model = {
|
|
65
|
-
...model,
|
|
66
|
-
tl: { ...model.tl },
|
|
67
|
-
br: { ...model.br }
|
|
68
|
-
};
|
|
69
|
-
return cb;
|
|
70
|
-
}
|
|
71
54
|
/**
|
|
72
55
|
* Get the checked state
|
|
73
56
|
*/
|
|
@@ -92,19 +92,9 @@ class Image {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
else if (range) {
|
|
95
|
-
// Anchor inputs:
|
|
96
|
-
// - string addresses ("A1") are 1-based; the internal Anchor uses
|
|
97
|
-
// 0-based nativeCol/nativeRow, so the top-left address is shifted
|
|
98
|
-
// by -1. The bottom-right address is intentionally NOT shifted —
|
|
99
|
-
// this matches the string-range path (e.g. "A1:B2") where br
|
|
100
|
-
// anchors the cell *past* the address (i.e. its right/bottom edge).
|
|
101
|
-
// - object inputs ({ col, row } / AnchorModel) already use the
|
|
102
|
-
// 0-based convention and are passed through as-is.
|
|
103
|
-
const tlInput = range.tl;
|
|
104
|
-
const brInput = range.br;
|
|
105
95
|
this.range = {
|
|
106
|
-
tl: new Anchor(this.worksheet,
|
|
107
|
-
br:
|
|
96
|
+
tl: new Anchor(this.worksheet, range.tl, 0),
|
|
97
|
+
br: range.br ? new Anchor(this.worksheet, range.br, 0) : undefined,
|
|
108
98
|
ext: range.ext,
|
|
109
99
|
editAs: range.editAs,
|
|
110
100
|
hyperlinks: hyperlinks || ("hyperlinks" in range ? range.hyperlinks : undefined)
|
|
@@ -170,14 +170,10 @@ class Range {
|
|
|
170
170
|
get _serialisedSheetName() {
|
|
171
171
|
const { sheetName } = this.model;
|
|
172
172
|
if (sheetName) {
|
|
173
|
-
// Plain ASCII identifiers (and the empty string) need no quoting.
|
|
174
173
|
if (/^[a-zA-Z0-9]*$/.test(sheetName)) {
|
|
175
174
|
return `${sheetName}!`;
|
|
176
175
|
}
|
|
177
|
-
|
|
178
|
-
// outside the bareword set are wrapped in single quotes, and any
|
|
179
|
-
// embedded apostrophes are doubled (e.g. `O'Brien` -> `'O''Brien'`).
|
|
180
|
-
return `'${sheetName.replace(/'/g, "''")}'!`;
|
|
176
|
+
return `'${sheetName}'!`;
|
|
181
177
|
}
|
|
182
178
|
return "";
|
|
183
179
|
}
|
|
@@ -430,9 +430,8 @@ class WorksheetWriter {
|
|
|
430
430
|
if (typeof filter === "number") {
|
|
431
431
|
this.conditionalFormatting.splice(filter, 1);
|
|
432
432
|
}
|
|
433
|
-
else if (
|
|
434
|
-
|
|
435
|
-
this.conditionalFormatting = this.conditionalFormatting.filter(cf => !filter(cf));
|
|
433
|
+
else if (filter instanceof Function) {
|
|
434
|
+
this.conditionalFormatting = this.conditionalFormatting.filter(filter);
|
|
436
435
|
}
|
|
437
436
|
else {
|
|
438
437
|
this.conditionalFormatting = [];
|
|
@@ -111,10 +111,7 @@ class Column {
|
|
|
111
111
|
return this.column.style;
|
|
112
112
|
}
|
|
113
113
|
set style(value) {
|
|
114
|
-
|
|
115
|
-
// to the on-sheet cells; a bare assignment leaves _cache empty and
|
|
116
|
-
// commit() returns early.
|
|
117
|
-
this._set("style", value);
|
|
114
|
+
this.column.style = value;
|
|
118
115
|
}
|
|
119
116
|
get totalsRowLabel() {
|
|
120
117
|
return this.column.totalsRowLabel;
|
|
@@ -480,32 +477,7 @@ class Table {
|
|
|
480
477
|
}
|
|
481
478
|
set name(value) {
|
|
482
479
|
this.cacheState();
|
|
483
|
-
|
|
484
|
-
const oldName = this.table.name;
|
|
485
|
-
if (newName === oldName) {
|
|
486
|
-
return;
|
|
487
|
-
}
|
|
488
|
-
// Synchronise the worksheet's table map and the workbook-wide name set
|
|
489
|
-
// so subsequent getTable(newName)/duplicate-name checks remain correct.
|
|
490
|
-
// Falls back to a bare assignment if the worksheet hasn't registered
|
|
491
|
-
// this table (e.g. transient instances built by Worksheet.set model).
|
|
492
|
-
const ws = this.worksheet;
|
|
493
|
-
const tables = ws?.tables;
|
|
494
|
-
const tableNames = ws?.workbook?._tableNames;
|
|
495
|
-
if (tables && tables[oldName] === this) {
|
|
496
|
-
const newKey = newName.toLowerCase();
|
|
497
|
-
const oldKey = oldName.toLowerCase();
|
|
498
|
-
if (newKey !== oldKey && tableNames?.has(newKey)) {
|
|
499
|
-
throw new TableError(`Table name "${newName}" already exists in the workbook (case-insensitive).`);
|
|
500
|
-
}
|
|
501
|
-
delete tables[oldName];
|
|
502
|
-
tables[newName] = this;
|
|
503
|
-
if (tableNames) {
|
|
504
|
-
tableNames.delete(oldKey);
|
|
505
|
-
tableNames.add(newKey);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
this.table.name = newName;
|
|
480
|
+
this.table.name = sanitizeTableName(value);
|
|
509
481
|
}
|
|
510
482
|
get displayName() {
|
|
511
483
|
return this.table.displayName || this.table.name;
|
|
@@ -109,12 +109,12 @@ export function filterDrawingAnchors(anchors) {
|
|
|
109
109
|
if (a.range?.br && a.shape) {
|
|
110
110
|
return true;
|
|
111
111
|
}
|
|
112
|
-
// One-cell anchors need a valid picture
|
|
113
|
-
if (!a.range?.br && !a.picture
|
|
112
|
+
// One-cell anchors need a valid picture
|
|
113
|
+
if (!a.range?.br && !a.picture) {
|
|
114
114
|
return false;
|
|
115
115
|
}
|
|
116
|
-
// Two-cell anchors need either picture
|
|
117
|
-
if (a.range?.br && !a.picture && !a.shape
|
|
116
|
+
// Two-cell anchors need either picture or shape
|
|
117
|
+
if (a.range?.br && !a.picture && !a.shape) {
|
|
118
118
|
return false;
|
|
119
119
|
}
|
|
120
120
|
return true;
|
|
@@ -89,28 +89,6 @@ export declare function pivotTableRelTargetFromWorksheet(n: number | string): st
|
|
|
89
89
|
export declare function tableRelTargetFromWorksheet(target: string): string;
|
|
90
90
|
export declare function mediaRelTargetFromRels(filename: string): string;
|
|
91
91
|
export declare function ctrlPropPath(id: number | string): string;
|
|
92
|
-
export declare function getChartNumberFromPath(path: string): number | undefined;
|
|
93
|
-
export declare function getChartNumberFromRelsPath(path: string): number | undefined;
|
|
94
|
-
export declare function getChartStyleNumberFromPath(path: string): number | undefined;
|
|
95
|
-
export declare function getChartColorsNumberFromPath(path: string): number | undefined;
|
|
96
|
-
export declare function chartPath(n: number | string): string;
|
|
97
|
-
export declare function chartRelsPath(n: number | string): string;
|
|
98
|
-
export declare function chartStylePath(n: number | string): string;
|
|
99
|
-
export declare function chartColorsPath(n: number | string): string;
|
|
100
|
-
export declare function chartRelTargetFromDrawing(n: number | string): string;
|
|
101
|
-
export declare function chartStyleRelTarget(n: number | string): string;
|
|
102
|
-
export declare function chartColorsRelTarget(n: number | string): string;
|
|
103
|
-
export declare function isChartPath(path: string): boolean;
|
|
104
|
-
export declare function isChartStylePath(path: string): boolean;
|
|
105
|
-
export declare function isChartColorsPath(path: string): boolean;
|
|
106
|
-
export declare function isChartRelsPath(path: string): boolean;
|
|
107
|
-
export declare function getChartExNumberFromPath(path: string): number | undefined;
|
|
108
|
-
export declare function getChartExNumberFromRelsPath(path: string): number | undefined;
|
|
109
|
-
export declare function chartExPath(n: number | string): string;
|
|
110
|
-
export declare function chartExRelsPath(n: number | string): string;
|
|
111
|
-
export declare function chartExRelTargetFromDrawing(n: number | string): string;
|
|
112
|
-
export declare function isChartExPath(path: string): boolean;
|
|
113
|
-
export declare function isChartExRelsPath(path: string): boolean;
|
|
114
92
|
export declare function ctrlPropRelTargetFromWorksheet(id: number | string): string;
|
|
115
93
|
/**
|
|
116
94
|
* Resolve a relationship Target (relative or absolute) to a normalized zip path.
|
|
@@ -123,9 +101,3 @@ export declare function ctrlPropRelTargetFromWorksheet(id: number | string): str
|
|
|
123
101
|
* @param target The raw Target value from the .rels file
|
|
124
102
|
*/
|
|
125
103
|
export declare function resolveRelTarget(baseDir: string, target: string): string;
|
|
126
|
-
export declare function getChartsheetNoFromPath(path: string): number | undefined;
|
|
127
|
-
export declare function getChartsheetNoFromRelsPath(path: string): number | undefined;
|
|
128
|
-
export declare function chartsheetPath(n: number | string): string;
|
|
129
|
-
export declare function chartsheetRelsPath(n: number | string): string;
|
|
130
|
-
export declare function isChartsheetPath(path: string): boolean;
|
|
131
|
-
export declare function isChartsheetRelsPath(path: string): boolean;
|
|
@@ -256,91 +256,6 @@ export function mediaRelTargetFromRels(filename) {
|
|
|
256
256
|
export function ctrlPropPath(id) {
|
|
257
257
|
return `xl/ctrlProps/ctrlProp${id}.xml`;
|
|
258
258
|
}
|
|
259
|
-
// -------- Charts --------
|
|
260
|
-
const chartXmlRegex = /^xl\/charts\/chart(\d+)[.]xml$/;
|
|
261
|
-
const chartRelsXmlRegex = /^xl\/charts\/_rels\/chart(\d+)[.]xml[.]rels$/;
|
|
262
|
-
const chartStyleXmlRegex = /^xl\/charts\/style(\d+)[.]xml$/;
|
|
263
|
-
const chartColorsXmlRegex = /^xl\/charts\/colors(\d+)[.]xml$/;
|
|
264
|
-
export function getChartNumberFromPath(path) {
|
|
265
|
-
const match = chartXmlRegex.exec(path);
|
|
266
|
-
return match ? parseInt(match[1], 10) : undefined;
|
|
267
|
-
}
|
|
268
|
-
export function getChartNumberFromRelsPath(path) {
|
|
269
|
-
const match = chartRelsXmlRegex.exec(path);
|
|
270
|
-
return match ? parseInt(match[1], 10) : undefined;
|
|
271
|
-
}
|
|
272
|
-
export function getChartStyleNumberFromPath(path) {
|
|
273
|
-
const match = chartStyleXmlRegex.exec(path);
|
|
274
|
-
return match ? parseInt(match[1], 10) : undefined;
|
|
275
|
-
}
|
|
276
|
-
export function getChartColorsNumberFromPath(path) {
|
|
277
|
-
const match = chartColorsXmlRegex.exec(path);
|
|
278
|
-
return match ? parseInt(match[1], 10) : undefined;
|
|
279
|
-
}
|
|
280
|
-
export function chartPath(n) {
|
|
281
|
-
return `xl/charts/chart${n}.xml`;
|
|
282
|
-
}
|
|
283
|
-
export function chartRelsPath(n) {
|
|
284
|
-
return `xl/charts/_rels/chart${n}.xml.rels`;
|
|
285
|
-
}
|
|
286
|
-
export function chartStylePath(n) {
|
|
287
|
-
return `xl/charts/style${n}.xml`;
|
|
288
|
-
}
|
|
289
|
-
export function chartColorsPath(n) {
|
|
290
|
-
return `xl/charts/colors${n}.xml`;
|
|
291
|
-
}
|
|
292
|
-
export function chartRelTargetFromDrawing(n) {
|
|
293
|
-
// Target inside xl/drawings/_rels/drawingN.xml.rels (base: xl/drawings/)
|
|
294
|
-
return `../charts/chart${n}.xml`;
|
|
295
|
-
}
|
|
296
|
-
export function chartStyleRelTarget(n) {
|
|
297
|
-
// Target inside xl/charts/_rels/chartN.xml.rels (base: xl/charts/)
|
|
298
|
-
return `style${n}.xml`;
|
|
299
|
-
}
|
|
300
|
-
export function chartColorsRelTarget(n) {
|
|
301
|
-
// Target inside xl/charts/_rels/chartN.xml.rels (base: xl/charts/)
|
|
302
|
-
return `colors${n}.xml`;
|
|
303
|
-
}
|
|
304
|
-
export function isChartPath(path) {
|
|
305
|
-
return chartXmlRegex.test(path);
|
|
306
|
-
}
|
|
307
|
-
export function isChartStylePath(path) {
|
|
308
|
-
return chartStyleXmlRegex.test(path);
|
|
309
|
-
}
|
|
310
|
-
export function isChartColorsPath(path) {
|
|
311
|
-
return chartColorsXmlRegex.test(path);
|
|
312
|
-
}
|
|
313
|
-
export function isChartRelsPath(path) {
|
|
314
|
-
return chartRelsXmlRegex.test(path);
|
|
315
|
-
}
|
|
316
|
-
// ============================================================================
|
|
317
|
-
// Chart Ex (Office 2016+ extended charts: treemap, sunburst, waterfall, etc.)
|
|
318
|
-
// ============================================================================
|
|
319
|
-
const chartExXmlRegex = /^xl\/charts\/chartEx(\d+)[.]xml$/;
|
|
320
|
-
const chartExRelsXmlRegex = /^xl\/charts\/_rels\/chartEx(\d+)[.]xml[.]rels$/;
|
|
321
|
-
export function getChartExNumberFromPath(path) {
|
|
322
|
-
const match = chartExXmlRegex.exec(path);
|
|
323
|
-
return match ? parseInt(match[1], 10) : undefined;
|
|
324
|
-
}
|
|
325
|
-
export function getChartExNumberFromRelsPath(path) {
|
|
326
|
-
const match = chartExRelsXmlRegex.exec(path);
|
|
327
|
-
return match ? parseInt(match[1], 10) : undefined;
|
|
328
|
-
}
|
|
329
|
-
export function chartExPath(n) {
|
|
330
|
-
return `xl/charts/chartEx${n}.xml`;
|
|
331
|
-
}
|
|
332
|
-
export function chartExRelsPath(n) {
|
|
333
|
-
return `xl/charts/_rels/chartEx${n}.xml.rels`;
|
|
334
|
-
}
|
|
335
|
-
export function chartExRelTargetFromDrawing(n) {
|
|
336
|
-
return `../charts/chartEx${n}.xml`;
|
|
337
|
-
}
|
|
338
|
-
export function isChartExPath(path) {
|
|
339
|
-
return chartExXmlRegex.test(path);
|
|
340
|
-
}
|
|
341
|
-
export function isChartExRelsPath(path) {
|
|
342
|
-
return chartExRelsXmlRegex.test(path);
|
|
343
|
-
}
|
|
344
259
|
export function ctrlPropRelTargetFromWorksheet(id) {
|
|
345
260
|
// Target inside xl/worksheets/_rels/sheetN.xml.rels (base: xl/worksheets/)
|
|
346
261
|
return `../ctrlProps/ctrlProp${id}.xml`;
|
|
@@ -379,28 +294,3 @@ export function resolveRelTarget(baseDir, target) {
|
|
|
379
294
|
}
|
|
380
295
|
return resolved.join("/");
|
|
381
296
|
}
|
|
382
|
-
// ============================================================================
|
|
383
|
-
// Chartsheet paths
|
|
384
|
-
// ============================================================================
|
|
385
|
-
const chartsheetXmlRegex = /^xl\/chartsheets\/sheet(\d+)[.]xml$/;
|
|
386
|
-
const chartsheetRelsXmlRegex = /^xl\/chartsheets\/_rels\/sheet(\d+)[.]xml[.]rels$/;
|
|
387
|
-
export function getChartsheetNoFromPath(path) {
|
|
388
|
-
const match = chartsheetXmlRegex.exec(path);
|
|
389
|
-
return match ? parseInt(match[1], 10) : undefined;
|
|
390
|
-
}
|
|
391
|
-
export function getChartsheetNoFromRelsPath(path) {
|
|
392
|
-
const match = chartsheetRelsXmlRegex.exec(path);
|
|
393
|
-
return match ? parseInt(match[1], 10) : undefined;
|
|
394
|
-
}
|
|
395
|
-
export function chartsheetPath(n) {
|
|
396
|
-
return `xl/chartsheets/sheet${n}.xml`;
|
|
397
|
-
}
|
|
398
|
-
export function chartsheetRelsPath(n) {
|
|
399
|
-
return `xl/chartsheets/_rels/sheet${n}.xml.rels`;
|
|
400
|
-
}
|
|
401
|
-
export function isChartsheetPath(path) {
|
|
402
|
-
return chartsheetXmlRegex.test(path);
|
|
403
|
-
}
|
|
404
|
-
export function isChartsheetRelsPath(path) {
|
|
405
|
-
return chartsheetRelsXmlRegex.test(path);
|
|
406
|
-
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PassthroughManager - Manages passthrough files for round-trip preservation
|
|
3
|
+
*
|
|
4
|
+
* This module handles files that are not fully parsed by the library but need to be
|
|
5
|
+
* preserved during read/write cycles (e.g., charts, sparklines, slicers).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Content type entry for ZIP content types
|
|
9
|
+
*/
|
|
10
|
+
export interface PassthroughContentType {
|
|
11
|
+
partName: string;
|
|
12
|
+
contentType: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ZIP writer interface for passthrough files
|
|
16
|
+
*/
|
|
17
|
+
export interface IPassthroughZipWriter {
|
|
18
|
+
append(data: Uint8Array, options: {
|
|
19
|
+
name: string;
|
|
20
|
+
}): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* PassthroughManager handles storage and retrieval of passthrough files
|
|
24
|
+
* that need to be preserved during Excel read/write cycles.
|
|
25
|
+
*/
|
|
26
|
+
export declare class PassthroughManager {
|
|
27
|
+
private files;
|
|
28
|
+
/**
|
|
29
|
+
* Check if a path should be treated as passthrough
|
|
30
|
+
*/
|
|
31
|
+
static isPassthroughPath(path: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Get the content type for a passthrough file path
|
|
34
|
+
* @returns Content type string or undefined if unknown
|
|
35
|
+
*/
|
|
36
|
+
static getContentType(path: string): string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Add a file to passthrough storage
|
|
39
|
+
*/
|
|
40
|
+
add(path: string, data: Uint8Array): void;
|
|
41
|
+
/**
|
|
42
|
+
* Get a file from passthrough storage
|
|
43
|
+
*/
|
|
44
|
+
get(path: string): Uint8Array | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Check if a file exists in passthrough storage
|
|
47
|
+
*/
|
|
48
|
+
has(path: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Get all stored paths
|
|
51
|
+
*/
|
|
52
|
+
getPaths(): string[];
|
|
53
|
+
/**
|
|
54
|
+
* Get all files as a record (for serialization)
|
|
55
|
+
*/
|
|
56
|
+
toRecord(): Record<string, Uint8Array>;
|
|
57
|
+
/**
|
|
58
|
+
* Load files from a record (for deserialization)
|
|
59
|
+
*/
|
|
60
|
+
fromRecord(record: Record<string, Uint8Array>): void;
|
|
61
|
+
/**
|
|
62
|
+
* Get content types for all stored files that have known types
|
|
63
|
+
*/
|
|
64
|
+
getContentTypes(): PassthroughContentType[];
|
|
65
|
+
/**
|
|
66
|
+
* Write all passthrough files to a ZIP writer
|
|
67
|
+
*/
|
|
68
|
+
writeToZip(zip: IPassthroughZipWriter): void;
|
|
69
|
+
/**
|
|
70
|
+
* Clear all stored files
|
|
71
|
+
*/
|
|
72
|
+
clear(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Get the number of stored files
|
|
75
|
+
*/
|
|
76
|
+
get size(): number;
|
|
77
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PassthroughManager - Manages passthrough files for round-trip preservation
|
|
3
|
+
*
|
|
4
|
+
* This module handles files that are not fully parsed by the library but need to be
|
|
5
|
+
* preserved during read/write cycles (e.g., charts, sparklines, slicers).
|
|
6
|
+
*/
|
|
7
|
+
// Pre-compiled regex patterns for content type detection (performance optimization)
|
|
8
|
+
const chartXmlRegex = /^xl\/charts\/chart\d+\.xml$/;
|
|
9
|
+
const chartStyleXmlRegex = /^xl\/charts\/style\d+\.xml$/;
|
|
10
|
+
const chartColorsXmlRegex = /^xl\/charts\/colors\d+\.xml$/;
|
|
11
|
+
/**
|
|
12
|
+
* Content type definitions for passthrough files
|
|
13
|
+
*/
|
|
14
|
+
const PASSTHROUGH_CONTENT_TYPES = new Map([
|
|
15
|
+
[chartXmlRegex, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"],
|
|
16
|
+
[chartStyleXmlRegex, "application/vnd.ms-office.chartstyle+xml"],
|
|
17
|
+
[chartColorsXmlRegex, "application/vnd.ms-office.chartcolorstyle+xml"]
|
|
18
|
+
]);
|
|
19
|
+
/**
|
|
20
|
+
* Passthrough path prefixes that should be preserved
|
|
21
|
+
*/
|
|
22
|
+
const PASSTHROUGH_PREFIXES = ["xl/charts/"];
|
|
23
|
+
/**
|
|
24
|
+
* PassthroughManager handles storage and retrieval of passthrough files
|
|
25
|
+
* that need to be preserved during Excel read/write cycles.
|
|
26
|
+
*/
|
|
27
|
+
export class PassthroughManager {
|
|
28
|
+
constructor() {
|
|
29
|
+
this.files = new Map();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if a path should be treated as passthrough
|
|
33
|
+
*/
|
|
34
|
+
static isPassthroughPath(path) {
|
|
35
|
+
return PASSTHROUGH_PREFIXES.some(prefix => path.startsWith(prefix));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the content type for a passthrough file path
|
|
39
|
+
* @returns Content type string or undefined if unknown
|
|
40
|
+
*/
|
|
41
|
+
static getContentType(path) {
|
|
42
|
+
// Chart relationships are handled by Default extension="rels"
|
|
43
|
+
if (path.startsWith("xl/charts/_rels/")) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
for (const [regex, contentType] of PASSTHROUGH_CONTENT_TYPES) {
|
|
47
|
+
if (regex.test(path)) {
|
|
48
|
+
return contentType;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Add a file to passthrough storage
|
|
55
|
+
*/
|
|
56
|
+
add(path, data) {
|
|
57
|
+
this.files.set(path, data);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get a file from passthrough storage
|
|
61
|
+
*/
|
|
62
|
+
get(path) {
|
|
63
|
+
return this.files.get(path);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Check if a file exists in passthrough storage
|
|
67
|
+
*/
|
|
68
|
+
has(path) {
|
|
69
|
+
return this.files.has(path);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get all stored paths
|
|
73
|
+
*/
|
|
74
|
+
getPaths() {
|
|
75
|
+
return [...this.files.keys()];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get all files as a record (for serialization)
|
|
79
|
+
*/
|
|
80
|
+
toRecord() {
|
|
81
|
+
const record = {};
|
|
82
|
+
for (const [path, data] of this.files) {
|
|
83
|
+
record[path] = data;
|
|
84
|
+
}
|
|
85
|
+
return record;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Load files from a record (for deserialization)
|
|
89
|
+
*/
|
|
90
|
+
fromRecord(record) {
|
|
91
|
+
this.files.clear();
|
|
92
|
+
for (const [path, data] of Object.entries(record)) {
|
|
93
|
+
this.files.set(path, data);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get content types for all stored files that have known types
|
|
98
|
+
*/
|
|
99
|
+
getContentTypes() {
|
|
100
|
+
const contentTypes = [];
|
|
101
|
+
for (const path of this.files.keys()) {
|
|
102
|
+
const contentType = PassthroughManager.getContentType(path);
|
|
103
|
+
if (contentType) {
|
|
104
|
+
contentTypes.push({ partName: path, contentType });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return contentTypes;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Write all passthrough files to a ZIP writer
|
|
111
|
+
*/
|
|
112
|
+
writeToZip(zip) {
|
|
113
|
+
for (const [path, data] of this.files) {
|
|
114
|
+
zip.append(data, { name: path });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Clear all stored files
|
|
119
|
+
*/
|
|
120
|
+
clear() {
|
|
121
|
+
this.files.clear();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Get the number of stored files
|
|
125
|
+
*/
|
|
126
|
+
get size() {
|
|
127
|
+
return this.files.size;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* - streaming: createStreamWriter/createStreamReader for large files
|
|
11
11
|
*/
|
|
12
12
|
import type { CsvParseOptions, CsvFormatOptions } from "../csv/types.js";
|
|
13
|
-
import type { ChartEntry, ChartExEntry } from "./chart/chart.js";
|
|
14
13
|
import { DefinedNames, type DefinedNameModel } from "./defined-names.js";
|
|
15
14
|
import type { PivotTable } from "./pivot-table.js";
|
|
16
15
|
import { WorkbookReader, type WorkbookReaderOptions } from "./stream/workbook-reader.js";
|
|
@@ -61,24 +60,12 @@ export interface WorkbookModel {
|
|
|
61
60
|
/** Loaded pivot tables from file - used during reconciliation */
|
|
62
61
|
loadedPivotTables?: PivotTable[];
|
|
63
62
|
calcProperties: Partial<CalculationProperties>;
|
|
63
|
+
/** Passthrough files (charts, etc.) preserved for round-trip */
|
|
64
|
+
passthrough?: Record<string, Uint8Array>;
|
|
65
|
+
/** Raw drawing XML data for passthrough (when drawing contains chart references) */
|
|
66
|
+
rawDrawings?: Record<string, Uint8Array>;
|
|
64
67
|
/** Default font preserved from the original file for round-trip fidelity */
|
|
65
68
|
defaultFont?: Partial<Font>;
|
|
66
|
-
/** Chart entries indexed by 1-based chart number */
|
|
67
|
-
chartEntries?: Record<number, ChartEntry>;
|
|
68
|
-
/** Chart rels indexed by chart number — preserved for round-trip */
|
|
69
|
-
chartRels?: Record<number, any[]>;
|
|
70
|
-
/** Chart style XML raw bytes indexed by style number — preserved for round-trip */
|
|
71
|
-
chartStyles?: Record<number, Uint8Array>;
|
|
72
|
-
/** Chart colors XML raw bytes indexed by colors number — preserved for round-trip */
|
|
73
|
-
chartColors?: Record<number, Uint8Array>;
|
|
74
|
-
/** ChartEx raw bytes (Office 2016+ extended charts) indexed by chartEx number */
|
|
75
|
-
chartExEntries?: Record<number, Uint8Array>;
|
|
76
|
-
/** ChartEx rels indexed by chartEx number */
|
|
77
|
-
chartExRels?: Record<number, any[]>;
|
|
78
|
-
/** Structured chartEx entries (programmatically built) indexed by chartEx number */
|
|
79
|
-
chartExStructuredEntries?: Record<number, ChartExEntry>;
|
|
80
|
-
/** Chartsheets parsed from the XLSX file — preserved for round-trip */
|
|
81
|
-
chartsheets?: any[];
|
|
82
69
|
/**
|
|
83
70
|
* External workbook references in declaration order. Matches the on-disk
|
|
84
71
|
* `[N]Sheet!Ref` indexing (1-based). Empty or undefined when the workbook
|
|
@@ -273,6 +260,10 @@ declare class Workbook {
|
|
|
273
260
|
protected _worksheets: Worksheet[];
|
|
274
261
|
protected _definedNames: DefinedNames;
|
|
275
262
|
protected _themes?: unknown;
|
|
263
|
+
/** Passthrough files (charts, etc.) preserved for round-trip */
|
|
264
|
+
protected _passthrough: Record<string, Uint8Array>;
|
|
265
|
+
/** Raw drawing XML data for passthrough (when drawing contains chart references) */
|
|
266
|
+
protected _rawDrawings: Record<string, Uint8Array>;
|
|
276
267
|
/** Default font preserved from original file for round-trip fidelity */
|
|
277
268
|
protected _defaultFont?: Partial<Font>;
|
|
278
269
|
/**
|
|
@@ -290,26 +281,6 @@ declare class Workbook {
|
|
|
290
281
|
protected _writerExternalLinkCache: Map<string, ExternalLinkModel>;
|
|
291
282
|
/** Global registry of table names (lowercase) for cross-worksheet uniqueness checks. */
|
|
292
283
|
readonly _tableNames: Set<string>;
|
|
293
|
-
/** Chart entries indexed by 1-based chart number */
|
|
294
|
-
protected _chartEntries: Record<number, ChartEntry>;
|
|
295
|
-
/** Chart rels indexed by chart number — preserved for round-trip */
|
|
296
|
-
protected _chartRels: Record<number, any[]>;
|
|
297
|
-
/** Chart style XML raw bytes indexed by style number — preserved for round-trip */
|
|
298
|
-
protected _chartStyles: Record<number, Uint8Array>;
|
|
299
|
-
/** Chart colors XML raw bytes indexed by colors number — preserved for round-trip */
|
|
300
|
-
protected _chartColors: Record<number, Uint8Array>;
|
|
301
|
-
/** ChartEx raw bytes (Office 2016+ extended charts) indexed by chartEx number */
|
|
302
|
-
protected _chartExEntries: Record<number, Uint8Array>;
|
|
303
|
-
/** ChartEx rels indexed by chartEx number */
|
|
304
|
-
protected _chartExRels: Record<number, any[]>;
|
|
305
|
-
/**
|
|
306
|
-
* ChartEx structured entries (built programmatically via addChartEx).
|
|
307
|
-
* Parallel to _chartExEntries (raw bytes). Serialised on write via the
|
|
308
|
-
* chart-ex-renderer.
|
|
309
|
-
*/
|
|
310
|
-
protected _chartExStructuredEntries: Record<number, ChartExEntry>;
|
|
311
|
-
/** Chartsheets parsed from the XLSX file — preserved for round-trip */
|
|
312
|
-
protected _chartsheets: any[];
|
|
313
284
|
private _xlsx?;
|
|
314
285
|
/**
|
|
315
286
|
* @param options Optional construction options.
|
|
@@ -695,34 +666,6 @@ declare class Workbook {
|
|
|
695
666
|
*/
|
|
696
667
|
addImage(image: ImageData): number;
|
|
697
668
|
getImage(id: number | string): WorkbookMedia | undefined;
|
|
698
|
-
/**
|
|
699
|
-
* Return the next available 1-based chart number.
|
|
700
|
-
*/
|
|
701
|
-
nextChartNumber(): number;
|
|
702
|
-
/**
|
|
703
|
-
* Store a chart entry in the workbook (keyed by chartNumber).
|
|
704
|
-
*/
|
|
705
|
-
addChartEntry(entry: ChartEntry): void;
|
|
706
|
-
/**
|
|
707
|
-
* Retrieve a chart entry by its 1-based chart number.
|
|
708
|
-
*/
|
|
709
|
-
getChartEntry(chartNumber: number): ChartEntry | undefined;
|
|
710
|
-
/**
|
|
711
|
-
* Remove a chart entry from the workbook.
|
|
712
|
-
* Safe to call even if the chart number doesn't exist.
|
|
713
|
-
*/
|
|
714
|
-
removeChartEntry(chartNumber: number): void;
|
|
715
|
-
/** Return the next available 1-based chartEx number. */
|
|
716
|
-
nextChartExNumber(): number;
|
|
717
|
-
/**
|
|
718
|
-
* Store a structured chartEx entry.
|
|
719
|
-
* Uses a parallel map so round-tripped raw-bytes entries are not clobbered.
|
|
720
|
-
*/
|
|
721
|
-
addChartExStructuredEntry(entry: ChartExEntry): void;
|
|
722
|
-
/** Get a structured chartEx entry by number. */
|
|
723
|
-
getChartExStructuredEntry(chartExNumber: number): ChartExEntry | undefined;
|
|
724
|
-
/** Remove a structured chartEx entry. */
|
|
725
|
-
removeChartExStructuredEntry(chartExNumber: number): void;
|
|
726
669
|
/**
|
|
727
670
|
* Declare that formulas in this workbook may reference an external
|
|
728
671
|
* workbook. Registers the target so the output file contains the required
|