postext 1.69.0 → 1.70.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 +2 -1
- package/dist/__tests__/exports.test.js +3 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/composed/sourceMap/text.d.ts.map +1 -1
- package/dist/composed/sourceMap/text.js +1 -15
- package/dist/composed/sourceMap/text.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/paint/displayList/blocks.d.ts +29 -0
- package/dist/paint/displayList/blocks.d.ts.map +1 -0
- package/dist/paint/displayList/blocks.js +257 -0
- package/dist/paint/displayList/blocks.js.map +1 -0
- package/dist/paint/displayList/comic.d.ts +8 -0
- package/dist/paint/displayList/comic.d.ts.map +1 -0
- package/dist/paint/displayList/comic.js +142 -0
- package/dist/paint/displayList/comic.js.map +1 -0
- package/dist/paint/displayList/design.d.ts +27 -0
- package/dist/paint/displayList/design.d.ts.map +1 -0
- package/dist/paint/displayList/design.js +190 -0
- package/dist/paint/displayList/design.js.map +1 -0
- package/dist/paint/displayList/displayList.test.d.ts +2 -0
- package/dist/paint/displayList/displayList.test.d.ts.map +1 -0
- package/dist/paint/displayList/displayList.test.js +256 -0
- package/dist/paint/displayList/displayList.test.js.map +1 -0
- package/dist/paint/displayList/eastAsian.test.d.ts +2 -0
- package/dist/paint/displayList/eastAsian.test.d.ts.map +1 -0
- package/dist/paint/displayList/eastAsian.test.js +112 -0
- package/dist/paint/displayList/eastAsian.test.js.map +1 -0
- package/dist/paint/displayList/frame.d.ts +49 -0
- package/dist/paint/displayList/frame.d.ts.map +1 -0
- package/dist/paint/displayList/frame.js +230 -0
- package/dist/paint/displayList/frame.js.map +1 -0
- package/dist/paint/displayList/frames.test.d.ts +2 -0
- package/dist/paint/displayList/frames.test.d.ts.map +1 -0
- package/dist/paint/displayList/frames.test.js +129 -0
- package/dist/paint/displayList/frames.test.js.map +1 -0
- package/dist/paint/displayList/index.d.ts +4 -0
- package/dist/paint/displayList/index.d.ts.map +1 -0
- package/dist/paint/displayList/index.js +5 -0
- package/dist/paint/displayList/index.js.map +1 -0
- package/dist/paint/displayList/inline.d.ts +19 -0
- package/dist/paint/displayList/inline.d.ts.map +1 -0
- package/dist/paint/displayList/inline.js +84 -0
- package/dist/paint/displayList/inline.js.map +1 -0
- package/dist/paint/displayList/lines.d.ts +60 -0
- package/dist/paint/displayList/lines.d.ts.map +1 -0
- package/dist/paint/displayList/lines.js +267 -0
- package/dist/paint/displayList/lines.js.map +1 -0
- package/dist/paint/displayList/overlays.d.ts +23 -0
- package/dist/paint/displayList/overlays.d.ts.map +1 -0
- package/dist/paint/displayList/overlays.js +99 -0
- package/dist/paint/displayList/overlays.js.map +1 -0
- package/dist/paint/displayList/overlays.test.d.ts +2 -0
- package/dist/paint/displayList/overlays.test.d.ts.map +1 -0
- package/dist/paint/displayList/overlays.test.js +241 -0
- package/dist/paint/displayList/overlays.test.js.map +1 -0
- package/dist/paint/displayList/page.d.ts +8 -0
- package/dist/paint/displayList/page.d.ts.map +1 -0
- package/dist/paint/displayList/page.js +157 -0
- package/dist/paint/displayList/page.js.map +1 -0
- package/dist/paint/displayList/resource.d.ts +6 -0
- package/dist/paint/displayList/resource.d.ts.map +1 -0
- package/dist/paint/displayList/resource.js +195 -0
- package/dist/paint/displayList/resource.js.map +1 -0
- package/dist/paint/displayList/review.test.d.ts +2 -0
- package/dist/paint/displayList/review.test.d.ts.map +1 -0
- package/dist/paint/displayList/review.test.js +185 -0
- package/dist/paint/displayList/review.test.js.map +1 -0
- package/dist/paint/displayList/source.d.ts +57 -0
- package/dist/paint/displayList/source.d.ts.map +1 -0
- package/dist/paint/displayList/source.js +263 -0
- package/dist/paint/displayList/source.js.map +1 -0
- package/dist/paint/displayList/source.test.d.ts +2 -0
- package/dist/paint/displayList/source.test.d.ts.map +1 -0
- package/dist/paint/displayList/source.test.js +37 -0
- package/dist/paint/displayList/source.test.js.map +1 -0
- package/dist/paint/displayList/types.d.ts +309 -0
- package/dist/paint/displayList/types.d.ts.map +1 -0
- package/dist/paint/displayList/types.js +7 -0
- package/dist/paint/displayList/types.js.map +1 -0
- package/dist/paint/segmentPlainLength.d.ts +9 -0
- package/dist/paint/segmentPlainLength.d.ts.map +1 -0
- package/dist/paint/segmentPlainLength.js +19 -0
- package/dist/paint/segmentPlainLength.js.map +1 -0
- package/dist/parse/sourceMapping.d.ts.map +1 -1
- package/dist/parse/sourceMapping.js +10 -4
- package/dist/parse/sourceMapping.js.map +1 -1
- package/dist/word/anchors/anchors.test.d.ts +2 -0
- package/dist/word/anchors/anchors.test.d.ts.map +1 -0
- package/dist/word/anchors/anchors.test.js +88 -0
- package/dist/word/anchors/anchors.test.js.map +1 -0
- package/dist/word/anchors/base64.d.ts +3 -0
- package/dist/word/anchors/base64.d.ts.map +1 -0
- package/dist/word/anchors/base64.js +47 -0
- package/dist/word/anchors/base64.js.map +1 -0
- package/dist/word/anchors/bookmarks.d.ts +11 -0
- package/dist/word/anchors/bookmarks.d.ts.map +1 -0
- package/dist/word/anchors/bookmarks.js +34 -0
- package/dist/word/anchors/bookmarks.js.map +1 -0
- package/dist/word/anchors/exportMap.d.ts +25 -0
- package/dist/word/anchors/exportMap.d.ts.map +1 -0
- package/dist/word/anchors/exportMap.js +131 -0
- package/dist/word/anchors/exportMap.js.map +1 -0
- package/dist/word/anchors/hash.d.ts +7 -0
- package/dist/word/anchors/hash.d.ts.map +1 -0
- package/dist/word/anchors/hash.js +39 -0
- package/dist/word/anchors/hash.js.map +1 -0
- package/dist/word/anchors/index.d.ts +7 -0
- package/dist/word/anchors/index.d.ts.map +1 -0
- package/dist/word/anchors/index.js +9 -0
- package/dist/word/anchors/index.js.map +1 -0
- package/dist/word/anchors/ommlHash.d.ts +8 -0
- package/dist/word/anchors/ommlHash.d.ts.map +1 -0
- package/dist/word/anchors/ommlHash.js +71 -0
- package/dist/word/anchors/ommlHash.js.map +1 -0
- package/dist/word/anchors/types.d.ts +87 -0
- package/dist/word/anchors/types.d.ts.map +1 -0
- package/dist/word/anchors/types.js +8 -0
- package/dist/word/anchors/types.js.map +1 -0
- package/dist/word/fonts/cmap.d.ts +13 -0
- package/dist/word/fonts/cmap.d.ts.map +1 -0
- package/dist/word/fonts/cmap.js +235 -0
- package/dist/word/fonts/cmap.js.map +1 -0
- package/dist/word/fonts/fonts.test.d.ts +2 -0
- package/dist/word/fonts/fonts.test.d.ts.map +1 -0
- package/dist/word/fonts/fonts.test.js +459 -0
- package/dist/word/fonts/fonts.test.js.map +1 -0
- package/dist/word/fonts/glyf.d.ts +21 -0
- package/dist/word/fonts/glyf.d.ts.map +1 -0
- package/dist/word/fonts/glyf.js +139 -0
- package/dist/word/fonts/glyf.js.map +1 -0
- package/dist/word/fonts/gsub.d.ts +8 -0
- package/dist/word/fonts/gsub.d.ts.map +1 -0
- package/dist/word/fonts/gsub.js +145 -0
- package/dist/word/fonts/gsub.js.map +1 -0
- package/dist/word/fonts/gsub.test.d.ts +2 -0
- package/dist/word/fonts/gsub.test.d.ts.map +1 -0
- package/dist/word/fonts/gsub.test.js +98 -0
- package/dist/word/fonts/gsub.test.js.map +1 -0
- package/dist/word/fonts/index.d.ts +6 -0
- package/dist/word/fonts/index.d.ts.map +1 -0
- package/dist/word/fonts/index.js +5 -0
- package/dist/word/fonts/index.js.map +1 -0
- package/dist/word/fonts/merge.d.ts +7 -0
- package/dist/word/fonts/merge.d.ts.map +1 -0
- package/dist/word/fonts/merge.js +222 -0
- package/dist/word/fonts/merge.js.map +1 -0
- package/dist/word/fonts/meta.d.ts +33 -0
- package/dist/word/fonts/meta.d.ts.map +1 -0
- package/dist/word/fonts/meta.js +206 -0
- package/dist/word/fonts/meta.js.map +1 -0
- package/dist/word/fonts/plan.d.ts +31 -0
- package/dist/word/fonts/plan.d.ts.map +1 -0
- package/dist/word/fonts/plan.js +275 -0
- package/dist/word/fonts/plan.js.map +1 -0
- package/dist/word/fonts/sfnt.d.ts +47 -0
- package/dist/word/fonts/sfnt.d.ts.map +1 -0
- package/dist/word/fonts/sfnt.js +202 -0
- package/dist/word/fonts/sfnt.js.map +1 -0
- package/dist/word/fonts/types.d.ts +54 -0
- package/dist/word/fonts/types.d.ts.map +1 -0
- package/dist/word/fonts/types.js +5 -0
- package/dist/word/fonts/types.js.map +1 -0
- package/dist/word/formatted/displayRoundTrip.test.d.ts +2 -0
- package/dist/word/formatted/displayRoundTrip.test.d.ts.map +1 -0
- package/dist/word/formatted/displayRoundTrip.test.js +99 -0
- package/dist/word/formatted/displayRoundTrip.test.js.map +1 -0
- package/dist/word/formatted/drawing.d.ts +61 -0
- package/dist/word/formatted/drawing.d.ts.map +1 -0
- package/dist/word/formatted/drawing.js +85 -0
- package/dist/word/formatted/drawing.js.map +1 -0
- package/dist/word/formatted/dump.test.d.ts +2 -0
- package/dist/word/formatted/dump.test.d.ts.map +1 -0
- package/dist/word/formatted/dump.test.js +31 -0
- package/dist/word/formatted/dump.test.js.map +1 -0
- package/dist/word/formatted/eastAsian.d.ts +68 -0
- package/dist/word/formatted/eastAsian.d.ts.map +1 -0
- package/dist/word/formatted/eastAsian.js +144 -0
- package/dist/word/formatted/eastAsian.js.map +1 -0
- package/dist/word/formatted/formatted.test-helper.d.ts +34 -0
- package/dist/word/formatted/formatted.test-helper.d.ts.map +1 -0
- package/dist/word/formatted/formatted.test-helper.js +138 -0
- package/dist/word/formatted/formatted.test-helper.js.map +1 -0
- package/dist/word/formatted/formatted.test.d.ts +2 -0
- package/dist/word/formatted/formatted.test.d.ts.map +1 -0
- package/dist/word/formatted/formatted.test.js +285 -0
- package/dist/word/formatted/formatted.test.js.map +1 -0
- package/dist/word/formatted/fragments.d.ts +30 -0
- package/dist/word/formatted/fragments.d.ts.map +1 -0
- package/dist/word/formatted/fragments.js +98 -0
- package/dist/word/formatted/fragments.js.map +1 -0
- package/dist/word/formatted/graphics.test.d.ts +2 -0
- package/dist/word/formatted/graphics.test.d.ts.map +1 -0
- package/dist/word/formatted/graphics.test.js +204 -0
- package/dist/word/formatted/graphics.test.js.map +1 -0
- package/dist/word/formatted/index.d.ts +8 -0
- package/dist/word/formatted/index.d.ts.map +1 -0
- package/dist/word/formatted/index.js +103 -0
- package/dist/word/formatted/index.js.map +1 -0
- package/dist/word/formatted/inline.test.d.ts +2 -0
- package/dist/word/formatted/inline.test.d.ts.map +1 -0
- package/dist/word/formatted/inline.test.js +154 -0
- package/dist/word/formatted/inline.test.js.map +1 -0
- package/dist/word/formatted/inlineShapes.d.ts +13 -0
- package/dist/word/formatted/inlineShapes.d.ts.map +1 -0
- package/dist/word/formatted/inlineShapes.js +79 -0
- package/dist/word/formatted/inlineShapes.js.map +1 -0
- package/dist/word/formatted/metrics.d.ts +54 -0
- package/dist/word/formatted/metrics.d.ts.map +1 -0
- package/dist/word/formatted/metrics.js +165 -0
- package/dist/word/formatted/metrics.js.map +1 -0
- package/dist/word/formatted/page.d.ts +16 -0
- package/dist/word/formatted/page.d.ts.map +1 -0
- package/dist/word/formatted/page.js +82 -0
- package/dist/word/formatted/page.js.map +1 -0
- package/dist/word/formatted/paragraphs.d.ts +98 -0
- package/dist/word/formatted/paragraphs.d.ts.map +1 -0
- package/dist/word/formatted/paragraphs.js +364 -0
- package/dist/word/formatted/paragraphs.js.map +1 -0
- package/dist/word/formatted/pictures.d.ts +27 -0
- package/dist/word/formatted/pictures.d.ts.map +1 -0
- package/dist/word/formatted/pictures.js +239 -0
- package/dist/word/formatted/pictures.js.map +1 -0
- package/dist/word/formatted/review.test.d.ts +2 -0
- package/dist/word/formatted/review.test.d.ts.map +1 -0
- package/dist/word/formatted/review.test.js +141 -0
- package/dist/word/formatted/review.test.js.map +1 -0
- package/dist/word/formatted/runs.d.ts +135 -0
- package/dist/word/formatted/runs.d.ts.map +1 -0
- package/dist/word/formatted/runs.js +433 -0
- package/dist/word/formatted/runs.js.map +1 -0
- package/dist/word/formatted/scripts.test.d.ts +2 -0
- package/dist/word/formatted/scripts.test.d.ts.map +1 -0
- package/dist/word/formatted/scripts.test.js +201 -0
- package/dist/word/formatted/scripts.test.js.map +1 -0
- package/dist/word/formatted/shapes.d.ts +29 -0
- package/dist/word/formatted/shapes.d.ts.map +1 -0
- package/dist/word/formatted/shapes.js +101 -0
- package/dist/word/formatted/shapes.js.map +1 -0
- package/dist/word/formatted/styles.d.ts +17 -0
- package/dist/word/formatted/styles.d.ts.map +1 -0
- package/dist/word/formatted/styles.js +91 -0
- package/dist/word/formatted/styles.js.map +1 -0
- package/dist/word/formatted/tables.d.ts +13 -0
- package/dist/word/formatted/tables.d.ts.map +1 -0
- package/dist/word/formatted/tables.js +159 -0
- package/dist/word/formatted/tables.js.map +1 -0
- package/dist/word/formatted/text.d.ts +32 -0
- package/dist/word/formatted/text.d.ts.map +1 -0
- package/dist/word/formatted/text.js +115 -0
- package/dist/word/formatted/text.js.map +1 -0
- package/dist/word/formatted/types.d.ts +68 -0
- package/dist/word/formatted/types.d.ts.map +1 -0
- package/dist/word/formatted/types.js +4 -0
- package/dist/word/formatted/types.js.map +1 -0
- package/dist/word/formatted/units.d.ts +23 -0
- package/dist/word/formatted/units.d.ts.map +1 -0
- package/dist/word/formatted/units.js +51 -0
- package/dist/word/formatted/units.js.map +1 -0
- package/dist/word/formatted/widths.test.d.ts +2 -0
- package/dist/word/formatted/widths.test.d.ts.map +1 -0
- package/dist/word/formatted/widths.test.js +327 -0
- package/dist/word/formatted/widths.test.js.map +1 -0
- package/dist/word/index.d.ts +13 -2
- package/dist/word/index.d.ts.map +1 -1
- package/dist/word/index.js +14 -5
- package/dist/word/index.js.map +1 -1
- package/dist/word/integration/corpus.known.test.d.ts +2 -0
- package/dist/word/integration/corpus.known.test.d.ts.map +1 -0
- package/dist/word/integration/corpus.known.test.js +42 -0
- package/dist/word/integration/corpus.known.test.js.map +1 -0
- package/dist/word/integration/corpus.test.d.ts +2 -0
- package/dist/word/integration/corpus.test.d.ts.map +1 -0
- package/dist/word/integration/corpus.test.js +352 -0
- package/dist/word/integration/corpus.test.js.map +1 -0
- package/dist/word/integration/formatted.test.d.ts +2 -0
- package/dist/word/integration/formatted.test.d.ts.map +1 -0
- package/dist/word/integration/formatted.test.js +125 -0
- package/dist/word/integration/formatted.test.js.map +1 -0
- package/dist/word/integration/integration.test-helper.d.ts +16 -0
- package/dist/word/integration/integration.test-helper.d.ts.map +1 -0
- package/dist/word/integration/integration.test-helper.js +48 -0
- package/dist/word/integration/integration.test-helper.js.map +1 -0
- package/dist/word/integration/sample.test-helper.d.ts +5 -0
- package/dist/word/integration/sample.test-helper.d.ts.map +1 -0
- package/dist/word/integration/sample.test-helper.js +48 -0
- package/dist/word/integration/sample.test-helper.js.map +1 -0
- package/dist/word/integration/semantic.test.d.ts +2 -0
- package/dist/word/integration/semantic.test.d.ts.map +1 -0
- package/dist/word/integration/semantic.test.js +111 -0
- package/dist/word/integration/semantic.test.js.map +1 -0
- package/dist/word/integration/wordEdit.test-helper.d.ts +14 -0
- package/dist/word/integration/wordEdit.test-helper.d.ts.map +1 -0
- package/dist/word/integration/wordEdit.test-helper.js +150 -0
- package/dist/word/integration/wordEdit.test-helper.js.map +1 -0
- package/dist/word/omml.d.ts.map +1 -1
- package/dist/word/omml.js +17 -5
- package/dist/word/omml.js.map +1 -1
- package/dist/word/omml.test.d.ts +2 -0
- package/dist/word/omml.test.d.ts.map +1 -0
- package/dist/word/omml.test.js +46 -0
- package/dist/word/omml.test.js.map +1 -0
- package/dist/word/ommlWrite/convert.d.ts +20 -0
- package/dist/word/ommlWrite/convert.d.ts.map +1 -0
- package/dist/word/ommlWrite/convert.js +311 -0
- package/dist/word/ommlWrite/convert.js.map +1 -0
- package/dist/word/ommlWrite/index.d.ts +25 -0
- package/dist/word/ommlWrite/index.d.ts.map +1 -0
- package/dist/word/ommlWrite/index.js +80 -0
- package/dist/word/ommlWrite/index.js.map +1 -0
- package/dist/word/ommlWrite/mml.d.ts +49 -0
- package/dist/word/ommlWrite/mml.d.ts.map +1 -0
- package/dist/word/ommlWrite/mml.js +73 -0
- package/dist/word/ommlWrite/mml.js.map +1 -0
- package/dist/word/ommlWrite/ommlWrite.test.d.ts +2 -0
- package/dist/word/ommlWrite/ommlWrite.test.d.ts.map +1 -0
- package/dist/word/ommlWrite/ommlWrite.test.js +230 -0
- package/dist/word/ommlWrite/ommlWrite.test.js.map +1 -0
- package/dist/word/ommlWrite/rows.d.ts +6 -0
- package/dist/word/ommlWrite/rows.d.ts.map +1 -0
- package/dist/word/ommlWrite/rows.js +216 -0
- package/dist/word/ommlWrite/rows.js.map +1 -0
- package/dist/word/ommlWrite/runs.d.ts +30 -0
- package/dist/word/ommlWrite/runs.d.ts.map +1 -0
- package/dist/word/ommlWrite/runs.js +122 -0
- package/dist/word/ommlWrite/runs.js.map +1 -0
- package/dist/word/ommlWrite/tables.d.ts +4 -0
- package/dist/word/ommlWrite/tables.d.ts.map +1 -0
- package/dist/word/ommlWrite/tables.js +50 -0
- package/dist/word/ommlWrite/tables.js.map +1 -0
- package/dist/word/ooxml/constants.d.ts +54 -0
- package/dist/word/ooxml/constants.d.ts.map +1 -0
- package/dist/word/ooxml/constants.js +85 -0
- package/dist/word/ooxml/constants.js.map +1 -0
- package/dist/word/ooxml/fonts.d.ts +16 -0
- package/dist/word/ooxml/fonts.d.ts.map +1 -0
- package/dist/word/ooxml/fonts.js +71 -0
- package/dist/word/ooxml/fonts.js.map +1 -0
- package/dist/word/ooxml/index.d.ts +7 -0
- package/dist/word/ooxml/index.d.ts.map +1 -0
- package/dist/word/ooxml/index.js +7 -0
- package/dist/word/ooxml/index.js.map +1 -0
- package/dist/word/ooxml/package.d.ts +21 -0
- package/dist/word/ooxml/package.d.ts.map +1 -0
- package/dist/word/ooxml/package.js +202 -0
- package/dist/word/ooxml/package.js.map +1 -0
- package/dist/word/ooxml/package.test.d.ts +2 -0
- package/dist/word/ooxml/package.test.d.ts.map +1 -0
- package/dist/word/ooxml/package.test.js +176 -0
- package/dist/word/ooxml/package.test.js.map +1 -0
- package/dist/word/ooxml/parts.d.ts +28 -0
- package/dist/word/ooxml/parts.d.ts.map +1 -0
- package/dist/word/ooxml/parts.js +172 -0
- package/dist/word/ooxml/parts.js.map +1 -0
- package/dist/word/ooxml/review.test.d.ts +2 -0
- package/dist/word/ooxml/review.test.d.ts.map +1 -0
- package/dist/word/ooxml/review.test.js +104 -0
- package/dist/word/ooxml/review.test.js.map +1 -0
- package/dist/word/ooxml/types.d.ts +85 -0
- package/dist/word/ooxml/types.d.ts.map +1 -0
- package/dist/word/ooxml/types.js +6 -0
- package/dist/word/ooxml/types.js.map +1 -0
- package/dist/word/ooxml/validate.d.ts +3 -0
- package/dist/word/ooxml/validate.d.ts.map +1 -0
- package/dist/word/ooxml/validate.js +122 -0
- package/dist/word/ooxml/validate.js.map +1 -0
- package/dist/word/ooxml/wellFormed.d.ts +3 -0
- package/dist/word/ooxml/wellFormed.d.ts.map +1 -0
- package/dist/word/ooxml/wellFormed.js +79 -0
- package/dist/word/ooxml/wellFormed.js.map +1 -0
- package/dist/word/roundtrip/added.d.ts +31 -0
- package/dist/word/roundtrip/added.d.ts.map +1 -0
- package/dist/word/roundtrip/added.js +199 -0
- package/dist/word/roundtrip/added.js.map +1 -0
- package/dist/word/roundtrip/added.test.d.ts +2 -0
- package/dist/word/roundtrip/added.test.d.ts.map +1 -0
- package/dist/word/roundtrip/added.test.js +59 -0
- package/dist/word/roundtrip/added.test.js.map +1 -0
- package/dist/word/roundtrip/apply.d.ts +11 -0
- package/dist/word/roundtrip/apply.d.ts.map +1 -0
- package/dist/word/roundtrip/apply.js +260 -0
- package/dist/word/roundtrip/apply.js.map +1 -0
- package/dist/word/roundtrip/blocks.d.ts +56 -0
- package/dist/word/roundtrip/blocks.d.ts.map +1 -0
- package/dist/word/roundtrip/blocks.js +145 -0
- package/dist/word/roundtrip/blocks.js.map +1 -0
- package/dist/word/roundtrip/corpus.test.d.ts +2 -0
- package/dist/word/roundtrip/corpus.test.d.ts.map +1 -0
- package/dist/word/roundtrip/corpus.test.js +54 -0
- package/dist/word/roundtrip/corpus.test.js.map +1 -0
- package/dist/word/roundtrip/diff.d.ts +15 -0
- package/dist/word/roundtrip/diff.d.ts.map +1 -0
- package/dist/word/roundtrip/diff.js +160 -0
- package/dist/word/roundtrip/diff.js.map +1 -0
- package/dist/word/roundtrip/diff.test.d.ts +2 -0
- package/dist/word/roundtrip/diff.test.d.ts.map +1 -0
- package/dist/word/roundtrip/diff.test.js +79 -0
- package/dist/word/roundtrip/diff.test.js.map +1 -0
- package/dist/word/roundtrip/edits.d.ts +34 -0
- package/dist/word/roundtrip/edits.d.ts.map +1 -0
- package/dist/word/roundtrip/edits.js +467 -0
- package/dist/word/roundtrip/edits.js.map +1 -0
- package/dist/word/roundtrip/fixture.test-helper.d.ts +62 -0
- package/dist/word/roundtrip/fixture.test-helper.d.ts.map +1 -0
- package/dist/word/roundtrip/fixture.test-helper.js +258 -0
- package/dist/word/roundtrip/fixture.test-helper.js.map +1 -0
- package/dist/word/roundtrip/formats.d.ts +6 -0
- package/dist/word/roundtrip/formats.d.ts.map +1 -0
- package/dist/word/roundtrip/formats.js +102 -0
- package/dist/word/roundtrip/formats.js.map +1 -0
- package/dist/word/roundtrip/formatted.test.d.ts +2 -0
- package/dist/word/roundtrip/formatted.test.d.ts.map +1 -0
- package/dist/word/roundtrip/formatted.test.js +93 -0
- package/dist/word/roundtrip/formatted.test.js.map +1 -0
- package/dist/word/roundtrip/holders.test.d.ts +2 -0
- package/dist/word/roundtrip/holders.test.d.ts.map +1 -0
- package/dist/word/roundtrip/holders.test.js +109 -0
- package/dist/word/roundtrip/holders.test.js.map +1 -0
- package/dist/word/roundtrip/index.d.ts +6 -0
- package/dist/word/roundtrip/index.d.ts.map +1 -0
- package/dist/word/roundtrip/index.js +9 -0
- package/dist/word/roundtrip/index.js.map +1 -0
- package/dist/word/roundtrip/markup.d.ts +35 -0
- package/dist/word/roundtrip/markup.d.ts.map +1 -0
- package/dist/word/roundtrip/markup.js +168 -0
- package/dist/word/roundtrip/markup.js.map +1 -0
- package/dist/word/roundtrip/math.d.ts +12 -0
- package/dist/word/roundtrip/math.d.ts.map +1 -0
- package/dist/word/roundtrip/math.js +47 -0
- package/dist/word/roundtrip/math.js.map +1 -0
- package/dist/word/roundtrip/math.test.d.ts +2 -0
- package/dist/word/roundtrip/math.test.d.ts.map +1 -0
- package/dist/word/roundtrip/math.test.js +63 -0
- package/dist/word/roundtrip/math.test.js.map +1 -0
- package/dist/word/roundtrip/merge.d.ts +21 -0
- package/dist/word/roundtrip/merge.d.ts.map +1 -0
- package/dist/word/roundtrip/merge.js +81 -0
- package/dist/word/roundtrip/merge.js.map +1 -0
- package/dist/word/roundtrip/paragraphs.test.d.ts +2 -0
- package/dist/word/roundtrip/paragraphs.test.d.ts.map +1 -0
- package/dist/word/roundtrip/paragraphs.test.js +44 -0
- package/dist/word/roundtrip/paragraphs.test.js.map +1 -0
- package/dist/word/roundtrip/read.d.ts +60 -0
- package/dist/word/roundtrip/read.d.ts.map +1 -0
- package/dist/word/roundtrip/read.js +247 -0
- package/dist/word/roundtrip/read.js.map +1 -0
- package/dist/word/roundtrip/review.test.d.ts +2 -0
- package/dist/word/roundtrip/review.test.d.ts.map +1 -0
- package/dist/word/roundtrip/review.test.js +76 -0
- package/dist/word/roundtrip/review.test.js.map +1 -0
- package/dist/word/roundtrip/semantic.test.d.ts +2 -0
- package/dist/word/roundtrip/semantic.test.d.ts.map +1 -0
- package/dist/word/roundtrip/semantic.test.js +121 -0
- package/dist/word/roundtrip/semantic.test.js.map +1 -0
- package/dist/word/roundtrip/targets.d.ts +26 -0
- package/dist/word/roundtrip/targets.d.ts.map +1 -0
- package/dist/word/roundtrip/targets.js +58 -0
- package/dist/word/roundtrip/targets.js.map +1 -0
- package/dist/word/roundtrip/types.d.ts +46 -0
- package/dist/word/roundtrip/types.d.ts.map +1 -0
- package/dist/word/roundtrip/types.js +4 -0
- package/dist/word/roundtrip/types.js.map +1 -0
- package/dist/word/roundtrip/walk.d.ts +66 -0
- package/dist/word/roundtrip/walk.d.ts.map +1 -0
- package/dist/word/roundtrip/walk.js +328 -0
- package/dist/word/roundtrip/walk.js.map +1 -0
- package/dist/word/roundtrip/writers.test.d.ts +2 -0
- package/dist/word/roundtrip/writers.test.d.ts.map +1 -0
- package/dist/word/roundtrip/writers.test.js +51 -0
- package/dist/word/roundtrip/writers.test.js.map +1 -0
- package/dist/word/semantic/atoms.d.ts +14 -0
- package/dist/word/semantic/atoms.d.ts.map +1 -0
- package/dist/word/semantic/atoms.js +85 -0
- package/dist/word/semantic/atoms.js.map +1 -0
- package/dist/word/semantic/blocks.d.ts +39 -0
- package/dist/word/semantic/blocks.d.ts.map +1 -0
- package/dist/word/semantic/blocks.js +260 -0
- package/dist/word/semantic/blocks.js.map +1 -0
- package/dist/word/semantic/chapter.d.ts +17 -0
- package/dist/word/semantic/chapter.d.ts.map +1 -0
- package/dist/word/semantic/chapter.js +56 -0
- package/dist/word/semantic/chapter.js.map +1 -0
- package/dist/word/semantic/constructs.test.d.ts +2 -0
- package/dist/word/semantic/constructs.test.d.ts.map +1 -0
- package/dist/word/semantic/constructs.test.js +267 -0
- package/dist/word/semantic/constructs.test.js.map +1 -0
- package/dist/word/semantic/containers.d.ts +8 -0
- package/dist/word/semantic/containers.d.ts.map +1 -0
- package/dist/word/semantic/containers.js +141 -0
- package/dist/word/semantic/containers.js.map +1 -0
- package/dist/word/semantic/context.d.ts +83 -0
- package/dist/word/semantic/context.d.ts.map +1 -0
- package/dist/word/semantic/context.js +9 -0
- package/dist/word/semantic/context.js.map +1 -0
- package/dist/word/semantic/corpus.test.d.ts +2 -0
- package/dist/word/semantic/corpus.test.d.ts.map +1 -0
- package/dist/word/semantic/corpus.test.js +80 -0
- package/dist/word/semantic/corpus.test.js.map +1 -0
- package/dist/word/semantic/engineNumbers.d.ts +31 -0
- package/dist/word/semantic/engineNumbers.d.ts.map +1 -0
- package/dist/word/semantic/engineNumbers.js +66 -0
- package/dist/word/semantic/engineNumbers.js.map +1 -0
- package/dist/word/semantic/figures.d.ts +8 -0
- package/dist/word/semantic/figures.d.ts.map +1 -0
- package/dist/word/semantic/figures.js +175 -0
- package/dist/word/semantic/figures.js.map +1 -0
- package/dist/word/semantic/fixtures/harness.d.ts +20 -0
- package/dist/word/semantic/fixtures/harness.d.ts.map +1 -0
- package/dist/word/semantic/fixtures/harness.js +89 -0
- package/dist/word/semantic/fixtures/harness.js.map +1 -0
- package/dist/word/semantic/fragments.d.ts +48 -0
- package/dist/word/semantic/fragments.d.ts.map +1 -0
- package/dist/word/semantic/fragments.js +109 -0
- package/dist/word/semantic/fragments.js.map +1 -0
- package/dist/word/semantic/index.d.ts +25 -0
- package/dist/word/semantic/index.d.ts.map +1 -0
- package/dist/word/semantic/index.js +141 -0
- package/dist/word/semantic/index.js.map +1 -0
- package/dist/word/semantic/inline.d.ts +34 -0
- package/dist/word/semantic/inline.d.ts.map +1 -0
- package/dist/word/semantic/inline.js +210 -0
- package/dist/word/semantic/inline.js.map +1 -0
- package/dist/word/semantic/inspect.d.ts +6 -0
- package/dist/word/semantic/inspect.d.ts.map +1 -0
- package/dist/word/semantic/inspect.js +102 -0
- package/dist/word/semantic/inspect.js.map +1 -0
- package/dist/word/semantic/marks.d.ts +30 -0
- package/dist/word/semantic/marks.d.ts.map +1 -0
- package/dist/word/semantic/marks.js +87 -0
- package/dist/word/semantic/marks.js.map +1 -0
- package/dist/word/semantic/numbering.d.ts +18 -0
- package/dist/word/semantic/numbering.d.ts.map +1 -0
- package/dist/word/semantic/numbering.js +93 -0
- package/dist/word/semantic/numbering.js.map +1 -0
- package/dist/word/semantic/numbers.test.d.ts +2 -0
- package/dist/word/semantic/numbers.test.d.ts.map +1 -0
- package/dist/word/semantic/numbers.test.js +53 -0
- package/dist/word/semantic/numbers.test.js.map +1 -0
- package/dist/word/semantic/raw.d.ts +8 -0
- package/dist/word/semantic/raw.d.ts.map +1 -0
- package/dist/word/semantic/raw.js +42 -0
- package/dist/word/semantic/raw.js.map +1 -0
- package/dist/word/semantic/review.test.d.ts +2 -0
- package/dist/word/semantic/review.test.d.ts.map +1 -0
- package/dist/word/semantic/review.test.js +88 -0
- package/dist/word/semantic/review.test.js.map +1 -0
- package/dist/word/semantic/sections.d.ts +25 -0
- package/dist/word/semantic/sections.d.ts.map +1 -0
- package/dist/word/semantic/sections.js +83 -0
- package/dist/word/semantic/sections.js.map +1 -0
- package/dist/word/semantic/snippet.d.ts +10 -0
- package/dist/word/semantic/snippet.d.ts.map +1 -0
- package/dist/word/semantic/snippet.js +34 -0
- package/dist/word/semantic/snippet.js.map +1 -0
- package/dist/word/semantic/styles.d.ts +66 -0
- package/dist/word/semantic/styles.d.ts.map +1 -0
- package/dist/word/semantic/styles.js +354 -0
- package/dist/word/semantic/styles.js.map +1 -0
- package/dist/word/semantic/tables.d.ts +4 -0
- package/dist/word/semantic/tables.d.ts.map +1 -0
- package/dist/word/semantic/tables.js +114 -0
- package/dist/word/semantic/tables.js.map +1 -0
- package/dist/word/semantic/types.d.ts +9 -0
- package/dist/word/semantic/types.d.ts.map +1 -0
- package/dist/word/semantic/types.js +3 -0
- package/dist/word/semantic/types.js.map +1 -0
- package/dist/word/semantic/wml.d.ts +104 -0
- package/dist/word/semantic/wml.d.ts.map +1 -0
- package/dist/word/semantic/wml.js +192 -0
- package/dist/word/semantic/wml.js.map +1 -0
- package/dist/word/word.test.js +31 -53
- package/dist/word/word.test.js.map +1 -1
- package/dist/word/xml.d.ts +16 -0
- package/dist/word/xml.d.ts.map +1 -1
- package/dist/word/xml.js +61 -15
- package/dist/word/xml.js.map +1 -1
- package/dist/word/xml.test.d.ts +2 -0
- package/dist/word/xml.test.d.ts.map +1 -0
- package/dist/word/xml.test.js +46 -0
- package/dist/word/xml.test.js.map +1 -0
- package/package.json +1 -1
- package/dist/word/toDocx/parse.d.ts +0 -46
- package/dist/word/toDocx/parse.d.ts.map +0 -1
- package/dist/word/toDocx/parse.js +0 -313
- package/dist/word/toDocx/parse.js.map +0 -1
- package/dist/word/toDocx/styles.d.ts +0 -63
- package/dist/word/toDocx/styles.d.ts.map +0 -1
- package/dist/word/toDocx/styles.js +0 -239
- package/dist/word/toDocx/styles.js.map +0 -1
- package/dist/word/toDocx/wordml.d.ts +0 -24
- package/dist/word/toDocx/wordml.d.ts.map +0 -1
- package/dist/word/toDocx/wordml.js +0 -114
- package/dist/word/toDocx/wordml.js.map +0 -1
- package/dist/word/toDocx.d.ts +0 -6
- package/dist/word/toDocx.d.ts.map +0 -1
- package/dist/word/toDocx.js +0 -157
- package/dist/word/toDocx.js.map +0 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// Math runs (`m:r`): the token elements of MathML (mi, mn, mo, mtext) and
|
|
2
|
+
// the spaces between them. A run's style (`m:sty`) and script (`m:scr`)
|
|
3
|
+
// come from `mathvariant`; text (`\text{…}`) is a normal-text run (`m:nor`),
|
|
4
|
+
// which `ommlToTex` reads back as `\text{…}`.
|
|
5
|
+
import { escapeAttr, escapeXml } from '../xml.js';
|
|
6
|
+
import { explicitAttr, tokenText } from './mml.js';
|
|
7
|
+
/** mathvariant → run style. */
|
|
8
|
+
const VARIANTS = {
|
|
9
|
+
normal: { sty: 'p' },
|
|
10
|
+
bold: { sty: 'b' },
|
|
11
|
+
italic: { sty: 'i' },
|
|
12
|
+
'bold-italic': { sty: 'bi' },
|
|
13
|
+
'double-struck': { scr: 'double-struck', sty: 'p' },
|
|
14
|
+
script: { scr: 'script', sty: 'p' },
|
|
15
|
+
'bold-script': { scr: 'script', sty: 'b' },
|
|
16
|
+
fraktur: { scr: 'fraktur', sty: 'p' },
|
|
17
|
+
'bold-fraktur': { scr: 'fraktur', sty: 'b' },
|
|
18
|
+
'sans-serif': { scr: 'sans-serif', sty: 'p' },
|
|
19
|
+
'bold-sans-serif': { scr: 'sans-serif', sty: 'b' },
|
|
20
|
+
'sans-serif-italic': { scr: 'sans-serif', sty: 'i' },
|
|
21
|
+
'sans-serif-bold-italic': { scr: 'sans-serif', sty: 'bi' },
|
|
22
|
+
monospace: { scr: 'monospace', sty: 'p' },
|
|
23
|
+
'-tex-calligraphic': { scr: 'script', sty: 'p' },
|
|
24
|
+
'-tex-bold-calligraphic': { scr: 'script', sty: 'b' },
|
|
25
|
+
'-tex-oldstyle': { sty: 'p' },
|
|
26
|
+
};
|
|
27
|
+
/** One `m:r` holding `text`. */
|
|
28
|
+
export function mathRun(text, style = {}, options = {}) {
|
|
29
|
+
if (text === '')
|
|
30
|
+
return '';
|
|
31
|
+
let pr = '';
|
|
32
|
+
if (style.nor)
|
|
33
|
+
pr = '<m:nor/>';
|
|
34
|
+
else {
|
|
35
|
+
if (style.scr)
|
|
36
|
+
pr += `<m:scr m:val="${escapeAttr(style.scr)}"/>`;
|
|
37
|
+
if (style.sty)
|
|
38
|
+
pr += `<m:sty m:val="${style.sty}"/>`;
|
|
39
|
+
}
|
|
40
|
+
const rPr = pr ? `<m:rPr>${pr}</m:rPr>` : '';
|
|
41
|
+
const font = options.font ? `<w:rPr><w:rFonts w:ascii="${escapeAttr(options.font)}" w:hAnsi="${escapeAttr(options.font)}"/></w:rPr>` : '';
|
|
42
|
+
return `<m:r>${rPr}${font}<m:t xml:space="preserve">${escapeXml(text)}</m:t></m:r>`;
|
|
43
|
+
}
|
|
44
|
+
/** The run style of a token from its `mathvariant` (explicit, or the
|
|
45
|
+
* MathML default: a multi-letter `mi` is upright). */
|
|
46
|
+
export function tokenStyle(node, text) {
|
|
47
|
+
if (node.kind === 'mtext' || node.kind === 'ms')
|
|
48
|
+
return { nor: true };
|
|
49
|
+
const variant = explicitAttr(node, 'mathvariant')
|
|
50
|
+
?? node.getProperty?.('variant');
|
|
51
|
+
if (variant !== undefined) {
|
|
52
|
+
const s = VARIANTS[variant];
|
|
53
|
+
// Italic is what Word gives single letters anyway; keep the run bare.
|
|
54
|
+
if (s && !(s.sty === 'i' && !s.scr && node.kind === 'mi' && [...text].length === 1))
|
|
55
|
+
return s;
|
|
56
|
+
if (s)
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
// A word (a function name, `\lim`, `\bmod`) is upright.
|
|
60
|
+
if ((node.kind === 'mi' && [...text].length > 1) || (node.kind === 'mo' && /^[A-Za-z]{2,}$/.test(text)))
|
|
61
|
+
return { sty: 'p' };
|
|
62
|
+
return {};
|
|
63
|
+
}
|
|
64
|
+
/** A token element as a run. */
|
|
65
|
+
export function tokenRun(node, options) {
|
|
66
|
+
const text = tokenText(node);
|
|
67
|
+
// Function application (U+2061) and invisible times/separators are
|
|
68
|
+
// MathML markup, not glyphs Word should set.
|
|
69
|
+
const visible = text.replace(/[-]/g, '');
|
|
70
|
+
return mathRun(visible, tokenStyle(node, visible), options);
|
|
71
|
+
}
|
|
72
|
+
/** Space widths in em → the Unicode space Word sets for it. */
|
|
73
|
+
const SPACES = [
|
|
74
|
+
[2, ' '],
|
|
75
|
+
[1, ' '],
|
|
76
|
+
[0.5, ' '],
|
|
77
|
+
[0.333, ' '],
|
|
78
|
+
[0.278, ' '],
|
|
79
|
+
[0.222, ' '],
|
|
80
|
+
[0.167, ' '],
|
|
81
|
+
[0.111, ' '],
|
|
82
|
+
];
|
|
83
|
+
/** The em width of a MathML length (`0.167em`, `thickmathspace`, `1em`). */
|
|
84
|
+
export function lengthEm(value) {
|
|
85
|
+
if (!value)
|
|
86
|
+
return 0;
|
|
87
|
+
const named = {
|
|
88
|
+
veryverythinmathspace: 1 / 18, verythinmathspace: 2 / 18, thinmathspace: 3 / 18,
|
|
89
|
+
mediummathspace: 4 / 18, thickmathspace: 5 / 18, verythickmathspace: 6 / 18, veryverythickmathspace: 7 / 18,
|
|
90
|
+
};
|
|
91
|
+
if (value in named)
|
|
92
|
+
return named[value];
|
|
93
|
+
const m = /^([-+]?[\d.]+)\s*(em|ex|pt|px|mu|cm|mm|in|pc|bp)?$/.exec(value.trim());
|
|
94
|
+
if (!m)
|
|
95
|
+
return 0;
|
|
96
|
+
const n = parseFloat(m[1]);
|
|
97
|
+
switch (m[2]) {
|
|
98
|
+
case 'ex': return n * 0.43;
|
|
99
|
+
case 'pt': return n / 10;
|
|
100
|
+
case 'px': return n / 16;
|
|
101
|
+
case 'mu': return n / 18;
|
|
102
|
+
// Physical lengths at the 10pt em the other cases assume.
|
|
103
|
+
case 'cm': return (n * 72.27) / 2.54 / 10;
|
|
104
|
+
case 'mm': return (n * 72.27) / 25.4 / 10;
|
|
105
|
+
case 'in': return (n * 72.27) / 10;
|
|
106
|
+
case 'pc': return (n * 12) / 10;
|
|
107
|
+
case 'bp': return (n * 72.27) / 72 / 10;
|
|
108
|
+
default: return n;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/** An `mspace` as a run of Unicode spaces (nothing for a negative or zero
|
|
112
|
+
* width: Word has no negative space). */
|
|
113
|
+
export function spaceRun(node, options) {
|
|
114
|
+
const em = lengthEm(explicitAttr(node, 'width'));
|
|
115
|
+
if (em <= 0.05)
|
|
116
|
+
return '';
|
|
117
|
+
for (const [w, chars] of SPACES)
|
|
118
|
+
if (em >= w - 0.01)
|
|
119
|
+
return mathRun(chars, {}, options);
|
|
120
|
+
return mathRun(' ', {}, options);
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../../src/word/ommlWrite/runs.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wEAAwE;AACxE,6EAA6E;AAC7E,8CAA8C;AAE9C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAgB,MAAM,UAAU,CAAC;AAoBjE,+BAA+B;AAC/B,MAAM,QAAQ,GAA6B;IACzC,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;IACpB,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;IAClB,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;IACpB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AAE,CAAC;QACxC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;AACH,CAAC;AAED;0CAC0C;AAC1C,MAAM,UAAU,QAAQ,CAAC,IAAa,EAAE,OAAmB;IACzD,MAAM,EAAE,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,IAAI,EAAE,IAAI,IAAI;QAAE,OAAO,EAAE,CAAC;IAC1B,KAAK,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM;QAAE,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI;YAAE,OAAO,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACxF,OAAO,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../../src/word/ommlWrite/tables.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmC,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAiBrD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CA0BpE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// `mtable` → a matrix (`m:m`) or, for the display alignments (`aligned`,
|
|
2
|
+
// `align*`, `gathered`, which MathJax marks displaystyle), an equation array
|
|
3
|
+
// (`m:eqArr`) whose rows carry Word's `&` alignment marks.
|
|
4
|
+
import { explicitAttr, kids, unsupported } from './mml.js';
|
|
5
|
+
import { mathRun } from './runs.js';
|
|
6
|
+
import { rowOf, small, wrap } from './convert.js';
|
|
7
|
+
import { convertRow } from './rows.js';
|
|
8
|
+
const JC = { left: 'left', right: 'right', center: 'center' };
|
|
9
|
+
function cellsOf(row) {
|
|
10
|
+
if (row.kind === 'mlabeledtr')
|
|
11
|
+
unsupported('equation tag');
|
|
12
|
+
if (row.kind !== 'mtr')
|
|
13
|
+
unsupported(`table row ${row.kind}`);
|
|
14
|
+
return kids(row);
|
|
15
|
+
}
|
|
16
|
+
function cellContent(cell, opts) {
|
|
17
|
+
// mtd → its inferred row.
|
|
18
|
+
return convertRow(kids(cell).flatMap(rowOf), opts);
|
|
19
|
+
}
|
|
20
|
+
export function convertTable(node, opts) {
|
|
21
|
+
const rows = kids(node).map(cellsOf);
|
|
22
|
+
if (explicitAttr(node, 'displaystyle') === 'true') {
|
|
23
|
+
const amp = mathRun('&', {}, opts);
|
|
24
|
+
const ds = { ...opts, display: true };
|
|
25
|
+
return wrap('eqArr', rows.map((cells) => wrap('e', cells.map((c) => cellContent(c, ds)).join(amp))).join(''));
|
|
26
|
+
}
|
|
27
|
+
opts = small(opts);
|
|
28
|
+
const cols = Math.max(1, ...rows.map((r) => r.length));
|
|
29
|
+
// CT_MCS holds at most 64 column entries.
|
|
30
|
+
if (cols > 64)
|
|
31
|
+
unsupported(`matrix of ${cols} columns`);
|
|
32
|
+
// CT_M needs at least one row: an empty environment is one empty row.
|
|
33
|
+
if (rows.length === 0)
|
|
34
|
+
rows.push([]);
|
|
35
|
+
const aligns = (explicitAttr(node, 'columnalign') ?? '').split(/\s+/).filter(Boolean);
|
|
36
|
+
let mcs = '';
|
|
37
|
+
for (let i = 0; i < cols; i++) {
|
|
38
|
+
// MathML repeats the last value for the remaining columns.
|
|
39
|
+
const a = aligns[Math.min(i, aligns.length - 1)] ?? 'center';
|
|
40
|
+
mcs += `<m:mc><m:mcPr><m:count m:val="1"/><m:mcJc m:val="${JC[a] ?? 'center'}"/></m:mcPr></m:mc>`;
|
|
41
|
+
}
|
|
42
|
+
const body = rows.map((cells) => {
|
|
43
|
+
let r = '';
|
|
44
|
+
for (let i = 0; i < cols; i++)
|
|
45
|
+
r += wrap('e', cells[i] ? cellContent(cells[i], opts) : '');
|
|
46
|
+
return wrap('mr', r);
|
|
47
|
+
}).join('');
|
|
48
|
+
return wrap('m', `<m:mPr><m:mcs>${mcs}</m:mcs></m:mPr>${body}`);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=tables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.js","sourceRoot":"","sources":["../../../src/word/ommlWrite/tables.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,6EAA6E;AAC7E,2DAA2D;AAE3D,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAgB,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,OAAO,EAAmB,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,EAAE,GAA2B,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAEtF,SAAS,OAAO,CAAC,GAAY;IAC3B,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY;QAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IAC3D,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK;QAAE,WAAW,CAAC,aAAa,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAED,SAAS,WAAW,CAAC,IAAa,EAAE,IAAgB;IAClD,0BAA0B;IAC1B,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAa,EAAE,IAAgB;IAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,C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;QAC3D,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC;QAC7D,GAAG,IAAI,oDAAoD,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,qBAAqB,CAAC;IACpG,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9B,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE;YAAE,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC5F,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,IAAI,CAAC,GAAG,EAAE,iBAAiB,GAAG,mBAAmB,IAAI,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const XML_DECL = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
|
|
2
|
+
/** Every namespace either variant writes, plus `mc:Ignorable` for the
|
|
3
|
+
* Word 2010+ ones; used on the document, headers, footers and notes. */
|
|
4
|
+
export declare const WORDML_NAMESPACES: string;
|
|
5
|
+
/** Only `w` and `r`, for settings, styles, numbering and the font table. */
|
|
6
|
+
export declare const W_NAMESPACES: string;
|
|
7
|
+
export declare const REL: {
|
|
8
|
+
readonly officeDocument: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
|
|
9
|
+
readonly coreProps: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
|
|
10
|
+
readonly appProps: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";
|
|
11
|
+
readonly customProps: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties";
|
|
12
|
+
readonly styles: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
|
|
13
|
+
readonly numbering: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering";
|
|
14
|
+
readonly footnotes: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes";
|
|
15
|
+
readonly endnotes: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes";
|
|
16
|
+
readonly settings: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings";
|
|
17
|
+
readonly fontTable: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";
|
|
18
|
+
readonly webSettings: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings";
|
|
19
|
+
readonly header: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";
|
|
20
|
+
readonly footer: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
|
|
21
|
+
readonly comments: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
|
|
22
|
+
readonly customXml: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml";
|
|
23
|
+
readonly customXmlProps: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps";
|
|
24
|
+
readonly image: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
|
|
25
|
+
readonly hyperlink: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
26
|
+
readonly font: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/font";
|
|
27
|
+
};
|
|
28
|
+
export declare const CONTENT_TYPE: {
|
|
29
|
+
readonly document: "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";
|
|
30
|
+
readonly styles: "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";
|
|
31
|
+
readonly numbering: "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml";
|
|
32
|
+
readonly footnotes: "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml";
|
|
33
|
+
readonly endnotes: "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml";
|
|
34
|
+
readonly settings: "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
|
|
35
|
+
readonly fontTable: "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml";
|
|
36
|
+
readonly webSettings: "application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml";
|
|
37
|
+
readonly header: "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml";
|
|
38
|
+
readonly footer: "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";
|
|
39
|
+
readonly comments: "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml";
|
|
40
|
+
readonly customXmlProps: "application/vnd.openxmlformats-officedocument.customXmlProperties+xml";
|
|
41
|
+
readonly coreProps: "application/vnd.openxmlformats-package.core-properties+xml";
|
|
42
|
+
readonly appProps: "application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
|
43
|
+
readonly customProps: "application/vnd.openxmlformats-officedocument.custom-properties+xml";
|
|
44
|
+
};
|
|
45
|
+
/** `Default` content types by extension. */
|
|
46
|
+
export declare const DEFAULT_TYPES: Record<string, string>;
|
|
47
|
+
export interface Rel {
|
|
48
|
+
id: string;
|
|
49
|
+
type: string;
|
|
50
|
+
target: string;
|
|
51
|
+
external?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export declare function relsXml(rels: readonly Rel[]): string;
|
|
54
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/word/ooxml/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,kEAA4D,CAAC;AAoBlF;yEACyE;AACzE,eAAO,MAAM,iBAAiB,QAC0E,CAAC;AAEzG,4EAA4E;AAC5E,eAAO,MAAM,YAAY,QAAwC,CAAC;AAGlE,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;CAoBN,CAAC;AAGX,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAgBf,CAAC;AAEX,4CAA4C;AAC5C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAShD,CAAC;AAEF,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,GAAG,MAAM,CAQpD"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Namespaces, relationship types and content types of the OOXML package.
|
|
2
|
+
export const XML_DECL = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
|
|
3
|
+
const NS = {
|
|
4
|
+
w: 'http://schemas.openxmlformats.org/wordprocessingml/2006/main',
|
|
5
|
+
r: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
|
|
6
|
+
wp: 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing',
|
|
7
|
+
wp14: 'http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing',
|
|
8
|
+
a: 'http://schemas.openxmlformats.org/drawingml/2006/main',
|
|
9
|
+
pic: 'http://schemas.openxmlformats.org/drawingml/2006/picture',
|
|
10
|
+
wps: 'http://schemas.microsoft.com/office/word/2010/wordprocessingShape',
|
|
11
|
+
wpg: 'http://schemas.microsoft.com/office/word/2010/wordprocessingGroup',
|
|
12
|
+
mc: 'http://schemas.openxmlformats.org/markup-compatibility/2006',
|
|
13
|
+
w14: 'http://schemas.microsoft.com/office/word/2010/wordml',
|
|
14
|
+
w15: 'http://schemas.microsoft.com/office/word/2012/wordml',
|
|
15
|
+
m: 'http://schemas.openxmlformats.org/officeDocument/2006/math',
|
|
16
|
+
asvg: 'http://schemas.microsoft.com/office/drawing/2016/SVG/main',
|
|
17
|
+
v: 'urn:schemas-microsoft-com:vml',
|
|
18
|
+
o: 'urn:schemas-microsoft-com:office:office',
|
|
19
|
+
};
|
|
20
|
+
/** Every namespace either variant writes, plus `mc:Ignorable` for the
|
|
21
|
+
* Word 2010+ ones; used on the document, headers, footers and notes. */
|
|
22
|
+
export const WORDML_NAMESPACES = Object.entries(NS).map(([p, uri]) => `xmlns:${p}="${uri}"`).join(' ') + ' mc:Ignorable="w14 w15 wp14"';
|
|
23
|
+
/** Only `w` and `r`, for settings, styles, numbering and the font table. */
|
|
24
|
+
export const W_NAMESPACES = `xmlns:w="${NS.w}" xmlns:r="${NS.r}"`;
|
|
25
|
+
const OFFICE_REL = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/';
|
|
26
|
+
export const REL = {
|
|
27
|
+
officeDocument: `${OFFICE_REL}officeDocument`,
|
|
28
|
+
coreProps: 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties',
|
|
29
|
+
appProps: `${OFFICE_REL}extended-properties`,
|
|
30
|
+
customProps: `${OFFICE_REL}custom-properties`,
|
|
31
|
+
styles: `${OFFICE_REL}styles`,
|
|
32
|
+
numbering: `${OFFICE_REL}numbering`,
|
|
33
|
+
footnotes: `${OFFICE_REL}footnotes`,
|
|
34
|
+
endnotes: `${OFFICE_REL}endnotes`,
|
|
35
|
+
settings: `${OFFICE_REL}settings`,
|
|
36
|
+
fontTable: `${OFFICE_REL}fontTable`,
|
|
37
|
+
webSettings: `${OFFICE_REL}webSettings`,
|
|
38
|
+
header: `${OFFICE_REL}header`,
|
|
39
|
+
footer: `${OFFICE_REL}footer`,
|
|
40
|
+
comments: `${OFFICE_REL}comments`,
|
|
41
|
+
customXml: `${OFFICE_REL}customXml`,
|
|
42
|
+
customXmlProps: `${OFFICE_REL}customXmlProps`,
|
|
43
|
+
image: `${OFFICE_REL}image`,
|
|
44
|
+
hyperlink: `${OFFICE_REL}hyperlink`,
|
|
45
|
+
font: `${OFFICE_REL}font`,
|
|
46
|
+
};
|
|
47
|
+
const WML = 'application/vnd.openxmlformats-officedocument.wordprocessingml.';
|
|
48
|
+
export const CONTENT_TYPE = {
|
|
49
|
+
document: `${WML}document.main+xml`,
|
|
50
|
+
styles: `${WML}styles+xml`,
|
|
51
|
+
numbering: `${WML}numbering+xml`,
|
|
52
|
+
footnotes: `${WML}footnotes+xml`,
|
|
53
|
+
endnotes: `${WML}endnotes+xml`,
|
|
54
|
+
settings: `${WML}settings+xml`,
|
|
55
|
+
fontTable: `${WML}fontTable+xml`,
|
|
56
|
+
webSettings: `${WML}webSettings+xml`,
|
|
57
|
+
header: `${WML}header+xml`,
|
|
58
|
+
footer: `${WML}footer+xml`,
|
|
59
|
+
comments: `${WML}comments+xml`,
|
|
60
|
+
customXmlProps: 'application/vnd.openxmlformats-officedocument.customXmlProperties+xml',
|
|
61
|
+
coreProps: 'application/vnd.openxmlformats-package.core-properties+xml',
|
|
62
|
+
appProps: 'application/vnd.openxmlformats-officedocument.extended-properties+xml',
|
|
63
|
+
customProps: 'application/vnd.openxmlformats-officedocument.custom-properties+xml',
|
|
64
|
+
};
|
|
65
|
+
/** `Default` content types by extension. */
|
|
66
|
+
export const DEFAULT_TYPES = {
|
|
67
|
+
rels: 'application/vnd.openxmlformats-package.relationships+xml',
|
|
68
|
+
xml: 'application/xml',
|
|
69
|
+
png: 'image/png',
|
|
70
|
+
jpeg: 'image/jpeg',
|
|
71
|
+
gif: 'image/gif',
|
|
72
|
+
svg: 'image/svg+xml',
|
|
73
|
+
emf: 'image/x-emf',
|
|
74
|
+
odttf: 'application/vnd.openxmlformats-officedocument.obfuscatedFont',
|
|
75
|
+
};
|
|
76
|
+
export function relsXml(rels) {
|
|
77
|
+
const items = rels
|
|
78
|
+
.map((r) => {
|
|
79
|
+
const target = r.target.replace(/&/g, '&').replace(/</g, '<').replace(/"/g, '"');
|
|
80
|
+
return `<Relationship Id="${r.id}" Type="${r.type}" Target="${target}"${r.external ? ' TargetMode="External"' : ''}/>`;
|
|
81
|
+
})
|
|
82
|
+
.join('');
|
|
83
|
+
return `${XML_DECL}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${items}</Relationships>`;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/word/ooxml/constants.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,MAAM,CAAC,MAAM,QAAQ,GAAG,yDAAyD,CAAC;AAElF,MAAM,EAAE,GAAG;IACT,CAAC,EAAE,8DAA8D;IACjE,CAAC,EAAE,qEAAqE;IACxE,EAAE,EAAE,wEAAwE;IAC5E,IAAI,EAAE,qEAAqE;IAC3E,CAAC,EAAE,uDAAuD;IAC1D,GAAG,EAAE,0DAA0D;IAC/D,GAAG,EAAE,mEAAmE;IACxE,GAAG,EAAE,mEAAmE;IACxE,EAAE,EAAE,6DAA6D;IACjE,GAAG,EAAE,sDAAsD;IAC3D,GAAG,EAAE,sDAAsD;IAC3D,CAAC,EAAE,4DAA4D;IAC/D,IAAI,EAAE,2DAA2D;IACjE,CAAC,EAAE,+BAA+B;IAClC,CAAC,EAAE,yCAAyC;CACpC,CAAC;AAEX;yEACyE;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAC5B,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,8BAA8B,CAAC;AAEzG,4EAA4E;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,EAAE,CAAC,CAAC,cAAc,EAAE,CAAC,C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AM,EAAE,GAAG,GAAG,YAAY;IAC1B,QAAQ,EAAE,GAAG,GAAG,cAAc;IAC9B,cAAc,EAAE,uEAAuE;IACvF,SAAS,EAAE,4DAA4D;IACvE,QAAQ,EAAE,uEAAuE;IACjF,WAAW,EAAE,qEAAqE;CAC1E,CAAC;AAEX,4CAA4C;AAC5C,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,IAAI,EAAE,0DAA0D;IAChE,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,aAAa;IAClB,KAAK,EAAE,8DAA8D;CACtE,CAAC;AASF,MAAM,UAAU,OAAO,CAAC,IAAoB;IAC1C,MAAM,KAAK,GAAG,IAAI;SACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC7F,OAAO,qBAAqB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,IAAI,aAAa,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACzH,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,GAAG,QAAQ,uFAAuF,KAAK,kBAAkB,CAAC;AACnI,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EmbeddedFontFace } from './types.js';
|
|
2
|
+
/** Obfuscate (or de-obfuscate) font bytes with a GUID font key. Returns a copy. */
|
|
3
|
+
export declare function obfuscateFont(bytes: Uint8Array, fontKey: string): Uint8Array;
|
|
4
|
+
/** A deterministic font key for a face (same font, same key). */
|
|
5
|
+
export declare function fontKeyFor(face: EmbeddedFontFace): string;
|
|
6
|
+
export interface FontPart {
|
|
7
|
+
path: string;
|
|
8
|
+
relId: string;
|
|
9
|
+
bytes: Uint8Array;
|
|
10
|
+
}
|
|
11
|
+
/** `word/fontTable.xml`, its font parts and the relationships between them. */
|
|
12
|
+
export declare function fontTable(faces: readonly EmbeddedFontFace[]): {
|
|
13
|
+
xml: string;
|
|
14
|
+
parts: FontPart[];
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=fonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/word/ooxml/fonts.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAWnD,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,CAM5E;AAED,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAEzD;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,UAAU,CAAC;CACnB;AAKD,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;CAAE,CAiChG"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Embedded fonts (ECMA-376 Part 4 §2.8.1): each face is stored as an
|
|
2
|
+
// obfuscated `.odttf` whose first 32 bytes are XORed with the 16 bytes of
|
|
3
|
+
// its GUID font key read in reverse order. The operation is symmetric.
|
|
4
|
+
import { escapeAttr } from '../xml.js';
|
|
5
|
+
import { guidFrom, hashBytes } from '../anchors/hash.js';
|
|
6
|
+
import { W_NAMESPACES, XML_DECL } from './constants.js';
|
|
7
|
+
/** The key bytes of a `{XXXXXXXX-…}` font key: hex pairs from last to first. */
|
|
8
|
+
function keyBytes(fontKey) {
|
|
9
|
+
const hex = fontKey.replace(/[{}-]/g, '');
|
|
10
|
+
if (!/^[0-9a-fA-F]{32}$/.test(hex))
|
|
11
|
+
throw new Error(`obfuscateFont: bad font key ${fontKey}`);
|
|
12
|
+
const key = new Uint8Array(16);
|
|
13
|
+
for (let i = 0; i < 16; i++)
|
|
14
|
+
key[i] = parseInt(hex.substr(30 - i * 2, 2), 16);
|
|
15
|
+
return key;
|
|
16
|
+
}
|
|
17
|
+
/** Obfuscate (or de-obfuscate) font bytes with a GUID font key. Returns a copy. */
|
|
18
|
+
export function obfuscateFont(bytes, fontKey) {
|
|
19
|
+
const key = keyBytes(fontKey);
|
|
20
|
+
const out = bytes.slice();
|
|
21
|
+
const n = Math.min(32, out.length);
|
|
22
|
+
for (let i = 0; i < n; i++)
|
|
23
|
+
out[i] = out[i] ^ key[i % 16];
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
/** A deterministic font key for a face (same font, same key). */
|
|
27
|
+
export function fontKeyFor(face) {
|
|
28
|
+
return guidFrom(`${face.family}\u0000${face.slot}\u0000${hashBytes(face.bytes)}`);
|
|
29
|
+
}
|
|
30
|
+
const SLOT_ORDER = ['regular', 'bold', 'italic', 'boldItalic'];
|
|
31
|
+
const EMBED_ELEMENT = { regular: 'embedRegular', bold: 'embedBold', italic: 'embedItalic', boldItalic: 'embedBoldItalic' };
|
|
32
|
+
/** `word/fontTable.xml`, its font parts and the relationships between them. */
|
|
33
|
+
export function fontTable(faces) {
|
|
34
|
+
const families = new Map();
|
|
35
|
+
for (const f of faces) {
|
|
36
|
+
const list = families.get(f.family) ?? [];
|
|
37
|
+
if (list.some((g) => g.slot === f.slot))
|
|
38
|
+
throw new Error(`fontTable: ${f.family} has two ${f.slot} faces`);
|
|
39
|
+
list.push(f);
|
|
40
|
+
families.set(f.family, list);
|
|
41
|
+
}
|
|
42
|
+
const parts = [];
|
|
43
|
+
let body = '';
|
|
44
|
+
for (const [family, list] of families) {
|
|
45
|
+
const meta = list.find((f) => f.slot === 'regular') ?? list[0];
|
|
46
|
+
let el = `<w:font w:name="${escapeAttr(family)}">`;
|
|
47
|
+
if (meta.panose)
|
|
48
|
+
el += `<w:panose1 w:val="${escapeAttr(meta.panose)}"/>`;
|
|
49
|
+
if (meta.charset)
|
|
50
|
+
el += `<w:charset w:val="${escapeAttr(meta.charset)}"/>`;
|
|
51
|
+
el += `<w:family w:val="${meta.familyClass ?? 'auto'}"/>`;
|
|
52
|
+
el += `<w:pitch w:val="${meta.pitch ?? 'variable'}"/>`;
|
|
53
|
+
if (meta.sig) {
|
|
54
|
+
const s = meta.sig;
|
|
55
|
+
el += `<w:sig w:usb0="${s.usb0}" w:usb1="${s.usb1}" w:usb2="${s.usb2}" w:usb3="${s.usb3}" w:csb0="${s.csb0}" w:csb1="${s.csb1}"/>`;
|
|
56
|
+
}
|
|
57
|
+
for (const slot of SLOT_ORDER) {
|
|
58
|
+
const face = list.find((f) => f.slot === slot);
|
|
59
|
+
if (!face)
|
|
60
|
+
continue;
|
|
61
|
+
const n = parts.length + 1;
|
|
62
|
+
const key = fontKeyFor(face);
|
|
63
|
+
const part = { path: `word/fonts/font${n}.odttf`, relId: `rId${n}`, bytes: obfuscateFont(face.bytes, key) };
|
|
64
|
+
parts.push(part);
|
|
65
|
+
el += `<w:${EMBED_ELEMENT[slot]} r:id="${part.relId}" w:fontKey="${key}"/>`;
|
|
66
|
+
}
|
|
67
|
+
body += `${el}</w:font>`;
|
|
68
|
+
}
|
|
69
|
+
return { xml: `${XML_DECL}<w:fonts ${W_NAMESPACES}>${body}</w:fonts>`, parts };
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=fonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.js","sourceRoot":"","sources":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AC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;YACtH,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,EAAE,IAAI,MAAM,aAAa,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,gBAAgB,GAAG,KAAK,CAAC;QAC9E,CAAC;QACD,IAAI,IAAI,GAAG,EAAE,WAAW,CAAC;IAC3B,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,GAAG,QAAQ,YAAY,YAAY,IAAI,IAAI,YAAY,EAAE,KAAK,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { DocxCoreProps, DocxSettings, EmbeddedFontFace, DocxPackageInput, DocxPackageBuilder } from './types.js';
|
|
2
|
+
export { createDocxPackage } from './package.js';
|
|
3
|
+
export { WORDML_NAMESPACES, W_NAMESPACES, REL, CONTENT_TYPE } from './constants.js';
|
|
4
|
+
export { obfuscateFont, fontKeyFor } from './fonts.js';
|
|
5
|
+
export { validateDocxPackage } from './validate.js';
|
|
6
|
+
export { xmlProblems } from './wellFormed.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/word/ooxml/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtH,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// The OOXML package layer both Word variants build on (#1389).
|
|
2
|
+
export { createDocxPackage } from './package.js';
|
|
3
|
+
export { WORDML_NAMESPACES, W_NAMESPACES, REL, CONTENT_TYPE } from './constants.js';
|
|
4
|
+
export { obfuscateFont, fontKeyFor } from './fonts.js';
|
|
5
|
+
export { validateDocxPackage } from './validate.js';
|
|
6
|
+
export { xmlProblems } from './wellFormed.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/word/ooxml/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAG/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WORDML_NAMESPACES, W_NAMESPACES } from './constants.js';
|
|
2
|
+
import type { DocxPackageBuilder, DocxPackageInput } from './types.js';
|
|
3
|
+
interface MediaEntry {
|
|
4
|
+
relId: string;
|
|
5
|
+
path: string;
|
|
6
|
+
bytes: Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
export declare function createDocxPackage(): DocxPackageBuilder;
|
|
9
|
+
interface Collected {
|
|
10
|
+
media: MediaEntry[];
|
|
11
|
+
links: Map<string, string>;
|
|
12
|
+
headers: Map<string, string>;
|
|
13
|
+
footers: Map<string, string>;
|
|
14
|
+
}
|
|
15
|
+
/** Every part of the package, `[Content_Types].xml` first. */
|
|
16
|
+
export declare function assemble(input: DocxPackageInput, c: Collected): Map<string, Uint8Array>;
|
|
17
|
+
/** Deterministic zip: fixed timestamps, insertion order, media stored. */
|
|
18
|
+
export declare function zipParts(parts: Map<string, Uint8Array>): Uint8Array;
|
|
19
|
+
/** For tests and callers that write `w` parts outside the package. */
|
|
20
|
+
export { W_NAMESPACES, WORDML_NAMESPACES };
|
|
21
|
+
//# sourceMappingURL=package.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../../src/word/ooxml/package.ts"],"names":[],"mappings":"AAQA,OAAO,EAAuD,iBAAiB,EAAE,YAAY,EAAY,MAAM,gBAAgB,CAAC;AAGhI,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAIvE,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;CACnB;AAmBD,wBAAgB,iBAAiB,IAAI,kBAAkB,CAmDtD;AAED,UAAU,SAAS;IACjB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,8DAA8D;AAC9D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAAE,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CA2GvF;AAED,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,UAAU,CAOnE;AAED,sEAAsE;AACtE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|