js.documents 1.60.1 → 1.60.2

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.
Files changed (74) hide show
  1. package/README.md +4 -4
  2. package/dist/convert/convert.cjs +1 -2
  3. package/dist/convert/convert.js +2 -3
  4. package/dist/edit/docx/content.d.cts +1 -1
  5. package/dist/edit/docx/content.d.ts +1 -1
  6. package/dist/edit/odg/content.d.cts +1 -1
  7. package/dist/edit/odg/content.d.ts +1 -1
  8. package/dist/edit/odp/content.d.cts +1 -1
  9. package/dist/edit/odp/content.d.ts +1 -1
  10. package/dist/edit/ods/content.d.cts +1 -1
  11. package/dist/edit/ods/content.d.ts +1 -1
  12. package/dist/edit/odt/content.d.cts +1 -2
  13. package/dist/edit/odt/content.d.ts +1 -2
  14. package/dist/edit/pptx/content.d.cts +1 -1
  15. package/dist/edit/pptx/content.d.ts +1 -1
  16. package/dist/index.cjs +12 -3
  17. package/dist/index.d.cts +1 -2
  18. package/dist/index.d.ts +1 -2
  19. package/dist/index.js +1 -2
  20. package/dist/layout/drawing.d.cts +1 -2
  21. package/dist/layout/drawing.d.ts +1 -2
  22. package/dist/layout/engine.d.cts +1 -2
  23. package/dist/layout/engine.d.ts +1 -2
  24. package/dist/layout/reconstruct.cjs +5 -5
  25. package/dist/layout/reconstruct.d.cts +1 -2
  26. package/dist/layout/reconstruct.d.ts +1 -2
  27. package/dist/layout/reconstruct.js +5 -5
  28. package/dist/layout/sheets.d.cts +1 -2
  29. package/dist/layout/sheets.d.ts +1 -2
  30. package/dist/layout/slides.d.cts +1 -2
  31. package/dist/layout/slides.d.ts +1 -2
  32. package/dist/markdown/read.cjs +1 -7
  33. package/dist/markdown/read.d.cts +1 -1
  34. package/dist/markdown/read.d.ts +1 -1
  35. package/dist/markdown/read.js +1 -7
  36. package/dist/markdown/write.d.cts +1 -1
  37. package/dist/markdown/write.d.ts +1 -1
  38. package/dist/odb/spreadsheet.cjs +1 -2
  39. package/dist/odb/spreadsheet.d.cts +1 -1
  40. package/dist/odb/spreadsheet.d.ts +1 -1
  41. package/dist/odb/spreadsheet.js +2 -2
  42. package/dist/odf/formula/placeholder.cjs +1 -2
  43. package/dist/odf/formula/placeholder.d.cts +4 -4
  44. package/dist/odf/formula/placeholder.d.ts +4 -4
  45. package/dist/odf/formula/placeholder.js +2 -2
  46. package/dist/odf/odg/read.cjs +2 -2
  47. package/dist/odf/odg/read.d.cts +1 -1
  48. package/dist/odf/odg/read.d.ts +1 -1
  49. package/dist/odf/odg/read.js +2 -2
  50. package/dist/odf/odp/read.cjs +2 -2
  51. package/dist/odf/odp/read.d.cts +1 -1
  52. package/dist/odf/odp/read.d.ts +1 -1
  53. package/dist/odf/odp/read.js +2 -2
  54. package/dist/odf/ods/read.cjs +2 -2
  55. package/dist/odf/ods/read.d.cts +1 -1
  56. package/dist/odf/ods/read.d.ts +1 -1
  57. package/dist/odf/ods/read.js +2 -2
  58. package/dist/odf/odt/read.cjs +2 -2
  59. package/dist/odf/odt/read.d.cts +1 -1
  60. package/dist/odf/odt/read.d.ts +1 -1
  61. package/dist/odf/odt/read.js +2 -2
  62. package/dist/ooxml/docx/read.cjs +2 -2
  63. package/dist/ooxml/docx/read.d.cts +1 -1
  64. package/dist/ooxml/docx/read.d.ts +1 -1
  65. package/dist/ooxml/docx/read.js +2 -2
  66. package/dist/ooxml/pptx/read.cjs +2 -2
  67. package/dist/ooxml/pptx/read.d.cts +1 -1
  68. package/dist/ooxml/pptx/read.d.ts +1 -1
  69. package/dist/ooxml/pptx/read.js +2 -2
  70. package/package.json +1 -1
  71. package/dist/model/content.cjs +0 -34
  72. package/dist/model/content.d.cts +0 -362
  73. package/dist/model/content.d.ts +0 -362
  74. package/dist/model/content.js +0 -32
