odf.js 5.5.2 → 6.1.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.
Files changed (200) hide show
  1. package/README.md +49 -43
  2. package/dist/{build-XSm3I8LT.d.cts → build--uPsivid.d.cts} +1 -1
  3. package/dist/{build-Z1KRkSEB.d.ts → build-DgBE0bmv.d.ts} +1 -1
  4. package/dist/{cascade-DWQfTwaM.d.cts → cascade-BDkyOmoo.d.cts} +5 -5
  5. package/dist/{cascade-BZ7zqXhL.d.ts → cascade-CaVinmvp.d.ts} +5 -5
  6. package/dist/{codec-CbPSWzQ2.d.ts → codec-CyJ4gSH2.d.ts} +39 -39
  7. package/dist/{codec-C3i7QbVt.d.cts → codec-lz3vgEos.d.cts} +39 -39
  8. package/dist/codec.d.cts +1 -1
  9. package/dist/codec.d.ts +1 -1
  10. package/dist/{constructs-C1S8qlVv.d.ts → constructs-BntJjuvH.d.ts} +8 -8
  11. package/dist/{constructs-FLBse5UV.d.cts → constructs-BzLZy5YP.d.cts} +8 -8
  12. package/dist/{embedded-CBTvjVKb.cjs → embedded-BsO-SvtW.cjs} +2 -2
  13. package/dist/{embedded-Zv8KtFUo.d.ts → embedded-C8tiMCE_.d.ts} +3 -3
  14. package/dist/{embedded-D2MXjcFm.js → embedded-UQQNFd5U.js} +3 -3
  15. package/dist/{embedded-BzPTTzdf.d.cts → embedded-tlaHMady.d.cts} +3 -3
  16. package/dist/{form-RJTtSmwn.d.ts → form-D6XHM5SR.d.ts} +3 -3
  17. package/dist/{form-CWWCkG-r.d.cts → form-coDwVdjG.d.cts} +3 -3
  18. package/dist/{forms-Eh1N15Qy.d.cts → forms-Dc74fCtk.d.cts} +2 -2
  19. package/dist/{forms-CyLw7lpE.d.ts → forms-Eq2p1ss3.d.ts} +2 -2
  20. package/dist/{fragment-B1og_8uA.d.cts → fragment-9dNg-m46.d.cts} +1 -1
  21. package/dist/{fragment-B1ZV7T5Z.d.ts → fragment-ClgCV_if.d.ts} +1 -1
  22. package/dist/{geometry-lKWJ_ifA.d.cts → geometry-B7FZHSyD.d.cts} +1 -1
  23. package/dist/{geometry-DnhkIhAM.d.ts → geometry-BI33aJpv.d.ts} +1 -1
  24. package/dist/image/sniff.d.cts +1 -1
  25. package/dist/image/sniff.d.ts +1 -1
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.d.cts +41 -41
  28. package/dist/index.d.ts +41 -41
  29. package/dist/index.js +1 -1
  30. package/dist/{list-KZeXA0mR.d.cts → list-DwTyo_B2.d.cts} +3 -3
  31. package/dist/{list-Qeuawtew.d.ts → list-X_GJY7P3.d.ts} +3 -3
  32. package/dist/{manifest-BALwu2JR.d.cts → manifest-BGs8Bbd_.d.cts} +1 -1
  33. package/dist/{manifest-CP1sqyGU.d.ts → manifest-Bju-_gTQ.d.ts} +1 -1
  34. package/dist/manifest.d.cts +1 -1
  35. package/dist/manifest.d.ts +1 -1
  36. package/dist/{masterpage-By_F05W4.d.ts → masterpage-BLK2OJ9q.d.ts} +2 -2
  37. package/dist/{masterpage-Bt6gxuoL.d.cts → masterpage-KqZshNGZ.d.cts} +2 -2
  38. package/dist/{metadata-1j1zm9Cx.d.cts → metadata-01SgHkRR.d.cts} +1 -1
  39. package/dist/{metadata-BXpjrAS-.d.ts → metadata-D1SOBTh8.d.ts} +1 -1
  40. package/dist/{mimetype-CPNMj04s.d.cts → mimetype-1BaQzNiS.d.cts} +1 -1
  41. package/dist/{mimetype-BfkwTeaW.d.ts → mimetype-DvMCOzmu.d.ts} +1 -1
  42. package/dist/mimetype.d.cts +1 -1
  43. package/dist/mimetype.d.ts +1 -1
  44. package/dist/model/node.d.cts +1 -1
  45. package/dist/model/node.d.ts +1 -1
  46. package/dist/model/package.d.cts +1 -1
  47. package/dist/model/package.d.ts +1 -1
  48. package/dist/{node-CkBWRjNR.d.cts → node-B6JX5CRX.d.cts} +1 -1
  49. package/dist/{node-CkBWRjNR.d.ts → node-B6JX5CRX.d.ts} +1 -1
  50. package/dist/{package-L24lkba-.d.cts → package-DMk9fuTI.d.cts} +1 -1
  51. package/dist/package-io/read.d.cts +1 -1
  52. package/dist/package-io/read.d.ts +1 -1
  53. package/dist/package-io/write.d.cts +1 -1
  54. package/dist/package-io/write.d.ts +1 -1
  55. package/dist/{package-BUojjTXf.d.ts → package-otZYrxiO.d.ts} +1 -1
  56. package/dist/{paragraph-hzoy-Wos.d.ts → paragraph-ByTzS8Li.d.ts} +4 -4
  57. package/dist/{paragraph-DaMqmhe3.d.cts → paragraph-CVULactG.d.cts} +4 -4
  58. package/dist/{parse-A8_8sdpX.d.ts → parse-BLukZ2z0.d.ts} +1 -1
  59. package/dist/{parse-CP5FLZqv.d.cts → parse-DcVtB3jT.d.cts} +1 -1
  60. package/dist/{path-DE7wkIcz.d.cts → path-CK0dIPgx.d.cts} +2 -2
  61. package/dist/{path-DE7wkIcz.d.ts → path-CK0dIPgx.d.ts} +2 -2
  62. package/dist/{properties-Rral02h1.d.ts → properties-CJyykyc_.d.ts} +1 -1
  63. package/dist/{properties-C-JKQZUD.d.cts → properties-CiIoNu2h.d.cts} +1 -1
  64. package/dist/{query-P-Y5DK0-.d.cts → query-C69wTkqg.d.cts} +1 -1
  65. package/dist/{query-sECN-7vU.d.ts → query-CbxD-WiQ.d.ts} +1 -1
  66. package/dist/{read-DYYxbvfo.d.ts → read-8s8AdaEd.d.ts} +2 -2
  67. package/dist/{read-CvjbdgH3.d.ts → read-B2jnd5eS.d.ts} +3 -3
  68. package/dist/{read-24g5eZw6.d.ts → read-BcxAWBB5.d.ts} +6 -6
  69. package/dist/read-Bo1GBjSE.d.ts +13 -0
  70. package/dist/{read-BnN7u9Y2.d.ts → read-C_oVZAnY.d.ts} +4 -4
  71. package/dist/{read-BV2an1ok.d.cts → read-D3V_MVAL.d.cts} +3 -3
  72. package/dist/read-D3wLfr-7.d.ts +12 -0
  73. package/dist/read-DHOQqjOZ.d.cts +12 -0
  74. package/dist/read-DSyz0YLj.d.cts +12 -0
  75. package/dist/read-DUOJ-1hX.d.ts +12 -0
  76. package/dist/{read-rwDsgR0d.d.cts → read-Dy5p1OMb.d.cts} +6 -6
  77. package/dist/{read-CMDEXqGw.d.ts → read-a0p7laV3.d.ts} +1 -1
  78. package/dist/{read-DUCm1nUv.d.cts → read-j9o0IoMq.d.cts} +4 -4
  79. package/dist/{read-ydLJ8bid.d.cts → read-jVX8DHs3.d.cts} +2 -2
  80. package/dist/{read-DzmMJPHd.d.cts → read-sawU0IWI.d.cts} +1 -1
  81. package/dist/read-tpfiT_n4.d.cts +13 -0
  82. package/dist/{registry-CphRYjDD.d.cts → registry-B-ZkdQv1.d.cts} +2 -2
  83. package/dist/{registry-D5RGBteE.d.ts → registry-Dajfxsbz.d.ts} +2 -2
  84. package/dist/{report-D6WNYaVn.d.cts → report-39DyUx5W.d.cts} +2 -2
  85. package/dist/{report-DbslT2OR.d.ts → report-x9RuNwmr.d.ts} +2 -2
  86. package/dist/{serialize-D1fti8C5.d.cts → serialize-BU7HZ8Qh.d.cts} +2 -2
  87. package/dist/{serialize-B-lq0LiG.d.ts → serialize-CWz84e0m.d.ts} +2 -2
  88. package/dist/{shapes-8o3NjBLU.d.cts → shapes-BCjeY90t.d.cts} +4 -4
  89. package/dist/{shapes-CCB8ydqD.d.ts → shapes-QkOsc-WT.d.ts} +4 -4
  90. package/dist/{sniff-DjpnUZRp.d.cts → sniff-DGOBHA0O.d.cts} +1 -1
  91. package/dist/{sniff-DjpnUZRp.d.ts → sniff-DGOBHA0O.d.ts} +1 -1
  92. package/dist/{span-KXroEGuH.d.ts → span-C3aJuEOM.d.ts} +1 -1
  93. package/dist/{span-BtmvlqZH.d.cts → span-DSM1SnHI.d.cts} +1 -1
  94. package/dist/styles/properties.d.cts +1 -1
  95. package/dist/styles/properties.d.ts +1 -1
  96. package/dist/styles/registry.d.cts +1 -1
  97. package/dist/styles/registry.d.ts +1 -1
  98. package/dist/styles/serialize.d.cts +1 -1
  99. package/dist/styles/serialize.d.ts +1 -1
  100. package/dist/styles/span.d.cts +1 -1
  101. package/dist/styles/span.d.ts +1 -1
  102. package/dist/{subdocument-BwW3FZC_.d.ts → subdocument-BhabEY9P.d.ts} +1 -1
  103. package/dist/{subdocument-yY8ASE4N.d.cts → subdocument-CQptFIQK.d.cts} +1 -1
  104. package/dist/{table-BH_Q2n_N.d.cts → table-CYvFMlP6.d.cts} +3 -3
  105. package/dist/{table-ByOoGcq_.d.ts → table-DclDgC5h.d.ts} +3 -3
  106. package/dist/{text-gJ5R0q3u.d.ts → text-Bn3C7lnm.d.ts} +1 -1
  107. package/dist/{text-BAi1tapc.d.cts → text-CDUCcwje.d.cts} +1 -1
  108. package/dist/{transform-C7GrZZdR.d.ts → transform-BFNc16LQ.d.ts} +3 -3
  109. package/dist/{transform-DKEjydnm.d.cts → transform-M1gbHp4j.d.cts} +3 -3
  110. package/dist/typed/draw/embedded.cjs +1 -1
  111. package/dist/typed/draw/embedded.d.cts +1 -1
  112. package/dist/typed/draw/embedded.d.ts +1 -1
  113. package/dist/typed/draw/embedded.js +1 -1
  114. package/dist/typed/draw/shapes.d.cts +1 -1
  115. package/dist/typed/draw/shapes.d.ts +1 -1
  116. package/dist/typed/formula/read.cjs +1 -1
  117. package/dist/typed/formula/read.d.cts +1 -1
  118. package/dist/typed/formula/read.d.ts +1 -1
  119. package/dist/typed/formula/read.js +2 -2
  120. package/dist/typed/odb/form.cjs +1 -1
  121. package/dist/typed/odb/form.d.cts +1 -1
  122. package/dist/typed/odb/form.d.ts +1 -1
  123. package/dist/typed/odb/form.js +1 -1
  124. package/dist/typed/odb/read.d.cts +1 -1
  125. package/dist/typed/odb/read.d.ts +1 -1
  126. package/dist/typed/odb/report.d.cts +1 -1
  127. package/dist/typed/odb/report.d.ts +1 -1
  128. package/dist/typed/odb/subdocument.d.cts +1 -1
  129. package/dist/typed/odb/subdocument.d.ts +1 -1
  130. package/dist/typed/odg/read.cjs +1 -1
  131. package/dist/typed/odg/read.d.cts +1 -1
  132. package/dist/typed/odg/read.d.ts +1 -1
  133. package/dist/typed/odg/read.js +2 -2
  134. package/dist/typed/odm/read.d.cts +1 -1
  135. package/dist/typed/odm/read.d.ts +1 -1
  136. package/dist/typed/odp/read.cjs +1 -1
  137. package/dist/typed/odp/read.d.cts +1 -1
  138. package/dist/typed/odp/read.d.ts +1 -1
  139. package/dist/typed/odp/read.js +2 -2
  140. package/dist/typed/ods/read.cjs +1 -1
  141. package/dist/typed/ods/read.d.cts +1 -1
  142. package/dist/typed/ods/read.d.ts +1 -1
  143. package/dist/typed/ods/read.js +1 -1
  144. package/dist/typed/odt/read.cjs +1 -1
  145. package/dist/typed/odt/read.d.cts +1 -1
  146. package/dist/typed/odt/read.d.ts +1 -1
  147. package/dist/typed/odt/read.js +1 -1
  148. package/dist/typed/shared/cascade.d.cts +1 -1
  149. package/dist/typed/shared/cascade.d.ts +1 -1
  150. package/dist/typed/shared/constructs.cjs +4 -3
  151. package/dist/typed/shared/constructs.d.cts +1 -1
  152. package/dist/typed/shared/constructs.d.ts +1 -1
  153. package/dist/typed/shared/constructs.js +4 -3
  154. package/dist/typed/shared/forms.d.cts +1 -1
  155. package/dist/typed/shared/forms.d.ts +1 -1
  156. package/dist/typed/shared/geometry.d.cts +1 -1
  157. package/dist/typed/shared/geometry.d.ts +1 -1
  158. package/dist/typed/shared/list.d.cts +1 -1
  159. package/dist/typed/shared/list.d.ts +1 -1
  160. package/dist/typed/shared/masterpage.d.cts +1 -1
  161. package/dist/typed/shared/masterpage.d.ts +1 -1
  162. package/dist/typed/shared/metadata.d.cts +1 -1
  163. package/dist/typed/shared/metadata.d.ts +1 -1
  164. package/dist/typed/shared/paragraph.cjs +1 -1
  165. package/dist/typed/shared/paragraph.d.cts +1 -1
  166. package/dist/typed/shared/paragraph.d.ts +1 -1
  167. package/dist/typed/shared/paragraph.js +1 -1
  168. package/dist/typed/shared/path.d.cts +1 -1
  169. package/dist/typed/shared/path.d.ts +1 -1
  170. package/dist/typed/shared/table.cjs +1 -1
  171. package/dist/typed/shared/table.d.cts +1 -1
  172. package/dist/typed/shared/table.d.ts +1 -1
  173. package/dist/typed/shared/table.js +1 -1
  174. package/dist/typed/shared/text.d.cts +1 -1
  175. package/dist/typed/shared/text.d.ts +1 -1
  176. package/dist/typed/shared/transform.d.cts +1 -1
  177. package/dist/typed/shared/transform.d.ts +1 -1
  178. package/dist/typed/shared/units.d.cts +1 -1
  179. package/dist/typed/shared/units.d.ts +1 -1
  180. package/dist/{units-7pCiECuP.d.cts → units-BQSNkTQZ.d.cts} +1 -1
  181. package/dist/{units-7pCiECuP.d.ts → units-BQSNkTQZ.d.ts} +1 -1
  182. package/dist/util/base64.cjs +4 -4
  183. package/dist/util/base64.js +4 -4
  184. package/dist/{write-D3kyj1Xw.d.cts → write-Crk-Yt_w.d.cts} +1 -1
  185. package/dist/{write-BxVkPZID.d.ts → write-R36XIZKx.d.ts} +1 -1
  186. package/dist/xml/build.d.cts +1 -1
  187. package/dist/xml/build.d.ts +1 -1
  188. package/dist/xml/fragment.d.cts +1 -1
  189. package/dist/xml/fragment.d.ts +1 -1
  190. package/dist/xml/parse.d.cts +1 -1
  191. package/dist/xml/parse.d.ts +1 -1
  192. package/dist/xml/query.d.cts +1 -1
  193. package/dist/xml/query.d.ts +1 -1
  194. package/package.json +2 -10
  195. package/dist/read-BLoaDxr_.d.ts +0 -12
  196. package/dist/read-C3Ei_MYc.d.cts +0 -13
  197. package/dist/read-CDSmR3qt.d.cts +0 -12
  198. package/dist/read-DJqvINGW.d.ts +0 -13
  199. package/dist/read-DfEHXwgn.d.ts +0 -12
  200. package/dist/read-IOYq80AA.d.cts +0 -12
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  `odf.js` is the ODF sibling of [`ooxml.js`](../ooxml.js/README.md), mirroring its architecture: a lossless ZIP-of-XML core that round-trips any package byte-for-content-faithful, with typed readers layered on top. Two ODF-specific differences shape the design: ODF has no relationship mechanism (inter-part references are direct paths, with an exhaustive `META-INF/manifest.xml`), and ODF has no inline/direct formatting — every formatting difference must be a named "automatic style," so `odf.js` owns a style-interning subsystem (`src/styles/`) with no OOXML equivalent.
8
8
 
