documents.js 1.61.0 → 1.63.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 +120 -47
- package/dist/{blr-types-CYYC3yYU.d.cts → blr-types-DVgO1DQ9.d.cts} +1 -1
- package/dist/{blr-types-CYYC3yYU.d.ts → blr-types-DVgO1DQ9.d.ts} +1 -1
- package/dist/convert/capability.cjs +1 -0
- package/dist/convert/capability.d.cts +1 -1
- package/dist/convert/capability.d.ts +1 -1
- package/dist/convert/capability.js +1 -0
- package/dist/convert/convert.cjs +92 -38
- package/dist/convert/convert.d.cts +11 -4
- package/dist/convert/convert.d.ts +11 -4
- package/dist/convert/convert.js +93 -39
- package/dist/convert/local.cjs +15 -2
- package/dist/convert/local.js +15 -2
- package/dist/convert/port.d.cts +8 -4
- package/dist/convert/port.d.ts +8 -4
- package/dist/edit/docx/content.cjs +75 -13
- package/dist/edit/docx/content.d.cts +8 -2
- package/dist/edit/docx/content.d.ts +8 -2
- package/dist/edit/docx/content.js +75 -13
- package/dist/edit/docx/paragraph.cjs +14 -0
- package/dist/edit/docx/paragraph.d.cts +5 -0
- package/dist/edit/docx/paragraph.d.ts +5 -0
- package/dist/edit/docx/paragraph.js +14 -0
- package/dist/edit/docx/run.cjs +1 -1
- package/dist/edit/docx/run.js +1 -1
- package/dist/edit/docx/table.cjs +41 -0
- package/dist/edit/docx/table.d.cts +7 -1
- package/dist/edit/docx/table.d.ts +7 -1
- package/dist/edit/docx/table.js +42 -1
- package/dist/edit/geometry.cjs +38 -0
- package/dist/edit/geometry.d.cts +7 -0
- package/dist/edit/geometry.d.ts +7 -0
- package/dist/edit/geometry.js +36 -0
- package/dist/edit/odg/content.cjs +15 -12
- package/dist/edit/odg/content.js +15 -12
- package/dist/edit/odg/editor.d.cts +1 -1
- package/dist/edit/odg/editor.d.ts +1 -1
- package/dist/edit/odg/page.d.cts +3 -3
- package/dist/edit/odg/page.d.ts +3 -3
- package/dist/edit/odg/vector.cjs +22 -13
- package/dist/edit/odg/vector.d.cts +1 -1
- package/dist/edit/odg/vector.d.ts +1 -1
- package/dist/edit/odg/vector.js +23 -14
- package/dist/edit/odp/content.cjs +15 -0
- package/dist/edit/odp/content.js +16 -1
- package/dist/edit/odp/editor.d.cts +1 -1
- package/dist/edit/odp/editor.d.ts +1 -1
- package/dist/edit/odp/image.d.cts +1 -1
- package/dist/edit/odp/image.d.ts +1 -1
- package/dist/edit/odp/shape.cjs +11 -30
- package/dist/edit/odp/shape.d.cts +2 -2
- package/dist/edit/odp/shape.d.ts +2 -2
- package/dist/edit/odp/shape.js +13 -33
- package/dist/edit/odp/slide.cjs +11 -0
- package/dist/edit/odp/slide.d.cts +14 -4
- package/dist/edit/odp/slide.d.ts +14 -4
- package/dist/edit/odp/slide.js +12 -1
- package/dist/edit/odt/content.cjs +56 -16
- package/dist/edit/odt/content.d.cts +4 -2
- package/dist/edit/odt/content.d.ts +4 -2
- package/dist/edit/odt/content.js +56 -17
- package/dist/edit/odt/editor.d.cts +1 -1
- package/dist/edit/odt/editor.d.ts +1 -1
- package/dist/edit/odt/table.cjs +36 -0
- package/dist/edit/odt/table.d.cts +1 -36
- package/dist/edit/odt/table.d.ts +1 -36
- package/dist/edit/odt/table.js +37 -1
- package/dist/edit/pptx/content.cjs +71 -3
- package/dist/edit/pptx/content.js +71 -3
- package/dist/edit/pptx/editor.d.cts +1 -1
- package/dist/edit/pptx/editor.d.ts +1 -1
- package/dist/edit/pptx/image.d.cts +1 -1
- package/dist/edit/pptx/image.d.ts +1 -1
- package/dist/edit/pptx/shape.cjs +23 -1
- package/dist/edit/pptx/shape.d.cts +2 -2
- package/dist/edit/pptx/shape.d.ts +2 -2
- package/dist/edit/pptx/shape.js +23 -3
- package/dist/edit/pptx/slide.cjs +10 -1
- package/dist/edit/pptx/slide.d.cts +11 -4
- package/dist/edit/pptx/slide.d.ts +11 -4
- package/dist/edit/pptx/slide.js +10 -1
- package/dist/edit/pptx/table.cjs +136 -0
- package/dist/edit/pptx/table.d.cts +2 -0
- package/dist/edit/pptx/table.d.ts +2 -0
- package/dist/edit/pptx/table.js +131 -0
- package/dist/firebird/backup.d.cts +1 -1
- package/dist/firebird/backup.d.ts +1 -1
- package/dist/firebird/blr-types.cjs +2 -2
- package/dist/firebird/blr-types.d.cts +1 -1
- package/dist/firebird/blr-types.d.ts +1 -1
- package/dist/firebird/blr-types.js +2 -2
- package/dist/firebird/data.cjs +68 -14
- package/dist/firebird/data.d.cts +1 -1
- package/dist/firebird/data.d.ts +1 -1
- package/dist/firebird/data.js +68 -14
- package/dist/firebird/schema.cjs +13 -1
- package/dist/firebird/schema.d.cts +1 -1
- package/dist/firebird/schema.d.ts +1 -1
- package/dist/firebird/schema.js +13 -1
- package/dist/fonts/obfuscation.cjs +50 -0
- package/dist/fonts/obfuscation.d.cts +9 -0
- package/dist/fonts/obfuscation.d.ts +9 -0
- package/dist/fonts/obfuscation.js +46 -0
- package/dist/fonts/odf.cjs +86 -0
- package/dist/fonts/odf.d.cts +9 -0
- package/dist/fonts/odf.d.ts +9 -0
- package/dist/fonts/odf.js +84 -0
- package/dist/fonts/ooxml.cjs +129 -0
- package/dist/fonts/ooxml.d.cts +9 -0
- package/dist/fonts/ooxml.d.ts +9 -0
- package/dist/fonts/ooxml.js +127 -0
- package/dist/fonts/registry.cjs +18 -0
- package/dist/fonts/registry.d.cts +2 -0
- package/dist/fonts/registry.d.ts +2 -0
- package/dist/fonts/registry.js +16 -0
- package/dist/{geometry-DvwdrIij.d.cts → geometry-DaJr8yQW.d.cts} +2 -2
- package/dist/{geometry-DvwdrIij.d.ts → geometry-DaJr8yQW.d.ts} +2 -2
- package/dist/hsqldb/binary-script.cjs +154 -0
- package/dist/hsqldb/binary-script.d.cts +15 -0
- package/dist/hsqldb/binary-script.d.ts +15 -0
- package/dist/hsqldb/binary-script.js +151 -0
- package/dist/hsqldb/cache.cjs +18 -11
- package/dist/hsqldb/cache.d.cts +9 -4
- package/dist/hsqldb/cache.d.ts +9 -4
- package/dist/hsqldb/cache.js +18 -11
- package/dist/hsqldb/rowformat.cjs +60 -16
- package/dist/hsqldb/rowformat.d.cts +2 -21
- package/dist/hsqldb/rowformat.d.ts +2 -21
- package/dist/hsqldb/rowformat.js +60 -17
- package/dist/{image-BZDy72Jb.d.cts → image-7snmKIxn.d.cts} +1 -1
- package/dist/{image-B-xQWYYS.d.ts → image-Cs8xF753.d.ts} +1 -1
- package/dist/{image-CeqwL-Qs.d.ts → image-DHcA9kaK.d.ts} +1 -1
- package/dist/{image-DWX6cNOD.d.cts → image-M5SezZVI.d.cts} +1 -1
- package/dist/index.cjs +86 -3
- package/dist/index.d.cts +33 -21
- package/dist/index.d.ts +33 -21
- package/dist/index.js +18 -5
- package/dist/layout/cell-typing.cjs +209 -0
- package/dist/layout/cell-typing.d.cts +22 -0
- package/dist/layout/cell-typing.d.ts +22 -0
- package/dist/layout/cell-typing.js +208 -0
- package/dist/layout/drawing.cjs +193 -17
- package/dist/layout/drawing.js +193 -17
- package/dist/layout/engine.cjs +46 -29
- package/dist/layout/engine.d.cts +0 -2
- package/dist/layout/engine.d.ts +0 -2
- package/dist/layout/engine.js +47 -30
- package/dist/layout/lattice.cjs +139 -0
- package/dist/layout/lattice.d.cts +20 -0
- package/dist/layout/lattice.d.ts +20 -0
- package/dist/layout/lattice.js +135 -0
- package/dist/layout/reconstruct.cjs +176 -113
- package/dist/layout/reconstruct.d.cts +2 -0
- package/dist/layout/reconstruct.d.ts +2 -0
- package/dist/layout/reconstruct.js +173 -110
- package/dist/layout/shared.cjs +52 -0
- package/dist/layout/shared.d.cts +4 -2
- package/dist/layout/shared.d.ts +4 -2
- package/dist/layout/shared.js +51 -1
- package/dist/layout/sheets.cjs +45 -11
- package/dist/layout/sheets.js +46 -12
- package/dist/layout/slides.cjs +7 -7
- package/dist/layout/slides.d.cts +0 -3
- package/dist/layout/slides.d.ts +0 -3
- package/dist/layout/slides.js +7 -7
- package/dist/markdown/write.cjs +19 -6
- package/dist/markdown/write.js +19 -6
- package/dist/mathml/layout.cjs +2 -2
- package/dist/mathml/layout.d.cts +1 -1
- package/dist/mathml/layout.d.ts +1 -1
- package/dist/mathml/layout.js +2 -2
- package/dist/model/embedded-drawing.cjs +32 -0
- package/dist/model/embedded-drawing.d.cts +8 -0
- package/dist/model/embedded-drawing.d.ts +8 -0
- package/dist/model/embedded-drawing.js +30 -0
- package/dist/model/formula.cjs +31 -0
- package/dist/model/formula.d.cts +6 -6
- package/dist/model/formula.d.ts +6 -6
- package/dist/model/formula.js +27 -0
- package/dist/model/geometry.d.cts +1 -1
- package/dist/model/geometry.d.ts +1 -1
- package/dist/model/paint-order.cjs +15 -0
- package/dist/model/paint-order.d.cts +14 -0
- package/dist/model/paint-order.d.ts +14 -0
- package/dist/model/paint-order.js +14 -0
- package/dist/odb/components.cjs +12 -0
- package/dist/odb/components.d.cts +6 -0
- package/dist/odb/components.d.ts +6 -0
- package/dist/odb/components.js +10 -0
- package/dist/odb/read.cjs +11 -7
- package/dist/odb/read.d.cts +3 -2
- package/dist/odb/read.d.ts +3 -2
- package/dist/odb/read.js +11 -7
- package/dist/odf/formula/detect.cjs +86 -18
- package/dist/odf/formula/detect.d.cts +10 -6
- package/dist/odf/formula/detect.d.ts +10 -6
- package/dist/odf/formula/detect.js +86 -19
- package/dist/odf/formula/read.cjs +4 -16
- package/dist/odf/formula/read.d.cts +4 -8
- package/dist/odf/formula/read.d.ts +4 -8
- package/dist/odf/formula/read.js +5 -17
- package/dist/odf/odp/read.cjs +9 -19
- package/dist/odf/odp/read.d.cts +2 -7
- package/dist/odf/odp/read.d.ts +2 -7
- package/dist/odf/odp/read.js +10 -20
- package/dist/odf/odt/read.cjs +63 -23
- package/dist/odf/odt/read.d.cts +2 -7
- package/dist/odf/odt/read.d.ts +2 -7
- package/dist/odf/odt/read.js +64 -24
- package/dist/omml/write.cjs +258 -0
- package/dist/omml/write.d.cts +2 -0
- package/dist/omml/write.d.ts +2 -0
- package/dist/omml/write.js +256 -0
- package/dist/registry-CrSqLIcn.d.ts +19 -0
- package/dist/registry-CtPhMD0f.d.cts +19 -0
- package/dist/rowformat-Cl2exlEh.d.cts +25 -0
- package/dist/rowformat-Cl2exlEh.d.ts +25 -0
- package/dist/{schema-Acco3Ezi.d.cts → schema-BeR_KJ0X.d.cts} +3 -1
- package/dist/{schema-VkAA6pF5.d.ts → schema-CSKwSb_v.d.ts} +3 -1
- package/dist/{shape-BUfjw5eZ.d.cts → shape-BhkP6HB8.d.cts} +6 -2
- package/dist/{shape-CTkl6kt8.d.ts → shape-BkVcwPcf.d.ts} +6 -2
- package/dist/{shape-BfN3m52m.d.ts → shape-CVXedeL7.d.ts} +3 -2
- package/dist/{shape-CN2ycxOo.d.cts → shape-CXZ6fejV.d.cts} +3 -2
- package/dist/table-C3CPZ--2.d.cts +35 -0
- package/dist/table-DjYcNOFm.d.cts +44 -0
- package/dist/table-DqfqMkVq.d.ts +44 -0
- package/dist/table-DvS_7UQS.d.ts +35 -0
- package/dist/{vector-ClohqsOe.d.cts → vector-Puuqu_IT.d.cts} +4 -0
- package/dist/{vector-ClohqsOe.d.ts → vector-Puuqu_IT.d.ts} +4 -0
- package/dist/write-DuyfnbL_.d.cts +16 -0
- package/dist/write-Zqwx6pka.d.ts +16 -0
- package/package.json +4 -4
- package/dist/odf/formula/placeholder.cjs +0 -36
- package/dist/odf/formula/placeholder.d.cts +0 -14
- package/dist/odf/formula/placeholder.d.ts +0 -14
- package/dist/odf/formula/placeholder.js +0 -36
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { el, txt } from "../xml/fragment.js";
|
|
2
|
+
import { parseMathLength } from "../mathml/length.js";
|
|
3
|
+
import { attrValue, elementChildren, elementLocalName, isMathMlElement, textContent } from "../mathml/nodes.js";
|
|
4
|
+
import { operatorProperties } from "../mathml/operators.js";
|
|
5
|
+
import { isMathVariant } from "../mathml/variant.js";
|
|
6
|
+
import { encodeXmlText, needsSpacePreserve } from "../xml/entities.js";
|
|
7
|
+
//#region src/omml/write.ts
|
|
8
|
+
const OMML_NS = "http://schemas.openxmlformats.org/officeDocument/2006/math";
|
|
9
|
+
const VARIANT_RUN_PROPERTIES = {
|
|
10
|
+
normal: { sty: "p" },
|
|
11
|
+
bold: { sty: "b" },
|
|
12
|
+
italic: { sty: "i" },
|
|
13
|
+
"bold-italic": { sty: "bi" },
|
|
14
|
+
"double-struck": {
|
|
15
|
+
scr: "double-struck",
|
|
16
|
+
sty: "p"
|
|
17
|
+
},
|
|
18
|
+
script: {
|
|
19
|
+
scr: "script",
|
|
20
|
+
sty: "p"
|
|
21
|
+
},
|
|
22
|
+
"bold-script": {
|
|
23
|
+
scr: "script",
|
|
24
|
+
sty: "b"
|
|
25
|
+
},
|
|
26
|
+
fraktur: {
|
|
27
|
+
scr: "fraktur",
|
|
28
|
+
sty: "p"
|
|
29
|
+
},
|
|
30
|
+
"bold-fraktur": {
|
|
31
|
+
scr: "fraktur",
|
|
32
|
+
sty: "b"
|
|
33
|
+
},
|
|
34
|
+
"sans-serif": {
|
|
35
|
+
scr: "sans-serif",
|
|
36
|
+
sty: "p"
|
|
37
|
+
},
|
|
38
|
+
"bold-sans-serif": {
|
|
39
|
+
scr: "sans-serif",
|
|
40
|
+
sty: "b"
|
|
41
|
+
},
|
|
42
|
+
"sans-serif-italic": {
|
|
43
|
+
scr: "sans-serif",
|
|
44
|
+
sty: "i"
|
|
45
|
+
},
|
|
46
|
+
"sans-serif-bold-italic": {
|
|
47
|
+
scr: "sans-serif",
|
|
48
|
+
sty: "bi"
|
|
49
|
+
},
|
|
50
|
+
monospace: {
|
|
51
|
+
scr: "monospace",
|
|
52
|
+
sty: "p"
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function columnJustification(align) {
|
|
56
|
+
return align === "left" || align === "right" || align === "center" ? align : "center";
|
|
57
|
+
}
|
|
58
|
+
function diagnose(ctx, kind, element) {
|
|
59
|
+
ctx.diagnostics.push({
|
|
60
|
+
kind,
|
|
61
|
+
detail: elementLocalName(element)
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function mathRun(text, properties) {
|
|
65
|
+
const tAttrs = needsSpacePreserve(text) ? { "xml:space": "preserve" } : {};
|
|
66
|
+
const children = [];
|
|
67
|
+
if (properties !== void 0) children.push(properties);
|
|
68
|
+
children.push(el("m:t", tAttrs, [txt(encodeXmlText(text))]));
|
|
69
|
+
return el("m:r", {}, children);
|
|
70
|
+
}
|
|
71
|
+
function variantRunProperties(variant) {
|
|
72
|
+
const mapped = VARIANT_RUN_PROPERTIES[variant];
|
|
73
|
+
const children = [];
|
|
74
|
+
if (mapped.scr !== void 0) children.push(el("m:scr", { "m:val": mapped.scr }));
|
|
75
|
+
children.push(el("m:sty", { "m:val": mapped.sty }));
|
|
76
|
+
return el("m:rPr", {}, children);
|
|
77
|
+
}
|
|
78
|
+
function miIntrinsicDefault(content) {
|
|
79
|
+
return [...content].length === 1 ? "italic" : "normal";
|
|
80
|
+
}
|
|
81
|
+
function tokenVariant(element, intrinsicDefault, ctx) {
|
|
82
|
+
const attr = attrValue(element, "mathvariant");
|
|
83
|
+
if (attr !== void 0 && isMathVariant(attr)) return attr;
|
|
84
|
+
return ctx.inheritedVariant ?? intrinsicDefault;
|
|
85
|
+
}
|
|
86
|
+
function tokenRun(element, rawText, intrinsicDefault, ctx, normalText) {
|
|
87
|
+
if (rawText.length === 0) return [];
|
|
88
|
+
if (normalText && attrValue(element, "mathvariant") === void 0) return [mathRun(rawText, el("m:rPr", {}, [el("m:nor")]))];
|
|
89
|
+
return [mathRun(rawText, variantRunProperties(tokenVariant(element, intrinsicDefault, ctx)))];
|
|
90
|
+
}
|
|
91
|
+
function argSlot(tag, child, ctx) {
|
|
92
|
+
return el(tag, {}, child === void 0 ? [] : convertElement(child, ctx));
|
|
93
|
+
}
|
|
94
|
+
function argSlotFromChildren(tag, children, ctx) {
|
|
95
|
+
return el(tag, {}, children.flatMap((child) => convertElement(child, ctx)));
|
|
96
|
+
}
|
|
97
|
+
function convertFraction(element, ctx) {
|
|
98
|
+
const children = elementChildren(element);
|
|
99
|
+
const lineThickness = attrValue(element, "linethickness");
|
|
100
|
+
const barless = lineThickness !== void 0 && parseMathLength(lineThickness, 1) === 0;
|
|
101
|
+
const parts = [];
|
|
102
|
+
if (barless) parts.push(el("m:fPr", {}, [el("m:type", { "m:val": "noBar" })]));
|
|
103
|
+
parts.push(argSlot("m:num", children[0], ctx), argSlot("m:den", children[1], ctx));
|
|
104
|
+
return el("m:f", {}, parts);
|
|
105
|
+
}
|
|
106
|
+
function convertRadical(element, kind, ctx) {
|
|
107
|
+
const children = elementChildren(element);
|
|
108
|
+
if (kind === "msqrt") return el("m:rad", {}, [
|
|
109
|
+
el("m:radPr", {}, [el("m:degHide", { "m:val": "1" })]),
|
|
110
|
+
el("m:deg"),
|
|
111
|
+
argSlotFromChildren("m:e", children, ctx)
|
|
112
|
+
]);
|
|
113
|
+
return el("m:rad", {}, [argSlot("m:deg", children[1], ctx), argSlot("m:e", children[0], ctx)]);
|
|
114
|
+
}
|
|
115
|
+
function convertScripts(element, kind, ctx) {
|
|
116
|
+
const children = elementChildren(element);
|
|
117
|
+
const base = argSlot("m:e", children[0], ctx);
|
|
118
|
+
if (kind === "msub") return el("m:sSub", {}, [base, argSlot("m:sub", children[1], ctx)]);
|
|
119
|
+
if (kind === "msup") return el("m:sSup", {}, [base, argSlot("m:sup", children[1], ctx)]);
|
|
120
|
+
return el("m:sSubSup", {}, [
|
|
121
|
+
base,
|
|
122
|
+
argSlot("m:sub", children[1], ctx),
|
|
123
|
+
argSlot("m:sup", children[2], ctx)
|
|
124
|
+
]);
|
|
125
|
+
}
|
|
126
|
+
function isMovableLimitsOperator(element) {
|
|
127
|
+
return element !== void 0 && elementLocalName(element) === "mo" && operatorProperties(textContent(element).trim()).movablelimits;
|
|
128
|
+
}
|
|
129
|
+
function convertUnderOver(element, kind, ctx) {
|
|
130
|
+
const children = elementChildren(element);
|
|
131
|
+
if (!ctx.displayStyle && isMovableLimitsOperator(children[0])) return convertScripts(element, kind === "munder" ? "msub" : kind === "mover" ? "msup" : "msubsup", ctx);
|
|
132
|
+
if (kind === "munder") return el("m:limLow", {}, [argSlot("m:e", children[0], ctx), argSlot("m:lim", children[1], ctx)]);
|
|
133
|
+
if (kind === "mover") return el("m:limUpp", {}, [argSlot("m:e", children[0], ctx), argSlot("m:lim", children[1], ctx)]);
|
|
134
|
+
const lower = el("m:limLow", {}, [argSlot("m:e", children[0], ctx), argSlot("m:lim", children[1], ctx)]);
|
|
135
|
+
return el("m:limUpp", {}, [el("m:e", {}, [lower]), argSlot("m:lim", children[2], ctx)]);
|
|
136
|
+
}
|
|
137
|
+
function convertTable(element, ctx) {
|
|
138
|
+
const rows = elementChildren(element).filter((child) => elementLocalName(child) === "mtr");
|
|
139
|
+
const columnAligns = (attrValue(element, "columnalign") ?? "").trim().split(/\s+/).filter((token) => token.length > 0);
|
|
140
|
+
const rowCells = rows.map((row) => elementChildren(row).filter((child) => elementLocalName(child) === "mtd"));
|
|
141
|
+
const columnCount = rowCells.reduce((max, cells) => Math.max(max, cells.length), 0);
|
|
142
|
+
const children = [];
|
|
143
|
+
if (columnCount > 0) {
|
|
144
|
+
const columns = [];
|
|
145
|
+
for (let column = 0; column < columnCount; column++) {
|
|
146
|
+
const align = columnJustification(columnAligns[column] ?? columnAligns[columnAligns.length - 1]);
|
|
147
|
+
columns.push(el("m:mc", {}, [el("m:mcPr", {}, [el("m:count", { "m:val": "1" }), el("m:mcJc", { "m:val": align })])]));
|
|
148
|
+
}
|
|
149
|
+
children.push(el("m:mPr", {}, [el("m:mcs", {}, columns)]));
|
|
150
|
+
}
|
|
151
|
+
for (const cells of rowCells) {
|
|
152
|
+
const slots = cells.map((cell) => argSlotFromChildren("m:e", elementChildren(cell), ctx));
|
|
153
|
+
children.push(el("m:mr", {}, slots.length === 0 ? [el("m:e")] : slots));
|
|
154
|
+
}
|
|
155
|
+
return el("m:m", {}, children);
|
|
156
|
+
}
|
|
157
|
+
function convertSpace(element, ctx) {
|
|
158
|
+
const width = attrValue(element, "width");
|
|
159
|
+
const widthValue = width === void 0 ? void 0 : parseMathLength(width, 1);
|
|
160
|
+
if (widthValue === void 0 || widthValue <= 0) return [];
|
|
161
|
+
diagnose(ctx, "approximated-element", element);
|
|
162
|
+
return [mathRun(" ", el("m:rPr", {}, [el("m:nor")]))];
|
|
163
|
+
}
|
|
164
|
+
function convertSemantics(element, ctx) {
|
|
165
|
+
const content = elementChildren(element).find((child) => {
|
|
166
|
+
const name = elementLocalName(child);
|
|
167
|
+
return name !== "annotation" && name !== "annotation-xml";
|
|
168
|
+
});
|
|
169
|
+
return content === void 0 ? [] : convertElement(content, ctx);
|
|
170
|
+
}
|
|
171
|
+
function mstyleContext(element, ctx) {
|
|
172
|
+
let next = ctx;
|
|
173
|
+
const displayAttr = attrValue(element, "displaystyle");
|
|
174
|
+
if (displayAttr === "true" || displayAttr === "false") next = {
|
|
175
|
+
...next,
|
|
176
|
+
displayStyle: displayAttr === "true"
|
|
177
|
+
};
|
|
178
|
+
const variantAttr = attrValue(element, "mathvariant");
|
|
179
|
+
if (variantAttr !== void 0 && isMathVariant(variantAttr)) next = {
|
|
180
|
+
...next,
|
|
181
|
+
inheritedVariant: variantAttr
|
|
182
|
+
};
|
|
183
|
+
return next;
|
|
184
|
+
}
|
|
185
|
+
function convertElement(node, ctx) {
|
|
186
|
+
const name = elementLocalName(node);
|
|
187
|
+
switch (name) {
|
|
188
|
+
case "mrow": return convertNodes(node.children, ctx);
|
|
189
|
+
case "mstyle": return convertNodes(node.children, mstyleContext(node, ctx));
|
|
190
|
+
case "semantics": return convertSemantics(node, ctx);
|
|
191
|
+
case "mi": {
|
|
192
|
+
const text = textContent(node);
|
|
193
|
+
return tokenRun(node, text, miIntrinsicDefault(text), ctx, false);
|
|
194
|
+
}
|
|
195
|
+
case "mn": return tokenRun(node, textContent(node), "normal", ctx, false);
|
|
196
|
+
case "mo": return tokenRun(node, textContent(node).trim(), "normal", ctx, false);
|
|
197
|
+
case "mtext": return tokenRun(node, textContent(node), "normal", ctx, true);
|
|
198
|
+
case "mspace": return convertSpace(node, ctx);
|
|
199
|
+
case "mfrac": return [convertFraction(node, ctx)];
|
|
200
|
+
case "msqrt": return [convertRadical(node, "msqrt", ctx)];
|
|
201
|
+
case "mroot": return [convertRadical(node, "mroot", ctx)];
|
|
202
|
+
case "msub":
|
|
203
|
+
case "msup":
|
|
204
|
+
case "msubsup": return [convertScripts(node, name, ctx)];
|
|
205
|
+
case "munder":
|
|
206
|
+
case "mover":
|
|
207
|
+
case "munderover": return [convertUnderOver(node, name, ctx)];
|
|
208
|
+
case "mtable": return [convertTable(node, ctx)];
|
|
209
|
+
case "mtr":
|
|
210
|
+
case "mtd": return convertNodes(node.children, ctx);
|
|
211
|
+
default:
|
|
212
|
+
diagnose(ctx, "unsupported-element", node);
|
|
213
|
+
return tokenRun(node, textContent(node), "normal", ctx, true);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function convertNodes(nodes, ctx) {
|
|
217
|
+
const out = [];
|
|
218
|
+
for (const node of nodes) {
|
|
219
|
+
if (!isMathMlElement(node)) continue;
|
|
220
|
+
out.push(...convertElement(node, ctx));
|
|
221
|
+
}
|
|
222
|
+
return out;
|
|
223
|
+
}
|
|
224
|
+
function rootContext(diagnostics) {
|
|
225
|
+
return {
|
|
226
|
+
inheritedVariant: void 0,
|
|
227
|
+
displayStyle: true,
|
|
228
|
+
diagnostics
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
function buildOfficeMath(mathml) {
|
|
232
|
+
const diagnostics = [];
|
|
233
|
+
const children = convertNodes(mathml, rootContext(diagnostics));
|
|
234
|
+
if (children.length === 0) return {
|
|
235
|
+
element: void 0,
|
|
236
|
+
diagnostics
|
|
237
|
+
};
|
|
238
|
+
return {
|
|
239
|
+
element: el("m:oMath", { "xmlns:m": OMML_NS }, children),
|
|
240
|
+
diagnostics
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function buildOfficeMathParagraph(mathml) {
|
|
244
|
+
const diagnostics = [];
|
|
245
|
+
const children = convertNodes(mathml, rootContext(diagnostics));
|
|
246
|
+
if (children.length === 0) return {
|
|
247
|
+
element: void 0,
|
|
248
|
+
diagnostics
|
|
249
|
+
};
|
|
250
|
+
return {
|
|
251
|
+
element: el("m:oMathPara", { "xmlns:m": OMML_NS }, [el("m:oMath", {}, children)]),
|
|
252
|
+
diagnostics
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
//#endregion
|
|
256
|
+
export { buildOfficeMath, buildOfficeMathParagraph };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Package } from "ooxml.js";
|
|
2
|
+
import { Package as Package$1 } from "odf.js";
|
|
3
|
+
import { FontRegistry, FontSubstitution, ProvidedFont } from "pdf-codec";
|
|
4
|
+
//#region src/fonts/registry.d.ts
|
|
5
|
+
type FontSourcePackage = {
|
|
6
|
+
readonly kind: 'docx' | 'pptx';
|
|
7
|
+
readonly package: Package;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'odf';
|
|
10
|
+
readonly package: Package$1;
|
|
11
|
+
};
|
|
12
|
+
interface DocumentFontRegistryOptions {
|
|
13
|
+
readonly fonts?: readonly ProvidedFont[];
|
|
14
|
+
readonly onFontSubstitution?: (substitution: FontSubstitution) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function extractSourceFonts(source: FontSourcePackage): ProvidedFont[];
|
|
17
|
+
declare function createDocumentFontRegistry(source: FontSourcePackage, options?: DocumentFontRegistryOptions): FontRegistry;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { extractSourceFonts as i, FontSourcePackage as n, createDocumentFontRegistry as r, DocumentFontRegistryOptions as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Package } from "odf.js";
|
|
2
|
+
import { Package as Package$1 } from "ooxml.js";
|
|
3
|
+
import { FontRegistry, FontSubstitution, ProvidedFont } from "pdf-codec";
|
|
4
|
+
//#region src/fonts/registry.d.ts
|
|
5
|
+
type FontSourcePackage = {
|
|
6
|
+
readonly kind: 'docx' | 'pptx';
|
|
7
|
+
readonly package: Package$1;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'odf';
|
|
10
|
+
readonly package: Package;
|
|
11
|
+
};
|
|
12
|
+
interface DocumentFontRegistryOptions {
|
|
13
|
+
readonly fonts?: readonly ProvidedFont[];
|
|
14
|
+
readonly onFontSubstitution?: (substitution: FontSubstitution) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function extractSourceFonts(source: FontSourcePackage): ProvidedFont[];
|
|
17
|
+
declare function createDocumentFontRegistry(source: FontSourcePackage, options?: DocumentFontRegistryOptions): FontRegistry;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { extractSourceFonts as i, FontSourcePackage as n, createDocumentFontRegistry as r, DocumentFontRegistryOptions as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ContentCellValue } from "document-schema.js";
|
|
2
|
+
//#region src/hsqldb/rowformat.d.ts
|
|
3
|
+
declare class HsqldbRowFormatError extends Error {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
declare function resolveHsqldbTypeCode(declaredType: string): number;
|
|
7
|
+
declare class HsqldbDataCursor {
|
|
8
|
+
private readonly bytes;
|
|
9
|
+
private readonly view;
|
|
10
|
+
position: number;
|
|
11
|
+
constructor(bytes: Uint8Array<ArrayBuffer>, offset?: number);
|
|
12
|
+
readUint8(): number;
|
|
13
|
+
readInt16(): number;
|
|
14
|
+
readInt32(): number;
|
|
15
|
+
readBigInt64(): bigint;
|
|
16
|
+
readFloat64(): number;
|
|
17
|
+
readBytes(length: number): Uint8Array<ArrayBuffer>;
|
|
18
|
+
}
|
|
19
|
+
declare function readModifiedUtf8(bytes: Uint8Array<ArrayBuffer>): string;
|
|
20
|
+
interface HsqldbDecodeOptions {
|
|
21
|
+
readonly timeZone?: string;
|
|
22
|
+
}
|
|
23
|
+
declare function readHsqldbColumnValue(cursor: HsqldbDataCursor, typeCode: number, options?: HsqldbDecodeOptions): ContentCellValue;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { readModifiedUtf8 as a, readHsqldbColumnValue as i, HsqldbDecodeOptions as n, resolveHsqldbTypeCode as o, HsqldbRowFormatError as r, HsqldbDataCursor as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ContentCellValue } from "document-schema.js";
|
|
2
|
+
//#region src/hsqldb/rowformat.d.ts
|
|
3
|
+
declare class HsqldbRowFormatError extends Error {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
declare function resolveHsqldbTypeCode(declaredType: string): number;
|
|
7
|
+
declare class HsqldbDataCursor {
|
|
8
|
+
private readonly bytes;
|
|
9
|
+
private readonly view;
|
|
10
|
+
position: number;
|
|
11
|
+
constructor(bytes: Uint8Array<ArrayBuffer>, offset?: number);
|
|
12
|
+
readUint8(): number;
|
|
13
|
+
readInt16(): number;
|
|
14
|
+
readInt32(): number;
|
|
15
|
+
readBigInt64(): bigint;
|
|
16
|
+
readFloat64(): number;
|
|
17
|
+
readBytes(length: number): Uint8Array<ArrayBuffer>;
|
|
18
|
+
}
|
|
19
|
+
declare function readModifiedUtf8(bytes: Uint8Array<ArrayBuffer>): string;
|
|
20
|
+
interface HsqldbDecodeOptions {
|
|
21
|
+
readonly timeZone?: string;
|
|
22
|
+
}
|
|
23
|
+
declare function readHsqldbColumnValue(cursor: HsqldbDataCursor, typeCode: number, options?: HsqldbDecodeOptions): ContentCellValue;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { readModifiedUtf8 as a, readHsqldbColumnValue as i, HsqldbDecodeOptions as n, resolveHsqldbTypeCode as o, HsqldbRowFormatError as r, HsqldbDataCursor as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as FirebirdBackupReader } from "./reader-DP0Mbaj4.cjs";
|
|
2
|
-
import { E as FirebirdPhysicalType } from "./blr-types-
|
|
2
|
+
import { E as FirebirdPhysicalType } from "./blr-types-DVgO1DQ9.cjs";
|
|
3
3
|
//#region src/firebird/schema.d.ts
|
|
4
4
|
interface FirebirdField {
|
|
5
5
|
readonly name: string;
|
|
@@ -7,6 +7,8 @@ interface FirebirdField {
|
|
|
7
7
|
readonly lengthBytes: number;
|
|
8
8
|
readonly scale: number;
|
|
9
9
|
readonly characterLength: number | undefined;
|
|
10
|
+
readonly subType: number;
|
|
11
|
+
readonly fieldNumber: number | undefined;
|
|
10
12
|
readonly typeLabel: string;
|
|
11
13
|
readonly computed: boolean;
|
|
12
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as FirebirdBackupReader } from "./reader-DP0Mbaj4.js";
|
|
2
|
-
import { E as FirebirdPhysicalType } from "./blr-types-
|
|
2
|
+
import { E as FirebirdPhysicalType } from "./blr-types-DVgO1DQ9.js";
|
|
3
3
|
//#region src/firebird/schema.d.ts
|
|
4
4
|
interface FirebirdField {
|
|
5
5
|
readonly name: string;
|
|
@@ -7,6 +7,8 @@ interface FirebirdField {
|
|
|
7
7
|
readonly lengthBytes: number;
|
|
8
8
|
readonly scale: number;
|
|
9
9
|
readonly characterLength: number | undefined;
|
|
10
|
+
readonly subType: number;
|
|
11
|
+
readonly fieldNumber: number | undefined;
|
|
10
12
|
readonly typeLabel: string;
|
|
11
13
|
readonly computed: boolean;
|
|
12
14
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { n as LayoutColor } from "./color-71eoF1Up.cjs";
|
|
2
|
-
import { t as Box } from "./geometry-
|
|
2
|
+
import { t as Box } from "./geometry-DaJr8yQW.cjs";
|
|
3
3
|
import { t as Alignment } from "./style-DkamR3aY.cjs";
|
|
4
4
|
import { XmlElement, XmlNode } from "ooxml.js";
|
|
5
5
|
//#region src/edit/pptx/shape.d.ts
|
|
6
|
+
declare const ROTATION_UNITS_PER_DEGREE = 60000;
|
|
6
7
|
declare class PptxShape {
|
|
7
8
|
private readonly container;
|
|
8
9
|
private readonly node;
|
|
@@ -12,6 +13,8 @@ declare class PptxShape {
|
|
|
12
13
|
private spPrElement;
|
|
13
14
|
get frame(): Box | undefined;
|
|
14
15
|
set frame(value: Box);
|
|
16
|
+
get rotationDeg(): number | undefined;
|
|
17
|
+
set rotationDeg(value: number | undefined);
|
|
15
18
|
get text(): string;
|
|
16
19
|
set text(value: string);
|
|
17
20
|
setParagraphs(paragraphs: readonly DrawingParagraphInit[]): void;
|
|
@@ -29,7 +32,8 @@ interface DrawingParagraphInit {
|
|
|
29
32
|
readonly runs: readonly DrawingRunInit[];
|
|
30
33
|
readonly alignment?: Alignment;
|
|
31
34
|
}
|
|
35
|
+
declare function buildDrawingParagraph(init: DrawingParagraphInit): XmlElement;
|
|
32
36
|
declare function buildTextBoxShape(frame: Box, text: string, shapeId: number): XmlElement;
|
|
33
37
|
declare function buildPictureShape(frame: Box, relationshipId: string, shapeId: number): XmlElement;
|
|
34
38
|
//#endregion
|
|
35
|
-
export {
|
|
39
|
+
export { buildDrawingParagraph as a, ROTATION_UNITS_PER_DEGREE as i, DrawingRunInit as n, buildPictureShape as o, PptxShape as r, buildTextBoxShape as s, DrawingParagraphInit as t };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { n as LayoutColor } from "./color-Bo228AY2.js";
|
|
2
|
-
import { t as Box } from "./geometry-
|
|
2
|
+
import { t as Box } from "./geometry-DaJr8yQW.js";
|
|
3
3
|
import { t as Alignment } from "./style-DkamR3aY.js";
|
|
4
4
|
import { XmlElement, XmlNode } from "ooxml.js";
|
|
5
5
|
//#region src/edit/pptx/shape.d.ts
|
|
6
|
+
declare const ROTATION_UNITS_PER_DEGREE = 60000;
|
|
6
7
|
declare class PptxShape {
|
|
7
8
|
private readonly container;
|
|
8
9
|
private readonly node;
|
|
@@ -12,6 +13,8 @@ declare class PptxShape {
|
|
|
12
13
|
private spPrElement;
|
|
13
14
|
get frame(): Box | undefined;
|
|
14
15
|
set frame(value: Box);
|
|
16
|
+
get rotationDeg(): number | undefined;
|
|
17
|
+
set rotationDeg(value: number | undefined);
|
|
15
18
|
get text(): string;
|
|
16
19
|
set text(value: string);
|
|
17
20
|
setParagraphs(paragraphs: readonly DrawingParagraphInit[]): void;
|
|
@@ -29,7 +32,8 @@ interface DrawingParagraphInit {
|
|
|
29
32
|
readonly runs: readonly DrawingRunInit[];
|
|
30
33
|
readonly alignment?: Alignment;
|
|
31
34
|
}
|
|
35
|
+
declare function buildDrawingParagraph(init: DrawingParagraphInit): XmlElement;
|
|
32
36
|
declare function buildTextBoxShape(frame: Box, text: string, shapeId: number): XmlElement;
|
|
33
37
|
declare function buildPictureShape(frame: Box, relationshipId: string, shapeId: number): XmlElement;
|
|
34
38
|
//#endregion
|
|
35
|
-
export {
|
|
39
|
+
export { buildDrawingParagraph as a, ROTATION_UNITS_PER_DEGREE as i, DrawingRunInit as n, buildPictureShape as o, PptxShape as r, buildTextBoxShape as s, DrawingParagraphInit as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Box } from "./geometry-
|
|
1
|
+
import { t as Box } from "./geometry-DaJr8yQW.js";
|
|
2
2
|
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-CoUi_88j.js";
|
|
3
3
|
import { t as OdtList } from "./list-CvKxhy3y.js";
|
|
4
4
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
@@ -26,5 +26,6 @@ declare class OdpShape {
|
|
|
26
26
|
}
|
|
27
27
|
declare function buildTextBoxFrame(pkg: Package, frame: Box, text: string): XmlElement;
|
|
28
28
|
declare function buildImageFrame(partPath: string, frame: Box): XmlElement;
|
|
29
|
+
declare function buildTableFrame(frame: Box, tableElement: XmlElement): XmlElement;
|
|
29
30
|
//#endregion
|
|
30
|
-
export { buildImageFrame as n,
|
|
31
|
+
export { buildTextBoxFrame as i, buildImageFrame as n, buildTableFrame as r, OdpShape as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Box } from "./geometry-
|
|
1
|
+
import { t as Box } from "./geometry-DaJr8yQW.cjs";
|
|
2
2
|
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-BXbXKPy3.cjs";
|
|
3
3
|
import { t as OdtList } from "./list-BuBM9rwQ.cjs";
|
|
4
4
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
@@ -26,5 +26,6 @@ declare class OdpShape {
|
|
|
26
26
|
}
|
|
27
27
|
declare function buildTextBoxFrame(pkg: Package, frame: Box, text: string): XmlElement;
|
|
28
28
|
declare function buildImageFrame(partPath: string, frame: Box): XmlElement;
|
|
29
|
+
declare function buildTableFrame(frame: Box, tableElement: XmlElement): XmlElement;
|
|
29
30
|
//#endregion
|
|
30
|
-
export { buildImageFrame as n,
|
|
31
|
+
export { buildTextBoxFrame as i, buildImageFrame as n, buildTableFrame as r, OdpShape as t };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { t as Box } from "./geometry-DaJr8yQW.cjs";
|
|
2
|
+
import { t as DrawingParagraphInit } from "./shape-BhkP6HB8.cjs";
|
|
3
|
+
import { XmlElement } from "ooxml.js";
|
|
4
|
+
//#region src/edit/pptx/table.d.ts
|
|
5
|
+
interface PptxTableInit {
|
|
6
|
+
readonly rows: number;
|
|
7
|
+
readonly columns: number;
|
|
8
|
+
readonly columnWidthsPt?: readonly number[];
|
|
9
|
+
}
|
|
10
|
+
declare class PptxTableCell {
|
|
11
|
+
private readonly node;
|
|
12
|
+
constructor(node: XmlElement);
|
|
13
|
+
get colSpan(): number | undefined;
|
|
14
|
+
set colSpan(value: number | undefined);
|
|
15
|
+
get rowSpan(): number | undefined;
|
|
16
|
+
set rowSpan(value: number | undefined);
|
|
17
|
+
set horizontalMerge(value: boolean);
|
|
18
|
+
set verticalMerge(value: boolean);
|
|
19
|
+
setParagraphs(paragraphs: readonly DrawingParagraphInit[]): void;
|
|
20
|
+
}
|
|
21
|
+
declare class PptxTableRow {
|
|
22
|
+
private readonly node;
|
|
23
|
+
constructor(node: XmlElement);
|
|
24
|
+
cells(): PptxTableCell[];
|
|
25
|
+
}
|
|
26
|
+
declare class PptxTable {
|
|
27
|
+
private readonly node;
|
|
28
|
+
constructor(node: XmlElement);
|
|
29
|
+
rows(): PptxTableRow[];
|
|
30
|
+
cell(rowIndex: number, columnIndex: number): PptxTableCell;
|
|
31
|
+
}
|
|
32
|
+
declare function buildDrawingTable(init: PptxTableInit): XmlElement;
|
|
33
|
+
declare function buildTableGraphicFrame(frame: Box, tableElement: XmlElement, shapeId: number, rotationDeg: number | undefined): XmlElement;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { buildDrawingTable as a, PptxTableRow as i, PptxTableCell as n, buildTableGraphicFrame as o, PptxTableInit as r, PptxTable as t };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-BXbXKPy3.cjs";
|
|
2
|
+
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
3
|
+
//#region src/edit/odt/table.d.ts
|
|
4
|
+
interface TableInit {
|
|
5
|
+
readonly rows: number;
|
|
6
|
+
readonly columns: number;
|
|
7
|
+
readonly columnWidthsPt?: readonly number[];
|
|
8
|
+
}
|
|
9
|
+
declare class OdtTableCell {
|
|
10
|
+
private readonly node;
|
|
11
|
+
private readonly pkg;
|
|
12
|
+
constructor(node: XmlElement, pkg: Package);
|
|
13
|
+
paragraphs(): OdtParagraph[];
|
|
14
|
+
appendParagraph(init?: ParagraphInit): OdtParagraph;
|
|
15
|
+
get text(): string;
|
|
16
|
+
get colSpan(): number | undefined;
|
|
17
|
+
set colSpan(value: number | undefined);
|
|
18
|
+
get rowSpan(): number | undefined;
|
|
19
|
+
set rowSpan(value: number | undefined);
|
|
20
|
+
}
|
|
21
|
+
declare class OdtTableRow {
|
|
22
|
+
private readonly node;
|
|
23
|
+
private readonly pkg;
|
|
24
|
+
constructor(node: XmlElement, pkg: Package);
|
|
25
|
+
cells(): OdtTableCell[];
|
|
26
|
+
appendCell(): OdtTableCell;
|
|
27
|
+
appendCoveredCell(): void;
|
|
28
|
+
}
|
|
29
|
+
declare class OdtTable {
|
|
30
|
+
private readonly container;
|
|
31
|
+
private readonly node;
|
|
32
|
+
private readonly pkg;
|
|
33
|
+
private removed;
|
|
34
|
+
constructor(container: XmlNode[], node: XmlElement, pkg: Package);
|
|
35
|
+
private live;
|
|
36
|
+
rows(): OdtTableRow[];
|
|
37
|
+
cell(rowIndex: number, columnIndex: number): OdtTableCell;
|
|
38
|
+
appendRow(columnCount: number): OdtTableRow;
|
|
39
|
+
appendEmptyRow(): OdtTableRow;
|
|
40
|
+
remove(): void;
|
|
41
|
+
}
|
|
42
|
+
declare function buildTable(pkg: Package, init: TableInit): XmlElement;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { buildTable as a, TableInit as i, OdtTableCell as n, OdtTableRow as r, OdtTable as t };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-CoUi_88j.js";
|
|
2
|
+
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
3
|
+
//#region src/edit/odt/table.d.ts
|
|
4
|
+
interface TableInit {
|
|
5
|
+
readonly rows: number;
|
|
6
|
+
readonly columns: number;
|
|
7
|
+
readonly columnWidthsPt?: readonly number[];
|
|
8
|
+
}
|
|
9
|
+
declare class OdtTableCell {
|
|
10
|
+
private readonly node;
|
|
11
|
+
private readonly pkg;
|
|
12
|
+
constructor(node: XmlElement, pkg: Package);
|
|
13
|
+
paragraphs(): OdtParagraph[];
|
|
14
|
+
appendParagraph(init?: ParagraphInit): OdtParagraph;
|
|
15
|
+
get text(): string;
|
|
16
|
+
get colSpan(): number | undefined;
|
|
17
|
+
set colSpan(value: number | undefined);
|
|
18
|
+
get rowSpan(): number | undefined;
|
|
19
|
+
set rowSpan(value: number | undefined);
|
|
20
|
+
}
|
|
21
|
+
declare class OdtTableRow {
|
|
22
|
+
private readonly node;
|
|
23
|
+
private readonly pkg;
|
|
24
|
+
constructor(node: XmlElement, pkg: Package);
|
|
25
|
+
cells(): OdtTableCell[];
|
|
26
|
+
appendCell(): OdtTableCell;
|
|
27
|
+
appendCoveredCell(): void;
|
|
28
|
+
}
|
|
29
|
+
declare class OdtTable {
|
|
30
|
+
private readonly container;
|
|
31
|
+
private readonly node;
|
|
32
|
+
private readonly pkg;
|
|
33
|
+
private removed;
|
|
34
|
+
constructor(container: XmlNode[], node: XmlElement, pkg: Package);
|
|
35
|
+
private live;
|
|
36
|
+
rows(): OdtTableRow[];
|
|
37
|
+
cell(rowIndex: number, columnIndex: number): OdtTableCell;
|
|
38
|
+
appendRow(columnCount: number): OdtTableRow;
|
|
39
|
+
appendEmptyRow(): OdtTableRow;
|
|
40
|
+
remove(): void;
|
|
41
|
+
}
|
|
42
|
+
declare function buildTable(pkg: Package, init: TableInit): XmlElement;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { buildTable as a, TableInit as i, OdtTableCell as n, OdtTableRow as r, OdtTable as t };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { t as Box } from "./geometry-DaJr8yQW.js";
|
|
2
|
+
import { t as DrawingParagraphInit } from "./shape-BkVcwPcf.js";
|
|
3
|
+
import { XmlElement } from "ooxml.js";
|
|
4
|
+
//#region src/edit/pptx/table.d.ts
|
|
5
|
+
interface PptxTableInit {
|
|
6
|
+
readonly rows: number;
|
|
7
|
+
readonly columns: number;
|
|
8
|
+
readonly columnWidthsPt?: readonly number[];
|
|
9
|
+
}
|
|
10
|
+
declare class PptxTableCell {
|
|
11
|
+
private readonly node;
|
|
12
|
+
constructor(node: XmlElement);
|
|
13
|
+
get colSpan(): number | undefined;
|
|
14
|
+
set colSpan(value: number | undefined);
|
|
15
|
+
get rowSpan(): number | undefined;
|
|
16
|
+
set rowSpan(value: number | undefined);
|
|
17
|
+
set horizontalMerge(value: boolean);
|
|
18
|
+
set verticalMerge(value: boolean);
|
|
19
|
+
setParagraphs(paragraphs: readonly DrawingParagraphInit[]): void;
|
|
20
|
+
}
|
|
21
|
+
declare class PptxTableRow {
|
|
22
|
+
private readonly node;
|
|
23
|
+
constructor(node: XmlElement);
|
|
24
|
+
cells(): PptxTableCell[];
|
|
25
|
+
}
|
|
26
|
+
declare class PptxTable {
|
|
27
|
+
private readonly node;
|
|
28
|
+
constructor(node: XmlElement);
|
|
29
|
+
rows(): PptxTableRow[];
|
|
30
|
+
cell(rowIndex: number, columnIndex: number): PptxTableCell;
|
|
31
|
+
}
|
|
32
|
+
declare function buildDrawingTable(init: PptxTableInit): XmlElement;
|
|
33
|
+
declare function buildTableGraphicFrame(frame: Box, tableElement: XmlElement, shapeId: number, rotationDeg: number | undefined): XmlElement;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { buildDrawingTable as a, PptxTableRow as i, PptxTableCell as n, buildTableGraphicFrame as o, PptxTableInit as r, PptxTable as t };
|
|
@@ -20,6 +20,8 @@ declare class OdgBoxVector {
|
|
|
20
20
|
get name(): string | undefined;
|
|
21
21
|
get frame(): Box | undefined;
|
|
22
22
|
set frame(value: Box);
|
|
23
|
+
get rotationDeg(): number | undefined;
|
|
24
|
+
set rotationDeg(value: number | undefined);
|
|
23
25
|
get fill(): Color | undefined;
|
|
24
26
|
set fill(value: Color | undefined);
|
|
25
27
|
get stroke(): ContentStroke | undefined;
|
|
@@ -65,6 +67,8 @@ declare class OdgPathVector {
|
|
|
65
67
|
get name(): string | undefined;
|
|
66
68
|
get frame(): Box | undefined;
|
|
67
69
|
set frame(value: Box);
|
|
70
|
+
get rotationDeg(): number | undefined;
|
|
71
|
+
set rotationDeg(value: number | undefined);
|
|
68
72
|
get fill(): Color | undefined;
|
|
69
73
|
set fill(value: Color | undefined);
|
|
70
74
|
get stroke(): ContentStroke | undefined;
|
|
@@ -20,6 +20,8 @@ declare class OdgBoxVector {
|
|
|
20
20
|
get name(): string | undefined;
|
|
21
21
|
get frame(): Box | undefined;
|
|
22
22
|
set frame(value: Box);
|
|
23
|
+
get rotationDeg(): number | undefined;
|
|
24
|
+
set rotationDeg(value: number | undefined);
|
|
23
25
|
get fill(): Color | undefined;
|
|
24
26
|
set fill(value: Color | undefined);
|
|
25
27
|
get stroke(): ContentStroke | undefined;
|
|
@@ -65,6 +67,8 @@ declare class OdgPathVector {
|
|
|
65
67
|
get name(): string | undefined;
|
|
66
68
|
get frame(): Box | undefined;
|
|
67
69
|
set frame(value: Box);
|
|
70
|
+
get rotationDeg(): number | undefined;
|
|
71
|
+
set rotationDeg(value: number | undefined);
|
|
68
72
|
get fill(): Color | undefined;
|
|
69
73
|
set fill(value: Color | undefined);
|
|
70
74
|
get stroke(): ContentStroke | undefined;
|