documents.js 1.57.0 → 1.58.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 +38 -0
- package/dist/blr-types-CYYC3yYU.d.cts +35 -0
- package/dist/blr-types-CYYC3yYU.d.ts +35 -0
- package/dist/cell-CNHPsDEk.d.cts +17 -0
- package/dist/cell-CNHPsDEk.d.ts +17 -0
- package/dist/color-71eoF1Up.d.cts +2 -0
- package/dist/color-Bo228AY2.d.ts +2 -0
- package/dist/convert/codec.cjs +51 -0
- package/dist/convert/codec.d.cts +13 -0
- package/dist/convert/codec.d.ts +13 -0
- package/dist/convert/codec.js +42 -0
- package/dist/convert/convert.cjs +443 -0
- package/dist/convert/convert.d.cts +55 -0
- package/dist/convert/convert.d.ts +55 -0
- package/dist/convert/convert.js +419 -0
- package/dist/convert/local.cjs +393 -0
- package/dist/convert/local.d.cts +5 -0
- package/dist/convert/local.d.ts +5 -0
- package/dist/convert/local.js +392 -0
- package/dist/convert/port.cjs +0 -0
- package/dist/convert/port.d.cts +34 -0
- package/dist/convert/port.d.ts +34 -0
- package/dist/convert/port.js +0 -0
- package/dist/edit/docx/content.cjs +71 -0
- package/dist/edit/docx/content.d.cts +6 -0
- package/dist/edit/docx/content.d.ts +6 -0
- package/dist/edit/docx/content.js +70 -0
- package/dist/edit/docx/editor.cjs +116 -0
- package/dist/edit/docx/editor.d.cts +23 -0
- package/dist/edit/docx/editor.d.ts +23 -0
- package/dist/edit/docx/editor.js +113 -0
- package/dist/edit/docx/image.cjs +74 -0
- package/dist/edit/docx/image.d.cts +2 -0
- package/dist/edit/docx/image.d.ts +2 -0
- package/dist/edit/docx/image.js +72 -0
- package/dist/edit/docx/paragraph.cjs +132 -0
- package/dist/edit/docx/paragraph.d.cts +40 -0
- package/dist/edit/docx/paragraph.d.ts +40 -0
- package/dist/edit/docx/paragraph.js +130 -0
- package/dist/edit/docx/props.cjs +132 -0
- package/dist/edit/docx/props.d.cts +20 -0
- package/dist/edit/docx/props.d.ts +20 -0
- package/dist/edit/docx/props.js +117 -0
- package/dist/edit/docx/run.cjs +143 -0
- package/dist/edit/docx/run.d.cts +2 -0
- package/dist/edit/docx/run.d.ts +2 -0
- package/dist/edit/docx/run.js +141 -0
- package/dist/edit/docx/scaffold.cjs +97 -0
- package/dist/edit/docx/scaffold.d.cts +5 -0
- package/dist/edit/docx/scaffold.d.ts +5 -0
- package/dist/edit/docx/scaffold.js +96 -0
- package/dist/edit/docx/table.cjs +99 -0
- package/dist/edit/docx/table.d.cts +34 -0
- package/dist/edit/docx/table.d.ts +34 -0
- package/dist/edit/docx/table.js +95 -0
- package/dist/edit/odg/content.cjs +65 -0
- package/dist/edit/odg/content.d.cts +6 -0
- package/dist/edit/odg/content.d.ts +6 -0
- package/dist/edit/odg/content.js +64 -0
- package/dist/edit/odg/editor.cjs +96 -0
- package/dist/edit/odg/editor.d.cts +19 -0
- package/dist/edit/odg/editor.d.ts +19 -0
- package/dist/edit/odg/editor.js +93 -0
- package/dist/edit/odg/page.cjs +70 -0
- package/dist/edit/odg/page.d.cts +34 -0
- package/dist/edit/odg/page.d.ts +34 -0
- package/dist/edit/odg/page.js +69 -0
- package/dist/edit/odg/scaffold.cjs +106 -0
- package/dist/edit/odg/scaffold.d.cts +7 -0
- package/dist/edit/odg/scaffold.d.ts +7 -0
- package/dist/edit/odg/scaffold.js +103 -0
- package/dist/edit/odg/style.cjs +83 -0
- package/dist/edit/odg/style.d.cts +14 -0
- package/dist/edit/odg/style.d.ts +14 -0
- package/dist/edit/odg/style.js +78 -0
- package/dist/edit/odg/svg-path.cjs +30 -0
- package/dist/edit/odg/svg-path.d.cts +7 -0
- package/dist/edit/odg/svg-path.d.ts +7 -0
- package/dist/edit/odg/svg-path.js +27 -0
- package/dist/edit/odg/vector.cjs +208 -0
- package/dist/edit/odg/vector.d.cts +2 -0
- package/dist/edit/odg/vector.d.ts +2 -0
- package/dist/edit/odg/vector.js +201 -0
- package/dist/edit/odp/content.cjs +42 -0
- package/dist/edit/odp/content.d.cts +6 -0
- package/dist/edit/odp/content.d.ts +6 -0
- package/dist/edit/odp/content.js +41 -0
- package/dist/edit/odp/editor.cjs +113 -0
- package/dist/edit/odp/editor.d.cts +20 -0
- package/dist/edit/odp/editor.d.ts +20 -0
- package/dist/edit/odp/editor.js +110 -0
- package/dist/edit/odp/image.cjs +10 -0
- package/dist/edit/odp/image.d.cts +2 -0
- package/dist/edit/odp/image.d.ts +2 -0
- package/dist/edit/odp/image.js +9 -0
- package/dist/edit/odp/scaffold.cjs +108 -0
- package/dist/edit/odp/scaffold.d.cts +7 -0
- package/dist/edit/odp/scaffold.d.ts +7 -0
- package/dist/edit/odp/scaffold.js +105 -0
- package/dist/edit/odp/shape.cjs +133 -0
- package/dist/edit/odp/shape.d.cts +2 -0
- package/dist/edit/odp/shape.d.ts +2 -0
- package/dist/edit/odp/shape.js +130 -0
- package/dist/edit/odp/slide.cjs +80 -0
- package/dist/edit/odp/slide.d.cts +31 -0
- package/dist/edit/odp/slide.d.ts +31 -0
- package/dist/edit/odp/slide.js +79 -0
- package/dist/edit/ods/address.cjs +108 -0
- package/dist/edit/ods/address.d.cts +15 -0
- package/dist/edit/ods/address.d.ts +15 -0
- package/dist/edit/ods/address.js +97 -0
- package/dist/edit/ods/cell.cjs +177 -0
- package/dist/edit/ods/cell.d.cts +2 -0
- package/dist/edit/ods/cell.d.ts +2 -0
- package/dist/edit/ods/cell.js +176 -0
- package/dist/edit/ods/content.cjs +26 -0
- package/dist/edit/ods/content.d.cts +6 -0
- package/dist/edit/ods/content.d.ts +6 -0
- package/dist/edit/ods/content.js +25 -0
- package/dist/edit/ods/editor.cjs +84 -0
- package/dist/edit/ods/editor.d.cts +17 -0
- package/dist/edit/ods/editor.d.ts +17 -0
- package/dist/edit/ods/editor.js +81 -0
- package/dist/edit/ods/print-settings.cjs +90 -0
- package/dist/edit/ods/print-settings.d.cts +7 -0
- package/dist/edit/ods/print-settings.d.ts +7 -0
- package/dist/edit/ods/print-settings.js +88 -0
- package/dist/edit/ods/scaffold.cjs +129 -0
- package/dist/edit/ods/scaffold.d.cts +9 -0
- package/dist/edit/ods/scaffold.d.ts +9 -0
- package/dist/edit/ods/scaffold.js +124 -0
- package/dist/edit/ods/sheet.cjs +70 -0
- package/dist/edit/ods/sheet.d.cts +22 -0
- package/dist/edit/ods/sheet.d.ts +22 -0
- package/dist/edit/ods/sheet.js +69 -0
- package/dist/edit/odt/automatic-styles.cjs +49 -0
- package/dist/edit/odt/automatic-styles.d.cts +8 -0
- package/dist/edit/odt/automatic-styles.d.ts +8 -0
- package/dist/edit/odt/automatic-styles.js +45 -0
- package/dist/edit/odt/content.cjs +110 -0
- package/dist/edit/odt/content.d.cts +9 -0
- package/dist/edit/odt/content.d.ts +9 -0
- package/dist/edit/odt/content.js +108 -0
- package/dist/edit/odt/editor.cjs +98 -0
- package/dist/edit/odt/editor.d.cts +25 -0
- package/dist/edit/odt/editor.d.ts +25 -0
- package/dist/edit/odt/editor.js +95 -0
- package/dist/edit/odt/list.cjs +82 -0
- package/dist/edit/odt/list.d.cts +2 -0
- package/dist/edit/odt/list.d.ts +2 -0
- package/dist/edit/odt/list.js +79 -0
- package/dist/edit/odt/paragraph.cjs +84 -0
- package/dist/edit/odt/paragraph.d.cts +2 -0
- package/dist/edit/odt/paragraph.d.ts +2 -0
- package/dist/edit/odt/paragraph.js +82 -0
- package/dist/edit/odt/props.cjs +26 -0
- package/dist/edit/odt/props.d.cts +7 -0
- package/dist/edit/odt/props.d.ts +7 -0
- package/dist/edit/odt/props.js +23 -0
- package/dist/edit/odt/run.cjs +82 -0
- package/dist/edit/odt/run.d.cts +2 -0
- package/dist/edit/odt/run.d.ts +2 -0
- package/dist/edit/odt/run.js +80 -0
- package/dist/edit/odt/scaffold.cjs +109 -0
- package/dist/edit/odt/scaffold.d.cts +5 -0
- package/dist/edit/odt/scaffold.d.ts +5 -0
- package/dist/edit/odt/scaffold.js +108 -0
- package/dist/edit/odt/table.cjs +123 -0
- package/dist/edit/odt/table.d.cts +37 -0
- package/dist/edit/odt/table.d.ts +37 -0
- package/dist/edit/odt/table.js +119 -0
- package/dist/edit/pptx/content.cjs +49 -0
- package/dist/edit/pptx/content.d.cts +6 -0
- package/dist/edit/pptx/content.d.ts +6 -0
- package/dist/edit/pptx/content.js +48 -0
- package/dist/edit/pptx/editor.cjs +187 -0
- package/dist/edit/pptx/editor.d.cts +20 -0
- package/dist/edit/pptx/editor.d.ts +20 -0
- package/dist/edit/pptx/editor.js +184 -0
- package/dist/edit/pptx/image.cjs +27 -0
- package/dist/edit/pptx/image.d.cts +2 -0
- package/dist/edit/pptx/image.d.ts +2 -0
- package/dist/edit/pptx/image.js +26 -0
- package/dist/edit/pptx/scaffold.cjs +292 -0
- package/dist/edit/pptx/scaffold.d.cts +13 -0
- package/dist/edit/pptx/scaffold.d.ts +13 -0
- package/dist/edit/pptx/scaffold.js +283 -0
- package/dist/edit/pptx/shape.cjs +182 -0
- package/dist/edit/pptx/shape.d.cts +2 -0
- package/dist/edit/pptx/shape.d.ts +2 -0
- package/dist/edit/pptx/shape.js +179 -0
- package/dist/edit/pptx/slide.cjs +146 -0
- package/dist/edit/pptx/slide.d.cts +33 -0
- package/dist/edit/pptx/slide.d.ts +33 -0
- package/dist/edit/pptx/slide.js +145 -0
- package/dist/firebird/backup.cjs +150 -0
- package/dist/firebird/backup.d.cts +21 -0
- package/dist/firebird/backup.d.ts +21 -0
- package/dist/firebird/backup.js +145 -0
- package/dist/firebird/blr-types.cjs +118 -0
- package/dist/firebird/blr-types.d.cts +2 -0
- package/dist/firebird/blr-types.d.ts +2 -0
- package/dist/firebird/blr-types.js +90 -0
- package/dist/firebird/data.cjs +231 -0
- package/dist/firebird/data.d.cts +17 -0
- package/dist/firebird/data.d.ts +17 -0
- package/dist/firebird/data.js +228 -0
- package/dist/firebird/date.cjs +63 -0
- package/dist/firebird/date.d.cts +17 -0
- package/dist/firebird/date.d.ts +17 -0
- package/dist/firebird/date.js +58 -0
- package/dist/firebird/reader.cjs +157 -0
- package/dist/firebird/reader.d.cts +2 -0
- package/dist/firebird/reader.d.ts +2 -0
- package/dist/firebird/reader.js +154 -0
- package/dist/firebird/schema.cjs +91 -0
- package/dist/firebird/schema.d.cts +2 -0
- package/dist/firebird/schema.d.ts +2 -0
- package/dist/firebird/schema.js +89 -0
- package/dist/geometry-DvwdrIij.d.cts +5 -0
- package/dist/geometry-DvwdrIij.d.ts +5 -0
- package/dist/hsqldb/cache.cjs +88 -0
- package/dist/hsqldb/cache.d.cts +13 -0
- package/dist/hsqldb/cache.d.ts +13 -0
- package/dist/hsqldb/cache.js +84 -0
- package/dist/hsqldb/rowformat.cjs +222 -0
- package/dist/hsqldb/rowformat.d.cts +21 -0
- package/dist/hsqldb/rowformat.d.ts +21 -0
- package/dist/hsqldb/rowformat.js +218 -0
- package/dist/hsqldb/script.cjs +450 -0
- package/dist/hsqldb/script.d.cts +19 -0
- package/dist/hsqldb/script.d.ts +19 -0
- package/dist/hsqldb/script.js +447 -0
- package/dist/image-B-xQWYYS.d.ts +16 -0
- package/dist/image-BZDy72Jb.d.cts +16 -0
- package/dist/image-BfRLAD9B.d.cts +18 -0
- package/dist/image-BfRLAD9B.d.ts +18 -0
- package/dist/image-CeqwL-Qs.d.ts +14 -0
- package/dist/image-DWX6cNOD.d.cts +14 -0
- package/dist/index.cjs +201 -10863
- package/dist/index.d.cts +71 -1406
- package/dist/index.d.ts +71 -1406
- package/dist/index.js +67 -10727
- package/dist/layout/drawing.cjs +117 -0
- package/dist/layout/drawing.d.cts +13 -0
- package/dist/layout/drawing.d.ts +13 -0
- package/dist/layout/drawing.js +116 -0
- package/dist/layout/engine.cjs +216 -0
- package/dist/layout/engine.d.cts +19 -0
- package/dist/layout/engine.d.ts +19 -0
- package/dist/layout/engine.js +215 -0
- package/dist/layout/reconstruct.cjs +809 -0
- package/dist/layout/reconstruct.d.cts +12 -0
- package/dist/layout/reconstruct.d.ts +12 -0
- package/dist/layout/reconstruct.js +805 -0
- package/dist/layout/shared.cjs +104 -0
- package/dist/layout/shared.d.cts +15 -0
- package/dist/layout/shared.d.ts +15 -0
- package/dist/layout/shared.js +96 -0
- package/dist/layout/sheets.cjs +413 -0
- package/dist/layout/sheets.d.cts +14 -0
- package/dist/layout/sheets.d.ts +14 -0
- package/dist/layout/sheets.js +414 -0
- package/dist/layout/slides.cjs +194 -0
- package/dist/layout/slides.d.cts +25 -0
- package/dist/layout/slides.d.ts +25 -0
- package/dist/layout/slides.js +192 -0
- package/dist/list-BuBM9rwQ.d.cts +24 -0
- package/dist/list-CvKxhy3y.d.ts +24 -0
- package/dist/mathml/compose.cjs +53 -0
- package/dist/mathml/compose.d.cts +8 -0
- package/dist/mathml/compose.d.ts +8 -0
- package/dist/mathml/compose.js +49 -0
- package/dist/mathml/layout-types.cjs +0 -0
- package/dist/mathml/layout-types.d.cts +50 -0
- package/dist/mathml/layout-types.d.ts +50 -0
- package/dist/mathml/layout-types.js +0 -0
- package/dist/mathml/layout.cjs +373 -0
- package/dist/mathml/layout.d.cts +24 -0
- package/dist/mathml/layout.d.ts +24 -0
- package/dist/mathml/layout.js +371 -0
- package/dist/mathml/length.cjs +41 -0
- package/dist/mathml/length.d.cts +4 -0
- package/dist/mathml/length.d.ts +4 -0
- package/dist/mathml/length.js +40 -0
- package/dist/mathml/metrics.cjs +0 -0
- package/dist/mathml/metrics.d.cts +44 -0
- package/dist/mathml/metrics.d.ts +44 -0
- package/dist/mathml/metrics.js +0 -0
- package/dist/mathml/nodes.cjs +39 -0
- package/dist/mathml/nodes.d.cts +2 -0
- package/dist/mathml/nodes.d.ts +2 -0
- package/dist/mathml/nodes.js +32 -0
- package/dist/mathml/operators.cjs +189 -0
- package/dist/mathml/operators.d.cts +13 -0
- package/dist/mathml/operators.d.ts +13 -0
- package/dist/mathml/operators.js +188 -0
- package/dist/mathml/radical.cjs +46 -0
- package/dist/mathml/radical.d.cts +10 -0
- package/dist/mathml/radical.d.ts +10 -0
- package/dist/mathml/radical.js +45 -0
- package/dist/mathml/variant.cjs +1160 -0
- package/dist/mathml/variant.d.cts +7 -0
- package/dist/mathml/variant.d.ts +7 -0
- package/dist/mathml/variant.js +1157 -0
- package/dist/model/bytes.cjs +88 -0
- package/dist/model/bytes.d.cts +12 -0
- package/dist/model/bytes.d.ts +12 -0
- package/dist/model/bytes.js +80 -0
- package/dist/model/color.cjs +26 -0
- package/dist/model/color.d.cts +2 -0
- package/dist/model/color.d.ts +2 -0
- package/dist/model/color.js +2 -0
- package/dist/model/content.cjs +34 -0
- package/dist/model/content.d.cts +362 -0
- package/dist/model/content.d.ts +362 -0
- package/dist/model/content.js +32 -0
- package/dist/model/formula.cjs +0 -0
- package/dist/model/formula.d.cts +8 -0
- package/dist/model/formula.d.ts +8 -0
- package/dist/model/formula.js +0 -0
- package/dist/model/geometry.cjs +55 -0
- package/dist/model/geometry.d.cts +2 -0
- package/dist/model/geometry.d.ts +2 -0
- package/dist/model/geometry.js +12 -0
- package/dist/model/style.cjs +20 -0
- package/dist/model/style.d.cts +2 -0
- package/dist/model/style.d.ts +2 -0
- package/dist/model/style.js +2 -0
- package/dist/model/units.cjs +55 -0
- package/dist/model/units.d.cts +20 -0
- package/dist/model/units.d.ts +20 -0
- package/dist/model/units.js +38 -0
- package/dist/nodes-pArN9ilm.d.cts +27 -0
- package/dist/nodes-pArN9ilm.d.ts +27 -0
- package/dist/odb/csv.cjs +48 -0
- package/dist/odb/csv.d.cts +14 -0
- package/dist/odb/csv.d.ts +14 -0
- package/dist/odb/csv.js +45 -0
- package/dist/odb/read.cjs +87 -0
- package/dist/odb/read.d.cts +15 -0
- package/dist/odb/read.d.ts +15 -0
- package/dist/odb/read.js +85 -0
- package/dist/odb/spreadsheet.cjs +68 -0
- package/dist/odb/spreadsheet.d.cts +6 -0
- package/dist/odb/spreadsheet.d.ts +6 -0
- package/dist/odb/spreadsheet.js +67 -0
- package/dist/odf/formula/detect.cjs +29 -0
- package/dist/odf/formula/detect.d.cts +12 -0
- package/dist/odf/formula/detect.d.ts +12 -0
- package/dist/odf/formula/detect.js +28 -0
- package/dist/odf/formula/placeholder.cjs +37 -0
- package/dist/odf/formula/placeholder.d.cts +14 -0
- package/dist/odf/formula/placeholder.d.ts +14 -0
- package/dist/odf/formula/placeholder.js +36 -0
- package/dist/odf/formula/read.cjs +32 -0
- package/dist/odf/formula/read.d.cts +11 -0
- package/dist/odf/formula/read.d.ts +11 -0
- package/dist/odf/formula/read.js +30 -0
- package/dist/odf/odg/read.cjs +15 -0
- package/dist/odf/odg/read.d.cts +6 -0
- package/dist/odf/odg/read.d.ts +6 -0
- package/dist/odf/odg/read.js +14 -0
- package/dist/odf/odp/read.cjs +45 -0
- package/dist/odf/odp/read.d.cts +11 -0
- package/dist/odf/odp/read.d.ts +11 -0
- package/dist/odf/odp/read.js +44 -0
- package/dist/odf/ods/read.cjs +15 -0
- package/dist/odf/ods/read.d.cts +6 -0
- package/dist/odf/ods/read.d.ts +6 -0
- package/dist/odf/ods/read.js +14 -0
- package/dist/odf/odt/read.cjs +43 -0
- package/dist/odf/odt/read.d.cts +11 -0
- package/dist/odf/odt/read.d.ts +11 -0
- package/dist/odf/odt/read.js +42 -0
- package/dist/odf-package/manifest.cjs +62 -0
- package/dist/odf-package/manifest.d.cts +2 -0
- package/dist/odf-package/manifest.d.ts +2 -0
- package/dist/odf-package/manifest.js +2 -0
- package/dist/odf-package/media.cjs +34 -0
- package/dist/odf-package/media.d.cts +8 -0
- package/dist/odf-package/media.d.ts +8 -0
- package/dist/odf-package/media.js +34 -0
- package/dist/ooxml/docx/read.cjs +15 -0
- package/dist/ooxml/docx/read.d.cts +6 -0
- package/dist/ooxml/docx/read.d.ts +6 -0
- package/dist/ooxml/docx/read.js +14 -0
- package/dist/ooxml/pptx/read.cjs +15 -0
- package/dist/ooxml/pptx/read.d.cts +6 -0
- package/dist/ooxml/pptx/read.d.ts +6 -0
- package/dist/ooxml/pptx/read.js +14 -0
- package/dist/opc/content-types.cjs +47 -0
- package/dist/opc/content-types.d.cts +7 -0
- package/dist/opc/content-types.d.ts +7 -0
- package/dist/opc/content-types.js +44 -0
- package/dist/opc/media.cjs +45 -0
- package/dist/opc/media.d.cts +10 -0
- package/dist/opc/media.d.ts +10 -0
- package/dist/opc/media.js +44 -0
- package/dist/opc/paths.cjs +28 -0
- package/dist/opc/paths.d.cts +5 -0
- package/dist/opc/paths.d.ts +5 -0
- package/dist/opc/paths.js +26 -0
- package/dist/opc/rels.cjs +47 -0
- package/dist/opc/rels.d.cts +10 -0
- package/dist/opc/rels.d.ts +10 -0
- package/dist/opc/rels.js +46 -0
- package/dist/paragraph-BXbXKPy3.d.cts +30 -0
- package/dist/paragraph-CoUi_88j.d.ts +30 -0
- package/dist/ports/abort.cjs +7 -0
- package/dist/ports/abort.d.cts +4 -0
- package/dist/ports/abort.d.ts +4 -0
- package/dist/ports/abort.js +6 -0
- package/dist/ports/clock.cjs +9 -0
- package/dist/ports/clock.d.cts +8 -0
- package/dist/ports/clock.d.ts +8 -0
- package/dist/ports/clock.js +7 -0
- package/dist/reader-DP0Mbaj4.d.cts +41 -0
- package/dist/reader-DP0Mbaj4.d.ts +41 -0
- package/dist/run-B3GNScJH.d.cts +38 -0
- package/dist/run-CJfh8rv3.d.ts +38 -0
- package/dist/run-D2rTWHbt.d.ts +38 -0
- package/dist/run-F8JN7Vy4.d.cts +38 -0
- package/dist/schema-Acco3Ezi.d.cts +22 -0
- package/dist/schema-VkAA6pF5.d.ts +22 -0
- package/dist/shape-BUfjw5eZ.d.cts +35 -0
- package/dist/shape-BfN3m52m.d.ts +30 -0
- package/dist/shape-CN2ycxOo.d.cts +30 -0
- package/dist/shape-CTkl6kt8.d.ts +35 -0
- package/dist/style-DkamR3aY.d.cts +2 -0
- package/dist/style-DkamR3aY.d.ts +2 -0
- package/dist/vector-ClohqsOe.d.cts +76 -0
- package/dist/vector-ClohqsOe.d.ts +76 -0
- package/dist/xml/edit.cjs +65 -0
- package/dist/xml/edit.d.cts +12 -0
- package/dist/xml/edit.d.ts +12 -0
- package/dist/xml/edit.js +57 -0
- package/dist/xml/entities.cjs +12 -0
- package/dist/xml/entities.d.cts +5 -0
- package/dist/xml/entities.d.ts +5 -0
- package/dist/xml/entities.js +10 -0
- package/dist/xml/fragment.cjs +22 -0
- package/dist/xml/fragment.d.cts +6 -0
- package/dist/xml/fragment.d.ts +6 -0
- package/dist/xml/fragment.js +20 -0
- package/dist/xml/odf-text.cjs +53 -0
- package/dist/xml/odf-text.d.cts +6 -0
- package/dist/xml/odf-text.d.ts +6 -0
- package/dist/xml/odf-text.js +51 -0
- package/dist/xml/query.cjs +33 -0
- package/dist/xml/query.d.cts +12 -0
- package/dist/xml/query.d.ts +12 -0
- package/dist/xml/query.js +29 -0
- package/package.json +9 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let ooxml_js = require("ooxml.js");
|
|
3
|
+
let pdf_codec = require("pdf-codec");
|
|
4
|
+
let document_schema_js = require("document-schema.js");
|
|
5
|
+
//#region src/layout/shared.ts
|
|
6
|
+
const NOMINAL_TEXT_SIZE_PT = 18;
|
|
7
|
+
const FALLBACK_ROW_HEIGHT_PT = 20;
|
|
8
|
+
function runFont(run) {
|
|
9
|
+
return {
|
|
10
|
+
family: run.fontFamily ?? document_schema_js.DEFAULT_LAYOUT_FONT.family,
|
|
11
|
+
weight: run.bold === true ? "bold" : "normal",
|
|
12
|
+
style: run.italic === true ? "italic" : "normal"
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function toStyledRuns(runs, fontScale = 1) {
|
|
16
|
+
return runs.map((run) => ({
|
|
17
|
+
text: run.text,
|
|
18
|
+
font: runFont(run),
|
|
19
|
+
sizePt: (run.sizePt ?? 18) * fontScale,
|
|
20
|
+
color: run.color ?? document_schema_js.COLOR_BLACK,
|
|
21
|
+
underline: run.underline,
|
|
22
|
+
hyperlink: run.hyperlink,
|
|
23
|
+
sourcePath: run.sourcePath
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
function effectiveStyledRuns(runs, fontScale = 1) {
|
|
27
|
+
const styled = toStyledRuns(runs, fontScale);
|
|
28
|
+
return styled.length > 0 ? styled : [{
|
|
29
|
+
text: "",
|
|
30
|
+
font: document_schema_js.DEFAULT_LAYOUT_FONT,
|
|
31
|
+
sizePt: 18 * fontScale,
|
|
32
|
+
color: document_schema_js.COLOR_BLACK
|
|
33
|
+
}];
|
|
34
|
+
}
|
|
35
|
+
function lineNaturalHeightPt(line, measurer, fallback) {
|
|
36
|
+
if (line.fragments.length === 0) return measurer.lineHeightAtSize(fallback.font, fallback.sizePt);
|
|
37
|
+
let max = 0;
|
|
38
|
+
for (const fragment of line.fragments) max = Math.max(max, measurer.lineHeightAtSize(fragment.font, fragment.sizePt));
|
|
39
|
+
return max;
|
|
40
|
+
}
|
|
41
|
+
function alignmentOffsetPt(alignment, contentWidthPt, lineWidthPt) {
|
|
42
|
+
if (alignment === "center") return Math.max(0, (contentWidthPt - lineWidthPt) / 2);
|
|
43
|
+
if (alignment === "right") return Math.max(0, contentWidthPt - lineWidthPt);
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
function decodeImageDimensions(format, bytes) {
|
|
47
|
+
if (format === "jpeg") {
|
|
48
|
+
const info = (0, pdf_codec.readJpegInfo)(bytes);
|
|
49
|
+
return {
|
|
50
|
+
widthPx: info.width,
|
|
51
|
+
heightPx: info.height
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const raw = (0, pdf_codec.decodePng)(bytes);
|
|
55
|
+
return {
|
|
56
|
+
widthPx: raw.width,
|
|
57
|
+
heightPx: raw.height
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function registerImage(block, images) {
|
|
61
|
+
const bytes = (0, ooxml_js.base64ToBytes)(block.base64);
|
|
62
|
+
const imageId = `img${(0, pdf_codec.crc32)(bytes).toString(16)}`;
|
|
63
|
+
if (!(imageId in images)) {
|
|
64
|
+
const { widthPx, heightPx } = decodeImageDimensions(block.format, bytes);
|
|
65
|
+
images[imageId] = {
|
|
66
|
+
format: block.format,
|
|
67
|
+
base64: block.base64,
|
|
68
|
+
widthPx,
|
|
69
|
+
heightPx
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return imageId;
|
|
73
|
+
}
|
|
74
|
+
function sumColumnWidthsPt(columnWidthsPt, startIndex, span) {
|
|
75
|
+
let sum = 0;
|
|
76
|
+
for (let i = startIndex; i < startIndex + span && i < columnWidthsPt.length; i++) sum += columnWidthsPt[i] ?? 0;
|
|
77
|
+
return sum;
|
|
78
|
+
}
|
|
79
|
+
function estimateRowHeightPt(row, measurer, columnWidthsPt, scale) {
|
|
80
|
+
let max = FALLBACK_ROW_HEIGHT_PT;
|
|
81
|
+
let colIndex = 0;
|
|
82
|
+
for (const cell of row.cells) {
|
|
83
|
+
const span = cell.colSpan ?? 1;
|
|
84
|
+
const cellWidthPt = sumColumnWidthsPt(columnWidthsPt, colIndex, span) * scale;
|
|
85
|
+
for (const block of cell.blocks) {
|
|
86
|
+
if (block.kind !== "paragraph") continue;
|
|
87
|
+
const runs = effectiveStyledRuns(block.runs);
|
|
88
|
+
const lines = (0, pdf_codec.wrapRunsToWidth)(runs, measurer, cellWidthPt);
|
|
89
|
+
for (const line of lines) max = Math.max(max, lineNaturalHeightPt(line, measurer, runs[0]));
|
|
90
|
+
}
|
|
91
|
+
colIndex += span;
|
|
92
|
+
}
|
|
93
|
+
return max;
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
exports.NOMINAL_TEXT_SIZE_PT = NOMINAL_TEXT_SIZE_PT;
|
|
97
|
+
exports.alignmentOffsetPt = alignmentOffsetPt;
|
|
98
|
+
exports.effectiveStyledRuns = effectiveStyledRuns;
|
|
99
|
+
exports.estimateRowHeightPt = estimateRowHeightPt;
|
|
100
|
+
exports.lineNaturalHeightPt = lineNaturalHeightPt;
|
|
101
|
+
exports.registerImage = registerImage;
|
|
102
|
+
exports.runFont = runFont;
|
|
103
|
+
exports.sumColumnWidthsPt = sumColumnWidthsPt;
|
|
104
|
+
exports.toStyledRuns = toStyledRuns;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { i as LayoutFont, t as Alignment } from "../style-DkamR3aY.cjs";
|
|
2
|
+
import { ContentImageBlock, ContentRun, ContentTableRow, LayoutImageAsset } from "document-schema.js";
|
|
3
|
+
import { StyledRun, TextMeasurer, WrappedLine } from "pdf-codec";
|
|
4
|
+
//#region src/layout/shared.d.ts
|
|
5
|
+
declare const NOMINAL_TEXT_SIZE_PT = 18;
|
|
6
|
+
declare function runFont(run: ContentRun): LayoutFont;
|
|
7
|
+
declare function toStyledRuns(runs: readonly ContentRun[], fontScale?: number): StyledRun[];
|
|
8
|
+
declare function effectiveStyledRuns(runs: readonly ContentRun[], fontScale?: number): StyledRun[];
|
|
9
|
+
declare function lineNaturalHeightPt(line: WrappedLine, measurer: TextMeasurer, fallback: StyledRun): number;
|
|
10
|
+
declare function alignmentOffsetPt(alignment: Alignment | undefined, contentWidthPt: number, lineWidthPt: number): number;
|
|
11
|
+
declare function registerImage(block: ContentImageBlock, images: Record<string, LayoutImageAsset>): string;
|
|
12
|
+
declare function sumColumnWidthsPt(columnWidthsPt: readonly number[], startIndex: number, span: number): number;
|
|
13
|
+
declare function estimateRowHeightPt(row: ContentTableRow, measurer: TextMeasurer, columnWidthsPt: readonly number[], scale: number): number;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { NOMINAL_TEXT_SIZE_PT, alignmentOffsetPt, effectiveStyledRuns, estimateRowHeightPt, lineNaturalHeightPt, registerImage, runFont, sumColumnWidthsPt, toStyledRuns };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { i as LayoutFont, t as Alignment } from "../style-DkamR3aY.js";
|
|
2
|
+
import { ContentImageBlock, ContentRun, ContentTableRow, LayoutImageAsset } from "document-schema.js";
|
|
3
|
+
import { StyledRun, TextMeasurer, WrappedLine } from "pdf-codec";
|
|
4
|
+
//#region src/layout/shared.d.ts
|
|
5
|
+
declare const NOMINAL_TEXT_SIZE_PT = 18;
|
|
6
|
+
declare function runFont(run: ContentRun): LayoutFont;
|
|
7
|
+
declare function toStyledRuns(runs: readonly ContentRun[], fontScale?: number): StyledRun[];
|
|
8
|
+
declare function effectiveStyledRuns(runs: readonly ContentRun[], fontScale?: number): StyledRun[];
|
|
9
|
+
declare function lineNaturalHeightPt(line: WrappedLine, measurer: TextMeasurer, fallback: StyledRun): number;
|
|
10
|
+
declare function alignmentOffsetPt(alignment: Alignment | undefined, contentWidthPt: number, lineWidthPt: number): number;
|
|
11
|
+
declare function registerImage(block: ContentImageBlock, images: Record<string, LayoutImageAsset>): string;
|
|
12
|
+
declare function sumColumnWidthsPt(columnWidthsPt: readonly number[], startIndex: number, span: number): number;
|
|
13
|
+
declare function estimateRowHeightPt(row: ContentTableRow, measurer: TextMeasurer, columnWidthsPt: readonly number[], scale: number): number;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { NOMINAL_TEXT_SIZE_PT, alignmentOffsetPt, effectiveStyledRuns, estimateRowHeightPt, lineNaturalHeightPt, registerImage, runFont, sumColumnWidthsPt, toStyledRuns };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { COLOR_BLACK } from "../model/color.js";
|
|
2
|
+
import { DEFAULT_LAYOUT_FONT } from "../model/style.js";
|
|
3
|
+
import { base64ToBytes } from "ooxml.js";
|
|
4
|
+
import { crc32, decodePng, readJpegInfo, wrapRunsToWidth } from "pdf-codec";
|
|
5
|
+
//#region src/layout/shared.ts
|
|
6
|
+
const NOMINAL_TEXT_SIZE_PT = 18;
|
|
7
|
+
const FALLBACK_ROW_HEIGHT_PT = 20;
|
|
8
|
+
function runFont(run) {
|
|
9
|
+
return {
|
|
10
|
+
family: run.fontFamily ?? DEFAULT_LAYOUT_FONT.family,
|
|
11
|
+
weight: run.bold === true ? "bold" : "normal",
|
|
12
|
+
style: run.italic === true ? "italic" : "normal"
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function toStyledRuns(runs, fontScale = 1) {
|
|
16
|
+
return runs.map((run) => ({
|
|
17
|
+
text: run.text,
|
|
18
|
+
font: runFont(run),
|
|
19
|
+
sizePt: (run.sizePt ?? 18) * fontScale,
|
|
20
|
+
color: run.color ?? COLOR_BLACK,
|
|
21
|
+
underline: run.underline,
|
|
22
|
+
hyperlink: run.hyperlink,
|
|
23
|
+
sourcePath: run.sourcePath
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
function effectiveStyledRuns(runs, fontScale = 1) {
|
|
27
|
+
const styled = toStyledRuns(runs, fontScale);
|
|
28
|
+
return styled.length > 0 ? styled : [{
|
|
29
|
+
text: "",
|
|
30
|
+
font: DEFAULT_LAYOUT_FONT,
|
|
31
|
+
sizePt: 18 * fontScale,
|
|
32
|
+
color: COLOR_BLACK
|
|
33
|
+
}];
|
|
34
|
+
}
|
|
35
|
+
function lineNaturalHeightPt(line, measurer, fallback) {
|
|
36
|
+
if (line.fragments.length === 0) return measurer.lineHeightAtSize(fallback.font, fallback.sizePt);
|
|
37
|
+
let max = 0;
|
|
38
|
+
for (const fragment of line.fragments) max = Math.max(max, measurer.lineHeightAtSize(fragment.font, fragment.sizePt));
|
|
39
|
+
return max;
|
|
40
|
+
}
|
|
41
|
+
function alignmentOffsetPt(alignment, contentWidthPt, lineWidthPt) {
|
|
42
|
+
if (alignment === "center") return Math.max(0, (contentWidthPt - lineWidthPt) / 2);
|
|
43
|
+
if (alignment === "right") return Math.max(0, contentWidthPt - lineWidthPt);
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
function decodeImageDimensions(format, bytes) {
|
|
47
|
+
if (format === "jpeg") {
|
|
48
|
+
const info = readJpegInfo(bytes);
|
|
49
|
+
return {
|
|
50
|
+
widthPx: info.width,
|
|
51
|
+
heightPx: info.height
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const raw = decodePng(bytes);
|
|
55
|
+
return {
|
|
56
|
+
widthPx: raw.width,
|
|
57
|
+
heightPx: raw.height
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function registerImage(block, images) {
|
|
61
|
+
const bytes = base64ToBytes(block.base64);
|
|
62
|
+
const imageId = `img${crc32(bytes).toString(16)}`;
|
|
63
|
+
if (!(imageId in images)) {
|
|
64
|
+
const { widthPx, heightPx } = decodeImageDimensions(block.format, bytes);
|
|
65
|
+
images[imageId] = {
|
|
66
|
+
format: block.format,
|
|
67
|
+
base64: block.base64,
|
|
68
|
+
widthPx,
|
|
69
|
+
heightPx
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return imageId;
|
|
73
|
+
}
|
|
74
|
+
function sumColumnWidthsPt(columnWidthsPt, startIndex, span) {
|
|
75
|
+
let sum = 0;
|
|
76
|
+
for (let i = startIndex; i < startIndex + span && i < columnWidthsPt.length; i++) sum += columnWidthsPt[i] ?? 0;
|
|
77
|
+
return sum;
|
|
78
|
+
}
|
|
79
|
+
function estimateRowHeightPt(row, measurer, columnWidthsPt, scale) {
|
|
80
|
+
let max = FALLBACK_ROW_HEIGHT_PT;
|
|
81
|
+
let colIndex = 0;
|
|
82
|
+
for (const cell of row.cells) {
|
|
83
|
+
const span = cell.colSpan ?? 1;
|
|
84
|
+
const cellWidthPt = sumColumnWidthsPt(columnWidthsPt, colIndex, span) * scale;
|
|
85
|
+
for (const block of cell.blocks) {
|
|
86
|
+
if (block.kind !== "paragraph") continue;
|
|
87
|
+
const runs = effectiveStyledRuns(block.runs);
|
|
88
|
+
const lines = wrapRunsToWidth(runs, measurer, cellWidthPt);
|
|
89
|
+
for (const line of lines) max = Math.max(max, lineNaturalHeightPt(line, measurer, runs[0]));
|
|
90
|
+
}
|
|
91
|
+
colIndex += span;
|
|
92
|
+
}
|
|
93
|
+
return max;
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { NOMINAL_TEXT_SIZE_PT, alignmentOffsetPt, effectiveStyledRuns, estimateRowHeightPt, lineNaturalHeightPt, registerImage, runFont, sumColumnWidthsPt, toStyledRuns };
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_layout_shared = require("./shared.cjs");
|
|
3
|
+
const require_ports_abort = require("../ports/abort.cjs");
|
|
4
|
+
let document_schema_js = require("document-schema.js");
|
|
5
|
+
let pdf_codec = require("pdf-codec");
|
|
6
|
+
//#region src/layout/sheets.ts
|
|
7
|
+
const DEFAULT_COLUMN_WIDTH_PT = 64;
|
|
8
|
+
const DEFAULT_ROW_HEIGHT_PT = 15;
|
|
9
|
+
const NOMINAL_CELL_TEXT_SIZE_PT = 10;
|
|
10
|
+
const HEADER_LABEL_SIZE_PT = 8;
|
|
11
|
+
const CELL_TEXT_PADDING_PT = 2;
|
|
12
|
+
const HEADER_LABEL_PADDING_PT = 2;
|
|
13
|
+
const MINIMUM_SCALE = .01;
|
|
14
|
+
const NUMERIC_OVERFLOW_TEXT = "###";
|
|
15
|
+
const GRIDLINE_COLOR = (0, document_schema_js.rgbHexToColor)("#D0D0D0");
|
|
16
|
+
const GRIDLINE_WIDTH_PT = .5;
|
|
17
|
+
const HEADER_LABEL_COLOR = (0, document_schema_js.rgbHexToColor)("#606060");
|
|
18
|
+
function columnLetters(index) {
|
|
19
|
+
let n = index + 1;
|
|
20
|
+
let letters = "";
|
|
21
|
+
while (n > 0) {
|
|
22
|
+
const remainder = (n - 1) % 26;
|
|
23
|
+
letters = String.fromCharCode(65 + remainder) + letters;
|
|
24
|
+
n = Math.floor((n - 1) / 26);
|
|
25
|
+
}
|
|
26
|
+
return letters;
|
|
27
|
+
}
|
|
28
|
+
function resolvePrintRange(sheet) {
|
|
29
|
+
if (sheet.printSettings.printRange !== void 0) return sheet.printSettings.printRange;
|
|
30
|
+
if (sheet.cells.length === 0) return;
|
|
31
|
+
let startRow = Number.POSITIVE_INFINITY;
|
|
32
|
+
let startColumn = Number.POSITIVE_INFINITY;
|
|
33
|
+
let endRow = Number.NEGATIVE_INFINITY;
|
|
34
|
+
let endColumn = Number.NEGATIVE_INFINITY;
|
|
35
|
+
for (const cell of sheet.cells) {
|
|
36
|
+
startRow = Math.min(startRow, cell.row);
|
|
37
|
+
startColumn = Math.min(startColumn, cell.column);
|
|
38
|
+
endRow = Math.max(endRow, cell.row + (cell.rowSpan ?? 1) - 1);
|
|
39
|
+
endColumn = Math.max(endColumn, cell.column + (cell.colSpan ?? 1) - 1);
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
startRow,
|
|
43
|
+
startColumn,
|
|
44
|
+
endRow,
|
|
45
|
+
endColumn
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function resolveAxis(entries, start, end, defaultSizePt) {
|
|
49
|
+
const sorted = [...entries].sort((a, b) => a.index - b.index);
|
|
50
|
+
const resolved = [];
|
|
51
|
+
let pointer = 0;
|
|
52
|
+
let currentSizePt = defaultSizePt;
|
|
53
|
+
let currentHidden = false;
|
|
54
|
+
for (let index = start; index <= end; index++) {
|
|
55
|
+
while (pointer < sorted.length && sorted[pointer].index <= index) {
|
|
56
|
+
currentSizePt = sorted[pointer].sizePt;
|
|
57
|
+
currentHidden = sorted[pointer].hidden ?? false;
|
|
58
|
+
pointer++;
|
|
59
|
+
}
|
|
60
|
+
resolved.push({
|
|
61
|
+
index,
|
|
62
|
+
sizePt: currentHidden ? 0 : currentSizePt,
|
|
63
|
+
hidden: currentHidden
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return resolved;
|
|
67
|
+
}
|
|
68
|
+
function computeHeaderGutter(printSettings, range, measurer) {
|
|
69
|
+
if (!printSettings.headers) return {
|
|
70
|
+
widthPt: 0,
|
|
71
|
+
heightPt: 0
|
|
72
|
+
};
|
|
73
|
+
const widestRowLabel = String(range.endRow + 1);
|
|
74
|
+
return {
|
|
75
|
+
widthPt: measurer.widthOfTextAtSize(widestRowLabel, document_schema_js.DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT) + 4,
|
|
76
|
+
heightPt: measurer.lineHeightAtSize(document_schema_js.DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT)
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function resolveScale(printSettings, availableWidthPt, availableHeightPt, totalContentWidthPt, totalContentHeightPt) {
|
|
80
|
+
if (printSettings.scale !== void 0) return Math.max(printSettings.scale / 100, MINIMUM_SCALE);
|
|
81
|
+
if (printSettings.fitToPages !== void 0) {
|
|
82
|
+
const budgetWidthPt = availableWidthPt * printSettings.fitToPages.width;
|
|
83
|
+
const budgetHeightPt = availableHeightPt * printSettings.fitToPages.height;
|
|
84
|
+
const widthRatio = totalContentWidthPt > 0 ? budgetWidthPt / totalContentWidthPt : 1;
|
|
85
|
+
const heightRatio = totalContentHeightPt > 0 ? budgetHeightPt / totalContentHeightPt : 1;
|
|
86
|
+
return Math.max(Math.min(widthRatio, heightRatio, 1), MINIMUM_SCALE);
|
|
87
|
+
}
|
|
88
|
+
return 1;
|
|
89
|
+
}
|
|
90
|
+
function partitionIndices(indices, sizeOf, availablePt, manualBreaks) {
|
|
91
|
+
const bands = [];
|
|
92
|
+
let current = [];
|
|
93
|
+
let currentSizePt = 0;
|
|
94
|
+
for (const index of indices) {
|
|
95
|
+
if (manualBreaks.has(index) && current.length > 0) {
|
|
96
|
+
bands.push(current);
|
|
97
|
+
current = [];
|
|
98
|
+
currentSizePt = 0;
|
|
99
|
+
}
|
|
100
|
+
const sizePt = sizeOf(index);
|
|
101
|
+
if (current.length > 0 && currentSizePt + sizePt > availablePt) {
|
|
102
|
+
bands.push(current);
|
|
103
|
+
current = [];
|
|
104
|
+
currentSizePt = 0;
|
|
105
|
+
}
|
|
106
|
+
current.push(index);
|
|
107
|
+
currentSizePt += sizePt;
|
|
108
|
+
}
|
|
109
|
+
if (current.length > 0) bands.push(current);
|
|
110
|
+
return bands;
|
|
111
|
+
}
|
|
112
|
+
function cellStyledRuns(cell) {
|
|
113
|
+
if (cell.runs !== void 0 && cell.runs.length > 0) {
|
|
114
|
+
const runsWithNominalSize = cell.runs.map((run) => run.sizePt === void 0 ? {
|
|
115
|
+
...run,
|
|
116
|
+
sizePt: NOMINAL_CELL_TEXT_SIZE_PT
|
|
117
|
+
} : run);
|
|
118
|
+
return require_layout_shared.toStyledRuns(runsWithNominalSize);
|
|
119
|
+
}
|
|
120
|
+
return [{
|
|
121
|
+
text: cell.displayText,
|
|
122
|
+
font: document_schema_js.DEFAULT_LAYOUT_FONT,
|
|
123
|
+
sizePt: NOMINAL_CELL_TEXT_SIZE_PT,
|
|
124
|
+
color: document_schema_js.COLOR_BLACK
|
|
125
|
+
}];
|
|
126
|
+
}
|
|
127
|
+
function isNumericLikeValue(kind) {
|
|
128
|
+
return kind === "number" || kind === "percentage" || kind === "currency" || kind === "date" || kind === "time";
|
|
129
|
+
}
|
|
130
|
+
function defaultAlignmentForValue(kind) {
|
|
131
|
+
if (isNumericLikeValue(kind)) return "right";
|
|
132
|
+
if (kind === "boolean" || kind === "error") return "center";
|
|
133
|
+
return "left";
|
|
134
|
+
}
|
|
135
|
+
function isCellVisuallyEmpty(cell) {
|
|
136
|
+
return cell === void 0 || cell.value.kind === "empty" && cell.displayText.length === 0;
|
|
137
|
+
}
|
|
138
|
+
function truncateFragmentsToWidth(fragments, measurer, maxWidthPt) {
|
|
139
|
+
const result = [];
|
|
140
|
+
for (const fragment of fragments) {
|
|
141
|
+
if (fragment.xOffsetPt >= maxWidthPt) break;
|
|
142
|
+
const remainingWidthPt = maxWidthPt - fragment.xOffsetPt;
|
|
143
|
+
if (measurer.widthOfTextAtSize(fragment.text, fragment.font, fragment.sizePt) <= remainingWidthPt) {
|
|
144
|
+
result.push(fragment);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
const chars = Array.from(fragment.text);
|
|
148
|
+
let width = 0;
|
|
149
|
+
let fitCount = 0;
|
|
150
|
+
for (const char of chars) {
|
|
151
|
+
const charWidthPt = measurer.widthOfTextAtSize(char, fragment.font, fragment.sizePt);
|
|
152
|
+
if (width + charWidthPt > remainingWidthPt) break;
|
|
153
|
+
width += charWidthPt;
|
|
154
|
+
fitCount++;
|
|
155
|
+
}
|
|
156
|
+
if (fitCount > 0) result.push({
|
|
157
|
+
...fragment,
|
|
158
|
+
text: chars.slice(0, fitCount).join("")
|
|
159
|
+
});
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
return result;
|
|
163
|
+
}
|
|
164
|
+
function buildPositionedAxis(repeatIndices, repeatSizePtOf, bandIndices, bandSizePtOf) {
|
|
165
|
+
const indices = [...repeatIndices, ...bandIndices];
|
|
166
|
+
const sizesPt = [...repeatIndices.map(repeatSizePtOf), ...bandIndices.map(bandSizePtOf)];
|
|
167
|
+
const offsetsPt = [0];
|
|
168
|
+
let running = 0;
|
|
169
|
+
for (const size of sizesPt) {
|
|
170
|
+
running += size;
|
|
171
|
+
offsetsPt.push(running);
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
indices,
|
|
175
|
+
sizesPt,
|
|
176
|
+
offsetsPt,
|
|
177
|
+
positionByIndex: new Map(indices.map((index, position) => [index, position]))
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function axisSpanSizePt(axis, startIndex, span) {
|
|
181
|
+
const startPosition = axis.positionByIndex.get(startIndex);
|
|
182
|
+
if (startPosition === void 0) return 0;
|
|
183
|
+
return require_layout_shared.sumColumnWidthsPt(axis.sizesPt, startPosition, span);
|
|
184
|
+
}
|
|
185
|
+
function renderCellText(cell, rowCells, columnAxis, rowAxis, gridLeftXPt, gridTopYDownPt, pageHeightPt, measurer, out) {
|
|
186
|
+
const columnPosition = columnAxis.positionByIndex.get(cell.column);
|
|
187
|
+
const rowPosition = rowAxis.positionByIndex.get(cell.row);
|
|
188
|
+
if (columnPosition === void 0 || rowPosition === void 0) return;
|
|
189
|
+
const ownWidthPt = axisSpanSizePt(columnAxis, cell.column, cell.colSpan ?? 1);
|
|
190
|
+
const heightPt = axisSpanSizePt(rowAxis, cell.row, cell.rowSpan ?? 1);
|
|
191
|
+
const xLeftPt = gridLeftXPt + columnAxis.offsetsPt[columnPosition];
|
|
192
|
+
const yTopDownPt = gridTopYDownPt + rowAxis.offsetsPt[rowPosition];
|
|
193
|
+
const alignment = defaultAlignmentForValue(cell.value.kind);
|
|
194
|
+
const numericLike = isNumericLikeValue(cell.value.kind);
|
|
195
|
+
const styledRuns = cellStyledRuns(cell);
|
|
196
|
+
const naturalLine = (0, pdf_codec.wrapRunsToWidth)(styledRuns, measurer, Number.POSITIVE_INFINITY)[0];
|
|
197
|
+
let availableWidthPt = Math.max(0, ownWidthPt - 4);
|
|
198
|
+
let fragments = naturalLine.fragments;
|
|
199
|
+
let lineWidthPt = naturalLine.widthPt;
|
|
200
|
+
if (lineWidthPt > availableWidthPt) if (numericLike) {
|
|
201
|
+
const overflowRuns = [{
|
|
202
|
+
text: NUMERIC_OVERFLOW_TEXT,
|
|
203
|
+
font: styledRuns[0].font,
|
|
204
|
+
sizePt: styledRuns[0].sizePt,
|
|
205
|
+
color: styledRuns[0].color
|
|
206
|
+
}];
|
|
207
|
+
const overflowLine = (0, pdf_codec.wrapRunsToWidth)(overflowRuns, measurer, Number.POSITIVE_INFINITY)[0];
|
|
208
|
+
fragments = overflowLine.fragments;
|
|
209
|
+
lineWidthPt = overflowLine.widthPt;
|
|
210
|
+
} else if (cell.value.kind === "string") {
|
|
211
|
+
let spillColumn = cell.column + (cell.colSpan ?? 1);
|
|
212
|
+
while (lineWidthPt > availableWidthPt) {
|
|
213
|
+
const neighborPosition = columnAxis.positionByIndex.get(spillColumn);
|
|
214
|
+
if (neighborPosition === void 0 || !isCellVisuallyEmpty(rowCells?.get(spillColumn))) break;
|
|
215
|
+
availableWidthPt += columnAxis.sizesPt[neighborPosition];
|
|
216
|
+
spillColumn++;
|
|
217
|
+
}
|
|
218
|
+
if (lineWidthPt > availableWidthPt) fragments = truncateFragmentsToWidth(fragments, measurer, availableWidthPt);
|
|
219
|
+
} else fragments = truncateFragmentsToWidth(fragments, measurer, availableWidthPt);
|
|
220
|
+
const alignOffsetPt = require_layout_shared.alignmentOffsetPt(alignment, availableWidthPt, lineWidthPt);
|
|
221
|
+
const textStartXPt = xLeftPt + CELL_TEXT_PADDING_PT + alignOffsetPt;
|
|
222
|
+
const lineHeightPt = require_layout_shared.lineNaturalHeightPt(naturalLine, measurer, styledRuns[0]);
|
|
223
|
+
const baselineYDownPt = yTopDownPt + Math.max(CELL_TEXT_PADDING_PT, heightPt - CELL_TEXT_PADDING_PT - lineHeightPt) + naturalLine.ascentPt;
|
|
224
|
+
for (const fragment of fragments) {
|
|
225
|
+
const textItem = {
|
|
226
|
+
kind: "text",
|
|
227
|
+
text: fragment.text,
|
|
228
|
+
xPt: textStartXPt + fragment.xOffsetPt,
|
|
229
|
+
yPt: pageHeightPt - baselineYDownPt,
|
|
230
|
+
font: fragment.font,
|
|
231
|
+
sizePt: fragment.sizePt,
|
|
232
|
+
color: fragment.color,
|
|
233
|
+
underline: fragment.underline,
|
|
234
|
+
sourcePath: fragment.sourcePath
|
|
235
|
+
};
|
|
236
|
+
out.push(textItem);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function renderHeaderLabels(gutter, columnAxis, rowAxis, gridLeftXPt, gridTopYDownPt, pageHeightPt, measurer, out) {
|
|
240
|
+
const lineHeightPt = measurer.lineHeightAtSize(document_schema_js.DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
241
|
+
const ascentPt = measurer.ascenderAtSize(document_schema_js.DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
242
|
+
columnAxis.indices.forEach((columnIndex, position) => {
|
|
243
|
+
const label = columnLetters(columnIndex);
|
|
244
|
+
const widthPt = columnAxis.sizesPt[position];
|
|
245
|
+
const labelWidthPt = measurer.widthOfTextAtSize(label, document_schema_js.DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
246
|
+
const xPt = gridLeftXPt + columnAxis.offsetsPt[position] + require_layout_shared.alignmentOffsetPt("center", widthPt, labelWidthPt);
|
|
247
|
+
const baselineYDownPt = gridTopYDownPt - gutter.heightPt + (gutter.heightPt - lineHeightPt) / 2 + ascentPt;
|
|
248
|
+
out.push({
|
|
249
|
+
kind: "text",
|
|
250
|
+
text: label,
|
|
251
|
+
xPt,
|
|
252
|
+
yPt: pageHeightPt - baselineYDownPt,
|
|
253
|
+
font: document_schema_js.DEFAULT_LAYOUT_FONT,
|
|
254
|
+
sizePt: HEADER_LABEL_SIZE_PT,
|
|
255
|
+
color: HEADER_LABEL_COLOR
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
rowAxis.indices.forEach((rowIndex, position) => {
|
|
259
|
+
const label = String(rowIndex + 1);
|
|
260
|
+
const heightPt = rowAxis.sizesPt[position];
|
|
261
|
+
const labelWidthPt = measurer.widthOfTextAtSize(label, document_schema_js.DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
262
|
+
const xPt = gridLeftXPt - gutter.widthPt + Math.max(HEADER_LABEL_PADDING_PT, gutter.widthPt - HEADER_LABEL_PADDING_PT - labelWidthPt);
|
|
263
|
+
const baselineYDownPt = gridTopYDownPt + rowAxis.offsetsPt[position] + Math.max(0, (heightPt - lineHeightPt) / 2) + ascentPt;
|
|
264
|
+
out.push({
|
|
265
|
+
kind: "text",
|
|
266
|
+
text: label,
|
|
267
|
+
xPt,
|
|
268
|
+
yPt: pageHeightPt - baselineYDownPt,
|
|
269
|
+
font: document_schema_js.DEFAULT_LAYOUT_FONT,
|
|
270
|
+
sizePt: HEADER_LABEL_SIZE_PT,
|
|
271
|
+
color: HEADER_LABEL_COLOR
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function renderGridlines(gridLeftXPt, gridTopYDownPt, gridWidthPt, gridHeightPt, columnOffsetsPt, rowOffsetsPt, pageHeightPt, out) {
|
|
276
|
+
for (const offsetPt of columnOffsetsPt) {
|
|
277
|
+
const xPt = gridLeftXPt + offsetPt;
|
|
278
|
+
const line = {
|
|
279
|
+
kind: "line",
|
|
280
|
+
x1Pt: xPt,
|
|
281
|
+
y1Pt: pageHeightPt - gridTopYDownPt,
|
|
282
|
+
x2Pt: xPt,
|
|
283
|
+
y2Pt: pageHeightPt - (gridTopYDownPt + gridHeightPt),
|
|
284
|
+
color: GRIDLINE_COLOR,
|
|
285
|
+
widthPt: GRIDLINE_WIDTH_PT
|
|
286
|
+
};
|
|
287
|
+
out.push(line);
|
|
288
|
+
}
|
|
289
|
+
for (const offsetPt of rowOffsetsPt) {
|
|
290
|
+
const yDownPt = gridTopYDownPt + offsetPt;
|
|
291
|
+
const line = {
|
|
292
|
+
kind: "line",
|
|
293
|
+
x1Pt: gridLeftXPt,
|
|
294
|
+
y1Pt: pageHeightPt - yDownPt,
|
|
295
|
+
x2Pt: gridLeftXPt + gridWidthPt,
|
|
296
|
+
y2Pt: pageHeightPt - yDownPt,
|
|
297
|
+
color: GRIDLINE_COLOR,
|
|
298
|
+
widthPt: GRIDLINE_WIDTH_PT
|
|
299
|
+
};
|
|
300
|
+
out.push(line);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
function bandableIndices(start, end, repeat) {
|
|
304
|
+
const indices = [];
|
|
305
|
+
for (let i = start; i <= end; i++) {
|
|
306
|
+
if (repeat !== void 0 && i >= repeat.start && i <= repeat.end) continue;
|
|
307
|
+
indices.push(i);
|
|
308
|
+
}
|
|
309
|
+
return indices;
|
|
310
|
+
}
|
|
311
|
+
function rangeIndices(start, end) {
|
|
312
|
+
const indices = [];
|
|
313
|
+
for (let i = start; i <= end; i++) indices.push(i);
|
|
314
|
+
return indices;
|
|
315
|
+
}
|
|
316
|
+
function convertSheetToPages(sheet, measurer, signal, out) {
|
|
317
|
+
require_ports_abort.throwIfAborted(signal);
|
|
318
|
+
const range = resolvePrintRange(sheet);
|
|
319
|
+
if (range === void 0) return;
|
|
320
|
+
const { printSettings } = sheet;
|
|
321
|
+
const { pageSize, margins } = printSettings;
|
|
322
|
+
const pageContentWidthPt = Math.max(0, pageSize.widthPt - margins.leftPt - margins.rightPt);
|
|
323
|
+
const pageContentHeightPt = Math.max(0, pageSize.heightPt - margins.topPt - margins.bottomPt);
|
|
324
|
+
const columnEntries = resolveAxis(sheet.columns.map((c) => ({
|
|
325
|
+
index: c.index,
|
|
326
|
+
sizePt: c.widthPt,
|
|
327
|
+
hidden: c.hidden
|
|
328
|
+
})), range.startColumn, range.endColumn, DEFAULT_COLUMN_WIDTH_PT);
|
|
329
|
+
const rowEntries = resolveAxis(sheet.rows.map((r) => ({
|
|
330
|
+
index: r.index,
|
|
331
|
+
sizePt: r.heightPt,
|
|
332
|
+
hidden: r.hidden
|
|
333
|
+
})), range.startRow, range.endRow, DEFAULT_ROW_HEIGHT_PT);
|
|
334
|
+
const columnSizeByIndex = new Map(columnEntries.map((e) => [e.index, e.sizePt]));
|
|
335
|
+
const rowSizeByIndex = new Map(rowEntries.map((e) => [e.index, e.sizePt]));
|
|
336
|
+
const hiddenColumnIndices = new Set(columnEntries.filter((e) => e.hidden).map((e) => e.index));
|
|
337
|
+
const hiddenRowIndices = new Set(rowEntries.filter((e) => e.hidden).map((e) => e.index));
|
|
338
|
+
const gutter = computeHeaderGutter(printSettings, range, measurer);
|
|
339
|
+
const repeatColumns = printSettings.repeatColumns;
|
|
340
|
+
const repeatRows = printSettings.repeatRows;
|
|
341
|
+
const repeatColumnIndices = repeatColumns === void 0 ? [] : rangeIndices(repeatColumns.start, repeatColumns.end);
|
|
342
|
+
const repeatRowIndices = repeatRows === void 0 ? [] : rangeIndices(repeatRows.start, repeatRows.end);
|
|
343
|
+
const repeatColumnsWidthPt = repeatColumnIndices.reduce((sum, i) => sum + (columnSizeByIndex.get(i) ?? 0), 0);
|
|
344
|
+
const repeatRowsHeightPt = repeatRowIndices.reduce((sum, i) => sum + (rowSizeByIndex.get(i) ?? 0), 0);
|
|
345
|
+
const bandableColumnIndices = bandableIndices(range.startColumn, range.endColumn, repeatColumns);
|
|
346
|
+
const bandableRowIndices = bandableIndices(range.startRow, range.endRow, repeatRows);
|
|
347
|
+
const availableWidthPt = Math.max(0, pageContentWidthPt - gutter.widthPt - repeatColumnsWidthPt);
|
|
348
|
+
const availableHeightPt = Math.max(0, pageContentHeightPt - gutter.heightPt - repeatRowsHeightPt);
|
|
349
|
+
const scale = resolveScale(printSettings, availableWidthPt, availableHeightPt, bandableColumnIndices.reduce((sum, i) => sum + (columnSizeByIndex.get(i) ?? 0), 0), bandableRowIndices.reduce((sum, i) => sum + (rowSizeByIndex.get(i) ?? 0), 0));
|
|
350
|
+
const descaledAvailableWidthPt = availableWidthPt / scale;
|
|
351
|
+
const descaledAvailableHeightPt = availableHeightPt / scale;
|
|
352
|
+
const manualBreakColumns = new Set(printSettings.manualBreaks?.columns ?? []);
|
|
353
|
+
const manualBreakRows = new Set(printSettings.manualBreaks?.rows ?? []);
|
|
354
|
+
require_ports_abort.throwIfAborted(signal);
|
|
355
|
+
const columnBands = partitionIndices(bandableColumnIndices, (i) => columnSizeByIndex.get(i) ?? 0, descaledAvailableWidthPt, manualBreakColumns);
|
|
356
|
+
const rowBands = partitionIndices(bandableRowIndices, (i) => rowSizeByIndex.get(i) ?? 0, descaledAvailableHeightPt, manualBreakRows);
|
|
357
|
+
const cellsByRow = /* @__PURE__ */ new Map();
|
|
358
|
+
for (const cell of sheet.cells) {
|
|
359
|
+
let row = cellsByRow.get(cell.row);
|
|
360
|
+
if (row === void 0) {
|
|
361
|
+
row = /* @__PURE__ */ new Map();
|
|
362
|
+
cellsByRow.set(cell.row, row);
|
|
363
|
+
}
|
|
364
|
+
row.set(cell.column, cell);
|
|
365
|
+
}
|
|
366
|
+
const scaledSizeOf = (sizeByIndex) => (index) => (sizeByIndex.get(index) ?? 0) * scale;
|
|
367
|
+
const unscaledSizeOf = (sizeByIndex) => (index) => sizeByIndex.get(index) ?? 0;
|
|
368
|
+
const bandPairs = printSettings.pageOrder === "overThenDown" ? rowBands.flatMap((rowBand) => columnBands.map((columnBand) => ({
|
|
369
|
+
columnBand,
|
|
370
|
+
rowBand
|
|
371
|
+
}))) : columnBands.flatMap((columnBand) => rowBands.map((rowBand) => ({
|
|
372
|
+
columnBand,
|
|
373
|
+
rowBand
|
|
374
|
+
})));
|
|
375
|
+
for (const { columnBand, rowBand } of bandPairs) {
|
|
376
|
+
require_ports_abort.throwIfAborted(signal);
|
|
377
|
+
const columnAxis = buildPositionedAxis(repeatColumnIndices, unscaledSizeOf(columnSizeByIndex), columnBand, scaledSizeOf(columnSizeByIndex));
|
|
378
|
+
const rowAxis = buildPositionedAxis(repeatRowIndices, unscaledSizeOf(rowSizeByIndex), rowBand, scaledSizeOf(rowSizeByIndex));
|
|
379
|
+
const gridLeftXPt = margins.leftPt + gutter.widthPt;
|
|
380
|
+
const gridTopYDownPt = margins.topPt + gutter.heightPt;
|
|
381
|
+
const gridWidthPt = columnAxis.offsetsPt[columnAxis.offsetsPt.length - 1];
|
|
382
|
+
const gridHeightPt = rowAxis.offsetsPt[rowAxis.offsetsPt.length - 1];
|
|
383
|
+
const items = [];
|
|
384
|
+
if (printSettings.gridlines) renderGridlines(gridLeftXPt, gridTopYDownPt, gridWidthPt, gridHeightPt, columnAxis.offsetsPt, rowAxis.offsetsPt, pageSize.heightPt, items);
|
|
385
|
+
if (printSettings.headers) renderHeaderLabels(gutter, columnAxis, rowAxis, gridLeftXPt, gridTopYDownPt, pageSize.heightPt, measurer, items);
|
|
386
|
+
for (const rowIndex of rowAxis.indices) {
|
|
387
|
+
const rowCells = cellsByRow.get(rowIndex);
|
|
388
|
+
if (rowCells === void 0) continue;
|
|
389
|
+
for (const [columnIndex, cell] of rowCells) {
|
|
390
|
+
require_ports_abort.throwIfAborted(signal);
|
|
391
|
+
if (!columnAxis.positionByIndex.has(columnIndex) || hiddenColumnIndices.has(columnIndex) || hiddenRowIndices.has(cell.row)) continue;
|
|
392
|
+
renderCellText(cell, rowCells, columnAxis, rowAxis, gridLeftXPt, gridTopYDownPt, pageSize.heightPt, measurer, items);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
out.push({
|
|
396
|
+
widthPt: pageSize.widthPt,
|
|
397
|
+
heightPt: pageSize.heightPt,
|
|
398
|
+
items
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
function convertSpreadsheetToLayout(doc, options) {
|
|
403
|
+
const pages = [];
|
|
404
|
+
for (const sheet of doc.sheets) convertSheetToPages(sheet, options.measurer, options.signal, pages);
|
|
405
|
+
return {
|
|
406
|
+
formatVersion: document_schema_js.LAYOUT_FORMAT_VERSION,
|
|
407
|
+
metadata: doc.metadata,
|
|
408
|
+
pages,
|
|
409
|
+
images: {}
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
//#endregion
|
|
413
|
+
exports.convertSpreadsheetToLayout = convertSpreadsheetToLayout;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContentDocument } from "../model/content.cjs";
|
|
2
|
+
import { LayoutDocument } from "document-schema.js";
|
|
3
|
+
import { TextMeasurer } from "pdf-codec";
|
|
4
|
+
//#region src/layout/sheets.d.ts
|
|
5
|
+
interface SheetsLayoutOptions {
|
|
6
|
+
readonly measurer: TextMeasurer;
|
|
7
|
+
readonly signal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
type SpreadsheetContentDocument = Extract<ContentDocument, {
|
|
10
|
+
kind: 'spreadsheet';
|
|
11
|
+
}>;
|
|
12
|
+
declare function convertSpreadsheetToLayout(doc: SpreadsheetContentDocument, options: SheetsLayoutOptions): LayoutDocument;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SheetsLayoutOptions, convertSpreadsheetToLayout };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContentDocument } from "../model/content.js";
|
|
2
|
+
import { LayoutDocument } from "document-schema.js";
|
|
3
|
+
import { TextMeasurer } from "pdf-codec";
|
|
4
|
+
//#region src/layout/sheets.d.ts
|
|
5
|
+
interface SheetsLayoutOptions {
|
|
6
|
+
readonly measurer: TextMeasurer;
|
|
7
|
+
readonly signal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
type SpreadsheetContentDocument = Extract<ContentDocument, {
|
|
10
|
+
kind: 'spreadsheet';
|
|
11
|
+
}>;
|
|
12
|
+
declare function convertSpreadsheetToLayout(doc: SpreadsheetContentDocument, options: SheetsLayoutOptions): LayoutDocument;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SheetsLayoutOptions, convertSpreadsheetToLayout };
|