9
- **This package does not depend on `ooxml.js`.** `ooxml.js`'s branding and SBOM are scoped to ECMA-376/OOXML; depending on it would be the wrong signal for an OASIS-standard codec and would force a breaking `ooxml.js` release for every ODF-only fix. The small generic ZIP/XML/`Package` layer is duplicated, kept structurally identical so TypeScript's structural typing makes both packages' values interchangeable for a shared consumer like `documents.js`. Both depend on [`document-schema.js`](../document-schema.js/README.md) for the genuinely identical `ContentDocument`/`DocumentPackage` content model.
9
+ **This package does not depend on `ooxml.js`.** `ooxml.js`'s branding and SBOM are scoped to ECMA-376/OOXML; depending on it would be the wrong signal for an OASIS-standard codec and would force a breaking `ooxml.js` release for every ODF-only fix. The small generic ZIP/XML/`Package` layer is duplicated, kept structurally identical so TypeScript's structural typing makes both packages' values interchangeable for a shared consumer like `documents.js`. Both depend on [`document-schema.js`](../document-schema.js/README.md) for the genuinely identical `ContentDocument`/`DocumentTree` content model.
10
10
 
11
11
  ```mermaid
12
12
  graph TD
@@ -58,12 +58,12 @@ Under active development. Built and shipped:
58
58
  - **Namespaces, media types, mimetype, manifest** (`src/ns.ts`, `src/media-type.ts`, `src/mimetype.ts`, `src/manifest.ts`) — full read and write, including `META-INF/manifest.xml` and the mimetype part's mandatory first-entry/stored/uncompressed layout.
59
59
  - **Style interning** (`src/styles/`) — `StyleRegistry` adopts existing automatic styles, finds-or-mints on `intern()`, fingerprints on canonical serialized properties (never `JSON.stringify`), collision-checked across all four style containers.
60
60
  - **Shared typed primitives** (`src/typed/shared/`) — unit parsing, A1 cell-reference computation with repeat-count cursor advancement, colour/geometry/master-page parsing into `document-schema.js` types, whitespace-run decoding, the read-side style cascade, shared `readOdfParagraph`/`readOdfTable`, the `draw:transform`/`draw:g` group-flattening geometry resolver, an `svg:d`/`draw:points` path parser, and `meta.xml` reading.
61
- - **Typed readers, at two levels** — `readOdt`/`readOdp`/`readOdg`/`readOds`/`readOdfFormula` resolve a `Package` into a `document-schema.js` **`DocumentPackage`**: the single hierarchical artefact, with a minted styles table. Beneath each sits its `*Content` sibling (`readOdtContent`, `readOdpContent`, `readOdgContent`, `readOdsContent`, `readOdfFormulaContent`) producing the flat `ContentDocument`-level shape instead. See [Reading a document](#reading-a-document).
61
+ - **Typed readers, at two levels** — `readOdt`/`readOdp`/`readOdg`/`readOds`/`readOdfFormula` resolve a `Package` into a `document-schema.js` **`DocumentTree`**: the single hierarchical artefact, with a minted styles table. Beneath each sits its `*Content` sibling (`readOdtContent`, `readOdpContent`, `readOdgContent`, `readOdsContent`, `readOdfFormulaContent`) producing the flat `ContentDocument`-level shape instead. See [Reading a document](#reading-a-document).
62
62
  - **What each reader actually covers** — wordprocessing (`readOdt`), presentation (`readOdp`), drawing (`readOdg`: vector primitives in `draw:z-index`-aware paint order), spreadsheet (`readOds`: every `office:value-type`, cell/page-anchored images, and embedded sub-documents including charts), each expressed in `document-schema.js`'s own `ContentSection`/`ContentSlide`/`ContentDrawPage`/`ContentSheet` vocabulary — plus the fidelity construct vocabulary in `readOdt` (fields including the cross-reference displays, bookmarks and reference-marks, tracked changes, notes, annotations, divisions, index wrappers, forms, and anchored frames; see [Fidelity constructs](#fidelity-constructs)).
63
- - **`readOdfFormulaMathMl`** — resolves a standalone/embedded `.odf` formula's bare-MathML `content.xml` into raw MathML nodes plus a StarMath annotation, with no pivot shaping at all. **`readOdfFormulaContent`** wraps that into a real `'formula'`-kind `ContentDocument`, and **`readOdfFormula`** into a `DocumentPackage`.
63
+ - **`readOdfFormulaMathMl`** — resolves a standalone/embedded `.odf` formula's bare-MathML `content.xml` into raw MathML nodes plus a StarMath annotation, with no pivot shaping at all. **`readOdfFormulaContent`** wraps that into a real `'formula'`-kind `ContentDocument`, and **`readOdfFormula`** into a `DocumentTree`.
64
64
  - **`readOdm`** — resolves a `.odm` master document into an ordered list of chapter references (`{ name, href, filterName? }`); chapters are genuinely external `.odt` files by ODF design, never cached.
65
- - **`readOdbInventory`** — resolves a `.odb` into connection info, table names, query definitions (`{ name, command, escapeProcessing? }` with real SQL text), and form/report `{ name, href }` pairs. A sub-document directory is named after an opaque *persistent* name (`forms/Obj11`), not the user-visible name.
66
- - **`readOdbForm`/`readOdbReport`** — extract one sub-document's *static structure*, executing nothing: a form's control tree and data bindings, or a report's band stack, recursive group tree, bound fields, and computed expressions.
65
+ - **`readOdbInventory`** — resolves a `.odb` into connection info, table names, query definitions (`{ name, command, escapeProcessing? }` with real SQL text), and form/report `{ name, href }` pairs. A sub-document directory is named after an opaque _persistent_ name (`forms/Obj11`), not the user-visible name.
66
+ - **`readOdbForm`/`readOdbReport`** — extract one sub-document's _static structure_, executing nothing: a form's control tree and data bindings, or a report's band stack, recursive group tree, bound fields, and computed expressions.
67
67
 
68
68
  Not yet built: live-view editors and the `.odb` database-table-export subsystem. A general-purpose SQL query engine for rendering a Report against its data is **deliberately not attempted** — building even a bounded SQL engine means reimplementing HSQLDB's/Firebird's query semantics, a materially different undertaking from decoding their file formats, with unreviewed licensing questions. Gated on the requesting engineer's explicit sign-off.
69
69
 
@@ -99,70 +99,70 @@ To run a single test file: `pnpm vitest run src/path/to/file.test.ts`.
99
99
 
100
100
  ### Reading a document
101
101
 
102
- A typed reader takes a `Package` (bytes go through `decodePackage`/`parsePackage` first) and returns a [`DocumentPackage`](../document-schema.js/README.md#the-package-tree) — `document-schema.js`'s single hierarchical artefact, where structure, layout, and content are fused in one tree and a `styles` table has already been minted over it:
102
+ A typed reader takes a `Package` (bytes go through `decodePackage`/`parsePackage` first) and returns a [`DocumentTree`](../document-schema.js/README.md#the-package-tree) — `document-schema.js`'s single hierarchical artefact, where structure, layout, and content are fused in one tree and a `styles` table has already been minted over it:
103
103
 
104
104
  ```ts
