odf.js 6.1.2 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![GitHub](https://img.shields.io/badge/GitHub-181717?logo=github&logoColor=white)](https://github.com/ExaDev/documents.js/tree/main/packages/odf.js) [![npm](https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white)](https://www.npmjs.com/package/odf.js) [![npm version](https://img.shields.io/npm/v/odf.js)](https://www.npmjs.com/package/odf.js) [![CI](https://img.shields.io/github/actions/workflow/status/ExaDev/documents.js/ci.yml?branch=main)](https://github.com/ExaDev/documents.js/actions)
4
4
 
5
- > A hand-written, dependency-minimal codec for the OpenDocument Format (ODF — OASIS/ISO 26300): `.odt`/`.ods`/`.odp`/`.odg`/`.odf`/`.odb`/`.odm` and their template variants, built on [Zod 4](https://zod.dev) codecs.
5
+ > A hand-written, dependency-minimal codec for the OpenDocument Format (ODF — OASIS/ISO 26300): `.odt`/`.ods`/`.odp`/`.odg`/`.odf`/`.odb`/`.odm` and their template variants, built on [Zod 4](https://zod.dev) codecs — plus read support for the pre-OASIS OpenOffice.org 1.x / StarOffice 6-7 documents ODF was based on (`.sxw`/`.sxc`/`.sxi`/`.sxd`).
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
 
@@ -64,6 +64,7 @@ Under active development. Built and shipped:
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
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
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
+ - **OpenOffice.org 1.x / StarOffice 6-7 reading** (`readSxw`/`readSxc`/`readSxi`/`readSxd` and their `*Content` siblings, plus `transformOoo1Package` and `isOoo1Package`) — the pre-OASIS ancestor ODF 1.0 was based on, read through the ODF readers above rather than beside them. See [Reading an OpenOffice.org 1.x document](#reading-an-openofficeorg-1x-document). **Read only:** there is no `.sxw` writer, because this package has no ODF content writer for an inverse transform to target.
67
68
 
68
69
  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
70
 
@@ -189,6 +190,42 @@ syncManifest(pkg); // rebuilds manifest.xml to exactly match pkg's current parts
189
190
  readMimetype(pkg); // 'application/vnd.oasis.opendocument.text'
190
191
  ```
191
192
 
193
+ ### Reading an OpenOffice.org 1.x document
194
+
195
+ `.sxw`/`.sxc`/`.sxi`/`.sxd` (and their `.stw`/`.stc`/`.sti`/`.std` template counterparts) are OpenOffice.org 1.x / StarOffice 6-7 documents — the format OASIS based ODF 1.0 directly on. They read through the same functions as their ODF successors, one reader per format, at the same two levels:
196
+
197
+ ```ts
198
+ import { decodePackage, readSxw, readSxcContent } from "odf.js";
199
+
200
+ const document = readSxw(decodePackage(sxwBytes)); // a wordprocessing DocumentTree
201
+ const { sheets } = readSxcContent(decodePackage(sxcBytes)); // the flat ContentSheet[] shape
202
+ ```
203
+
204
+ | Format | Reader | Flat sibling | Package kind |
205
+ | --------------- | --------- | ---------------- | ---------------- |
206
+ | `.sxw` / `.stw` | `readSxw` | `readSxwContent` | `wordprocessing` |
207
+ | `.sxc` / `.stc` | `readSxc` | `readSxcContent` | `spreadsheet` |
208
+ | `.sxi` / `.sti` | `readSxi` | `readSxiContent` | `presentation` |
209
+ | `.sxd` / `.std` | `readSxd` | `readSxdContent` | `drawing` |
210
+
211
+ None of these is a second reader. Each is `readOdt`/`readOds`/`readOdp`/`readOdg` run over a package `transformOoo1Package` has rewritten into the ODF shape — the same approach LibreOffice itself takes, where a `.sxw` goes through a transformer (`xmloff/source/transform/`) into the ordinary ODF importer rather than through an importer of its own. Every construct the ODF readers understand therefore works on an OpenOffice.org 1.x document too, and a fix to any of them fixes both formats at once.
212
+
213
+ `transformOoo1Package` is exported for a caller that wants the transformed `Package` rather than a read of it, and returns anything that is not an OpenOffice.org 1.x package unchanged; `isOoo1Package` is the same detection on its own, decided by the namespace URIs the package's parts declare rather than by a file extension or a manifest media type. `OOO1_NAMESPACES`, `OOO1_MEDIA_TYPES`, `ooo1MediaTypeForExtension` and `odfMediaTypeForOoo1MediaType` expose the format's own namespace and media-type tables.
214
+
215
+ **Read only.** There is no `.sxw` writer, and the asymmetry is not specific to this format: this package's typed layer is read-only for ODF as well, so there is no ODF content writer for an inverse transform to target. See [What differs between the two vocabularies](#what-differs-between-the-two-vocabularies) for what the transform covers, and its own module comment (`src/ooo1/transform.ts`) for the full list.
216
+
217
+ ### What differs between the two vocabularies
218
+
219
+ ODF kept OpenOffice.org XML's document model and most of its element and attribute names. What it changed, and what `src/ooo1/` therefore implements:
220
+
221
+ - **Every namespace URI OpenOffice.org minted** (`http://openoffice.org/2000/office` and its family) became an OASIS one, and `fo:`/`svg:` went the other way — OpenOffice.org bound them to the real W3C XSL-FO and SVG namespaces, where ODF mints its own `xsl-fo-compatible`/`svg-compatible` URIs.
222
+ - **The document's genre.** OpenOffice.org 1.x names it in an `office:class` attribute on the root and puts the content straight inside `office:body`; ODF dropped the attribute and wraps the content in `office:text`/`office:spreadsheet`/`office:presentation`/`office:drawing`/`office:chart`.
223
+ - **One `style:properties` per style became ODF's family of typed `style:*-properties` elements.** This is the one difference a namespace rename cannot paper over, because the same attribute name is valid in several of them with a different meaning in each (`fo:background-color` is a character highlight, paragraph shading, or a cell fill depending on which element it sits in). The split follows LibreOffice's own algorithm — an ordered candidate list per style family, first match wins — and lives in `src/ooo1/properties.ts`.
224
+ - **Frames.** `draw:image`, `draw:text-box`, `draw:object` and their siblings are bare shapes carrying their own position and anchoring; ODF wraps each in a `draw:frame` that carries those instead.
225
+ - **Renames**: `text:ordered-list`/`text:unordered-list` → `text:list`, the footnote/endnote pair → the `text:note` family with a `text:note-class`, `text:tab-stop` → `text:tab`, `text:h/@text:level` → `@text:outline-level`, `office:font-decls`/`style:font-decl` → `office:font-face-decls`/`style:font-face`, `style:page-master` → `style:page-layout`, `table:sub-table` → `table:table` + `table:is-sub-table`, and the `meta:keywords` wrapper unwrapped to bare `meta:keyword` children.
226
+ - **Values, not just names**: lengths written in the `"inch"` unit become `"in"`; a cell's `table:value-*` attributes become `office:value-*`; the compound `style:text-underline`/`style:text-crossing-out` attributes expand into ODF's style/type/width triples; `fo:keep-with-next`'s boolean becomes `always`/`auto`; a package-internal `xlink:href` loses the `#` OpenOffice.org prefixed it with; and `office:annotation`/`office:change-info` move their author and date from attributes into `dc:creator`/`dc:date` child elements.
227
+ - **The package.** An OpenOffice.org 1.x package has no `mimetype` part at all — the manifest's `/` entry, in its own `http://openoffice.org/2001/manifest` namespace, is the only record of the document's type. The transform rewrites that entry to the OASIS media type and synthesises the `mimetype` part.
228
+
192
229
  ### Direct module imports
193
230
 
194
231
  Every module is also importable directly by its own subpath, without going through the barrel:
@@ -217,6 +254,7 @@ Layered from a lossless core outward, mirroring `ooxml.js`:
217
254
  - **`src/typed/draw/`** — the shared `draw:frame`/`draw:g`/vector shape vocabulary and `readDrawImageBlock` (`shapes.ts`), plus `embedded.ts` (`readDrawObjectReference`, `readEmbeddedObjectDocument`, `readOdfChartContent` — the shared embedded-object reference resolver and the central kind→reader dispatch table).
218
255
  - **`src/typed/formula/`, `odm/`** — `readOdfFormula`/`readOdfFormulaContent`/`readOdfFormulaMathMl` and `readOdm`.
219
256
  - **`src/typed/odb/`** — `readOdbInventory`, `readOdbForm`/`readOdbReport`, `resolveOdbComponent`, `subDocumentPackage`.
257
+ - **`src/ooo1/`** — the OpenOffice.org 1.x variant reader: `ns.ts` (the pre-OASIS namespace and `application/vnd.sun.xml.*` media-type tables plus package detection), `properties.ts` (the `style:properties` split), `transform.ts` (the whole package rewrite), `read.ts` (`readSxw`/`readSxc`/`readSxi`/`readSxd`). Sits _beside_ `typed/`, not inside it: it adds no reader of its own, it feeds the ones already there.
220
258
 
221
259
  ## Conventions
222
260
 
@@ -228,6 +266,9 @@ Layered from a lossless core outward, mirroring `ooxml.js`:
228
266
  ## Gotchas and quirks
229
267
 
230
268
  - **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`.
269
+ - **OpenOffice.org 1.x's `presentation:` namespace is `http://openoffice.org/2000/presentation`, not the `2001/` one OpenOffice.org's own DTD declares.** `xmloff/dtd/nmspace.mod` says `2001/presentation`; every real `.sxi` says `2000/presentation`, and the `2001` spelling appears nowhere in LibreOffice's namespace table — so nothing could ever have read it. `config:` and `manifest:` genuinely are the `2001/` ones.
270
+ - **An OpenOffice.org 1.x package has no `mimetype` part.** That convention arrived with ODF; before it, the manifest's `/` entry was the only record of a document's type, and it is what `isOoo1Package`-adjacent code reads. `transformOoo1Package` synthesises the ODF part.
271
+ - **OpenOffice.org 1.x writes lengths in an `"inch"` unit ODF does not have** (`svg:width="1.9992inch"`), so `parseOdfLength` rejects them — the OpenOffice.org transform rewrites the unit before any reader sees it.
231
272
  - **`.odb`'s media type is `application/vnd.oasis.opendocument.base`**, not `...database`.
232
273
  - **`dc:creator` records whoever most recently _saved_ the document, not the author** — the original author is `meta:initial-creator`.
233
274
  - **`meta:keyword` appears once per keyword**, unlike OOXML's single comma-separated `cp:keywords`.
@@ -274,6 +315,8 @@ Conventional Commits, enforced workspace-wide by commitlint through a root `comm
274
315
  - [ooxml.js](../ooxml.js/README.md) — the OOXML sibling; architecturally mirrored, deliberately not depended on.
275
316
  - [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.
276
317
  - [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.
318
+ - [OpenOffice.org XML File Format 1.0](https://www.openoffice.org/xml/general.html) ([archived](https://web.archive.org/web/20240101000000*/https://www.openoffice.org/xml/general.html)) — the pre-OASIS format's own project page, and the source of the DTD (`xmloff/dtd/office.mod`, `text.mod`, `nmspace.mod`, [retained in Apache OpenOffice's tree](https://github.com/apache/openoffice/tree/trunk/main/xmloff/dtd)) that `src/ooo1/` was written against.
319
+ - [LibreOffice's own OpenOffice.org-to-ODF transformer](https://github.com/LibreOffice/core/tree/master/xmloff/source/transform) — `OOo2Oasis.cxx`'s element and attribute action tables and `StyleOOoTContext.cxx`'s `style:properties` splitter, cross-checked against for every rename `src/ooo1/` implements. Its namespace token table is [`xmloff/source/core/xmltoken.cxx`](https://github.com/LibreOffice/core/blob/master/xmloff/source/core/xmltoken.cxx) (the `XML_N_*_OOO` entries).
277
320
 
278
321
  ## License
279
322
 
@@ -35,6 +35,9 @@ import "./read-D3V_MVAL.cjs";
35
35
  import "./subdocument-CQptFIQK.cjs";
36
36
  import "./forms-Dc74fCtk.cjs";
37
37
  import "./form-coDwVdjG.cjs";
38
+ import "./ns-C14w-Zhf.cjs";
39
+ import "./transform-SDysw9wx.cjs";
40
+ import "./read-RFqq4ckj.cjs";
38
41
  import "./report-39DyUx5W.cjs";
39
42
  import { z } from "zod";
40
43
  import { Alignment as Alignment$1, AlignmentSchema, DocumentTree as DocumentTree$1 } from "document-schema.js";
@@ -35,6 +35,9 @@ import "./read-B2jnd5eS.js";
35
35
  import "./subdocument-BhabEY9P.js";
36
36
  import "./forms-Eq2p1ss3.js";
37
37
  import "./form-D6XHM5SR.js";
38
+ import "./ns-CTyKJZeF.js";
39
+ import "./transform-DRr76JEu.js";
40
+ import "./read-3yy5EFV_.js";
38
41
  import "./report-x9RuNwmr.js";
39
42
  import { z } from "zod";
40
43
  import { Alignment as Alignment$1, AlignmentSchema as AlignmentSchema$1, DocumentTree as DocumentTree$1 } from "document-schema.js";
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-lz3vgEos.cjs";
1
+ import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-B72LApRl.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-CyJ4gSH2.js";
1
+ import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-rbZGlr37.js";
2
2
  export { decodePackage, encodePackage, packageCodec, xmlCodec };
package/dist/index.cjs CHANGED
@@ -43,6 +43,9 @@ const require_typed_shared_forms = require("./typed/shared/forms.cjs");
43
43
  const require_typed_odm_read = require("./typed/odm/read.cjs");
44
44
  const require_typed_odb_read = require("./typed/odb/read.cjs");
45
45
  const require_typed_odb_form = require("./typed/odb/form.cjs");
46
+ const require_ooo1_ns = require("./ooo1/ns.cjs");
47
+ const require_ooo1_transform = require("./ooo1/transform.cjs");
48
+ const require_ooo1_read = require("./ooo1/read.cjs");
46
49
  const require_typed_odb_report = require("./typed/odb/report.cjs");
47
50
  let document_schema_js = require("document-schema.js");
48
51
  Object.defineProperty(exports, "AlignmentSchema", {
@@ -61,6 +64,8 @@ exports.ManifestProblemSchema = require_manifest.ManifestProblemSchema;
61
64
  exports.ManifestSchema = require_manifest.ManifestSchema;
62
65
  exports.ODF_MEDIA_TYPES = require_media_type.ODF_MEDIA_TYPES;
63
66
  exports.ODF_NAMESPACES = require_ns.ODF_NAMESPACES;
67
+ exports.OOO1_MEDIA_TYPES = require_ooo1_ns.OOO1_MEDIA_TYPES;
68
+ exports.OOO1_NAMESPACES = require_ooo1_ns.OOO1_NAMESPACES;
64
69
  exports.PackageSchema = require_model_package.PackageSchema;
65
70
  exports.PartSchema = require_model_package.PartSchema;
66
71
  exports.STYLE_FAMILIES = require_styles_registry.STYLE_FAMILIES;
@@ -104,12 +109,15 @@ exports.formatOdfLength = require_typed_shared_units.formatOdfLength;
104
109
  exports.formatPercentageMultiplier = require_styles_properties.formatPercentageMultiplier;
105
110
  exports.formatPt = require_styles_properties.formatPt;
106
111
  exports.getOdfSpaceCount = require_typed_shared_text.getOdfSpaceCount;
112
+ exports.isOoo1Package = require_ooo1_ns.isOoo1Package;
107
113
  exports.isStyleFamily = require_styles_registry.isStyleFamily;
108
114
  exports.isXmlNode = require_model_node.isXmlNode;
109
115
  exports.measureOdfNodeLength = require_typed_shared_text.measureOdfNodeLength;
110
116
  exports.mediaTypeForExtension = require_media_type.mediaTypeForExtension;
111
117
  exports.mintOdfListNumId = require_typed_shared_list.mintOdfListNumId;
112
118
  exports.netRotationDeg = require_typed_shared_transform.netRotationDeg;
119
+ exports.odfMediaTypeForOoo1MediaType = require_ooo1_ns.odfMediaTypeForOoo1MediaType;
120
+ exports.ooo1MediaTypeForExtension = require_ooo1_ns.ooo1MediaTypeForExtension;
113
121
  exports.packageCodec = require_codec.packageCodec;
114
122
  exports.paragraphPropertiesToAttributes = require_styles_properties.paragraphPropertiesToAttributes;
115
123
  exports.parseBox = require_typed_shared_geometry.parseBox;
@@ -157,6 +165,14 @@ exports.readOds = require_embedded.readOds;
157
165
  exports.readOdsContent = require_embedded.readOdsContent;
158
166
  exports.readOdt = require_embedded.readOdt;
159
167
  exports.readOdtContent = require_embedded.readOdtContent;
168
+ exports.readSxc = require_ooo1_read.readSxc;
169
+ exports.readSxcContent = require_ooo1_read.readSxcContent;
170
+ exports.readSxd = require_ooo1_read.readSxd;
171
+ exports.readSxdContent = require_ooo1_read.readSxdContent;
172
+ exports.readSxi = require_ooo1_read.readSxi;
173
+ exports.readSxiContent = require_ooo1_read.readSxiContent;
174
+ exports.readSxw = require_ooo1_read.readSxw;
175
+ exports.readSxwContent = require_ooo1_read.readSxwContent;
160
176
  exports.resolveDrawPageSize = require_typed_shared_masterpage.resolveDrawPageSize;
161
177
  exports.resolveOdbComponent = require_typed_odb_read.resolveOdbComponent;
162
178
  exports.resolveOdfListKind = require_typed_shared_list.resolveOdfListKind;
@@ -173,6 +189,7 @@ exports.subDocumentPackage = require_typed_odb_subdocument.subDocumentPackage;
173
189
  exports.sumOdfNodeLength = require_typed_shared_text.sumOdfNodeLength;
174
190
  exports.syncManifest = require_manifest.syncManifest;
175
191
  exports.textPropertiesToAttributes = require_styles_properties.textPropertiesToAttributes;
192
+ exports.transformOoo1Package = require_ooo1_transform.transformOoo1Package;
176
193
  exports.txt = require_xml_fragment.txt;
177
194
  exports.unzipPackage = require_zip.unzipPackage;
178
195
  exports.validateManifest = require_manifest.validateManifest;
package/dist/index.d.cts CHANGED
@@ -43,6 +43,9 @@ import { a as readOdbInventory, i as OdbQueryInfo, n as OdbConnectionInfo, o as
43
43
  import { n as subDocumentPackage, t as SubDocumentPackageOptions } from "./subdocument-CQptFIQK.cjs";
44
44
  import { i as readOdfFormDefinitions, n as OdbFormDefinition, r as readOdfFormControlConstructs, t as OdbFormControl } from "./forms-Dc74fCtk.cjs";
45
45
  import { n as readOdbForm, t as OdbForm } from "./form-coDwVdjG.cjs";
46
+ import { a as isOoo1Package, i as Ooo1NamespacePrefix, n as OOO1_NAMESPACES, o as odfMediaTypeForOoo1MediaType, r as Ooo1Extension, s as ooo1MediaTypeForExtension, t as OOO1_MEDIA_TYPES } from "./ns-C14w-Zhf.cjs";
47
+ import { t as transformOoo1Package } from "./transform-SDysw9wx.cjs";
48
+ import { a as readSxi, c as readSxwContent, i as readSxdContent, n as readSxcContent, o as readSxiContent, r as readSxd, s as readSxw, t as readSxc } from "./read-RFqq4ckj.cjs";
46
49
  import { a as OdbReportGroup, i as OdbReportFunction, n as OdbReportBand, o as readOdbReport, r as OdbReportElement, t as OdbReport } from "./report-39DyUx5W.cjs";
47
- import { a as Alignment, i as xmlCodec, n as encodePackage, o as AlignmentSchema, r as packageCodec, s as DocumentTree, t as decodePackage } from "./codec-lz3vgEos.cjs";
48
- export { type Alignment, AlignmentSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type BuildManifestOptions, type CascadeDiagnostic, type DocumentTree, type DrawPageContent, type EmbeddedDocumentKind, type EmbeddedDrawObject, type ImageFormat, type InternRequest, type LengthUnit, MANIFEST_PART, META_PART, MIMETYPE_PART, type Manifest, type ManifestEntry, ManifestEntrySchema, type ManifestProblem, ManifestProblemSchema, ManifestSchema, ODF_MEDIA_TYPES, ODF_NAMESPACES, type OdbComponentInfo, type OdbConnectionInfo, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, type OdfExtension, type OdfFormulaDocument, type OdfListIdState, type OdfListParagraphReader, type OdfNamespacePrefix, type OdfPoint, type OdfRawPoint, type OdfRawSegment, type OdfRawSubpath, type OdfShapeGeometry, type OdfTransformFunction, type OdfViewBox, type OdgDocument, type OdmDocument, type OdmSection, type OdpDocument, type OdsDocument, type OdtDocument, type OdtHeaderFooterPart, type OdtHeaderFooterVariant, type OdtReadOptions, type OtherPartRef, type Package, PackageSchema, type ParsedProperties, type Part, PartSchema, STYLE_FAMILIES, type StyleCascadeResult, type StyleElementChainResult, type StyleFamily, type StyleProperties, StylePropertiesSchema, StyleRegistry, type StyleRegistryOptions, type SubDocumentPackageOptions, TableCursor, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, type ZipEntry, applyOdfTransform, attrValue, base64ToBytes, buildManifest, buildOdfSubpaths, buildStylePropertyElements, buildXml, bytesToBase64, canonicalPropertiesString, cellReference, childrenWithTag, columnIndexToLetters, columnLettersToIndex, composeOdfGroupTransform, decodeOdfText, decodePackage, decodeXmlText, el, elementsWithTag, encodePackage, encodeXmlText, ensureSpan, findChildElement, findStyleElement, formatOdfColor, formatOdfLength, formatPercentageMultiplier, formatPt, getOdfSpaceCount, isStyleFamily, isXmlNode, measureOdfNodeLength, mediaTypeForExtension, mintOdfListNumId, netRotationDeg, packageCodec, paragraphPropertiesToAttributes, parseBox, parseCellReference, parseOdfLength as parseLength, parseOdfLength, parseLinePoints, parseMargins, parseOdfColor, parseOdfPathData, parseOdfPointsList, parseOdfTransform, parseOdfViewBox, parsePackage, parsePageSize, parseParagraphProperties, parseStyleElementProperties, parseTextProperties, parseXml, rawSubpathFromPoints, readDrawFrame, readDrawImageBlock, readDrawObjectReference, readDrawPageContent, readManifest, readMimetype, readOdbForm, readOdbInventory, readOdbReport, readOdfFormControlConstructs, readOdfFormDefinitions, readOdfFormula, readOdfFormulaContent, readOdfFormulaMathMl, readOdfListParagraphs, readOdfMetadata, readOdfParagraph, readOdfTable, readOdg, readOdgContent, readOdm, readOdp, readOdpContent, readOds, readOdsContent, readOdt, readOdtContent, resolveDrawPageSize, resolveOdbComponent, resolveOdfListKind, resolveOdfShapeGeometry, resolvePageLayoutProperties, resolveStyle, resolveStyleElementChain, rootElement, scaleOdfRawPoint, serializePackage, setDocumentMediaType, sniffImageFormat, subDocumentPackage, sumOdfNodeLength, syncManifest, textPropertiesToAttributes, txt, unzipPackage, validateManifest, walkDrawShapes, writeManifest, writeMimetype, xmlCodec, xmlnsAttributes, zipPackage };
50
+ import { a as Alignment, i as xmlCodec, n as encodePackage, o as AlignmentSchema, r as packageCodec, s as DocumentTree, t as decodePackage } from "./codec-B72LApRl.cjs";
51
+ export { type Alignment, AlignmentSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type BuildManifestOptions, type CascadeDiagnostic, type DocumentTree, type DrawPageContent, type EmbeddedDocumentKind, type EmbeddedDrawObject, type ImageFormat, type InternRequest, type LengthUnit, MANIFEST_PART, META_PART, MIMETYPE_PART, type Manifest, type ManifestEntry, ManifestEntrySchema, type ManifestProblem, ManifestProblemSchema, ManifestSchema, ODF_MEDIA_TYPES, ODF_NAMESPACES, OOO1_MEDIA_TYPES, OOO1_NAMESPACES, type OdbComponentInfo, type OdbConnectionInfo, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, type OdfExtension, type OdfFormulaDocument, type OdfListIdState, type OdfListParagraphReader, type OdfNamespacePrefix, type OdfPoint, type OdfRawPoint, type OdfRawSegment, type OdfRawSubpath, type OdfShapeGeometry, type OdfTransformFunction, type OdfViewBox, type OdgDocument, type OdmDocument, type OdmSection, type OdpDocument, type OdsDocument, type OdtDocument, type OdtHeaderFooterPart, type OdtHeaderFooterVariant, type OdtReadOptions, type Ooo1Extension, type Ooo1NamespacePrefix, type OtherPartRef, type Package, PackageSchema, type ParsedProperties, type Part, PartSchema, STYLE_FAMILIES, type StyleCascadeResult, type StyleElementChainResult, type StyleFamily, type StyleProperties, StylePropertiesSchema, StyleRegistry, type StyleRegistryOptions, type SubDocumentPackageOptions, TableCursor, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, type ZipEntry, applyOdfTransform, attrValue, base64ToBytes, buildManifest, buildOdfSubpaths, buildStylePropertyElements, buildXml, bytesToBase64, canonicalPropertiesString, cellReference, childrenWithTag, columnIndexToLetters, columnLettersToIndex, composeOdfGroupTransform, decodeOdfText, decodePackage, decodeXmlText, el, elementsWithTag, encodePackage, encodeXmlText, ensureSpan, findChildElement, findStyleElement, formatOdfColor, formatOdfLength, formatPercentageMultiplier, formatPt, getOdfSpaceCount, isOoo1Package, isStyleFamily, isXmlNode, measureOdfNodeLength, mediaTypeForExtension, mintOdfListNumId, netRotationDeg, odfMediaTypeForOoo1MediaType, ooo1MediaTypeForExtension, packageCodec, paragraphPropertiesToAttributes, parseBox, parseCellReference, parseOdfLength as parseLength, parseOdfLength, parseLinePoints, parseMargins, parseOdfColor, parseOdfPathData, parseOdfPointsList, parseOdfTransform, parseOdfViewBox, parsePackage, parsePageSize, parseParagraphProperties, parseStyleElementProperties, parseTextProperties, parseXml, rawSubpathFromPoints, readDrawFrame, readDrawImageBlock, readDrawObjectReference, readDrawPageContent, readManifest, readMimetype, readOdbForm, readOdbInventory, readOdbReport, readOdfFormControlConstructs, readOdfFormDefinitions, readOdfFormula, readOdfFormulaContent, readOdfFormulaMathMl, readOdfListParagraphs, readOdfMetadata, readOdfParagraph, readOdfTable, readOdg, readOdgContent, readOdm, readOdp, readOdpContent, readOds, readOdsContent, readOdt, readOdtContent, readSxc, readSxcContent, readSxd, readSxdContent, readSxi, readSxiContent, readSxw, readSxwContent, resolveDrawPageSize, resolveOdbComponent, resolveOdfListKind, resolveOdfShapeGeometry, resolvePageLayoutProperties, resolveStyle, resolveStyleElementChain, rootElement, scaleOdfRawPoint, serializePackage, setDocumentMediaType, sniffImageFormat, subDocumentPackage, sumOdfNodeLength, syncManifest, textPropertiesToAttributes, transformOoo1Package, txt, unzipPackage, validateManifest, walkDrawShapes, writeManifest, writeMimetype, xmlCodec, xmlnsAttributes, zipPackage };
package/dist/index.d.ts CHANGED
@@ -43,6 +43,9 @@ import { a as readOdbInventory, i as OdbQueryInfo, n as OdbConnectionInfo, o as
43
43
  import { n as subDocumentPackage, t as SubDocumentPackageOptions } from "./subdocument-BhabEY9P.js";
44
44
  import { i as readOdfFormDefinitions, n as OdbFormDefinition, r as readOdfFormControlConstructs, t as OdbFormControl } from "./forms-Eq2p1ss3.js";
45
45
  import { n as readOdbForm, t as OdbForm } from "./form-D6XHM5SR.js";
46
+ import { a as isOoo1Package, i as Ooo1NamespacePrefix, n as OOO1_NAMESPACES, o as odfMediaTypeForOoo1MediaType, r as Ooo1Extension, s as ooo1MediaTypeForExtension, t as OOO1_MEDIA_TYPES } from "./ns-CTyKJZeF.js";
47
+ import { t as transformOoo1Package } from "./transform-DRr76JEu.js";
48
+ import { a as readSxi, c as readSxwContent, i as readSxdContent, n as readSxcContent, o as readSxiContent, r as readSxd, s as readSxw, t as readSxc } from "./read-3yy5EFV_.js";
46
49
  import { a as OdbReportGroup, i as OdbReportFunction, n as OdbReportBand, o as readOdbReport, r as OdbReportElement, t as OdbReport } from "./report-x9RuNwmr.js";
47
- import { a as Alignment, i as xmlCodec, n as encodePackage, o as AlignmentSchema, r as packageCodec, s as DocumentTree, t as decodePackage } from "./codec-CyJ4gSH2.js";
48
- export { type Alignment, AlignmentSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type BuildManifestOptions, type CascadeDiagnostic, type DocumentTree, type DrawPageContent, type EmbeddedDocumentKind, type EmbeddedDrawObject, type ImageFormat, type InternRequest, type LengthUnit, MANIFEST_PART, META_PART, MIMETYPE_PART, type Manifest, type ManifestEntry, ManifestEntrySchema, type ManifestProblem, ManifestProblemSchema, ManifestSchema, ODF_MEDIA_TYPES, ODF_NAMESPACES, type OdbComponentInfo, type OdbConnectionInfo, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, type OdfExtension, type OdfFormulaDocument, type OdfListIdState, type OdfListParagraphReader, type OdfNamespacePrefix, type OdfPoint, type OdfRawPoint, type OdfRawSegment, type OdfRawSubpath, type OdfShapeGeometry, type OdfTransformFunction, type OdfViewBox, type OdgDocument, type OdmDocument, type OdmSection, type OdpDocument, type OdsDocument, type OdtDocument, type OdtHeaderFooterPart, type OdtHeaderFooterVariant, type OdtReadOptions, type OtherPartRef, type Package, PackageSchema, type ParsedProperties, type Part, PartSchema, STYLE_FAMILIES, type StyleCascadeResult, type StyleElementChainResult, type StyleFamily, type StyleProperties, StylePropertiesSchema, StyleRegistry, type StyleRegistryOptions, type SubDocumentPackageOptions, TableCursor, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, type ZipEntry, applyOdfTransform, attrValue, base64ToBytes, buildManifest, buildOdfSubpaths, buildStylePropertyElements, buildXml, bytesToBase64, canonicalPropertiesString, cellReference, childrenWithTag, columnIndexToLetters, columnLettersToIndex, composeOdfGroupTransform, decodeOdfText, decodePackage, decodeXmlText, el, elementsWithTag, encodePackage, encodeXmlText, ensureSpan, findChildElement, findStyleElement, formatOdfColor, formatOdfLength, formatPercentageMultiplier, formatPt, getOdfSpaceCount, isStyleFamily, isXmlNode, measureOdfNodeLength, mediaTypeForExtension, mintOdfListNumId, netRotationDeg, packageCodec, paragraphPropertiesToAttributes, parseBox, parseCellReference, parseOdfLength as parseLength, parseOdfLength, parseLinePoints, parseMargins, parseOdfColor, parseOdfPathData, parseOdfPointsList, parseOdfTransform, parseOdfViewBox, parsePackage, parsePageSize, parseParagraphProperties, parseStyleElementProperties, parseTextProperties, parseXml, rawSubpathFromPoints, readDrawFrame, readDrawImageBlock, readDrawObjectReference, readDrawPageContent, readManifest, readMimetype, readOdbForm, readOdbInventory, readOdbReport, readOdfFormControlConstructs, readOdfFormDefinitions, readOdfFormula, readOdfFormulaContent, readOdfFormulaMathMl, readOdfListParagraphs, readOdfMetadata, readOdfParagraph, readOdfTable, readOdg, readOdgContent, readOdm, readOdp, readOdpContent, readOds, readOdsContent, readOdt, readOdtContent, resolveDrawPageSize, resolveOdbComponent, resolveOdfListKind, resolveOdfShapeGeometry, resolvePageLayoutProperties, resolveStyle, resolveStyleElementChain, rootElement, scaleOdfRawPoint, serializePackage, setDocumentMediaType, sniffImageFormat, subDocumentPackage, sumOdfNodeLength, syncManifest, textPropertiesToAttributes, txt, unzipPackage, validateManifest, walkDrawShapes, writeManifest, writeMimetype, xmlCodec, xmlnsAttributes, zipPackage };
50
+ import { a as Alignment, i as xmlCodec, n as encodePackage, o as AlignmentSchema, r as packageCodec, s as DocumentTree, t as decodePackage } from "./codec-rbZGlr37.js";
51
+ export { type Alignment, AlignmentSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type BuildManifestOptions, type CascadeDiagnostic, type DocumentTree, type DrawPageContent, type EmbeddedDocumentKind, type EmbeddedDrawObject, type ImageFormat, type InternRequest, type LengthUnit, MANIFEST_PART, META_PART, MIMETYPE_PART, type Manifest, type ManifestEntry, ManifestEntrySchema, type ManifestProblem, ManifestProblemSchema, ManifestSchema, ODF_MEDIA_TYPES, ODF_NAMESPACES, OOO1_MEDIA_TYPES, OOO1_NAMESPACES, type OdbComponentInfo, type OdbConnectionInfo, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, type OdfExtension, type OdfFormulaDocument, type OdfListIdState, type OdfListParagraphReader, type OdfNamespacePrefix, type OdfPoint, type OdfRawPoint, type OdfRawSegment, type OdfRawSubpath, type OdfShapeGeometry, type OdfTransformFunction, type OdfViewBox, type OdgDocument, type OdmDocument, type OdmSection, type OdpDocument, type OdsDocument, type OdtDocument, type OdtHeaderFooterPart, type OdtHeaderFooterVariant, type OdtReadOptions, type Ooo1Extension, type Ooo1NamespacePrefix, type OtherPartRef, type Package, PackageSchema, type ParsedProperties, type Part, PartSchema, STYLE_FAMILIES, type StyleCascadeResult, type StyleElementChainResult, type StyleFamily, type StyleProperties, StylePropertiesSchema, StyleRegistry, type StyleRegistryOptions, type SubDocumentPackageOptions, TableCursor, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, type ZipEntry, applyOdfTransform, attrValue, base64ToBytes, buildManifest, buildOdfSubpaths, buildStylePropertyElements, buildXml, bytesToBase64, canonicalPropertiesString, cellReference, childrenWithTag, columnIndexToLetters, columnLettersToIndex, composeOdfGroupTransform, decodeOdfText, decodePackage, decodeXmlText, el, elementsWithTag, encodePackage, encodeXmlText, ensureSpan, findChildElement, findStyleElement, formatOdfColor, formatOdfLength, formatPercentageMultiplier, formatPt, getOdfSpaceCount, isOoo1Package, isStyleFamily, isXmlNode, measureOdfNodeLength, mediaTypeForExtension, mintOdfListNumId, netRotationDeg, odfMediaTypeForOoo1MediaType, ooo1MediaTypeForExtension, packageCodec, paragraphPropertiesToAttributes, parseBox, parseCellReference, parseOdfLength as parseLength, parseOdfLength, parseLinePoints, parseMargins, parseOdfColor, parseOdfPathData, parseOdfPointsList, parseOdfTransform, parseOdfViewBox, parsePackage, parsePageSize, parseParagraphProperties, parseStyleElementProperties, parseTextProperties, parseXml, rawSubpathFromPoints, readDrawFrame, readDrawImageBlock, readDrawObjectReference, readDrawPageContent, readManifest, readMimetype, readOdbForm, readOdbInventory, readOdbReport, readOdfFormControlConstructs, readOdfFormDefinitions, readOdfFormula, readOdfFormulaContent, readOdfFormulaMathMl, readOdfListParagraphs, readOdfMetadata, readOdfParagraph, readOdfTable, readOdg, readOdgContent, readOdm, readOdp, readOdpContent, readOds, readOdsContent, readOdt, readOdtContent, readSxc, readSxcContent, readSxd, readSxdContent, readSxi, readSxiContent, readSxw, readSxwContent, resolveDrawPageSize, resolveOdbComponent, resolveOdfListKind, resolveOdfShapeGeometry, resolvePageLayoutProperties, resolveStyle, resolveStyleElementChain, rootElement, scaleOdfRawPoint, serializePackage, setDocumentMediaType, sniffImageFormat, subDocumentPackage, sumOdfNodeLength, syncManifest, textPropertiesToAttributes, transformOoo1Package, txt, unzipPackage, validateManifest, walkDrawShapes, writeManifest, writeMimetype, xmlCodec, xmlnsAttributes, zipPackage };
package/dist/index.js CHANGED
@@ -42,6 +42,9 @@ import { readOdfFormControlConstructs, readOdfFormDefinitions } from "./typed/sh
42
42
  import { readOdm } from "./typed/odm/read.js";
43
43
  import { readOdbInventory, resolveOdbComponent } from "./typed/odb/read.js";
44
44
  import { readOdbForm } from "./typed/odb/form.js";
45
+ import { OOO1_MEDIA_TYPES, OOO1_NAMESPACES, isOoo1Package, odfMediaTypeForOoo1MediaType, ooo1MediaTypeForExtension } from "./ooo1/ns.js";
46
+ import { transformOoo1Package } from "./ooo1/transform.js";
47
+ import { readSxc, readSxcContent, readSxd, readSxdContent, readSxi, readSxiContent, readSxw, readSxwContent } from "./ooo1/read.js";
45
48
  import { readOdbReport } from "./typed/odb/report.js";
46
49
  import { AlignmentSchema } from "document-schema.js";
47
- export { AlignmentSchema, AttributeSchema, BinaryPartSchema, MANIFEST_PART, META_PART, MIMETYPE_PART, ManifestEntrySchema, ManifestProblemSchema, ManifestSchema, ODF_MEDIA_TYPES, ODF_NAMESPACES, PackageSchema, PartSchema, STYLE_FAMILIES, StylePropertiesSchema, StyleRegistry, TableCursor, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, applyOdfTransform, attrValue, base64ToBytes, buildManifest, buildOdfSubpaths, buildStylePropertyElements, buildXml, bytesToBase64, canonicalPropertiesString, cellReference, childrenWithTag, columnIndexToLetters, columnLettersToIndex, composeOdfGroupTransform, decodeOdfText, decodePackage, decodeXmlText, el, elementsWithTag, encodePackage, encodeXmlText, ensureSpan, findChildElement, findStyleElement, formatOdfColor, formatOdfLength, formatPercentageMultiplier, formatPt, getOdfSpaceCount, isStyleFamily, isXmlNode, measureOdfNodeLength, mediaTypeForExtension, mintOdfListNumId, netRotationDeg, packageCodec, paragraphPropertiesToAttributes, parseBox, parseCellReference, parseOdfLength as parseLength, parseOdfLength, parseLinePoints, parseMargins, parseOdfColor, parseOdfPathData, parseOdfPointsList, parseOdfTransform, parseOdfViewBox, parsePackage, parsePageSize, parseParagraphProperties, parseStyleElementProperties, parseTextProperties, parseXml, rawSubpathFromPoints, readDrawFrame, readDrawImageBlock, readDrawObjectReference, readDrawPageContent, readManifest, readMimetype, readOdbForm, readOdbInventory, readOdbReport, readOdfFormControlConstructs, readOdfFormDefinitions, readOdfFormula, readOdfFormulaContent, readOdfFormulaMathMl, readOdfListParagraphs, readOdfMetadata, readOdfParagraph, readOdfTable, readOdg, readOdgContent, readOdm, readOdp, readOdpContent, readOds, readOdsContent, readOdt, readOdtContent, resolveDrawPageSize, resolveOdbComponent, resolveOdfListKind, resolveOdfShapeGeometry, resolvePageLayoutProperties, resolveStyle, resolveStyleElementChain, rootElement, scaleOdfRawPoint, serializePackage, setDocumentMediaType, sniffImageFormat, subDocumentPackage, sumOdfNodeLength, syncManifest, textPropertiesToAttributes, txt, unzipPackage, validateManifest, walkDrawShapes, writeManifest, writeMimetype, xmlCodec, xmlnsAttributes, zipPackage };
50
+ export { AlignmentSchema, AttributeSchema, BinaryPartSchema, MANIFEST_PART, META_PART, MIMETYPE_PART, ManifestEntrySchema, ManifestProblemSchema, ManifestSchema, ODF_MEDIA_TYPES, ODF_NAMESPACES, OOO1_MEDIA_TYPES, OOO1_NAMESPACES, PackageSchema, PartSchema, STYLE_FAMILIES, StylePropertiesSchema, StyleRegistry, TableCursor, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, applyOdfTransform, attrValue, base64ToBytes, buildManifest, buildOdfSubpaths, buildStylePropertyElements, buildXml, bytesToBase64, canonicalPropertiesString, cellReference, childrenWithTag, columnIndexToLetters, columnLettersToIndex, composeOdfGroupTransform, decodeOdfText, decodePackage, decodeXmlText, el, elementsWithTag, encodePackage, encodeXmlText, ensureSpan, findChildElement, findStyleElement, formatOdfColor, formatOdfLength, formatPercentageMultiplier, formatPt, getOdfSpaceCount, isOoo1Package, isStyleFamily, isXmlNode, measureOdfNodeLength, mediaTypeForExtension, mintOdfListNumId, netRotationDeg, odfMediaTypeForOoo1MediaType, ooo1MediaTypeForExtension, packageCodec, paragraphPropertiesToAttributes, parseBox, parseCellReference, parseOdfLength as parseLength, parseOdfLength, parseLinePoints, parseMargins, parseOdfColor, parseOdfPathData, parseOdfPointsList, parseOdfTransform, parseOdfViewBox, parsePackage, parsePageSize, parseParagraphProperties, parseStyleElementProperties, parseTextProperties, parseXml, rawSubpathFromPoints, readDrawFrame, readDrawImageBlock, readDrawObjectReference, readDrawPageContent, readManifest, readMimetype, readOdbForm, readOdbInventory, readOdbReport, readOdfFormControlConstructs, readOdfFormDefinitions, readOdfFormula, readOdfFormulaContent, readOdfFormulaMathMl, readOdfListParagraphs, readOdfMetadata, readOdfParagraph, readOdfTable, readOdg, readOdgContent, readOdm, readOdp, readOdpContent, readOds, readOdsContent, readOdt, readOdtContent, readSxc, readSxcContent, readSxd, readSxdContent, readSxi, readSxiContent, readSxw, readSxwContent, resolveDrawPageSize, resolveOdbComponent, resolveOdfListKind, resolveOdfShapeGeometry, resolvePageLayoutProperties, resolveStyle, resolveStyleElementChain, rootElement, scaleOdfRawPoint, serializePackage, setDocumentMediaType, sniffImageFormat, subDocumentPackage, sumOdfNodeLength, syncManifest, textPropertiesToAttributes, transformOoo1Package, txt, unzipPackage, validateManifest, walkDrawShapes, writeManifest, writeMimetype, xmlCodec, xmlnsAttributes, zipPackage };
@@ -0,0 +1,42 @@
1
+ import { r as Package } from "./package-DMk9fuTI.cjs";
2
+ //#region src/ooo1/ns.d.ts
3
+ declare const OOO1_NAMESPACES: Readonly<{
4
+ office: "http://openoffice.org/2000/office";
5
+ style: "http://openoffice.org/2000/style";
6
+ text: "http://openoffice.org/2000/text";
7
+ table: "http://openoffice.org/2000/table";
8
+ draw: "http://openoffice.org/2000/drawing";
9
+ meta: "http://openoffice.org/2000/meta";
10
+ number: "http://openoffice.org/2000/datastyle";
11
+ chart: "http://openoffice.org/2000/chart";
12
+ dr3d: "http://openoffice.org/2000/dr3d";
13
+ form: "http://openoffice.org/2000/form";
14
+ script: "http://openoffice.org/2000/script";
15
+ presentation: "http://openoffice.org/2000/presentation";
16
+ config: "http://openoffice.org/2001/config";
17
+ manifest: "http://openoffice.org/2001/manifest";
18
+ fo: "http://www.w3.org/1999/XSL/Format";
19
+ svg: "http://www.w3.org/2000/svg";
20
+ xlink: "http://www.w3.org/1999/xlink";
21
+ dc: "http://purl.org/dc/elements/1.1/";
22
+ math: "http://www.w3.org/1998/Math/MathML";
23
+ }>;
24
+ type Ooo1NamespacePrefix = keyof typeof OOO1_NAMESPACES;
25
+ declare const OOO1_MEDIA_TYPES: Readonly<{
26
+ sxw: "application/vnd.sun.xml.writer";
27
+ stw: "application/vnd.sun.xml.writer.template";
28
+ sxg: "application/vnd.sun.xml.writer.global";
29
+ sxc: "application/vnd.sun.xml.calc";
30
+ stc: "application/vnd.sun.xml.calc.template";
31
+ sxi: "application/vnd.sun.xml.impress";
32
+ sti: "application/vnd.sun.xml.impress.template";
33
+ sxd: "application/vnd.sun.xml.draw";
34
+ std: "application/vnd.sun.xml.draw.template";
35
+ sxm: "application/vnd.sun.xml.math";
36
+ }>;
37
+ type Ooo1Extension = keyof typeof OOO1_MEDIA_TYPES;
38
+ declare function ooo1MediaTypeForExtension(extension: string): string | undefined;
39
+ declare function odfMediaTypeForOoo1MediaType(mediaType: string): string | undefined;
40
+ declare function isOoo1Package(pkg: Package): boolean;
41
+ //#endregion
42
+ export { isOoo1Package as a, Ooo1NamespacePrefix as i, OOO1_NAMESPACES as n, odfMediaTypeForOoo1MediaType as o, Ooo1Extension as r, ooo1MediaTypeForExtension as s, OOO1_MEDIA_TYPES as t };
@@ -0,0 +1,42 @@
1
+ import { r as Package } from "./package-otZYrxiO.js";
2
+ //#region src/ooo1/ns.d.ts
3
+ declare const OOO1_NAMESPACES: Readonly<{
4
+ office: "http://openoffice.org/2000/office";
5
+ style: "http://openoffice.org/2000/style";
6
+ text: "http://openoffice.org/2000/text";
7
+ table: "http://openoffice.org/2000/table";
8
+ draw: "http://openoffice.org/2000/drawing";
9
+ meta: "http://openoffice.org/2000/meta";
10
+ number: "http://openoffice.org/2000/datastyle";
11
+ chart: "http://openoffice.org/2000/chart";
12
+ dr3d: "http://openoffice.org/2000/dr3d";
13
+ form: "http://openoffice.org/2000/form";
14
+ script: "http://openoffice.org/2000/script";
15
+ presentation: "http://openoffice.org/2000/presentation";
16
+ config: "http://openoffice.org/2001/config";
17
+ manifest: "http://openoffice.org/2001/manifest";
18
+ fo: "http://www.w3.org/1999/XSL/Format";
19
+ svg: "http://www.w3.org/2000/svg";
20
+ xlink: "http://www.w3.org/1999/xlink";
21
+ dc: "http://purl.org/dc/elements/1.1/";
22
+ math: "http://www.w3.org/1998/Math/MathML";
23
+ }>;
24
+ type Ooo1NamespacePrefix = keyof typeof OOO1_NAMESPACES;
25
+ declare const OOO1_MEDIA_TYPES: Readonly<{
26
+ sxw: "application/vnd.sun.xml.writer";
27
+ stw: "application/vnd.sun.xml.writer.template";
28
+ sxg: "application/vnd.sun.xml.writer.global";
29
+ sxc: "application/vnd.sun.xml.calc";
30
+ stc: "application/vnd.sun.xml.calc.template";
31
+ sxi: "application/vnd.sun.xml.impress";
32
+ sti: "application/vnd.sun.xml.impress.template";
33
+ sxd: "application/vnd.sun.xml.draw";
34
+ std: "application/vnd.sun.xml.draw.template";
35
+ sxm: "application/vnd.sun.xml.math";
36
+ }>;
37
+ type Ooo1Extension = keyof typeof OOO1_MEDIA_TYPES;
38
+ declare function ooo1MediaTypeForExtension(extension: string): string | undefined;
39
+ declare function odfMediaTypeForOoo1MediaType(mediaType: string): string | undefined;
40
+ declare function isOoo1Package(pkg: Package): boolean;
41
+ //#endregion
42
+ export { isOoo1Package as a, Ooo1NamespacePrefix as i, OOO1_NAMESPACES as n, odfMediaTypeForOoo1MediaType as o, Ooo1Extension as r, ooo1MediaTypeForExtension as s, OOO1_MEDIA_TYPES as t };
@@ -0,0 +1,74 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_xml_query = require("../xml/query.cjs");
3
+ //#region src/ooo1/ns.ts
4
+ const OOO1_NAMESPACES = Object.freeze({
5
+ office: "http://openoffice.org/2000/office",
6
+ style: "http://openoffice.org/2000/style",
7
+ text: "http://openoffice.org/2000/text",
8
+ table: "http://openoffice.org/2000/table",
9
+ draw: "http://openoffice.org/2000/drawing",
10
+ meta: "http://openoffice.org/2000/meta",
11
+ number: "http://openoffice.org/2000/datastyle",
12
+ chart: "http://openoffice.org/2000/chart",
13
+ dr3d: "http://openoffice.org/2000/dr3d",
14
+ form: "http://openoffice.org/2000/form",
15
+ script: "http://openoffice.org/2000/script",
16
+ presentation: "http://openoffice.org/2000/presentation",
17
+ config: "http://openoffice.org/2001/config",
18
+ manifest: "http://openoffice.org/2001/manifest",
19
+ fo: "http://www.w3.org/1999/XSL/Format",
20
+ svg: "http://www.w3.org/2000/svg",
21
+ xlink: "http://www.w3.org/1999/xlink",
22
+ dc: "http://purl.org/dc/elements/1.1/",
23
+ math: "http://www.w3.org/1998/Math/MathML"
24
+ });
25
+ const OOO1_ONLY_NAMESPACE_URIS = new Set(Object.values(OOO1_NAMESPACES).filter((uri) => uri.startsWith("http://openoffice.org/")));
26
+ const OOO1_MEDIA_TYPES = Object.freeze({
27
+ sxw: "application/vnd.sun.xml.writer",
28
+ stw: "application/vnd.sun.xml.writer.template",
29
+ sxg: "application/vnd.sun.xml.writer.global",
30
+ sxc: "application/vnd.sun.xml.calc",
31
+ stc: "application/vnd.sun.xml.calc.template",
32
+ sxi: "application/vnd.sun.xml.impress",
33
+ sti: "application/vnd.sun.xml.impress.template",
34
+ sxd: "application/vnd.sun.xml.draw",
35
+ std: "application/vnd.sun.xml.draw.template",
36
+ sxm: "application/vnd.sun.xml.math"
37
+ });
38
+ function isOoo1Extension(extension) {
39
+ return Object.hasOwn(OOO1_MEDIA_TYPES, extension);
40
+ }
41
+ function ooo1MediaTypeForExtension(extension) {
42
+ const lower = extension.toLowerCase();
43
+ return isOoo1Extension(lower) ? OOO1_MEDIA_TYPES[lower] : void 0;
44
+ }
45
+ const ODF_MEDIA_TYPE_BY_OOO1_MEDIA_TYPE = /* @__PURE__ */ new Map([
46
+ [OOO1_MEDIA_TYPES.sxw, "application/vnd.oasis.opendocument.text"],
47
+ [OOO1_MEDIA_TYPES.stw, "application/vnd.oasis.opendocument.text-template"],
48
+ [OOO1_MEDIA_TYPES.sxg, "application/vnd.oasis.opendocument.text-master"],
49
+ [OOO1_MEDIA_TYPES.sxc, "application/vnd.oasis.opendocument.spreadsheet"],
50
+ [OOO1_MEDIA_TYPES.stc, "application/vnd.oasis.opendocument.spreadsheet-template"],
51
+ [OOO1_MEDIA_TYPES.sxi, "application/vnd.oasis.opendocument.presentation"],
52
+ [OOO1_MEDIA_TYPES.sti, "application/vnd.oasis.opendocument.presentation-template"],
53
+ [OOO1_MEDIA_TYPES.sxd, "application/vnd.oasis.opendocument.graphics"],
54
+ [OOO1_MEDIA_TYPES.std, "application/vnd.oasis.opendocument.graphics-template"],
55
+ [OOO1_MEDIA_TYPES.sxm, "application/vnd.oasis.opendocument.formula"]
56
+ ]);
57
+ function odfMediaTypeForOoo1MediaType(mediaType) {
58
+ return ODF_MEDIA_TYPE_BY_OOO1_MEDIA_TYPE.get(mediaType);
59
+ }
60
+ function isOoo1Package(pkg) {
61
+ for (const part of Object.values(pkg.parts)) {
62
+ if (part.kind !== "xml") continue;
63
+ const root = require_xml_query.rootElement(part.nodes);
64
+ if (root === void 0) continue;
65
+ for (const attribute of root.attributes) if ((attribute.name === "xmlns" || attribute.name.startsWith("xmlns:")) && OOO1_ONLY_NAMESPACE_URIS.has(attribute.value)) return true;
66
+ }
67
+ return false;
68
+ }
69
+ //#endregion
70
+ exports.OOO1_MEDIA_TYPES = OOO1_MEDIA_TYPES;
71
+ exports.OOO1_NAMESPACES = OOO1_NAMESPACES;
72
+ exports.isOoo1Package = isOoo1Package;
73
+ exports.odfMediaTypeForOoo1MediaType = odfMediaTypeForOoo1MediaType;
74
+ exports.ooo1MediaTypeForExtension = ooo1MediaTypeForExtension;
@@ -0,0 +1,2 @@
1
+ import { a as isOoo1Package, i as Ooo1NamespacePrefix, n as OOO1_NAMESPACES, o as odfMediaTypeForOoo1MediaType, r as Ooo1Extension, s as ooo1MediaTypeForExtension, t as OOO1_MEDIA_TYPES } from "../ns-C14w-Zhf.cjs";
2
+ export { OOO1_MEDIA_TYPES, OOO1_NAMESPACES, Ooo1Extension, Ooo1NamespacePrefix, isOoo1Package, odfMediaTypeForOoo1MediaType, ooo1MediaTypeForExtension };
@@ -0,0 +1,2 @@
1
+ import { a as isOoo1Package, i as Ooo1NamespacePrefix, n as OOO1_NAMESPACES, o as odfMediaTypeForOoo1MediaType, r as Ooo1Extension, s as ooo1MediaTypeForExtension, t as OOO1_MEDIA_TYPES } from "../ns-CTyKJZeF.js";
2
+ export { OOO1_MEDIA_TYPES, OOO1_NAMESPACES, Ooo1Extension, Ooo1NamespacePrefix, isOoo1Package, odfMediaTypeForOoo1MediaType, ooo1MediaTypeForExtension };
@@ -0,0 +1,69 @@
1
+ import { rootElement } from "../xml/query.js";
2
+ //#region src/ooo1/ns.ts
3
+ const OOO1_NAMESPACES = Object.freeze({
4
+ office: "http://openoffice.org/2000/office",
5
+ style: "http://openoffice.org/2000/style",
6
+ text: "http://openoffice.org/2000/text",
7
+ table: "http://openoffice.org/2000/table",
8
+ draw: "http://openoffice.org/2000/drawing",
9
+ meta: "http://openoffice.org/2000/meta",
10
+ number: "http://openoffice.org/2000/datastyle",
11
+ chart: "http://openoffice.org/2000/chart",
12
+ dr3d: "http://openoffice.org/2000/dr3d",
13
+ form: "http://openoffice.org/2000/form",
14
+ script: "http://openoffice.org/2000/script",
15
+ presentation: "http://openoffice.org/2000/presentation",
16
+ config: "http://openoffice.org/2001/config",
17
+ manifest: "http://openoffice.org/2001/manifest",
18
+ fo: "http://www.w3.org/1999/XSL/Format",
19
+ svg: "http://www.w3.org/2000/svg",
20
+ xlink: "http://www.w3.org/1999/xlink",
21
+ dc: "http://purl.org/dc/elements/1.1/",
22
+ math: "http://www.w3.org/1998/Math/MathML"
23
+ });
24
+ const OOO1_ONLY_NAMESPACE_URIS = new Set(Object.values(OOO1_NAMESPACES).filter((uri) => uri.startsWith("http://openoffice.org/")));
25
+ const OOO1_MEDIA_TYPES = Object.freeze({
26
+ sxw: "application/vnd.sun.xml.writer",
27
+ stw: "application/vnd.sun.xml.writer.template",
28
+ sxg: "application/vnd.sun.xml.writer.global",
29
+ sxc: "application/vnd.sun.xml.calc",
30
+ stc: "application/vnd.sun.xml.calc.template",
31
+ sxi: "application/vnd.sun.xml.impress",
32
+ sti: "application/vnd.sun.xml.impress.template",
33
+ sxd: "application/vnd.sun.xml.draw",
34
+ std: "application/vnd.sun.xml.draw.template",
35
+ sxm: "application/vnd.sun.xml.math"
36
+ });
37
+ function isOoo1Extension(extension) {
38
+ return Object.hasOwn(OOO1_MEDIA_TYPES, extension);
39
+ }
40
+ function ooo1MediaTypeForExtension(extension) {
41
+ const lower = extension.toLowerCase();
42
+ return isOoo1Extension(lower) ? OOO1_MEDIA_TYPES[lower] : void 0;
43
+ }
44
+ const ODF_MEDIA_TYPE_BY_OOO1_MEDIA_TYPE = /* @__PURE__ */ new Map([
45
+ [OOO1_MEDIA_TYPES.sxw, "application/vnd.oasis.opendocument.text"],
46
+ [OOO1_MEDIA_TYPES.stw, "application/vnd.oasis.opendocument.text-template"],
47
+ [OOO1_MEDIA_TYPES.sxg, "application/vnd.oasis.opendocument.text-master"],
48
+ [OOO1_MEDIA_TYPES.sxc, "application/vnd.oasis.opendocument.spreadsheet"],
49
+ [OOO1_MEDIA_TYPES.stc, "application/vnd.oasis.opendocument.spreadsheet-template"],
50
+ [OOO1_MEDIA_TYPES.sxi, "application/vnd.oasis.opendocument.presentation"],
51
+ [OOO1_MEDIA_TYPES.sti, "application/vnd.oasis.opendocument.presentation-template"],
52
+ [OOO1_MEDIA_TYPES.sxd, "application/vnd.oasis.opendocument.graphics"],
53
+ [OOO1_MEDIA_TYPES.std, "application/vnd.oasis.opendocument.graphics-template"],
54
+ [OOO1_MEDIA_TYPES.sxm, "application/vnd.oasis.opendocument.formula"]
55
+ ]);
56
+ function odfMediaTypeForOoo1MediaType(mediaType) {
57
+ return ODF_MEDIA_TYPE_BY_OOO1_MEDIA_TYPE.get(mediaType);
58
+ }
59
+ function isOoo1Package(pkg) {
60
+ for (const part of Object.values(pkg.parts)) {
61
+ if (part.kind !== "xml") continue;
62
+ const root = rootElement(part.nodes);
63
+ if (root === void 0) continue;
64
+ for (const attribute of root.attributes) if ((attribute.name === "xmlns" || attribute.name.startsWith("xmlns:")) && OOO1_ONLY_NAMESPACE_URIS.has(attribute.value)) return true;
65
+ }
66
+ return false;
67
+ }
68
+ //#endregion
69
+ export { OOO1_MEDIA_TYPES, OOO1_NAMESPACES, isOoo1Package, odfMediaTypeForOoo1MediaType, ooo1MediaTypeForExtension };