odf.js 5.4.0 → 5.5.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/dist/{codec-CCjdir_f.d.cts → codec-C3i7QbVt.d.cts} +1 -1
- package/dist/{codec-heu5sgsK.d.ts → codec-CbPSWzQ2.d.ts} +1 -1
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/{embedded-DbLrCGPi.cjs → embedded-CBTvjVKb.cjs} +8 -21
- package/dist/{embedded-BSSdoKcK.js → embedded-D2MXjcFm.js} +9 -22
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{paragraph-BEAeuCLf.d.cts → paragraph-DaMqmhe3.d.cts} +2 -1
- package/dist/{paragraph-DdcX8JuK.d.ts → paragraph-hzoy-Wos.d.ts} +2 -1
- package/dist/typed/draw/embedded.cjs +1 -1
- package/dist/typed/draw/embedded.js +1 -1
- package/dist/typed/odb/form.cjs +1 -1
- package/dist/typed/odb/form.js +1 -1
- package/dist/typed/ods/read.cjs +1 -1
- package/dist/typed/ods/read.js +1 -1
- package/dist/typed/odt/read.cjs +1 -1
- package/dist/typed/odt/read.js +1 -1
- package/dist/typed/shared/paragraph.cjs +15 -0
- package/dist/typed/shared/paragraph.d.cts +2 -2
- package/dist/typed/shared/paragraph.d.ts +2 -2
- package/dist/typed/shared/paragraph.js +15 -1
- package/dist/typed/shared/table.cjs +6 -1
- package/dist/typed/shared/table.js +7 -2
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ import "./text-BAi1tapc.cjs";
|
|
|
18
18
|
import "./cascade-DWQfTwaM.cjs";
|
|
19
19
|
import "./metadata-1j1zm9Cx.cjs";
|
|
20
20
|
import "./list-KZeXA0mR.cjs";
|
|
21
|
-
import "./paragraph-
|
|
21
|
+
import "./paragraph-DaMqmhe3.cjs";
|
|
22
22
|
import "./table-BH_Q2n_N.cjs";
|
|
23
23
|
import "./transform-DKEjydnm.cjs";
|
|
24
24
|
import "./masterpage-Bt6gxuoL.cjs";
|
|
@@ -18,7 +18,7 @@ import "./text-gJ5R0q3u.js";
|
|
|
18
18
|
import "./cascade-BZ7zqXhL.js";
|
|
19
19
|
import "./metadata-BXpjrAS-.js";
|
|
20
20
|
import "./list-Qeuawtew.js";
|
|
21
|
-
import "./paragraph-
|
|
21
|
+
import "./paragraph-hzoy-Wos.js";
|
|
22
22
|
import "./table-ByOoGcq_.js";
|
|
23
23
|
import "./transform-C7GrZZdR.js";
|
|
24
24
|
import "./masterpage-By_F05W4.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-
|
|
1
|
+
import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-C3i7QbVt.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-
|
|
1
|
+
import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-CbPSWzQ2.js";
|
|
2
2
|
export { decodePackage, encodePackage, packageCodec, xmlCodec };
|
|
@@ -434,20 +434,6 @@ const ODT_HEADER_FOOTER_TAGS = /* @__PURE__ */ new Map([
|
|
|
434
434
|
]);
|
|
435
435
|
const CONTENT_PART$1 = "content.xml";
|
|
436
436
|
const AUTOMATIC_STYLE_PARTS = [CONTENT_PART$1, "styles.xml"];
|
|
437
|
-
function readOutlineLevel(headingElement) {
|
|
438
|
-
const raw = require_xml_query.attrValue(headingElement, "text:outline-level");
|
|
439
|
-
if (raw === void 0) return 1;
|
|
440
|
-
const parsed = Number.parseInt(raw, 10);
|
|
441
|
-
return Number.isInteger(parsed) && parsed > 0 ? parsed : 1;
|
|
442
|
-
}
|
|
443
|
-
function readParagraphOrHeading(element, paragraph) {
|
|
444
|
-
if (element.tag === "text:h") {
|
|
445
|
-
const outlineLevel = readOutlineLevel(element);
|
|
446
|
-
paragraph.styleId = `Heading${outlineLevel}`;
|
|
447
|
-
paragraph.headingLevel = outlineLevel;
|
|
448
|
-
}
|
|
449
|
-
return paragraph;
|
|
450
|
-
}
|
|
451
437
|
function resolveParagraphMasterPageName(element, pkg, state) {
|
|
452
438
|
const styleName = require_xml_query.attrValue(element, "text:style-name");
|
|
453
439
|
if (state.masterPageByStyleName.has(styleName)) return state.masterPageByStyleName.get(styleName);
|
|
@@ -541,15 +527,16 @@ function readBlocks(nodes, pkg, state, baseIndex = 0) {
|
|
|
541
527
|
};
|
|
542
528
|
const readOneParagraph = (element) => {
|
|
543
529
|
const halves = [];
|
|
530
|
+
const paragraph = require_typed_shared_paragraph.readOdfParagraph(element, pkg, {
|
|
531
|
+
provenanceRegions: state.provenanceRegions,
|
|
532
|
+
markersOut: halves,
|
|
533
|
+
definitions: state.definitions,
|
|
534
|
+
listIdState: state.listIdState,
|
|
535
|
+
format: "odt"
|
|
536
|
+
});
|
|
544
537
|
return {
|
|
545
538
|
element,
|
|
546
|
-
paragraph:
|
|
547
|
-
provenanceRegions: state.provenanceRegions,
|
|
548
|
-
markersOut: halves,
|
|
549
|
-
definitions: state.definitions,
|
|
550
|
-
listIdState: state.listIdState,
|
|
551
|
-
format: "odt"
|
|
552
|
-
})),
|
|
539
|
+
paragraph: require_typed_shared_paragraph.readParagraphOrHeading(element, paragraph),
|
|
553
540
|
halves,
|
|
554
541
|
liftedSources: readAnchoredFrameSources(element, pkg, state),
|
|
555
542
|
masterPageName: resolveParagraphMasterPageName(element, pkg, state)
|
|
@@ -6,7 +6,7 @@ import { findStyleElement, resolveStyleElementChain } from "./typed/shared/casca
|
|
|
6
6
|
import { readOdfMetadata } from "./typed/shared/metadata.js";
|
|
7
7
|
import { mintOdfListNumId, readOdfListParagraphs } from "./typed/shared/list.js";
|
|
8
8
|
import { addOdfPackageResidue, collectOdfDataStyleDefinitions, collectOdfFieldMasterDefinitions, collectOdfFontFaceDefinitions, collectOdfNamedExpressions, collectOdfNonContentPartResidue, collectOdfProvenanceRegions, insertOdfConstructMarkers, isOdfExtensionElement, isOdfIndexWrapper, odfDivisionDescriptor, odfIndexControlDescriptor, odfMarkerHalfEventIndex, odfResidue, resolveOdfMarkerEvents } from "./typed/shared/constructs.js";
|
|
9
|
-
import { readOdfConstructBodyBlocks, readOdfParagraph } from "./typed/shared/paragraph.js";
|
|
9
|
+
import { readOdfConstructBodyBlocks, readOdfParagraph, readParagraphOrHeading } from "./typed/shared/paragraph.js";
|
|
10
10
|
import { readCellStyleDecoration, readOdfTable } from "./typed/shared/table.js";
|
|
11
11
|
import { parseOdfTransform } from "./typed/shared/transform.js";
|
|
12
12
|
import { readOdfMasterPageElements, resolvePageLayoutProperties } from "./typed/shared/masterpage.js";
|
|
@@ -434,20 +434,6 @@ const ODT_HEADER_FOOTER_TAGS = /* @__PURE__ */ new Map([
|
|
|
434
434
|
]);
|
|
435
435
|
const CONTENT_PART$1 = "content.xml";
|
|
436
436
|
const AUTOMATIC_STYLE_PARTS = [CONTENT_PART$1, "styles.xml"];
|
|
437
|
-
function readOutlineLevel(headingElement) {
|
|
438
|
-
const raw = attrValue(headingElement, "text:outline-level");
|
|
439
|
-
if (raw === void 0) return 1;
|
|
440
|
-
const parsed = Number.parseInt(raw, 10);
|
|
441
|
-
return Number.isInteger(parsed) && parsed > 0 ? parsed : 1;
|
|
442
|
-
}
|
|
443
|
-
function readParagraphOrHeading(element, paragraph) {
|
|
444
|
-
if (element.tag === "text:h") {
|
|
445
|
-
const outlineLevel = readOutlineLevel(element);
|
|
446
|
-
paragraph.styleId = `Heading${outlineLevel}`;
|
|
447
|
-
paragraph.headingLevel = outlineLevel;
|
|
448
|
-
}
|
|
449
|
-
return paragraph;
|
|
450
|
-
}
|
|
451
437
|
function resolveParagraphMasterPageName(element, pkg, state) {
|
|
452
438
|
const styleName = attrValue(element, "text:style-name");
|
|
453
439
|
if (state.masterPageByStyleName.has(styleName)) return state.masterPageByStyleName.get(styleName);
|
|
@@ -541,15 +527,16 @@ function readBlocks(nodes, pkg, state, baseIndex = 0) {
|
|
|
541
527
|
};
|
|
542
528
|
const readOneParagraph = (element) => {
|
|
543
529
|
const halves = [];
|
|
530
|
+
const paragraph = readOdfParagraph(element, pkg, {
|
|
531
|
+
provenanceRegions: state.provenanceRegions,
|
|
532
|
+
markersOut: halves,
|
|
533
|
+
definitions: state.definitions,
|
|
534
|
+
listIdState: state.listIdState,
|
|
535
|
+
format: "odt"
|
|
536
|
+
});
|
|
544
537
|
return {
|
|
545
538
|
element,
|
|
546
|
-
paragraph: readParagraphOrHeading(element,
|
|
547
|
-
provenanceRegions: state.provenanceRegions,
|
|
548
|
-
markersOut: halves,
|
|
549
|
-
definitions: state.definitions,
|
|
550
|
-
listIdState: state.listIdState,
|
|
551
|
-
format: "odt"
|
|
552
|
-
})),
|
|
539
|
+
paragraph: readParagraphOrHeading(element, paragraph),
|
|
553
540
|
halves,
|
|
554
541
|
liftedSources: readAnchoredFrameSources(element, pkg, state),
|
|
555
542
|
masterPageName: resolveParagraphMasterPageName(element, pkg, state)
|
package/dist/index.cjs
CHANGED
|
@@ -38,7 +38,7 @@ const require_typed_formula_read = require("./typed/formula/read.cjs");
|
|
|
38
38
|
const require_typed_odb_subdocument = require("./typed/odb/subdocument.cjs");
|
|
39
39
|
const require_typed_odg_read = require("./typed/odg/read.cjs");
|
|
40
40
|
const require_typed_odp_read = require("./typed/odp/read.cjs");
|
|
41
|
-
const require_embedded = require("./embedded-
|
|
41
|
+
const require_embedded = require("./embedded-CBTvjVKb.cjs");
|
|
42
42
|
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");
|
package/dist/index.d.cts
CHANGED
|
@@ -26,7 +26,7 @@ import { a as measureOdfNodeLength, n as decodeOdfText, o as sumOdfNodeLength, r
|
|
|
26
26
|
import { a as resolveStyle, i as findStyleElement, n as StyleCascadeResult, o as resolveStyleElementChain, r as StyleElementChainResult, t as CascadeDiagnostic } from "./cascade-DWQfTwaM.cjs";
|
|
27
27
|
import { n as readOdfMetadata, t as META_PART } from "./metadata-1j1zm9Cx.cjs";
|
|
28
28
|
import { a as resolveOdfListKind, i as readOdfListParagraphs, n as OdfListParagraphReader, r as mintOdfListNumId, t as OdfListIdState } from "./list-KZeXA0mR.cjs";
|
|
29
|
-
import { r as readOdfParagraph } from "./paragraph-
|
|
29
|
+
import { r as readOdfParagraph } from "./paragraph-DaMqmhe3.cjs";
|
|
30
30
|
import { r as readOdfTable } from "./table-BH_Q2n_N.cjs";
|
|
31
31
|
import { a as composeOdfGroupTransform, c as resolveOdfShapeGeometry, i as applyOdfTransform, n as OdfShapeGeometry, o as netRotationDeg, r as OdfTransformFunction, s as parseOdfTransform, t as OdfPoint } from "./transform-DKEjydnm.cjs";
|
|
32
32
|
import { n as resolveDrawPageSize, r as resolvePageLayoutProperties } from "./masterpage-Bt6gxuoL.cjs";
|
|
@@ -44,5 +44,5 @@ import { n as subDocumentPackage, t as SubDocumentPackageOptions } from "./subdo
|
|
|
44
44
|
import { i as readOdfFormDefinitions, n as OdbFormDefinition, r as readOdfFormControlConstructs, t as OdbFormControl } from "./forms-Eh1N15Qy.cjs";
|
|
45
45
|
import { n as readOdbForm, t as OdbForm } from "./form-CWWCkG-r.cjs";
|
|
46
46
|
import { a as OdbReportGroup, i as OdbReportFunction, n as OdbReportBand, o as readOdbReport, r as OdbReportElement, t as OdbReport } from "./report-D6WNYaVn.cjs";
|
|
47
|
-
import { a as Alignment, i as xmlCodec, n as encodePackage, o as AlignmentSchema, r as packageCodec, s as DocumentPackage, t as decodePackage } from "./codec-
|
|
47
|
+
import { a as Alignment, i as xmlCodec, n as encodePackage, o as AlignmentSchema, r as packageCodec, s as DocumentPackage, t as decodePackage } from "./codec-C3i7QbVt.cjs";
|
|
48
48
|
export { type Alignment, AlignmentSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type BuildManifestOptions, type CascadeDiagnostic, type DocumentPackage, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { a as measureOdfNodeLength, n as decodeOdfText, o as sumOdfNodeLength, r
|
|
|
26
26
|
import { a as resolveStyle, i as findStyleElement, n as StyleCascadeResult, o as resolveStyleElementChain, r as StyleElementChainResult, t as CascadeDiagnostic } from "./cascade-BZ7zqXhL.js";
|
|
27
27
|
import { n as readOdfMetadata, t as META_PART } from "./metadata-BXpjrAS-.js";
|
|
28
28
|
import { a as resolveOdfListKind, i as readOdfListParagraphs, n as OdfListParagraphReader, r as mintOdfListNumId, t as OdfListIdState } from "./list-Qeuawtew.js";
|
|
29
|
-
import { r as readOdfParagraph } from "./paragraph-
|
|
29
|
+
import { r as readOdfParagraph } from "./paragraph-hzoy-Wos.js";
|
|
30
30
|
import { r as readOdfTable } from "./table-ByOoGcq_.js";
|
|
31
31
|
import { a as composeOdfGroupTransform, c as resolveOdfShapeGeometry, i as applyOdfTransform, n as OdfShapeGeometry, o as netRotationDeg, r as OdfTransformFunction, s as parseOdfTransform, t as OdfPoint } from "./transform-C7GrZZdR.js";
|
|
32
32
|
import { n as resolveDrawPageSize, r as resolvePageLayoutProperties } from "./masterpage-By_F05W4.js";
|
|
@@ -44,5 +44,5 @@ import { n as subDocumentPackage, t as SubDocumentPackageOptions } from "./subdo
|
|
|
44
44
|
import { i as readOdfFormDefinitions, n as OdbFormDefinition, r as readOdfFormControlConstructs, t as OdbFormControl } from "./forms-CyLw7lpE.js";
|
|
45
45
|
import { n as readOdbForm, t as OdbForm } from "./form-RJTtSmwn.js";
|
|
46
46
|
import { a as OdbReportGroup, i as OdbReportFunction, n as OdbReportBand, o as readOdbReport, r as OdbReportElement, t as OdbReport } from "./report-DbslT2OR.js";
|
|
47
|
-
import { a as Alignment, i as xmlCodec, n as encodePackage, o as AlignmentSchema, r as packageCodec, s as DocumentPackage, t as decodePackage } from "./codec-
|
|
47
|
+
import { a as Alignment, i as xmlCodec, n as encodePackage, o as AlignmentSchema, r as packageCodec, s as DocumentPackage, t as decodePackage } from "./codec-CbPSWzQ2.js";
|
|
48
48
|
export { type Alignment, AlignmentSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type BuildManifestOptions, type CascadeDiagnostic, type DocumentPackage, 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 };
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ import { readOdfFormula, readOdfFormulaContent, readOdfFormulaMathMl } from "./t
|
|
|
37
37
|
import { subDocumentPackage } from "./typed/odb/subdocument.js";
|
|
38
38
|
import { readOdg, readOdgContent } from "./typed/odg/read.js";
|
|
39
39
|
import { readOdp, readOdpContent } from "./typed/odp/read.js";
|
|
40
|
-
import { a as readOdtContent, i as readOdt, o as readOds, s as readOdsContent, t as readDrawObjectReference } from "./embedded-
|
|
40
|
+
import { a as readOdtContent, i as readOdt, o as readOds, s as readOdsContent, t as readDrawObjectReference } from "./embedded-D2MXjcFm.js";
|
|
41
41
|
import { readOdfFormControlConstructs, readOdfFormDefinitions } from "./typed/shared/forms.js";
|
|
42
42
|
import { readOdm } from "./typed/odm/read.js";
|
|
43
43
|
import { readOdbInventory, resolveOdbComponent } from "./typed/odb/read.js";
|
|
@@ -13,5 +13,6 @@ interface OdfParagraphContext {
|
|
|
13
13
|
}
|
|
14
14
|
declare function readOdfConstructBodyBlocks(body: XmlElement, pkg: Package, context: OdfParagraphContext, listIdState: OdfListIdState): ContentBlock[];
|
|
15
15
|
declare function readOdfParagraph(pElement: XmlElement, pkg: Package, context?: OdfParagraphContext): ContentParagraph;
|
|
16
|
+
declare function readParagraphOrHeading(element: XmlElement, paragraph: ContentParagraph): ContentParagraph;
|
|
16
17
|
//#endregion
|
|
17
|
-
export { readOdfConstructBodyBlocks as n, readOdfParagraph as r, OdfParagraphContext as t };
|
|
18
|
+
export { readParagraphOrHeading as i, readOdfConstructBodyBlocks as n, readOdfParagraph as r, OdfParagraphContext as t };
|
|
@@ -13,5 +13,6 @@ interface OdfParagraphContext {
|
|
|
13
13
|
}
|
|
14
14
|
declare function readOdfConstructBodyBlocks(body: XmlElement, pkg: Package, context: OdfParagraphContext, listIdState: OdfListIdState): ContentBlock[];
|
|
15
15
|
declare function readOdfParagraph(pElement: XmlElement, pkg: Package, context?: OdfParagraphContext): ContentParagraph;
|
|
16
|
+
declare function readParagraphOrHeading(element: XmlElement, paragraph: ContentParagraph): ContentParagraph;
|
|
16
17
|
//#endregion
|
|
17
|
-
export { readOdfConstructBodyBlocks as n, readOdfParagraph as r, OdfParagraphContext as t };
|
|
18
|
+
export { readParagraphOrHeading as i, readOdfConstructBodyBlocks as n, readOdfParagraph as r, OdfParagraphContext as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_embedded = require("../../embedded-
|
|
2
|
+
const require_embedded = require("../../embedded-CBTvjVKb.cjs");
|
|
3
3
|
exports.readDrawObjectReference = require_embedded.readDrawObjectReference;
|
|
4
4
|
exports.readEmbeddedObjectDocument = require_embedded.readEmbeddedObjectDocument;
|
|
5
5
|
exports.readOdfChartContent = require_embedded.readOdfChartContent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as readEmbeddedObjectDocument, r as readOdfChartContent, t as readDrawObjectReference } from "../../embedded-
|
|
1
|
+
import { n as readEmbeddedObjectDocument, r as readOdfChartContent, t as readDrawObjectReference } from "../../embedded-D2MXjcFm.js";
|
|
2
2
|
export { readDrawObjectReference, readEmbeddedObjectDocument, readOdfChartContent };
|
package/dist/typed/odb/form.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_xml_query = require("../../xml/query.cjs");
|
|
3
3
|
const require_typed_odb_subdocument = require("./subdocument.cjs");
|
|
4
|
-
const require_embedded = require("../../embedded-
|
|
4
|
+
const require_embedded = require("../../embedded-CBTvjVKb.cjs");
|
|
5
5
|
const require_typed_shared_forms = require("../shared/forms.cjs");
|
|
6
6
|
const require_typed_odb_read = require("./read.cjs");
|
|
7
7
|
//#region src/typed/odb/form.ts
|
package/dist/typed/odb/form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findChildElement, rootElement } from "../../xml/query.js";
|
|
2
2
|
import { subDocumentPackage } from "./subdocument.js";
|
|
3
|
-
import { a as readOdtContent } from "../../embedded-
|
|
3
|
+
import { a as readOdtContent } from "../../embedded-D2MXjcFm.js";
|
|
4
4
|
import { readOdfFormDefinitions } from "../shared/forms.js";
|
|
5
5
|
import { resolveOdbComponent } from "./read.js";
|
|
6
6
|
//#region src/typed/odb/form.ts
|
package/dist/typed/ods/read.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_embedded = require("../../embedded-
|
|
2
|
+
const require_embedded = require("../../embedded-CBTvjVKb.cjs");
|
|
3
3
|
exports.readOds = require_embedded.readOds;
|
|
4
4
|
exports.readOdsContent = require_embedded.readOdsContent;
|
package/dist/typed/ods/read.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { o as readOds, s as readOdsContent } from "../../embedded-
|
|
1
|
+
import { o as readOds, s as readOdsContent } from "../../embedded-D2MXjcFm.js";
|
|
2
2
|
export { readOds, readOdsContent };
|
package/dist/typed/odt/read.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_embedded = require("../../embedded-
|
|
2
|
+
const require_embedded = require("../../embedded-CBTvjVKb.cjs");
|
|
3
3
|
exports.readOdt = require_embedded.readOdt;
|
|
4
4
|
exports.readOdtContent = require_embedded.readOdtContent;
|
package/dist/typed/odt/read.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readOdtContent, i as readOdt } from "../../embedded-
|
|
1
|
+
import { a as readOdtContent, i as readOdt } from "../../embedded-D2MXjcFm.js";
|
|
2
2
|
export { readOdt, readOdtContent };
|
|
@@ -263,6 +263,21 @@ function readOdfParagraph(pElement, pkg, context = {}) {
|
|
|
263
263
|
pageBreakAfter: paragraphProperties.pageBreakAfter
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
+
function readOutlineLevel(headingElement) {
|
|
267
|
+
const raw = require_xml_query.attrValue(headingElement, "text:outline-level");
|
|
268
|
+
if (raw === void 0) return 1;
|
|
269
|
+
const parsed = Number.parseInt(raw, 10);
|
|
270
|
+
return Number.isInteger(parsed) && parsed > 0 ? parsed : 1;
|
|
271
|
+
}
|
|
272
|
+
function readParagraphOrHeading(element, paragraph) {
|
|
273
|
+
if (element.tag === "text:h") {
|
|
274
|
+
const outlineLevel = readOutlineLevel(element);
|
|
275
|
+
paragraph.styleId = `Heading${outlineLevel}`;
|
|
276
|
+
paragraph.headingLevel = outlineLevel;
|
|
277
|
+
}
|
|
278
|
+
return paragraph;
|
|
279
|
+
}
|
|
266
280
|
//#endregion
|
|
267
281
|
exports.readOdfConstructBodyBlocks = readOdfConstructBodyBlocks;
|
|
268
282
|
exports.readOdfParagraph = readOdfParagraph;
|
|
283
|
+
exports.readParagraphOrHeading = readParagraphOrHeading;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as readOdfConstructBodyBlocks, r as readOdfParagraph, t as OdfParagraphContext } from "../../paragraph-
|
|
2
|
-
export { OdfParagraphContext, readOdfConstructBodyBlocks, readOdfParagraph };
|
|
1
|
+
import { i as readParagraphOrHeading, n as readOdfConstructBodyBlocks, r as readOdfParagraph, t as OdfParagraphContext } from "../../paragraph-DaMqmhe3.cjs";
|
|
2
|
+
export { OdfParagraphContext, readOdfConstructBodyBlocks, readOdfParagraph, readParagraphOrHeading };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as readOdfConstructBodyBlocks, r as readOdfParagraph, t as OdfParagraphContext } from "../../paragraph-
|
|
2
|
-
export { OdfParagraphContext, readOdfConstructBodyBlocks, readOdfParagraph };
|
|
1
|
+
import { i as readParagraphOrHeading, n as readOdfConstructBodyBlocks, r as readOdfParagraph, t as OdfParagraphContext } from "../../paragraph-hzoy-Wos.js";
|
|
2
|
+
export { OdfParagraphContext, readOdfConstructBodyBlocks, readOdfParagraph, readParagraphOrHeading };
|
|
@@ -262,5 +262,19 @@ function readOdfParagraph(pElement, pkg, context = {}) {
|
|
|
262
262
|
pageBreakAfter: paragraphProperties.pageBreakAfter
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
+
function readOutlineLevel(headingElement) {
|
|
266
|
+
const raw = attrValue(headingElement, "text:outline-level");
|
|
267
|
+
if (raw === void 0) return 1;
|
|
268
|
+
const parsed = Number.parseInt(raw, 10);
|
|
269
|
+
return Number.isInteger(parsed) && parsed > 0 ? parsed : 1;
|
|
270
|
+
}
|
|
271
|
+
function readParagraphOrHeading(element, paragraph) {
|
|
272
|
+
if (element.tag === "text:h") {
|
|
273
|
+
const outlineLevel = readOutlineLevel(element);
|
|
274
|
+
paragraph.styleId = `Heading${outlineLevel}`;
|
|
275
|
+
paragraph.headingLevel = outlineLevel;
|
|
276
|
+
}
|
|
277
|
+
return paragraph;
|
|
278
|
+
}
|
|
265
279
|
//#endregion
|
|
266
|
-
export { readOdfConstructBodyBlocks, readOdfParagraph };
|
|
280
|
+
export { readOdfConstructBodyBlocks, readOdfParagraph, readParagraphOrHeading };
|
|
@@ -115,7 +115,12 @@ function readCellStyleDecoration(elements) {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
function readTableCell(cellElement, pkg) {
|
|
118
|
-
const blocks =
|
|
118
|
+
const blocks = [];
|
|
119
|
+
for (const child of cellElement.children) {
|
|
120
|
+
if (child.type !== "element") continue;
|
|
121
|
+
if (child.tag === "text:p") blocks.push(require_typed_shared_paragraph.readOdfParagraph(child, pkg));
|
|
122
|
+
else if (child.tag === "text:h") blocks.push(require_typed_shared_paragraph.readParagraphOrHeading(child, require_typed_shared_paragraph.readOdfParagraph(child, pkg)));
|
|
123
|
+
}
|
|
119
124
|
const colSpanRaw = require_xml_query.attrValue(cellElement, "table:number-columns-spanned");
|
|
120
125
|
const rowSpanRaw = require_xml_query.attrValue(cellElement, "table:number-rows-spanned");
|
|
121
126
|
const styleName = require_xml_query.attrValue(cellElement, "table:style-name");
|
|
@@ -2,7 +2,7 @@ import { parseOdfLength } from "./units.js";
|
|
|
2
2
|
import { parseOdfColor } from "./color.js";
|
|
3
3
|
import { attrValue, childrenWithTag } from "../../xml/query.js";
|
|
4
4
|
import { findStyleElement } from "./cascade.js";
|
|
5
|
-
import { readOdfParagraph } from "./paragraph.js";
|
|
5
|
+
import { readOdfParagraph, readParagraphOrHeading } from "./paragraph.js";
|
|
6
6
|
//#region src/typed/shared/table.ts
|
|
7
7
|
function readRepeatCount(element, attrName) {
|
|
8
8
|
const raw = attrValue(element, attrName);
|
|
@@ -114,7 +114,12 @@ function readCellStyleDecoration(elements) {
|
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
function readTableCell(cellElement, pkg) {
|
|
117
|
-
const blocks =
|
|
117
|
+
const blocks = [];
|
|
118
|
+
for (const child of cellElement.children) {
|
|
119
|
+
if (child.type !== "element") continue;
|
|
120
|
+
if (child.tag === "text:p") blocks.push(readOdfParagraph(child, pkg));
|
|
121
|
+
else if (child.tag === "text:h") blocks.push(readParagraphOrHeading(child, readOdfParagraph(child, pkg)));
|
|
122
|
+
}
|
|
118
123
|
const colSpanRaw = attrValue(cellElement, "table:number-columns-spanned");
|
|
119
124
|
const rowSpanRaw = attrValue(cellElement, "table:number-rows-spanned");
|
|
120
125
|
const styleName = attrValue(cellElement, "table:style-name");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "odf.js",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "Type-safe, lossless round-trip conversion between OpenDocument Format packages (odt, ods, odp) and JSON, hand-written and dependency-minimal, built on Zod 4 codecs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|