105
- import { decodePackage, readOdt } from 'odf.js';
105
+ import { decodePackage, readOdt } from "odf.js";
106
106
 
107
107
  const pkg = decodePackage(new Uint8Array(await file.arrayBuffer()));
108
108
  const document = readOdt(pkg);
109
109
 
110
- document.kind; // 'wordprocessing'
111
- document.metadata; // title, author, keywords, ... from meta.xml
112
- document.children; // one section group per ContentSection, headings and lists grouped inside it
113
- document.styles; // the minted styles table the tree's `style` refs name
110
+ document.kind; // 'wordprocessing'
111
+ document.metadata; // title, author, keywords, ... from meta.xml
112
+ document.children; // one section group per ContentSection, headings and lists grouped inside it
113
+ document.styles; // the minted styles table the tree's `style` refs name
114
114
  ```
115
115
 
116
- One reader per format, each returning the `DocumentPackage` arm its format produces:
116
+ One reader per format, each returning the `DocumentTree` arm its format produces:
117
117
 
118
- | Format | Reader | Package kind |
119
- | --- | --- | --- |
120
- | `.odt` | `readOdt` | `wordprocessing` |
121
- | `.odp` | `readOdp` | `presentation` |
122
- | `.ods` | `readOds` | `spreadsheet` |
123
- | `.odg` | `readOdg` | `drawing` |
124
- | `.odf` | `readOdfFormula` | `formula` |
118
+ | Format | Reader | Package kind |
119
+ | ------ | ---------------- | ---------------- |
120
+ | `.odt` | `readOdt` | `wordprocessing` |
121
+ | `.odp` | `readOdp` | `presentation` |
122
+ | `.ods` | `readOds` | `spreadsheet` |
123
+ | `.odg` | `readOdg` | `drawing` |
124
+ | `.odf` | `readOdfFormula` | `formula` |
125
125
 
126
- Each is assembled through `document-schema.js`'s own `assemblePackage`, so odf.js's packages are built exactly the way every other package construction site in this family builds one. No `pages` array is populated and no node carries `frames`: a reader runs before any layout pass, and rendered page geometry is a layout engine's to report, never a reader's to invent.
126
+ Each is assembled through `document-schema.js`'s own `assembleTree`, so odf.js's packages are built exactly the way every other package construction site in this family builds one. No `pages` array is populated and no node carries `frames`: a reader runs before any layout pass, and rendered page geometry is a layout engine's to report, never a reader's to invent.
127
127
 
128
128
  ### The flat `ContentDocument` level
129
129
 
130
130
  Beneath each package-native reader sits the flat reader it is built on, unchanged in behaviour and exported under a `*Content` name. Reach for these when you work in `document-schema.js`'s flat codec-exchange form — as `documents.js`'s own conversion pipeline does — rather than in the tree:
131
131
 
132
132
  ```ts
