odf.js 5.1.2 → 5.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 +2 -2
- package/dist/{codec-BxxFEqvT.d.ts → codec-BQB05qN1.d.ts} +1 -1
- package/dist/{codec-BAz7YIru.d.cts → codec-BoPvy83Y.d.cts} +1 -1
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/embedded-BBJoUl86.js +777 -0
- package/dist/{embedded-BPhuSEEI.d.ts → embedded-CLuwn306.d.ts} +6 -1
- package/dist/embedded-FMIPM1fw.cjs +818 -0
- package/dist/{embedded-J3M3kDvY.d.cts → embedded-ztNK8w6V.d.cts} +6 -1
- package/dist/index.cjs +7 -9
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -4
- package/dist/typed/draw/embedded.cjs +4 -85
- package/dist/typed/draw/embedded.d.cts +2 -2
- package/dist/typed/draw/embedded.d.ts +2 -2
- package/dist/typed/draw/embedded.js +2 -84
- package/dist/typed/odb/form.cjs +2 -2
- package/dist/typed/odb/form.js +1 -1
- package/dist/typed/ods/read.cjs +3 -446
- package/dist/typed/ods/read.js +1 -444
- package/dist/typed/odt/read.cjs +3 -310
- package/dist/typed/odt/read.js +1 -308
- package/package.json +1 -1
|
@@ -13,6 +13,11 @@ declare function readOdfChartContent(chartPackage: Package, frame: Box, format:
|
|
|
13
13
|
document: ContentDocument;
|
|
14
14
|
residue: SourceResidue | undefined;
|
|
15
15
|
};
|
|
16
|
+
interface EmbeddedDocumentRead {
|
|
17
|
+
readonly document: ContentDocument;
|
|
18
|
+
readonly residue: SourceResidue | undefined;
|
|
19
|
+
}
|
|
20
|
+
declare function readEmbeddedObjectDocument(reference: EmbeddedDrawObject, frame: Box, format: OdfResidueFormat): EmbeddedDocumentRead;
|
|
16
21
|
declare function readDrawObjectReference(frame: XmlElement, pkg: Package): EmbeddedDrawObject | undefined;
|
|
17
22
|
//#endregion
|
|
18
|
-
export {
|
|
23
|
+
export { readEmbeddedObjectDocument as a, readDrawObjectReference as i, EmbeddedDocumentRead as n, readOdfChartContent as o, EmbeddedDrawObject as r, EmbeddedDocumentKind as t };
|
package/dist/index.cjs
CHANGED
|
@@ -36,12 +36,10 @@ const require_typed_shared_path = require("./typed/shared/path.cjs");
|
|
|
36
36
|
const require_typed_draw_shapes = require("./typed/draw/shapes.cjs");
|
|
37
37
|
const require_typed_formula_read = require("./typed/formula/read.cjs");
|
|
38
38
|
const require_typed_odb_subdocument = require("./typed/odb/subdocument.cjs");
|
|
39
|
-
const
|
|
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-FMIPM1fw.cjs");
|
|
41
42
|
const require_typed_shared_forms = require("./typed/shared/forms.cjs");
|
|
42
|
-
const require_typed_odg_read = require("./typed/odg/read.cjs");
|
|
43
|
-
const require_typed_odt_read = require("./typed/odt/read.cjs");
|
|
44
|
-
const require_typed_ods_read = require("./typed/ods/read.cjs");
|
|
45
43
|
const require_typed_odm_read = require("./typed/odm/read.cjs");
|
|
46
44
|
const require_typed_odb_read = require("./typed/odb/read.cjs");
|
|
47
45
|
const require_typed_odb_form = require("./typed/odb/form.cjs");
|
|
@@ -134,7 +132,7 @@ exports.parseXml = require_xml_parse.parseXml;
|
|
|
134
132
|
exports.rawSubpathFromPoints = require_typed_shared_path.rawSubpathFromPoints;
|
|
135
133
|
exports.readDrawFrame = require_typed_draw_shapes.readDrawFrame;
|
|
136
134
|
exports.readDrawImageBlock = require_typed_draw_shapes.readDrawImageBlock;
|
|
137
|
-
exports.readDrawObjectReference =
|
|
135
|
+
exports.readDrawObjectReference = require_embedded.readDrawObjectReference;
|
|
138
136
|
exports.readDrawPageContent = require_typed_draw_shapes.readDrawPageContent;
|
|
139
137
|
exports.readManifest = require_manifest.readManifest;
|
|
140
138
|
exports.readMimetype = require_mimetype.readMimetype;
|
|
@@ -155,10 +153,10 @@ exports.readOdgContent = require_typed_odg_read.readOdgContent;
|
|
|
155
153
|
exports.readOdm = require_typed_odm_read.readOdm;
|
|
156
154
|
exports.readOdp = require_typed_odp_read.readOdp;
|
|
157
155
|
exports.readOdpContent = require_typed_odp_read.readOdpContent;
|
|
158
|
-
exports.readOds =
|
|
159
|
-
exports.readOdsContent =
|
|
160
|
-
exports.readOdt =
|
|
161
|
-
exports.readOdtContent =
|
|
156
|
+
exports.readOds = require_embedded.readOds;
|
|
157
|
+
exports.readOdsContent = require_embedded.readOdsContent;
|
|
158
|
+
exports.readOdt = require_embedded.readOdt;
|
|
159
|
+
exports.readOdtContent = require_embedded.readOdtContent;
|
|
162
160
|
exports.resolveDrawPageSize = require_typed_shared_masterpage.resolveDrawPageSize;
|
|
163
161
|
exports.resolveOdbComponent = require_typed_odb_read.resolveOdbComponent;
|
|
164
162
|
exports.resolveOdfListKind = require_typed_shared_list.resolveOdfListKind;
|
package/dist/index.d.cts
CHANGED
|
@@ -32,7 +32,7 @@ import { a as composeOdfGroupTransform, c as resolveOdfShapeGeometry, i as apply
|
|
|
32
32
|
import { n as resolvePageLayoutProperties, t as resolveDrawPageSize } from "./masterpage-XJ2v2khe.cjs";
|
|
33
33
|
import { a as buildOdfSubpaths, c as parseOdfViewBox, i as OdfViewBox, l as rawSubpathFromPoints, n as OdfRawSegment, o as parseOdfPathData, r as OdfRawSubpath, s as parseOdfPointsList, t as OdfRawPoint, u as scaleOdfRawPoint } from "./path-DE7wkIcz.cjs";
|
|
34
34
|
import { a as walkDrawShapes, i as readDrawPageContent, n as readDrawFrame, r as readDrawImageBlock, t as DrawPageContent } from "./shapes-8o3NjBLU.cjs";
|
|
35
|
-
import {
|
|
35
|
+
import { i as readDrawObjectReference, r as EmbeddedDrawObject, t as EmbeddedDocumentKind } from "./embedded-ztNK8w6V.cjs";
|
|
36
36
|
import { n as readOdp, r as readOdpContent, t as OdpDocument } from "./read-CTfeWaWq.cjs";
|
|
37
37
|
import { i as readOdtContent, n as OdtReadOptions, r as readOdt, t as OdtDocument } from "./read-Cs1ktkWB.cjs";
|
|
38
38
|
import { n as readOdg, r as readOdgContent, t as OdgDocument } from "./read-DOYWO6BM.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-cIjw-Jf-.cjs";
|
|
45
45
|
import { n as readOdbForm, t as OdbForm } from "./form-BGCT81ss.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-BoPvy83Y.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 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
|
@@ -32,7 +32,7 @@ import { a as composeOdfGroupTransform, c as resolveOdfShapeGeometry, i as apply
|
|
|
32
32
|
import { n as resolvePageLayoutProperties, t as resolveDrawPageSize } from "./masterpage-C1McDhMv.js";
|
|
33
33
|
import { a as buildOdfSubpaths, c as parseOdfViewBox, i as OdfViewBox, l as rawSubpathFromPoints, n as OdfRawSegment, o as parseOdfPathData, r as OdfRawSubpath, s as parseOdfPointsList, t as OdfRawPoint, u as scaleOdfRawPoint } from "./path-DE7wkIcz.js";
|
|
34
34
|
import { a as walkDrawShapes, i as readDrawPageContent, n as readDrawFrame, r as readDrawImageBlock, t as DrawPageContent } from "./shapes-CCB8ydqD.js";
|
|
35
|
-
import {
|
|
35
|
+
import { i as readDrawObjectReference, r as EmbeddedDrawObject, t as EmbeddedDocumentKind } from "./embedded-CLuwn306.js";
|
|
36
36
|
import { n as readOdp, r as readOdpContent, t as OdpDocument } from "./read-Db_GZ0ZH.js";
|
|
37
37
|
import { i as readOdtContent, n as OdtReadOptions, r as readOdt, t as OdtDocument } from "./read-DHuiGh_y.js";
|
|
38
38
|
import { n as readOdg, r as readOdgContent, t as OdgDocument } from "./read-lc0t0UHK.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-D1-0spCe.js";
|
|
45
45
|
import { n as readOdbForm, t as OdbForm } from "./form-D3H5H2NL.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-BQB05qN1.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 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
|
@@ -35,12 +35,10 @@ import { buildOdfSubpaths, parseOdfPathData, parseOdfPointsList, parseOdfViewBox
|
|
|
35
35
|
import { readDrawFrame, readDrawImageBlock, readDrawPageContent, walkDrawShapes } from "./typed/draw/shapes.js";
|
|
36
36
|
import { readOdfFormula, readOdfFormulaContent, readOdfFormulaMathMl } from "./typed/formula/read.js";
|
|
37
37
|
import { subDocumentPackage } from "./typed/odb/subdocument.js";
|
|
38
|
-
import {
|
|
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-BBJoUl86.js";
|
|
40
41
|
import { readOdfFormControlConstructs, readOdfFormDefinitions } from "./typed/shared/forms.js";
|
|
41
|
-
import { readOdg, readOdgContent } from "./typed/odg/read.js";
|
|
42
|
-
import { readOdt, readOdtContent } from "./typed/odt/read.js";
|
|
43
|
-
import { readOds, readOdsContent } from "./typed/ods/read.js";
|
|
44
42
|
import { readOdm } from "./typed/odm/read.js";
|
|
45
43
|
import { readOdbInventory, resolveOdbComponent } from "./typed/odb/read.js";
|
|
46
44
|
import { readOdbForm } from "./typed/odb/form.js";
|
|
@@ -1,86 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const require_typed_odb_subdocument = require("../odb/subdocument.cjs");
|
|
7
|
-
//#region src/typed/draw/embedded.ts
|
|
8
|
-
const CONTENT_PART = "content.xml";
|
|
9
|
-
function embeddedKindFor(bodyChildTag) {
|
|
10
|
-
switch (bodyChildTag) {
|
|
11
|
-
case "office:text": return "wordprocessing";
|
|
12
|
-
case "office:spreadsheet": return "spreadsheet";
|
|
13
|
-
case "office:presentation": return "presentation";
|
|
14
|
-
case "office:drawing": return "drawing";
|
|
15
|
-
case "office:chart": return "chart";
|
|
16
|
-
default: return;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function readOdfChartContent(chartPackage, frame, format) {
|
|
20
|
-
const contentPart = chartPackage.parts[CONTENT_PART];
|
|
21
|
-
const contentRoot = contentPart?.kind === "xml" ? require_xml_query.rootElement(contentPart.nodes) : void 0;
|
|
22
|
-
const chartElement = contentRoot === void 0 ? void 0 : require_xml_query.elementsWithTag(contentRoot.children, "chart:chart")[0];
|
|
23
|
-
const localTable = chartElement === void 0 ? void 0 : require_xml_query.elementsWithTag(chartElement.children, "table:table")[0];
|
|
24
|
-
const blocks = localTable === void 0 ? [] : [require_typed_shared_table.readOdfTable(localTable, chartPackage)];
|
|
25
|
-
return {
|
|
26
|
-
document: {
|
|
27
|
-
kind: "drawing",
|
|
28
|
-
metadata: {},
|
|
29
|
-
pages: [{
|
|
30
|
-
size: {
|
|
31
|
-
widthPt: frame.widthPt,
|
|
32
|
-
heightPt: frame.heightPt
|
|
33
|
-
},
|
|
34
|
-
shapes: [{
|
|
35
|
-
frame: {
|
|
36
|
-
xPt: 0,
|
|
37
|
-
yPt: 0,
|
|
38
|
-
widthPt: frame.widthPt,
|
|
39
|
-
heightPt: frame.heightPt
|
|
40
|
-
},
|
|
41
|
-
insetLeftPt: 0,
|
|
42
|
-
insetTopPt: 0,
|
|
43
|
-
insetRightPt: 0,
|
|
44
|
-
insetBottomPt: 0,
|
|
45
|
-
blocks
|
|
46
|
-
}],
|
|
47
|
-
vectors: []
|
|
48
|
-
}]
|
|
49
|
-
},
|
|
50
|
-
residue: chartElement === void 0 ? void 0 : require_typed_shared_constructs.odfResidue(format, chartElement)
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function subDocumentKind(nodes) {
|
|
54
|
-
const root = require_xml_query.rootElement(nodes);
|
|
55
|
-
const body = root === void 0 ? void 0 : require_xml_query.findChildElement(root.children, "office:body");
|
|
56
|
-
const bodyChild = body === void 0 ? void 0 : require_xml_query.rootElement(body.children);
|
|
57
|
-
const bodyKind = bodyChild === void 0 ? void 0 : embeddedKindFor(bodyChild.tag);
|
|
58
|
-
if (bodyKind !== void 0) return bodyKind;
|
|
59
|
-
return require_typed_formula_read.findMathRoot(nodes) === void 0 ? void 0 : "formula";
|
|
60
|
-
}
|
|
61
|
-
function normaliseObjectHref(raw) {
|
|
62
|
-
const withoutPrefix = raw.startsWith("./") ? raw.slice(2) : raw;
|
|
63
|
-
const trimmed = withoutPrefix.endsWith("/") ? withoutPrefix.slice(0, -1) : withoutPrefix;
|
|
64
|
-
if (trimmed.length === 0 || trimmed.startsWith("..") || trimmed.startsWith("/") || trimmed.includes("://")) return;
|
|
65
|
-
return trimmed;
|
|
66
|
-
}
|
|
67
|
-
function readDrawObjectReference(frame, pkg) {
|
|
68
|
-
const object = require_xml_query.childrenWithTag(frame, "draw:object")[0];
|
|
69
|
-
if (object === void 0) return;
|
|
70
|
-
const rawHref = require_xml_query.attrValue(object, "xlink:href");
|
|
71
|
-
const href = rawHref === void 0 ? void 0 : normaliseObjectHref(rawHref);
|
|
72
|
-
if (href === void 0) return;
|
|
73
|
-
const subPackage = require_typed_odb_subdocument.subDocumentPackage(pkg, href, { allowMissingContent: true });
|
|
74
|
-
const contentPart = subPackage.parts[CONTENT_PART];
|
|
75
|
-
if (contentPart?.kind !== "xml") return;
|
|
76
|
-
const objectKind = subDocumentKind(contentPart.nodes);
|
|
77
|
-
if (objectKind === void 0) return;
|
|
78
|
-
return {
|
|
79
|
-
objectKind,
|
|
80
|
-
package: subPackage,
|
|
81
|
-
href
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
exports.readDrawObjectReference = readDrawObjectReference;
|
|
86
|
-
exports.readOdfChartContent = readOdfChartContent;
|
|
2
|
+
const require_embedded = require("../../embedded-FMIPM1fw.cjs");
|
|
3
|
+
exports.readDrawObjectReference = require_embedded.readDrawObjectReference;
|
|
4
|
+
exports.readEmbeddedObjectDocument = require_embedded.readEmbeddedObjectDocument;
|
|
5
|
+
exports.readOdfChartContent = require_embedded.readOdfChartContent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
export { EmbeddedDocumentKind, EmbeddedDrawObject, readDrawObjectReference, readOdfChartContent };
|
|
1
|
+
import { a as readEmbeddedObjectDocument, i as readDrawObjectReference, n as EmbeddedDocumentRead, o as readOdfChartContent, r as EmbeddedDrawObject, t as EmbeddedDocumentKind } from "../../embedded-ztNK8w6V.cjs";
|
|
2
|
+
export { EmbeddedDocumentKind, EmbeddedDocumentRead, EmbeddedDrawObject, readDrawObjectReference, readEmbeddedObjectDocument, readOdfChartContent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
export { EmbeddedDocumentKind, EmbeddedDrawObject, readDrawObjectReference, readOdfChartContent };
|
|
1
|
+
import { a as readEmbeddedObjectDocument, i as readDrawObjectReference, n as EmbeddedDocumentRead, o as readOdfChartContent, r as EmbeddedDrawObject, t as EmbeddedDocumentKind } from "../../embedded-CLuwn306.js";
|
|
2
|
+
export { EmbeddedDocumentKind, EmbeddedDocumentRead, EmbeddedDrawObject, readDrawObjectReference, readEmbeddedObjectDocument, readOdfChartContent };
|
|
@@ -1,84 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { readOdfTable } from "../shared/table.js";
|
|
4
|
-
import { findMathRoot } from "../formula/read.js";
|
|
5
|
-
import { subDocumentPackage } from "../odb/subdocument.js";
|
|
6
|
-
//#region src/typed/draw/embedded.ts
|
|
7
|
-
const CONTENT_PART = "content.xml";
|
|
8
|
-
function embeddedKindFor(bodyChildTag) {
|
|
9
|
-
switch (bodyChildTag) {
|
|
10
|
-
case "office:text": return "wordprocessing";
|
|
11
|
-
case "office:spreadsheet": return "spreadsheet";
|
|
12
|
-
case "office:presentation": return "presentation";
|
|
13
|
-
case "office:drawing": return "drawing";
|
|
14
|
-
case "office:chart": return "chart";
|
|
15
|
-
default: return;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function readOdfChartContent(chartPackage, frame, format) {
|
|
19
|
-
const contentPart = chartPackage.parts[CONTENT_PART];
|
|
20
|
-
const contentRoot = contentPart?.kind === "xml" ? rootElement(contentPart.nodes) : void 0;
|
|
21
|
-
const chartElement = contentRoot === void 0 ? void 0 : elementsWithTag(contentRoot.children, "chart:chart")[0];
|
|
22
|
-
const localTable = chartElement === void 0 ? void 0 : elementsWithTag(chartElement.children, "table:table")[0];
|
|
23
|
-
const blocks = localTable === void 0 ? [] : [readOdfTable(localTable, chartPackage)];
|
|
24
|
-
return {
|
|
25
|
-
document: {
|
|
26
|
-
kind: "drawing",
|
|
27
|
-
metadata: {},
|
|
28
|
-
pages: [{
|
|
29
|
-
size: {
|
|
30
|
-
widthPt: frame.widthPt,
|
|
31
|
-
heightPt: frame.heightPt
|
|
32
|
-
},
|
|
33
|
-
shapes: [{
|
|
34
|
-
frame: {
|
|
35
|
-
xPt: 0,
|
|
36
|
-
yPt: 0,
|
|
37
|
-
widthPt: frame.widthPt,
|
|
38
|
-
heightPt: frame.heightPt
|
|
39
|
-
},
|
|
40
|
-
insetLeftPt: 0,
|
|
41
|
-
insetTopPt: 0,
|
|
42
|
-
insetRightPt: 0,
|
|
43
|
-
insetBottomPt: 0,
|
|
44
|
-
blocks
|
|
45
|
-
}],
|
|
46
|
-
vectors: []
|
|
47
|
-
}]
|
|
48
|
-
},
|
|
49
|
-
residue: chartElement === void 0 ? void 0 : odfResidue(format, chartElement)
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function subDocumentKind(nodes) {
|
|
53
|
-
const root = rootElement(nodes);
|
|
54
|
-
const body = root === void 0 ? void 0 : findChildElement(root.children, "office:body");
|
|
55
|
-
const bodyChild = body === void 0 ? void 0 : rootElement(body.children);
|
|
56
|
-
const bodyKind = bodyChild === void 0 ? void 0 : embeddedKindFor(bodyChild.tag);
|
|
57
|
-
if (bodyKind !== void 0) return bodyKind;
|
|
58
|
-
return findMathRoot(nodes) === void 0 ? void 0 : "formula";
|
|
59
|
-
}
|
|
60
|
-
function normaliseObjectHref(raw) {
|
|
61
|
-
const withoutPrefix = raw.startsWith("./") ? raw.slice(2) : raw;
|
|
62
|
-
const trimmed = withoutPrefix.endsWith("/") ? withoutPrefix.slice(0, -1) : withoutPrefix;
|
|
63
|
-
if (trimmed.length === 0 || trimmed.startsWith("..") || trimmed.startsWith("/") || trimmed.includes("://")) return;
|
|
64
|
-
return trimmed;
|
|
65
|
-
}
|
|
66
|
-
function readDrawObjectReference(frame, pkg) {
|
|
67
|
-
const object = childrenWithTag(frame, "draw:object")[0];
|
|
68
|
-
if (object === void 0) return;
|
|
69
|
-
const rawHref = attrValue(object, "xlink:href");
|
|
70
|
-
const href = rawHref === void 0 ? void 0 : normaliseObjectHref(rawHref);
|
|
71
|
-
if (href === void 0) return;
|
|
72
|
-
const subPackage = subDocumentPackage(pkg, href, { allowMissingContent: true });
|
|
73
|
-
const contentPart = subPackage.parts[CONTENT_PART];
|
|
74
|
-
if (contentPart?.kind !== "xml") return;
|
|
75
|
-
const objectKind = subDocumentKind(contentPart.nodes);
|
|
76
|
-
if (objectKind === void 0) return;
|
|
77
|
-
return {
|
|
78
|
-
objectKind,
|
|
79
|
-
package: subPackage,
|
|
80
|
-
href
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
//#endregion
|
|
84
|
-
export { readDrawObjectReference, readOdfChartContent };
|
|
1
|
+
import { n as readEmbeddedObjectDocument, r as readOdfChartContent, t as readDrawObjectReference } from "../../embedded-BBJoUl86.js";
|
|
2
|
+
export { readDrawObjectReference, readEmbeddedObjectDocument, readOdfChartContent };
|
package/dist/typed/odb/form.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-FMIPM1fw.cjs");
|
|
4
5
|
const require_typed_shared_forms = require("../shared/forms.cjs");
|
|
5
|
-
const require_typed_odt_read = require("../odt/read.cjs");
|
|
6
6
|
const require_typed_odb_read = require("./read.cjs");
|
|
7
7
|
//#region src/typed/odb/form.ts
|
|
8
8
|
const CONTENT_PART = "content.xml";
|
|
@@ -20,7 +20,7 @@ function readOdbForm(pkg, formName) {
|
|
|
20
20
|
return {
|
|
21
21
|
name: component.name,
|
|
22
22
|
href: component.href,
|
|
23
|
-
document:
|
|
23
|
+
document: require_embedded.readOdtContent(subPackage),
|
|
24
24
|
forms: readFormDefinitions(require_xml_query.rootElement(contentPart.nodes))
|
|
25
25
|
};
|
|
26
26
|
}
|
package/dist/typed/odb/form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { findChildElement, rootElement } from "../../xml/query.js";
|
|
2
2
|
import { subDocumentPackage } from "./subdocument.js";
|
|
3
|
+
import { a as readOdtContent } from "../../embedded-BBJoUl86.js";
|
|
3
4
|
import { readOdfFormDefinitions } from "../shared/forms.js";
|
|
4
|
-
import { readOdtContent } from "../odt/read.js";
|
|
5
5
|
import { resolveOdbComponent } from "./read.js";
|
|
6
6
|
//#region src/typed/odb/form.ts
|
|
7
7
|
const CONTENT_PART = "content.xml";
|