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