133
- import { readOdsContent, readOdfFormulaMathMl } from 'odf.js';
133
+ import { readOdsContent, readOdfFormulaMathMl } from "odf.js";
134
134
 
135
- const { metadata, sheets } = readOdsContent(pkg); // the flat ContentSheet[] shape, no tree, no styles table
135
+ const { metadata, sheets } = readOdsContent(pkg); // the flat ContentSheet[] shape, no tree, no styles table
136
136
  const { mathml, starMath } = readOdfFormulaMathMl(formulaPkg); // rawest of all: MathML nodes and the StarMath annotation
137
137
  ```
138
138
 
139
139
  `readOdtContent`/`readOdpContent`/`readOdgContent`/`readOdsContent` return `{ metadata, sections | slides | pages | sheets }`; `readOdfFormulaContent` returns a whole `'formula'`-kind `ContentDocument`; `readOdfFormulaMathMl` returns the raw MathML with no pivot shaping at all. A package-native reader calls its own `*Content` sibling and reshapes that result, so the two levels are one read and can never disagree about what the file says.
140
140
 
141
- Crossing between the levels is `document-schema.js`'s job, not this package's: `flattenPackage(readOdt(pkg))` reproduces exactly what `readOdtContent(pkg)` returns, wrapped in its `ContentDocument` envelope. That equality is pinned per format against real fixture bytes in this package's own test suites.
141
+ Crossing between the levels is `document-schema.js`'s job, not this package's: `flattenTree(readOdt(pkg))` reproduces exactly what `readOdtContent(pkg)` returns, wrapped in its `ContentDocument` envelope. That equality is pinned per format against real fixture bytes in this package's own test suites.
142
142
 
143
143
  ### The primary names moved — migrating from 4.x
144
144
 
145
145
  Every bare `readOdX` name now belongs to the package-native reader. Callers of the old flat functions rename; nothing about those functions' behaviour changed:
146
146
 
147
- | 4.x | 5.0 | Returns |
148
- | --- | --- | --- |
149
- | `readOdt` | `readOdtContent` | `OdtDocument` |
150
- | `readOdp` | `readOdpContent` | `OdpDocument` |
151
- | `readOdg` | `readOdgContent` | `OdgDocument` |
152
- | `readOds` | `readOdsContent` | `OdsDocument` |
153
- | `readOdfFormulaDocument` | `readOdfFormulaContent` | `ContentDocument` |
154
- | `readOdfFormula` | `readOdfFormulaMathMl` | `OdfFormulaDocument` |
147
+ | 4.x | 5.0 | Returns |
148
+ | ------------------------ | ----------------------- | -------------------- |
149
+ | `readOdt` | `readOdtContent` | `OdtDocument` |
150
+ | `readOdp` | `readOdpContent` | `OdpDocument` |
151
+ | `readOdg` | `readOdgContent` | `OdgDocument` |
152
+ | `readOds` | `readOdsContent` | `OdsDocument` |
153
+ | `readOdfFormulaDocument` | `readOdfFormulaContent` | `ContentDocument` |
154
+ | `readOdfFormula` | `readOdfFormulaMathMl` | `OdfFormulaDocument` |
155
155
 
156
- The rename is a compile error at every call site, never a silent behaviour change: each new bare name returns a `DocumentPackage`, which is assignable to none of the old return types.
156
+ The rename is a compile error at every call site, never a silent behaviour change: each new bare name returns a `DocumentTree`, which is assignable to none of the old return types.
157
157
 
158
- `readOdm`, `readOdbInventory`, `readOdbForm`, and `readOdbReport` are untouched, and none gains a package-native form. `readOdm`'s chapters are external file references and `readOdbInventory`/`readOdbReport` describe structure rather than content, so none of those three has a `ContentDocument` to decompose. `readOdbForm` is the exception that proves the rule rather than a fourth case of it: a form's sub-document is a complete, ordinary ODF text document, so `readOdbForm` does call `readOdtContent` on it and does return an `OdtDocument` — but that document is one component nested inside the form's own control-tree result, not the function's own top-level return value, so there is no `DocumentPackage`-native `readOdbForm` to add without changing what the function returns altogether.
158
+ `readOdm`, `readOdbInventory`, `readOdbForm`, and `readOdbReport` are untouched, and none gains a package-native form. `readOdm`'s chapters are external file references and `readOdbInventory`/`readOdbReport` describe structure rather than content, so none of those three has a `ContentDocument` to decompose. `readOdbForm` is the exception that proves the rule rather than a fourth case of it: a form's sub-document is a complete, ordinary ODF text document, so `readOdbForm` does call `readOdtContent` on it and does return an `OdtDocument` — but that document is one component nested inside the form's own control-tree result, not the function's own top-level return value, so there is no `DocumentTree`-native `readOdbForm` to add without changing what the function returns altogether.
159
159
 
160
160
  ### The lossless core
161
161
 
162
162
  The ZIP-of-XML layer every reader above is built on:
163
163
 
164
164
  ```ts
165
- import { decodePackage, encodePackage } from 'odf.js';
165
+ import { decodePackage, encodePackage } from "odf.js";
166
166
 
167
167
  // .odt / .ods / .odp bytes -> faithful JSON Package
168
168
  const pkg = decodePackage(new Uint8Array(await file.arrayBuffer()));
@@ -176,10 +176,15 @@ const bytes = encodePackage(pkg);
176
176
  Manifest and mimetype, ODF's own package-identity mechanism (no relationships, unlike OOXML):
177
177
 
178
178
  ```ts
179
- import { readManifest, syncManifest, setDocumentMediaType, readMimetype } from 'odf.js';
179
+ import {
180
+ readManifest,
181
+ syncManifest,
182
+ setDocumentMediaType,
183
+ readMimetype,
184
+ } from "odf.js";
180
185
 
181
186
  const manifest = readManifest(pkg); // { entries: [{ fullPath, mediaType }, ...] }
182
- setDocumentMediaType(pkg, 'application/vnd.oasis.opendocument.text'); // updates mimetype + manifest root entry atomically
187
+ setDocumentMediaType(pkg, "application/vnd.oasis.opendocument.text"); // updates mimetype + manifest root entry atomically
183
188
  syncManifest(pkg); // rebuilds manifest.xml to exactly match pkg's current parts
184
189
  readMimetype(pkg); // 'application/vnd.oasis.opendocument.text'
185
190
  ```
