ooxml-core 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/{PptxHandler-TEKISCJO.cjs → PptxHandler-DNSXWTQV.cjs} +3 -3
- package/dist/{PptxHandler-FYD7IYXT.mjs → PptxHandler-FSKKPZZC.mjs} +3 -3
- package/dist/PptxHandler-H7MEWJJJ.mjs +4 -0
- package/dist/{PresentationBuilder-IMB4DVRN.mjs → PresentationBuilder-7TSENZTX.mjs} +2 -2
- package/dist/{PresentationBuilder-NCKASKXU.cjs → PresentationBuilder-A5NI35VN.cjs} +5 -5
- package/dist/{PresentationBuilder-EYI6Z2JP.mjs → PresentationBuilder-RIJWQSEU.mjs} +3 -3
- package/dist/automation/docx-forms.d.ts +26 -0
- package/dist/automation/docx-forms.d.ts.map +1 -0
- package/dist/automation/index.cjs +6084 -2537
- package/dist/automation/index.d.ts +1 -0
- package/dist/automation/index.d.ts.map +1 -1
- package/dist/automation/index.mjs +6083 -2538
- package/dist/chart/axis-range.d.ts.map +1 -1
- package/dist/chart/bubble-radius.d.ts +0 -5
- package/dist/chart/bubble-radius.d.ts.map +1 -1
- package/dist/chart/extent.d.ts +9 -0
- package/dist/chart/extent.d.ts.map +1 -0
- package/dist/chart/histogram-binning.d.ts.map +1 -1
- package/dist/chart/index.cjs +56 -18
- package/dist/chart/index.mjs +56 -18
- package/dist/chart/render/chart-svg-cartesian.d.ts.map +1 -1
- package/dist/chart/render/chart-svg-legend.d.ts.map +1 -1
- package/dist/chart/render/chart-view-ex.d.ts.map +1 -1
- package/dist/chart/render/chart-view.d.ts.map +1 -1
- package/dist/chart/trendline-fit.d.ts.map +1 -1
- package/dist/{chunk-3IENHIFD.cjs → chunk-4LZIUJI3.cjs} +52 -12
- package/dist/{chunk-LEV2SVMK.mjs → chunk-4QPOJCJG.mjs} +45 -8
- package/dist/{chunk-CC5UNZOO.mjs → chunk-6IIMI5RS.mjs} +52 -12
- package/dist/{chunk-MN27HKHM.mjs → chunk-BA7Z6ATM.mjs} +5 -5
- package/dist/{chunk-LVM3IZJ2.mjs → chunk-DLFMCZZT.mjs} +1 -1
- package/dist/{chunk-M4XLF4R7.mjs → chunk-GBKBR4CX.mjs} +20 -8
- package/dist/{chunk-NXKATFM5.cjs → chunk-HL3FBJ6X.cjs} +1065 -1016
- package/dist/{chunk-WXY5EDGT.mjs → chunk-LF5E5ZOH.mjs} +51 -2
- package/dist/{chunk-MNXKRXFB.mjs → chunk-Q5PKBQXH.mjs} +52 -3
- package/dist/{chunk-GQYQQ3GA.mjs → chunk-VQF6HQEE.mjs} +1 -1
- package/dist/collab/embedding.d.ts +103 -0
- package/dist/collab/embedding.d.ts.map +1 -0
- package/dist/collab/index.cjs +450 -342
- package/dist/collab/index.d.ts +1 -0
- package/dist/collab/index.d.ts.map +1 -1
- package/dist/collab/index.mjs +443 -343
- package/dist/color/theme-palette.d.ts +5 -1
- package/dist/color/theme-palette.d.ts.map +1 -1
- package/dist/crypto/index.cjs +27 -2
- package/dist/crypto/index.mjs +27 -2
- package/dist/diagram/index.cjs +31 -3
- package/dist/diagram/index.mjs +31 -3
- package/dist/docx/block-parser.d.ts.map +1 -1
- package/dist/docx/cell-blocks.d.ts +7 -1
- package/dist/docx/cell-blocks.d.ts.map +1 -1
- package/dist/docx/content-control-edit.d.ts +14 -0
- package/dist/docx/content-control-edit.d.ts.map +1 -1
- package/dist/docx/content-control-model.d.ts +8 -0
- package/dist/docx/content-control-model.d.ts.map +1 -1
- package/dist/docx/content-control-values.d.ts +20 -0
- package/dist/docx/content-control-values.d.ts.map +1 -0
- package/dist/docx/content-control.d.ts +7 -1
- package/dist/docx/content-control.d.ts.map +1 -1
- package/dist/docx/element-order.d.ts +10 -5
- package/dist/docx/element-order.d.ts.map +1 -1
- package/dist/docx/embedded.cjs +3861 -1379
- package/dist/docx/embedded.mjs +3861 -1379
- package/dist/docx/field-instruction.d.ts +22 -0
- package/dist/docx/field-instruction.d.ts.map +1 -0
- package/dist/docx/form-field-model.d.ts +48 -0
- package/dist/docx/form-field-model.d.ts.map +1 -0
- package/dist/docx/form-fields.d.ts +31 -0
- package/dist/docx/form-fields.d.ts.map +1 -0
- package/dist/docx/form-fill-fields.d.ts +61 -0
- package/dist/docx/form-fill-fields.d.ts.map +1 -0
- package/dist/docx/form-fill-labels.d.ts +8 -0
- package/dist/docx/form-fill-labels.d.ts.map +1 -0
- package/dist/docx/form-fill-sites.d.ts +59 -0
- package/dist/docx/form-fill-sites.d.ts.map +1 -0
- package/dist/docx/form-fill-values.d.ts +28 -0
- package/dist/docx/form-fill-values.d.ts.map +1 -0
- package/dist/docx/form-fill-write.d.ts +26 -0
- package/dist/docx/form-fill-write.d.ts.map +1 -0
- package/dist/docx/glossary.d.ts +15 -0
- package/dist/docx/glossary.d.ts.map +1 -0
- package/dist/docx/index.cjs +5929 -3153
- package/dist/docx/index.d.ts +7 -0
- package/dist/docx/index.d.ts.map +1 -1
- package/dist/docx/index.mjs +5913 -3154
- package/dist/docx/inline-annotations.d.ts +21 -0
- package/dist/docx/inline-annotations.d.ts.map +1 -0
- package/dist/docx/inline-container-markers.d.ts +14 -0
- package/dist/docx/inline-container-markers.d.ts.map +1 -0
- package/dist/docx/inline-containers.d.ts +54 -0
- package/dist/docx/inline-containers.d.ts.map +1 -0
- package/dist/docx/inline-form-field-bookmarks.d.ts +15 -0
- package/dist/docx/inline-form-field-bookmarks.d.ts.map +1 -0
- package/dist/docx/inline-marker-positions.d.ts +15 -0
- package/dist/docx/inline-marker-positions.d.ts.map +1 -0
- package/dist/docx/inline-markers.d.ts +63 -0
- package/dist/docx/inline-markers.d.ts.map +1 -0
- package/dist/docx/inline-slots.d.ts +24 -0
- package/dist/docx/inline-slots.d.ts.map +1 -0
- package/dist/docx/layout/adapter.d.ts.map +1 -1
- package/dist/docx/layout/index.cjs +1176 -563
- package/dist/docx/layout/index.d.ts +2 -1
- package/dist/docx/layout/index.d.ts.map +1 -1
- package/dist/docx/layout/index.mjs +1175 -564
- package/dist/docx/layout/input.d.ts +5 -1
- package/dist/docx/layout/input.d.ts.map +1 -1
- package/dist/docx/layout/page-style-refs.d.ts +21 -0
- package/dist/docx/layout/page-style-refs.d.ts.map +1 -0
- package/dist/docx/layout/paragraph-fragments.d.ts.map +1 -1
- package/dist/docx/layout/result.d.ts +1 -0
- package/dist/docx/layout/result.d.ts.map +1 -1
- package/dist/docx/layout/tab-stops.d.ts +8 -1
- package/dist/docx/layout/tab-stops.d.ts.map +1 -1
- package/dist/docx/load/index.cjs +3969 -1487
- package/dist/docx/load/index.mjs +3969 -1487
- package/dist/docx/model-run.d.ts +24 -2
- package/dist/docx/model-run.d.ts.map +1 -1
- package/dist/docx/model.d.ts +5 -0
- package/dist/docx/model.d.ts.map +1 -1
- package/dist/docx/numbering-format.d.ts.map +1 -1
- package/dist/docx/parse-warnings.d.ts.map +1 -1
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/run-segmentation.d.ts +11 -0
- package/dist/docx/run-segmentation.d.ts.map +1 -0
- package/dist/docx/save.d.ts.map +1 -1
- package/dist/docx/section-model.d.ts +5 -0
- package/dist/docx/section-model.d.ts.map +1 -1
- package/dist/docx/sections.d.ts +4 -2
- package/dist/docx/sections.d.ts.map +1 -1
- package/dist/docx/settings.d.ts +9 -0
- package/dist/docx/settings.d.ts.map +1 -1
- package/dist/docx/special-characters.d.ts +34 -0
- package/dist/docx/special-characters.d.ts.map +1 -0
- package/dist/docx/style-ref-fields.d.ts +40 -0
- package/dist/docx/style-ref-fields.d.ts.map +1 -0
- package/dist/docx/style-ref.d.ts +85 -0
- package/dist/docx/style-ref.d.ts.map +1 -0
- package/dist/docx/table-model.d.ts +2 -2
- package/dist/docx/table-model.d.ts.map +1 -1
- package/dist/docx/ui/break-note-schema.d.ts.map +1 -1
- package/dist/docx/ui/content-control-commands.d.ts +20 -8
- package/dist/docx/ui/content-control-commands.d.ts.map +1 -1
- package/dist/docx/ui/content-control-guard.d.ts +4 -1
- package/dist/docx/ui/content-control-guard.d.ts.map +1 -1
- package/dist/docx/ui/content-control-paste.d.ts +23 -0
- package/dist/docx/ui/content-control-paste.d.ts.map +1 -0
- package/dist/docx/ui/content-control-rows.d.ts +15 -0
- package/dist/docx/ui/content-control-rows.d.ts.map +1 -0
- package/dist/docx/ui/content-control-sources.d.ts +12 -0
- package/dist/docx/ui/content-control-sources.d.ts.map +1 -0
- package/dist/docx/ui/content-control-spans.d.ts +29 -6
- package/dist/docx/ui/content-control-spans.d.ts.map +1 -1
- package/dist/docx/ui/content-control-temporary.d.ts +10 -0
- package/dist/docx/ui/content-control-temporary.d.ts.map +1 -0
- package/dist/docx/ui/form-field-commands.d.ts +41 -0
- package/dist/docx/ui/form-field-commands.d.ts.map +1 -0
- package/dist/docx/ui/form-field-guard.d.ts +24 -0
- package/dist/docx/ui/form-field-guard.d.ts.map +1 -0
- package/dist/docx/ui/form-text-blank.d.ts +18 -0
- package/dist/docx/ui/form-text-blank.d.ts.map +1 -0
- package/dist/docx/ui/index.cjs +9276 -7132
- package/dist/docx/ui/index.d.ts +5 -0
- package/dist/docx/ui/index.d.ts.map +1 -1
- package/dist/docx/ui/index.mjs +9259 -7137
- package/dist/docx/ui/positional-tab-input.d.ts +7 -0
- package/dist/docx/ui/positional-tab-input.d.ts.map +1 -0
- package/dist/docx/ui/run-compare.d.ts.map +1 -1
- package/dist/docx/ui/run-extra-mark.d.ts +1 -1
- package/dist/docx/ui/run-extra-mark.d.ts.map +1 -1
- package/dist/docx/ui/schema-marks.d.ts +1 -1
- package/dist/docx/ui/schema-marks.d.ts.map +1 -1
- package/dist/docx/ui/symbol-font.d.ts +4 -0
- package/dist/docx/ui/symbol-font.d.ts.map +1 -0
- package/dist/docx/ui/yjs-collaboration.d.ts +12 -1
- package/dist/docx/ui/yjs-collaboration.d.ts.map +1 -1
- package/dist/docx/write-block-placement.d.ts +7 -0
- package/dist/docx/write-block-placement.d.ts.map +1 -1
- package/dist/docx/write-content-control.d.ts +6 -0
- package/dist/docx/write-content-control.d.ts.map +1 -1
- package/dist/docx/write-header-footer.d.ts +6 -2
- package/dist/docx/write-header-footer.d.ts.map +1 -1
- package/dist/docx/write-inline.d.ts +12 -16
- package/dist/docx/write-inline.d.ts.map +1 -1
- package/dist/docx/write-paragraph.d.ts.map +1 -1
- package/dist/docx/write-revisions.d.ts.map +1 -1
- package/dist/docx/write-run.d.ts.map +1 -1
- package/dist/docx/write-section-properties.d.ts +5 -0
- package/dist/docx/write-section-properties.d.ts.map +1 -0
- package/dist/docx/write-sections.d.ts.map +1 -1
- package/dist/docx/write-table-controls.d.ts +15 -0
- package/dist/docx/write-table-controls.d.ts.map +1 -0
- package/dist/docx/write-table-properties.d.ts.map +1 -1
- package/dist/docx/write-table.d.ts.map +1 -1
- package/dist/docx/write.d.ts.map +1 -1
- package/dist/docx/xml.d.ts +6 -0
- package/dist/docx/xml.d.ts.map +1 -1
- package/dist/drawingml/index.cjs +31 -3
- package/dist/drawingml/index.mjs +31 -3
- package/dist/index.cjs +77 -26
- package/dist/index.mjs +77 -26
- package/dist/math/index.cjs +27 -2
- package/dist/math/index.mjs +27 -2
- package/dist/opc/index.cjs +51 -11
- package/dist/opc/index.mjs +51 -11
- package/dist/opc/zip-folders.d.ts +11 -0
- package/dist/opc/zip-folders.d.ts.map +1 -0
- package/dist/opc/zip-limits.d.ts +9 -0
- package/dist/opc/zip-limits.d.ts.map +1 -1
- package/dist/pptx/automation/index.cjs +116 -17
- package/dist/pptx/automation/index.d.ts +2 -2
- package/dist/pptx/automation/index.mjs +6 -6
- package/dist/pptx/chunks/{index-CgFX0T7b.d.ts → index-CPhsd7Df.d.ts} +9 -1
- package/dist/pptx/chunks/{index-CgFX0T7b.d.ts.map → index-CPhsd7Df.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-qwVYoFn6.d.ts → index-Q5mM8kIR.d.ts} +2 -2
- package/dist/pptx/chunks/{index-qwVYoFn6.d.ts.map → index-Q5mM8kIR.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +116 -17
- package/dist/pptx/cli/index.mjs +5 -5
- package/dist/pptx/converter/index.cjs +12 -3
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +3 -3
- package/dist/pptx/editor/render/find-replace.cjs +14 -14
- package/dist/pptx/editor/render/find-replace.d.ts +1 -1
- package/dist/pptx/editor/render/find-replace.mjs +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +8 -8
- package/dist/pptx/editor/render/slide-operations.mjs +2 -2
- package/dist/pptx/index.cjs +116 -17
- package/dist/pptx/index.d.ts +2 -2
- package/dist/pptx/index.mjs +6 -6
- package/dist/pptx/signature-node/index.cjs +20 -8
- package/dist/pptx/signature-node/index.mjs +2 -2
- package/dist/teams/index.cjs +105 -70
- package/dist/teams/index.mjs +105 -70
- package/dist/text/text-diff.d.ts +15 -0
- package/dist/text/text-diff.d.ts.map +1 -0
- package/dist/visio/index.cjs +159 -39
- package/dist/visio/index.mjs +159 -39
- package/dist/visio/ui/contract.d.ts +7 -2
- package/dist/visio/ui/contract.d.ts.map +1 -1
- package/dist/visio/ui/index.cjs +165 -43
- package/dist/visio/ui/index.mjs +165 -43
- package/dist/xlsx/collab/index.cjs +8 -3
- package/dist/xlsx/collab/index.mjs +8 -3
- package/dist/xlsx/compare/cells.d.ts +22 -0
- package/dist/xlsx/compare/cells.d.ts.map +1 -0
- package/dist/xlsx/compare/compare.d.ts +12 -0
- package/dist/xlsx/compare/compare.d.ts.map +1 -0
- package/dist/xlsx/compare/conditional.d.ts +7 -0
- package/dist/xlsx/compare/conditional.d.ts.map +1 -0
- package/dist/xlsx/compare/format-key.d.ts +34 -0
- package/dist/xlsx/compare/format-key.d.ts.map +1 -0
- package/dist/xlsx/compare/group.d.ts +8 -0
- package/dist/xlsx/compare/group.d.ts.map +1 -0
- package/dist/xlsx/compare/index.d.ts +5 -0
- package/dist/xlsx/compare/index.d.ts.map +1 -0
- package/dist/xlsx/compare/rich-text.d.ts +7 -0
- package/dist/xlsx/compare/rich-text.d.ts.map +1 -0
- package/dist/xlsx/compare/sheets.d.ts +22 -0
- package/dist/xlsx/compare/sheets.d.ts.map +1 -0
- package/dist/xlsx/compare/structure.d.ts +11 -0
- package/dist/xlsx/compare/structure.d.ts.map +1 -0
- package/dist/xlsx/compare/text.d.ts +8 -0
- package/dist/xlsx/compare/text.d.ts.map +1 -0
- package/dist/xlsx/compare/types.d.ts +173 -0
- package/dist/xlsx/compare/types.d.ts.map +1 -0
- package/dist/xlsx/edit/cell-values.d.ts.map +1 -1
- package/dist/xlsx/edit/clipboard-html.d.ts.map +1 -1
- package/dist/xlsx/edit/clipboard-text.d.ts.map +1 -1
- package/dist/xlsx/edit/clipboard.d.ts.map +1 -1
- package/dist/xlsx/edit/clone-cell.d.ts +9 -0
- package/dist/xlsx/edit/clone-cell.d.ts.map +1 -0
- package/dist/xlsx/edit/history.d.ts +8 -3
- package/dist/xlsx/edit/history.d.ts.map +1 -1
- package/dist/xlsx/edit/timelines.d.ts.map +1 -1
- package/dist/xlsx/formula/change-areas.d.ts +9 -0
- package/dist/xlsx/formula/change-areas.d.ts.map +1 -0
- package/dist/xlsx/formula/engine-prepare.d.ts +8 -0
- package/dist/xlsx/formula/engine-prepare.d.ts.map +1 -1
- package/dist/xlsx/formula/engine.d.ts.map +1 -1
- package/dist/xlsx/formula/spill.d.ts +5 -1
- package/dist/xlsx/formula/spill.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +2461 -1192
- package/dist/xlsx/index.d.ts +1 -0
- package/dist/xlsx/index.d.ts.map +1 -1
- package/dist/xlsx/index.mjs +2454 -1193
- package/dist/xlsx/layout/cell-view.d.ts.map +1 -1
- package/dist/xlsx/layout/navigate.d.ts.map +1 -1
- package/dist/xlsx/layout/style-view.d.ts +5 -0
- package/dist/xlsx/layout/style-view.d.ts.map +1 -1
- package/dist/xlsx/load/csv-dates.d.ts +22 -0
- package/dist/xlsx/load/csv-dates.d.ts.map +1 -0
- package/dist/xlsx/load/csv-import.d.ts +64 -0
- package/dist/xlsx/load/csv-import.d.ts.map +1 -0
- package/dist/xlsx/load/csv-separators.d.ts +13 -0
- package/dist/xlsx/load/csv-separators.d.ts.map +1 -0
- package/dist/xlsx/load/csv-traits.d.ts +20 -0
- package/dist/xlsx/load/csv-traits.d.ts.map +1 -0
- package/dist/xlsx/load/csv.d.ts +8 -4
- package/dist/xlsx/load/csv.d.ts.map +1 -1
- package/dist/xlsx/load/detect.d.ts +13 -0
- package/dist/xlsx/load/detect.d.ts.map +1 -1
- package/dist/xlsx/load/errors.d.ts +1 -0
- package/dist/xlsx/load/errors.d.ts.map +1 -1
- package/dist/xlsx/load/index.cjs +537 -91
- package/dist/xlsx/load/index.d.ts +3 -1
- package/dist/xlsx/load/index.d.ts.map +1 -1
- package/dist/xlsx/load/index.mjs +536 -92
- package/dist/xlsx/numfmt/input-date.d.ts +2 -0
- package/dist/xlsx/numfmt/input-date.d.ts.map +1 -1
- package/dist/xlsx/pivot/cache-xml.d.ts.map +1 -1
- package/dist/xlsx/pivot/groups.d.ts.map +1 -1
- package/dist/xlsx/read/index.d.ts +2 -1
- package/dist/xlsx/read/index.d.ts.map +1 -1
- package/dist/xlsx/read/limits.d.ts +50 -0
- package/dist/xlsx/read/limits.d.ts.map +1 -0
- package/dist/xlsx/read/load.d.ts +11 -1
- package/dist/xlsx/read/load.d.ts.map +1 -1
- package/dist/xlsx/read/package.d.ts +5 -23
- package/dist/xlsx/read/package.d.ts.map +1 -1
- package/dist/xlsx/read/shared-strings.d.ts +2 -2
- package/dist/xlsx/read/shared-strings.d.ts.map +1 -1
- package/dist/xlsx/read/worksheet.d.ts +2 -0
- package/dist/xlsx/read/worksheet.d.ts.map +1 -1
- package/dist/xlsx/stable-key.d.ts +3 -0
- package/dist/xlsx/stable-key.d.ts.map +1 -0
- package/dist/xlsx/styles.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +657 -372
- package/dist/xlsx/ui/index.mjs +657 -372
- package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
- package/dist/xml/index.cjs +32 -3
- package/dist/xml/index.mjs +32 -4
- package/dist/xml/xml.d.ts +11 -1
- package/dist/xml/xml.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/PptxHandler-SITN3K3F.mjs +0 -4
package/dist/visio/index.cjs
CHANGED
|
@@ -80,6 +80,19 @@ var DEFAULT_XML_LIMITS = {
|
|
|
80
80
|
maxDepth: 512,
|
|
81
81
|
maxNodes: 5e6
|
|
82
82
|
};
|
|
83
|
+
var XmlLimitError = class extends Error {
|
|
84
|
+
code = "xml-limit";
|
|
85
|
+
/** The limit that was exceeded. */
|
|
86
|
+
limit;
|
|
87
|
+
/** Its value: the largest depth or element count allowed. */
|
|
88
|
+
maximum;
|
|
89
|
+
constructor(message, limit3, maximum) {
|
|
90
|
+
super(message);
|
|
91
|
+
this.name = "XmlLimitError";
|
|
92
|
+
this.limit = limit3;
|
|
93
|
+
this.maximum = maximum;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
83
96
|
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
84
97
|
var MARKUP_SKIPS = [
|
|
85
98
|
["<!--", "-->"],
|
|
@@ -113,11 +126,22 @@ function checkXmlLimits(xml, label, limits = {}) {
|
|
|
113
126
|
continue;
|
|
114
127
|
}
|
|
115
128
|
nodes++;
|
|
116
|
-
if (nodes > maxNodes)
|
|
129
|
+
if (nodes > maxNodes)
|
|
130
|
+
throw new XmlLimitError(
|
|
131
|
+
`${label} XML exceeds the limit of ${maxNodes} elements`,
|
|
132
|
+
"maxNodes",
|
|
133
|
+
maxNodes
|
|
134
|
+
);
|
|
117
135
|
if (!selfClosing && ++depth > maxDepth)
|
|
118
|
-
throw new
|
|
136
|
+
throw new XmlLimitError(
|
|
137
|
+
`${label} XML exceeds the nesting depth limit of ${maxDepth}`,
|
|
138
|
+
"maxDepth",
|
|
139
|
+
maxDepth
|
|
140
|
+
);
|
|
119
141
|
}
|
|
120
142
|
}
|
|
143
|
+
var CRLF_DECLARATION = /^<\?xml[^>]*\?>\r\n/;
|
|
144
|
+
var crlfDeclarations = /* @__PURE__ */ new WeakSet();
|
|
121
145
|
function parseXml(xml, options2 = {}) {
|
|
122
146
|
const label = options2.label ?? "OOXML";
|
|
123
147
|
if (/<!DOCTYPE|<!ENTITY/i.test(xml))
|
|
@@ -139,9 +163,13 @@ function parseXml(xml, options2 = {}) {
|
|
|
139
163
|
}
|
|
140
164
|
if (parseError || !parsed.documentElement)
|
|
141
165
|
throw new Error(`Invalid ${label} XML: ${parseError || "missing root element"}`);
|
|
166
|
+
if (CRLF_DECLARATION.test(xml)) crlfDeclarations.add(parsed);
|
|
142
167
|
return parsed;
|
|
143
168
|
}
|
|
144
|
-
var buildXml = (node3) =>
|
|
169
|
+
var buildXml = (node3) => {
|
|
170
|
+
const xml = new xmldom.XMLSerializer().serializeToString(node3);
|
|
171
|
+
return crlfDeclarations.has(node3) ? xml.replace(/^(<\?xml[^>]*\?>)\n/, "$1\r\n") : xml;
|
|
172
|
+
};
|
|
145
173
|
var isElement = (node3) => node3.nodeType === 1;
|
|
146
174
|
var elements = (parent) => Array.from(parent.childNodes).filter(isElement);
|
|
147
175
|
function named(element2, local, ns, lenient = true) {
|
|
@@ -7690,9 +7718,9 @@ function createWorksheet(name3, sheetId5) {
|
|
|
7690
7718
|
};
|
|
7691
7719
|
}
|
|
7692
7720
|
|
|
7693
|
-
// xlsx/
|
|
7694
|
-
function
|
|
7695
|
-
return JSON.stringify(sortKeys(
|
|
7721
|
+
// xlsx/stable-key.ts
|
|
7722
|
+
function stableKey(value3) {
|
|
7723
|
+
return JSON.stringify(sortKeys(value3));
|
|
7696
7724
|
}
|
|
7697
7725
|
function sortKeys(value3) {
|
|
7698
7726
|
if (Array.isArray(value3)) return value3.map(sortKeys);
|
|
@@ -7706,6 +7734,11 @@ function sortKeys(value3) {
|
|
|
7706
7734
|
}
|
|
7707
7735
|
return value3;
|
|
7708
7736
|
}
|
|
7737
|
+
|
|
7738
|
+
// xlsx/styles.ts
|
|
7739
|
+
function styleKey(style2) {
|
|
7740
|
+
return stableKey(style2);
|
|
7741
|
+
}
|
|
7709
7742
|
function styleAt(workbook, styleId) {
|
|
7710
7743
|
const style2 = workbook.styles[styleId ?? 0] ?? workbook.styles[0];
|
|
7711
7744
|
if (!style2) throw new Error("Workbook has no default cell style");
|
|
@@ -10312,10 +10345,13 @@ var DEFAULT_ZIP_LIMITS = {
|
|
|
10312
10345
|
var ZipLimitError = class extends Error {
|
|
10313
10346
|
code = "ZIP_BOMB";
|
|
10314
10347
|
limit;
|
|
10348
|
+
/** The check that failed (absent when the error was built without one). */
|
|
10349
|
+
kind;
|
|
10315
10350
|
constructor(message, details) {
|
|
10316
10351
|
super(message);
|
|
10317
10352
|
this.name = "ZipLimitError";
|
|
10318
10353
|
this.limit = details.limit;
|
|
10354
|
+
this.kind = details.kind;
|
|
10319
10355
|
}
|
|
10320
10356
|
};
|
|
10321
10357
|
var mib = (bytes) => Math.round(bytes / 1048576);
|
|
@@ -10338,7 +10374,7 @@ function resolveLimits(limits) {
|
|
|
10338
10374
|
maxEntryBytes: limits.maxEntryBytes ?? DEFAULT_ZIP_LIMITS.maxEntryBytes,
|
|
10339
10375
|
maxTotalBytes: limits.maxTotalBytes ?? DEFAULT_ZIP_LIMITS.maxTotalBytes,
|
|
10340
10376
|
label: limits.label ?? "ZIP",
|
|
10341
|
-
fail: (message, limit3) => create2 ? create2(message, { limit: limit3 }) : new ZipLimitError(message, { limit: limit3 })
|
|
10377
|
+
fail: (message, limit3, kind) => create2 ? create2(message, { limit: limit3, kind }) : new ZipLimitError(message, { limit: limit3, kind })
|
|
10342
10378
|
};
|
|
10343
10379
|
}
|
|
10344
10380
|
function inflateEntryGuarded(entry3, alreadyRead, limits) {
|
|
@@ -10361,13 +10397,18 @@ function inflateEntryGuarded(entry3, alreadyRead, limits) {
|
|
|
10361
10397
|
size3 += chunk.byteLength;
|
|
10362
10398
|
if (size3 > declared || size3 > r.maxEntryBytes)
|
|
10363
10399
|
return abort(
|
|
10364
|
-
r.fail(
|
|
10400
|
+
r.fail(
|
|
10401
|
+
`${r.label} part ${entry3.name} inflates past its declared size`,
|
|
10402
|
+
r.maxEntryBytes,
|
|
10403
|
+
size3 > declared ? "declaredSize" : "maxEntryBytes"
|
|
10404
|
+
)
|
|
10365
10405
|
);
|
|
10366
10406
|
if (alreadyRead + size3 > r.maxTotalBytes)
|
|
10367
10407
|
return abort(
|
|
10368
10408
|
r.fail(
|
|
10369
10409
|
`${r.label} package exceeds the ${mib(r.maxTotalBytes)} MiB uncompressed content limit`,
|
|
10370
|
-
r.maxTotalBytes
|
|
10410
|
+
r.maxTotalBytes,
|
|
10411
|
+
"maxTotalBytes"
|
|
10371
10412
|
)
|
|
10372
10413
|
);
|
|
10373
10414
|
chunks.push(chunk);
|
|
@@ -10400,26 +10441,29 @@ function guardZip(zip, limits = {}) {
|
|
|
10400
10441
|
if (entries.length > r.maxEntries)
|
|
10401
10442
|
throw r.fail(
|
|
10402
10443
|
`${r.label} package exceeds the ${r.maxEntries.toLocaleString("en-US")} part limit`,
|
|
10403
|
-
r.maxEntries
|
|
10444
|
+
r.maxEntries,
|
|
10445
|
+
"maxEntries"
|
|
10404
10446
|
);
|
|
10405
10447
|
let declared = 0;
|
|
10406
10448
|
for (const entry3 of entries) {
|
|
10407
10449
|
const original = entry3.unsafeOriginalName;
|
|
10408
10450
|
if (!isSafePartName(entry3.name) || original !== void 0 && !isSafePartName(original))
|
|
10409
|
-
throw r.fail(`${r.label} package has an unsafe part name`, r.maxEntries);
|
|
10451
|
+
throw r.fail(`${r.label} package has an unsafe part name`, r.maxEntries, "partName");
|
|
10410
10452
|
if (entry3.dir) continue;
|
|
10411
10453
|
const size3 = declaredEntrySize(entry3);
|
|
10412
10454
|
if (size3 > r.maxEntryBytes)
|
|
10413
10455
|
throw r.fail(
|
|
10414
10456
|
`${r.label} part ${entry3.name} exceeds the uncompressed part size limit`,
|
|
10415
|
-
r.maxEntryBytes
|
|
10457
|
+
r.maxEntryBytes,
|
|
10458
|
+
"maxEntryBytes"
|
|
10416
10459
|
);
|
|
10417
10460
|
declared += size3;
|
|
10418
10461
|
}
|
|
10419
10462
|
if (declared > r.maxTotalBytes)
|
|
10420
10463
|
throw r.fail(
|
|
10421
10464
|
`${r.label} package exceeds the ${mib(r.maxTotalBytes)} MiB uncompressed content limit`,
|
|
10422
|
-
r.maxTotalBytes
|
|
10465
|
+
r.maxTotalBytes,
|
|
10466
|
+
"maxTotalBytes"
|
|
10423
10467
|
);
|
|
10424
10468
|
const produced = /* @__PURE__ */ new Map();
|
|
10425
10469
|
let total = 0;
|
|
@@ -12288,10 +12332,69 @@ function mergeComments(legacy, threaded) {
|
|
|
12288
12332
|
(a2, b) => a2.address.row - b.address.row || a2.address.col - b.address.col
|
|
12289
12333
|
);
|
|
12290
12334
|
}
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
var
|
|
12294
|
-
|
|
12335
|
+
|
|
12336
|
+
// xlsx/read/limits.ts
|
|
12337
|
+
var DEFAULT_XLSX_LOAD_LIMITS = {
|
|
12338
|
+
maxInputBytes: 50 * 1024 * 1024,
|
|
12339
|
+
maxParts: 1e4,
|
|
12340
|
+
maxPartBytes: 200 * 1024 * 1024,
|
|
12341
|
+
maxTotalBytes: 300 * 1024 * 1024,
|
|
12342
|
+
maxXmlElements: 5e6
|
|
12343
|
+
};
|
|
12344
|
+
var WorkbookTooLargeError = class extends Error {
|
|
12345
|
+
code = "workbook-too-large";
|
|
12346
|
+
/** The limit that was exceeded, as named in {@link XlsxLoadLimits}. */
|
|
12347
|
+
limit;
|
|
12348
|
+
/** The value of that limit when the load failed. */
|
|
12349
|
+
maximum;
|
|
12350
|
+
constructor(message, limit3, maximum, options2) {
|
|
12351
|
+
super(message, options2);
|
|
12352
|
+
this.name = "WorkbookTooLargeError";
|
|
12353
|
+
this.limit = limit3;
|
|
12354
|
+
this.maximum = maximum;
|
|
12355
|
+
}
|
|
12356
|
+
};
|
|
12357
|
+
function resolveLoadLimits(limits = {}) {
|
|
12358
|
+
const resolved = { ...DEFAULT_XLSX_LOAD_LIMITS };
|
|
12359
|
+
for (const name3 of Object.keys(resolved)) {
|
|
12360
|
+
const value3 = limits[name3];
|
|
12361
|
+
if (value3 === void 0) continue;
|
|
12362
|
+
if (!Number.isFinite(value3) || value3 <= 0)
|
|
12363
|
+
throw new RangeError(`limits.${name3} must be a positive finite number`);
|
|
12364
|
+
resolved[name3] = value3;
|
|
12365
|
+
}
|
|
12366
|
+
return resolved;
|
|
12367
|
+
}
|
|
12368
|
+
var ZIP_LIMIT_NAMES = {
|
|
12369
|
+
maxInputBytes: "maxInputBytes",
|
|
12370
|
+
maxEntries: "maxParts",
|
|
12371
|
+
maxEntryBytes: "maxPartBytes",
|
|
12372
|
+
maxTotalBytes: "maxTotalBytes"
|
|
12373
|
+
};
|
|
12374
|
+
function zipLimitsFor(limits) {
|
|
12375
|
+
return {
|
|
12376
|
+
maxInputBytes: limits.maxInputBytes,
|
|
12377
|
+
maxEntries: limits.maxParts,
|
|
12378
|
+
maxEntryBytes: limits.maxPartBytes,
|
|
12379
|
+
maxTotalBytes: limits.maxTotalBytes,
|
|
12380
|
+
label: "XLSX",
|
|
12381
|
+
createError: (message, { limit: limit3, kind }) => {
|
|
12382
|
+
const name3 = ZIP_LIMIT_NAMES[kind];
|
|
12383
|
+
return name3 ? new WorkbookTooLargeError(message, name3, limit3) : new ZipLimitError(message, { limit: limit3, kind });
|
|
12384
|
+
}
|
|
12385
|
+
};
|
|
12386
|
+
}
|
|
12387
|
+
function parseDataXml(xml, label, maxXmlElements = DEFAULT_XLSX_LOAD_LIMITS.maxXmlElements) {
|
|
12388
|
+
try {
|
|
12389
|
+
return parseXml(xml, { label, limits: { maxNodes: maxXmlElements } });
|
|
12390
|
+
} catch (error) {
|
|
12391
|
+
if (error instanceof XmlLimitError && error.limit === "maxNodes")
|
|
12392
|
+
throw new WorkbookTooLargeError(error.message, "maxXmlElements", error.maximum, {
|
|
12393
|
+
cause: error
|
|
12394
|
+
});
|
|
12395
|
+
throw error;
|
|
12396
|
+
}
|
|
12397
|
+
}
|
|
12295
12398
|
var CONTENT_TYPES = {
|
|
12296
12399
|
workbook: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
|
|
12297
12400
|
workbookMacro: "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
|
|
@@ -12362,16 +12465,15 @@ var SourceIndex = class {
|
|
|
12362
12465
|
};
|
|
12363
12466
|
var mib2 = (bytes) => Math.round(bytes / 1048576);
|
|
12364
12467
|
async function readZipParts(input, limits = {}) {
|
|
12365
|
-
const
|
|
12366
|
-
const
|
|
12367
|
-
maxEntries: limits.maxParts ?? MAX_PARTS,
|
|
12368
|
-
maxEntryBytes: limits.maxPartBytes ?? MAX_PART_BYTES,
|
|
12369
|
-
maxTotalBytes: limits.maxTotalBytes ?? MAX_UNCOMPRESSED_BYTES,
|
|
12370
|
-
label: "XLSX"
|
|
12371
|
-
};
|
|
12468
|
+
const resolved = resolveLoadLimits(limits);
|
|
12469
|
+
const maxInput = resolved.maxInputBytes;
|
|
12372
12470
|
const bytes = input instanceof Uint8Array ? input : new Uint8Array(input);
|
|
12373
12471
|
if (bytes.byteLength > maxInput)
|
|
12374
|
-
throw new
|
|
12472
|
+
throw new WorkbookTooLargeError(
|
|
12473
|
+
`XLSX package exceeds the ${mib2(maxInput)} MiB compressed input limit`,
|
|
12474
|
+
"maxInputBytes",
|
|
12475
|
+
maxInput
|
|
12476
|
+
);
|
|
12375
12477
|
let loaded;
|
|
12376
12478
|
try {
|
|
12377
12479
|
loaded = await JSZip__default.default.loadAsync(bytes);
|
|
@@ -12381,7 +12483,7 @@ async function readZipParts(input, limits = {}) {
|
|
|
12381
12483
|
{ cause: error }
|
|
12382
12484
|
);
|
|
12383
12485
|
}
|
|
12384
|
-
const zip = guardZip(loaded,
|
|
12486
|
+
const zip = guardZip(loaded, zipLimitsFor(resolved));
|
|
12385
12487
|
const parts = /* @__PURE__ */ new Map();
|
|
12386
12488
|
for (const entry3 of Object.values(zip.files)) {
|
|
12387
12489
|
if (entry3.dir) continue;
|
|
@@ -12588,9 +12690,9 @@ function parseRichString(element2, palette) {
|
|
|
12588
12690
|
const text6 = parsed.map((run) => run.text).join("");
|
|
12589
12691
|
return { text: text6, runs: parsed };
|
|
12590
12692
|
}
|
|
12591
|
-
function parseSharedStrings(xml, palette) {
|
|
12693
|
+
function parseSharedStrings(xml, palette, maxXmlElements) {
|
|
12592
12694
|
if (!xml) return [];
|
|
12593
|
-
const root2 =
|
|
12695
|
+
const root2 = parseDataXml(xml, "XLSX shared strings", maxXmlElements).documentElement;
|
|
12594
12696
|
return xChildren(root2, "si").map((si) => parseRichString(si, palette));
|
|
12595
12697
|
}
|
|
12596
12698
|
|
|
@@ -17424,7 +17526,11 @@ function parseWorksheet(ctx, partName, name3, sheetId5) {
|
|
|
17424
17526
|
return sheet;
|
|
17425
17527
|
}
|
|
17426
17528
|
const split = splitSheetData(xml);
|
|
17427
|
-
const root2 =
|
|
17529
|
+
const root2 = parseDataXml(
|
|
17530
|
+
split?.xml ?? xml,
|
|
17531
|
+
"XLSX worksheet",
|
|
17532
|
+
ctx.maxXmlElements
|
|
17533
|
+
).documentElement;
|
|
17428
17534
|
const byName = /* @__PURE__ */ new Map();
|
|
17429
17535
|
const cfBlocks = [];
|
|
17430
17536
|
for (const node3 of elements(root2)) {
|
|
@@ -17498,8 +17604,9 @@ function liftPrintAreas(workbook) {
|
|
|
17498
17604
|
return false;
|
|
17499
17605
|
});
|
|
17500
17606
|
}
|
|
17501
|
-
async function loadXlsx(input) {
|
|
17502
|
-
const
|
|
17607
|
+
async function loadXlsx(input, options2 = {}) {
|
|
17608
|
+
const limits = resolveLoadLimits(options2.limits);
|
|
17609
|
+
const parts = await readZipParts(input, limits);
|
|
17503
17610
|
const source = new SourceIndex(parts);
|
|
17504
17611
|
const workbookPart = source.workbookPart();
|
|
17505
17612
|
if (!workbookPart) throw new Error("XLSX package has no workbook part (xl/workbook.xml)");
|
|
@@ -17520,7 +17627,8 @@ async function loadXlsx(input) {
|
|
|
17520
17627
|
source,
|
|
17521
17628
|
sharedStrings: parseSharedStrings(
|
|
17522
17629
|
stringsPart ? source.text(stringsPart) : void 0,
|
|
17523
|
-
styles.palette
|
|
17630
|
+
styles.palette,
|
|
17631
|
+
limits.maxXmlElements
|
|
17524
17632
|
),
|
|
17525
17633
|
xfMap: styles.xfMap,
|
|
17526
17634
|
date1904: book.date1904,
|
|
@@ -17528,7 +17636,8 @@ async function loadXlsx(input) {
|
|
|
17528
17636
|
dxfs: styles.dxfs,
|
|
17529
17637
|
persons: parsePersons(personsPart ? source.text(personsPart) : void 0),
|
|
17530
17638
|
dynamicCells: parseDynamicArrayMetadata(metadataPart ? source.text(metadataPart) : void 0),
|
|
17531
|
-
warn
|
|
17639
|
+
warn,
|
|
17640
|
+
maxXmlElements: limits.maxXmlElements
|
|
17532
17641
|
};
|
|
17533
17642
|
const rels = source.rels(workbookPart);
|
|
17534
17643
|
const sheets = book.sheets.map((entry3) => {
|
|
@@ -18011,14 +18120,24 @@ function formatAxisValue(value3, percent = false) {
|
|
|
18011
18120
|
return `${v < 0 ? "-" : ""}${grouped}${frac ? `.${frac}` : ""}`;
|
|
18012
18121
|
}
|
|
18013
18122
|
|
|
18123
|
+
// chart/extent.ts
|
|
18124
|
+
function extentOf(values) {
|
|
18125
|
+
let min = Infinity;
|
|
18126
|
+
let max = -Infinity;
|
|
18127
|
+
for (const value3 of values) {
|
|
18128
|
+
min = Math.min(min, value3);
|
|
18129
|
+
max = Math.max(max, value3);
|
|
18130
|
+
}
|
|
18131
|
+
return { min, max };
|
|
18132
|
+
}
|
|
18133
|
+
|
|
18014
18134
|
// chart/axis-range.ts
|
|
18015
18135
|
function computeLogValueRange(series, logBase) {
|
|
18016
18136
|
const allValues = series.flatMap((item) => item.values).filter((value3) => value3 !== null && Number.isFinite(value3) && value3 > 0);
|
|
18017
18137
|
if (allValues.length === 0) {
|
|
18018
18138
|
return { min: 1, max: logBase, span: 1, logScale: true, logBase };
|
|
18019
18139
|
}
|
|
18020
|
-
const dataMin =
|
|
18021
|
-
const dataMax = Math.max(...allValues);
|
|
18140
|
+
const { min: dataMin, max: dataMax } = extentOf(allValues);
|
|
18022
18141
|
const logMin = Math.floor(Math.log(dataMin) / Math.log(logBase));
|
|
18023
18142
|
const logMax = Math.ceil(Math.log(dataMax) / Math.log(logBase));
|
|
18024
18143
|
const min = logBase ** logMin;
|
|
@@ -18746,8 +18865,7 @@ function computeHistogramBins(values, options2, format5 = String) {
|
|
|
18746
18865
|
});
|
|
18747
18866
|
}
|
|
18748
18867
|
if (regular.length > 0) {
|
|
18749
|
-
const min =
|
|
18750
|
-
const max = Math.max(...regular.map((item) => item.value));
|
|
18868
|
+
const { min, max } = extentOf(regular.map((item) => item.value));
|
|
18751
18869
|
const requestedSize = options2.binSize && options2.binSize > 0 ? options2.binSize : void 0;
|
|
18752
18870
|
const requestedCount = options2.binCount && options2.binCount > 0 ? options2.binCount : void 0;
|
|
18753
18871
|
const start = requestedSize ? Math.floor(min / requestedSize) * requestedSize : min;
|
|
@@ -18875,8 +18993,9 @@ function waterfallView(chart, model2, ctx) {
|
|
|
18875
18993
|
colors: { increase: role(0), decrease: role(1), total: role(2) }
|
|
18876
18994
|
};
|
|
18877
18995
|
const ends = steps.flatMap((step2) => [step2.startValue, step2.endValue]);
|
|
18996
|
+
const range2 = extentOf(ends);
|
|
18878
18997
|
model2.valueAxis = {
|
|
18879
|
-
...ends.length ? niceScale(
|
|
18998
|
+
...ends.length ? niceScale(range2.min, range2.max) : niceScale(0, 1),
|
|
18880
18999
|
percent: false
|
|
18881
19000
|
};
|
|
18882
19001
|
const labels = model2.categories;
|
|
@@ -18992,7 +19111,8 @@ function chartSummaryView(chart, theme2, options2 = {}) {
|
|
|
18992
19111
|
s.xValues = s.values.map((_, k) => numeric5 ? toNumber(cats[k] ?? null) : k + 1);
|
|
18993
19112
|
});
|
|
18994
19113
|
const xs = series.flatMap((s) => s.xValues ?? []).filter((x) => x !== null);
|
|
18995
|
-
|
|
19114
|
+
const range2 = extentOf(xs);
|
|
19115
|
+
model2.xAxis = xs.length ? niceScale(range2.min, range2.max) : niceScale(0, 1);
|
|
18996
19116
|
}
|
|
18997
19117
|
if (type === "stock") model2.stock = stockView(chart.stock, ctx);
|
|
18998
19118
|
if (type === "bubble") bubbleView(chart, model2, ctx.evaluateRef);
|