@cj-tech-master/excelts 4.2.1 → 4.2.2-canary.20260115044841.88820eb
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/THIRD_PARTY_NOTICES.md +0 -31
- package/dist/browser/index.browser.d.ts +1 -0
- package/dist/browser/index.browser.js +12 -0
- package/dist/{esm/modules/archive → browser/modules/archive/compression}/compress.base.js +1 -1
- package/dist/{types/modules/archive → browser/modules/archive/compression}/compress.browser.d.ts +2 -8
- package/dist/browser/modules/archive/{compress.browser.js → compression/compress.browser.js} +3 -11
- package/dist/browser/modules/archive/{compress.d.ts → compression/compress.d.ts} +2 -2
- package/dist/{esm/modules/archive → browser/modules/archive/compression}/compress.js +1 -1
- package/dist/browser/modules/archive/{crc32.browser.d.ts → compression/crc32.browser.d.ts} +1 -1
- package/dist/browser/modules/archive/{crc32.d.ts → compression/crc32.d.ts} +1 -1
- package/dist/browser/modules/archive/{crc32.js → compression/crc32.js} +1 -1
- package/dist/browser/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
- package/dist/browser/modules/archive/{streaming-compress.browser.d.ts → compression/streaming-compress.browser.d.ts} +2 -2
- package/dist/browser/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
- package/dist/browser/modules/archive/{streaming-compress.d.ts → compression/streaming-compress.d.ts} +2 -2
- package/dist/browser/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
- package/dist/browser/modules/archive/defaults.d.ts +1 -0
- package/dist/browser/modules/archive/defaults.js +6 -3
- package/dist/browser/modules/archive/index.base.d.ts +4 -4
- package/dist/browser/modules/archive/index.base.js +3 -6
- package/dist/browser/modules/archive/index.browser.d.ts +3 -4
- package/dist/browser/modules/archive/index.browser.js +3 -7
- package/dist/browser/modules/archive/index.d.ts +3 -4
- package/dist/browser/modules/archive/index.js +3 -5
- package/dist/browser/modules/archive/internal/byte-queue.d.ts +33 -0
- package/dist/browser/modules/archive/internal/byte-queue.js +407 -0
- package/dist/browser/modules/archive/io/archive-sink.d.ts +8 -0
- package/dist/browser/modules/archive/io/archive-sink.js +45 -0
- package/dist/browser/modules/archive/io/archive-source.d.ts +6 -0
- package/dist/browser/modules/archive/io/archive-source.js +100 -0
- package/dist/browser/modules/archive/{extract.d.ts → unzip/extract.d.ts} +2 -2
- package/dist/browser/modules/archive/unzip/index.d.ts +40 -0
- package/dist/browser/modules/archive/unzip/index.js +164 -0
- package/dist/browser/modules/archive/{parse.base.d.ts → unzip/stream.base.d.ts} +36 -2
- package/dist/browser/modules/archive/unzip/stream.base.js +1022 -0
- package/dist/browser/modules/archive/{parse.browser.d.ts → unzip/stream.browser.d.ts} +1 -1
- package/dist/browser/modules/archive/{parse.browser.js → unzip/stream.browser.js} +371 -110
- package/dist/browser/modules/archive/{parse.d.ts → unzip/stream.d.ts} +2 -2
- package/dist/{esm/modules/archive/parse.js → browser/modules/archive/unzip/stream.js} +6 -5
- package/dist/browser/modules/archive/{zip-parser.d.ts → unzip/zip-parser.d.ts} +1 -1
- package/dist/{esm/modules/archive → browser/modules/archive/unzip}/zip-parser.js +38 -24
- package/dist/browser/modules/archive/utils/async-queue.d.ts +7 -0
- package/dist/browser/modules/archive/utils/async-queue.js +103 -0
- package/dist/browser/modules/archive/utils/bytes.js +16 -16
- package/dist/browser/modules/archive/utils/compressibility.d.ts +10 -0
- package/dist/browser/modules/archive/utils/compressibility.js +57 -0
- package/dist/browser/modules/archive/utils/parse-buffer.js +21 -23
- package/dist/browser/modules/archive/utils/pattern-scanner.d.ts +21 -0
- package/dist/browser/modules/archive/utils/pattern-scanner.js +27 -0
- package/dist/browser/modules/archive/utils/timestamps.js +62 -1
- package/dist/browser/modules/archive/utils/zip-extra-fields.d.ts +1 -1
- package/dist/browser/modules/archive/utils/zip-extra-fields.js +26 -14
- package/dist/browser/modules/archive/zip/index.d.ts +42 -0
- package/dist/browser/modules/archive/zip/index.js +157 -0
- package/dist/browser/modules/archive/{streaming-zip.d.ts → zip/stream.d.ts} +28 -5
- package/dist/browser/modules/archive/{streaming-zip.js → zip/stream.js} +192 -48
- package/dist/browser/modules/archive/zip/zip-bytes.d.ts +73 -0
- package/dist/browser/modules/archive/zip/zip-bytes.js +239 -0
- package/dist/{esm/modules/archive → browser/modules/archive/zip}/zip-entry-metadata.js +3 -3
- package/dist/browser/modules/archive/{zip-records.d.ts → zip-spec/zip-records.d.ts} +20 -0
- package/dist/browser/modules/archive/zip-spec/zip-records.js +126 -0
- package/dist/browser/modules/excel/stream/workbook-reader.browser.js +1 -1
- package/dist/browser/modules/excel/stream/workbook-writer.browser.d.ts +1 -1
- package/dist/browser/modules/excel/stream/workbook-writer.browser.js +1 -1
- package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +48 -0
- package/dist/browser/modules/excel/utils/ooxml-validator.js +469 -0
- package/dist/browser/modules/excel/utils/parse-sax.d.ts +3 -0
- package/dist/browser/modules/excel/utils/parse-sax.js +32 -13
- package/dist/browser/modules/excel/worksheet.js +5 -2
- package/dist/browser/modules/excel/xlsx/xform/core/app-xform.js +3 -3
- package/dist/browser/modules/excel/xlsx/xform/core/core-xform.js +56 -68
- package/dist/browser/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/sp-xform.d.ts +18 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/sp-xform.js +112 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +6 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
- package/dist/browser/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
- package/dist/browser/modules/excel/xlsx/xform/list-xform.js +8 -10
- package/dist/browser/modules/excel/xlsx/xform/sheet/page-setup-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
- package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
- package/dist/browser/modules/excel/xlsx/xform/strings/shared-string-xform.js +2 -3
- package/dist/browser/modules/excel/xlsx/xform/strings/text-xform.js +5 -7
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +11 -10
- package/dist/browser/modules/excel/xlsx/xlsx.js +1 -1
- package/dist/browser/modules/stream/base-transform.d.ts +3 -0
- package/dist/browser/modules/stream/base-transform.js +34 -20
- package/dist/browser/modules/stream/buffered-stream.d.ts +2 -12
- package/dist/browser/modules/stream/chunked-builder.js +4 -4
- package/dist/browser/modules/stream/index.browser.d.ts +13 -19
- package/dist/browser/modules/stream/index.browser.js +10 -22
- package/dist/browser/modules/stream/index.d.ts +18 -41
- package/dist/browser/modules/stream/index.js +15 -44
- package/dist/browser/modules/stream/internal/event-utils.d.ts +17 -0
- package/dist/browser/modules/stream/internal/event-utils.js +40 -0
- package/dist/browser/modules/stream/internal/type-guards.d.ts +9 -0
- package/dist/browser/modules/stream/internal/type-guards.js +24 -0
- package/dist/browser/modules/stream/pull-stream.d.ts +5 -6
- package/dist/browser/modules/stream/pull-stream.js +107 -43
- package/dist/browser/modules/stream/shared.d.ts +1 -1
- package/dist/browser/modules/stream/shared.js +7 -4
- package/dist/browser/modules/stream/streams.browser.d.ts +32 -44
- package/dist/browser/modules/stream/streams.browser.js +921 -836
- package/dist/browser/modules/stream/streams.d.ts +4 -20
- package/dist/browser/modules/stream/streams.js +146 -95
- package/dist/browser/modules/stream/utils.js +5 -38
- package/dist/cjs/modules/archive/{compress.base.js → compression/compress.base.js} +1 -1
- package/dist/cjs/modules/archive/{compress.browser.js → compression/compress.browser.js} +3 -11
- package/dist/cjs/modules/archive/{compress.js → compression/compress.js} +1 -1
- package/dist/cjs/modules/archive/{crc32.js → compression/crc32.js} +1 -1
- package/dist/cjs/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
- package/dist/cjs/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
- package/dist/cjs/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
- package/dist/cjs/modules/archive/defaults.js +7 -4
- package/dist/cjs/modules/archive/index.base.js +9 -19
- package/dist/cjs/modules/archive/index.browser.js +4 -10
- package/dist/cjs/modules/archive/index.js +4 -8
- package/dist/cjs/modules/archive/internal/byte-queue.js +411 -0
- package/dist/cjs/modules/archive/io/archive-sink.js +49 -0
- package/dist/cjs/modules/archive/io/archive-source.js +105 -0
- package/dist/cjs/modules/archive/unzip/index.js +170 -0
- package/dist/cjs/modules/archive/unzip/stream.base.js +1044 -0
- package/dist/cjs/modules/archive/{parse.browser.js → unzip/stream.browser.js} +372 -111
- package/dist/cjs/modules/archive/{parse.js → unzip/stream.js} +9 -8
- package/dist/cjs/modules/archive/{zip-parser.js → unzip/zip-parser.js} +47 -33
- package/dist/cjs/modules/archive/utils/async-queue.js +106 -0
- package/dist/cjs/modules/archive/utils/bytes.js +16 -16
- package/dist/cjs/modules/archive/utils/compressibility.js +60 -0
- package/dist/cjs/modules/archive/utils/parse-buffer.js +21 -23
- package/dist/cjs/modules/archive/utils/pattern-scanner.js +31 -0
- package/dist/cjs/modules/archive/utils/timestamps.js +64 -3
- package/dist/cjs/modules/archive/utils/zip-extra-fields.js +26 -14
- package/dist/cjs/modules/archive/zip/index.js +162 -0
- package/dist/cjs/modules/archive/{streaming-zip.js → zip/stream.js} +194 -50
- package/dist/cjs/modules/archive/zip/zip-bytes.js +242 -0
- package/dist/cjs/modules/archive/{zip-entry-metadata.js → zip/zip-entry-metadata.js} +5 -5
- package/dist/cjs/modules/archive/zip-spec/zip-records.js +136 -0
- package/dist/cjs/modules/excel/stream/workbook-reader.browser.js +2 -2
- package/dist/cjs/modules/excel/stream/workbook-writer.browser.js +4 -4
- package/dist/cjs/modules/excel/utils/ooxml-validator.js +475 -0
- package/dist/cjs/modules/excel/utils/parse-sax.js +32 -13
- package/dist/cjs/modules/excel/worksheet.js +5 -2
- package/dist/cjs/modules/excel/xlsx/xform/core/app-xform.js +3 -3
- package/dist/cjs/modules/excel/xlsx/xform/core/core-xform.js +56 -68
- package/dist/cjs/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
- package/dist/cjs/modules/excel/xlsx/xform/drawing/sp-xform.js +115 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
- package/dist/cjs/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
- package/dist/cjs/modules/excel/xlsx/xform/list-xform.js +8 -10
- package/dist/cjs/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
- package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
- package/dist/cjs/modules/excel/xlsx/xform/strings/shared-string-xform.js +2 -3
- package/dist/cjs/modules/excel/xlsx/xform/strings/text-xform.js +5 -7
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +14 -13
- package/dist/cjs/modules/excel/xlsx/xlsx.js +2 -2
- package/dist/cjs/modules/stream/base-transform.js +34 -20
- package/dist/cjs/modules/stream/chunked-builder.js +4 -4
- package/dist/cjs/modules/stream/index.browser.js +10 -17
- package/dist/cjs/modules/stream/index.js +15 -39
- package/dist/cjs/modules/stream/internal/event-utils.js +43 -0
- package/dist/cjs/modules/stream/internal/type-guards.js +30 -0
- package/dist/cjs/modules/stream/pull-stream.js +107 -43
- package/dist/cjs/modules/stream/shared.js +7 -4
- package/dist/cjs/modules/stream/streams.browser.js +927 -847
- package/dist/cjs/modules/stream/streams.js +156 -107
- package/dist/cjs/modules/stream/utils.js +3 -36
- package/dist/esm/index.browser.js +12 -0
- package/dist/{browser/modules/archive → esm/modules/archive/compression}/compress.base.js +1 -1
- package/dist/esm/modules/archive/{compress.browser.js → compression/compress.browser.js} +3 -11
- package/dist/{browser/modules/archive → esm/modules/archive/compression}/compress.js +1 -1
- package/dist/esm/modules/archive/{crc32.js → compression/crc32.js} +1 -1
- package/dist/esm/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
- package/dist/esm/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
- package/dist/esm/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
- package/dist/esm/modules/archive/defaults.js +6 -3
- package/dist/esm/modules/archive/index.base.js +3 -6
- package/dist/esm/modules/archive/index.browser.js +3 -7
- package/dist/esm/modules/archive/index.js +3 -5
- package/dist/esm/modules/archive/internal/byte-queue.js +407 -0
- package/dist/esm/modules/archive/io/archive-sink.js +45 -0
- package/dist/esm/modules/archive/io/archive-source.js +100 -0
- package/dist/esm/modules/archive/unzip/index.js +164 -0
- package/dist/esm/modules/archive/unzip/stream.base.js +1022 -0
- package/dist/esm/modules/archive/{parse.browser.js → unzip/stream.browser.js} +371 -110
- package/dist/{browser/modules/archive/parse.js → esm/modules/archive/unzip/stream.js} +6 -5
- package/dist/{browser/modules/archive → esm/modules/archive/unzip}/zip-parser.js +38 -24
- package/dist/esm/modules/archive/utils/async-queue.js +103 -0
- package/dist/esm/modules/archive/utils/bytes.js +16 -16
- package/dist/esm/modules/archive/utils/compressibility.js +57 -0
- package/dist/esm/modules/archive/utils/parse-buffer.js +21 -23
- package/dist/esm/modules/archive/utils/pattern-scanner.js +27 -0
- package/dist/esm/modules/archive/utils/timestamps.js +62 -1
- package/dist/esm/modules/archive/utils/zip-extra-fields.js +26 -14
- package/dist/esm/modules/archive/zip/index.js +157 -0
- package/dist/esm/modules/archive/{streaming-zip.js → zip/stream.js} +192 -48
- package/dist/esm/modules/archive/zip/zip-bytes.js +239 -0
- package/dist/{browser/modules/archive → esm/modules/archive/zip}/zip-entry-metadata.js +3 -3
- package/dist/esm/modules/archive/zip-spec/zip-records.js +126 -0
- package/dist/esm/modules/excel/stream/workbook-reader.browser.js +1 -1
- package/dist/esm/modules/excel/stream/workbook-writer.browser.js +1 -1
- package/dist/esm/modules/excel/utils/ooxml-validator.js +469 -0
- package/dist/esm/modules/excel/utils/parse-sax.js +32 -13
- package/dist/esm/modules/excel/worksheet.js +5 -2
- package/dist/esm/modules/excel/xlsx/xform/core/app-xform.js +3 -3
- package/dist/esm/modules/excel/xlsx/xform/core/core-xform.js +56 -68
- package/dist/esm/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
- package/dist/esm/modules/excel/xlsx/xform/drawing/sp-xform.js +112 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
- package/dist/esm/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
- package/dist/esm/modules/excel/xlsx/xform/list-xform.js +8 -10
- package/dist/esm/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
- package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
- package/dist/esm/modules/excel/xlsx/xform/strings/shared-string-xform.js +2 -3
- package/dist/esm/modules/excel/xlsx/xform/strings/text-xform.js +5 -7
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +11 -10
- package/dist/esm/modules/excel/xlsx/xlsx.js +1 -1
- package/dist/esm/modules/stream/base-transform.js +34 -20
- package/dist/esm/modules/stream/chunked-builder.js +4 -4
- package/dist/esm/modules/stream/index.browser.js +10 -22
- package/dist/esm/modules/stream/index.js +15 -44
- package/dist/esm/modules/stream/internal/event-utils.js +40 -0
- package/dist/esm/modules/stream/internal/type-guards.js +24 -0
- package/dist/esm/modules/stream/pull-stream.js +107 -43
- package/dist/esm/modules/stream/shared.js +7 -4
- package/dist/esm/modules/stream/streams.browser.js +921 -836
- package/dist/esm/modules/stream/streams.js +146 -95
- package/dist/esm/modules/stream/utils.js +5 -38
- package/dist/iife/THIRD_PARTY_NOTICES.md +0 -31
- package/dist/iife/excelts.iife.js +6592 -4537
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +103 -31
- package/dist/types/index.browser.d.ts +1 -0
- package/dist/{browser/modules/archive → types/modules/archive/compression}/compress.browser.d.ts +2 -8
- package/dist/types/modules/archive/{streaming-compress.browser.d.ts → compression/streaming-compress.browser.d.ts} +1 -1
- package/dist/types/modules/archive/defaults.d.ts +1 -0
- package/dist/types/modules/archive/index.base.d.ts +4 -4
- package/dist/types/modules/archive/index.browser.d.ts +3 -4
- package/dist/types/modules/archive/index.d.ts +3 -4
- package/dist/types/modules/archive/internal/byte-queue.d.ts +33 -0
- package/dist/types/modules/archive/io/archive-sink.d.ts +8 -0
- package/dist/types/modules/archive/io/archive-source.d.ts +6 -0
- package/dist/types/modules/archive/unzip/index.d.ts +40 -0
- package/dist/types/modules/archive/{parse.base.d.ts → unzip/stream.base.d.ts} +38 -4
- package/dist/types/modules/archive/{parse.browser.d.ts → unzip/stream.browser.d.ts} +2 -2
- package/dist/types/modules/archive/{parse.d.ts → unzip/stream.d.ts} +3 -3
- package/dist/types/modules/archive/{zip-parser.d.ts → unzip/zip-parser.d.ts} +1 -1
- package/dist/types/modules/archive/utils/async-queue.d.ts +7 -0
- package/dist/types/modules/archive/utils/compressibility.d.ts +10 -0
- package/dist/types/modules/archive/utils/pattern-scanner.d.ts +21 -0
- package/dist/types/modules/archive/utils/zip-extra-fields.d.ts +1 -1
- package/dist/types/modules/archive/zip/index.d.ts +42 -0
- package/dist/types/modules/archive/{streaming-zip.d.ts → zip/stream.d.ts} +29 -6
- package/dist/types/modules/archive/zip/zip-bytes.d.ts +73 -0
- package/dist/types/modules/archive/{zip-entry-metadata.d.ts → zip/zip-entry-metadata.d.ts} +1 -1
- package/dist/types/modules/archive/{zip-records.d.ts → zip-spec/zip-records.d.ts} +20 -0
- package/dist/types/modules/excel/stream/workbook-writer.browser.d.ts +1 -1
- package/dist/types/modules/excel/utils/ooxml-validator.d.ts +48 -0
- package/dist/types/modules/excel/utils/parse-sax.d.ts +3 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.d.ts +1 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/sp-xform.d.ts +18 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +6 -1
- package/dist/types/modules/excel/xlsx/xform/sheet/page-setup-xform.d.ts +1 -0
- package/dist/types/modules/stream/base-transform.d.ts +3 -0
- package/dist/types/modules/stream/buffered-stream.d.ts +2 -12
- package/dist/types/modules/stream/index.browser.d.ts +13 -19
- package/dist/types/modules/stream/index.d.ts +18 -41
- package/dist/types/modules/stream/internal/event-utils.d.ts +17 -0
- package/dist/types/modules/stream/internal/type-guards.d.ts +9 -0
- package/dist/types/modules/stream/pull-stream.d.ts +5 -6
- package/dist/types/modules/stream/shared.d.ts +1 -1
- package/dist/types/modules/stream/streams.browser.d.ts +32 -44
- package/dist/types/modules/stream/streams.d.ts +4 -20
- package/package.json +14 -10
- package/dist/browser/modules/archive/byte-queue.d.ts +0 -18
- package/dist/browser/modules/archive/byte-queue.js +0 -125
- package/dist/browser/modules/archive/parse.base.js +0 -644
- package/dist/browser/modules/archive/utils/zip-extra.d.ts +0 -18
- package/dist/browser/modules/archive/utils/zip-extra.js +0 -68
- package/dist/browser/modules/archive/zip-builder.d.ts +0 -117
- package/dist/browser/modules/archive/zip-builder.js +0 -292
- package/dist/browser/modules/archive/zip-constants.d.ts +0 -18
- package/dist/browser/modules/archive/zip-constants.js +0 -23
- package/dist/browser/modules/archive/zip-records.js +0 -84
- package/dist/cjs/modules/archive/byte-queue.js +0 -129
- package/dist/cjs/modules/archive/parse.base.js +0 -666
- package/dist/cjs/modules/archive/utils/zip-extra.js +0 -74
- package/dist/cjs/modules/archive/zip-builder.js +0 -297
- package/dist/cjs/modules/archive/zip-constants.js +0 -26
- package/dist/cjs/modules/archive/zip-records.js +0 -90
- package/dist/esm/modules/archive/byte-queue.js +0 -125
- package/dist/esm/modules/archive/parse.base.js +0 -644
- package/dist/esm/modules/archive/utils/zip-extra.js +0 -68
- package/dist/esm/modules/archive/zip-builder.js +0 -292
- package/dist/esm/modules/archive/zip-constants.js +0 -23
- package/dist/esm/modules/archive/zip-records.js +0 -84
- package/dist/types/modules/archive/byte-queue.d.ts +0 -18
- package/dist/types/modules/archive/utils/zip-extra.d.ts +0 -18
- package/dist/types/modules/archive/zip-builder.d.ts +0 -117
- package/dist/types/modules/archive/zip-constants.d.ts +0 -18
- /package/dist/browser/modules/archive/{compress.base.d.ts → compression/compress.base.d.ts} +0 -0
- /package/dist/browser/modules/archive/{crc32.base.d.ts → compression/crc32.base.d.ts} +0 -0
- /package/dist/browser/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
- /package/dist/browser/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
- /package/dist/browser/modules/archive/{deflate-fallback.d.ts → compression/deflate-fallback.d.ts} +0 -0
- /package/dist/browser/modules/archive/{streaming-compress.base.d.ts → compression/streaming-compress.base.d.ts} +0 -0
- /package/dist/browser/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
- /package/dist/browser/modules/archive/{extract.js → unzip/extract.js} +0 -0
- /package/dist/browser/modules/archive/{zip-entry-metadata.d.ts → zip/zip-entry-metadata.d.ts} +0 -0
- /package/dist/browser/modules/archive/{zip-entry-info.d.ts → zip-spec/zip-entry-info.d.ts} +0 -0
- /package/dist/browser/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
- /package/dist/cjs/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
- /package/dist/cjs/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
- /package/dist/cjs/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
- /package/dist/cjs/modules/archive/{extract.js → unzip/extract.js} +0 -0
- /package/dist/cjs/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
- /package/dist/esm/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
- /package/dist/esm/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
- /package/dist/esm/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
- /package/dist/esm/modules/archive/{extract.js → unzip/extract.js} +0 -0
- /package/dist/esm/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
- /package/dist/types/modules/archive/{compress.base.d.ts → compression/compress.base.d.ts} +0 -0
- /package/dist/types/modules/archive/{compress.d.ts → compression/compress.d.ts} +0 -0
- /package/dist/types/modules/archive/{crc32.base.d.ts → compression/crc32.base.d.ts} +0 -0
- /package/dist/types/modules/archive/{crc32.browser.d.ts → compression/crc32.browser.d.ts} +0 -0
- /package/dist/types/modules/archive/{crc32.d.ts → compression/crc32.d.ts} +0 -0
- /package/dist/types/modules/archive/{deflate-fallback.d.ts → compression/deflate-fallback.d.ts} +0 -0
- /package/dist/types/modules/archive/{streaming-compress.base.d.ts → compression/streaming-compress.base.d.ts} +0 -0
- /package/dist/types/modules/archive/{streaming-compress.d.ts → compression/streaming-compress.d.ts} +0 -0
- /package/dist/types/modules/archive/{extract.d.ts → unzip/extract.d.ts} +0 -0
- /package/dist/types/modules/archive/{zip-entry-info.d.ts → zip-spec/zip-entry-info.d.ts} +0 -0
|
@@ -6,31 +6,50 @@ const base_xform_1 = require("../base-xform.js");
|
|
|
6
6
|
const date_xform_1 = require("../simple/date-xform.js");
|
|
7
7
|
const string_xform_1 = require("../simple/string-xform.js");
|
|
8
8
|
const integer_xform_1 = require("../simple/integer-xform.js");
|
|
9
|
+
// Rendering uses namespace prefixes, parsing uses unqualified names (SAX strips prefixes)
|
|
10
|
+
const PROPS = {
|
|
11
|
+
creator: "dc:creator",
|
|
12
|
+
title: "dc:title",
|
|
13
|
+
subject: "dc:subject",
|
|
14
|
+
description: "dc:description",
|
|
15
|
+
identifier: "dc:identifier",
|
|
16
|
+
language: "dc:language",
|
|
17
|
+
keywords: "cp:keywords",
|
|
18
|
+
category: "cp:category",
|
|
19
|
+
lastModifiedBy: "cp:lastModifiedBy",
|
|
20
|
+
lastPrinted: "cp:lastPrinted",
|
|
21
|
+
revision: "cp:revision",
|
|
22
|
+
version: "cp:version",
|
|
23
|
+
contentStatus: "cp:contentStatus",
|
|
24
|
+
contentType: "cp:contentType",
|
|
25
|
+
created: "dcterms:created",
|
|
26
|
+
modified: "dcterms:modified"
|
|
27
|
+
};
|
|
9
28
|
class CoreXform extends base_xform_1.BaseXform {
|
|
10
29
|
constructor() {
|
|
11
30
|
super();
|
|
12
31
|
this.map = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
tag:
|
|
32
|
+
creator: new string_xform_1.StringXform({ tag: PROPS.creator }),
|
|
33
|
+
title: new string_xform_1.StringXform({ tag: PROPS.title }),
|
|
34
|
+
subject: new string_xform_1.StringXform({ tag: PROPS.subject }),
|
|
35
|
+
description: new string_xform_1.StringXform({ tag: PROPS.description }),
|
|
36
|
+
identifier: new string_xform_1.StringXform({ tag: PROPS.identifier }),
|
|
37
|
+
language: new string_xform_1.StringXform({ tag: PROPS.language }),
|
|
38
|
+
keywords: new string_xform_1.StringXform({ tag: PROPS.keywords }),
|
|
39
|
+
category: new string_xform_1.StringXform({ tag: PROPS.category }),
|
|
40
|
+
lastModifiedBy: new string_xform_1.StringXform({ tag: PROPS.lastModifiedBy }),
|
|
41
|
+
lastPrinted: new date_xform_1.DateXform({ tag: PROPS.lastPrinted, format: CoreXform.DateFormat }),
|
|
42
|
+
revision: new integer_xform_1.IntegerXform({ tag: PROPS.revision }),
|
|
43
|
+
version: new string_xform_1.StringXform({ tag: PROPS.version }),
|
|
44
|
+
contentStatus: new string_xform_1.StringXform({ tag: PROPS.contentStatus }),
|
|
45
|
+
contentType: new string_xform_1.StringXform({ tag: PROPS.contentType }),
|
|
46
|
+
created: new date_xform_1.DateXform({
|
|
47
|
+
tag: PROPS.created,
|
|
29
48
|
attrs: CoreXform.DateAttrs,
|
|
30
49
|
format: CoreXform.DateFormat
|
|
31
50
|
}),
|
|
32
|
-
|
|
33
|
-
tag:
|
|
51
|
+
modified: new date_xform_1.DateXform({
|
|
52
|
+
tag: PROPS.modified,
|
|
34
53
|
attrs: CoreXform.DateAttrs,
|
|
35
54
|
format: CoreXform.DateFormat
|
|
36
55
|
})
|
|
@@ -39,22 +58,9 @@ class CoreXform extends base_xform_1.BaseXform {
|
|
|
39
58
|
render(xmlStream, model) {
|
|
40
59
|
xmlStream.openXml(xml_stream_1.XmlStream.StdDocAttributes);
|
|
41
60
|
xmlStream.openNode("cp:coreProperties", CoreXform.CORE_PROPERTY_ATTRIBUTES);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this.map["dc:description"].render(xmlStream, model.description);
|
|
46
|
-
this.map["dc:identifier"].render(xmlStream, model.identifier);
|
|
47
|
-
this.map["dc:language"].render(xmlStream, model.language);
|
|
48
|
-
this.map["cp:keywords"].render(xmlStream, model.keywords);
|
|
49
|
-
this.map["cp:category"].render(xmlStream, model.category);
|
|
50
|
-
this.map["cp:lastModifiedBy"].render(xmlStream, model.lastModifiedBy);
|
|
51
|
-
this.map["cp:lastPrinted"].render(xmlStream, model.lastPrinted);
|
|
52
|
-
this.map["cp:revision"].render(xmlStream, model.revision);
|
|
53
|
-
this.map["cp:version"].render(xmlStream, model.version);
|
|
54
|
-
this.map["cp:contentStatus"].render(xmlStream, model.contentStatus);
|
|
55
|
-
this.map["cp:contentType"].render(xmlStream, model.contentType);
|
|
56
|
-
this.map["dcterms:created"].render(xmlStream, model.created);
|
|
57
|
-
this.map["dcterms:modified"].render(xmlStream, model.modified);
|
|
61
|
+
for (const key of Object.keys(PROPS)) {
|
|
62
|
+
this.map[key].render(xmlStream, model[key]);
|
|
63
|
+
}
|
|
58
64
|
xmlStream.closeNode();
|
|
59
65
|
}
|
|
60
66
|
parseOpen(node) {
|
|
@@ -62,18 +68,13 @@ class CoreXform extends base_xform_1.BaseXform {
|
|
|
62
68
|
this.parser.parseOpen(node);
|
|
63
69
|
return true;
|
|
64
70
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.parser = this.map[node.name];
|
|
71
|
-
if (this.parser) {
|
|
72
|
-
this.parser.parseOpen(node);
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
throw new Error(`Unexpected xml node in parseOpen: ${JSON.stringify(node)}`);
|
|
71
|
+
if (node.name !== "coreProperties") {
|
|
72
|
+
this.parser = this.map[node.name];
|
|
73
|
+
if (this.parser) {
|
|
74
|
+
this.parser.parseOpen(node);
|
|
75
|
+
}
|
|
76
76
|
}
|
|
77
|
+
return true;
|
|
77
78
|
}
|
|
78
79
|
parseText(text) {
|
|
79
80
|
if (this.parser) {
|
|
@@ -87,30 +88,17 @@ class CoreXform extends base_xform_1.BaseXform {
|
|
|
87
88
|
}
|
|
88
89
|
return true;
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this.model
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
language: this.map["dc:language"].model,
|
|
100
|
-
keywords: this.map["cp:keywords"].model,
|
|
101
|
-
category: this.map["cp:category"].model,
|
|
102
|
-
lastModifiedBy: this.map["cp:lastModifiedBy"].model,
|
|
103
|
-
lastPrinted: this.map["cp:lastPrinted"].model,
|
|
104
|
-
revision: this.map["cp:revision"].model,
|
|
105
|
-
contentStatus: this.map["cp:contentStatus"].model,
|
|
106
|
-
contentType: this.map["cp:contentType"].model,
|
|
107
|
-
created: this.map["dcterms:created"].model,
|
|
108
|
-
modified: this.map["dcterms:modified"].model
|
|
109
|
-
};
|
|
110
|
-
return false;
|
|
111
|
-
default:
|
|
112
|
-
throw new Error(`Unexpected xml node in parseClose: ${name}`);
|
|
91
|
+
if (name === "coreProperties") {
|
|
92
|
+
this.model = {};
|
|
93
|
+
for (const key of Object.keys(PROPS)) {
|
|
94
|
+
const val = this.map[key].model;
|
|
95
|
+
if (val !== undefined && val !== "") {
|
|
96
|
+
this.model[key] = val;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return false;
|
|
113
100
|
}
|
|
101
|
+
return true;
|
|
114
102
|
}
|
|
115
103
|
}
|
|
116
104
|
exports.CoreXform = CoreXform;
|
|
@@ -10,6 +10,17 @@ const base_xform_1 = require("../base-xform.js");
|
|
|
10
10
|
* that stores its properties like objectType, checked state, and linked cell.
|
|
11
11
|
*/
|
|
12
12
|
class CtrlPropXform extends base_xform_1.BaseXform {
|
|
13
|
+
_checkedToXmlValue(checked) {
|
|
14
|
+
switch (checked) {
|
|
15
|
+
case "Checked":
|
|
16
|
+
return "1";
|
|
17
|
+
case "Mixed":
|
|
18
|
+
return "2";
|
|
19
|
+
case "Unchecked":
|
|
20
|
+
default:
|
|
21
|
+
return "0";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
13
24
|
get tag() {
|
|
14
25
|
return "formControlPr";
|
|
15
26
|
}
|
|
@@ -18,7 +29,8 @@ class CtrlPropXform extends base_xform_1.BaseXform {
|
|
|
18
29
|
const attrs = {
|
|
19
30
|
xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",
|
|
20
31
|
objectType: "CheckBox",
|
|
21
|
-
|
|
32
|
+
// Excel tends to serialize this as numeric state (0/1/2), matching VML x:Checked.
|
|
33
|
+
checked: this._checkedToXmlValue(renderModel.checked),
|
|
22
34
|
lockText: "1"
|
|
23
35
|
};
|
|
24
36
|
// Add linked cell reference
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpXform = void 0;
|
|
4
|
+
const base_xform_1 = require("../base-xform.js");
|
|
5
|
+
class SpXform extends base_xform_1.BaseXform {
|
|
6
|
+
get tag() {
|
|
7
|
+
return "xdr:sp";
|
|
8
|
+
}
|
|
9
|
+
render(xmlStream, model) {
|
|
10
|
+
if (!model) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
xmlStream.openNode(this.tag, { macro: "", textlink: "" });
|
|
14
|
+
// Non-visual properties
|
|
15
|
+
xmlStream.openNode("xdr:nvSpPr");
|
|
16
|
+
xmlStream.openNode("xdr:cNvPr", {
|
|
17
|
+
id: model.cNvPrId,
|
|
18
|
+
name: model.name,
|
|
19
|
+
hidden: model.hidden ? "1" : undefined
|
|
20
|
+
});
|
|
21
|
+
xmlStream.openNode("a:extLst");
|
|
22
|
+
xmlStream.openNode("a:ext", {
|
|
23
|
+
uri: "{63B3BB69-23CF-44E3-9099-C40C66FF867C}"
|
|
24
|
+
});
|
|
25
|
+
xmlStream.leafNode("a14:compatExt", {
|
|
26
|
+
spid: model.spid,
|
|
27
|
+
"xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main"
|
|
28
|
+
}, undefined);
|
|
29
|
+
xmlStream.closeNode(); // a:ext
|
|
30
|
+
xmlStream.closeNode(); // a:extLst
|
|
31
|
+
xmlStream.closeNode(); // xdr:cNvPr
|
|
32
|
+
xmlStream.leafNode("xdr:cNvSpPr");
|
|
33
|
+
xmlStream.closeNode(); // xdr:nvSpPr
|
|
34
|
+
// Shape properties
|
|
35
|
+
xmlStream.openNode("xdr:spPr", { bwMode: "auto" });
|
|
36
|
+
xmlStream.openNode("a:xfrm");
|
|
37
|
+
xmlStream.leafNode("a:off", { x: 0, y: 0 });
|
|
38
|
+
xmlStream.leafNode("a:ext", { cx: 0, cy: 0 });
|
|
39
|
+
xmlStream.closeNode(); // a:xfrm
|
|
40
|
+
xmlStream.openNode("a:prstGeom", { prst: "rect" });
|
|
41
|
+
xmlStream.leafNode("a:avLst");
|
|
42
|
+
xmlStream.closeNode(); // a:prstGeom
|
|
43
|
+
xmlStream.leafNode("a:noFill");
|
|
44
|
+
xmlStream.openNode("a:ln");
|
|
45
|
+
xmlStream.leafNode("a:noFill");
|
|
46
|
+
xmlStream.closeNode(); // a:ln
|
|
47
|
+
xmlStream.openNode("a:extLst");
|
|
48
|
+
xmlStream.openNode("a:ext", { uri: "{909E8E84-426E-40DD-AFC4-6F175D3DCCD1}" });
|
|
49
|
+
xmlStream.openNode("a14:hiddenFill", {
|
|
50
|
+
"xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main"
|
|
51
|
+
});
|
|
52
|
+
xmlStream.openNode("a:solidFill");
|
|
53
|
+
xmlStream.leafNode("a:srgbClr", { val: "F0F0F0" });
|
|
54
|
+
xmlStream.closeNode(); // a:solidFill
|
|
55
|
+
xmlStream.closeNode(); // a14:hiddenFill
|
|
56
|
+
xmlStream.closeNode(); // a:ext
|
|
57
|
+
xmlStream.openNode("a:ext", { uri: "{91240B29-F687-4F45-9708-019B960494DF}" });
|
|
58
|
+
xmlStream.openNode("a14:hiddenLine", {
|
|
59
|
+
w: 9525,
|
|
60
|
+
"xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main"
|
|
61
|
+
});
|
|
62
|
+
xmlStream.openNode("a:solidFill");
|
|
63
|
+
xmlStream.leafNode("a:srgbClr", { val: "000000" });
|
|
64
|
+
xmlStream.closeNode(); // a:solidFill
|
|
65
|
+
xmlStream.leafNode("a:miter", { lim: 800000 });
|
|
66
|
+
xmlStream.leafNode("a:headEnd");
|
|
67
|
+
xmlStream.leafNode("a:tailEnd");
|
|
68
|
+
xmlStream.closeNode(); // a14:hiddenLine
|
|
69
|
+
xmlStream.closeNode(); // a:ext
|
|
70
|
+
xmlStream.closeNode(); // a:extLst
|
|
71
|
+
xmlStream.closeNode(); // xdr:spPr
|
|
72
|
+
// Text body (label)
|
|
73
|
+
xmlStream.openNode("xdr:txBody");
|
|
74
|
+
xmlStream.leafNode("a:bodyPr", {
|
|
75
|
+
vertOverflow: "clip",
|
|
76
|
+
wrap: "square",
|
|
77
|
+
lIns: 18288,
|
|
78
|
+
tIns: 18288,
|
|
79
|
+
rIns: 0,
|
|
80
|
+
bIns: 18288,
|
|
81
|
+
anchor: "ctr",
|
|
82
|
+
upright: 1
|
|
83
|
+
});
|
|
84
|
+
xmlStream.leafNode("a:lstStyle");
|
|
85
|
+
xmlStream.openNode("a:p");
|
|
86
|
+
xmlStream.openNode("a:pPr", { algn: "l", rtl: 0 });
|
|
87
|
+
xmlStream.leafNode("a:defRPr", { sz: 1000 });
|
|
88
|
+
xmlStream.closeNode(); // a:pPr
|
|
89
|
+
xmlStream.openNode("a:r");
|
|
90
|
+
xmlStream.openNode("a:rPr", {
|
|
91
|
+
lang: "en-US",
|
|
92
|
+
sz: 800,
|
|
93
|
+
b: 0,
|
|
94
|
+
i: 0,
|
|
95
|
+
u: "none",
|
|
96
|
+
strike: "noStrike",
|
|
97
|
+
baseline: 0
|
|
98
|
+
});
|
|
99
|
+
xmlStream.openNode("a:solidFill");
|
|
100
|
+
xmlStream.leafNode("a:srgbClr", { val: "000000" });
|
|
101
|
+
xmlStream.closeNode(); // a:solidFill
|
|
102
|
+
xmlStream.leafNode("a:latin", { typeface: "Tahoma", pitchFamily: 2, charset: 0 });
|
|
103
|
+
xmlStream.leafNode("a:ea", { typeface: "Tahoma", pitchFamily: 2, charset: 0 });
|
|
104
|
+
xmlStream.leafNode("a:cs", { typeface: "Tahoma", pitchFamily: 2, charset: 0 });
|
|
105
|
+
xmlStream.closeNode(); // a:rPr
|
|
106
|
+
xmlStream.openNode("a:t");
|
|
107
|
+
xmlStream.writeText(model.text ?? "");
|
|
108
|
+
xmlStream.closeNode(); // a:t
|
|
109
|
+
xmlStream.closeNode(); // a:r
|
|
110
|
+
xmlStream.closeNode(); // a:p
|
|
111
|
+
xmlStream.closeNode(); // xdr:txBody
|
|
112
|
+
xmlStream.closeNode(); // xdr:sp
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.SpXform = SpXform;
|
|
@@ -5,6 +5,7 @@ const base_cell_anchor_xform_1 = require("./base-cell-anchor-xform.js");
|
|
|
5
5
|
const static_xform_1 = require("../static-xform.js");
|
|
6
6
|
const cell_position_xform_1 = require("./cell-position-xform.js");
|
|
7
7
|
const pic_xform_1 = require("./pic-xform.js");
|
|
8
|
+
const sp_xform_1 = require("./sp-xform.js");
|
|
8
9
|
class TwoCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
|
|
9
10
|
constructor() {
|
|
10
11
|
super();
|
|
@@ -12,6 +13,7 @@ class TwoCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
|
|
|
12
13
|
"xdr:from": new cell_position_xform_1.CellPositionXform({ tag: "xdr:from" }),
|
|
13
14
|
"xdr:to": new cell_position_xform_1.CellPositionXform({ tag: "xdr:to" }),
|
|
14
15
|
"xdr:pic": new pic_xform_1.PicXform(),
|
|
16
|
+
"xdr:sp": new sp_xform_1.SpXform(),
|
|
15
17
|
"xdr:clientData": new static_xform_1.StaticXform({ tag: "xdr:clientData" })
|
|
16
18
|
};
|
|
17
19
|
}
|
|
@@ -19,15 +21,41 @@ class TwoCellAnchorXform extends base_cell_anchor_xform_1.BaseCellAnchorXform {
|
|
|
19
21
|
return "xdr:twoCellAnchor";
|
|
20
22
|
}
|
|
21
23
|
prepare(model, options) {
|
|
22
|
-
|
|
24
|
+
if (model.picture) {
|
|
25
|
+
this.map["xdr:pic"].prepare(model.picture, options);
|
|
26
|
+
}
|
|
23
27
|
}
|
|
24
28
|
render(xmlStream, model) {
|
|
29
|
+
const wrapAlternateContent = !!model.alternateContent;
|
|
30
|
+
if (wrapAlternateContent) {
|
|
31
|
+
xmlStream.openNode("mc:AlternateContent", {
|
|
32
|
+
"xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
33
|
+
});
|
|
34
|
+
xmlStream.openNode("mc:Choice", {
|
|
35
|
+
Requires: model.alternateContent?.requires,
|
|
36
|
+
...(model.alternateContent?.requires === "a14"
|
|
37
|
+
? {
|
|
38
|
+
"xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main"
|
|
39
|
+
}
|
|
40
|
+
: {})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
25
43
|
xmlStream.openNode(this.tag, { editAs: model.range.editAs || "oneCell" });
|
|
26
44
|
this.map["xdr:from"].render(xmlStream, model.range.tl);
|
|
27
45
|
this.map["xdr:to"].render(xmlStream, model.range.br);
|
|
28
|
-
|
|
46
|
+
if (model.picture) {
|
|
47
|
+
this.map["xdr:pic"].render(xmlStream, model.picture);
|
|
48
|
+
}
|
|
49
|
+
else if (model.shape) {
|
|
50
|
+
this.map["xdr:sp"].render(xmlStream, model.shape);
|
|
51
|
+
}
|
|
29
52
|
this.map["xdr:clientData"].render(xmlStream, {});
|
|
30
53
|
xmlStream.closeNode();
|
|
54
|
+
if (wrapAlternateContent) {
|
|
55
|
+
xmlStream.closeNode(); // mc:Choice
|
|
56
|
+
xmlStream.leafNode("mc:Fallback");
|
|
57
|
+
xmlStream.closeNode(); // mc:AlternateContent
|
|
58
|
+
}
|
|
31
59
|
}
|
|
32
60
|
parseClose(name) {
|
|
33
61
|
if (this.parser) {
|
|
@@ -110,14 +110,22 @@ class VmlDrawingXform extends base_xform_1.BaseXform {
|
|
|
110
110
|
}
|
|
111
111
|
// ClientData - the core of the checkbox control
|
|
112
112
|
xmlStream.openNode("x:ClientData", { ObjectType: "Checkbox" });
|
|
113
|
+
// Match Excel's VML patterns (similar to Note ClientData): include positioning and cell address.
|
|
114
|
+
// Omitting these can cause Excel to repair the sheet by dropping all legacy controls.
|
|
115
|
+
xmlStream.leafNode("x:MoveWithCells");
|
|
116
|
+
xmlStream.leafNode("x:SizeWithCells");
|
|
113
117
|
// Anchor position
|
|
114
118
|
xmlStream.openNode("x:Anchor");
|
|
115
119
|
xmlStream.writeText(form_control_1.FormCheckbox.getVmlAnchor(control));
|
|
116
120
|
xmlStream.closeNode();
|
|
121
|
+
// Protection / text locking
|
|
122
|
+
xmlStream.leafNode("x:Locked", undefined, "False");
|
|
123
|
+
xmlStream.leafNode("x:LockText", undefined, "True");
|
|
117
124
|
// Print settings
|
|
118
125
|
xmlStream.leafNode("x:PrintObject", undefined, control.print ? "True" : "False");
|
|
119
126
|
xmlStream.leafNode("x:AutoFill", undefined, "False");
|
|
120
127
|
xmlStream.leafNode("x:AutoLine", undefined, "False");
|
|
128
|
+
xmlStream.leafNode("x:TextHAlign", undefined, "Left");
|
|
121
129
|
xmlStream.leafNode("x:TextVAlign", undefined, "Center");
|
|
122
130
|
// Linked cell
|
|
123
131
|
if (control.link) {
|
|
@@ -129,6 +137,9 @@ class VmlDrawingXform extends base_xform_1.BaseXform {
|
|
|
129
137
|
}
|
|
130
138
|
// Checked state (0 = unchecked, 1 = checked, 2 = mixed)
|
|
131
139
|
xmlStream.leafNode("x:Checked", undefined, String(form_control_1.FormCheckbox.getVmlCheckedValue(control)));
|
|
140
|
+
// Cell address (0-based row/column)
|
|
141
|
+
xmlStream.leafNode("x:Row", undefined, String(control.tl.row));
|
|
142
|
+
xmlStream.leafNode("x:Column", undefined, String(control.tl.col));
|
|
132
143
|
xmlStream.closeNode(); // x:ClientData
|
|
133
144
|
xmlStream.closeNode(); // v:shape
|
|
134
145
|
}
|
|
@@ -44,17 +44,15 @@ class ListXform extends base_xform_1.BaseXform {
|
|
|
44
44
|
this.parser.parseOpen(node);
|
|
45
45
|
return true;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return true;
|
|
51
|
-
default:
|
|
52
|
-
if (this.childXform.parseOpen(node)) {
|
|
53
|
-
this.parser = this.childXform;
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
return false;
|
|
47
|
+
if (node.name === this.tag) {
|
|
48
|
+
this.model = [];
|
|
49
|
+
return true;
|
|
57
50
|
}
|
|
51
|
+
if (this.childXform.parseOpen(node)) {
|
|
52
|
+
this.parser = this.childXform;
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
58
56
|
}
|
|
59
57
|
parseText(text) {
|
|
60
58
|
if (this.parser) {
|
|
@@ -39,13 +39,27 @@ class PageSetupXform extends base_xform_1.BaseXform {
|
|
|
39
39
|
get tag() {
|
|
40
40
|
return "pageSetup";
|
|
41
41
|
}
|
|
42
|
+
_dpiToXml(value) {
|
|
43
|
+
// Excel commonly omits these attributes. 4294967295 is used as a sentinel default
|
|
44
|
+
// when parsing missing values; it should never be serialized back out.
|
|
45
|
+
if (value === undefined) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
if (!Number.isFinite(value)) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
if (value === 4294967295) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
42
56
|
render(xmlStream, model) {
|
|
43
57
|
if (model) {
|
|
44
58
|
const attributes = {
|
|
45
59
|
paperSize: model.paperSize,
|
|
46
60
|
orientation: model.orientation,
|
|
47
|
-
horizontalDpi: model.horizontalDpi,
|
|
48
|
-
verticalDpi: model.verticalDpi,
|
|
61
|
+
horizontalDpi: this._dpiToXml(model.horizontalDpi),
|
|
62
|
+
verticalDpi: this._dpiToXml(model.verticalDpi),
|
|
49
63
|
pageOrder: pageOrderToXml(model.pageOrder),
|
|
50
64
|
blackAndWhite: booleanToXml(model.blackAndWhite),
|
|
51
65
|
draft: booleanToXml(model.draft),
|
|
@@ -140,6 +140,14 @@ class WorkSheetXform extends base_xform_1.BaseXform {
|
|
|
140
140
|
options.merges = new merges_1.Merges();
|
|
141
141
|
model.hyperlinks = options.hyperlinks = [];
|
|
142
142
|
model.comments = options.comments = [];
|
|
143
|
+
// Some Excel builds are surprisingly strict when legacy form controls exist.
|
|
144
|
+
// Emitting a default sheetView (workbookViewId=0) matches typical Excel output
|
|
145
|
+
// and avoids relying on optional element handling.
|
|
146
|
+
if (model.formControls && model.formControls.length > 0) {
|
|
147
|
+
if (!model.views || model.views.length === 0) {
|
|
148
|
+
model.views = [{ workbookViewId: 0 }];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
143
151
|
options.formulae = {};
|
|
144
152
|
options.siFormulae = 0;
|
|
145
153
|
this.map.cols.prepare(model.cols, options);
|
|
@@ -281,6 +289,23 @@ class WorkSheetXform extends base_xform_1.BaseXform {
|
|
|
281
289
|
// prepare form controls (legacy checkboxes)
|
|
282
290
|
// Form controls share the VML file with comments, but need separate ctrlProp relationships
|
|
283
291
|
if (model.formControls && model.formControls.length > 0) {
|
|
292
|
+
// Ensure a DrawingML drawing part exists for form controls.
|
|
293
|
+
// Excel often repairs sheets that have legacy controls but no <drawing> part.
|
|
294
|
+
let { drawing } = model;
|
|
295
|
+
if (!drawing) {
|
|
296
|
+
drawing = model.drawing = {
|
|
297
|
+
rId: nextRid(rels),
|
|
298
|
+
name: `drawing${++options.drawingsCount}`,
|
|
299
|
+
anchors: [],
|
|
300
|
+
rels: []
|
|
301
|
+
};
|
|
302
|
+
options.drawings.push(drawing);
|
|
303
|
+
rels.push({
|
|
304
|
+
Id: drawing.rId,
|
|
305
|
+
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
|
|
306
|
+
Target: (0, ooxml_paths_1.drawingRelTargetFromWorksheet)(drawing.name)
|
|
307
|
+
});
|
|
308
|
+
}
|
|
284
309
|
// If no comments, we need to add the VML drawing relationship for form controls
|
|
285
310
|
if (model.comments.length === 0) {
|
|
286
311
|
rels.push({
|
|
@@ -289,6 +314,14 @@ class WorkSheetXform extends base_xform_1.BaseXform {
|
|
|
289
314
|
Target: (0, ooxml_paths_1.vmlDrawingRelTargetFromWorksheet)(model.id)
|
|
290
315
|
});
|
|
291
316
|
}
|
|
317
|
+
// Add hidden DrawingML shapes that bridge to the VML shape ids.
|
|
318
|
+
// This mirrors what Excel writes when it "repairs" legacy form controls.
|
|
319
|
+
const toNativePos = (p) => ({
|
|
320
|
+
nativeCol: p.col,
|
|
321
|
+
nativeColOff: p.colOff,
|
|
322
|
+
nativeRow: p.row,
|
|
323
|
+
nativeRowOff: p.rowOff
|
|
324
|
+
});
|
|
292
325
|
// Add ctrlProp relationships for each form control
|
|
293
326
|
for (const control of model.formControls) {
|
|
294
327
|
const globalCtrlPropId = options.formControlRefs.length + 1;
|
|
@@ -301,6 +334,22 @@ class WorkSheetXform extends base_xform_1.BaseXform {
|
|
|
301
334
|
Target: (0, ooxml_paths_1.ctrlPropRelTargetFromWorksheet)(globalCtrlPropId)
|
|
302
335
|
});
|
|
303
336
|
options.formControlRefs.push(globalCtrlPropId);
|
|
337
|
+
const defaultName = `Check Box ${Math.max(1, control.shapeId - 1024)}`;
|
|
338
|
+
drawing.anchors.push({
|
|
339
|
+
range: {
|
|
340
|
+
editAs: "absolute",
|
|
341
|
+
tl: toNativePos(control.tl),
|
|
342
|
+
br: toNativePos(control.br)
|
|
343
|
+
},
|
|
344
|
+
alternateContent: { requires: "a14" },
|
|
345
|
+
shape: {
|
|
346
|
+
cNvPrId: control.shapeId,
|
|
347
|
+
name: control.name || defaultName,
|
|
348
|
+
hidden: true,
|
|
349
|
+
spid: `_x0000_s${control.shapeId}`,
|
|
350
|
+
text: control.text
|
|
351
|
+
}
|
|
352
|
+
});
|
|
304
353
|
}
|
|
305
354
|
}
|
|
306
355
|
// prepare ext items
|
|
@@ -308,7 +357,14 @@ class WorkSheetXform extends base_xform_1.BaseXform {
|
|
|
308
357
|
}
|
|
309
358
|
render(xmlStream, model) {
|
|
310
359
|
xmlStream.openXml(xml_stream_1.XmlStream.StdDocAttributes);
|
|
311
|
-
|
|
360
|
+
const worksheetAttrs = { ...WorkSheetXform.WORKSHEET_ATTRIBUTES };
|
|
361
|
+
if (model.formControls && model.formControls.length > 0) {
|
|
362
|
+
worksheetAttrs["xmlns:x14"] = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main";
|
|
363
|
+
worksheetAttrs["xmlns:xdr"] =
|
|
364
|
+
"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing";
|
|
365
|
+
worksheetAttrs["mc:Ignorable"] = `${worksheetAttrs["mc:Ignorable"]} x14`;
|
|
366
|
+
}
|
|
367
|
+
xmlStream.openNode("worksheet", worksheetAttrs);
|
|
312
368
|
const sheetFormatPropertiesModel = model.properties
|
|
313
369
|
? {
|
|
314
370
|
defaultRowHeight: model.properties.defaultRowHeight,
|
|
@@ -358,26 +414,68 @@ class WorkSheetXform extends base_xform_1.BaseXform {
|
|
|
358
414
|
this.map.colBreaks.render(xmlStream, model.colBreaks);
|
|
359
415
|
this.map.drawing.render(xmlStream, model.drawing); // Note: must be after rowBreaks/colBreaks
|
|
360
416
|
this.map.picture.render(xmlStream, model.background); // Note: must be after drawing
|
|
361
|
-
|
|
417
|
+
if (model.rels) {
|
|
418
|
+
// Add a <legacyDrawing /> node for each VML drawing relationship (comments and/or form controls).
|
|
419
|
+
// NOTE: Excel is picky about worksheet child element order; legacyDrawing must come before controls.
|
|
420
|
+
model.rels.forEach(rel => {
|
|
421
|
+
if (rel.Type === rel_type_1.RelType.VmlDrawing) {
|
|
422
|
+
xmlStream.leafNode("legacyDrawing", { "r:id": rel.Id });
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
}
|
|
362
426
|
// Controls section for legacy form controls (checkboxes, etc.)
|
|
363
427
|
// Excel expects <controls> entries that reference ctrlProp relationships.
|
|
364
428
|
if (model.formControls && model.formControls.length > 0) {
|
|
429
|
+
xmlStream.openNode("mc:AlternateContent");
|
|
430
|
+
xmlStream.openNode("mc:Choice", { Requires: "x14" });
|
|
365
431
|
xmlStream.openNode("controls");
|
|
366
432
|
for (const control of model.formControls) {
|
|
367
|
-
if (control.ctrlPropRelId) {
|
|
368
|
-
|
|
433
|
+
if (!control.ctrlPropRelId) {
|
|
434
|
+
continue;
|
|
369
435
|
}
|
|
436
|
+
const defaultName = `Check Box ${Math.max(1, control.shapeId - 1024)}`;
|
|
437
|
+
xmlStream.openNode("mc:AlternateContent");
|
|
438
|
+
xmlStream.openNode("mc:Choice", { Requires: "x14" });
|
|
439
|
+
xmlStream.openNode("control", {
|
|
440
|
+
shapeId: control.shapeId,
|
|
441
|
+
"r:id": control.ctrlPropRelId,
|
|
442
|
+
name: control.name || defaultName
|
|
443
|
+
});
|
|
444
|
+
xmlStream.openNode("controlPr", {
|
|
445
|
+
locked: 0,
|
|
446
|
+
defaultSize: 0,
|
|
447
|
+
print: control.print ? 1 : 0,
|
|
448
|
+
autoFill: 0,
|
|
449
|
+
autoLine: 0,
|
|
450
|
+
autoPict: 0
|
|
451
|
+
});
|
|
452
|
+
xmlStream.openNode("anchor");
|
|
453
|
+
xmlStream.openNode("from");
|
|
454
|
+
xmlStream.leafNode("xdr:col", undefined, control.tl.col);
|
|
455
|
+
xmlStream.leafNode("xdr:colOff", undefined, control.tl.colOff);
|
|
456
|
+
xmlStream.leafNode("xdr:row", undefined, control.tl.row);
|
|
457
|
+
xmlStream.leafNode("xdr:rowOff", undefined, control.tl.rowOff);
|
|
458
|
+
xmlStream.closeNode();
|
|
459
|
+
xmlStream.openNode("to");
|
|
460
|
+
xmlStream.leafNode("xdr:col", undefined, control.br.col);
|
|
461
|
+
xmlStream.leafNode("xdr:colOff", undefined, control.br.colOff);
|
|
462
|
+
xmlStream.leafNode("xdr:row", undefined, control.br.row);
|
|
463
|
+
xmlStream.leafNode("xdr:rowOff", undefined, control.br.rowOff);
|
|
464
|
+
xmlStream.closeNode(); // to
|
|
465
|
+
xmlStream.closeNode(); // anchor
|
|
466
|
+
xmlStream.closeNode(); // controlPr
|
|
467
|
+
xmlStream.closeNode(); // control
|
|
468
|
+
xmlStream.closeNode(); // mc:Choice
|
|
469
|
+
xmlStream.leafNode("mc:Fallback");
|
|
470
|
+
xmlStream.closeNode(); // mc:AlternateContent
|
|
370
471
|
}
|
|
371
472
|
xmlStream.closeNode();
|
|
473
|
+
xmlStream.closeNode();
|
|
474
|
+
xmlStream.leafNode("mc:Fallback");
|
|
475
|
+
xmlStream.closeNode();
|
|
372
476
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
model.rels.forEach(rel => {
|
|
376
|
-
if (rel.Type === rel_type_1.RelType.VmlDrawing) {
|
|
377
|
-
xmlStream.leafNode("legacyDrawing", { "r:id": rel.Id });
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
}
|
|
477
|
+
// Table parts must come after <controls> in worksheet element order.
|
|
478
|
+
this.map.tableParts.render(xmlStream, model.tables);
|
|
381
479
|
// extLst should be the last element in the worksheet.
|
|
382
480
|
this.map.extLst.render(xmlStream, model);
|
|
383
481
|
xmlStream.closeNode();
|
|
@@ -39,16 +39,15 @@ class SharedStringXform extends base_xform_1.BaseXform {
|
|
|
39
39
|
xmlStream.closeNode();
|
|
40
40
|
}
|
|
41
41
|
parseOpen(node) {
|
|
42
|
-
const { name } = node;
|
|
43
42
|
if (this.parser) {
|
|
44
43
|
this.parser.parseOpen(node);
|
|
45
44
|
return true;
|
|
46
45
|
}
|
|
47
|
-
if (name === this.tag) {
|
|
46
|
+
if (node.name === this.tag) {
|
|
48
47
|
this.model = {};
|
|
49
48
|
return true;
|
|
50
49
|
}
|
|
51
|
-
this.parser = this.map[name];
|
|
50
|
+
this.parser = this.map[node.name];
|
|
52
51
|
if (this.parser) {
|
|
53
52
|
this.parser.parseOpen(node);
|
|
54
53
|
return true;
|