@@ -189,9 +194,9 @@ readMimetype(pkg); // 'application/vnd.oasis.opendocument.text'
189
194
  Every module is also importable directly by its own subpath, without going through the barrel:
190
195
 
191
196
  ```ts
192
- import { parseOdfLength } from 'odf.js/typed/shared/units';
197
+ import { parseOdfLength } from "odf.js/typed/shared/units";
193
198
 
194
- parseOdfLength('2.5cm'); // 70.86614173228347
199
+ parseOdfLength("2.5cm"); // 70.86614173228347
195
200
  ```
196
201
 
197
202
  Any `src/**/*.ts` module (excluding tests and `test-support/` fixtures) resolves at its path relative to `src/` — `src/manifest.ts` as `odf.js/manifest`, `src/typed/odt/read.ts` as `odf.js/typed/odt/read`, and so on.
@@ -203,7 +208,7 @@ Layered from a lossless core outward, mirroring `ooxml.js`:
203
208
  - **`src/model/`** — `Package`/`XmlNode`/`XmlElement`: a duplicate-by-design copy of `ooxml.js`'s equivalent.
204
209
  - **`src/xml/`** — XML parse/build (`fast-xml-parser`), production element/text-node construction, entity encoding, and tree-query helpers.
205
210
  - **`src/image/`** — `sniffImageFormat`: a PNG/JPEG magic-byte sniffer consumed by `src/manifest.ts` and `src/typed/draw/shapes.ts`.
206
- - **`src/zip.ts`** — takes *ordered* `[path, entry]` tuples, not a `Record`, so the mimetype-first/stored/uncompressed requirement doesn't depend on insertion order surviving a Zod round trip.
211
+ - **`src/zip.ts`** — takes _ordered_ `[path, entry]` tuples, not a `Record`, so the mimetype-first/stored/uncompressed requirement doesn't depend on insertion order surviving a Zod round trip.
207
212
  - **`src/package-io/`** — `write.ts` hoists `mimetype` first (stored) and `META-INF/manifest.xml` second if present; never fabricates either as a side effect.
208
213
  - **`src/manifest.ts`** — full manifest read/write; the manifest is ODF's one mandatory part, unlike `ooxml.js`'s read-only OPC-relationship stance.
209
214
  - **`src/styles/`** — `properties.ts`/`serialize.ts` (canonical property-bag ↔ XML attributes), `registry.ts` (`StyleRegistry`, the mandatory style-interning layer), `span.ts` (character-range `text:span` wrapping).
@@ -224,7 +229,7 @@ Layered from a lossless core outward, mirroring `ooxml.js`:
224
229
 
225
230
  - **Several ODF namespace URIs are not what you'd guess from the prefix.** `draw:` is `...drawing:1.0`, `number:` is `...datastyle:1.0`, `fo:`/`svg:`/`smil:` are `*-compatible:1.0`. See `src/ns.ts`.
226
231
  - **`.odb`'s media type is `application/vnd.oasis.opendocument.base`**, not `...database`.
227
- - **`dc:creator` records whoever most recently *saved* the document, not the author** — the original author is `meta:initial-creator`.
232
+ - **`dc:creator` records whoever most recently _saved_ the document, not the author** — the original author is `meta:initial-creator`.
228
233
  - **`meta:keyword` appears once per keyword**, unlike OOXML's single comma-separated `cp:keywords`.
229
234
  - **`table:number-columns-repeated`/`-rows-repeated` must be cursor-advanced, never materialized** — real sheets have trailing repeat counts over a million.
