odf.js 5.0.8 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/{cascade-qYa3mgnE.d.cts → cascade-BmvsXcAz.d.cts} +2 -2
- package/dist/{cascade-8u4q16_U.d.ts → cascade-rhqUQrUa.d.ts} +2 -2
- package/dist/{codec-jKlS0rWl.d.cts → codec-BAz7YIru.d.cts} +26 -25
- package/dist/{codec-DqldvlN5.d.ts → codec-BxxFEqvT.d.ts} +26 -25
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/constructs-CJpDDQV0.d.ts +63 -0
- package/dist/constructs-Dy_DMFs3.d.cts +63 -0
- package/dist/embedded-BPhuSEEI.d.ts +18 -0
- package/dist/embedded-J3M3kDvY.d.cts +18 -0
- package/dist/form-BGCT81ss.d.cts +13 -0
- package/dist/form-D3H5H2NL.d.ts +13 -0
- package/dist/forms-D1-0spCe.d.ts +27 -0
- package/dist/forms-cIjw-Jf-.d.cts +27 -0
- package/dist/index.cjs +5 -2
- package/dist/index.d.cts +28 -27
- package/dist/index.d.ts +28 -27
- package/dist/index.js +4 -3
- package/dist/{list-C35tiDYU.d.cts → list-KZeXA0mR.d.cts} +1 -1
- package/dist/{list-acGU0xLo.d.ts → list-Qeuawtew.d.ts} +1 -1
- package/dist/{manifest-xxJ4FpSe.d.ts → manifest-BALwu2JR.d.cts} +1 -1
- package/dist/{manifest-CmsCOCEi.d.cts → manifest-CP1sqyGU.d.ts} +1 -1
- package/dist/manifest.d.cts +1 -1
- package/dist/manifest.d.ts +1 -1
- package/dist/{masterpage-7nBnqFj-.d.ts → masterpage-C1McDhMv.d.ts} +1 -1
- package/dist/{masterpage-EmefIRgy.d.cts → masterpage-XJ2v2khe.d.cts} +1 -1
- package/dist/{metadata-32LoP2TK.d.ts → metadata-1j1zm9Cx.d.cts} +1 -1
- package/dist/{metadata-frJqeeSB.d.cts → metadata-BXpjrAS-.d.ts} +1 -1
- package/dist/{mimetype-uF-RHNpR.d.ts → mimetype-BfkwTeaW.d.ts} +1 -1
- package/dist/{mimetype-BcLX0N-N.d.cts → mimetype-CPNMj04s.d.cts} +1 -1
- package/dist/mimetype.d.cts +1 -1
- package/dist/mimetype.d.ts +1 -1
- package/dist/model/package.d.cts +1 -113
- package/dist/model/package.d.ts +1 -113
- package/dist/package-BUojjTXf.d.ts +114 -0
- package/dist/package-L24lkba-.d.cts +114 -0
- package/dist/package-io/read.d.cts +1 -1
- package/dist/package-io/read.d.ts +1 -1
- package/dist/package-io/write.d.cts +1 -1
- package/dist/package-io/write.d.ts +1 -1
- package/dist/paragraph-6hzAZpmi.d.ts +16 -0
- package/dist/paragraph-BBmSl_sK.d.cts +16 -0
- package/dist/read-B4238IGr.d.cts +12 -0
- package/dist/{read-DrdmKX0x.d.cts → read-BV2an1ok.d.cts} +1 -1
- package/dist/{read-DOuXgPhP.d.ts → read-BnN7u9Y2.d.ts} +1 -1
- package/dist/{read-DhLNXgiM.d.ts → read-CMDEXqGw.d.ts} +1 -1
- package/dist/{read-YSIwlhrk.d.ts → read-CTfeWaWq.d.cts} +1 -1
- package/dist/read-CdvX2qnz.d.ts +12 -0
- package/dist/read-Cs1ktkWB.d.cts +15 -0
- package/dist/{read-BoIUENWq.d.ts → read-CvjbdgH3.d.ts} +1 -1
- package/dist/read-DHuiGh_y.d.ts +15 -0
- package/dist/{read-BM8KaFQS.d.cts → read-DOYWO6BM.d.cts} +1 -1
- package/dist/{read-xCmo7cec.d.cts → read-DUCm1nUv.d.cts} +1 -1
- package/dist/{read-BkFbEves.d.ts → read-DYYxbvfo.d.ts} +1 -1
- package/dist/{read-KpU38maT.d.cts → read-Db_GZ0ZH.d.ts} +1 -1
- package/dist/{read-CFMsXSl7.d.cts → read-DzmMJPHd.d.cts} +1 -1
- package/dist/{read-B9zz_ax1.d.ts → read-lc0t0UHK.d.ts} +1 -1
- package/dist/{read-DNNf5_6n.d.cts → read-ydLJ8bid.d.cts} +1 -1
- package/dist/{registry-R43n1hcL.d.ts → registry-BVeEpUMI.d.ts} +1 -1
- package/dist/{registry-Dy6pjoh3.d.cts → registry-CaJpWDke.d.cts} +1 -1
- package/dist/{report-MpwUgXbA.d.ts → report-D6WNYaVn.d.cts} +1 -1
- package/dist/{report-BuCJ7_YU.d.cts → report-DbslT2OR.d.ts} +1 -1
- package/dist/{shapes-BqcccDK8.d.cts → shapes-8o3NjBLU.d.cts} +3 -3
- package/dist/{shapes-BB59aIC8.d.ts → shapes-CCB8ydqD.d.ts} +3 -3
- package/dist/styles/registry.d.cts +1 -1
- package/dist/styles/registry.d.ts +1 -1
- package/dist/{subdocument-CIxH3a5V.d.cts → subdocument-BwW3FZC_.d.ts} +1 -1
- package/dist/{subdocument-DQNQF7wV.d.ts → subdocument-yY8ASE4N.d.cts} +1 -1
- package/dist/{table-sweV3r9n.d.cts → table-BH_Q2n_N.d.cts} +1 -1
- package/dist/{table-D81TZyBn.d.ts → table-ByOoGcq_.d.ts} +1 -1
- package/dist/{text-Cal14ZaX.d.cts → text-BAi1tapc.d.cts} +3 -1
- package/dist/{text-CkNojpZm.d.ts → text-gJ5R0q3u.d.ts} +3 -1
- package/dist/typed/draw/embedded.cjs +38 -0
- package/dist/typed/draw/embedded.d.cts +2 -2
- package/dist/typed/draw/embedded.d.ts +2 -2
- package/dist/typed/draw/embedded.js +39 -2
- package/dist/typed/draw/shapes.cjs +20 -3
- package/dist/typed/draw/shapes.d.cts +1 -1
- package/dist/typed/draw/shapes.d.ts +1 -1
- package/dist/typed/draw/shapes.js +20 -3
- package/dist/typed/formula/read.d.cts +1 -1
- package/dist/typed/formula/read.d.ts +1 -1
- package/dist/typed/odb/form.cjs +2 -59
- package/dist/typed/odb/form.d.cts +2 -2
- package/dist/typed/odb/form.d.ts +2 -2
- package/dist/typed/odb/form.js +3 -60
- package/dist/typed/odb/read.d.cts +1 -1
- package/dist/typed/odb/read.d.ts +1 -1
- package/dist/typed/odb/report.d.cts +1 -1
- package/dist/typed/odb/report.d.ts +1 -1
- package/dist/typed/odb/subdocument.d.cts +1 -1
- package/dist/typed/odb/subdocument.d.ts +1 -1
- package/dist/typed/odg/read.d.cts +1 -1
- package/dist/typed/odg/read.d.ts +1 -1
- package/dist/typed/odm/read.d.cts +1 -1
- package/dist/typed/odm/read.d.ts +1 -1
- package/dist/typed/odp/read.d.cts +1 -1
- package/dist/typed/odp/read.d.ts +1 -1
- package/dist/typed/ods/read.cjs +28 -6
- package/dist/typed/ods/read.d.cts +1 -1
- package/dist/typed/ods/read.d.ts +1 -1
- package/dist/typed/ods/read.js +29 -7
- package/dist/typed/odt/read.cjs +215 -15
- package/dist/typed/odt/read.d.cts +2 -2
- package/dist/typed/odt/read.d.ts +2 -2
- package/dist/typed/odt/read.js +215 -15
- package/dist/typed/shared/cascade.d.cts +1 -1
- package/dist/typed/shared/cascade.d.ts +1 -1
- package/dist/typed/shared/constructs.cjs +392 -0
- package/dist/typed/shared/constructs.d.cts +2 -0
- package/dist/typed/shared/constructs.d.ts +2 -0
- package/dist/typed/shared/constructs.js +374 -0
- package/dist/typed/shared/forms.cjs +128 -0
- package/dist/typed/shared/forms.d.cts +2 -0
- package/dist/typed/shared/forms.d.ts +2 -0
- package/dist/typed/shared/forms.js +126 -0
- package/dist/typed/shared/list.d.cts +1 -1
- package/dist/typed/shared/list.d.ts +1 -1
- package/dist/typed/shared/masterpage.d.cts +1 -1
- package/dist/typed/shared/masterpage.d.ts +1 -1
- package/dist/typed/shared/metadata.d.cts +1 -1
- package/dist/typed/shared/metadata.d.ts +1 -1
- package/dist/typed/shared/paragraph.cjs +189 -10
- package/dist/typed/shared/paragraph.d.cts +2 -2
- package/dist/typed/shared/paragraph.d.ts +2 -2
- package/dist/typed/shared/paragraph.js +192 -13
- package/dist/typed/shared/table.d.cts +1 -1
- package/dist/typed/shared/table.d.ts +1 -1
- package/dist/typed/shared/text.cjs +57 -2
- package/dist/typed/shared/text.d.cts +2 -2
- package/dist/typed/shared/text.d.ts +2 -2
- package/dist/typed/shared/text.js +56 -3
- package/dist/{write-C0nwVuPI.d.ts → write-BxVkPZID.d.ts} +1 -1
- package/dist/{write-Dfb2tirK.d.cts → write-D3kyj1Xw.d.cts} +1 -1
- package/package.json +2 -2
- package/dist/embedded-CNMqOrnt.d.ts +0 -13
- package/dist/embedded-D7Kr1Sce.d.cts +0 -13
- package/dist/form-BsAAx5-p.d.ts +0 -31
- package/dist/form-DSIbHxog.d.cts +0 -31
- package/dist/paragraph-9ii2naJC.d.cts +0 -7
- package/dist/paragraph-DWNnedIE.d.ts +0 -7
- package/dist/read-B4zS8bGb.d.ts +0 -11
- package/dist/read-BHpPvhzR.d.cts +0 -11
- package/dist/read-C6MhadqG.d.ts +0 -11
- package/dist/read-CszvDMMt.d.cts +0 -11
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as walkDrawShapes, i as readDrawPageContent, n as readDrawFrame, r as readDrawImageBlock, t as DrawPageContent } from "../../shapes-
|
|
1
|
+
import { a as walkDrawShapes, i as readDrawPageContent, n as readDrawFrame, r as readDrawImageBlock, t as DrawPageContent } from "../../shapes-CCB8ydqD.js";
|
|
2
2
|
export { DrawPageContent, readDrawFrame, readDrawImageBlock, readDrawPageContent, walkDrawShapes };
|
|
@@ -6,8 +6,8 @@ import { attrValue, childrenWithTag, elementsWithTag } from "../../xml/query.js"
|
|
|
6
6
|
import { decodeOdfText } from "../shared/text.js";
|
|
7
7
|
import { parseLinePoints } from "../shared/geometry.js";
|
|
8
8
|
import { resolveStyleElementChain } from "../shared/cascade.js";
|
|
9
|
-
import { readOdfParagraph } from "../shared/paragraph.js";
|
|
10
9
|
import { mintOdfListNumId, readOdfListParagraphs } from "../shared/list.js";
|
|
10
|
+
import { readOdfParagraph } from "../shared/paragraph.js";
|
|
11
11
|
import { readOdfTable } from "../shared/table.js";
|
|
12
12
|
import { applyOdfTransform, composeOdfGroupTransform, parseOdfTransform, resolveOdfShapeGeometry } from "../shared/transform.js";
|
|
13
13
|
import { buildOdfSubpaths, parseOdfPathData, parseOdfPointsList, parseOdfViewBox, rawSubpathFromPoints } from "../shared/path.js";
|
|
@@ -90,8 +90,8 @@ function readDrawFrameContent(frame, frameBox, pkg, listIdState) {
|
|
|
90
90
|
}
|
|
91
91
|
return [];
|
|
92
92
|
}
|
|
93
|
-
function readDrawFrame(frame, groupFunctions, pkg, listIdState = { next: 1 }) {
|
|
94
|
-
const ownGeometry = resolveOdfShapeGeometry(frame);
|
|
93
|
+
function readDrawFrame(frame, groupFunctions, pkg, listIdState = { next: 1 }, flowPositioning = false) {
|
|
94
|
+
const ownGeometry = resolveOdfShapeGeometry(frame) ?? (flowPositioning ? flowFrameGeometry(frame) : void 0);
|
|
95
95
|
if (ownGeometry === void 0) return;
|
|
96
96
|
const geometry = composeOdfGroupTransform(groupFunctions, ownGeometry);
|
|
97
97
|
return {
|
|
@@ -102,6 +102,23 @@ function readDrawFrame(frame, groupFunctions, pkg, listIdState = { next: 1 }) {
|
|
|
102
102
|
blocks: readDrawFrameContent(frame, geometry.frame, pkg, listIdState)
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
+
function flowFrameGeometry(frame) {
|
|
106
|
+
const widthValue = attrValue(frame, "svg:width");
|
|
107
|
+
const heightValue = attrValue(frame, "svg:height");
|
|
108
|
+
if (widthValue === void 0 || heightValue === void 0) return;
|
|
109
|
+
const widthPt = parseOdfLength(widthValue);
|
|
110
|
+
const heightPt = parseOdfLength(heightValue);
|
|
111
|
+
if (widthPt === void 0 || heightPt === void 0) return;
|
|
112
|
+
return {
|
|
113
|
+
frame: {
|
|
114
|
+
xPt: 0,
|
|
115
|
+
yPt: 0,
|
|
116
|
+
widthPt,
|
|
117
|
+
heightPt
|
|
118
|
+
},
|
|
119
|
+
rotationDeg: void 0
|
|
120
|
+
};
|
|
121
|
+
}
|
|
105
122
|
function readOwnTransformFunctions(element) {
|
|
106
123
|
const value = attrValue(element, "draw:transform");
|
|
107
124
|
return value === void 0 ? [] : parseOdfTransform(value);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readOdfFormulaMathMl, i as readOdfFormulaContent, n as findMathRoot, r as readOdfFormula, t as OdfFormulaDocument } from "../../read-
|
|
1
|
+
import { a as readOdfFormulaMathMl, i as readOdfFormulaContent, n as findMathRoot, r as readOdfFormula, t as OdfFormulaDocument } from "../../read-DUCm1nUv.cjs";
|
|
2
2
|
export { OdfFormulaDocument, findMathRoot, readOdfFormula, readOdfFormulaContent, readOdfFormulaMathMl };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readOdfFormulaMathMl, i as readOdfFormulaContent, n as findMathRoot, r as readOdfFormula, t as OdfFormulaDocument } from "../../read-
|
|
1
|
+
import { a as readOdfFormulaMathMl, i as readOdfFormulaContent, n as findMathRoot, r as readOdfFormula, t as OdfFormulaDocument } from "../../read-BnN7u9Y2.js";
|
|
2
2
|
export { OdfFormulaDocument, findMathRoot, readOdfFormula, readOdfFormulaContent, readOdfFormulaMathMl };
|
package/dist/typed/odb/form.cjs
CHANGED
|
@@ -1,73 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_xml_entities = require("../../xml/entities.cjs");
|
|
3
2
|
const require_xml_query = require("../../xml/query.cjs");
|
|
4
3
|
const require_typed_odb_subdocument = require("./subdocument.cjs");
|
|
4
|
+
const require_typed_shared_forms = require("../shared/forms.cjs");
|
|
5
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";
|
|
9
|
-
const FORM_ELEMENT_TAG = "form:form";
|
|
10
|
-
const FORM_PROPERTIES_TAG = "form:properties";
|
|
11
|
-
const FORM_TAG_PREFIX = "form:";
|
|
12
|
-
function formAttr(element, name) {
|
|
13
|
-
const raw = require_xml_query.attrValue(element, name);
|
|
14
|
-
return raw === void 0 ? void 0 : require_xml_entities.decodeXmlText(raw);
|
|
15
|
-
}
|
|
16
|
-
function readControl(element) {
|
|
17
|
-
const control = {
|
|
18
|
-
tag: element.tag,
|
|
19
|
-
controls: readControls(element)
|
|
20
|
-
};
|
|
21
|
-
const name = formAttr(element, "form:name");
|
|
22
|
-
if (name !== void 0) control.name = name;
|
|
23
|
-
const controlImplementation = formAttr(element, "form:control-implementation");
|
|
24
|
-
if (controlImplementation !== void 0) control.controlImplementation = controlImplementation;
|
|
25
|
-
const dataField = formAttr(element, "form:data-field");
|
|
26
|
-
if (dataField !== void 0) control.dataField = dataField;
|
|
27
|
-
const id = formAttr(element, "form:id");
|
|
28
|
-
if (id !== void 0) control.id = id;
|
|
29
|
-
const label = formAttr(element, "form:label");
|
|
30
|
-
if (label !== void 0) control.label = label;
|
|
31
|
-
return control;
|
|
32
|
-
}
|
|
33
|
-
function readControls(container) {
|
|
34
|
-
const controls = [];
|
|
35
|
-
for (const child of container.children) {
|
|
36
|
-
if (child.type !== "element" || !child.tag.startsWith(FORM_TAG_PREFIX)) continue;
|
|
37
|
-
if (child.tag === FORM_ELEMENT_TAG || child.tag === FORM_PROPERTIES_TAG) continue;
|
|
38
|
-
controls.push(readControl(child));
|
|
39
|
-
}
|
|
40
|
-
return controls;
|
|
41
|
-
}
|
|
42
|
-
function readFormDefinition(element) {
|
|
43
|
-
const subForms = [];
|
|
44
|
-
for (const child of element.children) if (child.type === "element" && child.tag === FORM_ELEMENT_TAG) subForms.push(readFormDefinition(child));
|
|
45
|
-
const definition = {
|
|
46
|
-
controls: readControls(element),
|
|
47
|
-
subForms
|
|
48
|
-
};
|
|
49
|
-
const name = formAttr(element, "form:name");
|
|
50
|
-
if (name !== void 0) definition.name = name;
|
|
51
|
-
const command = formAttr(element, "form:command");
|
|
52
|
-
if (command !== void 0) definition.command = command;
|
|
53
|
-
const commandType = formAttr(element, "form:command-type");
|
|
54
|
-
if (commandType !== void 0) definition.commandType = commandType;
|
|
55
|
-
const datasource = formAttr(element, "form:datasource");
|
|
56
|
-
if (datasource !== void 0) definition.datasource = datasource;
|
|
57
|
-
const filter = formAttr(element, "form:filter");
|
|
58
|
-
if (filter !== void 0) definition.filter = filter;
|
|
59
|
-
const order = formAttr(element, "form:order");
|
|
60
|
-
if (order !== void 0) definition.order = order;
|
|
61
|
-
return definition;
|
|
62
|
-
}
|
|
63
9
|
function readFormDefinitions(contentRoot) {
|
|
64
10
|
const body = contentRoot === void 0 ? void 0 : require_xml_query.findChildElement(contentRoot.children, "office:body");
|
|
65
11
|
const text = body === void 0 ? void 0 : require_xml_query.findChildElement(body.children, "office:text");
|
|
66
12
|
const forms = text === void 0 ? void 0 : require_xml_query.findChildElement(text.children, "office:forms");
|
|
67
|
-
|
|
68
|
-
const definitions = [];
|
|
69
|
-
for (const child of forms.children) if (child.type === "element" && child.tag === FORM_ELEMENT_TAG) definitions.push(readFormDefinition(child));
|
|
70
|
-
return definitions;
|
|
13
|
+
return forms === void 0 ? [] : require_typed_shared_forms.readOdfFormDefinitions(forms);
|
|
71
14
|
}
|
|
72
15
|
function readOdbForm(pkg, formName) {
|
|
73
16
|
const component = require_typed_odb_read.resolveOdbComponent(pkg, "form", formName);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { OdbForm,
|
|
1
|
+
import { n as readOdbForm, t as OdbForm } from "../../form-BGCT81ss.cjs";
|
|
2
|
+
export { OdbForm, readOdbForm };
|
package/dist/typed/odb/form.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { OdbForm,
|
|
1
|
+
import { n as readOdbForm, t as OdbForm } from "../../form-D3H5H2NL.js";
|
|
2
|
+
export { OdbForm, readOdbForm };
|
package/dist/typed/odb/form.js
CHANGED
|
@@ -1,72 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { attrValue, findChildElement, rootElement } from "../../xml/query.js";
|
|
1
|
+
import { findChildElement, rootElement } from "../../xml/query.js";
|
|
3
2
|
import { subDocumentPackage } from "./subdocument.js";
|
|
3
|
+
import { readOdfFormDefinitions } from "../shared/forms.js";
|
|
4
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";
|
|
8
|
-
const FORM_ELEMENT_TAG = "form:form";
|
|
9
|
-
const FORM_PROPERTIES_TAG = "form:properties";
|
|
10
|
-
const FORM_TAG_PREFIX = "form:";
|
|
11
|
-
function formAttr(element, name) {
|
|
12
|
-
const raw = attrValue(element, name);
|
|
13
|
-
return raw === void 0 ? void 0 : decodeXmlText(raw);
|
|
14
|
-
}
|
|
15
|
-
function readControl(element) {
|
|
16
|
-
const control = {
|
|
17
|
-
tag: element.tag,
|
|
18
|
-
controls: readControls(element)
|
|
19
|
-
};
|
|
20
|
-
const name = formAttr(element, "form:name");
|
|
21
|
-
if (name !== void 0) control.name = name;
|
|
22
|
-
const controlImplementation = formAttr(element, "form:control-implementation");
|
|
23
|
-
if (controlImplementation !== void 0) control.controlImplementation = controlImplementation;
|
|
24
|
-
const dataField = formAttr(element, "form:data-field");
|
|
25
|
-
if (dataField !== void 0) control.dataField = dataField;
|
|
26
|
-
const id = formAttr(element, "form:id");
|
|
27
|
-
if (id !== void 0) control.id = id;
|
|
28
|
-
const label = formAttr(element, "form:label");
|
|
29
|
-
if (label !== void 0) control.label = label;
|
|
30
|
-
return control;
|
|
31
|
-
}
|
|
32
|
-
function readControls(container) {
|
|
33
|
-
const controls = [];
|
|
34
|
-
for (const child of container.children) {
|
|
35
|
-
if (child.type !== "element" || !child.tag.startsWith(FORM_TAG_PREFIX)) continue;
|
|
36
|
-
if (child.tag === FORM_ELEMENT_TAG || child.tag === FORM_PROPERTIES_TAG) continue;
|
|
37
|
-
controls.push(readControl(child));
|
|
38
|
-
}
|
|
39
|
-
return controls;
|
|
40
|
-
}
|
|
41
|
-
function readFormDefinition(element) {
|
|
42
|
-
const subForms = [];
|
|
43
|
-
for (const child of element.children) if (child.type === "element" && child.tag === FORM_ELEMENT_TAG) subForms.push(readFormDefinition(child));
|
|
44
|
-
const definition = {
|
|
45
|
-
controls: readControls(element),
|
|
46
|
-
subForms
|
|
47
|
-
};
|
|
48
|
-
const name = formAttr(element, "form:name");
|
|
49
|
-
if (name !== void 0) definition.name = name;
|
|
50
|
-
const command = formAttr(element, "form:command");
|
|
51
|
-
if (command !== void 0) definition.command = command;
|
|
52
|
-
const commandType = formAttr(element, "form:command-type");
|
|
53
|
-
if (commandType !== void 0) definition.commandType = commandType;
|
|
54
|
-
const datasource = formAttr(element, "form:datasource");
|
|
55
|
-
if (datasource !== void 0) definition.datasource = datasource;
|
|
56
|
-
const filter = formAttr(element, "form:filter");
|
|
57
|
-
if (filter !== void 0) definition.filter = filter;
|
|
58
|
-
const order = formAttr(element, "form:order");
|
|
59
|
-
if (order !== void 0) definition.order = order;
|
|
60
|
-
return definition;
|
|
61
|
-
}
|
|
62
8
|
function readFormDefinitions(contentRoot) {
|
|
63
9
|
const body = contentRoot === void 0 ? void 0 : findChildElement(contentRoot.children, "office:body");
|
|
64
10
|
const text = body === void 0 ? void 0 : findChildElement(body.children, "office:text");
|
|
65
11
|
const forms = text === void 0 ? void 0 : findChildElement(text.children, "office:forms");
|
|
66
|
-
|
|
67
|
-
const definitions = [];
|
|
68
|
-
for (const child of forms.children) if (child.type === "element" && child.tag === FORM_ELEMENT_TAG) definitions.push(readFormDefinition(child));
|
|
69
|
-
return definitions;
|
|
12
|
+
return forms === void 0 ? [] : readOdfFormDefinitions(forms);
|
|
70
13
|
}
|
|
71
14
|
function readOdbForm(pkg, formName) {
|
|
72
15
|
const component = resolveOdbComponent(pkg, "form", formName);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readOdbInventory, i as OdbQueryInfo, n as OdbConnectionInfo, o as resolveOdbComponent, r as OdbInventory, t as OdbComponentInfo } from "../../read-
|
|
1
|
+
import { a as readOdbInventory, i as OdbQueryInfo, n as OdbConnectionInfo, o as resolveOdbComponent, r as OdbInventory, t as OdbComponentInfo } from "../../read-BV2an1ok.cjs";
|
|
2
2
|
export { OdbComponentInfo, OdbConnectionInfo, OdbInventory, OdbQueryInfo, readOdbInventory, resolveOdbComponent };
|
package/dist/typed/odb/read.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readOdbInventory, i as OdbQueryInfo, n as OdbConnectionInfo, o as resolveOdbComponent, r as OdbInventory, t as OdbComponentInfo } from "../../read-
|
|
1
|
+
import { a as readOdbInventory, i as OdbQueryInfo, n as OdbConnectionInfo, o as resolveOdbComponent, r as OdbInventory, t as OdbComponentInfo } from "../../read-CvjbdgH3.js";
|
|
2
2
|
export { OdbComponentInfo, OdbConnectionInfo, OdbInventory, OdbQueryInfo, readOdbInventory, resolveOdbComponent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OdbReportGroup, i as OdbReportFunction, n as OdbReportBand, o as readOdbReport, r as OdbReportElement, t as OdbReport } from "../../report-
|
|
1
|
+
import { a as OdbReportGroup, i as OdbReportFunction, n as OdbReportBand, o as readOdbReport, r as OdbReportElement, t as OdbReport } from "../../report-D6WNYaVn.cjs";
|
|
2
2
|
export { OdbReport, OdbReportBand, OdbReportElement, OdbReportFunction, OdbReportGroup, readOdbReport };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OdbReportGroup, i as OdbReportFunction, n as OdbReportBand, o as readOdbReport, r as OdbReportElement, t as OdbReport } from "../../report-
|
|
1
|
+
import { a as OdbReportGroup, i as OdbReportFunction, n as OdbReportBand, o as readOdbReport, r as OdbReportElement, t as OdbReport } from "../../report-DbslT2OR.js";
|
|
2
2
|
export { OdbReport, OdbReportBand, OdbReportElement, OdbReportFunction, OdbReportGroup, readOdbReport };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as subDocumentPackage, t as SubDocumentPackageOptions } from "../../subdocument-
|
|
1
|
+
import { n as subDocumentPackage, t as SubDocumentPackageOptions } from "../../subdocument-yY8ASE4N.cjs";
|
|
2
2
|
export { SubDocumentPackageOptions, subDocumentPackage };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as subDocumentPackage, t as SubDocumentPackageOptions } from "../../subdocument-
|
|
1
|
+
import { n as subDocumentPackage, t as SubDocumentPackageOptions } from "../../subdocument-BwW3FZC_.js";
|
|
2
2
|
export { SubDocumentPackageOptions, subDocumentPackage };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as readOdg, r as readOdgContent, t as OdgDocument } from "../../read-
|
|
1
|
+
import { n as readOdg, r as readOdgContent, t as OdgDocument } from "../../read-DOYWO6BM.cjs";
|
|
2
2
|
export { OdgDocument, readOdg, readOdgContent };
|
package/dist/typed/odg/read.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as readOdg, r as readOdgContent, t as OdgDocument } from "../../read-
|
|
1
|
+
import { n as readOdg, r as readOdgContent, t as OdgDocument } from "../../read-lc0t0UHK.js";
|
|
2
2
|
export { OdgDocument, readOdg, readOdgContent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as OdmSection, r as readOdm, t as OdmDocument } from "../../read-
|
|
1
|
+
import { n as OdmSection, r as readOdm, t as OdmDocument } from "../../read-ydLJ8bid.cjs";
|
|
2
2
|
export { OdmDocument, OdmSection, readOdm };
|
package/dist/typed/odm/read.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as OdmSection, r as readOdm, t as OdmDocument } from "../../read-
|
|
1
|
+
import { n as OdmSection, r as readOdm, t as OdmDocument } from "../../read-DYYxbvfo.js";
|
|
2
2
|
export { OdmDocument, OdmSection, readOdm };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as readOdp, r as readOdpContent, t as OdpDocument } from "../../read-
|
|
1
|
+
import { n as readOdp, r as readOdpContent, t as OdpDocument } from "../../read-CTfeWaWq.cjs";
|
|
2
2
|
export { OdpDocument, readOdp, readOdpContent };
|
package/dist/typed/odp/read.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as readOdp, r as readOdpContent, t as OdpDocument } from "../../read-
|
|
1
|
+
import { n as readOdp, r as readOdpContent, t as OdpDocument } from "../../read-Db_GZ0ZH.js";
|
|
2
2
|
export { OdpDocument, readOdp, readOdpContent };
|
package/dist/typed/ods/read.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const require_typed_shared_a1 = require("../shared/a1.cjs");
|
|
|
5
5
|
const require_typed_shared_geometry = require("../shared/geometry.cjs");
|
|
6
6
|
const require_typed_shared_cascade = require("../shared/cascade.cjs");
|
|
7
7
|
const require_typed_shared_metadata = require("../shared/metadata.cjs");
|
|
8
|
+
const require_typed_shared_constructs = require("../shared/constructs.cjs");
|
|
8
9
|
const require_typed_shared_paragraph = require("../shared/paragraph.cjs");
|
|
9
10
|
const require_typed_shared_table = require("../shared/table.cjs");
|
|
10
11
|
const require_typed_shared_transform = require("../shared/transform.cjs");
|
|
@@ -13,8 +14,8 @@ const require_typed_draw_shapes = require("../draw/shapes.cjs");
|
|
|
13
14
|
const require_typed_formula_read = require("../formula/read.cjs");
|
|
14
15
|
const require_typed_draw_embedded = require("../draw/embedded.cjs");
|
|
15
16
|
const require_typed_odp_read = require("../odp/read.cjs");
|
|
16
|
-
const require_typed_odt_read = require("../odt/read.cjs");
|
|
17
17
|
const require_typed_odg_read = require("../odg/read.cjs");
|
|
18
|
+
const require_typed_odt_read = require("../odt/read.cjs");
|
|
18
19
|
let document_schema_js = require("document-schema.js");
|
|
19
20
|
//#region src/typed/ods/read.ts
|
|
20
21
|
const CONTENT_PART = "content.xml";
|
|
@@ -165,7 +166,7 @@ function parseNonNegativeInteger(value) {
|
|
|
165
166
|
const parsed = Number.parseInt(value, 10);
|
|
166
167
|
return Number.isInteger(parsed) && parsed >= 0 ? parsed : void 0;
|
|
167
168
|
}
|
|
168
|
-
function readEmbeddedObjectDocument(reference) {
|
|
169
|
+
function readEmbeddedObjectDocument(reference, frame) {
|
|
169
170
|
switch (reference.objectKind) {
|
|
170
171
|
case "wordprocessing": {
|
|
171
172
|
const { metadata, sections } = require_typed_odt_read.readOdtContent(reference.package);
|
|
@@ -200,16 +201,32 @@ function readEmbeddedObjectDocument(reference) {
|
|
|
200
201
|
};
|
|
201
202
|
}
|
|
202
203
|
case "formula": return require_typed_formula_read.readOdfFormulaContent(reference.package);
|
|
204
|
+
case "chart": return require_typed_draw_embedded.readOdfChartContent(reference.package, frame, "ods").document;
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
function collectAnchoredFrame(frameElement, groupFunctions, pkg, anchorRow, anchorColumn, images, embeddedObjects) {
|
|
206
208
|
const shape = require_typed_draw_shapes.readDrawFrame(frameElement, groupFunctions, pkg);
|
|
207
209
|
if (shape === void 0) return;
|
|
208
210
|
const reference = require_typed_draw_embedded.readDrawObjectReference(frameElement, pkg);
|
|
211
|
+
if (reference?.objectKind === "chart") {
|
|
212
|
+
const { document, residue } = require_typed_draw_embedded.readOdfChartContent(reference.package, shape.frame, "ods");
|
|
213
|
+
const chartObject = {
|
|
214
|
+
objectKind: "chart",
|
|
215
|
+
document,
|
|
216
|
+
frame: shape.frame,
|
|
217
|
+
anchorRow,
|
|
218
|
+
anchorColumn,
|
|
219
|
+
offsetXPt: shape.frame.xPt,
|
|
220
|
+
offsetYPt: shape.frame.yPt
|
|
221
|
+
};
|
|
222
|
+
if (residue !== void 0) chartObject.source = residue;
|
|
223
|
+
embeddedObjects.push(chartObject);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
209
226
|
if (reference !== void 0) {
|
|
210
227
|
embeddedObjects.push({
|
|
211
228
|
objectKind: reference.objectKind,
|
|
212
|
-
document: readEmbeddedObjectDocument(reference),
|
|
229
|
+
document: readEmbeddedObjectDocument(reference, shape.frame),
|
|
213
230
|
frame: shape.frame,
|
|
214
231
|
anchorRow,
|
|
215
232
|
anchorColumn,
|
|
@@ -407,18 +424,23 @@ function readOdsContent(pkg) {
|
|
|
407
424
|
const sheet = readSheet(table, pkg);
|
|
408
425
|
if (sheet !== void 0) sheets.push(sheet);
|
|
409
426
|
}
|
|
427
|
+
const definitions = {};
|
|
428
|
+
if (spreadsheet !== void 0) require_typed_shared_constructs.collectOdfNamedExpressions(spreadsheet.children, definitions);
|
|
410
429
|
return {
|
|
411
430
|
metadata: require_typed_shared_metadata.readOdfMetadata(pkg),
|
|
412
|
-
sheets
|
|
431
|
+
sheets,
|
|
432
|
+
...Object.keys(definitions).length > 0 ? { definitions } : {}
|
|
413
433
|
};
|
|
414
434
|
}
|
|
415
435
|
function readOds(pkg) {
|
|
416
|
-
const { metadata, sheets } = readOdsContent(pkg);
|
|
417
|
-
|
|
436
|
+
const { metadata, sheets, definitions } = readOdsContent(pkg);
|
|
437
|
+
const assembled = (0, document_schema_js.assemblePackage)({
|
|
418
438
|
kind: "spreadsheet",
|
|
419
439
|
metadata,
|
|
420
440
|
sheets
|
|
421
441
|
});
|
|
442
|
+
if (definitions !== void 0) assembled.definitions = definitions;
|
|
443
|
+
return assembled;
|
|
422
444
|
}
|
|
423
445
|
//#endregion
|
|
424
446
|
exports.readOds = readOds;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as readOds, r as readOdsContent, t as OdsDocument } from "../../read-
|
|
1
|
+
import { n as readOds, r as readOdsContent, t as OdsDocument } from "../../read-B4238IGr.cjs";
|
|
2
2
|
export { OdsDocument, readOds, readOdsContent };
|
package/dist/typed/ods/read.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as readOds, r as readOdsContent, t as OdsDocument } from "../../read-
|
|
1
|
+
import { n as readOds, r as readOdsContent, t as OdsDocument } from "../../read-CdvX2qnz.js";
|
|
2
2
|
export { OdsDocument, readOds, readOdsContent };
|
package/dist/typed/ods/read.js
CHANGED
|
@@ -4,16 +4,17 @@ import { TableCursor, parseCellReference as parseCellReference$1 } from "../shar
|
|
|
4
4
|
import { parseMargins, parsePageSize } from "../shared/geometry.js";
|
|
5
5
|
import { findStyleElement, resolveStyleElementChain } from "../shared/cascade.js";
|
|
6
6
|
import { readOdfMetadata } from "../shared/metadata.js";
|
|
7
|
+
import { collectOdfNamedExpressions } from "../shared/constructs.js";
|
|
7
8
|
import { readOdfParagraph } from "../shared/paragraph.js";
|
|
8
9
|
import { readCellStyleDecoration } from "../shared/table.js";
|
|
9
10
|
import { parseOdfTransform } from "../shared/transform.js";
|
|
10
11
|
import { resolvePageLayoutProperties } from "../shared/masterpage.js";
|
|
11
12
|
import { readDrawFrame } from "../draw/shapes.js";
|
|
12
13
|
import { readOdfFormulaContent } from "../formula/read.js";
|
|
13
|
-
import { readDrawObjectReference } from "../draw/embedded.js";
|
|
14
|
+
import { readDrawObjectReference, readOdfChartContent } from "../draw/embedded.js";
|
|
14
15
|
import { readOdpContent } from "../odp/read.js";
|
|
15
|
-
import { readOdtContent } from "../odt/read.js";
|
|
16
16
|
import { readOdgContent } from "../odg/read.js";
|
|
17
|
+
import { readOdtContent } from "../odt/read.js";
|
|
17
18
|
import { PAGE_SIZE_A4, assemblePackage } from "document-schema.js";
|
|
18
19
|
//#region src/typed/ods/read.ts
|
|
19
20
|
const CONTENT_PART = "content.xml";
|
|
@@ -164,7 +165,7 @@ function parseNonNegativeInteger(value) {
|
|
|
164
165
|
const parsed = Number.parseInt(value, 10);
|
|
165
166
|
return Number.isInteger(parsed) && parsed >= 0 ? parsed : void 0;
|
|
166
167
|
}
|
|
167
|
-
function readEmbeddedObjectDocument(reference) {
|
|
168
|
+
function readEmbeddedObjectDocument(reference, frame) {
|
|
168
169
|
switch (reference.objectKind) {
|
|
169
170
|
case "wordprocessing": {
|
|
170
171
|
const { metadata, sections } = readOdtContent(reference.package);
|
|
@@ -199,16 +200,32 @@ function readEmbeddedObjectDocument(reference) {
|
|
|
199
200
|
};
|
|
200
201
|
}
|
|
201
202
|
case "formula": return readOdfFormulaContent(reference.package);
|
|
203
|
+
case "chart": return readOdfChartContent(reference.package, frame, "ods").document;
|
|
202
204
|
}
|
|
203
205
|
}
|
|
204
206
|
function collectAnchoredFrame(frameElement, groupFunctions, pkg, anchorRow, anchorColumn, images, embeddedObjects) {
|
|
205
207
|
const shape = readDrawFrame(frameElement, groupFunctions, pkg);
|
|
206
208
|
if (shape === void 0) return;
|
|
207
209
|
const reference = readDrawObjectReference(frameElement, pkg);
|
|
210
|
+
if (reference?.objectKind === "chart") {
|
|
211
|
+
const { document, residue } = readOdfChartContent(reference.package, shape.frame, "ods");
|
|
212
|
+
const chartObject = {
|
|
213
|
+
objectKind: "chart",
|
|
214
|
+
document,
|
|
215
|
+
frame: shape.frame,
|
|
216
|
+
anchorRow,
|
|
217
|
+
anchorColumn,
|
|
218
|
+
offsetXPt: shape.frame.xPt,
|
|
219
|
+
offsetYPt: shape.frame.yPt
|
|
220
|
+
};
|
|
221
|
+
if (residue !== void 0) chartObject.source = residue;
|
|
222
|
+
embeddedObjects.push(chartObject);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
208
225
|
if (reference !== void 0) {
|
|
209
226
|
embeddedObjects.push({
|
|
210
227
|
objectKind: reference.objectKind,
|
|
211
|
-
document: readEmbeddedObjectDocument(reference),
|
|
228
|
+
document: readEmbeddedObjectDocument(reference, shape.frame),
|
|
212
229
|
frame: shape.frame,
|
|
213
230
|
anchorRow,
|
|
214
231
|
anchorColumn,
|
|
@@ -406,18 +423,23 @@ function readOdsContent(pkg) {
|
|
|
406
423
|
const sheet = readSheet(table, pkg);
|
|
407
424
|
if (sheet !== void 0) sheets.push(sheet);
|
|
408
425
|
}
|
|
426
|
+
const definitions = {};
|
|
427
|
+
if (spreadsheet !== void 0) collectOdfNamedExpressions(spreadsheet.children, definitions);
|
|
409
428
|
return {
|
|
410
429
|
metadata: readOdfMetadata(pkg),
|
|
411
|
-
sheets
|
|
430
|
+
sheets,
|
|
431
|
+
...Object.keys(definitions).length > 0 ? { definitions } : {}
|
|
412
432
|
};
|
|
413
433
|
}
|
|
414
434
|
function readOds(pkg) {
|
|
415
|
-
const { metadata, sheets } = readOdsContent(pkg);
|
|
416
|
-
|
|
435
|
+
const { metadata, sheets, definitions } = readOdsContent(pkg);
|
|
436
|
+
const assembled = assemblePackage({
|
|
417
437
|
kind: "spreadsheet",
|
|
418
438
|
metadata,
|
|
419
439
|
sheets
|
|
420
440
|
});
|
|
441
|
+
if (definitions !== void 0) assembled.definitions = definitions;
|
|
442
|
+
return assembled;
|
|
421
443
|
}
|
|
422
444
|
//#endregion
|
|
423
445
|
export { readOds, readOdsContent };
|