@cj-tech-master/excelts 9.5.4 → 9.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/modules/archive/compression/streaming-compress.browser.js +29 -0
- package/dist/browser/modules/archive/compression/streaming-compress.js +9 -0
- package/dist/browser/modules/archive/compression/worker-pool/pool.browser.js +26 -1
- package/dist/browser/modules/archive/fs/archive-file.d.ts +8 -5
- package/dist/browser/modules/archive/fs/archive-file.js +78 -16
- package/dist/browser/modules/archive/unzip/stream.browser.js +43 -2
- package/dist/browser/modules/excel/chart/chart-ex-builder.js +7 -2
- package/dist/browser/modules/excel/chart/chart-ex-renderer.js +4 -9
- package/dist/browser/modules/excel/chart/chart-ex-types.d.ts +0 -12
- package/dist/browser/modules/excel/chart/chart.d.ts +1 -5
- package/dist/browser/modules/excel/chart/chart.js +1 -7
- package/dist/browser/modules/excel/chart/types.d.ts +0 -6
- package/dist/browser/modules/excel/stream/workbook-reader.browser.js +25 -1
- package/dist/browser/modules/excel/stream/workbook-reader.js +9 -0
- package/dist/browser/modules/excel/stream/workbook-writer.browser.d.ts +40 -0
- package/dist/browser/modules/excel/stream/workbook-writer.browser.js +228 -13
- package/dist/browser/modules/excel/utils/string-buf.d.ts +5 -26
- package/dist/browser/modules/excel/utils/string-buf.js +4 -81
- package/dist/browser/modules/excel/workbook.browser.js +135 -25
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.js +6 -20
- package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +19 -9
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +32 -8
- package/dist/browser/modules/excel/xlsx/xlsx.d.ts +10 -2
- package/dist/browser/modules/excel/xlsx/xlsx.js +9 -1
- package/dist/browser/modules/pdf/excel-bridge.d.ts +30 -1
- package/dist/browser/modules/pdf/excel-bridge.js +32 -0
- package/dist/browser/modules/pdf/font/metrics.d.ts +3 -52
- package/dist/browser/modules/pdf/font/metrics.js +3 -237
- package/dist/browser/modules/pdf/index.d.ts +1 -1
- package/dist/browser/modules/pdf/index.js +1 -1
- package/dist/browser/modules/pdf/render-layout-to-pdf.d.ts +66 -0
- package/dist/browser/modules/pdf/render-layout-to-pdf.js +647 -0
- package/dist/browser/modules/pdf/word-bridge.d.ts +80 -12
- package/dist/browser/modules/pdf/word-bridge.js +122 -274
- package/dist/browser/modules/stream/index.base.d.ts +2 -0
- package/dist/browser/modules/stream/index.base.js +2 -1
- package/dist/browser/modules/stream/internal/sink-adapter.d.ts +65 -0
- package/dist/browser/modules/stream/internal/sink-adapter.js +198 -0
- package/dist/browser/modules/stream/pull-stream.d.ts +19 -2
- package/dist/browser/modules/stream/pull-stream.js +51 -5
- package/dist/browser/modules/stream/types.d.ts +13 -1
- package/dist/browser/modules/word/advanced/diff.d.ts +61 -0
- package/dist/browser/modules/word/advanced/diff.js +167 -0
- package/dist/browser/modules/word/advanced/drawing-shapes.d.ts +269 -0
- package/dist/browser/modules/word/advanced/drawing-shapes.js +268 -0
- package/dist/browser/modules/word/advanced/field-engine.d.ts +43 -0
- package/dist/browser/modules/word/advanced/field-engine.js +1225 -0
- package/dist/browser/modules/word/advanced/glossary.d.ts +86 -0
- package/dist/browser/modules/word/advanced/glossary.js +79 -0
- package/dist/browser/modules/word/advanced/math-convert.d.ts +30 -0
- package/dist/browser/modules/word/advanced/math-convert.js +595 -0
- package/dist/browser/modules/word/advanced/ole-objects.d.ts +115 -0
- package/dist/browser/modules/word/advanced/ole-objects.js +271 -0
- package/dist/browser/modules/word/advanced/style-map.d.ts +105 -0
- package/dist/browser/modules/word/advanced/style-map.js +322 -0
- package/dist/browser/modules/word/advanced/validation.d.ts +56 -0
- package/dist/browser/modules/word/advanced/validation.js +1065 -0
- package/dist/browser/modules/word/advanced/vba-project.d.ts +91 -0
- package/dist/browser/modules/word/advanced/vba-project.js +265 -0
- package/dist/browser/modules/word/bridge/excel-bridge.d.ts +127 -0
- package/dist/browser/modules/word/bridge/excel-bridge.js +980 -0
- package/dist/browser/modules/word/builder/document-handle.d.ts +151 -0
- package/dist/browser/modules/word/builder/document-handle.js +664 -0
- package/dist/browser/modules/word/builder/paragraph-builders.d.ts +61 -0
- package/dist/browser/modules/word/builder/paragraph-builders.js +90 -0
- package/dist/browser/modules/word/builder/run-builders.d.ts +374 -0
- package/dist/browser/modules/word/builder/run-builders.js +600 -0
- package/dist/browser/modules/word/builder/table-builders.d.ts +23 -0
- package/dist/browser/modules/word/builder/table-builders.js +45 -0
- package/dist/browser/modules/word/constants.d.ts +39 -1
- package/dist/browser/modules/word/constants.js +109 -1
- package/dist/browser/modules/word/convert/conversion-ir.d.ts +210 -0
- package/dist/browser/modules/word/convert/conversion-ir.js +31 -0
- package/dist/browser/modules/word/convert/docx-to-semantic.d.ts +39 -0
- package/dist/browser/modules/word/convert/docx-to-semantic.js +499 -0
- package/dist/browser/modules/word/convert/flat-opc.d.ts +44 -0
- package/dist/browser/modules/word/convert/flat-opc.js +385 -0
- package/dist/browser/modules/word/convert/html/html-import.d.ts +50 -0
- package/dist/browser/modules/word/convert/html/html-import.js +1907 -0
- package/dist/{types/modules/word → browser/modules/word/convert/html}/html-renderer.d.ts +14 -1
- package/dist/{esm/modules/word → browser/modules/word/convert/html}/html-renderer.js +420 -69
- package/dist/browser/modules/word/convert/html/html.d.ts +15 -0
- package/dist/browser/modules/word/convert/html/html.js +15 -0
- package/dist/browser/modules/word/convert/markdown/markdown-import.d.ts +68 -0
- package/dist/browser/modules/word/convert/markdown/markdown-import.js +1325 -0
- package/dist/browser/modules/word/convert/markdown/markdown-renderer.d.ts +25 -0
- package/dist/browser/modules/word/convert/markdown/markdown-renderer.js +634 -0
- package/dist/browser/modules/word/convert/markdown/markdown.d.ts +15 -0
- package/dist/browser/modules/word/convert/markdown/markdown.js +15 -0
- package/dist/browser/modules/word/convert/odt/odt.d.ts +41 -0
- package/dist/browser/modules/word/convert/odt/odt.js +1932 -0
- package/dist/browser/modules/word/{color-utils.d.ts → core/color-utils.d.ts} +8 -1
- package/dist/browser/modules/word/core/color-utils.js +43 -0
- package/dist/browser/modules/word/core/internal-utils.d.ts +90 -0
- package/dist/browser/modules/word/core/internal-utils.js +209 -0
- package/dist/browser/modules/word/core/mapper.d.ts +44 -0
- package/dist/browser/modules/word/core/mapper.js +427 -0
- package/dist/browser/modules/word/core/opc-paths.d.ts +33 -0
- package/dist/browser/modules/word/core/opc-paths.js +48 -0
- package/dist/browser/modules/word/core/text-utils.d.ts +38 -0
- package/dist/browser/modules/word/core/text-utils.js +202 -0
- package/dist/browser/modules/word/core/walker.d.ts +119 -0
- package/dist/browser/modules/word/core/walker.js +570 -0
- package/dist/browser/modules/word/crypto.d.ts +14 -9
- package/dist/browser/modules/word/crypto.js +13 -7
- package/dist/browser/modules/word/document-io.d.ts +59 -27
- package/dist/browser/modules/word/document-io.js +80 -197
- package/dist/browser/modules/word/errors.d.ts +44 -1
- package/dist/browser/modules/word/errors.js +54 -2
- package/dist/browser/modules/word/excel.d.ts +14 -0
- package/dist/browser/modules/word/excel.js +13 -0
- package/dist/browser/modules/word/font/font-embed.d.ts +112 -0
- package/dist/browser/modules/word/font/font-embed.js +646 -0
- package/dist/{esm/modules/word → browser/modules/word/font}/font-obfuscation.js +4 -9
- package/dist/browser/modules/word/font/hyphenation.d.ts +65 -0
- package/dist/browser/modules/word/font/hyphenation.js +4210 -0
- package/dist/browser/modules/word/font/text-shaping.d.ts +58 -0
- package/dist/browser/modules/word/font/text-shaping.js +635 -0
- package/dist/browser/modules/word/html.d.ts +7 -6
- package/dist/browser/modules/word/html.js +6 -5
- package/dist/browser/modules/word/incremental-edit.d.ts +123 -0
- package/dist/browser/modules/word/incremental-edit.js +361 -0
- package/dist/browser/modules/word/index.base.d.ts +194 -10
- package/dist/browser/modules/word/index.base.js +138 -29
- package/dist/browser/modules/word/layout/layout-constants.d.ts +17 -0
- package/dist/browser/modules/word/layout/layout-constants.js +17 -0
- package/dist/browser/modules/word/layout/layout-full.d.ts +53 -0
- package/dist/browser/modules/word/layout/layout-full.js +1696 -0
- package/dist/browser/modules/word/layout/layout-model.d.ts +344 -0
- package/dist/browser/modules/word/layout/layout-model.js +16 -0
- package/dist/browser/modules/word/layout/layout.d.ts +63 -0
- package/dist/browser/modules/word/layout/layout.js +1167 -0
- package/dist/browser/modules/word/layout/render-page.d.ts +57 -0
- package/dist/browser/modules/word/layout/render-page.js +1238 -0
- package/dist/browser/modules/word/markdown.d.ts +14 -0
- package/dist/browser/modules/word/markdown.js +13 -0
- package/dist/browser/modules/word/patcher.d.ts +62 -0
- package/dist/browser/modules/word/patcher.js +537 -0
- package/dist/browser/modules/word/query/compat.d.ts +25 -0
- package/dist/browser/modules/word/query/compat.js +58 -0
- package/dist/browser/modules/word/query/data-binding.d.ts +22 -0
- package/dist/browser/modules/word/query/data-binding.js +392 -0
- package/dist/browser/modules/word/query/form-fields.d.ts +41 -0
- package/dist/browser/modules/word/query/form-fields.js +268 -0
- package/dist/browser/modules/word/query/format-search.d.ts +99 -0
- package/dist/browser/modules/word/query/format-search.js +329 -0
- package/dist/browser/modules/word/query/mail-merge.d.ts +25 -0
- package/dist/browser/modules/word/query/mail-merge.js +111 -0
- package/dist/browser/modules/word/query/merge.d.ts +50 -0
- package/dist/browser/modules/word/query/merge.js +617 -0
- package/dist/browser/modules/word/query/replace.d.ts +47 -0
- package/dist/browser/modules/word/query/replace.js +301 -0
- package/dist/browser/modules/word/query/revisions.d.ts +67 -0
- package/dist/browser/modules/word/query/revisions.js +879 -0
- package/dist/browser/modules/word/query/search.d.ts +129 -0
- package/dist/browser/modules/word/query/search.js +346 -0
- package/dist/browser/modules/word/query/split.d.ts +44 -0
- package/dist/browser/modules/word/query/split.js +135 -0
- package/dist/browser/modules/word/query/style-resolve.d.ts +104 -0
- package/dist/browser/modules/word/query/style-resolve.js +368 -0
- package/dist/browser/modules/word/reader/chart-parser.d.ts +20 -0
- package/dist/browser/modules/word/reader/chart-parser.js +810 -0
- package/dist/browser/modules/word/reader/comments-parser.d.ts +26 -0
- package/dist/browser/modules/word/reader/comments-parser.js +92 -0
- package/dist/browser/modules/word/reader/doc-props-parsers.d.ts +15 -0
- package/dist/browser/modules/word/reader/doc-props-parsers.js +190 -0
- package/dist/browser/modules/word/reader/docx-reader.d.ts +27 -0
- package/dist/browser/modules/word/reader/docx-reader.js +2557 -0
- package/dist/browser/modules/word/reader/drawing-helpers.d.ts +27 -0
- package/dist/browser/modules/word/reader/drawing-helpers.js +84 -0
- package/dist/browser/modules/word/reader/form-field-parser.d.ts +21 -0
- package/dist/browser/modules/word/reader/form-field-parser.js +82 -0
- package/dist/browser/modules/word/reader/image-parsers.d.ts +11 -0
- package/dist/browser/modules/word/reader/image-parsers.js +291 -0
- package/dist/browser/modules/word/reader/math-parser.d.ts +12 -0
- package/dist/browser/modules/word/reader/math-parser.js +422 -0
- package/dist/browser/modules/word/reader/metadata-parsers.d.ts +17 -0
- package/dist/browser/modules/word/reader/metadata-parsers.js +87 -0
- package/dist/browser/modules/word/reader/numbering-parser.d.ts +13 -0
- package/dist/browser/modules/word/reader/numbering-parser.js +166 -0
- package/dist/browser/modules/word/reader/paragraph-section-parsers.d.ts +12 -0
- package/dist/browser/modules/word/reader/paragraph-section-parsers.js +503 -0
- package/dist/browser/modules/word/reader/parse-utils.d.ts +91 -0
- package/dist/browser/modules/word/reader/parse-utils.js +249 -0
- package/dist/browser/modules/word/reader/properties-parsers.d.ts +21 -0
- package/dist/browser/modules/word/reader/properties-parsers.js +332 -0
- package/dist/browser/modules/word/reader/reader-context.d.ts +69 -0
- package/dist/browser/modules/word/reader/reader-context.js +61 -0
- package/dist/browser/modules/word/reader/sdt-helpers.d.ts +29 -0
- package/dist/browser/modules/word/reader/sdt-helpers.js +111 -0
- package/dist/browser/modules/word/reader/settings-parser.d.ts +8 -0
- package/dist/browser/modules/word/reader/settings-parser.js +263 -0
- package/dist/browser/modules/word/reader/styles-parser.d.ts +12 -0
- package/dist/browser/modules/word/reader/styles-parser.js +147 -0
- package/dist/browser/modules/word/reader/table-properties-parsers.d.ts +12 -0
- package/dist/browser/modules/word/reader/table-properties-parsers.js +234 -0
- package/dist/browser/modules/word/reader/theme-parser.d.ts +8 -0
- package/dist/browser/modules/word/reader/theme-parser.js +167 -0
- package/dist/browser/modules/word/reader/watermark-parser.d.ts +15 -0
- package/dist/browser/modules/word/reader/watermark-parser.js +110 -0
- package/dist/browser/modules/word/security/cfb-reader.d.ts +37 -0
- package/dist/browser/modules/word/security/cfb-reader.js +410 -0
- package/dist/browser/modules/word/{digital-signatures.d.ts → security/digital-signatures.d.ts} +19 -11
- package/dist/browser/modules/word/{digital-signatures.js → security/digital-signatures.js} +34 -34
- package/dist/browser/modules/word/security/document-protection.d.ts +93 -0
- package/dist/browser/modules/word/security/document-protection.js +201 -0
- package/dist/{types/modules/word → browser/modules/word/security}/encryption.d.ts +51 -4
- package/dist/browser/modules/word/security/encryption.js +602 -0
- package/dist/browser/modules/word/security/policy.d.ts +80 -0
- package/dist/browser/modules/word/security/policy.js +102 -0
- package/dist/browser/modules/word/template/template-chart.d.ts +56 -0
- package/dist/browser/modules/word/template/template-chart.js +167 -0
- package/dist/browser/modules/word/template/template-datasource.d.ts +154 -0
- package/dist/browser/modules/word/template/template-datasource.js +541 -0
- package/dist/browser/modules/word/template/template-engine.d.ts +121 -0
- package/dist/browser/modules/word/template/template-engine.js +1435 -0
- package/dist/browser/modules/word/types.d.ts +224 -25
- package/dist/browser/modules/word/units.d.ts +26 -0
- package/dist/browser/modules/word/units.js +43 -14
- package/dist/browser/modules/word/{writers → writer}/chart-writer.js +164 -23
- package/dist/browser/modules/word/writer/checkbox-writer.d.ts +17 -0
- package/dist/browser/modules/word/writer/checkbox-writer.js +79 -0
- package/dist/{types/modules/word/writers → browser/modules/word/writer}/comment-writer.d.ts +2 -1
- package/dist/browser/modules/word/{writers → writer}/comment-writer.js +8 -6
- package/dist/browser/modules/word/writer/common-parts.d.ts +57 -0
- package/dist/browser/modules/word/writer/common-parts.js +101 -0
- package/dist/{types/modules/word → browser/modules/word/writer}/content-types.d.ts +2 -2
- package/dist/{esm/modules/word → browser/modules/word/writer}/content-types.js +14 -6
- package/dist/browser/modules/word/writer/document-writer.d.ts +24 -0
- package/dist/browser/modules/word/writer/document-writer.js +473 -0
- package/dist/browser/modules/word/writer/docx-packager.d.ts +35 -0
- package/dist/browser/modules/word/writer/docx-packager.js +1515 -0
- package/dist/{types/modules/word/writers → browser/modules/word/writer}/footnote-writer.d.ts +3 -2
- package/dist/{esm/modules/word/writers → browser/modules/word/writer}/footnote-writer.js +13 -10
- package/dist/{types/modules/word/writers → browser/modules/word/writer}/header-footer-writer.d.ts +3 -2
- package/dist/{esm/modules/word/writers → browser/modules/word/writer}/header-footer-writer.js +39 -21
- package/dist/{types/modules/word/writers → browser/modules/word/writer}/image-writer.d.ts +1 -1
- package/dist/browser/modules/word/{writers → writer}/image-writer.js +11 -7
- package/dist/browser/modules/word/writer/math-writer.d.ts +20 -0
- package/dist/{esm/modules/word/writers → browser/modules/word/writer}/math-writer.js +21 -1
- package/dist/browser/modules/word/{writers → writer}/numbering-writer.d.ts +1 -1
- package/dist/{esm/modules/word/writers → browser/modules/word/writer}/numbering-writer.js +11 -4
- package/dist/browser/modules/word/{writers → writer}/paragraph-writer.d.ts +2 -1
- package/dist/browser/modules/word/{writers → writer}/paragraph-writer.js +73 -38
- package/dist/browser/modules/word/{writers → writer}/parts-writer.d.ts +3 -3
- package/dist/{esm/modules/word/writers → browser/modules/word/writer}/parts-writer.js +91 -12
- package/dist/browser/modules/word/writer/reference-scanners.d.ts +42 -0
- package/dist/browser/modules/word/writer/reference-scanners.js +111 -0
- package/dist/browser/modules/word/writer/relationships.d.ts +52 -0
- package/dist/browser/modules/word/writer/relationships.js +117 -0
- package/dist/browser/modules/word/writer/render-context.d.ts +124 -0
- package/dist/browser/modules/word/writer/render-context.js +46 -0
- package/dist/browser/modules/word/{writers → writer}/run-writer.d.ts +10 -1
- package/dist/{esm/modules/word/writers → browser/modules/word/writer}/run-writer.js +126 -24
- package/dist/browser/modules/word/writer/sdt-writer.d.ts +25 -0
- package/dist/browser/modules/word/writer/sdt-writer.js +189 -0
- package/dist/browser/modules/word/writer/stream-buf.d.ts +37 -0
- package/dist/browser/modules/word/writer/stream-buf.js +73 -0
- package/dist/browser/modules/word/writer/streaming-writer.d.ts +344 -0
- package/dist/browser/modules/word/writer/streaming-writer.js +1382 -0
- package/dist/browser/modules/word/writer/string-buf.d.ts +8 -0
- package/dist/browser/modules/word/writer/string-buf.js +7 -0
- package/dist/browser/modules/word/{writers → writer}/styles-writer.js +32 -1
- package/dist/browser/modules/word/{writers → writer}/table-writer.d.ts +2 -1
- package/dist/browser/modules/word/{writers → writer}/table-writer.js +94 -11
- package/dist/browser/modules/xml/types.d.ts +22 -0
- package/dist/browser/utils/crypto.browser.d.ts +3 -1
- package/dist/browser/utils/crypto.browser.js +3 -1
- package/dist/browser/utils/crypto.d.ts +4 -1
- package/dist/browser/utils/crypto.js +4 -1
- package/dist/browser/utils/font-metrics.d.ts +63 -0
- package/dist/browser/utils/font-metrics.js +293 -0
- package/dist/browser/utils/string-buf.d.ts +42 -0
- package/dist/browser/utils/string-buf.js +89 -0
- package/dist/browser/utils/theme-colors.d.ts +55 -0
- package/dist/browser/utils/theme-colors.js +120 -0
- package/dist/cjs/modules/archive/compression/streaming-compress.browser.js +29 -0
- package/dist/cjs/modules/archive/compression/streaming-compress.js +9 -0
- package/dist/cjs/modules/archive/compression/worker-pool/pool.browser.js +26 -1
- package/dist/cjs/modules/archive/fs/archive-file.js +78 -16
- package/dist/cjs/modules/archive/unzip/stream.browser.js +43 -2
- package/dist/cjs/modules/excel/chart/chart-ex-builder.js +7 -2
- package/dist/cjs/modules/excel/chart/chart-ex-renderer.js +4 -9
- package/dist/cjs/modules/excel/chart/chart.js +1 -7
- package/dist/cjs/modules/excel/stream/workbook-reader.browser.js +25 -1
- package/dist/cjs/modules/excel/stream/workbook-reader.js +9 -0
- package/dist/cjs/modules/excel/stream/workbook-writer.browser.js +228 -13
- package/dist/cjs/modules/excel/utils/string-buf.js +5 -81
- package/dist/cjs/modules/excel/workbook.browser.js +135 -25
- package/dist/cjs/modules/excel/xlsx/xform/chart/chart-space-xform.js +6 -20
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +32 -8
- package/dist/cjs/modules/excel/xlsx/xlsx.js +9 -1
- package/dist/cjs/modules/pdf/excel-bridge.js +33 -0
- package/dist/cjs/modules/pdf/font/metrics.js +11 -244
- package/dist/cjs/modules/pdf/index.js +2 -1
- package/dist/cjs/modules/pdf/render-layout-to-pdf.js +651 -0
- package/dist/cjs/modules/pdf/word-bridge.js +155 -274
- package/dist/cjs/modules/stream/index.base.js +4 -2
- package/dist/cjs/modules/stream/internal/sink-adapter.js +202 -0
- package/dist/cjs/modules/stream/pull-stream.js +51 -5
- package/dist/cjs/modules/word/advanced/diff.js +170 -0
- package/dist/cjs/modules/word/advanced/drawing-shapes.js +279 -0
- package/dist/cjs/modules/word/advanced/field-engine.js +1229 -0
- package/dist/cjs/modules/word/advanced/glossary.js +87 -0
- package/dist/cjs/modules/word/advanced/math-convert.js +599 -0
- package/dist/cjs/modules/word/advanced/ole-objects.js +277 -0
- package/dist/cjs/modules/word/advanced/style-map.js +329 -0
- package/dist/cjs/modules/word/advanced/validation.js +1068 -0
- package/dist/cjs/modules/word/advanced/vba-project.js +274 -0
- package/dist/cjs/modules/word/bridge/excel-bridge.js +1020 -0
- package/dist/cjs/modules/word/builder/document-handle.js +667 -0
- package/dist/cjs/modules/word/builder/paragraph-builders.js +109 -0
- package/dist/cjs/modules/word/builder/run-builders.js +676 -0
- package/dist/cjs/modules/word/builder/table-builders.js +53 -0
- package/dist/cjs/modules/word/constants.js +111 -2
- package/dist/cjs/modules/word/convert/conversion-ir.js +34 -0
- package/dist/cjs/modules/word/convert/docx-to-semantic.js +502 -0
- package/dist/cjs/modules/word/convert/flat-opc.js +390 -0
- package/dist/cjs/modules/word/convert/html/html-import.js +1910 -0
- package/dist/cjs/modules/word/{html-renderer.js → convert/html/html-renderer.js} +420 -69
- package/dist/cjs/modules/word/convert/html/html.js +20 -0
- package/dist/cjs/modules/word/convert/markdown/markdown-import.js +1329 -0
- package/dist/cjs/modules/word/convert/markdown/markdown-renderer.js +637 -0
- package/dist/cjs/modules/word/convert/markdown/markdown.js +21 -0
- package/dist/cjs/modules/word/convert/odt/odt.js +1936 -0
- package/dist/cjs/modules/word/core/color-utils.js +47 -0
- package/dist/cjs/modules/word/core/internal-utils.js +219 -0
- package/dist/cjs/modules/word/core/mapper.js +430 -0
- package/dist/cjs/modules/word/core/opc-paths.js +53 -0
- package/dist/cjs/modules/word/core/text-utils.js +210 -0
- package/dist/cjs/modules/word/core/walker.js +577 -0
- package/dist/cjs/modules/word/crypto.js +19 -8
- package/dist/cjs/modules/word/document-io.js +117 -197
- package/dist/cjs/modules/word/errors.js +59 -13
- package/dist/cjs/modules/word/excel.js +22 -0
- package/dist/cjs/modules/word/font/font-embed.js +652 -0
- package/dist/cjs/modules/word/{font-obfuscation.js → font/font-obfuscation.js} +4 -9
- package/dist/cjs/modules/word/font/hyphenation.js +4216 -0
- package/dist/cjs/modules/word/font/text-shaping.js +640 -0
- package/dist/cjs/modules/word/html.js +9 -7
- package/dist/cjs/modules/word/incremental-edit.js +366 -0
- package/dist/cjs/modules/word/index.base.js +370 -137
- package/dist/cjs/modules/word/layout/layout-constants.js +20 -0
- package/dist/cjs/modules/word/layout/layout-full.js +1699 -0
- package/dist/cjs/modules/word/layout/layout-model.js +17 -0
- package/dist/cjs/modules/word/layout/layout.js +1170 -0
- package/dist/cjs/modules/word/layout/render-page.js +1243 -0
- package/dist/cjs/modules/word/markdown.js +19 -0
- package/dist/cjs/modules/word/patcher.js +539 -0
- package/dist/cjs/modules/word/query/compat.js +61 -0
- package/dist/cjs/modules/word/query/data-binding.js +395 -0
- package/dist/cjs/modules/word/query/form-fields.js +272 -0
- package/dist/cjs/modules/word/query/format-search.js +334 -0
- package/dist/cjs/modules/word/query/mail-merge.js +114 -0
- package/dist/cjs/modules/word/query/merge.js +620 -0
- package/dist/cjs/modules/word/query/replace.js +304 -0
- package/dist/cjs/modules/word/query/revisions.js +885 -0
- package/dist/cjs/modules/word/query/search.js +361 -0
- package/dist/cjs/modules/word/query/split.js +138 -0
- package/dist/cjs/modules/word/query/style-resolve.js +374 -0
- package/dist/cjs/modules/word/reader/chart-parser.js +814 -0
- package/dist/cjs/modules/word/reader/comments-parser.js +96 -0
- package/dist/cjs/modules/word/reader/doc-props-parsers.js +194 -0
- package/dist/cjs/modules/word/reader/docx-reader.js +2560 -0
- package/dist/cjs/modules/word/reader/drawing-helpers.js +90 -0
- package/dist/cjs/modules/word/reader/form-field-parser.js +85 -0
- package/dist/cjs/modules/word/reader/image-parsers.js +293 -0
- package/dist/cjs/modules/word/reader/math-parser.js +424 -0
- package/dist/cjs/modules/word/reader/metadata-parsers.js +93 -0
- package/dist/cjs/modules/word/reader/numbering-parser.js +168 -0
- package/dist/cjs/modules/word/reader/paragraph-section-parsers.js +505 -0
- package/dist/cjs/modules/word/reader/parse-utils.js +271 -0
- package/dist/cjs/modules/word/reader/properties-parsers.js +338 -0
- package/dist/cjs/modules/word/reader/reader-context.js +66 -0
- package/dist/cjs/modules/word/reader/sdt-helpers.js +114 -0
- package/dist/cjs/modules/word/reader/settings-parser.js +265 -0
- package/dist/cjs/modules/word/reader/styles-parser.js +149 -0
- package/dist/cjs/modules/word/reader/table-properties-parsers.js +237 -0
- package/dist/cjs/modules/word/reader/theme-parser.js +169 -0
- package/dist/cjs/modules/word/reader/watermark-parser.js +113 -0
- package/dist/cjs/modules/word/security/cfb-reader.js +414 -0
- package/dist/cjs/modules/word/{digital-signatures.js → security/digital-signatures.js} +34 -34
- package/dist/cjs/modules/word/security/document-protection.js +208 -0
- package/dist/cjs/modules/word/security/encryption.js +612 -0
- package/dist/cjs/modules/word/security/policy.js +106 -0
- package/dist/cjs/modules/word/template/template-chart.js +170 -0
- package/dist/cjs/modules/word/template/template-datasource.js +549 -0
- package/dist/cjs/modules/word/template/template-engine.js +1430 -0
- package/dist/cjs/modules/word/units.js +44 -14
- package/dist/cjs/modules/word/{writers → writer}/chart-writer.js +163 -22
- package/dist/cjs/modules/word/writer/checkbox-writer.js +82 -0
- package/dist/cjs/modules/word/{writers → writer}/comment-writer.js +8 -6
- package/dist/cjs/modules/word/writer/common-parts.js +104 -0
- package/dist/cjs/modules/word/{content-types.js → writer/content-types.js} +14 -6
- package/dist/cjs/modules/word/writer/document-writer.js +478 -0
- package/dist/cjs/modules/word/writer/docx-packager.js +1551 -0
- package/dist/cjs/modules/word/{writers → writer}/footnote-writer.js +13 -10
- package/dist/cjs/modules/word/{writers → writer}/header-footer-writer.js +38 -20
- package/dist/cjs/modules/word/{writers → writer}/image-writer.js +11 -7
- package/dist/cjs/modules/word/{writers → writer}/math-writer.js +21 -1
- package/dist/cjs/modules/word/{writers → writer}/numbering-writer.js +11 -4
- package/dist/cjs/modules/word/{writers → writer}/paragraph-writer.js +72 -37
- package/dist/cjs/modules/word/{writers → writer}/parts-writer.js +91 -12
- package/dist/cjs/modules/word/writer/reference-scanners.js +120 -0
- package/dist/cjs/modules/word/writer/relationships.js +124 -0
- package/dist/cjs/modules/word/writer/render-context.js +51 -0
- package/dist/cjs/modules/word/{writers → writer}/run-writer.js +127 -24
- package/dist/cjs/modules/word/writer/sdt-writer.js +192 -0
- package/dist/cjs/modules/word/writer/stream-buf.js +76 -0
- package/dist/cjs/modules/word/writer/streaming-writer.js +1387 -0
- package/dist/cjs/modules/word/writer/string-buf.js +11 -0
- package/dist/cjs/modules/word/{writers → writer}/styles-writer.js +32 -1
- package/dist/cjs/modules/word/{writers → writer}/table-writer.js +94 -11
- package/dist/cjs/utils/crypto.browser.js +3 -1
- package/dist/cjs/utils/crypto.js +4 -1
- package/dist/cjs/utils/font-metrics.js +303 -0
- package/dist/cjs/utils/string-buf.js +92 -0
- package/dist/cjs/utils/theme-colors.js +126 -0
- package/dist/esm/modules/archive/compression/streaming-compress.browser.js +29 -0
- package/dist/esm/modules/archive/compression/streaming-compress.js +9 -0
- package/dist/esm/modules/archive/compression/worker-pool/pool.browser.js +26 -1
- package/dist/esm/modules/archive/fs/archive-file.js +78 -16
- package/dist/esm/modules/archive/unzip/stream.browser.js +43 -2
- package/dist/esm/modules/excel/chart/chart-ex-builder.js +7 -2
- package/dist/esm/modules/excel/chart/chart-ex-renderer.js +4 -9
- package/dist/esm/modules/excel/chart/chart.js +1 -7
- package/dist/esm/modules/excel/stream/workbook-reader.browser.js +25 -1
- package/dist/esm/modules/excel/stream/workbook-reader.js +9 -0
- package/dist/esm/modules/excel/stream/workbook-writer.browser.js +228 -13
- package/dist/esm/modules/excel/utils/string-buf.js +4 -81
- package/dist/esm/modules/excel/workbook.browser.js +135 -25
- package/dist/esm/modules/excel/xlsx/xform/chart/chart-space-xform.js +6 -20
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +32 -8
- package/dist/esm/modules/excel/xlsx/xlsx.js +9 -1
- package/dist/esm/modules/pdf/excel-bridge.js +32 -0
- package/dist/esm/modules/pdf/font/metrics.js +3 -237
- package/dist/esm/modules/pdf/index.js +1 -1
- package/dist/esm/modules/pdf/render-layout-to-pdf.js +647 -0
- package/dist/esm/modules/pdf/word-bridge.js +122 -274
- package/dist/esm/modules/stream/index.base.js +2 -1
- package/dist/esm/modules/stream/internal/sink-adapter.js +198 -0
- package/dist/esm/modules/stream/pull-stream.js +51 -5
- package/dist/esm/modules/word/advanced/diff.js +167 -0
- package/dist/esm/modules/word/advanced/drawing-shapes.js +268 -0
- package/dist/esm/modules/word/advanced/field-engine.js +1225 -0
- package/dist/esm/modules/word/advanced/glossary.js +79 -0
- package/dist/esm/modules/word/advanced/math-convert.js +595 -0
- package/dist/esm/modules/word/advanced/ole-objects.js +271 -0
- package/dist/esm/modules/word/advanced/style-map.js +322 -0
- package/dist/esm/modules/word/advanced/validation.js +1065 -0
- package/dist/esm/modules/word/advanced/vba-project.js +265 -0
- package/dist/esm/modules/word/bridge/excel-bridge.js +980 -0
- package/dist/esm/modules/word/builder/document-handle.js +664 -0
- package/dist/esm/modules/word/builder/paragraph-builders.js +90 -0
- package/dist/esm/modules/word/builder/run-builders.js +600 -0
- package/dist/esm/modules/word/builder/table-builders.js +45 -0
- package/dist/esm/modules/word/constants.js +109 -1
- package/dist/esm/modules/word/convert/conversion-ir.js +31 -0
- package/dist/esm/modules/word/convert/docx-to-semantic.js +499 -0
- package/dist/esm/modules/word/convert/flat-opc.js +385 -0
- package/dist/esm/modules/word/convert/html/html-import.js +1907 -0
- package/dist/{browser/modules/word → esm/modules/word/convert/html}/html-renderer.js +420 -69
- package/dist/esm/modules/word/convert/html/html.js +15 -0
- package/dist/esm/modules/word/convert/markdown/markdown-import.js +1325 -0
- package/dist/esm/modules/word/convert/markdown/markdown-renderer.js +634 -0
- package/dist/esm/modules/word/convert/markdown/markdown.js +15 -0
- package/dist/esm/modules/word/convert/odt/odt.js +1932 -0
- package/dist/esm/modules/word/core/color-utils.js +43 -0
- package/dist/esm/modules/word/core/internal-utils.js +209 -0
- package/dist/esm/modules/word/core/mapper.js +427 -0
- package/dist/esm/modules/word/core/opc-paths.js +48 -0
- package/dist/esm/modules/word/core/text-utils.js +202 -0
- package/dist/esm/modules/word/core/walker.js +570 -0
- package/dist/esm/modules/word/crypto.js +13 -7
- package/dist/esm/modules/word/document-io.js +80 -197
- package/dist/esm/modules/word/errors.js +54 -2
- package/dist/esm/modules/word/excel.js +13 -0
- package/dist/esm/modules/word/font/font-embed.js +646 -0
- package/dist/{browser/modules/word → esm/modules/word/font}/font-obfuscation.js +4 -9
- package/dist/esm/modules/word/font/hyphenation.js +4210 -0
- package/dist/esm/modules/word/font/text-shaping.js +635 -0
- package/dist/esm/modules/word/html.js +6 -5
- package/dist/esm/modules/word/incremental-edit.js +361 -0
- package/dist/esm/modules/word/index.base.js +138 -29
- package/dist/esm/modules/word/layout/layout-constants.js +17 -0
- package/dist/esm/modules/word/layout/layout-full.js +1696 -0
- package/dist/esm/modules/word/layout/layout-model.js +16 -0
- package/dist/esm/modules/word/layout/layout.js +1167 -0
- package/dist/esm/modules/word/layout/render-page.js +1238 -0
- package/dist/esm/modules/word/markdown.js +13 -0
- package/dist/esm/modules/word/patcher.js +537 -0
- package/dist/esm/modules/word/query/compat.js +58 -0
- package/dist/esm/modules/word/query/data-binding.js +392 -0
- package/dist/esm/modules/word/query/form-fields.js +268 -0
- package/dist/esm/modules/word/query/format-search.js +329 -0
- package/dist/esm/modules/word/query/mail-merge.js +111 -0
- package/dist/esm/modules/word/query/merge.js +617 -0
- package/dist/esm/modules/word/query/replace.js +301 -0
- package/dist/esm/modules/word/query/revisions.js +879 -0
- package/dist/esm/modules/word/query/search.js +346 -0
- package/dist/esm/modules/word/query/split.js +135 -0
- package/dist/esm/modules/word/query/style-resolve.js +368 -0
- package/dist/esm/modules/word/reader/chart-parser.js +810 -0
- package/dist/esm/modules/word/reader/comments-parser.js +92 -0
- package/dist/esm/modules/word/reader/doc-props-parsers.js +190 -0
- package/dist/esm/modules/word/reader/docx-reader.js +2557 -0
- package/dist/esm/modules/word/reader/drawing-helpers.js +84 -0
- package/dist/esm/modules/word/reader/form-field-parser.js +82 -0
- package/dist/esm/modules/word/reader/image-parsers.js +291 -0
- package/dist/esm/modules/word/reader/math-parser.js +422 -0
- package/dist/esm/modules/word/reader/metadata-parsers.js +87 -0
- package/dist/esm/modules/word/reader/numbering-parser.js +166 -0
- package/dist/esm/modules/word/reader/paragraph-section-parsers.js +503 -0
- package/dist/esm/modules/word/reader/parse-utils.js +249 -0
- package/dist/esm/modules/word/reader/properties-parsers.js +332 -0
- package/dist/esm/modules/word/reader/reader-context.js +61 -0
- package/dist/esm/modules/word/reader/sdt-helpers.js +111 -0
- package/dist/esm/modules/word/reader/settings-parser.js +263 -0
- package/dist/esm/modules/word/reader/styles-parser.js +147 -0
- package/dist/esm/modules/word/reader/table-properties-parsers.js +234 -0
- package/dist/esm/modules/word/reader/theme-parser.js +167 -0
- package/dist/esm/modules/word/reader/watermark-parser.js +110 -0
- package/dist/esm/modules/word/security/cfb-reader.js +410 -0
- package/dist/esm/modules/word/{digital-signatures.js → security/digital-signatures.js} +34 -34
- package/dist/esm/modules/word/security/document-protection.js +201 -0
- package/dist/esm/modules/word/security/encryption.js +602 -0
- package/dist/esm/modules/word/security/policy.js +102 -0
- package/dist/esm/modules/word/template/template-chart.js +167 -0
- package/dist/esm/modules/word/template/template-datasource.js +541 -0
- package/dist/esm/modules/word/template/template-engine.js +1435 -0
- package/dist/esm/modules/word/units.js +43 -14
- package/dist/esm/modules/word/{writers → writer}/chart-writer.js +164 -23
- package/dist/esm/modules/word/writer/checkbox-writer.js +79 -0
- package/dist/esm/modules/word/{writers → writer}/comment-writer.js +8 -6
- package/dist/esm/modules/word/writer/common-parts.js +101 -0
- package/dist/{browser/modules/word → esm/modules/word/writer}/content-types.js +14 -6
- package/dist/esm/modules/word/writer/document-writer.js +473 -0
- package/dist/esm/modules/word/writer/docx-packager.js +1515 -0
- package/dist/{browser/modules/word/writers → esm/modules/word/writer}/footnote-writer.js +13 -10
- package/dist/{browser/modules/word/writers → esm/modules/word/writer}/header-footer-writer.js +39 -21
- package/dist/esm/modules/word/{writers → writer}/image-writer.js +11 -7
- package/dist/{browser/modules/word/writers → esm/modules/word/writer}/math-writer.js +21 -1
- package/dist/{browser/modules/word/writers → esm/modules/word/writer}/numbering-writer.js +11 -4
- package/dist/esm/modules/word/{writers → writer}/paragraph-writer.js +73 -38
- package/dist/{browser/modules/word/writers → esm/modules/word/writer}/parts-writer.js +91 -12
- package/dist/esm/modules/word/writer/reference-scanners.js +111 -0
- package/dist/esm/modules/word/writer/relationships.js +117 -0
- package/dist/esm/modules/word/writer/render-context.js +46 -0
- package/dist/{browser/modules/word/writers → esm/modules/word/writer}/run-writer.js +126 -24
- package/dist/esm/modules/word/writer/sdt-writer.js +189 -0
- package/dist/esm/modules/word/writer/stream-buf.js +73 -0
- package/dist/esm/modules/word/writer/streaming-writer.js +1382 -0
- package/dist/esm/modules/word/writer/string-buf.js +7 -0
- package/dist/esm/modules/word/{writers → writer}/styles-writer.js +32 -1
- package/dist/esm/modules/word/{writers → writer}/table-writer.js +94 -11
- package/dist/esm/utils/crypto.browser.js +3 -1
- package/dist/esm/utils/crypto.js +4 -1
- package/dist/esm/utils/font-metrics.js +293 -0
- package/dist/esm/utils/string-buf.js +89 -0
- package/dist/esm/utils/theme-colors.js +120 -0
- package/dist/iife/excelts.iife.js +70692 -70337
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +57 -57
- package/dist/types/modules/archive/fs/archive-file.d.ts +8 -5
- package/dist/types/modules/excel/chart/chart-ex-types.d.ts +0 -12
- package/dist/types/modules/excel/chart/chart.d.ts +1 -5
- package/dist/types/modules/excel/chart/types.d.ts +0 -6
- package/dist/types/modules/excel/stream/workbook-writer.browser.d.ts +40 -0
- package/dist/types/modules/excel/utils/string-buf.d.ts +5 -26
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +19 -9
- package/dist/types/modules/excel/xlsx/xlsx.d.ts +10 -2
- package/dist/types/modules/pdf/excel-bridge.d.ts +30 -1
- package/dist/types/modules/pdf/font/metrics.d.ts +3 -52
- package/dist/types/modules/pdf/index.d.ts +1 -1
- package/dist/types/modules/pdf/render-layout-to-pdf.d.ts +66 -0
- package/dist/types/modules/pdf/word-bridge.d.ts +80 -12
- package/dist/types/modules/stream/index.base.d.ts +2 -0
- package/dist/types/modules/stream/internal/sink-adapter.d.ts +65 -0
- package/dist/types/modules/stream/pull-stream.d.ts +19 -2
- package/dist/types/modules/stream/types.d.ts +13 -1
- package/dist/types/modules/word/advanced/diff.d.ts +61 -0
- package/dist/types/modules/word/advanced/drawing-shapes.d.ts +269 -0
- package/dist/types/modules/word/advanced/field-engine.d.ts +43 -0
- package/dist/types/modules/word/advanced/glossary.d.ts +86 -0
- package/dist/types/modules/word/advanced/math-convert.d.ts +30 -0
- package/dist/types/modules/word/advanced/ole-objects.d.ts +115 -0
- package/dist/types/modules/word/advanced/style-map.d.ts +105 -0
- package/dist/types/modules/word/advanced/validation.d.ts +56 -0
- package/dist/types/modules/word/advanced/vba-project.d.ts +91 -0
- package/dist/types/modules/word/bridge/excel-bridge.d.ts +127 -0
- package/dist/types/modules/word/builder/document-handle.d.ts +151 -0
- package/dist/types/modules/word/builder/paragraph-builders.d.ts +61 -0
- package/dist/types/modules/word/builder/run-builders.d.ts +374 -0
- package/dist/types/modules/word/builder/table-builders.d.ts +23 -0
- package/dist/types/modules/word/constants.d.ts +39 -1
- package/dist/types/modules/word/convert/conversion-ir.d.ts +210 -0
- package/dist/types/modules/word/convert/docx-to-semantic.d.ts +39 -0
- package/dist/types/modules/word/convert/flat-opc.d.ts +44 -0
- package/dist/types/modules/word/convert/html/html-import.d.ts +50 -0
- package/dist/{browser/modules/word → types/modules/word/convert/html}/html-renderer.d.ts +14 -1
- package/dist/types/modules/word/convert/html/html.d.ts +15 -0
- package/dist/types/modules/word/convert/markdown/markdown-import.d.ts +68 -0
- package/dist/types/modules/word/convert/markdown/markdown-renderer.d.ts +25 -0
- package/dist/types/modules/word/convert/markdown/markdown.d.ts +15 -0
- package/dist/types/modules/word/convert/odt/odt.d.ts +41 -0
- package/dist/types/modules/word/{color-utils.d.ts → core/color-utils.d.ts} +8 -1
- package/dist/types/modules/word/core/internal-utils.d.ts +90 -0
- package/dist/types/modules/word/core/mapper.d.ts +44 -0
- package/dist/types/modules/word/core/opc-paths.d.ts +33 -0
- package/dist/types/modules/word/core/text-utils.d.ts +38 -0
- package/dist/types/modules/word/core/walker.d.ts +119 -0
- package/dist/types/modules/word/crypto.d.ts +14 -9
- package/dist/types/modules/word/document-io.d.ts +59 -27
- package/dist/types/modules/word/errors.d.ts +44 -1
- package/dist/types/modules/word/excel.d.ts +14 -0
- package/dist/types/modules/word/font/font-embed.d.ts +112 -0
- package/dist/types/modules/word/font/hyphenation.d.ts +65 -0
- package/dist/types/modules/word/font/text-shaping.d.ts +58 -0
- package/dist/types/modules/word/html.d.ts +7 -6
- package/dist/types/modules/word/incremental-edit.d.ts +123 -0
- package/dist/types/modules/word/index.base.d.ts +194 -10
- package/dist/types/modules/word/layout/layout-constants.d.ts +17 -0
- package/dist/types/modules/word/layout/layout-full.d.ts +53 -0
- package/dist/types/modules/word/layout/layout-model.d.ts +344 -0
- package/dist/types/modules/word/layout/layout.d.ts +63 -0
- package/dist/types/modules/word/layout/render-page.d.ts +57 -0
- package/dist/types/modules/word/markdown.d.ts +14 -0
- package/dist/types/modules/word/patcher.d.ts +62 -0
- package/dist/types/modules/word/query/compat.d.ts +25 -0
- package/dist/types/modules/word/query/data-binding.d.ts +22 -0
- package/dist/types/modules/word/query/form-fields.d.ts +41 -0
- package/dist/types/modules/word/query/format-search.d.ts +99 -0
- package/dist/types/modules/word/query/mail-merge.d.ts +25 -0
- package/dist/types/modules/word/query/merge.d.ts +50 -0
- package/dist/types/modules/word/query/replace.d.ts +47 -0
- package/dist/types/modules/word/query/revisions.d.ts +67 -0
- package/dist/types/modules/word/query/search.d.ts +129 -0
- package/dist/types/modules/word/query/split.d.ts +44 -0
- package/dist/types/modules/word/query/style-resolve.d.ts +104 -0
- package/dist/types/modules/word/reader/chart-parser.d.ts +20 -0
- package/dist/types/modules/word/reader/comments-parser.d.ts +26 -0
- package/dist/types/modules/word/reader/doc-props-parsers.d.ts +15 -0
- package/dist/types/modules/word/reader/docx-reader.d.ts +27 -0
- package/dist/types/modules/word/reader/drawing-helpers.d.ts +27 -0
- package/dist/types/modules/word/reader/form-field-parser.d.ts +21 -0
- package/dist/types/modules/word/reader/image-parsers.d.ts +11 -0
- package/dist/types/modules/word/reader/math-parser.d.ts +12 -0
- package/dist/types/modules/word/reader/metadata-parsers.d.ts +17 -0
- package/dist/types/modules/word/reader/numbering-parser.d.ts +13 -0
- package/dist/types/modules/word/reader/paragraph-section-parsers.d.ts +12 -0
- package/dist/types/modules/word/reader/parse-utils.d.ts +91 -0
- package/dist/types/modules/word/reader/properties-parsers.d.ts +21 -0
- package/dist/types/modules/word/reader/reader-context.d.ts +69 -0
- package/dist/types/modules/word/reader/sdt-helpers.d.ts +29 -0
- package/dist/types/modules/word/reader/settings-parser.d.ts +8 -0
- package/dist/types/modules/word/reader/styles-parser.d.ts +12 -0
- package/dist/types/modules/word/reader/table-properties-parsers.d.ts +12 -0
- package/dist/types/modules/word/reader/theme-parser.d.ts +8 -0
- package/dist/types/modules/word/reader/watermark-parser.d.ts +15 -0
- package/dist/types/modules/word/security/cfb-reader.d.ts +37 -0
- package/dist/types/modules/word/{digital-signatures.d.ts → security/digital-signatures.d.ts} +19 -11
- package/dist/types/modules/word/security/document-protection.d.ts +93 -0
- package/dist/{browser/modules/word → types/modules/word/security}/encryption.d.ts +51 -4
- package/dist/types/modules/word/security/policy.d.ts +80 -0
- package/dist/types/modules/word/template/template-chart.d.ts +56 -0
- package/dist/types/modules/word/template/template-datasource.d.ts +154 -0
- package/dist/types/modules/word/template/template-engine.d.ts +121 -0
- package/dist/types/modules/word/types.d.ts +224 -25
- package/dist/types/modules/word/units.d.ts +26 -0
- package/dist/types/modules/word/writer/checkbox-writer.d.ts +17 -0
- package/dist/{browser/modules/word/writers → types/modules/word/writer}/comment-writer.d.ts +2 -1
- package/dist/types/modules/word/writer/common-parts.d.ts +57 -0
- package/dist/{browser/modules/word → types/modules/word/writer}/content-types.d.ts +2 -2
- package/dist/types/modules/word/writer/document-writer.d.ts +24 -0
- package/dist/types/modules/word/writer/docx-packager.d.ts +35 -0
- package/dist/{browser/modules/word/writers → types/modules/word/writer}/footnote-writer.d.ts +3 -2
- package/dist/{browser/modules/word/writers → types/modules/word/writer}/header-footer-writer.d.ts +3 -2
- package/dist/{browser/modules/word/writers → types/modules/word/writer}/image-writer.d.ts +1 -1
- package/dist/types/modules/word/writer/math-writer.d.ts +20 -0
- package/dist/types/modules/word/{writers → writer}/numbering-writer.d.ts +1 -1
- package/dist/types/modules/word/{writers → writer}/paragraph-writer.d.ts +2 -1
- package/dist/types/modules/word/{writers → writer}/parts-writer.d.ts +3 -3
- package/dist/types/modules/word/writer/reference-scanners.d.ts +42 -0
- package/dist/types/modules/word/writer/relationships.d.ts +52 -0
- package/dist/types/modules/word/writer/render-context.d.ts +124 -0
- package/dist/types/modules/word/{writers → writer}/run-writer.d.ts +10 -1
- package/dist/types/modules/word/writer/sdt-writer.d.ts +25 -0
- package/dist/types/modules/word/writer/stream-buf.d.ts +37 -0
- package/dist/types/modules/word/writer/streaming-writer.d.ts +344 -0
- package/dist/types/modules/word/writer/string-buf.d.ts +8 -0
- package/dist/types/modules/word/{writers → writer}/table-writer.d.ts +2 -1
- package/dist/types/modules/xml/types.d.ts +22 -0
- package/dist/types/utils/crypto.browser.d.ts +3 -1
- package/dist/types/utils/crypto.d.ts +4 -1
- package/dist/types/utils/font-metrics.d.ts +63 -0
- package/dist/types/utils/string-buf.d.ts +42 -0
- package/dist/types/utils/theme-colors.d.ts +55 -0
- package/package.json +121 -39
- package/dist/browser/modules/word/color-utils.js +0 -94
- package/dist/browser/modules/word/document.d.ts +0 -657
- package/dist/browser/modules/word/document.js +0 -1533
- package/dist/browser/modules/word/docx-packager.d.ts +0 -14
- package/dist/browser/modules/word/docx-packager.js +0 -822
- package/dist/browser/modules/word/docx-reader.d.ts +0 -11
- package/dist/browser/modules/word/docx-reader.js +0 -4929
- package/dist/browser/modules/word/encryption.js +0 -274
- package/dist/browser/modules/word/internal-utils.d.ts +0 -23
- package/dist/browser/modules/word/internal-utils.js +0 -54
- package/dist/browser/modules/word/namespaces.d.ts +0 -159
- package/dist/browser/modules/word/namespaces.js +0 -189
- package/dist/browser/modules/word/relationships.d.ts +0 -30
- package/dist/browser/modules/word/relationships.js +0 -48
- package/dist/browser/modules/word/writers/checkbox-writer.d.ts +0 -9
- package/dist/browser/modules/word/writers/checkbox-writer.js +0 -42
- package/dist/browser/modules/word/writers/document-writer.d.ts +0 -16
- package/dist/browser/modules/word/writers/document-writer.js +0 -461
- package/dist/browser/modules/word/writers/math-writer.d.ts +0 -9
- package/dist/cjs/modules/word/color-utils.js +0 -97
- package/dist/cjs/modules/word/document.js +0 -1645
- package/dist/cjs/modules/word/docx-packager.js +0 -825
- package/dist/cjs/modules/word/docx-reader.js +0 -4932
- package/dist/cjs/modules/word/encryption.js +0 -282
- package/dist/cjs/modules/word/internal-utils.js +0 -59
- package/dist/cjs/modules/word/namespaces.js +0 -192
- package/dist/cjs/modules/word/relationships.js +0 -55
- package/dist/cjs/modules/word/writers/checkbox-writer.js +0 -45
- package/dist/cjs/modules/word/writers/document-writer.js +0 -465
- package/dist/esm/modules/word/color-utils.js +0 -94
- package/dist/esm/modules/word/document.js +0 -1533
- package/dist/esm/modules/word/docx-packager.js +0 -822
- package/dist/esm/modules/word/docx-reader.js +0 -4929
- package/dist/esm/modules/word/encryption.js +0 -274
- package/dist/esm/modules/word/internal-utils.js +0 -54
- package/dist/esm/modules/word/namespaces.js +0 -189
- package/dist/esm/modules/word/relationships.js +0 -48
- package/dist/esm/modules/word/writers/checkbox-writer.js +0 -42
- package/dist/esm/modules/word/writers/document-writer.js +0 -461
- package/dist/types/modules/word/document.d.ts +0 -657
- package/dist/types/modules/word/docx-packager.d.ts +0 -14
- package/dist/types/modules/word/docx-reader.d.ts +0 -11
- package/dist/types/modules/word/internal-utils.d.ts +0 -23
- package/dist/types/modules/word/namespaces.d.ts +0 -159
- package/dist/types/modules/word/relationships.d.ts +0 -30
- package/dist/types/modules/word/writers/checkbox-writer.d.ts +0 -9
- package/dist/types/modules/word/writers/document-writer.d.ts +0 -16
- package/dist/types/modules/word/writers/math-writer.d.ts +0 -9
- /package/dist/browser/modules/word/{font-obfuscation.d.ts → font/font-obfuscation.d.ts} +0 -0
- /package/dist/browser/modules/word/{writers → writer}/chart-writer.d.ts +0 -0
- /package/dist/browser/modules/word/{writers → writer}/section-writer.d.ts +0 -0
- /package/dist/browser/modules/word/{writers → writer}/section-writer.js +0 -0
- /package/dist/browser/modules/word/{writers → writer}/styles-writer.d.ts +0 -0
- /package/dist/browser/modules/word/{writers → writer}/textbox-writer.d.ts +0 -0
- /package/dist/browser/modules/word/{writers → writer}/textbox-writer.js +0 -0
- /package/dist/browser/modules/word/{writers → writer}/toc-writer.d.ts +0 -0
- /package/dist/browser/modules/word/{writers → writer}/toc-writer.js +0 -0
- /package/dist/cjs/modules/word/{writers → writer}/section-writer.js +0 -0
- /package/dist/cjs/modules/word/{writers → writer}/textbox-writer.js +0 -0
- /package/dist/cjs/modules/word/{writers → writer}/toc-writer.js +0 -0
- /package/dist/esm/modules/word/{writers → writer}/section-writer.js +0 -0
- /package/dist/esm/modules/word/{writers → writer}/textbox-writer.js +0 -0
- /package/dist/esm/modules/word/{writers → writer}/toc-writer.js +0 -0
- /package/dist/types/modules/word/{font-obfuscation.d.ts → font/font-obfuscation.d.ts} +0 -0
- /package/dist/types/modules/word/{writers → writer}/chart-writer.d.ts +0 -0
- /package/dist/types/modules/word/{writers → writer}/section-writer.d.ts +0 -0
- /package/dist/types/modules/word/{writers → writer}/styles-writer.d.ts +0 -0
- /package/dist/types/modules/word/{writers → writer}/textbox-writer.d.ts +0 -0
- /package/dist/types/modules/word/{writers → writer}/toc-writer.d.ts +0 -0
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Renders various auxiliary parts of the DOCX package.
|
|
6
6
|
*/
|
|
7
7
|
import { NS_W, NS_R, NS_M, NS_V, NS_O, NS_W14, NS_DC, NS_DCTERMS, NS_DCMITYPE, NS_CP, NS_EP, NS_VT, NS_XSI, NS_CUSTOM, STD_DOC_ATTRIBUTES } from "../constants.js";
|
|
8
|
+
import { DocxRawXmlPolicyError } from "../errors.js";
|
|
8
9
|
/** Render footnote/endnote properties in settings. */
|
|
9
10
|
function renderSettingsNoteProperties(xml, tagName, props) {
|
|
10
11
|
xml.openNode(tagName);
|
|
@@ -26,7 +27,7 @@ function renderSettingsNoteProperties(xml, tagName, props) {
|
|
|
26
27
|
// Settings
|
|
27
28
|
// =============================================================================
|
|
28
29
|
/** Render word/settings.xml. */
|
|
29
|
-
export function renderSettings(xml, settings) {
|
|
30
|
+
export function renderSettings(xml, settings, rawXmlPolicy) {
|
|
30
31
|
xml.openXml(STD_DOC_ATTRIBUTES);
|
|
31
32
|
xml.openNode("w:settings", {
|
|
32
33
|
"xmlns:w": NS_W,
|
|
@@ -141,10 +142,34 @@ export function renderSettings(xml, settings) {
|
|
|
141
142
|
// Document protection
|
|
142
143
|
if (settings?.documentProtection) {
|
|
143
144
|
const dp = settings.documentProtection;
|
|
144
|
-
const attrs = {
|
|
145
|
+
const attrs = {};
|
|
146
|
+
if (dp.type) {
|
|
147
|
+
attrs["w:edit"] = dp.type;
|
|
148
|
+
}
|
|
149
|
+
else if (dp.edit) {
|
|
150
|
+
attrs["w:edit"] = dp.edit;
|
|
151
|
+
}
|
|
145
152
|
if (dp.enforcement !== undefined) {
|
|
146
153
|
attrs["w:enforcement"] = dp.enforcement ? "1" : "0";
|
|
147
154
|
}
|
|
155
|
+
if (dp.formatting !== undefined) {
|
|
156
|
+
attrs["w:formatting"] = dp.formatting ? "1" : "0";
|
|
157
|
+
}
|
|
158
|
+
if (dp.hashAlgorithm) {
|
|
159
|
+
attrs["w:cryptAlgorithmClass"] = "hash";
|
|
160
|
+
attrs["w:cryptAlgorithmType"] = "typeAny";
|
|
161
|
+
attrs["w:cryptAlgorithmSid"] = hashAlgorithmToSid(dp.hashAlgorithm);
|
|
162
|
+
attrs["w:cryptProviderType"] = "rsaAES";
|
|
163
|
+
}
|
|
164
|
+
if (dp.hashValue) {
|
|
165
|
+
attrs["w:hash"] = dp.hashValue;
|
|
166
|
+
}
|
|
167
|
+
if (dp.saltValue) {
|
|
168
|
+
attrs["w:salt"] = dp.saltValue;
|
|
169
|
+
}
|
|
170
|
+
if (dp.spinCount !== undefined) {
|
|
171
|
+
attrs["w:cryptSpinCount"] = String(dp.spinCount);
|
|
172
|
+
}
|
|
148
173
|
xml.leafNode("w:documentProtection", attrs);
|
|
149
174
|
}
|
|
150
175
|
// Display background shape
|
|
@@ -172,7 +197,12 @@ export function renderSettings(xml, settings) {
|
|
|
172
197
|
}
|
|
173
198
|
// Mail merge (round-trip preservation)
|
|
174
199
|
if (settings?.mailMergeRawXml) {
|
|
175
|
-
|
|
200
|
+
if (rawXmlPolicy === "reject") {
|
|
201
|
+
throw new DocxRawXmlPolicyError("settings.mailMergeRawXml");
|
|
202
|
+
}
|
|
203
|
+
if (rawXmlPolicy !== "strip") {
|
|
204
|
+
xml.writeRaw(settings.mailMergeRawXml);
|
|
205
|
+
}
|
|
176
206
|
}
|
|
177
207
|
// Write protection
|
|
178
208
|
if (settings?.writeProtection) {
|
|
@@ -207,14 +237,25 @@ export function renderSettings(xml, settings) {
|
|
|
207
237
|
xml.leafNode(`w:${flag.name}`, attrs);
|
|
208
238
|
}
|
|
209
239
|
}
|
|
240
|
+
// Resolve compatibilityMode value: prefer an explicit entry in
|
|
241
|
+
// settings.compatSettings, then settings.compatibilityMode, then 15.
|
|
242
|
+
// Then emit every additional compatSetting (skipping the duplicate
|
|
243
|
+
// compatibilityMode entry to avoid two w:compatSetting elements with
|
|
244
|
+
// the same name — Word treats the first as authoritative, which would
|
|
245
|
+
// hide a user-supplied mode behind the default 15).
|
|
246
|
+
const explicitMode = settings?.compatSettings?.find(s => s.name === "compatibilityMode");
|
|
247
|
+
const compatibilityModeVal = explicitMode?.val ?? String(settings?.compatibilityMode ?? 15);
|
|
210
248
|
xml.leafNode("w:compatSetting", {
|
|
211
249
|
"w:name": "compatibilityMode",
|
|
212
250
|
"w:uri": "http://schemas.microsoft.com/office/word",
|
|
213
|
-
"w:val":
|
|
251
|
+
"w:val": compatibilityModeVal
|
|
214
252
|
});
|
|
215
|
-
// Additional compatSettings
|
|
253
|
+
// Additional compatSettings (excluding compatibilityMode — already written)
|
|
216
254
|
if (settings?.compatSettings) {
|
|
217
255
|
for (const cs of settings.compatSettings) {
|
|
256
|
+
if (cs.name === "compatibilityMode") {
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
218
259
|
xml.leafNode("w:compatSetting", {
|
|
219
260
|
"w:name": cs.name,
|
|
220
261
|
"w:uri": cs.uri,
|
|
@@ -472,7 +513,7 @@ export function renderCustomProperties(xml, properties) {
|
|
|
472
513
|
// Theme (minimal default theme)
|
|
473
514
|
// =============================================================================
|
|
474
515
|
/** Render word/theme/theme1.xml (minimal theme). */
|
|
475
|
-
export function renderTheme(xml, theme) {
|
|
516
|
+
export function renderTheme(xml, theme, rawXmlPolicy) {
|
|
476
517
|
const NS_A_LOCAL = "http://schemas.openxmlformats.org/drawingml/2006/main";
|
|
477
518
|
xml.openXml(STD_DOC_ATTRIBUTES);
|
|
478
519
|
xml.openNode("a:theme", { "xmlns:a": NS_A_LOCAL, name: theme?.name ?? "Office Theme" });
|
|
@@ -530,9 +571,19 @@ export function renderTheme(xml, theme) {
|
|
|
530
571
|
xml.closeNode(); // a:fontScheme
|
|
531
572
|
// Format scheme - preserve raw XML if provided, otherwise minimal default
|
|
532
573
|
if (theme?.formatScheme?.rawXml) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
574
|
+
if (rawXmlPolicy === "reject") {
|
|
575
|
+
throw new DocxRawXmlPolicyError("theme.formatScheme.rawXml");
|
|
576
|
+
}
|
|
577
|
+
if (rawXmlPolicy === "strip") {
|
|
578
|
+
// Fall back to a minimal default rather than emitting an empty
|
|
579
|
+
// a:fmtScheme — Word treats an empty format scheme as malformed.
|
|
580
|
+
renderDefaultFormatScheme(xml);
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
xml.openNode("a:fmtScheme", { name: theme.formatScheme.name });
|
|
584
|
+
xml.writeRaw(theme.formatScheme.rawXml);
|
|
585
|
+
xml.closeNode();
|
|
586
|
+
}
|
|
536
587
|
}
|
|
537
588
|
else {
|
|
538
589
|
renderDefaultFormatScheme(xml);
|
|
@@ -540,7 +591,12 @@ export function renderTheme(xml, theme) {
|
|
|
540
591
|
xml.closeNode(); // a:themeElements
|
|
541
592
|
// Extension list (round-trip preservation)
|
|
542
593
|
if (theme?.extLstXml) {
|
|
543
|
-
|
|
594
|
+
if (rawXmlPolicy === "reject") {
|
|
595
|
+
throw new DocxRawXmlPolicyError("theme.extLstXml");
|
|
596
|
+
}
|
|
597
|
+
if (rawXmlPolicy !== "strip") {
|
|
598
|
+
xml.writeRaw(theme.extLstXml);
|
|
599
|
+
}
|
|
544
600
|
}
|
|
545
601
|
xml.closeNode(); // a:theme
|
|
546
602
|
}
|
|
@@ -599,7 +655,7 @@ function renderDefaultFormatScheme(xml) {
|
|
|
599
655
|
// Web Settings
|
|
600
656
|
// =============================================================================
|
|
601
657
|
/** Render word/webSettings.xml. */
|
|
602
|
-
export function renderWebSettings(xml, ws) {
|
|
658
|
+
export function renderWebSettings(xml, ws, rawXmlPolicy) {
|
|
603
659
|
xml.openXml(STD_DOC_ATTRIBUTES);
|
|
604
660
|
xml.openNode("w:webSettings", { "xmlns:w": NS_W });
|
|
605
661
|
if (ws?.optimizeForBrowser) {
|
|
@@ -628,7 +684,12 @@ export function renderWebSettings(xml, ws) {
|
|
|
628
684
|
xml.leafNode("w:useTargetMachineType");
|
|
629
685
|
}
|
|
630
686
|
if (ws?.rawXml) {
|
|
631
|
-
|
|
687
|
+
if (rawXmlPolicy === "reject") {
|
|
688
|
+
throw new DocxRawXmlPolicyError("webSettings.rawXml");
|
|
689
|
+
}
|
|
690
|
+
if (rawXmlPolicy !== "strip") {
|
|
691
|
+
xml.writeRaw(ws.rawXml);
|
|
692
|
+
}
|
|
632
693
|
}
|
|
633
694
|
xml.closeNode();
|
|
634
695
|
}
|
|
@@ -658,3 +719,21 @@ export function renderPeople(xml, people) {
|
|
|
658
719
|
}
|
|
659
720
|
xml.closeNode();
|
|
660
721
|
}
|
|
722
|
+
// =============================================================================
|
|
723
|
+
// Internal Helpers
|
|
724
|
+
// =============================================================================
|
|
725
|
+
/** Convert hash algorithm name to OOXML cryptAlgorithmSid value. */
|
|
726
|
+
function hashAlgorithmToSid(algorithm) {
|
|
727
|
+
switch (algorithm) {
|
|
728
|
+
case "SHA-1":
|
|
729
|
+
return "4";
|
|
730
|
+
case "SHA-256":
|
|
731
|
+
return "12";
|
|
732
|
+
case "SHA-384":
|
|
733
|
+
return "13";
|
|
734
|
+
case "SHA-512":
|
|
735
|
+
return "14";
|
|
736
|
+
default:
|
|
737
|
+
return "4"; // Default to SHA-1
|
|
738
|
+
}
|
|
739
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOCX Module - Reference Scanners
|
|
3
|
+
*
|
|
4
|
+
* Shared helpers for scanning the document model for image / hyperlink /
|
|
5
|
+
* chart references that need to be registered against a part-level .rels
|
|
6
|
+
* file. Used by both the bulk packager and the streaming writer to avoid
|
|
7
|
+
* behaviour drift in how header/footer/notes/comments parts collect their
|
|
8
|
+
* own relationships.
|
|
9
|
+
*/
|
|
10
|
+
import type { ChartContent, HeaderFooterContent, Hyperlink, Paragraph, ParagraphChild } from "../types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Recursively collect image rIds referenced inside a list of paragraph
|
|
13
|
+
* children. Descends into track-change wrappers (`InsertedRun`,
|
|
14
|
+
* `MovedToRun`, etc.) so an image embedded inside `<w:ins>...</w:ins>` is
|
|
15
|
+
* not silently lost.
|
|
16
|
+
*/
|
|
17
|
+
export declare function scanChildrenForImages(children: readonly ParagraphChild[], out: Set<string>): void;
|
|
18
|
+
/**
|
|
19
|
+
* Recursively collect external-URL hyperlinks from a list of paragraph
|
|
20
|
+
* children. Descends into track-change wrappers so an inserted hyperlink
|
|
21
|
+
* isn't dropped.
|
|
22
|
+
*
|
|
23
|
+
* Always emits hyperlinks that carry a `url`, regardless of whether the
|
|
24
|
+
* model already has an `rId`. Reader-supplied `rId`s are stale once the
|
|
25
|
+
* package is repackaged because the relationship table is rebuilt from
|
|
26
|
+
* scratch — the packager assigns its own canonical `rId<N>` and exposes
|
|
27
|
+
* it via the `hyperlinkRIds` WeakMap, which the renderer consults.
|
|
28
|
+
*/
|
|
29
|
+
export declare function scanChildrenForHyperlinks(children: readonly ParagraphChild[], out: Hyperlink[]): void;
|
|
30
|
+
/** Collect all image rIds referenced in header/footer content. */
|
|
31
|
+
export declare function collectImageRidsFromContent(content: HeaderFooterContent): Set<string>;
|
|
32
|
+
/** Collect hyperlinks from header/footer content. */
|
|
33
|
+
export declare function collectHyperlinksFromHeaderFooter(content: HeaderFooterContent): Hyperlink[];
|
|
34
|
+
/** Collect all chart contents inside header/footer content. */
|
|
35
|
+
export declare function collectChartsFromHeaderFooter(content: HeaderFooterContent, out: ChartContent[]): void;
|
|
36
|
+
/** Collect image rIds and hyperlinks from a notes/comments collection. */
|
|
37
|
+
export declare function collectImageRidsFromNotes(notes: readonly {
|
|
38
|
+
content: readonly Paragraph[];
|
|
39
|
+
}[] | undefined): Set<string>;
|
|
40
|
+
export declare function collectHyperlinksFromNotes(notes: readonly {
|
|
41
|
+
content: readonly Paragraph[];
|
|
42
|
+
}[] | undefined): Hyperlink[];
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOCX Module - Reference Scanners
|
|
3
|
+
*
|
|
4
|
+
* Shared helpers for scanning the document model for image / hyperlink /
|
|
5
|
+
* chart references that need to be registered against a part-level .rels
|
|
6
|
+
* file. Used by both the bulk packager and the streaming writer to avoid
|
|
7
|
+
* behaviour drift in how header/footer/notes/comments parts collect their
|
|
8
|
+
* own relationships.
|
|
9
|
+
*/
|
|
10
|
+
import { walkBlocks } from "../core/walker.js";
|
|
11
|
+
/** Scan a Run for image rIds. */
|
|
12
|
+
function scanRunForImages(run, out) {
|
|
13
|
+
for (const rc of run.content) {
|
|
14
|
+
if (rc.type === "image" && rc.rId) {
|
|
15
|
+
out.add(rc.rId);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Recursively collect image rIds referenced inside a list of paragraph
|
|
21
|
+
* children. Descends into track-change wrappers (`InsertedRun`,
|
|
22
|
+
* `MovedToRun`, etc.) so an image embedded inside `<w:ins>...</w:ins>` is
|
|
23
|
+
* not silently lost.
|
|
24
|
+
*/
|
|
25
|
+
export function scanChildrenForImages(children, out) {
|
|
26
|
+
walkBlocks([{ type: "paragraph", children }], {
|
|
27
|
+
enterRun(run) {
|
|
28
|
+
scanRunForImages(run, out);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Recursively collect external-URL hyperlinks from a list of paragraph
|
|
34
|
+
* children. Descends into track-change wrappers so an inserted hyperlink
|
|
35
|
+
* isn't dropped.
|
|
36
|
+
*
|
|
37
|
+
* Always emits hyperlinks that carry a `url`, regardless of whether the
|
|
38
|
+
* model already has an `rId`. Reader-supplied `rId`s are stale once the
|
|
39
|
+
* package is repackaged because the relationship table is rebuilt from
|
|
40
|
+
* scratch — the packager assigns its own canonical `rId<N>` and exposes
|
|
41
|
+
* it via the `hyperlinkRIds` WeakMap, which the renderer consults.
|
|
42
|
+
*/
|
|
43
|
+
export function scanChildrenForHyperlinks(children, out) {
|
|
44
|
+
walkBlocks([{ type: "paragraph", children }], {
|
|
45
|
+
enterHyperlink(h) {
|
|
46
|
+
if (h.url) {
|
|
47
|
+
out.push(h);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Walk paragraphs in a block list (recursing through tables, SDTs, TOC
|
|
54
|
+
* cached paragraphs, text boxes) and visit each paragraph.
|
|
55
|
+
*/
|
|
56
|
+
function walkParagraphs(blocks, onParagraph) {
|
|
57
|
+
walkBlocks(blocks, {
|
|
58
|
+
enterParagraph(p) {
|
|
59
|
+
onParagraph(p);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/** Collect all image rIds referenced in header/footer content. */
|
|
64
|
+
export function collectImageRidsFromContent(content) {
|
|
65
|
+
const rIds = new Set();
|
|
66
|
+
walkParagraphs(content.children, p => {
|
|
67
|
+
scanChildrenForImages(p.children, rIds);
|
|
68
|
+
});
|
|
69
|
+
return rIds;
|
|
70
|
+
}
|
|
71
|
+
/** Collect hyperlinks from header/footer content. */
|
|
72
|
+
export function collectHyperlinksFromHeaderFooter(content) {
|
|
73
|
+
const links = [];
|
|
74
|
+
walkParagraphs(content.children, p => {
|
|
75
|
+
scanChildrenForHyperlinks(p.children, links);
|
|
76
|
+
});
|
|
77
|
+
return links;
|
|
78
|
+
}
|
|
79
|
+
/** Collect all chart contents inside header/footer content. */
|
|
80
|
+
export function collectChartsFromHeaderFooter(content, out) {
|
|
81
|
+
walkBlocks(content.children, {
|
|
82
|
+
visitChart(chart) {
|
|
83
|
+
out.push(chart);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/** Collect image rIds and hyperlinks from a notes/comments collection. */
|
|
88
|
+
export function collectImageRidsFromNotes(notes) {
|
|
89
|
+
const rIds = new Set();
|
|
90
|
+
if (!notes) {
|
|
91
|
+
return rIds;
|
|
92
|
+
}
|
|
93
|
+
for (const note of notes) {
|
|
94
|
+
for (const p of note.content) {
|
|
95
|
+
scanChildrenForImages(p.children, rIds);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return rIds;
|
|
99
|
+
}
|
|
100
|
+
export function collectHyperlinksFromNotes(notes) {
|
|
101
|
+
const links = [];
|
|
102
|
+
if (!notes) {
|
|
103
|
+
return links;
|
|
104
|
+
}
|
|
105
|
+
for (const note of notes) {
|
|
106
|
+
for (const p of note.content) {
|
|
107
|
+
scanChildrenForHyperlinks(p.children, links);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return links;
|
|
111
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOCX Module - Relationship Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages OPC relationships for the DOCX package.
|
|
5
|
+
* Generates .rels files for package-level and part-level relationships.
|
|
6
|
+
*
|
|
7
|
+
* Provides both an object-oriented RelationshipsState interface and
|
|
8
|
+
* backward-compatible free functions (addRelationship, renderRelationships, etc.).
|
|
9
|
+
*/
|
|
10
|
+
import type { XmlSink } from "../../xml/types.js";
|
|
11
|
+
/** A single OPC relationship. */
|
|
12
|
+
export interface Relationship {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly type: string;
|
|
15
|
+
readonly target: string;
|
|
16
|
+
/**
|
|
17
|
+
* OPC TargetMode. Standard values are `"External"` and `"Internal"`
|
|
18
|
+
* (with `"Internal"` typically omitted on the wire). Internally we accept
|
|
19
|
+
* any string so that round-tripped relationships preserve non-standard
|
|
20
|
+
* values verbatim; new relationships emitted by the writer's own helpers
|
|
21
|
+
* still pass `"External"` or `undefined`.
|
|
22
|
+
*/
|
|
23
|
+
readonly targetMode?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Rich relationship set with validation and dedup capabilities. */
|
|
26
|
+
export interface RelationshipsState {
|
|
27
|
+
readonly rels: readonly Relationship[];
|
|
28
|
+
/** Add a relationship. If a matching (type, target, targetMode) already exists, returns its ID. */
|
|
29
|
+
add(type: string, target: string, targetMode?: string): string;
|
|
30
|
+
/** Add with a specific ID. Throws if ID already exists. */
|
|
31
|
+
addWithId(id: string, type: string, target: string, targetMode?: string): void;
|
|
32
|
+
/** Find existing relationship by type and target. */
|
|
33
|
+
findByTypeAndTarget(type: string, target: string): Relationship | undefined;
|
|
34
|
+
/** Check if an rId is already used. */
|
|
35
|
+
hasId(id: string): boolean;
|
|
36
|
+
/** Get count. */
|
|
37
|
+
count(): number;
|
|
38
|
+
/** Validate all relationships. Returns error messages (empty = valid). */
|
|
39
|
+
validate(): string[];
|
|
40
|
+
/** Render to XML. */
|
|
41
|
+
render(sink: XmlSink): void;
|
|
42
|
+
}
|
|
43
|
+
/** Create a new empty RelationshipsState. */
|
|
44
|
+
export declare function createRelationships(): RelationshipsState;
|
|
45
|
+
/** Add a relationship and return its assigned rId (free function alias). */
|
|
46
|
+
export declare function addRelationship(state: RelationshipsState, type: string, target: string, targetMode?: string): string;
|
|
47
|
+
/** Add a relationship with a specific ID (free function alias). */
|
|
48
|
+
export declare function addRelationshipWithId(state: RelationshipsState, id: string, type: string, target: string, targetMode?: string): void;
|
|
49
|
+
/** Get the number of relationships (free function alias). */
|
|
50
|
+
export declare function getRelationshipCount(state: RelationshipsState): number;
|
|
51
|
+
/** Render the relationships XML to a sink (free function alias). */
|
|
52
|
+
export declare function renderRelationships(state: RelationshipsState, xml: XmlSink): void;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOCX Module - Relationship Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages OPC relationships for the DOCX package.
|
|
5
|
+
* Generates .rels files for package-level and part-level relationships.
|
|
6
|
+
*
|
|
7
|
+
* Provides both an object-oriented RelationshipsState interface and
|
|
8
|
+
* backward-compatible free functions (addRelationship, renderRelationships, etc.).
|
|
9
|
+
*/
|
|
10
|
+
import { NS_PKG_RELS, STD_DOC_ATTRIBUTES } from "../constants.js";
|
|
11
|
+
import { DocxWriteError } from "../errors.js";
|
|
12
|
+
/** Create a new empty RelationshipsState. */
|
|
13
|
+
export function createRelationships() {
|
|
14
|
+
const internal = { _rels: [], _nextId: 1 };
|
|
15
|
+
const state = {
|
|
16
|
+
get rels() {
|
|
17
|
+
return internal._rels;
|
|
18
|
+
},
|
|
19
|
+
add(type, target, targetMode) {
|
|
20
|
+
// Dedup: reuse existing (type, target, targetMode) if found
|
|
21
|
+
const existing = internal._rels.find(r => r.type === type && r.target === target && r.targetMode === targetMode);
|
|
22
|
+
if (existing) {
|
|
23
|
+
return existing.id;
|
|
24
|
+
}
|
|
25
|
+
// Generate the next id but skip any value already taken by a
|
|
26
|
+
// previously registered non-standard id (e.g. round-tripped models
|
|
27
|
+
// sometimes carry rIds in formats other than "rId<n>", or the same
|
|
28
|
+
// numeric value was claimed by addWithId before this call).
|
|
29
|
+
let id = `rId${internal._nextId++}`;
|
|
30
|
+
while (internal._rels.some(r => r.id === id)) {
|
|
31
|
+
id = `rId${internal._nextId++}`;
|
|
32
|
+
}
|
|
33
|
+
internal._rels.push({ id, type, target, targetMode });
|
|
34
|
+
return id;
|
|
35
|
+
},
|
|
36
|
+
addWithId(id, type, target, targetMode) {
|
|
37
|
+
if (internal._rels.some(r => r.id === id)) {
|
|
38
|
+
throw new DocxWriteError(`Relationship ID "${id}" already exists`);
|
|
39
|
+
}
|
|
40
|
+
internal._rels.push({ id, type, target, targetMode });
|
|
41
|
+
// Keep nextId above any manually-assigned numeric IDs. This works for
|
|
42
|
+
// the common "rId<n>" form; non-standard formats (e.g. "R8") simply
|
|
43
|
+
// don't advance the counter, but the `add()` path above still skips
|
|
44
|
+
// collisions defensively.
|
|
45
|
+
const num = parseInt(id.replace("rId", ""), 10);
|
|
46
|
+
if (!isNaN(num) && num >= internal._nextId) {
|
|
47
|
+
internal._nextId = num + 1;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
findByTypeAndTarget(type, target) {
|
|
51
|
+
return internal._rels.find(r => r.type === type && r.target === target);
|
|
52
|
+
},
|
|
53
|
+
hasId(id) {
|
|
54
|
+
return internal._rels.some(r => r.id === id);
|
|
55
|
+
},
|
|
56
|
+
count() {
|
|
57
|
+
return internal._rels.length;
|
|
58
|
+
},
|
|
59
|
+
validate() {
|
|
60
|
+
const errors = [];
|
|
61
|
+
// Check duplicate IDs
|
|
62
|
+
const idSet = new Set();
|
|
63
|
+
for (const rel of internal._rels) {
|
|
64
|
+
if (idSet.has(rel.id)) {
|
|
65
|
+
errors.push(`Duplicate relationship ID: "${rel.id}"`);
|
|
66
|
+
}
|
|
67
|
+
idSet.add(rel.id);
|
|
68
|
+
}
|
|
69
|
+
// Check external targets without TargetMode
|
|
70
|
+
for (const rel of internal._rels) {
|
|
71
|
+
if ((rel.target.startsWith("http://") ||
|
|
72
|
+
rel.target.startsWith("https://") ||
|
|
73
|
+
rel.target.startsWith("mailto:")) &&
|
|
74
|
+
!rel.targetMode) {
|
|
75
|
+
errors.push(`Relationship "${rel.id}" has external target "${rel.target}" but no TargetMode="External"`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return errors;
|
|
79
|
+
},
|
|
80
|
+
render(sink) {
|
|
81
|
+
renderRelationships(state, sink);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
return state;
|
|
85
|
+
}
|
|
86
|
+
// =============================================================================
|
|
87
|
+
// Backward-Compatible Free Functions
|
|
88
|
+
// =============================================================================
|
|
89
|
+
/** Add a relationship and return its assigned rId (free function alias). */
|
|
90
|
+
export function addRelationship(state, type, target, targetMode) {
|
|
91
|
+
return state.add(type, target, targetMode);
|
|
92
|
+
}
|
|
93
|
+
/** Add a relationship with a specific ID (free function alias). */
|
|
94
|
+
export function addRelationshipWithId(state, id, type, target, targetMode) {
|
|
95
|
+
state.addWithId(id, type, target, targetMode);
|
|
96
|
+
}
|
|
97
|
+
/** Get the number of relationships (free function alias). */
|
|
98
|
+
export function getRelationshipCount(state) {
|
|
99
|
+
return state.count();
|
|
100
|
+
}
|
|
101
|
+
/** Render the relationships XML to a sink (free function alias). */
|
|
102
|
+
export function renderRelationships(state, xml) {
|
|
103
|
+
xml.openXml(STD_DOC_ATTRIBUTES);
|
|
104
|
+
xml.openNode("Relationships", { xmlns: NS_PKG_RELS });
|
|
105
|
+
for (const rel of state.rels) {
|
|
106
|
+
const attrs = {
|
|
107
|
+
Id: rel.id,
|
|
108
|
+
Type: rel.type,
|
|
109
|
+
Target: rel.target
|
|
110
|
+
};
|
|
111
|
+
if (rel.targetMode) {
|
|
112
|
+
attrs.TargetMode = rel.targetMode;
|
|
113
|
+
}
|
|
114
|
+
xml.leafNode("Relationship", attrs);
|
|
115
|
+
}
|
|
116
|
+
xml.closeNode();
|
|
117
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified rendering context for DOCX XML serialization.
|
|
3
|
+
* Passed to all writer functions to provide shared state.
|
|
4
|
+
*/
|
|
5
|
+
import type { WordSecurityPolicy } from "../security/policy.js";
|
|
6
|
+
/**
|
|
7
|
+
* A fully-qualified part name within the package (e.g. "/word/document.xml").
|
|
8
|
+
* Type alias kept for documentation; functionally identical to `string`.
|
|
9
|
+
*/
|
|
10
|
+
type PartName = string;
|
|
11
|
+
/** ID generators for various document elements. */
|
|
12
|
+
export interface IdGenerators {
|
|
13
|
+
nextDrawingId(): number;
|
|
14
|
+
nextSdtId(): number;
|
|
15
|
+
nextBookmarkId(): number;
|
|
16
|
+
nextDocPrId(): number;
|
|
17
|
+
nextChartId(): number;
|
|
18
|
+
nextImagePartId(): number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Lightweight, content-renderer-facing subset of WordRenderContext.
|
|
22
|
+
*
|
|
23
|
+
* Most leaf renderers (run/paragraph/table/image) only need the rId remap and
|
|
24
|
+
* the hyperlink rId map; passing the full WordRenderContext would couple them
|
|
25
|
+
* to chartRIds/securityPolicy/etc. They take this `RenderHelpers` instead.
|
|
26
|
+
*/
|
|
27
|
+
export interface RenderHelpers {
|
|
28
|
+
/** See WordRenderContext.imageRIdRemap. */
|
|
29
|
+
readonly imageRemap?: ReadonlyMap<string, string>;
|
|
30
|
+
/** See WordRenderContext.hyperlinkRIds. */
|
|
31
|
+
readonly hyperlinkRIds?: ReadonlyWeakMap<object, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Raw XML output policy. Controls how preserved/opaque rawXml fragments
|
|
34
|
+
* (opaqueRun, opaqueParagraphChild, opaqueDrawing, _advancedFillXml, …)
|
|
35
|
+
* are emitted. Defaults to `"preserve"` when undefined for backwards
|
|
36
|
+
* compatibility with callers that built helpers without a context.
|
|
37
|
+
*/
|
|
38
|
+
readonly rawXmlPolicy?: "preserve" | "strip" | "reject";
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Apply the `rawXmlPolicy` to a single `xml.writeRaw(...)` operation.
|
|
42
|
+
*
|
|
43
|
+
* - `"preserve"` (or undefined): write the fragment verbatim.
|
|
44
|
+
* - `"strip"`: skip writing — the surrounding wrapper element (if any) is
|
|
45
|
+
* left empty. This is intentionally conservative: it preserves ZIP/relationship
|
|
46
|
+
* integrity even though it may produce a structurally-incomplete element.
|
|
47
|
+
* - `"reject"`: throw `DocxRawXmlPolicyError` so the caller learns about the
|
|
48
|
+
* opaque content instead of silently producing degraded output.
|
|
49
|
+
*
|
|
50
|
+
* Importing the error class lazily would create an import cycle; callers that
|
|
51
|
+
* need to throw should do so themselves. This helper just resolves the action.
|
|
52
|
+
*/
|
|
53
|
+
export type RawXmlAction = "write" | "skip" | "throw";
|
|
54
|
+
export declare function resolveRawXmlAction(policy: "preserve" | "strip" | "reject" | undefined): RawXmlAction;
|
|
55
|
+
/**
|
|
56
|
+
* Read-only WeakMap projection.
|
|
57
|
+
* (TS lib doesn't ship one; we mirror the readonly subset of WeakMap.)
|
|
58
|
+
*/
|
|
59
|
+
interface ReadonlyWeakMap<K extends WeakKey, V> {
|
|
60
|
+
get(key: K): V | undefined;
|
|
61
|
+
has(key: K): boolean;
|
|
62
|
+
}
|
|
63
|
+
/** Render context passed to all writer functions. */
|
|
64
|
+
export interface WordRenderContext {
|
|
65
|
+
/** Current part being rendered. */
|
|
66
|
+
readonly partName: PartName;
|
|
67
|
+
/** Security policy controlling raw XML, external targets, etc. */
|
|
68
|
+
readonly securityPolicy: WordSecurityPolicy;
|
|
69
|
+
/** ID generators (shared across all parts for a single document render). */
|
|
70
|
+
readonly ids: IdGenerators;
|
|
71
|
+
/** Raw XML output policy. If "reject", opaque content throws instead of being written. */
|
|
72
|
+
readonly rawXmlPolicy: "preserve" | "strip" | "reject";
|
|
73
|
+
/** Chart/ChartEx object → rId mapping. Populated by packager before rendering. */
|
|
74
|
+
readonly chartRIds: Map<object, string>;
|
|
75
|
+
/**
|
|
76
|
+
* Optional remap for image relationship IDs that the packager had to rewrite
|
|
77
|
+
* (e.g. when the model's image rId collided with a non-image relationship in
|
|
78
|
+
* the same .rels file). Writers that emit `r:embed` look up this map first
|
|
79
|
+
* and fall back to the original rId stored on the model. The map is keyed by
|
|
80
|
+
* the original (model-side) rId.
|
|
81
|
+
*/
|
|
82
|
+
readonly imageRIdRemap: Map<string, string>;
|
|
83
|
+
/**
|
|
84
|
+
* External hyperlink object → rId mapping. The packager registers a
|
|
85
|
+
* relationship for each hyperlink with a `url` and stores the assigned rId
|
|
86
|
+
* here, keyed by the hyperlink object identity. The paragraph writer reads
|
|
87
|
+
* this when emitting `<w:hyperlink r:id="...">` so the model itself is
|
|
88
|
+
* never mutated.
|
|
89
|
+
*/
|
|
90
|
+
readonly hyperlinkRIds: WeakMap<object, string>;
|
|
91
|
+
/**
|
|
92
|
+
* AltChunk object → rId mapping. Populated by the packager when registering
|
|
93
|
+
* the relationship for each `w:altChunk`. Renderers prefer this map over
|
|
94
|
+
* `AltChunk.rId` so the caller's model is never mutated, including when
|
|
95
|
+
* the altChunk is nested inside a table cell or SDT and was therefore not
|
|
96
|
+
* cloned by the shallow body copy.
|
|
97
|
+
*/
|
|
98
|
+
readonly altChunkRIds: WeakMap<object, string>;
|
|
99
|
+
}
|
|
100
|
+
/** Create ID generators with given starting values. */
|
|
101
|
+
export declare function createIdGenerators(startValues?: {
|
|
102
|
+
drawingId?: number;
|
|
103
|
+
sdtId?: number;
|
|
104
|
+
bookmarkId?: number;
|
|
105
|
+
docPrId?: number;
|
|
106
|
+
chartId?: number;
|
|
107
|
+
imagePartId?: number;
|
|
108
|
+
}): IdGenerators;
|
|
109
|
+
/** Create a default render context. */
|
|
110
|
+
export declare function createRenderContext(options?: {
|
|
111
|
+
partName?: PartName;
|
|
112
|
+
securityPolicy?: WordSecurityPolicy;
|
|
113
|
+
chartRIds?: Map<object, string>;
|
|
114
|
+
imageRIdRemap?: Map<string, string>;
|
|
115
|
+
hyperlinkRIds?: WeakMap<object, string>;
|
|
116
|
+
altChunkRIds?: WeakMap<object, string>;
|
|
117
|
+
/**
|
|
118
|
+
* Pre-built ID generators. When provided, the caller is responsible for
|
|
119
|
+
* seeding them (e.g. with the maximum existing SDT id in the document so
|
|
120
|
+
* auto-assigned IDs don't collide with author-supplied ones).
|
|
121
|
+
*/
|
|
122
|
+
ids?: IdGenerators;
|
|
123
|
+
}): WordRenderContext;
|
|
124
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified rendering context for DOCX XML serialization.
|
|
3
|
+
* Passed to all writer functions to provide shared state.
|
|
4
|
+
*/
|
|
5
|
+
import { DEFAULT_SECURITY_POLICY } from "../security/policy.js";
|
|
6
|
+
export function resolveRawXmlAction(policy) {
|
|
7
|
+
switch (policy) {
|
|
8
|
+
case "strip":
|
|
9
|
+
return "skip";
|
|
10
|
+
case "reject":
|
|
11
|
+
return "throw";
|
|
12
|
+
default:
|
|
13
|
+
return "write";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** Create ID generators with given starting values. */
|
|
17
|
+
export function createIdGenerators(startValues) {
|
|
18
|
+
let drawingId = startValues?.drawingId ?? 1;
|
|
19
|
+
let sdtId = startValues?.sdtId ?? 1;
|
|
20
|
+
let bookmarkId = startValues?.bookmarkId ?? 0;
|
|
21
|
+
let docPrId = startValues?.docPrId ?? 1;
|
|
22
|
+
let chartId = startValues?.chartId ?? 1;
|
|
23
|
+
let imagePartId = startValues?.imagePartId ?? 1;
|
|
24
|
+
return {
|
|
25
|
+
nextDrawingId: () => drawingId++,
|
|
26
|
+
nextSdtId: () => sdtId++,
|
|
27
|
+
nextBookmarkId: () => bookmarkId++,
|
|
28
|
+
nextDocPrId: () => docPrId++,
|
|
29
|
+
nextChartId: () => chartId++,
|
|
30
|
+
nextImagePartId: () => imagePartId++
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Create a default render context. */
|
|
34
|
+
export function createRenderContext(options) {
|
|
35
|
+
const securityPolicy = options?.securityPolicy ?? DEFAULT_SECURITY_POLICY;
|
|
36
|
+
return {
|
|
37
|
+
partName: options?.partName ?? "/word/document.xml",
|
|
38
|
+
securityPolicy,
|
|
39
|
+
ids: options?.ids ?? createIdGenerators(),
|
|
40
|
+
rawXmlPolicy: securityPolicy.rawXmlPolicy ?? "preserve",
|
|
41
|
+
chartRIds: options?.chartRIds ?? new Map(),
|
|
42
|
+
imageRIdRemap: options?.imageRIdRemap ?? new Map(),
|
|
43
|
+
hyperlinkRIds: options?.hyperlinkRIds ?? new WeakMap(),
|
|
44
|
+
altChunkRIds: options?.altChunkRIds ?? new WeakMap()
|
|
45
|
+
};
|
|
46
|
+
}
|