230
235
  - **ODF cells carry no explicit cell-reference attribute** (unlike xlsx's `r="B7"`) — `typed/shared/a1.ts` computes references from a running cursor.
@@ -233,7 +238,7 @@ Layered from a lossless core outward, mirroring `ooxml.js`:
233
238
  - **`svg:fill-rule` and `draw:stroke` map onto `ContentVector.fillRule`/`ContentStroke.style`.** A dotted pattern and `"double"` stroke have no ODF vector-stroke counterpart and remain unread.
234
239
  - **`readOdsContent`/`readTableCell` resolve cell `background`/`borders`/`alignment`/`verticalAlignment` from the real style cascade.** An explicit `fo:border-*` of `"none"`/`"hidden"` clears an inherited edge.
235
240
  - **`readOdsContent` reads sheet-anchored drawings** — cell-anchored `draw:frame`s (coordinates relative to the cell) and page-anchored ones (in `table:shapes`). An embedded chart resolves as a `chart`-kind object whose document is a frame-sized drawing page carrying the chart's own cached data table, with the `chart:chart` element quarantined in residue. A sheet cannot carry a floating text box or bare vector; each is skipped.
236
- - **`readDrawObjectReference` resolves a frame's embedded sub-document kind from its own `content.xml`, not the manifest.** A `draw:object` must be checked *before* the frame's preview image, since an embedded-object frame also carries a preview `draw:image`.
241
+ - **`readDrawObjectReference` resolves a frame's embedded sub-document kind from its own `content.xml`, not the manifest.** A `draw:object` must be checked _before_ the frame's preview image, since an embedded-object frame also carries a preview `draw:image`.
237
242
 
238
243
  ## Fidelity constructs
239
244
 
@@ -250,7 +255,8 @@ Layered from a lossless core outward, mirroring `ooxml.js`:
250
255
  - **The quarantined residue rows** — inline no-analogue constructs (`text:ruby`, `text:meta`, a heading's `text:is-list-header` flag) quarantine on their own paragraph beside the style-chain unknowns; document-level tenants nothing else owns (`xforms:model`, DDE connection declarations and `text:dde-source` links, vendor-extension elements) quarantine at the package tier on `OdtDocument.source`; `table:calculation-settings` and vendor-extension elements (Calc writes its `calcext:conditional-formats` inside each `table:table`) do the same on `OdsDocument.source`; an odp slide's presentation extras — the transition attributes off the slide's own drawing-page style, where every ODF schema version and real Impress output put them (the legacy `presentation:transition-*`/`presentation:duration` spelling and the ODF 1.2 `smil:type`/`-subtype`/`-direction`/`-fadeColor` one), plus `presentation:sound` and `anim:` trees — and every format's unmapped shape kinds (`dr3d:scene`, `draw:connector`, `draw:measure`, applet/plugin/floating-frame) quarantine on their own slide/page; an unrecognised `draw:custom-shape` preset's whole `draw:enhanced-geometry` quarantines in the text shape it degrades to; and every non-content XML part (`settings.xml`, `META-INF/manifest.rdf`, `Configurations2/…`) quarantines at the package tier keyed by its part path — never an embedded sub-document's own `Object N/` parts, which the semantic channel already carries whole.
251
256
 
252
257
  Every read-side construct has no write-side counterpart because this package's typed layer is read-only — the honest asymmetry of a reader with no content writer; the lossless `encodePackage` layer remains the byte-fidelity tier.
253
- - **An embedded Math object in a spreadsheet cell reads as `objectKind: 'formula'`** — its `content.xml` root *is* the MathML root, so `readDrawObjectReference` falls back to `findMathRoot` and dispatches to `readOdfFormulaContent`.
258
+
259
+ - **An embedded Math object in a spreadsheet cell reads as `objectKind: 'formula'`** — its `content.xml` root _is_ the MathML root, so `readDrawObjectReference` falls back to `findMathRoot` and dispatches to `readOdfFormulaContent`.
254
260
  - **A `draw:frame`'s alternative text (`svg:title`, falling back to `svg:desc`) reads into `ContentImageBlock.altText`.**
255
261
  - **`readOdbInventory`'s `queries` carry real `db:command` SQL text**, not just names — a breaking rename from `string[]` to `OdbQueryInfo[]`.
256
262
  - **`.odb` Form/Report structure extraction is real** (`readOdbForm`/`readOdbReport`), grounded in a genuine fixture. **A SQL/`rpt:` rendering engine to execute a query or evaluate report totals is deliberately not attempted** — see the Status section. Even a fully bounded SQL engine would not suffice to render a report: grouping breaks (`rpt:HASCHANGED`), prefix functions (`rpt:LEFT`), and running totals (`rpt:SUM`) are evaluated by Report Builder's own `rpt:` formula language, not by SQL.
@@ -266,7 +272,7 @@ Conventional Commits, enforced workspace-wide by commitlint through a root `comm
266
272
  ## References
267
273
 
268
274
  - [ooxml.js](../ooxml.js/README.md) — the OOXML sibling; architecturally mirrored, deliberately not depended on.
269
- - [document-schema.js](../document-schema.js/README.md) — the canonical `ContentDocument`/`DocumentPackage` schema both packages depend on, and the home of the `assemblePackage`/`flattenPackage`/`decompose`/`factorStyles` transform between the two encodings.
275
+ - [document-schema.js](../document-schema.js/README.md) — the canonical `ContentDocument`/`DocumentTree` schema both packages depend on, and the home of the `assembleTree`/`flattenTree`/`decompose`/`factorStyles` transform between the two encodings.
270
276
  - [documents.js](https://github.com/ExaDev/documents.js) — the downstream consumer; its own `readOdtContent`/`readOdpContent`/`readOdsContent`/`readOdgContent` adapters wrap this package's flat `*Content` readers into `ContentDocument`s, adding the odt/odp formula, image, and vector detection passes those readers deliberately leave out.
271
277
 
272
278
  ## License
@@ -1,4 +1,4 @@
1
- import { d as XmlNode } from "./node-CkBWRjNR.cjs";
1
+ import { d as XmlNode } from "./node-B6JX5CRX.cjs";
2
2
  //#region src/xml/build.d.ts
3
3
  declare function buildXml(nodes: XmlNode[]): string;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { d as XmlNode } from "./node-CkBWRjNR.js";
1
+ import { d as XmlNode } from "./node-B6JX5CRX.js";
2
2
  //#region src/xml/build.d.ts
3
3
  declare function buildXml(nodes: XmlNode[]): string;
4
4
  //#endregion
@@ -1,10 +1,10 @@
1
- import { l as XmlElement } from "./node-CkBWRjNR.cjs";
2
- import { r as Package } from "./package-L24lkba-.cjs";
3
- import { n as StyleProperties } from "./properties-C-JKQZUD.cjs";
4
- import { i as StyleFamily } from "./registry-CphRYjDD.cjs";
1
+ import { l as XmlElement } from "./node-B6JX5CRX.cjs";
2
+ import { r as Package } from "./package-DMk9fuTI.cjs";
3
+ import { n as StyleProperties } from "./properties-CiIoNu2h.cjs";
4
+ import { i as StyleFamily } from "./registry-B-ZkdQv1.cjs";
5
5
  //#region src/typed/shared/cascade.d.ts
6
6
  interface CascadeDiagnostic {
7
- severity: 'warning';
7
+ severity: "warning";
8
8
  message: string;
9
9
  }
10
10
  interface StyleCascadeResult {
@@ -1,10 +1,10 @@
1
- import { l as XmlElement } from "./node-CkBWRjNR.js";
2
- import { r as Package } from "./package-BUojjTXf.js";
3
- import { n as StyleProperties } from "./properties-Rral02h1.js";
4
- import { i as StyleFamily } from "./registry-D5RGBteE.js";
1
+ import { l as XmlElement } from "./node-B6JX5CRX.js";
2
+ import { r as Package } from "./package-otZYrxiO.js";
3
+ import { n as StyleProperties } from "./properties-CJyykyc_.js";
4
+ import { i as StyleFamily } from "./registry-Dajfxsbz.js";
5
5
  //#region src/typed/shared/cascade.d.ts
6
6
  interface CascadeDiagnostic {
7
- severity: 'warning';
7
+ severity: "warning";
8
8
  message: string;
9
9
  }
10
10
  interface StyleCascadeResult {
@@ -1,43 +1,43 @@
1
- import { d as XmlNode } from "./node-CkBWRjNR.js";
2
- import { r as Package } from "./package-BUojjTXf.js";
3
- import "./read-CMDEXqGw.js";
4
- import "./write-BxVkPZID.js";
5
- import "./parse-A8_8sdpX.js";
6
- import "./build-Z1KRkSEB.js";
7
- import "./mimetype-BfkwTeaW.js";
8
- import "./fragment-B1ZV7T5Z.js";
9
- import "./manifest-CP1sqyGU.js";
10
- import "./properties-Rral02h1.js";
11
- import "./serialize-B-lq0LiG.js";
12
- import "./registry-D5RGBteE.js";
13
- import "./span-KXroEGuH.js";
14
- import "./query-sECN-7vU.js";
1
+ import { d as XmlNode } from "./node-B6JX5CRX.js";
2
+ import { r as Package } from "./package-otZYrxiO.js";
3
+ import "./read-a0p7laV3.js";
4
+ import "./write-R36XIZKx.js";
5
+ import "./parse-BLukZ2z0.js";
6
+ import "./build-DgBE0bmv.js";
7
+ import "./mimetype-DvMCOzmu.js";
8
+ import "./fragment-ClgCV_if.js";
9
+ import "./manifest-Bju-_gTQ.js";
10
+ import "./properties-CJyykyc_.js";
11
+ import "./serialize-CWz84e0m.js";
12
+ import "./registry-Dajfxsbz.js";
13
+ import "./span-C3aJuEOM.js";
14
+ import "./query-CbxD-WiQ.js";
15
15
  import "./color-CqXjt_to.js";
16
- import "./geometry-DnhkIhAM.js";
17
- import "./text-gJ5R0q3u.js";
18
- import "./cascade-BZ7zqXhL.js";
19
- import "./metadata-BXpjrAS-.js";
20
- import "./list-Qeuawtew.js";
21
- import "./paragraph-hzoy-Wos.js";
22
- import "./table-ByOoGcq_.js";
23
- import "./transform-C7GrZZdR.js";
24
- import "./masterpage-By_F05W4.js";
25
- import "./path-DE7wkIcz.js";
26
- import "./shapes-CCB8ydqD.js";
27
- import "./embedded-Zv8KtFUo.js";
28
- import "./read-DfEHXwgn.js";
29
- import "./read-24g5eZw6.js";
30
- import "./read-BLoaDxr_.js";
31
- import "./read-DJqvINGW.js";
32
- import "./read-BnN7u9Y2.js";
33
- import "./read-DYYxbvfo.js";
34
- import "./read-CvjbdgH3.js";
35
- import "./subdocument-BwW3FZC_.js";
36
- import "./forms-CyLw7lpE.js";
37
- import "./form-RJTtSmwn.js";
38
- import "./report-DbslT2OR.js";
16
+ import "./geometry-BI33aJpv.js";
17
+ import "./text-Bn3C7lnm.js";
18
+ import "./cascade-CaVinmvp.js";
19
+ import "./metadata-D1SOBTh8.js";
20
+ import "./list-X_GJY7P3.js";
21
+ import "./paragraph-ByTzS8Li.js";
22
+ import "./table-DclDgC5h.js";
23
+ import "./transform-BFNc16LQ.js";
24
+ import "./masterpage-BLK2OJ9q.js";
25
+ import "./path-CK0dIPgx.js";
26
+ import "./shapes-QkOsc-WT.js";
27
+ import "./embedded-C8tiMCE_.js";
28
+ import "./read-DUOJ-1hX.js";
29
+ import "./read-BcxAWBB5.js";
30
+ import "./read-D3wLfr-7.js";
31
+ import "./read-Bo1GBjSE.js";
32
+ import "./read-C_oVZAnY.js";
33
+ import "./read-8s8AdaEd.js";
34
+ import "./read-B2jnd5eS.js";
35
+ import "./subdocument-BhabEY9P.js";
36
+ import "./forms-Eq2p1ss3.js";
37
+ import "./form-D6XHM5SR.js";
38
+ import "./report-x9RuNwmr.js";
39
39
  import { z } from "zod";
40
- import { Alignment as Alignment$1, AlignmentSchema as AlignmentSchema$1, DocumentPackage as DocumentPackage$1 } from "document-schema.js";
40
+ import { Alignment as Alignment$1, AlignmentSchema as AlignmentSchema$1, DocumentTree as DocumentTree$1 } from "document-schema.js";
41
41
  //#region src/codec.d.ts
42
42
  declare const xmlCodec: z.ZodCodec<z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
43
43
  type: z.ZodLiteral<"text">;
@@ -106,4 +106,4 @@ declare const packageCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint
106
106
  declare function decodePackage(bytes: Uint8Array<ArrayBuffer>): Package;
107
107
  declare function encodePackage(pkg: Package): Uint8Array<ArrayBuffer>;
108
108
  //#endregion
109
- export { Alignment$1 as a, xmlCodec as i, encodePackage as n, AlignmentSchema$1 as o, packageCodec as r, DocumentPackage$1 as s, decodePackage as t };
109
+ export { Alignment$1 as a, xmlCodec as i, encodePackage as n, AlignmentSchema$1 as o, packageCodec as r, DocumentTree$1 as s, decodePackage as t };
@@ -1,43 +1,43 @@
1
- import { d as XmlNode } from "./node-CkBWRjNR.cjs";
2
- import { r as Package } from "./package-L24lkba-.cjs";
3
- import "./read-DzmMJPHd.cjs";
4
- import "./write-D3kyj1Xw.cjs";
5
- import "./parse-CP5FLZqv.cjs";
6
- import "./build-XSm3I8LT.cjs";
7
- import "./mimetype-CPNMj04s.cjs";
8
- import "./fragment-B1og_8uA.cjs";
9
- import "./manifest-BALwu2JR.cjs";
10
- import "./properties-C-JKQZUD.cjs";
11
- import "./serialize-D1fti8C5.cjs";
12
- import "./registry-CphRYjDD.cjs";
13
- import "./span-BtmvlqZH.cjs";
14
- import "./query-P-Y5DK0-.cjs";
1
+ import { d as XmlNode } from "./node-B6JX5CRX.cjs";
2
+ import { r as Package } from "./package-DMk9fuTI.cjs";
3
+ import "./read-sawU0IWI.cjs";
4
+ import "./write-Crk-Yt_w.cjs";
5
+ import "./parse-DcVtB3jT.cjs";
6
+ import "./build--uPsivid.cjs";
7
+ import "./mimetype-1BaQzNiS.cjs";
8
+ import "./fragment-9dNg-m46.cjs";
9
+ import "./manifest-BGs8Bbd_.cjs";
10
+ import "./properties-CiIoNu2h.cjs";
11
+ import "./serialize-BU7HZ8Qh.cjs";
12
+ import "./registry-B-ZkdQv1.cjs";
13
+ import "./span-DSM1SnHI.cjs";
14
+ import "./query-C69wTkqg.cjs";
15
15
  import "./color-CqXjt_to.cjs";
16
- import "./geometry-lKWJ_ifA.cjs";
17
- import "./text-BAi1tapc.cjs";
18
- import "./cascade-DWQfTwaM.cjs";
19
- import "./metadata-1j1zm9Cx.cjs";
20
- import "./list-KZeXA0mR.cjs";
21
- import "./paragraph-DaMqmhe3.cjs";
22
- import "./table-BH_Q2n_N.cjs";
23
- import "./transform-DKEjydnm.cjs";
24
- import "./masterpage-Bt6gxuoL.cjs";
25
- import "./path-DE7wkIcz.cjs";
26
- import "./shapes-8o3NjBLU.cjs";
27
- import "./embedded-BzPTTzdf.cjs";
28
- import "./read-CDSmR3qt.cjs";
29
- import "./read-rwDsgR0d.cjs";
30
- import "./read-IOYq80AA.cjs";
31
- import "./read-C3Ei_MYc.cjs";
32
- import "./read-DUCm1nUv.cjs";
33
- import "./read-ydLJ8bid.cjs";
34
- import "./read-BV2an1ok.cjs";
35
- import "./subdocument-yY8ASE4N.cjs";
36
- import "./forms-Eh1N15Qy.cjs";
37
- import "./form-CWWCkG-r.cjs";
38
- import "./report-D6WNYaVn.cjs";
16
+ import "./geometry-B7FZHSyD.cjs";
17
+ import "./text-CDUCcwje.cjs";
18
+ import "./cascade-BDkyOmoo.cjs";
19
+ import "./metadata-01SgHkRR.cjs";
20
+ import "./list-DwTyo_B2.cjs";
21
+ import "./paragraph-CVULactG.cjs";
22
+ import "./table-CYvFMlP6.cjs";
23
+ import "./transform-M1gbHp4j.cjs";
24
+ import "./masterpage-KqZshNGZ.cjs";
25
+ import "./path-CK0dIPgx.cjs";
26
+ import "./shapes-BCjeY90t.cjs";
27
+ import "./embedded-tlaHMady.cjs";
28
+ import "./read-DHOQqjOZ.cjs";
29
+ import "./read-Dy5p1OMb.cjs";
30
+ import "./read-DSyz0YLj.cjs";
31
+ import "./read-tpfiT_n4.cjs";
32
+ import "./read-j9o0IoMq.cjs";
33
+ import "./read-jVX8DHs3.cjs";
34
+ import "./read-D3V_MVAL.cjs";
35
+ import "./subdocument-CQptFIQK.cjs";
36
+ import "./forms-Dc74fCtk.cjs";
37
+ import "./form-coDwVdjG.cjs";
38
+ import "./report-39DyUx5W.cjs";
39
39
  import { z } from "zod";
40
- import { Alignment as Alignment$1, AlignmentSchema, DocumentPackage as DocumentPackage$1 } from "document-schema.js";
40
+ import { Alignment as Alignment$1, AlignmentSchema, DocumentTree as DocumentTree$1 } from "document-schema.js";
41
41
  //#region src/codec.d.ts
42
42
  declare const xmlCodec: z.ZodCodec<z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
43
43
  type: z.ZodLiteral<"text">;
@@ -106,4 +106,4 @@ declare const packageCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint
106
106
  declare function decodePackage(bytes: Uint8Array<ArrayBuffer>): Package;
107
107
  declare function encodePackage(pkg: Package): Uint8Array<ArrayBuffer>;
108
108
  //#endregion
109
- export { Alignment$1 as a, xmlCodec as i, encodePackage as n, AlignmentSchema as o, packageCodec as r, DocumentPackage$1 as s, decodePackage as t };
109
+ export { Alignment$1 as a, xmlCodec as i, encodePackage as n, AlignmentSchema as o, packageCodec as r, DocumentTree$1 as s, decodePackage as t };
package/dist/codec.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-C3i7QbVt.cjs";
1
+ import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-lz3vgEos.cjs";
2
2
  export { decodePackage, encodePackage, packageCodec, xmlCodec };
package/dist/codec.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-CbPSWzQ2.js";
1
+ import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-CyJ4gSH2.js";
2
2
  export { decodePackage, encodePackage, packageCodec, xmlCodec };
@@ -1,10 +1,10 @@
1
- import { d as XmlNode, l as XmlElement } from "./node-CkBWRjNR.js";
2
- import { r as Package } from "./package-BUojjTXf.js";
1
+ import { d as XmlNode, l as XmlElement } from "./node-B6JX5CRX.js";
2
+ import { r as Package } from "./package-otZYrxiO.js";
3
3
  import { AnchorDescriptor, ConstructDescriptor, ContentBlock, ContentControlDescriptor, DefinitionEntry, DivisionDescriptor, FieldDescriptor, ProvenanceDescriptor, RunConstructExtent, SourceResidue } from "document-schema.js";
4
4
  //#region src/typed/shared/constructs.d.ts
5
5
  declare function odfFieldDescriptor(element: XmlElement): FieldDescriptor;
6
6
  declare function odfBookmarkAnchorDescriptor(name: string): AnchorDescriptor;
7
- type OdfResidueFormat = 'odt' | 'ods' | 'odp' | 'odg' | 'odm' | 'odb' | 'odf';
7
+ type OdfResidueFormat = "odt" | "ods" | "odp" | "odg" | "odm" | "odb" | "odf";
8
8
  declare function odfResidue(format: OdfResidueFormat, ...elements: XmlElement[]): SourceResidue;
9
9
  declare function isOdfExtensionElement(element: XmlElement): boolean;
10
10
  declare const ODF_UNMAPPED_SHAPE_TAGS: ReadonlySet<string>;
@@ -17,16 +17,16 @@ declare function odfDivisionDescriptor(sectionElement: XmlElement, pkg: Package)
17
17
  declare const ODF_INDEX_WRAPPER_TAGS: ReadonlySet<string>;
18
18
  declare function isOdfIndexWrapper(element: XmlElement): boolean;
19
19
  declare function odfIndexControlDescriptor(wrapper: XmlElement): ContentControlDescriptor;
20
- type OdfMarkerKind = 'bookmark' | 'referenceMark' | 'change' | 'annotation';
20
+ type OdfMarkerKind = "bookmark" | "referenceMark" | "change" | "annotation";
21
21
  interface OdfMarkerHalf {
22
22
  readonly kind: OdfMarkerKind;
23
- readonly side: 'start' | 'end';
23
+ readonly side: "start" | "end";
24
24
  readonly key: string;
25
25
  readonly element: XmlElement;
26
26
  readonly parent: XmlElement;
27
27
  readonly runPosition: number;
28
28
  readonly order: number;
29
- readonly descriptor: () => RunConstructExtent['descriptor'] | undefined;
29
+ readonly descriptor: () => RunConstructExtent["descriptor"] | undefined;
30
30
  }
31
31
  declare function odfMarkerHalfEventIndex(half: OdfMarkerHalf, paragraphElement: XmlElement, paragraphStartIndex: number, liftedBlocksBeforeHalf?: number): number | undefined;
32
32
  declare function isOdfBlockScopedHalf(half: OdfMarkerHalf, paragraphElement: XmlElement): boolean;
@@ -48,12 +48,12 @@ interface OdfConstructExtent {
48
48
  declare function insertOdfConstructMarkers(blocks: readonly ContentBlock[], extents: readonly OdfConstructExtent[]): ContentBlock[];
49
49
  interface OdfMarkerEvent {
50
50
  readonly kind: OdfMarkerKind;
51
- readonly side: 'start' | 'end';
51
+ readonly side: "start" | "end";
52
52
  readonly key: string;
53
53
  readonly index: number;
54
54
  readonly qualified: boolean;
55
55
  readonly order: number;
56
- readonly descriptor: () => RunConstructExtent['descriptor'] | undefined;
56
+ readonly descriptor: () => RunConstructExtent["descriptor"] | undefined;
57
57
  readonly element: XmlElement;
58
58
  }
59
59
  declare function resolveOdfMarkerEvents(events: readonly OdfMarkerEvent[]): {
@@ -1,10 +1,10 @@
1
- import { d as XmlNode, l as XmlElement } from "./node-CkBWRjNR.cjs";
2
- import { r as Package } from "./package-L24lkba-.cjs";
1
+ import { d as XmlNode, l as XmlElement } from "./node-B6JX5CRX.cjs";
2
+ import { r as Package } from "./package-DMk9fuTI.cjs";
3
3
  import { AnchorDescriptor, ConstructDescriptor, ContentBlock, ContentControlDescriptor, DefinitionEntry, DivisionDescriptor, FieldDescriptor, ProvenanceDescriptor, RunConstructExtent, SourceResidue } from "document-schema.js";
4
4
  //#region src/typed/shared/constructs.d.ts
5
5
  declare function odfFieldDescriptor(element: XmlElement): FieldDescriptor;
6
6
  declare function odfBookmarkAnchorDescriptor(name: string): AnchorDescriptor;
7
- type OdfResidueFormat = 'odt' | 'ods' | 'odp' | 'odg' | 'odm' | 'odb' | 'odf';
7
+ type OdfResidueFormat = "odt" | "ods" | "odp" | "odg" | "odm" | "odb" | "odf";
8
8
  declare function odfResidue(format: OdfResidueFormat, ...elements: XmlElement[]): SourceResidue;
9
9
  declare function isOdfExtensionElement(element: XmlElement): boolean;
10
10
  declare const ODF_UNMAPPED_SHAPE_TAGS: ReadonlySet<string>;
@@ -17,16 +17,16 @@ declare function odfDivisionDescriptor(sectionElement: XmlElement, pkg: Package)
17
17
  declare const ODF_INDEX_WRAPPER_TAGS: ReadonlySet<string>;
18
18
  declare function isOdfIndexWrapper(element: XmlElement): boolean;
19
19
  declare function odfIndexControlDescriptor(wrapper: XmlElement): ContentControlDescriptor;
20
- type OdfMarkerKind = 'bookmark' | 'referenceMark' | 'change' | 'annotation';
20
+ type OdfMarkerKind = "bookmark" | "referenceMark" | "change" | "annotation";
21
21
  interface OdfMarkerHalf {
22
22
  readonly kind: OdfMarkerKind;
23
- readonly side: 'start' | 'end';
23
+ readonly side: "start" | "end";
24
24
  readonly key: string;
25
25
  readonly element: XmlElement;
26
26
  readonly parent: XmlElement;
27
27
  readonly runPosition: number;
28
28
  readonly order: number;
29
- readonly descriptor: () => RunConstructExtent['descriptor'] | undefined;
29
+ readonly descriptor: () => RunConstructExtent["descriptor"] | undefined;
30
30
  }
31
31
  declare function odfMarkerHalfEventIndex(half: OdfMarkerHalf, paragraphElement: XmlElement, paragraphStartIndex: number, liftedBlocksBeforeHalf?: number): number | undefined;
32
32
  declare function isOdfBlockScopedHalf(half: OdfMarkerHalf, paragraphElement: XmlElement): boolean;
@@ -48,12 +48,12 @@ interface OdfConstructExtent {
48
48
  declare function insertOdfConstructMarkers(blocks: readonly ContentBlock[], extents: readonly OdfConstructExtent[]): ContentBlock[];
49
49
  interface OdfMarkerEvent {
50
50
  readonly kind: OdfMarkerKind;
51
- readonly side: 'start' | 'end';
51
+ readonly side: "start" | "end";
52
52
  readonly key: string;
53
53
  readonly index: number;
54
54
  readonly qualified: boolean;
55
55
  readonly order: number;
56
- readonly descriptor: () => RunConstructExtent['descriptor'] | undefined;
56
+ readonly descriptor: () => RunConstructExtent["descriptor"] | undefined;
57
57
  readonly element: XmlElement;
58
58
  }
59
59
  declare function resolveOdfMarkerEvents(events: readonly OdfMarkerEvent[]): {
@@ -395,7 +395,7 @@ function readOdsContent(pkg) {
395
395
  }
396
396
  function readOds(pkg) {
397
397
  const { metadata, sheets, definitions, source } = readOdsContent(pkg);
398
- const assembled = (0, document_schema_js.assemblePackage)({
398
+ const assembled = (0, document_schema_js.assembleTree)({
399
399
  kind: "spreadsheet",
400
400
  metadata,
401
401
  sheets
@@ -747,7 +747,7 @@ function readOdtContent(pkg, options = {}) {
747
747
  }
748
748
  function readOdt(pkg, options = {}) {
749
749
  const { metadata, sections, definitions, source } = readOdtContent(pkg, options);
750
- const assembled = (0, document_schema_js.assemblePackage)({
750
+ const assembled = (0, document_schema_js.assembleTree)({
751
751
  kind: "wordprocessing",
752
752
  metadata,
753
753
  sections
@@ -1,6 +1,6 @@
1
- import { l as XmlElement } from "./node-CkBWRjNR.js";
2
- import { r as Package } from "./package-BUojjTXf.js";
3
- import { l as OdfResidueFormat } from "./constructs-C1S8qlVv.js";
1
+ import { l as XmlElement } from "./node-B6JX5CRX.js";
2
+ import { r as Package } from "./package-otZYrxiO.js";
3
+ import { l as OdfResidueFormat } from "./constructs-BntJjuvH.js";
4
4
  import { Box, ContentDocument, ContentEmbeddedObjectKind, SourceResidue } from "document-schema.js";
5
5
  //#region src/typed/draw/embedded.d.ts
6
6
  type EmbeddedDocumentKind = ContentEmbeddedObjectKind;
@@ -16,7 +16,7 @@ import { subDocumentPackage } from "./typed/odb/subdocument.js";
16
16
  import { readOdgContent } from "./typed/odg/read.js";
17
17
  import { readOdpContent } from "./typed/odp/read.js";
18
18
  import { readOdfFormControlConstructs } from "./typed/shared/forms.js";
19
- import { PAGE_SIZE_A4, assemblePackage } from "document-schema.js";
19
+ import { PAGE_SIZE_A4, assembleTree } from "document-schema.js";
20
20
  //#region src/typed/ods/read.ts
21
21
  const CONTENT_PART$2 = "content.xml";
22
22
  function parseKnownOdfLength$1(value) {
@@ -395,7 +395,7 @@ function readOdsContent(pkg) {
395
395
  }
396
396
  function readOds(pkg) {
397
397
  const { metadata, sheets, definitions, source } = readOdsContent(pkg);
398
- const assembled = assemblePackage({
398
+ const assembled = assembleTree({
399
399
  kind: "spreadsheet",
400
400
  metadata,
401
401
  sheets
@@ -747,7 +747,7 @@ function readOdtContent(pkg, options = {}) {
747
747
  }
748
748
  function readOdt(pkg, options = {}) {
749
749
  const { metadata, sections, definitions, source } = readOdtContent(pkg, options);
750
- const assembled = assemblePackage({
750
+ const assembled = assembleTree({
751
751
  kind: "wordprocessing",
752
752
  metadata,
753
753
  sections