package/README.md CHANGED
@@ -156,7 +156,7 @@ const { kind, value } = documentFromJson(JSON.parse(readFileSync('converted.doc.
156
156
  // kind: 'DocumentPackage' (here) | 'ContentDocument' | 'LayoutDocument'
157
157
  ```
158
158
 
159
- `contentDocumentWithSchema`/`layoutDocumentWithSchema` are the `ContentDocument`/`LayoutDocument` equivalents — note these operate on `document-schema.js`'s own `ContentDocument` shape, not this package's own, differently-shaped `ContentDocument`/`ContentDocumentSchema` (a thinner per-conversion envelope wrapping `ContentSection`/`ContentSlide`/`ContentSheet`/`ContentDrawPage`, exported above); import `ContentDocument`/`ContentDocumentSchema` directly from `document-schema.js` if you need to construct one for `contentDocumentWithSchema`.
159
+ `contentDocumentWithSchema`/`layoutDocumentWithSchema` are the `ContentDocument`/`LayoutDocument` equivalents — these operate on the identical `ContentDocument`/`ContentDocumentSchema` this package imports and re-exports from `document-schema.js` above (a discriminated union of `wordprocessing`/`presentation`/`spreadsheet`/`drawing` variants wrapping `ContentSection`/`ContentSlide`/`ContentSheet`/`ContentDrawPage`), so no separate import or conversion step is needed to construct one for `contentDocumentWithSchema`.
160
160
 
161
161
  Reading and editing docx/pptx content directly, without going through PDF at all:
162
162
 
@@ -353,7 +353,7 @@ This works via a `"./*"` wildcard entry in `package.json`'s `exports` map, resol
353
353
 
354
354
  The package is layered from generic primitives outward to the two conversion directions:
355
355
 
356
- - **`src/model/`** — thin, documents.js-specific additions on top of the sibling [`document-schema.js`](https://github.com/ExaDev/document-schema.js) package, which now owns the two pivot models themselves: `LayoutDocument` (the PDF-side pivot: pages of positioned text/image/rect/line/ellipse/path/link items, PDF-native coordinates and units — `LayoutPath` is a general vector path, one or more subpaths of line/cubic segments sharing one fill/fillRule/stroke, the item kind `writePath`, pdf-codec's own content-write.ts, turns into PDF `m`/`l`/`c`/`h` content-stream operators) and `ContentDocument` (the semantic pivot: a discriminated union of `wordprocessing`, `presentation`, `spreadsheet`, and `drawing` variants sharing paragraph/run/table/image building blocks, `drawing`'s own `ContentVector` vocabulary — rect/ellipse/line/path — being the vector-primitive counterpart to the shared `ContentShape`) are both imported, not defined here — `document-schema.js` exists specifically so `ooxml.js`, `odf.js`, `pdf-codec`, and `documents.js` share one schema instead of each maintaining an independent, drift-prone copy. What remains local: `bytes.ts` (magic-byte-validated `Uint8Array` schemas for docx/pptx/PDF, plus `Odt`/`Ods`/`Odp`/`OdgBytesSchema`, which check the package's actual declared media type against `odf.js`'s `ODF_MEDIA_TYPES` table rather than only the generic ZIP signature the OOXML schemas are limited to), `units.ts` (OOXML EMU/twip/point/half-point conversions), and `geometry.ts`/`color.ts`/`style.ts`, each now mostly a thin re-export of `document-schema.js`'s `Box`/`Margins`/`PageSize`/`Color`/`Alignment`/`LayoutFont` — the one genuinely PDF-specific piece each still adds locally is `geometry.ts`'s `flipY` (the top-left/y-down ↔ bottom-left/y-up space conversion between OOXML/ODF and PDF coordinates); `LayoutFont`/`DEFAULT_LAYOUT_FONT` moved to `document-schema.js` too (since `LayoutText`, part of the pivot, needs the field), leaving only the standard-14 font *resolution* logic that consumes it (pdf-codec's own `fonts.ts`/`font-read.ts`) as PDF-specific, now external to this package entirely. `content.ts` holds the one genuinely local piece of the `ContentDocument` envelope (`CONTENT_FORMAT_VERSION`), and `formula.ts` defines `EmbeddedFormula` — the side-channel formula shape threaded alongside a `ContentDocument` rather than inside it (see the Usage section above), with a type-only dependency on `MathMlNode` from `mathml` (see the dependency-direction note below). `PositionedFormula` (the equivalent side-channel shape for a `LayoutDocument`) now lives in `pdf-codec` itself, which redeclares its own structurally-identical copy of it and of `MathBox` — see [Architecture](#architecture) below and pdf-codec's own README for why a real `MathBox` this package's `layoutFormula` produces crosses that package boundary with zero cast or wrapper.
356
+ - **`src/model/`** — thin, documents.js-specific additions on top of the sibling [`document-schema.js`](https://github.com/ExaDev/document-schema.js) package, which now owns the two pivot models themselves: `LayoutDocument` (the PDF-side pivot: pages of positioned text/image/rect/line/ellipse/path/link items, PDF-native coordinates and units — `LayoutPath` is a general vector path, one or more subpaths of line/cubic segments sharing one fill/fillRule/stroke, the item kind `writePath`, pdf-codec's own content-write.ts, turns into PDF `m`/`l`/`c`/`h` content-stream operators) and `ContentDocument` (the semantic pivot: a discriminated union of `wordprocessing`, `presentation`, `spreadsheet`, and `drawing` variants sharing paragraph/run/table/image building blocks, `drawing`'s own `ContentVector` vocabulary — rect/ellipse/line/path — being the vector-primitive counterpart to the shared `ContentShape`) are both imported, not defined here — `document-schema.js` exists specifically so `ooxml.js`, `odf.js`, `pdf-codec`, and `documents.js` share one schema instead of each maintaining an independent, drift-prone copy. What remains local: `bytes.ts` (magic-byte-validated `Uint8Array` schemas for docx/pptx/PDF, plus `Odt`/`Ods`/`Odp`/`OdgBytesSchema`, which check the package's actual declared media type against `odf.js`'s `ODF_MEDIA_TYPES` table rather than only the generic ZIP signature the OOXML schemas are limited to), `units.ts` (OOXML EMU/twip/point/half-point conversions), and `geometry.ts`/`color.ts`/`style.ts`, each now mostly a thin re-export of `document-schema.js`'s `Box`/`Margins`/`PageSize`/`Color`/`Alignment`/`LayoutFont` — the one genuinely PDF-specific piece each still adds locally is `geometry.ts`'s `flipY` (the top-left/y-down ↔ bottom-left/y-up space conversion between OOXML/ODF and PDF coordinates); `LayoutFont`/`DEFAULT_LAYOUT_FONT` moved to `document-schema.js` too (since `LayoutText`, part of the pivot, needs the field), leaving only the standard-14 font *resolution* logic that consumes it (pdf-codec's own `fonts.ts`/`font-read.ts`) as PDF-specific, now external to this package entirely. `ContentDocument`/`ContentDocumentSchema`/`CONTENT_FORMAT_VERSION` themselves have no local file at all any more — every consumer imports them directly from `document-schema.js`, which owns the envelope as well as everything it wraps. `formula.ts` defines `EmbeddedFormula` — the side-channel formula shape threaded alongside a `ContentDocument` rather than inside it (see the Usage section above), with a type-only dependency on `MathMlNode` from `mathml` (see the dependency-direction note below). `PositionedFormula` (the equivalent side-channel shape for a `LayoutDocument`) now lives in `pdf-codec` itself, which redeclares its own structurally-identical copy of it and of `MathBox` — see [Architecture](#architecture) below and pdf-codec's own README for why a real `MathBox` this package's `layoutFormula` produces crosses that package boundary with zero cast or wrapper.
357
357
  - **The hand-written PDF codec, and the generic byte/image primitives it depends on, are now the external [`pdf-codec`](https://github.com/ExaDev/pdf-codec) dependency** rather than local `src/pdf/`/`src/bytes/`/`src/image/` directories — see that package's own README for its internal architecture (the object model, cross-reference handling, content-stream interpreter, standard-14 font resolution, the embedded math-font writer, and the generic byte/PNG/JPEG primitives it exports for a layout engine like this package's own `src/layout/` to build on).
358
358
  - **`src/ports/`** — the injectable ports this package's own "identity, clock, and observability are first-class ports" convention calls for: `abort.ts`'s `throwIfAborted` (a signal-check helper called at row loop boundaries in `src/layout/sheets.ts`/`reconstruct.ts` — the codebase has no `await` point for cancellation to hook into implicitly, since the local pipeline is synchronous end to end, so every long-running loop checks explicitly instead; `pdf-codec` needed the identical helper for its own page loops and now carries its own independently-duplicated copy rather than depending on this package for it) and `clock.ts`'s `ClockPort`/`systemClock`/`fixedClock` (an injectable "now", for deterministic PDF output in tests). `ClockPort` is exported and tested in isolation but not yet consumed by any conversion path — `writePdf`'s own `/CreationDate`/`/ModDate` come directly from `LayoutDocument.metadata.createdIso`/`modifiedIso` when present, with nothing in pdf-codec's own write path calling `new Date()` to fill in a missing one, so there is currently no real call site for `ClockPort` to inject into. A real, tracked gap in wiring, not a documentation gap: a future default-timestamp write path should consume it rather than reaching for `new Date()` directly.
359
359
  - **`src/xml/`** and **`src/opc/`** — parent-aware XML query/mutation and OPC package mechanics (relationship IDs, content-type entries, atomic media-part insertion) built over `ooxml.js`'s `Package`/`XmlNode`, needed because `ooxml.js`'s own XML nodes have no parent pointers and `ooxml.js` never writes new parts into an existing package. `src/xml/odf-text.ts` is the one ODF-specific module in this directory: `encodeOdfText`/`decodeOdfText` convert between a plain string and ODF's own whitespace-run element sequence (`text:s` for a run of two or more literal spaces, `text:tab`, `text:line-break` — all three occupy real character positions in an ODF paragraph but are ELEMENTS, not text-node characters, unlike docx's flat `w:t` run text) — see the Gotchas entry below on why every ODF text getter in this codebase must call `decodeOdfText`, never `ooxml.js`'s own plain-text-node `textContent()`.
@@ -369,7 +369,7 @@ The package is layered from generic primitives outward to the two conversion dir
369
369
  - **`src/odb/`** — the decoder-selection and pivot-mapping layer sitting between odf.js's `.odb` support and `src/hsqldb/`/`src/firebird/`: `read.ts`'s `readOdbTables(pkg)` calls odf.js's own `readOdbInventory` to classify the package's connection (throwing `OdbNoEmbeddedDataSourceError` for an external-only datasource) and its embedded engine, then routes a genuine HSQLDB TEXT script to `parseHsqldbScript`, then — whenever a `database/data` part is present — hands Tier 1's own result to `src/hsqldb/cache.ts`'s `decodeHsqldbCachedTables` to splice in every CACHED table's real rows (a `.odb` with no CACHED table at all, the common case, never even looks for `database/data`, leaving Tier 1's own result untouched), or routes a Firebird `database/firebird.fbk` part to `readFirebirdBackup` — throwing `OdbUnsupportedFormatError` (naming HSQLDB's own whole-script binary/compressed serialisation explicitly, the one embedded shape still unimplemented) for anything none of these cover. `spreadsheet.ts`'s `odbTablesToSpreadsheetDocument` maps `HsqldbTable[]` onto the same `ContentSheet`-based `ContentDocument` spreadsheet variant `readOdsContent`/`buildOdsPackage` already produce and consume, feeding `odbToXlsx`'s call into `buildXlsxPackage` directly. `csv.ts`'s `buildOdbTableCsv` writes exactly one named table as CSV bytes, with no `ContentSheet`/xlsx machinery involved at all, throwing `OdbTableNotSpecifiedError`/`OdbTableNotFoundError` (naming every available table) when the caller's own `table` option doesn't resolve to exactly one table.
370
370
  - **`src/convert/`** — `convert.ts` (the fourteen PDF-pivot round-trip ergonomic wrappers — docx/pptx/odt/odp/ods/odg each with a genuine layout-engine edge, `xlsxToPdf`/`pdfToXlsx` composing the ods⇄xlsx bridge with the ods⇄pdf layout pair internally, and `markdownToPdf`/`pdfToMarkdown` reusing the wordprocessing layout engine directly — plus a dedicated "cross-format bridges" section, ten functions across five pairs: `odtToDocx`/`docxToOdt`, `odpToPptx`/`pptxToOdp`, `odsToXlsx`/`xlsxToOds`, and `markdownToDocx`/`docxToMarkdown`, `markdownToOdt`/`odtToMarkdown`, each a direct `readXContent` → `buildYPackage` composition bypassing PDF entirely — see [Fidelity](#fidelity) — `odmToPdf`, the one further conversion shaped around a caller-supplied `resolveSubDocument` callback rather than being purely bytes-in/bytes-out, since a `.odm` master document's own chapters are external references odf.js's `readOdm` never inlines — see Gotchas — `odbToXlsx`/`odbToCsv`, thin compositions over `readOdbTables` and `src/odb/`'s own pivot/CSV mapping, and `odfToPdf`, a standalone `.odf` formula document → PDF via `readOdfFormulaContent` → `src/mathml`'s `layoutFormula` → `writePdf`'s own formula-aware option, with no reverse `pdfToOdf` at all), `codec.ts` (`docxPdfCodec`/`pptxPdfCodec`/`odtPdfCodec`/`odpPdfCodec`/`odsPdfCodec`/`odgPdfCodec`/`xlsxPdfCodec`/`markdownPdfCodec` plus `odtDocxCodec`/`odpPptxCodec`/`odsXlsxCodec`/`markdownDocxCodec`/`markdownOdtCodec`, a `z.codec()` pair over each — `odmToPdf`/`odbToXlsx`/`odbToCsv`/`odfToPdf` have no codec of their own, for the same fixed-signature/one-directional reasons each has no port entry, or a one-way port entry, below), `port.ts`/`local.ts` (the swappable `DocumentConverter` contract and its synchronous local implementation, covering `docx`/`pptx`/`odt`/`odp`/`ods`/`odg`/`odf`/`xlsx`/`markdown` → `pdf`, `pdf` → `docx`/`pptx`/`odt`/`odp`/`ods`/`odg`/`xlsx`/`markdown`, and the ten bridge functions — `DocumentFormat` includes `xlsx` even though xlsx has no PDF conversion of its own (the port composes one, see `xlsxToPdf`); `odm` and `odb` are deliberately not `DocumentFormat` members, since neither `odmToPdf` nor `odbToXlsx`/`odbToCsv` is wired into this port at all; `odf` IS a member, but with only the one `odf → pdf` entry — no `pdf → odf`). Every conversion function that builds a `ContentDocument`/`LayoutDocument` internally (the fourteen PDF-pivot conversions and the ten bridges; `odfToPdf` accepts but never invokes it) also accepts an `onDocument` callback, and `ConversionResult` carries the same value through the port as an optional `package` field — the full `DocumentPackage` (content + layout, from `document-schema.js`) that conversion built, not just its target bytes.
371
371
 
372
- Dependency direction among this package's own local modules is downward and checkable, with one deliberate exception (`layout`, noted below): `mathml`/`ports` import nothing local (`mathml` is fully self-contained — no dependency on `model`, `document-schema.js`, or any ODF package, since it consumes only its own locally-mirrored `MathMlNode` input and its own injected `MathFontMetrics` port); `model` imports nothing local at the value level, but `formula.ts` carries one type-only import of `MathMlNode` from `mathml` (erased entirely at runtime, and not a cycle — `mathml` itself imports nothing from `model`); `ooxml/*` imports `model` only (now a thin adapter over `ooxml.js`'s own `readDocx`/`readPptx` — see the `src/ooxml/` entry above — with no `xml/*` dependency of its own left; no PDF knowledge either); `odf/*` imports `model` only (no PDF knowledge, no `xml/*` — `odf.js` already owns its own XML query helpers); `markdown` imports `model` only, plus the external `markdown-codec` dependency directly (no PDF knowledge, no odf.js/ooxml.js knowledge at all — the one adapter package in this family whose source format is not a zip archive); `hsqldb` imports `document-schema.js` only (no odf.js knowledge); `firebird` imports `document-schema.js` (its own row/schema decoding, `ContentCellValue` only) and `hsqldb` (`HsqldbTable`/`HsqldbColumn`, a type-only import for its own output shape — the deliberate pivot-sharing point between Tier 1 and Tier 3) but no odf.js knowledge at all; `layout` imports `model`+`mathml`+`ports`, plus, genuinely upward and outward, several text-measurement/font-metric/matrix primitives from the external `pdf-codec` dependency (`measure.ts`/`text-layout.ts`/`math-font.ts`/`matrix.ts`/`afm-widths.ts`/`fonts.ts` — see the `src/layout/` entry above for exactly which); `odf-package` imports odf.js only (no local dependency, mirroring `opc`'s relationship to `ooxml.js`); `odb` imports `hsqldb`+`firebird`+`model`+`odf-package`+odf.js only; `convert` composes everything else, including `pdf-codec` directly for `readPdf`/`writePdf`/`loadMathFont` and `markdown-codec` indirectly via `markdown/read.ts`/`markdown/write.ts`/`markdown/text.ts`. Beyond this package's own local modules, five external dependencies each own a distinct concern with no overlap: `ooxml.js` (docx/pptx/xlsx ⇄ JSON), `odf.js` (odt/ods/odp/odg ⇄ JSON), `document-schema.js` (the shared `ContentDocument`/`LayoutDocument` schemas), `pdf-codec` (the PDF codec itself, plus the text-layout/font-resolution/byte/image primitives built on it), and `markdown-codec` (CommonMark+GFM ⇄ `ContentDocument`). No `PdfObject`/`PdfDict`/`PdfStream` type appears anywhere in this package at all — that type is pdf-codec's own internal concern now, never exposed across the package boundary.
372
+ Dependency direction among this package's own local modules is downward and checkable, with one deliberate exception (`layout`, noted below): `mathml`/`ports` import nothing local (`mathml` is fully self-contained — no dependency on `model`, `document-schema.js`, or any ODF package, since it consumes only its own locally-mirrored `MathMlNode` input and its own injected `MathFontMetrics` port); `model` imports nothing local at the value level, but `formula.ts` carries one type-only import of `MathMlNode` from `mathml` (erased entirely at runtime, and not a cycle — `mathml` itself imports nothing from `model`); `ooxml/*` imports no local module at all (now a thin adapter over `ooxml.js`'s own `readDocx`/`readPptx` — see the `src/ooxml/` entry above — with no `model`/`xml/*` dependency of its own left, since `ContentDocument`/`CONTENT_FORMAT_VERSION` now come straight from `document-schema.js`; no PDF knowledge either); `odf/*` imports `model` only, and only for `formula.ts`'s `EmbeddedFormula`/`geometry.ts`'s `Box`/`PAGE_SIZE_A4` (its own `ContentDocument`/`CONTENT_FORMAT_VERSION` usage is `document-schema.js`-direct too now — no PDF knowledge, no `xml/*` — `odf.js` already owns its own XML query helpers); `markdown` imports no local module at all, plus the external `markdown-codec` dependency directly (no PDF knowledge, no odf.js/ooxml.js knowledge at all — the one adapter package in this family whose source format is not a zip archive); `hsqldb` imports `document-schema.js` only (no odf.js knowledge); `firebird` imports `document-schema.js` (its own row/schema decoding, `ContentCellValue` only) and `hsqldb` (`HsqldbTable`/`HsqldbColumn`, a type-only import for its own output shape — the deliberate pivot-sharing point between Tier 1 and Tier 3) but no odf.js knowledge at all; `layout` imports `model`+`mathml`+`ports`, plus, genuinely upward and outward, several text-measurement/font-metric/matrix primitives from the external `pdf-codec` dependency (`measure.ts`/`text-layout.ts`/`math-font.ts`/`matrix.ts`/`afm-widths.ts`/`fonts.ts` — see the `src/layout/` entry above for exactly which); `odf-package` imports odf.js only (no local dependency, mirroring `opc`'s relationship to `ooxml.js`); `odb` imports `hsqldb`+`firebird`+`model`+`odf-package`+odf.js only; `convert` composes everything else, including `pdf-codec` directly for `readPdf`/`writePdf`/`loadMathFont` and `markdown-codec` indirectly via `markdown/read.ts`/`markdown/write.ts`/`markdown/text.ts`. Beyond this package's own local modules, five external dependencies each own a distinct concern with no overlap: `ooxml.js` (docx/pptx/xlsx ⇄ JSON), `odf.js` (odt/ods/odp/odg ⇄ JSON), `document-schema.js` (the shared `ContentDocument`/`LayoutDocument` schemas), `pdf-codec` (the PDF codec itself, plus the text-layout/font-resolution/byte/image primitives built on it), and `markdown-codec` (CommonMark+GFM ⇄ `ContentDocument`). No `PdfObject`/`PdfDict`/`PdfStream` type appears anywhere in this package at all — that type is pdf-codec's own internal concern now, never exposed across the package boundary.
373
373
 
374
374
  ## Build, test, and lint
375
375
 
@@ -449,7 +449,7 @@ To run a single test file: `pnpm vitest run src/path/to/file.test.ts`.
449
449
  - **Embedded-formula detection inside odt/odp is genuinely new work with no `odf.js`-side equivalent (`readDrawFrameContent` doesn't recognise a `draw:object`-bearing `draw:frame` at all yet — see the `src/odf/` architecture entry above), and each format's own detection carries its own real, bounded scope narrowing.** For **odt** (`src/odf/odt/read.ts`): only a `draw:frame` that is a *direct child of `office:text`* is detected — a formula anchored inline inside a paragraph's own run content, or nested inside a `draw:g` group, is not. Detected formulas are appended to the **end** of the section's own `blocks` array, in the order their frames appear in the document, not interleaved at their true original position among the paragraphs/tables `odf.js`'s own reader already produced — true positional interleaving would need per-element block-count bookkeeping this adapter doesn't have (a `text:list`, for instance, unwraps into many `ContentParagraph` blocks from one raw XML element, so "one raw child = one block" doesn't hold in general). For **odp** (`src/odf/odp/read.ts`): only a top-level `draw:frame` on a `draw:page` with no `draw:g` sibling at all is detected (a slide containing any group is skipped entirely for formula detection, to avoid mismatching a formula onto the wrong shape) — but where it IS detected, position is exact, not appended: `odf.js`'s own `walkDrawShapes` already produces exactly one `ContentShape` per top-level `draw:frame` in document order, so the Nth frame maps precisely onto `shapes[N]`. **ods embedded-formula detection is not implemented at all** — `odf.js`'s `readOds` has no existing floating-drawing/anchor-resolution mechanism (`ContentSheetImage`/`ContentSheet.embeddedObjects` are both already-known, pre-existing unpopulated gaps this task does not newly create — see the `ContentSheetCellSchema` gotcha above for the sibling gap on the write side), so there is no `readDrawFrame`-equivalent entry point to hook a formula-frame scan onto the way odt/odp have; `src/layout/sheets.ts` accordingly has no formula-handling branch at all, with a comment marking why.
450
450
  - **A formula that isn't rendered as real MathML (an odm chapter's own embedded formula, or any formula crossing the `odtToDocx`/`docxToOdt`/`odpToPptx`/`pptxToOdp` bridges) survives only as its own plain-text placeholder** — the formula's StarMath annotation if it had one, or the literal `[formula]` otherwise (see `src/odf/formula/placeholder.ts`). `odmToPdf`'s own per-chapter `readOdtContent` call discards that chapter's own `formulas` map entirely (re-keying every formula's `sourcePath` against the final combined document's own renumbered block indices is a materially larger undertaking than this task's own scope, and `.odm` has no confirmed real-world test fixture to validate it against regardless — see the `odmToPdf` gotcha below). `buildDocxPackage` has no MathML-writing path of its own (OOXML's own math markup, OMML, is a different vocabulary this package does not write), so none of the ten cross-format bridges ever consult a formula's real MathML either, even when bridging between two formats that both, individually, support real formula rendering elsewhere in this package — for the two markdown bridges specifically, there is nothing to consult regardless, since markdown has no formula/embedded-object construct of its own for `readMarkdownContent` to detect in the first place.
451
451
  - **`sourcePath` traces a `LayoutItem` back to the `ContentDocument` node it came from, but only within one read+layout pass.** `ooxml.js`'s `readDocx`/`readPptx` stamp every `ContentRun`/`ContentImageBlock`/`ContentTable`/`ContentShape` with a positional path (`sections[0].blocks[2].runs[1]`, `slides[1].shapes[3].blocks[0]`); `convertWordprocessingToLayout`/`convertPresentationToLayout` copy that same string onto whichever `LayoutText`/`LayoutImage`/`LayoutLink`/`LayoutRect` item(s) it produces, so a positioned PDF-side item can be traced back to its semantic origin. When line-wrapping splits one run's word across a run boundary, every resulting fragment gets its own run's path (not a shared or merged one); when a single run is emergency-split across several lines or pages, every resulting fragment keeps that same one run's path unchanged. A table cell's background `LayoutRect` is attributed to its containing table's own `sourcePath`, since `ContentTableCell` carries none of its own. This is **not** an edit-tracking or incremental-relayout mechanism — the path is only valid against the exact `ContentDocument`/`Package` it was assigned from in that one read; editing the document, re-reading it, or reordering its blocks invalidates every previously-captured path, and nothing here recomputes or diffs paths across two versions of a document.
452
- - **`readMarkdownContent` re-stamps `documents.js`'s own `CONTENT_FORMAT_VERSION` onto a fresh envelope rather than passing markdown-codec's `readMarkdown` return value straight through**, even though both are, today, structurally identical `wordprocessing`-variant `ContentDocument` shapes. `markdown-codec`'s own `readMarkdown` produces a full `document-schema.js` `ContentDocument` directly (see that package's own `src/read.ts` module comment for the recorded reconciliation decision behind that choice); `documents.js` still owns an independently-versioned local `ContentDocumentSchema` (`src/model/content.ts`), so `readMarkdownContent` follows the exact same re-stamping template every other `readXContent` adapter in this package already does, rather than being a special case.
452
+ - **`readMarkdownContent` passes markdown-codec's `readMarkdown` return value straight through, unlike `readDocxContent`/`readOdtContent`/etc., which build a fresh `ContentDocument` envelope from a narrower, format-specific shape.** `markdown-codec`'s own `readMarkdown` already produces a full `document-schema.js` `ContentDocument` directly (`kind`/`formatVersion`/`metadata`/`sections`) the identical `ContentDocument` type `documents.js` itself imports and re-exports from `document-schema.js`, with no local schema of its own to reconcile against so, after narrowing to the `wordprocessing` variant, there is nothing left to rebuild.
453
453
  - **Every construct-mapping gap either `readMarkdownContent` (read) or `buildMarkdownText` (write) cannot represent losslessly is markdown-codec's own documented, reachable `MarkdownDiagnosticCodes` entry, surfaced through whatever `sink` a caller passes to `readMarkdownContent`/`buildMarkdownText` directly (the `DocumentToPdfOptions`/`DocumentBridgeOptions` shapes `markdownToPdf`/`markdownToDocx`/`markdownToOdt` accept have no room for one — see those types' own doc comments) — not a silent approximation:**
454
454
  - **`md/invented-page-geometry`** — markdown has no page concept of its own; every lowered document gets one `ContentSection` with A4 + 1in default page geometry (overridable via `readMarkdownContent`'s own `pageSize`/`margins` options). Fires unconditionally, once per lowered document.
455
455
  - **`md/nested-emphasis-flattened`** — emphasis nested inside the identical kind (emphasis-in-emphasis, strong-in-strong) flattens to one run rather than preserving the nesting.
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../model/content.cjs");
3
2
  const require_model_geometry = require("../model/geometry.cjs");
4
3
  const require_edit_docx_editor = require("../edit/docx/editor.cjs");
5
4
  const require_edit_docx_content = require("../edit/docx/content.cjs");
@@ -497,7 +496,7 @@ function odmToPdf(bytes, options) {
497
496
  require_ports_abort.throwIfAborted(options?.signal);
498
497
  const content = {
499
498
  kind: "wordprocessing",
500
- formatVersion: 1,
499
+ formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
501
500
  metadata: (0, odf_js.readOdfMetadata)(pkg),
502
501
  sections: combinedSections
503
502
  };
@@ -1,4 +1,3 @@
1
- import "../model/content.js";
2
1
  import { PAGE_SIZE_A4, flipY } from "../model/geometry.js";
3
2
  import { openDocx } from "../edit/docx/editor.js";
4
3
  import { buildDocxPackage } from "../edit/docx/content.js";
@@ -29,7 +28,7 @@ import { buildOdbTableCsv } from "../odb/csv.js";
29
28
  import { readOdbTables } from "../odb/read.js";
30
29
  import { odbTablesToSpreadsheetDocument } from "../odb/spreadsheet.js";
31
30
  import { buildXlsxPackage, decodePackage, encodePackage, readXlsxContent } from "ooxml.js";
32
- import { COLOR_BLACK, DOCUMENT_PACKAGE_FORMAT_VERSION, LAYOUT_FORMAT_VERSION } from "document-schema.js";
31
+ import { COLOR_BLACK, CONTENT_FORMAT_VERSION, DOCUMENT_PACKAGE_FORMAT_VERSION, LAYOUT_FORMAT_VERSION } from "document-schema.js";
33
32
  import { decodePackage as decodePackage$1, encodePackage as encodePackage$1, readOdfMetadata, readOdfParagraph, readOdfTable, readOdm } from "odf.js";
34
33
  import { createStandardFontMeasurer, loadMathFont, readPdf, writePdf } from "pdf-codec";
35
34
  //#region src/convert/convert.ts
@@ -496,7 +495,7 @@ function odmToPdf(bytes, options) {
496
495
  throwIfAborted(options?.signal);
497
496
  const content = {
498
497
  kind: "wordprocessing",
499
- formatVersion: 1,
498
+ formatVersion: CONTENT_FORMAT_VERSION,
500
499
  metadata: readOdfMetadata(pkg),
501
500
  sections: combinedSections
502
501
  };
@@ -1,4 +1,4 @@
1
- import { ContentDocument } from "../../model/content.cjs";
1
+ import { ContentDocument } from "document-schema.js";
2
2
  import { Package } from "ooxml.js";
3
3
  //#region src/edit/docx/content.d.ts
4
4
  declare function buildDocxPackage(content: ContentDocument): Package;
@@ -1,5 +1,5 @@
1
- import { ContentDocument } from "../../model/content.js";
2
1
  import { Package } from "ooxml.js";
2
+ import { ContentDocument } from "document-schema.js";
3
3
  //#region src/edit/docx/content.d.ts
4
4
  declare function buildDocxPackage(content: ContentDocument): Package;
5
5
  //#endregion
@@ -1,4 +1,4 @@
1
- import { ContentDocument } from "../../model/content.cjs";
1
+ import { ContentDocument } from "document-schema.js";
2
2
  import { Package } from "odf.js";
3
3
  //#region src/edit/odg/content.d.ts
4
4
  declare function buildOdgPackage(content: ContentDocument): Package;
@@ -1,4 +1,4 @@
1
- import { ContentDocument } from "../../model/content.js";
1
+ import { ContentDocument } from "document-schema.js";
2
2
  import { Package } from "odf.js";
3
3
  //#region src/edit/odg/content.d.ts
4
4
  declare function buildOdgPackage(content: ContentDocument): Package;
@@ -1,4 +1,4 @@
1
- import { ContentDocument } from "../../model/content.cjs";
1
+ import { ContentDocument } from "document-schema.js";
2
2
  import { Package } from "odf.js";
3
3
  //#region src/edit/odp/content.d.ts
4
4
  declare function buildOdpPackage(content: ContentDocument): Package;
@@ -1,4 +1,4 @@
1
- import { ContentDocument } from "../../model/content.js";
1
+ import { ContentDocument } from "document-schema.js";
2
2
  import { Package } from "odf.js";
3
3
  //#region src/edit/odp/content.d.ts
4
4
  declare function buildOdpPackage(content: ContentDocument): Package;
@@ -1,4 +1,4 @@
1
- import { ContentDocument } from "../../model/content.cjs";
1
+ import { ContentDocument } from "document-schema.js";
2
2
  import { Package } from "odf.js";
3
3
  //#region src/edit/ods/content.d.ts
4
4
  declare function buildOdsPackage(content: ContentDocument): Package;
@@ -1,4 +1,4 @@
1
- import { ContentDocument } from "../../model/content.js";
1
+ import { ContentDocument } from "document-schema.js";
2
2
  import { Package } from "odf.js";
3
3
  //#region src/edit/ods/content.d.ts
4
4
  declare function buildOdsPackage(content: ContentDocument): Package;
@@ -1,6 +1,5 @@
1
- import { ContentDocument } from "../../model/content.cjs";
2
1
  import { t as OdtParagraph } from "../../paragraph-BXbXKPy3.cjs";
3
- import { ContentParagraph } from "document-schema.js";
2
+ import { ContentDocument, ContentParagraph } from "document-schema.js";
4
3
  import { Package } from "odf.js";
5
4
  //#region src/edit/odt/content.d.ts
6
5
  declare function buildOdtPackage(content: ContentDocument): Package;
@@ -1,6 +1,5 @@
1
- import { ContentDocument } from "../../model/content.js";
2
1
  import { t as OdtParagraph } from "../../paragraph-CoUi_88j.js";
3
- import { ContentParagraph } from "document-schema.js";
2
+ import { ContentDocument, ContentParagraph } from "document-schema.js";
4
3
  import { Package } from "odf.js";
5
4
  //#region src/edit/odt/content.d.ts
6
5
  declare function buildOdtPackage(content: ContentDocument): Package;
@@ -1,4 +1,4 @@
1
- import { ContentDocument } from "../../model/content.cjs";
1
+ import { ContentDocument } from "document-schema.js";
2
2
  import { Package } from "ooxml.js";
3
3
  //#region src/edit/pptx/content.d.ts
4
4
  declare function buildPptxPackage(content: ContentDocument): Package;
@@ -1,5 +1,5 @@
1
- import { ContentDocument } from "../../model/content.js";
2
1
  import { Package } from "ooxml.js";
2
+ import { ContentDocument } from "document-schema.js";
3
3
  //#region src/edit/pptx/content.d.ts
4
4
  declare function buildPptxPackage(content: ContentDocument): Package;
5
5
  //#endregion
package/dist/index.cjs CHANGED
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_model_content = require("./model/content.cjs");
3
2
  const require_model_geometry = require("./model/geometry.cjs");
4
3
  const require_model_bytes = require("./model/bytes.cjs");
5
4
  const require_edit_docx_run = require("./edit/docx/run.cjs");
@@ -85,7 +84,12 @@ Object.defineProperty(exports, "COLOR_BLACK", {
85
84
  return document_schema_js.COLOR_BLACK;
86
85
  }
87
86
  });
88
- exports.CONTENT_FORMAT_VERSION = require_model_content.CONTENT_FORMAT_VERSION;
87
+ Object.defineProperty(exports, "CONTENT_FORMAT_VERSION", {
88
+ enumerable: true,
89
+ get: function() {
90
+ return document_schema_js.CONTENT_FORMAT_VERSION;
91
+ }
92
+ });
89
93
  Object.defineProperty(exports, "CommentSchema", {
90
94
  enumerable: true,
91
95
  get: function() {
@@ -122,7 +126,12 @@ Object.defineProperty(exports, "ContentCellValueSchema", {
122
126
  return document_schema_js.ContentCellValueSchema;
123
127
  }
124
128
  });
125
- exports.ContentDocumentSchema = require_model_content.ContentDocumentSchema;
129
+ Object.defineProperty(exports, "ContentDocumentSchema", {
130
+ enumerable: true,
131
+ get: function() {
132
+ return document_schema_js.ContentDocumentSchema;
133
+ }
134
+ });
126
135
  Object.defineProperty(exports, "ContentDrawPageSchema", {
127
136
  enumerable: true,
128
137
  get: function() {
package/dist/index.d.cts CHANGED
@@ -2,7 +2,6 @@ import { DocumentBridgeOptions, DocumentToPdfOptions, OdbToCsvOptions, OdmToPdfO
2
2
  import { ConversionRequest, ConversionResult, Diagnostic, DocumentConverter, DocumentFormat, DocumentPayload } from "./convert/port.cjs";
3
3
  import { docxPdfCodec, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, odgPdfCodec, odpPdfCodec, odpPptxCodec, odsPdfCodec, odsXlsxCodec, odtDocxCodec, odtPdfCodec, pptxPdfCodec, xlsxPdfCodec } from "./convert/codec.cjs";
4
4
  import { createLocalDocumentConverter } from "./convert/local.cjs";
5
- import { CONTENT_FORMAT_VERSION, ContentDocument, ContentDocumentSchema } from "./model/content.cjs";
6
5
  import { buildDocxPackage } from "./edit/docx/content.cjs";
7
6
  import { a as rgbHexToColor, n as LayoutColor, t as COLOR_BLACK } from "./color-71eoF1Up.cjs";
8
7
  import { t as DocxRun } from "./run-B3GNScJH.cjs";
@@ -69,7 +68,7 @@ import { odbTablesToSpreadsheetDocument } from "./odb/spreadsheet.cjs";
69
68
  import { OdbTableNotFoundError, OdbTableNotSpecifiedError } from "./odb/csv.cjs";
70
69
  import { ClockPort, fixedClock, systemClock } from "./ports/clock.cjs";
71
70
  import { throwIfAborted } from "./ports/abort.cjs";
72
- import { ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocumentJson, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DocumentJsonResult, DocumentPackage, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
71
+ import { CONTENT_FORMAT_VERSION, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentJson, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DocumentJsonResult, DocumentPackage, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
73
72
  import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PositionedFormula, ReadPdfOptions, WinAnsiSubstitution, WritePdfOptions, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
74
73
  import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Package, PackageSchema, Part, PartSchema, Relationship, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, attr, base64ToBytes, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, resolveRelationships, rootElement, serializePackage, textContent as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
75
74
  export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EmbeddedFormula, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, type HsqldbColumn, HsqldbRowFormatError, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, MarkdownBytesSchema, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, type OdpContentResult, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, type OdtContentResult, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type PresentationLayoutResult, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type StandaloneFormulaContent, type TextBoxInit$2 as TextBoxInit, UnrecognizedDocumentSchemaError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readMarkdownContent, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
package/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@ import { DocumentBridgeOptions, DocumentToPdfOptions, OdbToCsvOptions, OdmToPdfO
2
2
  import { ConversionRequest, ConversionResult, Diagnostic, DocumentConverter, DocumentFormat, DocumentPayload } from "./convert/port.js";
3
3
  import { docxPdfCodec, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, odgPdfCodec, odpPdfCodec, odpPptxCodec, odsPdfCodec, odsXlsxCodec, odtDocxCodec, odtPdfCodec, pptxPdfCodec, xlsxPdfCodec } from "./convert/codec.js";
4
4
  import { createLocalDocumentConverter } from "./convert/local.js";
5
- import { CONTENT_FORMAT_VERSION, ContentDocument, ContentDocumentSchema } from "./model/content.js";
6
5
  import { buildDocxPackage } from "./edit/docx/content.js";
7
6
  import { a as rgbHexToColor, n as LayoutColor, t as COLOR_BLACK } from "./color-Bo228AY2.js";
8
7
  import { t as DocxRun } from "./run-D2rTWHbt.js";
@@ -70,6 +69,6 @@ import { OdbTableNotFoundError, OdbTableNotSpecifiedError } from "./odb/csv.js";
70
69
  import { ClockPort, fixedClock, systemClock } from "./ports/clock.js";
71
70
  import { throwIfAborted } from "./ports/abort.js";
72
71
  import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Package, PackageSchema, Part, PartSchema, Relationship, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, attr, base64ToBytes, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, resolveRelationships, rootElement, serializePackage, textContent as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
73
- import { ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocumentJson, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DocumentJsonResult, DocumentPackage, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
72
+ import { CONTENT_FORMAT_VERSION, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentJson, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DocumentJsonResult, DocumentPackage, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
74
73
  import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PositionedFormula, ReadPdfOptions, WinAnsiSubstitution, WritePdfOptions, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
75
74
  export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EmbeddedFormula, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, type HsqldbColumn, HsqldbRowFormatError, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, MarkdownBytesSchema, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, type OdpContentResult, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, type OdtContentResult, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type PresentationLayoutResult, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type StandaloneFormulaContent, type TextBoxInit$2 as TextBoxInit, UnrecognizedDocumentSchemaError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readMarkdownContent, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import { CONTENT_FORMAT_VERSION, ContentDocumentSchema } from "./model/content.js";
2
1
  import { PAGE_SIZE_A4, PAGE_SIZE_LETTER, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, flipY } from "./model/geometry.js";
3
2
  import { COLOR_BLACK, rgbHexToColor } from "./model/color.js";
4
3
  import { DEFAULT_LAYOUT_FONT } from "./model/style.js";
@@ -66,6 +65,6 @@ import { docxPdfCodec, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, od
66
65
  import { createLocalDocumentConverter } from "./convert/local.js";
67
66
  import { fixedClock, systemClock } from "./ports/clock.js";
68
67
  import { AttributeSchema, BinaryPartSchema, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, DefinedNameSchema, PackageSchema, PartSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, attr, base64ToBytes, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, resolveRelationships, rootElement, serializePackage, textContent as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
69
- import { ContentBlockSchema, ContentCellValueSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DocumentPackageSchema, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
68
+ import { CONTENT_FORMAT_VERSION, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DocumentPackageSchema, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, schemaUriFor } from "document-schema.js";
70
69
  import { NOOP_DIAGNOSTIC_SINK, PdfEncryptedError, PdfParseError, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
71
70
  export { AttributeSchema, BinaryPartSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DefinedNameSchema, DocumentPackageSchema, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, HsqldbRowFormatError, HsqldbScriptParseError, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, MarkdownBytesSchema, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdgBoxVector, OdgBytesSchema, OdgEditor, OdgLineVector, OdgPage, OdgPathVector, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, OdtRun, OdtTable, OdtTableCell, OdtTableRow, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PackageSchema, PartSchema, PdfBytesSchema, PdfEncryptedError, PdfParseError, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, XlsxBytesSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodePackage, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodeMarkdownText, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToDocx, markdownToOdt, markdownToPdf, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readMarkdownContent, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxPdfCodec, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
@@ -1,5 +1,4 @@
1
- import { ContentDocument } from "../model/content.cjs";
2
- import { LayoutDocument } from "document-schema.js";
1
+ import { ContentDocument, LayoutDocument } from "document-schema.js";
3
2
  import { TextMeasurer } from "pdf-codec";
4
3
  //#region src/layout/drawing.d.ts
5
4
  interface DrawingLayoutOptions {
@@ -1,5 +1,4 @@
1
- import { ContentDocument } from "../model/content.js";
2
- import { LayoutDocument } from "document-schema.js";
1
+ import { ContentDocument, LayoutDocument } from "document-schema.js";
3
2
  import { TextMeasurer } from "pdf-codec";
4
3
  //#region src/layout/drawing.d.ts
5
4
  interface DrawingLayoutOptions {
@@ -1,6 +1,5 @@
1
- import { ContentDocument } from "../model/content.cjs";
2
1
  import { EmbeddedFormula } from "../model/formula.cjs";
3
- import { LayoutDocument } from "document-schema.js";
2
+ import { ContentDocument, LayoutDocument } from "document-schema.js";
4
3
  import { PositionedFormula, TextMeasurer } from "pdf-codec";
5
4
  //#region src/layout/engine.d.ts
6
5
  interface EngineLayoutOptions {
@@ -1,6 +1,5 @@
1
- import { ContentDocument } from "../model/content.js";
2
1
  import { EmbeddedFormula } from "../model/formula.js";
3
- import { LayoutDocument } from "document-schema.js";
2
+ import { ContentDocument, LayoutDocument } from "document-schema.js";
4
3
  import { PositionedFormula, TextMeasurer } from "pdf-codec";
5
4
  //#region src/layout/engine.d.ts
6
5
  interface EngineLayoutOptions {
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../model/content.cjs");
3
2
  const require_model_geometry = require("../model/geometry.cjs");
4
3
  const require_ports_abort = require("../ports/abort.cjs");
4
+ let document_schema_js = require("document-schema.js");
5
5
  let pdf_codec = require("pdf-codec");
6
6
  //#region src/layout/reconstruct.ts
7
7
  const ZERO_MARGINS = {
@@ -111,7 +111,7 @@ function reconstructWordprocessing(doc, options) {
111
111
  if (currentGroup.length > 0) sections.push(buildSection(currentGroup, doc.images));
112
112
  return {
113
113
  kind: "wordprocessing",
114
- formatVersion: 1,
114
+ formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
115
115
  metadata: doc.metadata,
116
116
  sections
117
117
  };
@@ -207,7 +207,7 @@ function reconstructPresentation(doc, options) {
207
207
  });
208
208
  return {
209
209
  kind: "presentation",
210
- formatVersion: 1,
210
+ formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
211
211
  metadata: doc.metadata,
212
212
  slides
213
213
  };
@@ -345,7 +345,7 @@ function reconstructDrawing(doc, options) {
345
345
  });
346
346
  return {
347
347
  kind: "drawing",
348
- formatVersion: 1,
348
+ formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
349
349
  metadata: doc.metadata,
350
350
  pages
351
351
  };
@@ -797,7 +797,7 @@ function reconstructSpreadsheet(doc, options) {
797
797
  });
798
798
  return {
799
799
  kind: "spreadsheet",
800
- formatVersion: 1,
800
+ formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
801
801
  metadata: doc.metadata,
802
802
  sheets
803
803
  };
@@ -1,5 +1,4 @@
1
- import { ContentDocument } from "../model/content.cjs";
2
- import { LayoutDocument } from "document-schema.js";
1
+ import { ContentDocument, LayoutDocument } from "document-schema.js";
3
2
  //#region src/layout/reconstruct.d.ts
4
3
  interface ReconstructOptions {
5
4
  readonly signal?: AbortSignal;
@@ -1,5 +1,4 @@
1
- import { ContentDocument } from "../model/content.js";
2
- import { LayoutDocument } from "document-schema.js";
1
+ import { ContentDocument, LayoutDocument } from "document-schema.js";
3
2
  //#region src/layout/reconstruct.d.ts
4
3
  interface ReconstructOptions {
5
4
  readonly signal?: AbortSignal;
@@ -1,6 +1,6 @@
1
- import "../model/content.js";
2
1
  import { flipY } from "../model/geometry.js";
3
2
  import { throwIfAborted } from "../ports/abort.js";
3
+ import { CONTENT_FORMAT_VERSION } from "document-schema.js";
4
4
  import { STANDARD_METRICS, resolveStandardFont } from "pdf-codec";
5
5
  //#region src/layout/reconstruct.ts
6
6
  const ZERO_MARGINS = {
@@ -110,7 +110,7 @@ function reconstructWordprocessing(doc, options) {
110
110
  if (currentGroup.length > 0) sections.push(buildSection(currentGroup, doc.images));
111
111
  return {
112
112
  kind: "wordprocessing",
113
- formatVersion: 1,
113
+ formatVersion: CONTENT_FORMAT_VERSION,
114
114
  metadata: doc.metadata,
115
115
  sections
116
116
  };
@@ -206,7 +206,7 @@ function reconstructPresentation(doc, options) {
206
206
  });
207
207
  return {
208
208
  kind: "presentation",
209
- formatVersion: 1,
209
+ formatVersion: CONTENT_FORMAT_VERSION,
210
210
  metadata: doc.metadata,
211
211
  slides
212
212
  };
@@ -344,7 +344,7 @@ function reconstructDrawing(doc, options) {
344
344
  });
345
345
  return {
346
346
  kind: "drawing",
347
- formatVersion: 1,
347
+ formatVersion: CONTENT_FORMAT_VERSION,
348
348
  metadata: doc.metadata,
349
349
  pages
350
350
  };
@@ -796,7 +796,7 @@ function reconstructSpreadsheet(doc, options) {
796
796
  });
797
797
  return {
798
798
  kind: "spreadsheet",
799
- formatVersion: 1,
799
+ formatVersion: CONTENT_FORMAT_VERSION,
800
800
  metadata: doc.metadata,
801
801
  sheets
802
802
  };
@@ -1,5 +1,4 @@
1
- import { ContentDocument } from "../model/content.cjs";
2
- import { LayoutDocument } from "document-schema.js";
1
+ import { ContentDocument, LayoutDocument } from "document-schema.js";
3
2
  import { TextMeasurer } from "pdf-codec";
4
3
  //#region src/layout/sheets.d.ts
5
4
  interface SheetsLayoutOptions {
@@ -1,5 +1,4 @@
1
- import { ContentDocument } from "../model/content.js";
2
- import { LayoutDocument } from "document-schema.js";
1
+ import { ContentDocument, LayoutDocument } from "document-schema.js";
3
2
  import { TextMeasurer } from "pdf-codec";
4
3
  //#region src/layout/sheets.d.ts
5
4
  interface SheetsLayoutOptions {
@@ -1,6 +1,5 @@
1
- import { ContentDocument } from "../model/content.cjs";
2
1
  import { EmbeddedFormula } from "../model/formula.cjs";
3
- import { ContentShape, LayoutDocument, LayoutImageAsset, LayoutItem } from "document-schema.js";
2
+ import { ContentDocument, ContentShape, LayoutDocument, LayoutImageAsset, LayoutItem } from "document-schema.js";
4
3
  import { PositionedFormula, TextMeasurer } from "pdf-codec";
5
4
  //#region src/layout/slides.d.ts
6
5
  interface SlidesLayoutOptions {
@@ -1,6 +1,5 @@
1
- import { ContentDocument } from "../model/content.js";
2
1
  import { EmbeddedFormula } from "../model/formula.js";
3
- import { ContentShape, LayoutDocument, LayoutImageAsset, LayoutItem } from "document-schema.js";
2
+ import { ContentDocument, ContentShape, LayoutDocument, LayoutImageAsset, LayoutItem } from "document-schema.js";
4
3
  import { PositionedFormula, TextMeasurer } from "pdf-codec";
5
4
  //#region src/layout/slides.d.ts
6
5
  interface SlidesLayoutOptions {
@@ -1,16 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../model/content.cjs");
3
2
  let markdown_codec = require("markdown-codec");
4
3
  //#region src/markdown/read.ts
5
4
  function readMarkdownContent(text, options) {
6
5
  const { document } = (0, markdown_codec.readMarkdown)(text, options);
7
6
  if (document.kind !== "wordprocessing") throw new Error("readMarkdown returned a non-wordprocessing ContentDocument");
8
- return {
9
- kind: "wordprocessing",
10
- formatVersion: 1,
11
- metadata: { ...document.metadata },
12
- sections: document.sections
13
- };
7
+ return document;
14
8
  }
15
9
  //#endregion
16
10
  exports.readMarkdownContent = readMarkdownContent;
@@ -1,4 +1,4 @@
1
- import { ContentDocument } from "../model/content.cjs";
1
+ import { ContentDocument } from "document-schema.js";
2
2
  import { ReadMarkdownOptions } from "markdown-codec";
3
3
  //#region src/markdown/read.d.ts
4
4
  declare function readMarkdownContent(text: string, options?: ReadMarkdownOptions): ContentDocument;
@@ -1,4 +1,4 @@
1
- import { ContentDocument } from "../model/content.js";
1
+ import { ContentDocument } from "document-schema.js";
2
2
  import { ReadMarkdownOptions } from "markdown-codec";
3
3
  //#region src/markdown/read.d.ts
4
4
  declare function readMarkdownContent(text: string, options?: ReadMarkdownOptions): ContentDocument;
@@ -1,15 +1,9 @@
1
- import "../model/content.js";
2
1
  import { readMarkdown } from "markdown-codec";
3
2
  //#region src/markdown/read.ts
4
3
  function readMarkdownContent(text, options) {
5
4
  const { document } = readMarkdown(text, options);
6
5
  if (document.kind !== "wordprocessing") throw new Error("readMarkdown returned a non-wordprocessing ContentDocument");
7
- return {
8
- kind: "wordprocessing",
9
- formatVersion: 1,
10
- metadata: { ...document.metadata },
11
- sections: document.sections
12
- };
6
+ return document;
13
7
  }
14
8
  //#endregion
15
9
  export { readMarkdownContent };