odf.js 6.3.0 → 6.4.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 +172 -18
- package/dist/{codec-BnzBd5_I.d.cts → codec-CFdlbFLJ.d.cts} +16 -10
- package/dist/{codec-Dg_HWuH1.d.ts → codec-DTAgph2r.d.ts} +16 -10
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/{embedded-BONPxvS3.js → embedded-BnavfkP-.js} +3 -3
- package/dist/{embedded-wrtHCJ68.cjs → embedded-Bxyss_ck.cjs} +14 -2
- package/dist/index.cjs +34 -1
- package/dist/index.d.cts +19 -13
- package/dist/index.d.ts +19 -13
- package/dist/index.js +12 -6
- package/dist/{list-vhXd0Jf6.d.ts → list-7FO0SDqZ.d.ts} +14 -1
- package/dist/{list-Bttwr1mk.d.cts → list-BorrTJBY.d.cts} +14 -1
- package/dist/{ns-C14w-Zhf.d.cts → ns-DrleaIZQ.d.cts} +3 -1
- package/dist/{ns-CTyKJZeF.d.ts → ns-E0TfX9tZ.d.ts} +3 -1
- package/dist/ooo1/ns.cjs +9 -0
- package/dist/ooo1/ns.d.cts +2 -2
- package/dist/ooo1/ns.d.ts +2 -2
- package/dist/ooo1/ns.js +8 -1
- package/dist/ooo1/properties.cjs +30 -0
- package/dist/ooo1/properties.d.cts +6 -2
- package/dist/ooo1/properties.d.ts +6 -2
- package/dist/ooo1/properties.js +30 -1
- package/dist/ooo1/read.cjs +1 -1
- package/dist/ooo1/read.d.cts +1 -1
- package/dist/ooo1/read.d.ts +1 -1
- package/dist/ooo1/read.js +1 -1
- package/dist/ooo1/transform.cjs +290 -0
- package/dist/ooo1/transform.d.cts +2 -2
- package/dist/ooo1/transform.d.ts +2 -2
- package/dist/ooo1/transform.js +293 -4
- package/dist/ooo1/write.cjs +40 -0
- package/dist/ooo1/write.d.cts +2 -0
- package/dist/ooo1/write.d.ts +2 -0
- package/dist/ooo1/write.js +32 -0
- package/dist/package-io/scaffold.cjs +2 -1
- package/dist/package-io/scaffold.js +2 -1
- package/dist/{paragraph-BdwsQisB.d.cts → paragraph-Bf6Iq5wC.d.cts} +1 -1
- package/dist/{paragraph-BoVy1LrN.d.ts → paragraph-DtC86tft.d.ts} +1 -1
- package/dist/{path-CK0dIPgx.d.cts → path-8HQS-J7y.d.cts} +3 -1
- package/dist/{path-CK0dIPgx.d.ts → path-8HQS-J7y.d.ts} +3 -1
- package/dist/{read-Bo1GBjSE.d.ts → read-A3CJkqVM.d.ts} +3 -1
- package/dist/{read-RFqq4ckj.d.cts → read-BgnLFuSi.d.cts} +1 -1
- package/dist/{read-3yy5EFV_.d.ts → read-CqaZ01kU.d.ts} +1 -1
- package/dist/{read-tpfiT_n4.d.cts → read-fphkvCpR.d.cts} +3 -1
- package/dist/{shapes-DUzrrf7b.d.ts → shapes-B6Ms7ibr.d.ts} +1 -1
- package/dist/{shapes-BQhXAk0D.d.cts → shapes-CbBc9t0y.d.cts} +1 -1
- package/dist/{table-ByhqRnSG.d.cts → table-CECMtPxZ.d.cts} +6 -2
- package/dist/{table-DElqGcT0.d.ts → table-XuniPr2I.d.ts} +6 -2
- package/dist/{transform-SDysw9wx.d.cts → transform-DFCPKX7e.d.cts} +2 -1
- package/dist/{transform-DRr76JEu.d.ts → transform-DPliWQuD.d.ts} +2 -1
- package/dist/typed/draw/embedded.cjs +1 -1
- package/dist/typed/draw/embedded.js +1 -1
- package/dist/typed/draw/shapes.cjs +7 -2
- package/dist/typed/draw/shapes.d.cts +1 -1
- package/dist/typed/draw/shapes.d.ts +1 -1
- package/dist/typed/draw/shapes.js +7 -2
- package/dist/typed/draw/write-shapes.cjs +210 -0
- package/dist/typed/draw/write-shapes.d.cts +2 -0
- package/dist/typed/draw/write-shapes.d.ts +2 -0
- package/dist/typed/draw/write-shapes.js +203 -0
- package/dist/typed/draw/write-vectors.cjs +132 -0
- package/dist/typed/draw/write-vectors.d.cts +2 -0
- package/dist/typed/draw/write-vectors.d.ts +2 -0
- package/dist/typed/draw/write-vectors.js +129 -0
- package/dist/typed/odb/form.cjs +1 -1
- package/dist/typed/odb/form.js +1 -1
- package/dist/typed/odg/write.cjs +80 -0
- package/dist/typed/odg/write.d.cts +2 -0
- package/dist/typed/odg/write.d.ts +2 -0
- package/dist/typed/odg/write.js +77 -0
- package/dist/typed/odp/write.cjs +108 -0
- package/dist/typed/odp/write.d.cts +2 -0
- package/dist/typed/odp/write.d.ts +2 -0
- package/dist/typed/odp/write.js +105 -0
- package/dist/typed/ods/read.cjs +3 -1
- package/dist/typed/ods/read.d.cts +2 -2
- package/dist/typed/ods/read.d.ts +2 -2
- package/dist/typed/ods/read.js +2 -2
- package/dist/typed/ods/write.cjs +578 -0
- package/dist/typed/ods/write.d.cts +2 -0
- package/dist/typed/ods/write.d.ts +2 -0
- package/dist/typed/ods/write.js +575 -0
- package/dist/typed/odt/read.cjs +1 -1
- package/dist/typed/odt/read.js +1 -1
- package/dist/typed/odt/write.cjs +9 -140
- package/dist/typed/odt/write.d.cts +1 -1
- package/dist/typed/odt/write.d.ts +1 -1
- package/dist/typed/odt/write.js +8 -139
- package/dist/typed/shared/canonicalise.cjs +126 -0
- package/dist/typed/shared/canonicalise.d.cts +10 -0
- package/dist/typed/shared/canonicalise.d.ts +10 -0
- package/dist/typed/shared/canonicalise.js +120 -0
- package/dist/typed/shared/list.cjs +32 -0
- package/dist/typed/shared/list.d.cts +2 -2
- package/dist/typed/shared/list.d.ts +2 -2
- package/dist/typed/shared/list.js +28 -1
- package/dist/typed/shared/paragraph.d.cts +1 -1
- package/dist/typed/shared/paragraph.d.ts +1 -1
- package/dist/typed/shared/path.cjs +19 -0
- package/dist/typed/shared/path.d.cts +2 -2
- package/dist/typed/shared/path.d.ts +2 -2
- package/dist/typed/shared/path.js +18 -1
- package/dist/typed/shared/table.cjs +3 -0
- package/dist/typed/shared/table.d.cts +2 -2
- package/dist/typed/shared/table.d.ts +2 -2
- package/dist/typed/shared/table.js +1 -1
- package/dist/typed/shared/units.cjs +16 -1
- package/dist/typed/shared/units.d.cts +2 -2
- package/dist/typed/shared/units.d.ts +2 -2
- package/dist/typed/shared/units.js +16 -2
- package/dist/{units-BQSNkTQZ.d.ts → units-DdyaQolR.d.cts} +2 -1
- package/dist/{units-BQSNkTQZ.d.cts → units-DdyaQolR.d.ts} +2 -1
- package/dist/write-4kMi-asu.d.ts +14 -0
- package/dist/write-BZXpT8F6.d.cts +17 -0
- package/dist/write-BhG3t3fJ.d.cts +14 -0
- package/dist/write-BuLQmwLD.d.cts +14 -0
- package/dist/write-C2c4xBXs.d.cts +14 -0
- package/dist/{write-7Uu_wlkL.d.cts → write-CPATqG4v.d.cts} +1 -0
- package/dist/write-CfTE2jY8.d.ts +14 -0
- package/dist/write-DttX1rTC.d.ts +14 -0
- package/dist/{write-DGcI9W7Z.d.ts → write-JERychL3.d.ts} +1 -0
- package/dist/write-SKnCTU4C.d.ts +17 -0
- package/dist/write-shapes-Co7BrmMZ.d.ts +36 -0
- package/dist/write-shapes-D4piGKf4.d.cts +36 -0
- package/dist/write-vectors-B-RVHAKI.d.cts +11 -0
- package/dist/write-vectors-CYjZoVBW.d.ts +11 -0
- package/package.json +2 -2
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { segmentOdfParagraphRuns } from "./paragraph.js";
|
|
2
|
+
import { colorToRgbHex, rgbHexToColor } from "document-schema.js";
|
|
3
|
+
//#region src/typed/shared/canonicalise.ts
|
|
4
|
+
function unsupportedContent(what, where) {
|
|
5
|
+
return /* @__PURE__ */ new Error(`${where} carries ${what}, which no ODF writer in this package can produce yet -- refusing to state a canonical form for content that would be silently lost on write. See ExaDev/documents.js for the tracked follow-up covering the fidelity constructs and embedded objects.`);
|
|
6
|
+
}
|
|
7
|
+
function canonicalColor(color) {
|
|
8
|
+
return rgbHexToColor(colorToRgbHex(color));
|
|
9
|
+
}
|
|
10
|
+
function canonicalRun(run) {
|
|
11
|
+
const canonical = { text: run.text };
|
|
12
|
+
if (run.bold !== void 0) canonical.bold = run.bold;
|
|
13
|
+
if (run.italic !== void 0) canonical.italic = run.italic;
|
|
14
|
+
if (run.underline !== void 0) canonical.underline = run.underline;
|
|
15
|
+
if (run.strike !== void 0) canonical.strike = run.strike;
|
|
16
|
+
if (run.fontFamily !== void 0) canonical.fontFamily = run.fontFamily;
|
|
17
|
+
if (run.sizePt !== void 0) canonical.sizePt = run.sizePt;
|
|
18
|
+
if (run.color !== void 0) canonical.color = canonicalColor(run.color);
|
|
19
|
+
if (run.hyperlink !== void 0) canonical.hyperlink = run.hyperlink;
|
|
20
|
+
return canonical;
|
|
21
|
+
}
|
|
22
|
+
function canonicalParagraph(paragraph, listNumId) {
|
|
23
|
+
if (paragraph.constructs !== void 0 && paragraph.constructs.length > 0) throw unsupportedContent("run-level construct extents (a field, bookmark, note, annotation, or tracked change)", "a paragraph");
|
|
24
|
+
const canonical = {
|
|
25
|
+
kind: "paragraph",
|
|
26
|
+
runs: segmentOdfParagraphRuns(paragraph.runs).map(canonicalRun)
|
|
27
|
+
};
|
|
28
|
+
if (paragraph.headingLevel !== void 0) {
|
|
29
|
+
canonical.headingLevel = paragraph.headingLevel;
|
|
30
|
+
canonical.styleId = `Heading${paragraph.headingLevel}`;
|
|
31
|
+
}
|
|
32
|
+
if (paragraph.alignment !== void 0) canonical.alignment = paragraph.alignment;
|
|
33
|
+
if (listNumId !== void 0 && paragraph.list !== void 0) canonical.list = {
|
|
34
|
+
numId: listNumId,
|
|
35
|
+
level: paragraph.list.level
|
|
36
|
+
};
|
|
37
|
+
if (paragraph.spacingBeforePt !== void 0) canonical.spacingBeforePt = paragraph.spacingBeforePt;
|
|
38
|
+
if (paragraph.spacingAfterPt !== void 0) canonical.spacingAfterPt = paragraph.spacingAfterPt;
|
|
39
|
+
if (paragraph.lineSpacing !== void 0) canonical.lineSpacing = paragraph.lineSpacing;
|
|
40
|
+
if (paragraph.indentLeftPt !== void 0) canonical.indentLeftPt = paragraph.indentLeftPt;
|
|
41
|
+
if (paragraph.indentFirstLinePt !== void 0) canonical.indentFirstLinePt = paragraph.indentFirstLinePt;
|
|
42
|
+
if (paragraph.pageBreakBefore !== void 0) canonical.pageBreakBefore = paragraph.pageBreakBefore;
|
|
43
|
+
if (paragraph.pageBreakAfter !== void 0) canonical.pageBreakAfter = paragraph.pageBreakAfter;
|
|
44
|
+
return canonical;
|
|
45
|
+
}
|
|
46
|
+
function canonicalCell(cell, covered) {
|
|
47
|
+
if (covered) return { blocks: [] };
|
|
48
|
+
const canonical = { blocks: cell.blocks.map((block) => {
|
|
49
|
+
if (block.kind !== "paragraph") throw unsupportedContent(`a "${block.kind}" block`, "a table cell");
|
|
50
|
+
return canonicalParagraph(block, void 0);
|
|
51
|
+
}) };
|
|
52
|
+
if (cell.colSpan !== void 0) canonical.colSpan = cell.colSpan;
|
|
53
|
+
if (cell.rowSpan !== void 0) canonical.rowSpan = cell.rowSpan;
|
|
54
|
+
if (cell.background !== void 0) canonical.background = canonicalColor(cell.background);
|
|
55
|
+
if (cell.borders !== void 0) {
|
|
56
|
+
const borders = {};
|
|
57
|
+
for (const edge of [
|
|
58
|
+
"left",
|
|
59
|
+
"right",
|
|
60
|
+
"top",
|
|
61
|
+
"bottom"
|
|
62
|
+
]) {
|
|
63
|
+
const border = cell.borders[edge];
|
|
64
|
+
if (border !== void 0) borders[edge] = {
|
|
65
|
+
color: canonicalColor(border.color),
|
|
66
|
+
widthPt: border.widthPt,
|
|
67
|
+
style: border.style ?? "solid"
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
canonical.borders = borders;
|
|
71
|
+
}
|
|
72
|
+
return canonical;
|
|
73
|
+
}
|
|
74
|
+
function canonicalTable(table) {
|
|
75
|
+
const covered = /* @__PURE__ */ new Set();
|
|
76
|
+
return {
|
|
77
|
+
kind: "table",
|
|
78
|
+
columnWidthsPt: [...table.columnWidthsPt],
|
|
79
|
+
rows: table.rows.map((row, rowIndex) => {
|
|
80
|
+
const cells = row.cells.map((cell, columnIndex) => {
|
|
81
|
+
const key = `${rowIndex},${columnIndex}`;
|
|
82
|
+
const isCovered = covered.has(key);
|
|
83
|
+
if (!isCovered) {
|
|
84
|
+
const colSpan = cell.colSpan ?? 1;
|
|
85
|
+
const rowSpan = cell.rowSpan ?? 1;
|
|
86
|
+
for (let r = rowIndex; r < rowIndex + rowSpan; r += 1) for (let c = columnIndex; c < columnIndex + colSpan; c += 1) if (r !== rowIndex || c !== columnIndex) covered.add(`${r},${c}`);
|
|
87
|
+
}
|
|
88
|
+
return canonicalCell(cell, isCovered);
|
|
89
|
+
});
|
|
90
|
+
return row.heightPt === void 0 ? { cells } : {
|
|
91
|
+
cells,
|
|
92
|
+
heightPt: row.heightPt
|
|
93
|
+
};
|
|
94
|
+
})
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function canonicalMetadata(metadata) {
|
|
98
|
+
const canonical = {};
|
|
99
|
+
if (metadata.title !== void 0) canonical.title = metadata.title;
|
|
100
|
+
if (metadata.author !== void 0) canonical.author = metadata.author;
|
|
101
|
+
if (metadata.subject !== void 0) canonical.subject = metadata.subject;
|
|
102
|
+
if (metadata.keywords !== void 0 && metadata.keywords.length > 0) canonical.keywords = [...metadata.keywords];
|
|
103
|
+
if (metadata.creator !== void 0) canonical.creator = metadata.creator;
|
|
104
|
+
if (metadata.createdIso !== void 0) canonical.createdIso = metadata.createdIso;
|
|
105
|
+
if (metadata.modifiedIso !== void 0) canonical.modifiedIso = metadata.modifiedIso;
|
|
106
|
+
return canonical;
|
|
107
|
+
}
|
|
108
|
+
function canonicalImage(image) {
|
|
109
|
+
const canonical = {
|
|
110
|
+
kind: "image",
|
|
111
|
+
format: image.format,
|
|
112
|
+
base64: image.base64,
|
|
113
|
+
widthPt: image.widthPt,
|
|
114
|
+
heightPt: image.heightPt
|
|
115
|
+
};
|
|
116
|
+
if (image.altText !== void 0) canonical.altText = image.altText;
|
|
117
|
+
return canonical;
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { canonicalColor, canonicalImage, canonicalMetadata, canonicalParagraph, canonicalRun, canonicalTable };
|
|
@@ -73,6 +73,33 @@ function writeOdfList(entries, styleName) {
|
|
|
73
73
|
}
|
|
74
74
|
return root;
|
|
75
75
|
}
|
|
76
|
+
function listKindOf(numId) {
|
|
77
|
+
if (numId === void 0) return;
|
|
78
|
+
if (numId.startsWith("ordered:")) return "ordered";
|
|
79
|
+
return numId.startsWith("bullet:") ? "bullet" : void 0;
|
|
80
|
+
}
|
|
81
|
+
const NO_NUM_ID_KEY = "\0";
|
|
82
|
+
function canonicalNumId(incoming, ordinal) {
|
|
83
|
+
const kind = listKindOf(incoming);
|
|
84
|
+
return kind === void 0 ? `list${ordinal}` : `${kind}:list${ordinal}`;
|
|
85
|
+
}
|
|
86
|
+
function planListMembership(membership, listState) {
|
|
87
|
+
if (membership === void 0) {
|
|
88
|
+
closeListPlan(listState);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const incomingKey = membership.numId ?? "\0";
|
|
92
|
+
if (listState.openNumId !== incomingKey) {
|
|
93
|
+
listState.openNumId = incomingKey;
|
|
94
|
+
listState.openCanonicalNumId = canonicalNumId(membership.numId, listState.next);
|
|
95
|
+
listState.next += 1;
|
|
96
|
+
}
|
|
97
|
+
return listState.openCanonicalNumId;
|
|
98
|
+
}
|
|
99
|
+
function closeListPlan(listState) {
|
|
100
|
+
listState.openNumId = void 0;
|
|
101
|
+
listState.openCanonicalNumId = void 0;
|
|
102
|
+
}
|
|
76
103
|
function readOdfListParagraphs(listElement, membership, readParagraph) {
|
|
77
104
|
const paragraphs = [];
|
|
78
105
|
for (const item of listElement.children) {
|
|
@@ -92,8 +119,13 @@ function readOdfListParagraphs(listElement, membership, readParagraph) {
|
|
|
92
119
|
return paragraphs;
|
|
93
120
|
}
|
|
94
121
|
//#endregion
|
|
122
|
+
exports.NO_NUM_ID_KEY = NO_NUM_ID_KEY;
|
|
95
123
|
exports.buildOdfListStyle = buildOdfListStyle;
|
|
124
|
+
exports.canonicalNumId = canonicalNumId;
|
|
125
|
+
exports.closeListPlan = closeListPlan;
|
|
126
|
+
exports.listKindOf = listKindOf;
|
|
96
127
|
exports.mintOdfListNumId = mintOdfListNumId;
|
|
128
|
+
exports.planListMembership = planListMembership;
|
|
97
129
|
exports.readOdfListParagraphs = readOdfListParagraphs;
|
|
98
130
|
exports.resolveOdfListKind = resolveOdfListKind;
|
|
99
131
|
exports.writeOdfList = writeOdfList;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { OdfListEntry, OdfListIdState, OdfListParagraphReader, buildOdfListStyle, mintOdfListNumId, readOdfListParagraphs, resolveOdfListKind, writeOdfList };
|
|
1
|
+
import { a as OdfListParagraphReader, c as closeListPlan, d as planListMembership, f as readOdfListParagraphs, i as OdfListIdState, l as listKindOf, m as writeOdfList, n as NO_NUM_ID_KEY, o as buildOdfListStyle, p as resolveOdfListKind, r as OdfListEntry, s as canonicalNumId, t as ListPlanState, u as mintOdfListNumId } from "../../list-BorrTJBY.cjs";
|
|
2
|
+
export { ListPlanState, NO_NUM_ID_KEY, OdfListEntry, OdfListIdState, OdfListParagraphReader, buildOdfListStyle, canonicalNumId, closeListPlan, listKindOf, mintOdfListNumId, planListMembership, readOdfListParagraphs, resolveOdfListKind, writeOdfList };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { OdfListEntry, OdfListIdState, OdfListParagraphReader, buildOdfListStyle, mintOdfListNumId, readOdfListParagraphs, resolveOdfListKind, writeOdfList };
|
|
1
|
+
import { a as OdfListParagraphReader, c as closeListPlan, d as planListMembership, f as readOdfListParagraphs, i as OdfListIdState, l as listKindOf, m as writeOdfList, n as NO_NUM_ID_KEY, o as buildOdfListStyle, p as resolveOdfListKind, r as OdfListEntry, s as canonicalNumId, t as ListPlanState, u as mintOdfListNumId } from "../../list-7FO0SDqZ.js";
|
|
2
|
+
export { ListPlanState, NO_NUM_ID_KEY, OdfListEntry, OdfListIdState, OdfListParagraphReader, buildOdfListStyle, canonicalNumId, closeListPlan, listKindOf, mintOdfListNumId, planListMembership, readOdfListParagraphs, resolveOdfListKind, writeOdfList };
|
|
@@ -72,6 +72,33 @@ function writeOdfList(entries, styleName) {
|
|
|
72
72
|
}
|
|
73
73
|
return root;
|
|
74
74
|
}
|
|
75
|
+
function listKindOf(numId) {
|
|
76
|
+
if (numId === void 0) return;
|
|
77
|
+
if (numId.startsWith("ordered:")) return "ordered";
|
|
78
|
+
return numId.startsWith("bullet:") ? "bullet" : void 0;
|
|
79
|
+
}
|
|
80
|
+
const NO_NUM_ID_KEY = "\0";
|
|
81
|
+
function canonicalNumId(incoming, ordinal) {
|
|
82
|
+
const kind = listKindOf(incoming);
|
|
83
|
+
return kind === void 0 ? `list${ordinal}` : `${kind}:list${ordinal}`;
|
|
84
|
+
}
|
|
85
|
+
function planListMembership(membership, listState) {
|
|
86
|
+
if (membership === void 0) {
|
|
87
|
+
closeListPlan(listState);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const incomingKey = membership.numId ?? "\0";
|
|
91
|
+
if (listState.openNumId !== incomingKey) {
|
|
92
|
+
listState.openNumId = incomingKey;
|
|
93
|
+
listState.openCanonicalNumId = canonicalNumId(membership.numId, listState.next);
|
|
94
|
+
listState.next += 1;
|
|
95
|
+
}
|
|
96
|
+
return listState.openCanonicalNumId;
|
|
97
|
+
}
|
|
98
|
+
function closeListPlan(listState) {
|
|
99
|
+
listState.openNumId = void 0;
|
|
100
|
+
listState.openCanonicalNumId = void 0;
|
|
101
|
+
}
|
|
75
102
|
function readOdfListParagraphs(listElement, membership, readParagraph) {
|
|
76
103
|
const paragraphs = [];
|
|
77
104
|
for (const item of listElement.children) {
|
|
@@ -91,4 +118,4 @@ function readOdfListParagraphs(listElement, membership, readParagraph) {
|
|
|
91
118
|
return paragraphs;
|
|
92
119
|
}
|
|
93
120
|
//#endregion
|
|
94
|
-
export { buildOdfListStyle, mintOdfListNumId, readOdfListParagraphs, resolveOdfListKind, writeOdfList };
|
|
121
|
+
export { NO_NUM_ID_KEY, buildOdfListStyle, canonicalNumId, closeListPlan, listKindOf, mintOdfListNumId, planListMembership, readOdfListParagraphs, resolveOdfListKind, writeOdfList };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readOdfConstructBodyBlocks, c as segmentOdfParagraphRuns, i as odfRunProperties, l as writeOdfParagraph, n as OdfParagraphWriteOptions, o as readOdfParagraph, r as odfParagraphProperties, s as readParagraphOrHeading, t as OdfParagraphContext } from "../../paragraph-
|
|
1
|
+
import { a as readOdfConstructBodyBlocks, c as segmentOdfParagraphRuns, i as odfRunProperties, l as writeOdfParagraph, n as OdfParagraphWriteOptions, o as readOdfParagraph, r as odfParagraphProperties, s as readParagraphOrHeading, t as OdfParagraphContext } from "../../paragraph-Bf6Iq5wC.cjs";
|
|
2
2
|
export { OdfParagraphContext, OdfParagraphWriteOptions, odfParagraphProperties, odfRunProperties, readOdfConstructBodyBlocks, readOdfParagraph, readParagraphOrHeading, segmentOdfParagraphRuns, writeOdfParagraph };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readOdfConstructBodyBlocks, c as segmentOdfParagraphRuns, i as odfRunProperties, l as writeOdfParagraph, n as OdfParagraphWriteOptions, o as readOdfParagraph, r as odfParagraphProperties, s as readParagraphOrHeading, t as OdfParagraphContext } from "../../paragraph-
|
|
1
|
+
import { a as readOdfConstructBodyBlocks, c as segmentOdfParagraphRuns, i as odfRunProperties, l as writeOdfParagraph, n as OdfParagraphWriteOptions, o as readOdfParagraph, r as odfParagraphProperties, s as readParagraphOrHeading, t as OdfParagraphContext } from "../../paragraph-DtC86tft.js";
|
|
2
2
|
export { OdfParagraphContext, OdfParagraphWriteOptions, odfParagraphProperties, odfRunProperties, readOdfConstructBodyBlocks, readOdfParagraph, readParagraphOrHeading, segmentOdfParagraphRuns, writeOdfParagraph };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_typed_shared_units = require("./units.cjs");
|
|
2
3
|
//#region src/typed/shared/path.ts
|
|
3
4
|
const VIEW_BOX_PATTERN = /^(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)$/;
|
|
4
5
|
function parseOdfViewBox(value) {
|
|
@@ -252,8 +253,26 @@ function buildOdfSubpaths(rawSubpaths, viewBox, frame) {
|
|
|
252
253
|
})
|
|
253
254
|
}));
|
|
254
255
|
}
|
|
256
|
+
function formatOdfViewBox(frame) {
|
|
257
|
+
return `0 0 ${require_typed_shared_units.formatOdfNumber(frame.widthPt)} ${require_typed_shared_units.formatOdfNumber(frame.heightPt)}`;
|
|
258
|
+
}
|
|
259
|
+
function formatPoint(point) {
|
|
260
|
+
return `${require_typed_shared_units.formatOdfNumber(point.xPt)},${require_typed_shared_units.formatOdfNumber(point.yPt)}`;
|
|
261
|
+
}
|
|
262
|
+
function formatOdfPathData(subpaths) {
|
|
263
|
+
const parts = [];
|
|
264
|
+
for (const subpath of subpaths) {
|
|
265
|
+
parts.push(`M ${formatPoint(subpath.start)}`);
|
|
266
|
+
for (const segment of subpath.segments) if (segment.kind === "line") parts.push(`L ${formatPoint(segment.to)}`);
|
|
267
|
+
else parts.push(`C ${formatPoint(segment.control1)} ${formatPoint(segment.control2)} ${formatPoint(segment.to)}`);
|
|
268
|
+
if (subpath.closed) parts.push("Z");
|
|
269
|
+
}
|
|
270
|
+
return parts.join(" ");
|
|
271
|
+
}
|
|
255
272
|
//#endregion
|
|
256
273
|
exports.buildOdfSubpaths = buildOdfSubpaths;
|
|
274
|
+
exports.formatOdfPathData = formatOdfPathData;
|
|
275
|
+
exports.formatOdfViewBox = formatOdfViewBox;
|
|
257
276
|
exports.parseOdfPathData = parseOdfPathData;
|
|
258
277
|
exports.parseOdfPointsList = parseOdfPointsList;
|
|
259
278
|
exports.parseOdfViewBox = parseOdfViewBox;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as buildOdfSubpaths, c as
|
|
2
|
-
export { OdfRawPoint, OdfRawSegment, OdfRawSubpath, OdfViewBox, buildOdfSubpaths, parseOdfPathData, parseOdfPointsList, parseOdfViewBox, rawSubpathFromPoints, scaleOdfRawPoint };
|
|
1
|
+
import { a as buildOdfSubpaths, c as parseOdfPathData, d as rawSubpathFromPoints, f as scaleOdfRawPoint, i as OdfViewBox, l as parseOdfPointsList, n as OdfRawSegment, o as formatOdfPathData, r as OdfRawSubpath, s as formatOdfViewBox, t as OdfRawPoint, u as parseOdfViewBox } from "../../path-8HQS-J7y.cjs";
|
|
2
|
+
export { OdfRawPoint, OdfRawSegment, OdfRawSubpath, OdfViewBox, buildOdfSubpaths, formatOdfPathData, formatOdfViewBox, parseOdfPathData, parseOdfPointsList, parseOdfViewBox, rawSubpathFromPoints, scaleOdfRawPoint };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as buildOdfSubpaths, c as
|
|
2
|
-
export { OdfRawPoint, OdfRawSegment, OdfRawSubpath, OdfViewBox, buildOdfSubpaths, parseOdfPathData, parseOdfPointsList, parseOdfViewBox, rawSubpathFromPoints, scaleOdfRawPoint };
|
|
1
|
+
import { a as buildOdfSubpaths, c as parseOdfPathData, d as rawSubpathFromPoints, f as scaleOdfRawPoint, i as OdfViewBox, l as parseOdfPointsList, n as OdfRawSegment, o as formatOdfPathData, r as OdfRawSubpath, s as formatOdfViewBox, t as OdfRawPoint, u as parseOdfViewBox } from "../../path-8HQS-J7y.js";
|
|
2
|
+
export { OdfRawPoint, OdfRawSegment, OdfRawSubpath, OdfViewBox, buildOdfSubpaths, formatOdfPathData, formatOdfViewBox, parseOdfPathData, parseOdfPointsList, parseOdfViewBox, rawSubpathFromPoints, scaleOdfRawPoint };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formatOdfNumber } from "./units.js";
|
|
1
2
|
//#region src/typed/shared/path.ts
|
|
2
3
|
const VIEW_BOX_PATTERN = /^(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)$/;
|
|
3
4
|
function parseOdfViewBox(value) {
|
|
@@ -251,5 +252,21 @@ function buildOdfSubpaths(rawSubpaths, viewBox, frame) {
|
|
|
251
252
|
})
|
|
252
253
|
}));
|
|
253
254
|
}
|
|
255
|
+
function formatOdfViewBox(frame) {
|
|
256
|
+
return `0 0 ${formatOdfNumber(frame.widthPt)} ${formatOdfNumber(frame.heightPt)}`;
|
|
257
|
+
}
|
|
258
|
+
function formatPoint(point) {
|
|
259
|
+
return `${formatOdfNumber(point.xPt)},${formatOdfNumber(point.yPt)}`;
|
|
260
|
+
}
|
|
261
|
+
function formatOdfPathData(subpaths) {
|
|
262
|
+
const parts = [];
|
|
263
|
+
for (const subpath of subpaths) {
|
|
264
|
+
parts.push(`M ${formatPoint(subpath.start)}`);
|
|
265
|
+
for (const segment of subpath.segments) if (segment.kind === "line") parts.push(`L ${formatPoint(segment.to)}`);
|
|
266
|
+
else parts.push(`C ${formatPoint(segment.control1)} ${formatPoint(segment.control2)} ${formatPoint(segment.to)}`);
|
|
267
|
+
if (subpath.closed) parts.push("Z");
|
|
268
|
+
}
|
|
269
|
+
return parts.join(" ");
|
|
270
|
+
}
|
|
254
271
|
//#endregion
|
|
255
|
-
export { buildOdfSubpaths, parseOdfPathData, parseOdfPointsList, parseOdfViewBox, rawSubpathFromPoints, scaleOdfRawPoint };
|
|
272
|
+
export { buildOdfSubpaths, formatOdfPathData, formatOdfViewBox, parseOdfPathData, parseOdfPointsList, parseOdfViewBox, rawSubpathFromPoints, scaleOdfRawPoint };
|
|
@@ -252,6 +252,9 @@ function readOdfTable(tableElement, pkg) {
|
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
254
|
//#endregion
|
|
255
|
+
exports.BORDER_EDGE_ATTRS = BORDER_EDGE_ATTRS;
|
|
256
|
+
exports.BORDER_EDGE_KEYS = BORDER_EDGE_KEYS;
|
|
257
|
+
exports.formatBorderEdge = formatBorderEdge;
|
|
255
258
|
exports.readCellStyleDecoration = readCellStyleDecoration;
|
|
256
259
|
exports.readOdfTable = readOdfTable;
|
|
257
260
|
exports.writeOdfTable = writeOdfTable;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { CellStyleDecoration, readCellStyleDecoration, readOdfTable, writeOdfTable };
|
|
1
|
+
import { a as formatBorderEdge, c as writeOdfTable, i as CellStyleDecoration, n as BORDER_EDGE_KEYS, o as readCellStyleDecoration, r as BorderEdgeKey, s as readOdfTable, t as BORDER_EDGE_ATTRS } from "../../table-CECMtPxZ.cjs";
|
|
2
|
+
export { BORDER_EDGE_ATTRS, BORDER_EDGE_KEYS, BorderEdgeKey, CellStyleDecoration, formatBorderEdge, readCellStyleDecoration, readOdfTable, writeOdfTable };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { CellStyleDecoration, readCellStyleDecoration, readOdfTable, writeOdfTable };
|
|
1
|
+
import { a as formatBorderEdge, c as writeOdfTable, i as CellStyleDecoration, n as BORDER_EDGE_KEYS, o as readCellStyleDecoration, r as BorderEdgeKey, s as readOdfTable, t as BORDER_EDGE_ATTRS } from "../../table-XuniPr2I.js";
|
|
2
|
+
export { BORDER_EDGE_ATTRS, BORDER_EDGE_KEYS, BorderEdgeKey, CellStyleDecoration, formatBorderEdge, readCellStyleDecoration, readOdfTable, writeOdfTable };
|
|
@@ -251,4 +251,4 @@ function readOdfTable(tableElement, pkg) {
|
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
|
-
export { readCellStyleDecoration, readOdfTable, writeOdfTable };
|
|
254
|
+
export { BORDER_EDGE_ATTRS, BORDER_EDGE_KEYS, formatBorderEdge, readCellStyleDecoration, readOdfTable, writeOdfTable };
|
|
@@ -27,9 +27,24 @@ function parseOdfLength(value) {
|
|
|
27
27
|
if (numeric === void 0 || unit === void 0 || !isLengthUnit(unit)) return;
|
|
28
28
|
return Number(numeric) * unitToPtFactor(unit);
|
|
29
29
|
}
|
|
30
|
+
function expandExponential(text) {
|
|
31
|
+
const match = /^(-?)(\d+)(?:\.(\d+))?[eE]([+-]?\d+)$/.exec(text);
|
|
32
|
+
if (match === null) return text;
|
|
33
|
+
const [, sign, integerDigits, fractionDigits, exponent] = match;
|
|
34
|
+
if (sign === void 0 || integerDigits === void 0 || exponent === void 0) return text;
|
|
35
|
+
const digits = `${integerDigits}${fractionDigits ?? ""}`;
|
|
36
|
+
const pointIndex = integerDigits.length + Number(exponent);
|
|
37
|
+
if (pointIndex <= 0) return `${sign}0.${"0".repeat(-pointIndex)}${digits}`;
|
|
38
|
+
if (pointIndex >= digits.length) return `${sign}${digits}${"0".repeat(pointIndex - digits.length)}`;
|
|
39
|
+
return `${sign}${digits.slice(0, pointIndex)}.${digits.slice(pointIndex)}`;
|
|
40
|
+
}
|
|
41
|
+
function formatOdfNumber(value) {
|
|
42
|
+
return expandExponential(`${value}`);
|
|
43
|
+
}
|
|
30
44
|
function formatOdfLength(pt, unit = "pt") {
|
|
31
|
-
return `${pt / unitToPtFactor(unit)}${unit}`;
|
|
45
|
+
return `${formatOdfNumber(pt / unitToPtFactor(unit))}${unit}`;
|
|
32
46
|
}
|
|
33
47
|
//#endregion
|
|
34
48
|
exports.formatOdfLength = formatOdfLength;
|
|
49
|
+
exports.formatOdfNumber = formatOdfNumber;
|
|
35
50
|
exports.parseOdfLength = parseOdfLength;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as formatOdfLength, r as
|
|
2
|
-
export { LengthUnit, formatOdfLength, parseOdfLength };
|
|
1
|
+
import { i as parseOdfLength, n as formatOdfLength, r as formatOdfNumber, t as LengthUnit } from "../../units-DdyaQolR.cjs";
|
|
2
|
+
export { LengthUnit, formatOdfLength, formatOdfNumber, parseOdfLength };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as formatOdfLength, r as
|
|
2
|
-
export { LengthUnit, formatOdfLength, parseOdfLength };
|
|
1
|
+
import { i as parseOdfLength, n as formatOdfLength, r as formatOdfNumber, t as LengthUnit } from "../../units-DdyaQolR.js";
|
|
2
|
+
export { LengthUnit, formatOdfLength, formatOdfNumber, parseOdfLength };
|
|
@@ -26,8 +26,22 @@ function parseOdfLength(value) {
|
|
|
26
26
|
if (numeric === void 0 || unit === void 0 || !isLengthUnit(unit)) return;
|
|
27
27
|
return Number(numeric) * unitToPtFactor(unit);
|
|
28
28
|
}
|
|
29
|
+
function expandExponential(text) {
|
|
30
|
+
const match = /^(-?)(\d+)(?:\.(\d+))?[eE]([+-]?\d+)$/.exec(text);
|
|
31
|
+
if (match === null) return text;
|
|
32
|
+
const [, sign, integerDigits, fractionDigits, exponent] = match;
|
|
33
|
+
if (sign === void 0 || integerDigits === void 0 || exponent === void 0) return text;
|
|
34
|
+
const digits = `${integerDigits}${fractionDigits ?? ""}`;
|
|
35
|
+
const pointIndex = integerDigits.length + Number(exponent);
|
|
36
|
+
if (pointIndex <= 0) return `${sign}0.${"0".repeat(-pointIndex)}${digits}`;
|
|
37
|
+
if (pointIndex >= digits.length) return `${sign}${digits}${"0".repeat(pointIndex - digits.length)}`;
|
|
38
|
+
return `${sign}${digits.slice(0, pointIndex)}.${digits.slice(pointIndex)}`;
|
|
39
|
+
}
|
|
40
|
+
function formatOdfNumber(value) {
|
|
41
|
+
return expandExponential(`${value}`);
|
|
42
|
+
}
|
|
29
43
|
function formatOdfLength(pt, unit = "pt") {
|
|
30
|
-
return `${pt / unitToPtFactor(unit)}${unit}`;
|
|
44
|
+
return `${formatOdfNumber(pt / unitToPtFactor(unit))}${unit}`;
|
|
31
45
|
}
|
|
32
46
|
//#endregion
|
|
33
|
-
export { formatOdfLength, parseOdfLength };
|
|
47
|
+
export { formatOdfLength, formatOdfNumber, parseOdfLength };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/typed/shared/units.d.ts
|
|
2
2
|
type LengthUnit = "cm" | "mm" | "in" | "pt" | "pc" | "px";
|
|
3
3
|
declare function parseOdfLength(value: string): number | undefined;
|
|
4
|
+
declare function formatOdfNumber(value: number): string;
|
|
4
5
|
declare function formatOdfLength(pt: number, unit?: LengthUnit): string;
|
|
5
6
|
//#endregion
|
|
6
|
-
export { formatOdfLength as n,
|
|
7
|
+
export { parseOdfLength as i, formatOdfLength as n, formatOdfNumber as r, LengthUnit as t };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/typed/shared/units.d.ts
|
|
2
2
|
type LengthUnit = "cm" | "mm" | "in" | "pt" | "pc" | "px";
|
|
3
3
|
declare function parseOdfLength(value: string): number | undefined;
|
|
4
|
+
declare function formatOdfNumber(value: number): string;
|
|
4
5
|
declare function formatOdfLength(pt: number, unit?: LengthUnit): string;
|
|
5
6
|
//#endregion
|
|
6
|
-
export { formatOdfLength as n,
|
|
7
|
+
export { parseOdfLength as i, formatOdfLength as n, formatOdfNumber as r, LengthUnit as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { r as Package } from "./package-otZYrxiO.js";
|
|
2
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
3
|
+
//#region src/typed/odg/write.d.ts
|
|
4
|
+
interface OdgWriteOptions {
|
|
5
|
+
readonly version?: string;
|
|
6
|
+
readonly template?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function normaliseOdgContent(document: ContentDocument): Extract<ContentDocument, {
|
|
9
|
+
kind: "drawing";
|
|
10
|
+
}>;
|
|
11
|
+
declare function writeOdgContent(document: ContentDocument, options?: OdgWriteOptions): Package;
|
|
12
|
+
declare function writeOdg(document: DocumentTree, options?: OdgWriteOptions): Package;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { writeOdgContent as i, normaliseOdgContent as n, writeOdg as r, OdgWriteOptions as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { r as Package } from "./package-DMk9fuTI.cjs";
|
|
2
|
+
import { t as OdpWriteOptions } from "./write-BhG3t3fJ.cjs";
|
|
3
|
+
import { t as OdtWriteOptions } from "./write-CPATqG4v.cjs";
|
|
4
|
+
import { t as OdgWriteOptions } from "./write-C2c4xBXs.cjs";
|
|
5
|
+
import { t as OdsWriteOptions } from "./write-BuLQmwLD.cjs";
|
|
6
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
7
|
+
//#region src/ooo1/write.d.ts
|
|
8
|
+
declare function writeSxw(document: DocumentTree, options?: OdtWriteOptions): Package;
|
|
9
|
+
declare function writeSxwContent(document: ContentDocument, options?: OdtWriteOptions): Package;
|
|
10
|
+
declare function writeSxc(document: DocumentTree, options?: OdsWriteOptions): Package;
|
|
11
|
+
declare function writeSxcContent(document: ContentDocument, options?: OdsWriteOptions): Package;
|
|
12
|
+
declare function writeSxi(document: DocumentTree, options?: OdpWriteOptions): Package;
|
|
13
|
+
declare function writeSxiContent(document: ContentDocument, options?: OdpWriteOptions): Package;
|
|
14
|
+
declare function writeSxd(document: DocumentTree, options?: OdgWriteOptions): Package;
|
|
15
|
+
declare function writeSxdContent(document: ContentDocument, options?: OdgWriteOptions): Package;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { writeSxi as a, writeSxwContent as c, writeSxdContent as i, writeSxcContent as n, writeSxiContent as o, writeSxd as r, writeSxw as s, writeSxc as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { r as Package } from "./package-DMk9fuTI.cjs";
|
|
2
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
3
|
+
//#region src/typed/odp/write.d.ts
|
|
4
|
+
interface OdpWriteOptions {
|
|
5
|
+
readonly version?: string;
|
|
6
|
+
readonly template?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function normaliseOdpContent(document: ContentDocument): Extract<ContentDocument, {
|
|
9
|
+
kind: "presentation";
|
|
10
|
+
}>;
|
|
11
|
+
declare function writeOdpContent(document: ContentDocument, options?: OdpWriteOptions): Package;
|
|
12
|
+
declare function writeOdp(document: DocumentTree, options?: OdpWriteOptions): Package;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { writeOdpContent as i, normaliseOdpContent as n, writeOdp as r, OdpWriteOptions as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { r as Package } from "./package-DMk9fuTI.cjs";
|
|
2
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
3
|
+
//#region src/typed/ods/write.d.ts
|
|
4
|
+
interface OdsWriteOptions {
|
|
5
|
+
readonly version?: string;
|
|
6
|
+
readonly template?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function normaliseOdsContent(document: ContentDocument): Extract<ContentDocument, {
|
|
9
|
+
kind: "spreadsheet";
|
|
10
|
+
}>;
|
|
11
|
+
declare function writeOdsContent(document: ContentDocument, options?: OdsWriteOptions): Package;
|
|
12
|
+
declare function writeOds(document: DocumentTree, options?: OdsWriteOptions): Package;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { writeOdsContent as i, normaliseOdsContent as n, writeOds as r, OdsWriteOptions as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { r as Package } from "./package-DMk9fuTI.cjs";
|
|
2
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
3
|
+
//#region src/typed/odg/write.d.ts
|
|
4
|
+
interface OdgWriteOptions {
|
|
5
|
+
readonly version?: string;
|
|
6
|
+
readonly template?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function normaliseOdgContent(document: ContentDocument): Extract<ContentDocument, {
|
|
9
|
+
kind: "drawing";
|
|
10
|
+
}>;
|
|
11
|
+
declare function writeOdgContent(document: ContentDocument, options?: OdgWriteOptions): Package;
|
|
12
|
+
declare function writeOdg(document: DocumentTree, options?: OdgWriteOptions): Package;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { writeOdgContent as i, normaliseOdgContent as n, writeOdg as r, OdgWriteOptions as t };
|
|
@@ -3,6 +3,7 @@ import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
|
3
3
|
//#region src/typed/odt/write.d.ts
|
|
4
4
|
interface OdtWriteOptions {
|
|
5
5
|
readonly version?: string;
|
|
6
|
+
readonly template?: boolean;
|
|
6
7
|
}
|
|
7
8
|
declare function normaliseOdtContent(document: ContentDocument): Extract<ContentDocument, {
|
|
8
9
|
kind: "wordprocessing";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { r as Package } from "./package-otZYrxiO.js";
|
|
2
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
3
|
+
//#region src/typed/odp/write.d.ts
|
|
4
|
+
interface OdpWriteOptions {
|
|
5
|
+
readonly version?: string;
|
|
6
|
+
readonly template?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function normaliseOdpContent(document: ContentDocument): Extract<ContentDocument, {
|
|
9
|
+
kind: "presentation";
|
|
10
|
+
}>;
|
|
11
|
+
declare function writeOdpContent(document: ContentDocument, options?: OdpWriteOptions): Package;
|
|
12
|
+
declare function writeOdp(document: DocumentTree, options?: OdpWriteOptions): Package;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { writeOdpContent as i, normaliseOdpContent as n, writeOdp as r, OdpWriteOptions as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { r as Package } from "./package-otZYrxiO.js";
|
|
2
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
3
|
+
//#region src/typed/ods/write.d.ts
|
|
4
|
+
interface OdsWriteOptions {
|
|
5
|
+
readonly version?: string;
|
|
6
|
+
readonly template?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function normaliseOdsContent(document: ContentDocument): Extract<ContentDocument, {
|
|
9
|
+
kind: "spreadsheet";
|
|
10
|
+
}>;
|
|
11
|
+
declare function writeOdsContent(document: ContentDocument, options?: OdsWriteOptions): Package;
|
|
12
|
+
declare function writeOds(document: DocumentTree, options?: OdsWriteOptions): Package;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { writeOdsContent as i, normaliseOdsContent as n, writeOds as r, OdsWriteOptions as t };
|
|
@@ -3,6 +3,7 @@ import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
|
3
3
|
//#region src/typed/odt/write.d.ts
|
|
4
4
|
interface OdtWriteOptions {
|
|
5
5
|
readonly version?: string;
|
|
6
|
+
readonly template?: boolean;
|
|
6
7
|
}
|
|
7
8
|
declare function normaliseOdtContent(document: ContentDocument): Extract<ContentDocument, {
|
|
8
9
|
kind: "wordprocessing";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { r as Package } from "./package-otZYrxiO.js";
|
|
2
|
+
import { t as OdpWriteOptions } from "./write-CfTE2jY8.js";
|
|
3
|
+
import { t as OdtWriteOptions } from "./write-JERychL3.js";
|
|
4
|
+
import { t as OdgWriteOptions } from "./write-4kMi-asu.js";
|
|
5
|
+
import { t as OdsWriteOptions } from "./write-DttX1rTC.js";
|
|
6
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
7
|
+
//#region src/ooo1/write.d.ts
|
|
8
|
+
declare function writeSxw(document: DocumentTree, options?: OdtWriteOptions): Package;
|
|
9
|
+
declare function writeSxwContent(document: ContentDocument, options?: OdtWriteOptions): Package;
|
|
10
|
+
declare function writeSxc(document: DocumentTree, options?: OdsWriteOptions): Package;
|
|
11
|
+
declare function writeSxcContent(document: ContentDocument, options?: OdsWriteOptions): Package;
|
|
12
|
+
declare function writeSxi(document: DocumentTree, options?: OdpWriteOptions): Package;
|
|
13
|
+
declare function writeSxiContent(document: ContentDocument, options?: OdpWriteOptions): Package;
|
|
14
|
+
declare function writeSxd(document: DocumentTree, options?: OdgWriteOptions): Package;
|
|
15
|
+
declare function writeSxdContent(document: ContentDocument, options?: OdgWriteOptions): Package;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { writeSxi as a, writeSxwContent as c, writeSxdContent as i, writeSxcContent as n, writeSxiContent as o, writeSxd as r, writeSxw as s, writeSxc as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { l as XmlElement } from "./node-B6JX5CRX.js";
|
|
2
|
+
import { r as Package } from "./package-otZYrxiO.js";
|
|
3
|
+
import { a as StyleRegistry } from "./registry-C_16-N6i.js";
|
|
4
|
+
import { t as ListPlanState } from "./list-7FO0SDqZ.js";
|
|
5
|
+
import { Box, ContentBlock, ContentImageBlock, ContentParagraph, ContentShape, ContentTable } from "document-schema.js";
|
|
6
|
+
//#region src/typed/draw/write-shapes.d.ts
|
|
7
|
+
type ShapeContentPlan = {
|
|
8
|
+
readonly kind: "text";
|
|
9
|
+
readonly paragraphs: readonly ContentParagraph[];
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: "table";
|
|
12
|
+
readonly table: ContentTable;
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: "image";
|
|
15
|
+
readonly image: ContentImageBlock;
|
|
16
|
+
};
|
|
17
|
+
declare function planShapeContent(blocks: readonly ContentBlock[], listState: ListPlanState): ShapeContentPlan;
|
|
18
|
+
interface DrawShapeWriteState {
|
|
19
|
+
readonly pkg: Package;
|
|
20
|
+
readonly registry: StyleRegistry;
|
|
21
|
+
readonly contentAutomaticStyles: XmlElement;
|
|
22
|
+
nextImage: number;
|
|
23
|
+
nextTable: number;
|
|
24
|
+
nextListStyle: number;
|
|
25
|
+
readonly listStyleByKind: Map<"ordered" | "bullet", string>;
|
|
26
|
+
}
|
|
27
|
+
declare function createDrawShapeWriteState(pkg: Package, registry: StyleRegistry, contentAutomaticStyles: XmlElement): DrawShapeWriteState;
|
|
28
|
+
declare function frameGeometryAttrs(frame: Box, rotationDeg: number | undefined): Record<string, string>;
|
|
29
|
+
declare function odfZIndexOf(paintOrder: number | undefined): number | undefined;
|
|
30
|
+
declare function writeDrawFrame(shape: ContentShape, listState: ListPlanState, state: DrawShapeWriteState, documentIndex: number): XmlElement;
|
|
31
|
+
declare function canonicalDrawShape(shape: ContentShape, documentIndex: number, listState: ListPlanState): ContentShape & {
|
|
32
|
+
paintOrder: number;
|
|
33
|
+
};
|
|
34
|
+
declare function writeDrawShapes(shapes: readonly ContentShape[], listState: ListPlanState, state: DrawShapeWriteState): XmlElement[];
|
|
35
|
+
//#endregion
|
|
36
|
+
export { frameGeometryAttrs as a, writeDrawFrame as c, createDrawShapeWriteState as i, writeDrawShapes as l, ShapeContentPlan as n, odfZIndexOf as o, canonicalDrawShape as r, planShapeContent as s, DrawShapeWriteState as t };
|