documents.js 1.44.0 → 1.45.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 +29 -6
- package/dist/index.cjs +753 -153
- package/dist/index.d.cts +121 -6
- package/dist/index.d.ts +121 -6
- package/dist/index.js +747 -155
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -536,7 +536,7 @@ function needsSpacePreserve(text) {
|
|
|
536
536
|
}
|
|
537
537
|
//#endregion
|
|
538
538
|
//#region src/edit/docx/run.ts
|
|
539
|
-
function directChild$
|
|
539
|
+
function directChild$10(parent, tag) {
|
|
540
540
|
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
541
541
|
}
|
|
542
542
|
function appendUElement(rPr, value) {
|
|
@@ -545,7 +545,7 @@ function appendUElement(rPr, value) {
|
|
|
545
545
|
return created;
|
|
546
546
|
}
|
|
547
547
|
function findOrCreateT(run) {
|
|
548
|
-
const existing = directChild$
|
|
548
|
+
const existing = directChild$10(run, "w:t");
|
|
549
549
|
if (existing !== void 0) return existing;
|
|
550
550
|
const created = el("w:t");
|
|
551
551
|
run.children.push(created);
|
|
@@ -565,7 +565,7 @@ var DocxRun = class {
|
|
|
565
565
|
}
|
|
566
566
|
rPr(create) {
|
|
567
567
|
const node = this.live();
|
|
568
|
-
return create ? ensureFirstChild(node, "w:rPr") : directChild$
|
|
568
|
+
return create ? ensureFirstChild(node, "w:rPr") : directChild$10(node, "w:rPr");
|
|
569
569
|
}
|
|
570
570
|
get text() {
|
|
571
571
|
return (0, ooxml_js.textContent)(this.live());
|
|
@@ -589,14 +589,14 @@ var DocxRun = class {
|
|
|
589
589
|
}
|
|
590
590
|
get underline() {
|
|
591
591
|
const rPr = this.rPr(false);
|
|
592
|
-
const uElement = rPr === void 0 ? void 0 : directChild$
|
|
592
|
+
const uElement = rPr === void 0 ? void 0 : directChild$10(rPr, "w:u");
|
|
593
593
|
if (uElement === void 0) return false;
|
|
594
594
|
for (const a of uElement.attributes) if (a.name === "w:val") return a.value !== "none";
|
|
595
595
|
return true;
|
|
596
596
|
}
|
|
597
597
|
set underline(value) {
|
|
598
598
|
const rPr = this.rPr(true);
|
|
599
|
-
const existing = directChild$
|
|
599
|
+
const existing = directChild$10(rPr, "w:u");
|
|
600
600
|
if (existing === void 0) {
|
|
601
601
|
appendUElement(rPr, value);
|
|
602
602
|
return;
|
|
@@ -670,7 +670,7 @@ function buildRun$1(init = {}) {
|
|
|
670
670
|
}
|
|
671
671
|
//#endregion
|
|
672
672
|
//#region src/edit/docx/paragraph.ts
|
|
673
|
-
function directChild$
|
|
673
|
+
function directChild$9(parent, tag) {
|
|
674
674
|
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
675
675
|
}
|
|
676
676
|
var DocxParagraph = class {
|
|
@@ -689,7 +689,7 @@ var DocxParagraph = class {
|
|
|
689
689
|
}
|
|
690
690
|
pPr(create) {
|
|
691
691
|
const node = this.live();
|
|
692
|
-
return create ? ensureFirstChild(node, "w:pPr") : directChild$
|
|
692
|
+
return create ? ensureFirstChild(node, "w:pPr") : directChild$9(node, "w:pPr");
|
|
693
693
|
}
|
|
694
694
|
get text() {
|
|
695
695
|
return (0, ooxml_js.textContent)(this.live());
|
|
@@ -726,7 +726,7 @@ var DocxParagraph = class {
|
|
|
726
726
|
set styleId(value) {
|
|
727
727
|
if (value === void 0) {
|
|
728
728
|
const pPr = this.pPr(false);
|
|
729
|
-
const existing = pPr === void 0 ? void 0 : directChild$
|
|
729
|
+
const existing = pPr === void 0 ? void 0 : directChild$9(pPr, "w:pStyle");
|
|
730
730
|
if (existing !== void 0 && pPr !== void 0) removeChild(pPr.children, existing);
|
|
731
731
|
return;
|
|
732
732
|
}
|
|
@@ -738,7 +738,7 @@ var DocxParagraph = class {
|
|
|
738
738
|
set alignment(value) {
|
|
739
739
|
if (value === void 0) {
|
|
740
740
|
const pPr = this.pPr(false);
|
|
741
|
-
const existing = pPr === void 0 ? void 0 : directChild$
|
|
741
|
+
const existing = pPr === void 0 ? void 0 : directChild$9(pPr, "w:jc");
|
|
742
742
|
if (existing !== void 0 && pPr !== void 0) removeChild(pPr.children, existing);
|
|
743
743
|
return;
|
|
744
744
|
}
|
|
@@ -746,12 +746,12 @@ var DocxParagraph = class {
|
|
|
746
746
|
}
|
|
747
747
|
get list() {
|
|
748
748
|
const pPr = this.pPr(false);
|
|
749
|
-
const numPr = pPr === void 0 ? void 0 : directChild$
|
|
749
|
+
const numPr = pPr === void 0 ? void 0 : directChild$9(pPr, "w:numPr");
|
|
750
750
|
if (numPr === void 0) return;
|
|
751
|
-
const numIdElement = directChild$
|
|
751
|
+
const numIdElement = directChild$9(numPr, "w:numId");
|
|
752
752
|
const numId = numIdElement === void 0 ? void 0 : (0, ooxml_js.attr)(numIdElement, "w:val");
|
|
753
753
|
if (numId === void 0) return;
|
|
754
|
-
const ilvlElement = directChild$
|
|
754
|
+
const ilvlElement = directChild$9(numPr, "w:ilvl");
|
|
755
755
|
const ilvl = ilvlElement === void 0 ? void 0 : (0, ooxml_js.attr)(ilvlElement, "w:val");
|
|
756
756
|
return {
|
|
757
757
|
numId,
|
|
@@ -761,7 +761,7 @@ var DocxParagraph = class {
|
|
|
761
761
|
set list(value) {
|
|
762
762
|
const pPr = this.pPr(true);
|
|
763
763
|
if (value === void 0) {
|
|
764
|
-
const existing = directChild$
|
|
764
|
+
const existing = directChild$9(pPr, "w:numPr");
|
|
765
765
|
if (existing !== void 0) removeChild(pPr.children, existing);
|
|
766
766
|
return;
|
|
767
767
|
}
|
|
@@ -795,7 +795,7 @@ function buildParagraph$1(init = {}) {
|
|
|
795
795
|
const CONTENT_TYPES_NS$1 = "http://schemas.openxmlformats.org/package/2006/content-types";
|
|
796
796
|
const RELS_NS$1 = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
797
797
|
const WORDML_NS = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
|
798
|
-
function declaration$
|
|
798
|
+
function declaration$5() {
|
|
799
799
|
return {
|
|
800
800
|
type: "declaration",
|
|
801
801
|
attributes: [
|
|
@@ -864,23 +864,23 @@ function createEmptyDocxPackage() {
|
|
|
864
864
|
return { parts: {
|
|
865
865
|
"[Content_Types].xml": {
|
|
866
866
|
kind: "xml",
|
|
867
|
-
nodes: [declaration$
|
|
867
|
+
nodes: [declaration$5(), contentTypes]
|
|
868
868
|
},
|
|
869
869
|
"_rels/.rels": {
|
|
870
870
|
kind: "xml",
|
|
871
|
-
nodes: [declaration$
|
|
871
|
+
nodes: [declaration$5(), rootRels]
|
|
872
872
|
},
|
|
873
873
|
"word/document.xml": {
|
|
874
874
|
kind: "xml",
|
|
875
|
-
nodes: [declaration$
|
|
875
|
+
nodes: [declaration$5(), document]
|
|
876
876
|
},
|
|
877
877
|
"word/_rels/document.xml.rels": {
|
|
878
878
|
kind: "xml",
|
|
879
|
-
nodes: [declaration$
|
|
879
|
+
nodes: [declaration$5(), documentRels]
|
|
880
880
|
},
|
|
881
881
|
"word/styles.xml": {
|
|
882
882
|
kind: "xml",
|
|
883
|
-
nodes: [declaration$
|
|
883
|
+
nodes: [declaration$5(), styles]
|
|
884
884
|
}
|
|
885
885
|
} };
|
|
886
886
|
}
|
|
@@ -1171,7 +1171,7 @@ const SLIDE_LAYOUT_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/
|
|
|
1171
1171
|
const THEME_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
|
|
1172
1172
|
const NOTES_MASTER_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster";
|
|
1173
1173
|
const MIN_MASTER_OR_LAYOUT_ID = 2147483648;
|
|
1174
|
-
function declaration$
|
|
1174
|
+
function declaration$4() {
|
|
1175
1175
|
return {
|
|
1176
1176
|
type: "declaration",
|
|
1177
1177
|
attributes: [
|
|
@@ -1321,7 +1321,7 @@ function ensureNotesMaster(pkg) {
|
|
|
1321
1321
|
});
|
|
1322
1322
|
pkg.parts[NOTES_MASTER_PART_PATH] = {
|
|
1323
1323
|
kind: "xml",
|
|
1324
|
-
nodes: [declaration$
|
|
1324
|
+
nodes: [declaration$4(), buildNotesMaster()]
|
|
1325
1325
|
};
|
|
1326
1326
|
ensureContentTypeOverride(pkg, NOTES_MASTER_PART_PATH, NOTES_MASTER_CONTENT_TYPE);
|
|
1327
1327
|
const presentationToNotesMasterTarget = buildRelativeTarget(PRESENTATION_PART_PATH$1, NOTES_MASTER_PART_PATH);
|
|
@@ -1360,15 +1360,15 @@ function createEmptyPptxPackage() {
|
|
|
1360
1360
|
const pkg = { parts: {
|
|
1361
1361
|
"[Content_Types].xml": {
|
|
1362
1362
|
kind: "xml",
|
|
1363
|
-
nodes: [declaration$
|
|
1363
|
+
nodes: [declaration$4(), contentTypes]
|
|
1364
1364
|
},
|
|
1365
1365
|
"_rels/.rels": {
|
|
1366
1366
|
kind: "xml",
|
|
1367
|
-
nodes: [declaration$
|
|
1367
|
+
nodes: [declaration$4(), rootRels]
|
|
1368
1368
|
},
|
|
1369
1369
|
[PRESENTATION_PART_PATH$1]: {
|
|
1370
1370
|
kind: "xml",
|
|
1371
|
-
nodes: [declaration$
|
|
1371
|
+
nodes: [declaration$4(), el("p:presentation", {
|
|
1372
1372
|
"xmlns:p": PML_NS,
|
|
1373
1373
|
"xmlns:r": R_NS
|
|
1374
1374
|
})]
|
|
@@ -1381,7 +1381,7 @@ function createEmptyPptxPackage() {
|
|
|
1381
1381
|
});
|
|
1382
1382
|
pkg.parts[SLIDE_LAYOUT_PART_PATH] = {
|
|
1383
1383
|
kind: "xml",
|
|
1384
|
-
nodes: [declaration$
|
|
1384
|
+
nodes: [declaration$4(), buildSlideLayout()]
|
|
1385
1385
|
};
|
|
1386
1386
|
ensureContentTypeOverride(pkg, SLIDE_LAYOUT_PART_PATH, SLIDE_LAYOUT_CONTENT_TYPE);
|
|
1387
1387
|
const masterToLayoutTarget = buildRelativeTarget(SLIDE_MASTER_PART_PATH, SLIDE_LAYOUT_PART_PATH);
|
|
@@ -1396,12 +1396,12 @@ function createEmptyPptxPackage() {
|
|
|
1396
1396
|
});
|
|
1397
1397
|
pkg.parts[SLIDE_MASTER_PART_PATH] = {
|
|
1398
1398
|
kind: "xml",
|
|
1399
|
-
nodes: [declaration$
|
|
1399
|
+
nodes: [declaration$4(), buildSlideMaster(masterToLayoutRelId)]
|
|
1400
1400
|
};
|
|
1401
1401
|
ensureContentTypeOverride(pkg, SLIDE_MASTER_PART_PATH, SLIDE_MASTER_CONTENT_TYPE);
|
|
1402
1402
|
pkg.parts[THEME_PART_PATH] = {
|
|
1403
1403
|
kind: "xml",
|
|
1404
|
-
nodes: [declaration$
|
|
1404
|
+
nodes: [declaration$4(), buildTheme()]
|
|
1405
1405
|
};
|
|
1406
1406
|
ensureContentTypeOverride(pkg, THEME_PART_PATH, THEME_CONTENT_TYPE);
|
|
1407
1407
|
const presentationToMasterTarget = buildRelativeTarget(PRESENTATION_PART_PATH$1, SLIDE_MASTER_PART_PATH);
|
|
@@ -1426,7 +1426,7 @@ function createEmptyPptxPackage() {
|
|
|
1426
1426
|
}
|
|
1427
1427
|
//#endregion
|
|
1428
1428
|
//#region src/edit/pptx/shape.ts
|
|
1429
|
-
function directChild$
|
|
1429
|
+
function directChild$8(parent, tag) {
|
|
1430
1430
|
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
1431
1431
|
}
|
|
1432
1432
|
function parseEmuAttr(element, name) {
|
|
@@ -1447,7 +1447,7 @@ var PptxShape = class {
|
|
|
1447
1447
|
}
|
|
1448
1448
|
spPrElement(create) {
|
|
1449
1449
|
const node = this.live();
|
|
1450
|
-
const existing = directChild$
|
|
1450
|
+
const existing = directChild$8(node, "p:spPr");
|
|
1451
1451
|
if (existing !== void 0 || !create) return existing;
|
|
1452
1452
|
const created = el("p:spPr");
|
|
1453
1453
|
node.children.push(created);
|
|
@@ -1455,10 +1455,10 @@ var PptxShape = class {
|
|
|
1455
1455
|
}
|
|
1456
1456
|
get frame() {
|
|
1457
1457
|
const spPr = this.spPrElement(false);
|
|
1458
|
-
const xfrm = spPr === void 0 ? void 0 : directChild$
|
|
1458
|
+
const xfrm = spPr === void 0 ? void 0 : directChild$8(spPr, "a:xfrm");
|
|
1459
1459
|
if (xfrm === void 0) return;
|
|
1460
|
-
const off = directChild$
|
|
1461
|
-
const ext = directChild$
|
|
1460
|
+
const off = directChild$8(xfrm, "a:off");
|
|
1461
|
+
const ext = directChild$8(xfrm, "a:ext");
|
|
1462
1462
|
if (off === void 0 || ext === void 0) return;
|
|
1463
1463
|
const x = parseEmuAttr(off, "x");
|
|
1464
1464
|
const y = parseEmuAttr(off, "y");
|
|
@@ -1474,7 +1474,7 @@ var PptxShape = class {
|
|
|
1474
1474
|
}
|
|
1475
1475
|
set frame(value) {
|
|
1476
1476
|
const spPr = this.spPrElement(true);
|
|
1477
|
-
let xfrm = directChild$
|
|
1477
|
+
let xfrm = directChild$8(spPr, "a:xfrm");
|
|
1478
1478
|
if (xfrm === void 0) {
|
|
1479
1479
|
xfrm = el("a:xfrm");
|
|
1480
1480
|
spPr.children.unshift(xfrm);
|
|
@@ -1488,12 +1488,12 @@ var PptxShape = class {
|
|
|
1488
1488
|
})];
|
|
1489
1489
|
}
|
|
1490
1490
|
get text() {
|
|
1491
|
-
const txBody = directChild$
|
|
1491
|
+
const txBody = directChild$8(this.live(), "p:txBody");
|
|
1492
1492
|
return txBody === void 0 ? "" : (0, ooxml_js.textContent)(txBody);
|
|
1493
1493
|
}
|
|
1494
1494
|
set text(value) {
|
|
1495
1495
|
const node = this.live();
|
|
1496
|
-
let txBody = directChild$
|
|
1496
|
+
let txBody = directChild$8(node, "p:txBody");
|
|
1497
1497
|
if (txBody === void 0) {
|
|
1498
1498
|
txBody = el("p:txBody", {}, [el("a:bodyPr"), el("a:lstStyle")]);
|
|
1499
1499
|
node.children.push(txBody);
|
|
@@ -1504,7 +1504,7 @@ var PptxShape = class {
|
|
|
1504
1504
|
}
|
|
1505
1505
|
setParagraphs(paragraphs) {
|
|
1506
1506
|
const node = this.live();
|
|
1507
|
-
let txBody = directChild$
|
|
1507
|
+
let txBody = directChild$8(node, "p:txBody");
|
|
1508
1508
|
if (txBody === void 0) {
|
|
1509
1509
|
txBody = el("p:txBody", {}, [el("a:bodyPr"), el("a:lstStyle")]);
|
|
1510
1510
|
node.children.push(txBody);
|
|
@@ -1615,12 +1615,12 @@ function insertPictureShapeMedia(context, slideRoot, frame, image) {
|
|
|
1615
1615
|
}
|
|
1616
1616
|
//#endregion
|
|
1617
1617
|
//#region src/edit/pptx/slide.ts
|
|
1618
|
-
function directChild$
|
|
1618
|
+
function directChild$7(parent, tag) {
|
|
1619
1619
|
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
1620
1620
|
}
|
|
1621
1621
|
function findSpTree(slideRoot) {
|
|
1622
|
-
const cSld = directChild$
|
|
1623
|
-
const spTree = cSld === void 0 ? void 0 : directChild$
|
|
1622
|
+
const cSld = directChild$7(slideRoot, "p:cSld");
|
|
1623
|
+
const spTree = cSld === void 0 ? void 0 : directChild$7(cSld, "p:spTree");
|
|
1624
1624
|
if (spTree === void 0) throw new Error("slide has no p:cSld/p:spTree element");
|
|
1625
1625
|
return spTree;
|
|
1626
1626
|
}
|
|
@@ -1752,7 +1752,7 @@ const PRESENTATION_PART_PATH = "ppt/presentation.xml";
|
|
|
1752
1752
|
const MEDIA_DIR = "ppt/media";
|
|
1753
1753
|
const SLIDE_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.presentationml.slide+xml";
|
|
1754
1754
|
const SLIDE_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide";
|
|
1755
|
-
function directChild$
|
|
1755
|
+
function directChild$6(parent, tag) {
|
|
1756
1756
|
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
1757
1757
|
}
|
|
1758
1758
|
function attrValue(element, name) {
|
|
@@ -1764,12 +1764,12 @@ function findPresentationRoot(pkg) {
|
|
|
1764
1764
|
return root;
|
|
1765
1765
|
}
|
|
1766
1766
|
function findSldIdLst(presentationRoot) {
|
|
1767
|
-
const sldIdLst = directChild$
|
|
1767
|
+
const sldIdLst = directChild$6(presentationRoot, "p:sldIdLst");
|
|
1768
1768
|
if (sldIdLst === void 0) throw new Error(`${PRESENTATION_PART_PATH} has no p:sldIdLst element`);
|
|
1769
1769
|
return sldIdLst;
|
|
1770
1770
|
}
|
|
1771
1771
|
function findSldSz(presentationRoot) {
|
|
1772
|
-
const sldSz = directChild$
|
|
1772
|
+
const sldSz = directChild$6(presentationRoot, "p:sldSz");
|
|
1773
1773
|
if (sldSz === void 0) throw new Error(`${PRESENTATION_PART_PATH} has no p:sldSz element`);
|
|
1774
1774
|
return sldSz;
|
|
1775
1775
|
}
|
|
@@ -1930,12 +1930,12 @@ function buildPptxPackage(content) {
|
|
|
1930
1930
|
if (firstSlide !== void 0) editor.slideSize = firstSlide.size;
|
|
1931
1931
|
for (const slide of content.slides) {
|
|
1932
1932
|
const pptxSlide = editor.addSlide();
|
|
1933
|
-
for (const shape of slide.shapes) appendShape$
|
|
1933
|
+
for (const shape of slide.shapes) appendShape$2(pptxSlide, shape);
|
|
1934
1934
|
if (slide.notes.length > 0) pptxSlide.notes = slide.notes;
|
|
1935
1935
|
}
|
|
1936
1936
|
return editor.toPackage();
|
|
1937
1937
|
}
|
|
1938
|
-
function appendShape$
|
|
1938
|
+
function appendShape$2(slide, shape) {
|
|
1939
1939
|
const [onlyBlock] = shape.blocks;
|
|
1940
1940
|
if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
|
|
1941
1941
|
slide.addImage({
|
|
@@ -1968,12 +1968,12 @@ function appendShape$1(slide, shape) {
|
|
|
1968
1968
|
}
|
|
1969
1969
|
//#endregion
|
|
1970
1970
|
//#region src/edit/odt/automatic-styles.ts
|
|
1971
|
-
const CONTENT_PART_PATH$
|
|
1971
|
+
const CONTENT_PART_PATH$4 = "content.xml";
|
|
1972
1972
|
function ensureAutomaticStyles(pkg) {
|
|
1973
|
-
const part = pkg.parts[CONTENT_PART_PATH$
|
|
1974
|
-
if (part?.kind !== "xml") throw new Error(`ensureAutomaticStyles: package has no ${CONTENT_PART_PATH$
|
|
1973
|
+
const part = pkg.parts[CONTENT_PART_PATH$4];
|
|
1974
|
+
if (part?.kind !== "xml") throw new Error(`ensureAutomaticStyles: package has no ${CONTENT_PART_PATH$4} part`);
|
|
1975
1975
|
const root = part.nodes.find((n) => n.type === "element");
|
|
1976
|
-
if (root === void 0) throw new Error(`ensureAutomaticStyles: ${CONTENT_PART_PATH$
|
|
1976
|
+
if (root === void 0) throw new Error(`ensureAutomaticStyles: ${CONTENT_PART_PATH$4} has no root element`);
|
|
1977
1977
|
for (const child of root.children) if (child.type === "element" && child.tag === "office:automatic-styles") return child;
|
|
1978
1978
|
const created = el("office:automatic-styles");
|
|
1979
1979
|
const insertBeforeTags = /* @__PURE__ */ new Set([
|
|
@@ -2067,7 +2067,7 @@ function applyStyleChange(pkg, element, family, change) {
|
|
|
2067
2067
|
...readCurrentStyleProperties(pkg, element, family),
|
|
2068
2068
|
...change
|
|
2069
2069
|
};
|
|
2070
|
-
const name = odf_js.StyleRegistry.forPart(pkg, CONTENT_PART_PATH$
|
|
2070
|
+
const name = odf_js.StyleRegistry.forPart(pkg, CONTENT_PART_PATH$4).intern({
|
|
2071
2071
|
family,
|
|
2072
2072
|
properties: merged
|
|
2073
2073
|
});
|
|
@@ -2298,7 +2298,7 @@ function buildList(pkg) {
|
|
|
2298
2298
|
}
|
|
2299
2299
|
//#endregion
|
|
2300
2300
|
//#region src/edit/odt/scaffold.ts
|
|
2301
|
-
const CONTENT_NS_PREFIXES$
|
|
2301
|
+
const CONTENT_NS_PREFIXES$3 = [
|
|
2302
2302
|
"office",
|
|
2303
2303
|
"style",
|
|
2304
2304
|
"text",
|
|
@@ -2308,7 +2308,7 @@ const CONTENT_NS_PREFIXES$2 = [
|
|
|
2308
2308
|
"svg",
|
|
2309
2309
|
"xlink"
|
|
2310
2310
|
];
|
|
2311
|
-
const STYLES_NS_PREFIXES$
|
|
2311
|
+
const STYLES_NS_PREFIXES$3 = [
|
|
2312
2312
|
"office",
|
|
2313
2313
|
"style",
|
|
2314
2314
|
"text",
|
|
@@ -2318,16 +2318,16 @@ const STYLES_NS_PREFIXES$2 = [
|
|
|
2318
2318
|
"svg",
|
|
2319
2319
|
"xlink"
|
|
2320
2320
|
];
|
|
2321
|
-
const META_NS_PREFIXES$
|
|
2321
|
+
const META_NS_PREFIXES$3 = [
|
|
2322
2322
|
"office",
|
|
2323
2323
|
"meta",
|
|
2324
2324
|
"dc"
|
|
2325
2325
|
];
|
|
2326
|
-
const ODF_VERSION$
|
|
2327
|
-
const PAGE_LAYOUT_NAME$
|
|
2328
|
-
const MASTER_PAGE_NAME$
|
|
2326
|
+
const ODF_VERSION$3 = "1.3";
|
|
2327
|
+
const PAGE_LAYOUT_NAME$3 = "PM1";
|
|
2328
|
+
const MASTER_PAGE_NAME$3 = "Standard";
|
|
2329
2329
|
const DEFAULT_MARGIN_PT = 72;
|
|
2330
|
-
function declaration$
|
|
2330
|
+
function declaration$3() {
|
|
2331
2331
|
return {
|
|
2332
2332
|
type: "declaration",
|
|
2333
2333
|
attributes: [
|
|
@@ -2346,8 +2346,8 @@ function declaration$2() {
|
|
|
2346
2346
|
]
|
|
2347
2347
|
};
|
|
2348
2348
|
}
|
|
2349
|
-
function buildPageLayout$
|
|
2350
|
-
return el("style:page-layout", { "style:name": PAGE_LAYOUT_NAME$
|
|
2349
|
+
function buildPageLayout$3() {
|
|
2350
|
+
return el("style:page-layout", { "style:name": PAGE_LAYOUT_NAME$3 }, [el("style:page-layout-properties", {
|
|
2351
2351
|
"fo:page-width": `${document_content_model.PAGE_SIZE_LETTER.widthPt}pt`,
|
|
2352
2352
|
"fo:page-height": `${document_content_model.PAGE_SIZE_LETTER.heightPt}pt`,
|
|
2353
2353
|
"fo:margin-top": `${DEFAULT_MARGIN_PT}pt`,
|
|
@@ -2356,44 +2356,44 @@ function buildPageLayout$2() {
|
|
|
2356
2356
|
"fo:margin-left": `${DEFAULT_MARGIN_PT}pt`
|
|
2357
2357
|
})]);
|
|
2358
2358
|
}
|
|
2359
|
-
function buildStylesXml$
|
|
2359
|
+
function buildStylesXml$3() {
|
|
2360
2360
|
return el("office:document-styles", {
|
|
2361
|
-
...(0, odf_js.xmlnsAttributes)([...STYLES_NS_PREFIXES$
|
|
2362
|
-
"office:version": ODF_VERSION$
|
|
2361
|
+
...(0, odf_js.xmlnsAttributes)([...STYLES_NS_PREFIXES$3]),
|
|
2362
|
+
"office:version": ODF_VERSION$3
|
|
2363
2363
|
}, [
|
|
2364
2364
|
el("office:styles"),
|
|
2365
|
-
el("office:automatic-styles", {}, [buildPageLayout$
|
|
2365
|
+
el("office:automatic-styles", {}, [buildPageLayout$3()]),
|
|
2366
2366
|
el("office:master-styles", {}, [el("style:master-page", {
|
|
2367
|
-
"style:name": MASTER_PAGE_NAME$
|
|
2368
|
-
"style:page-layout-name": PAGE_LAYOUT_NAME$
|
|
2367
|
+
"style:name": MASTER_PAGE_NAME$3,
|
|
2368
|
+
"style:page-layout-name": PAGE_LAYOUT_NAME$3
|
|
2369
2369
|
})])
|
|
2370
2370
|
]);
|
|
2371
2371
|
}
|
|
2372
|
-
function buildContentXml$
|
|
2372
|
+
function buildContentXml$3() {
|
|
2373
2373
|
return el("office:document-content", {
|
|
2374
|
-
...(0, odf_js.xmlnsAttributes)([...CONTENT_NS_PREFIXES$
|
|
2375
|
-
"office:version": ODF_VERSION$
|
|
2374
|
+
...(0, odf_js.xmlnsAttributes)([...CONTENT_NS_PREFIXES$3]),
|
|
2375
|
+
"office:version": ODF_VERSION$3
|
|
2376
2376
|
}, [el("office:automatic-styles"), el("office:body", {}, [el("office:text")])]);
|
|
2377
2377
|
}
|
|
2378
|
-
function buildMetaXml$
|
|
2378
|
+
function buildMetaXml$3() {
|
|
2379
2379
|
return el("office:document-meta", {
|
|
2380
|
-
...(0, odf_js.xmlnsAttributes)([...META_NS_PREFIXES$
|
|
2381
|
-
"office:version": ODF_VERSION$
|
|
2380
|
+
...(0, odf_js.xmlnsAttributes)([...META_NS_PREFIXES$3]),
|
|
2381
|
+
"office:version": ODF_VERSION$3
|
|
2382
2382
|
}, [el("office:meta")]);
|
|
2383
2383
|
}
|
|
2384
2384
|
function createEmptyOdtPackage() {
|
|
2385
2385
|
const pkg = { parts: {
|
|
2386
2386
|
"content.xml": {
|
|
2387
2387
|
kind: "xml",
|
|
2388
|
-
nodes: [declaration$
|
|
2388
|
+
nodes: [declaration$3(), buildContentXml$3()]
|
|
2389
2389
|
},
|
|
2390
2390
|
"styles.xml": {
|
|
2391
2391
|
kind: "xml",
|
|
2392
|
-
nodes: [declaration$
|
|
2392
|
+
nodes: [declaration$3(), buildStylesXml$3()]
|
|
2393
2393
|
},
|
|
2394
2394
|
"meta.xml": {
|
|
2395
2395
|
kind: "xml",
|
|
2396
|
-
nodes: [declaration$
|
|
2396
|
+
nodes: [declaration$3(), buildMetaXml$3()]
|
|
2397
2397
|
}
|
|
2398
2398
|
} };
|
|
2399
2399
|
(0, odf_js.setDocumentMediaType)(pkg, odf_js.ODF_MEDIA_TYPES.odt);
|
|
@@ -2514,20 +2514,20 @@ function buildTable(pkg, init) {
|
|
|
2514
2514
|
}
|
|
2515
2515
|
//#endregion
|
|
2516
2516
|
//#region src/edit/odt/editor.ts
|
|
2517
|
-
const CONTENT_PART_PATH$
|
|
2517
|
+
const CONTENT_PART_PATH$3 = "content.xml";
|
|
2518
2518
|
function findContentRoot(pkg) {
|
|
2519
|
-
const part = pkg.parts[CONTENT_PART_PATH$
|
|
2519
|
+
const part = pkg.parts[CONTENT_PART_PATH$3];
|
|
2520
2520
|
const root = part?.kind === "xml" ? part.nodes.find((n) => n.type === "element") : void 0;
|
|
2521
|
-
if (root === void 0) throw new Error(`package has no root element at ${CONTENT_PART_PATH$
|
|
2521
|
+
if (root === void 0) throw new Error(`package has no root element at ${CONTENT_PART_PATH$3}`);
|
|
2522
2522
|
return root;
|
|
2523
2523
|
}
|
|
2524
|
-
function directChild$
|
|
2524
|
+
function directChild$5(parent, tag) {
|
|
2525
2525
|
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
2526
2526
|
}
|
|
2527
2527
|
function findOfficeText(contentRoot) {
|
|
2528
|
-
const body = directChild$
|
|
2529
|
-
const text = body === void 0 ? void 0 : directChild$
|
|
2530
|
-
if (text === void 0) throw new Error(`${CONTENT_PART_PATH$
|
|
2528
|
+
const body = directChild$5(contentRoot, "office:body");
|
|
2529
|
+
const text = body === void 0 ? void 0 : directChild$5(body, "office:text");
|
|
2530
|
+
if (text === void 0) throw new Error(`${CONTENT_PART_PATH$3} has no office:body/office:text element`);
|
|
2531
2531
|
return text;
|
|
2532
2532
|
}
|
|
2533
2533
|
var OdtBodyImpl = class {
|
|
@@ -2659,7 +2659,7 @@ function appendBlock(body, block) {
|
|
|
2659
2659
|
}
|
|
2660
2660
|
//#endregion
|
|
2661
2661
|
//#region src/edit/odp/scaffold.ts
|
|
2662
|
-
const CONTENT_NS_PREFIXES$
|
|
2662
|
+
const CONTENT_NS_PREFIXES$2 = [
|
|
2663
2663
|
"office",
|
|
2664
2664
|
"style",
|
|
2665
2665
|
"text",
|
|
@@ -2670,7 +2670,7 @@ const CONTENT_NS_PREFIXES$1 = [
|
|
|
2670
2670
|
"svg",
|
|
2671
2671
|
"xlink"
|
|
2672
2672
|
];
|
|
2673
|
-
const STYLES_NS_PREFIXES$
|
|
2673
|
+
const STYLES_NS_PREFIXES$2 = [
|
|
2674
2674
|
"office",
|
|
2675
2675
|
"style",
|
|
2676
2676
|
"text",
|
|
@@ -2681,14 +2681,14 @@ const STYLES_NS_PREFIXES$1 = [
|
|
|
2681
2681
|
"svg",
|
|
2682
2682
|
"xlink"
|
|
2683
2683
|
];
|
|
2684
|
-
const META_NS_PREFIXES$
|
|
2684
|
+
const META_NS_PREFIXES$2 = [
|
|
2685
2685
|
"office",
|
|
2686
2686
|
"meta",
|
|
2687
2687
|
"dc"
|
|
2688
2688
|
];
|
|
2689
|
-
const ODF_VERSION$
|
|
2690
|
-
const MASTER_PAGE_NAME$
|
|
2691
|
-
function declaration$
|
|
2689
|
+
const ODF_VERSION$2 = "1.3";
|
|
2690
|
+
const MASTER_PAGE_NAME$2 = "Standard";
|
|
2691
|
+
function declaration$2() {
|
|
2692
2692
|
return {
|
|
2693
2693
|
type: "declaration",
|
|
2694
2694
|
attributes: [
|
|
@@ -2707,50 +2707,50 @@ function declaration$1() {
|
|
|
2707
2707
|
]
|
|
2708
2708
|
};
|
|
2709
2709
|
}
|
|
2710
|
-
function buildPageLayout$
|
|
2710
|
+
function buildPageLayout$2() {
|
|
2711
2711
|
return el("style:page-layout", { "style:name": "PM1" }, [el("style:page-layout-properties", {
|
|
2712
2712
|
"fo:page-width": `${document_content_model.SLIDE_SIZE_WIDESCREEN.widthPt}pt`,
|
|
2713
2713
|
"fo:page-height": `${document_content_model.SLIDE_SIZE_WIDESCREEN.heightPt}pt`
|
|
2714
2714
|
})]);
|
|
2715
2715
|
}
|
|
2716
|
-
function buildStylesXml$
|
|
2716
|
+
function buildStylesXml$2() {
|
|
2717
2717
|
return el("office:document-styles", {
|
|
2718
|
-
...(0, odf_js.xmlnsAttributes)([...STYLES_NS_PREFIXES$
|
|
2719
|
-
"office:version": ODF_VERSION$
|
|
2718
|
+
...(0, odf_js.xmlnsAttributes)([...STYLES_NS_PREFIXES$2]),
|
|
2719
|
+
"office:version": ODF_VERSION$2
|
|
2720
2720
|
}, [
|
|
2721
2721
|
el("office:styles"),
|
|
2722
|
-
el("office:automatic-styles", {}, [buildPageLayout$
|
|
2722
|
+
el("office:automatic-styles", {}, [buildPageLayout$2()]),
|
|
2723
2723
|
el("office:master-styles", {}, [el("style:master-page", {
|
|
2724
|
-
"style:name": MASTER_PAGE_NAME$
|
|
2724
|
+
"style:name": MASTER_PAGE_NAME$2,
|
|
2725
2725
|
"style:page-layout-name": "PM1"
|
|
2726
2726
|
})])
|
|
2727
2727
|
]);
|
|
2728
2728
|
}
|
|
2729
|
-
function buildContentXml$
|
|
2729
|
+
function buildContentXml$2() {
|
|
2730
2730
|
return el("office:document-content", {
|
|
2731
|
-
...(0, odf_js.xmlnsAttributes)([...CONTENT_NS_PREFIXES$
|
|
2732
|
-
"office:version": ODF_VERSION$
|
|
2731
|
+
...(0, odf_js.xmlnsAttributes)([...CONTENT_NS_PREFIXES$2]),
|
|
2732
|
+
"office:version": ODF_VERSION$2
|
|
2733
2733
|
}, [el("office:automatic-styles"), el("office:body", {}, [el("office:presentation")])]);
|
|
2734
2734
|
}
|
|
2735
|
-
function buildMetaXml$
|
|
2735
|
+
function buildMetaXml$2() {
|
|
2736
2736
|
return el("office:document-meta", {
|
|
2737
|
-
...(0, odf_js.xmlnsAttributes)([...META_NS_PREFIXES$
|
|
2738
|
-
"office:version": ODF_VERSION$
|
|
2737
|
+
...(0, odf_js.xmlnsAttributes)([...META_NS_PREFIXES$2]),
|
|
2738
|
+
"office:version": ODF_VERSION$2
|
|
2739
2739
|
}, [el("office:meta")]);
|
|
2740
2740
|
}
|
|
2741
2741
|
function createEmptyOdpPackage() {
|
|
2742
2742
|
const pkg = { parts: {
|
|
2743
2743
|
"content.xml": {
|
|
2744
2744
|
kind: "xml",
|
|
2745
|
-
nodes: [declaration$
|
|
2745
|
+
nodes: [declaration$2(), buildContentXml$2()]
|
|
2746
2746
|
},
|
|
2747
2747
|
"styles.xml": {
|
|
2748
2748
|
kind: "xml",
|
|
2749
|
-
nodes: [declaration$
|
|
2749
|
+
nodes: [declaration$2(), buildStylesXml$2()]
|
|
2750
2750
|
},
|
|
2751
2751
|
"meta.xml": {
|
|
2752
2752
|
kind: "xml",
|
|
2753
|
-
nodes: [declaration$
|
|
2753
|
+
nodes: [declaration$2(), buildMetaXml$2()]
|
|
2754
2754
|
}
|
|
2755
2755
|
} };
|
|
2756
2756
|
(0, odf_js.setDocumentMediaType)(pkg, odf_js.ODF_MEDIA_TYPES.odp);
|
|
@@ -2790,7 +2790,7 @@ function addImageMedia(pkg, imageBytes, format) {
|
|
|
2790
2790
|
}
|
|
2791
2791
|
//#endregion
|
|
2792
2792
|
//#region src/edit/odp/shape.ts
|
|
2793
|
-
function directChild$
|
|
2793
|
+
function directChild$4(parent, tag) {
|
|
2794
2794
|
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
2795
2795
|
}
|
|
2796
2796
|
function buildTransformAttr(frame, rotationDeg) {
|
|
@@ -2858,7 +2858,7 @@ var OdpShape = class {
|
|
|
2858
2858
|
}
|
|
2859
2859
|
textBox(create) {
|
|
2860
2860
|
const node = this.live();
|
|
2861
|
-
const existing = directChild$
|
|
2861
|
+
const existing = directChild$4(node, "draw:text-box");
|
|
2862
2862
|
if (existing !== void 0 || !create) return existing;
|
|
2863
2863
|
const created = el("draw:text-box");
|
|
2864
2864
|
node.children.push(created);
|
|
@@ -2919,7 +2919,7 @@ function insertImageFrameMedia(context, frame, image) {
|
|
|
2919
2919
|
}
|
|
2920
2920
|
//#endregion
|
|
2921
2921
|
//#region src/edit/odp/slide.ts
|
|
2922
|
-
function directChild$
|
|
2922
|
+
function directChild$3(parent, tag) {
|
|
2923
2923
|
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
2924
2924
|
}
|
|
2925
2925
|
const NOTES_FRAME_X_PT = 20;
|
|
@@ -2968,13 +2968,13 @@ var OdpSlide = class {
|
|
|
2968
2968
|
return new OdpShape(node.children, frameElement, this.context.pkg);
|
|
2969
2969
|
}
|
|
2970
2970
|
get notes() {
|
|
2971
|
-
const notesElement = directChild$
|
|
2971
|
+
const notesElement = directChild$3(this.live(), "presentation:notes");
|
|
2972
2972
|
if (notesElement === void 0) return "";
|
|
2973
2973
|
return (0, ooxml_js.elementsWithTag)(notesElement.children, "text:p").map((p) => decodeOdfText(p.children)).join("\n");
|
|
2974
2974
|
}
|
|
2975
2975
|
set notes(value) {
|
|
2976
2976
|
const node = this.live();
|
|
2977
|
-
const existing = directChild$
|
|
2977
|
+
const existing = directChild$3(node, "presentation:notes");
|
|
2978
2978
|
const notesElement = buildNotesElement(this.context.pkg, value);
|
|
2979
2979
|
if (existing === void 0) node.children.push(notesElement);
|
|
2980
2980
|
else existing.children = notesElement.children;
|
|
@@ -2986,27 +2986,27 @@ var OdpSlide = class {
|
|
|
2986
2986
|
};
|
|
2987
2987
|
//#endregion
|
|
2988
2988
|
//#region src/edit/odp/editor.ts
|
|
2989
|
-
const CONTENT_PART_PATH$
|
|
2990
|
-
const STYLES_PART_PATH = "styles.xml";
|
|
2991
|
-
function directChild$
|
|
2989
|
+
const CONTENT_PART_PATH$2 = "content.xml";
|
|
2990
|
+
const STYLES_PART_PATH$1 = "styles.xml";
|
|
2991
|
+
function directChild$2(parent, tag) {
|
|
2992
2992
|
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
2993
2993
|
}
|
|
2994
|
-
function findRoot$
|
|
2994
|
+
function findRoot$2(pkg, partPath) {
|
|
2995
2995
|
const part = pkg.parts[partPath];
|
|
2996
2996
|
const root = part?.kind === "xml" ? part.nodes.find((n) => n.type === "element") : void 0;
|
|
2997
2997
|
if (root === void 0) throw new Error(`package has no root element at ${partPath}`);
|
|
2998
2998
|
return root;
|
|
2999
2999
|
}
|
|
3000
3000
|
function findOfficePresentation(pkg) {
|
|
3001
|
-
const body = directChild$
|
|
3002
|
-
const presentation = body === void 0 ? void 0 : directChild$
|
|
3003
|
-
if (presentation === void 0) throw new Error(`${CONTENT_PART_PATH$
|
|
3001
|
+
const body = directChild$2(findRoot$2(pkg, CONTENT_PART_PATH$2), "office:body");
|
|
3002
|
+
const presentation = body === void 0 ? void 0 : directChild$2(body, "office:presentation");
|
|
3003
|
+
if (presentation === void 0) throw new Error(`${CONTENT_PART_PATH$2} has no office:body/office:presentation element`);
|
|
3004
3004
|
return presentation;
|
|
3005
3005
|
}
|
|
3006
|
-
function findPageLayoutProperties(pkg) {
|
|
3007
|
-
const pageLayout = directChild$
|
|
3008
|
-
const properties = pageLayout === void 0 ? void 0 : directChild$
|
|
3009
|
-
if (properties === void 0) throw new Error(`${STYLES_PART_PATH} has no style:page-layout[style:name="PM1"]/style:page-layout-properties element`);
|
|
3006
|
+
function findPageLayoutProperties$1(pkg) {
|
|
3007
|
+
const pageLayout = directChild$2(findRoot$2(pkg, STYLES_PART_PATH$1), "office:automatic-styles")?.children.find((c) => c.type === "element" && c.tag === "style:page-layout" && (0, ooxml_js.attr)(c, "style:name") === "PM1");
|
|
3008
|
+
const properties = pageLayout === void 0 ? void 0 : directChild$2(pageLayout, "style:page-layout-properties");
|
|
3009
|
+
if (properties === void 0) throw new Error(`${STYLES_PART_PATH$1} has no style:page-layout[style:name="PM1"]/style:page-layout-properties element`);
|
|
3010
3010
|
return properties;
|
|
3011
3011
|
}
|
|
3012
3012
|
var OdpEditor = class {
|
|
@@ -3025,7 +3025,7 @@ var OdpEditor = class {
|
|
|
3025
3025
|
}
|
|
3026
3026
|
addSlide() {
|
|
3027
3027
|
const presentation = findOfficePresentation(this.pkg);
|
|
3028
|
-
const pageElement = el("draw:page", { "draw:master-page-name": MASTER_PAGE_NAME$
|
|
3028
|
+
const pageElement = el("draw:page", { "draw:master-page-name": MASTER_PAGE_NAME$2 });
|
|
3029
3029
|
presentation.children.push(pageElement);
|
|
3030
3030
|
const context = { pkg: this.pkg };
|
|
3031
3031
|
return new OdpSlide(presentation.children, pageElement, context);
|
|
@@ -3055,7 +3055,7 @@ var OdpEditor = class {
|
|
|
3055
3055
|
presentation.children.splice(insertAt, 0, moved);
|
|
3056
3056
|
}
|
|
3057
3057
|
get slideSize() {
|
|
3058
|
-
const properties = findPageLayoutProperties(this.pkg);
|
|
3058
|
+
const properties = findPageLayoutProperties$1(this.pkg);
|
|
3059
3059
|
const widthValue = (0, ooxml_js.attr)(properties, "fo:page-width");
|
|
3060
3060
|
const heightValue = (0, ooxml_js.attr)(properties, "fo:page-height");
|
|
3061
3061
|
const widthPt = widthValue === void 0 ? void 0 : (0, odf_js.parseOdfLength)(widthValue);
|
|
@@ -3066,7 +3066,7 @@ var OdpEditor = class {
|
|
|
3066
3066
|
};
|
|
3067
3067
|
}
|
|
3068
3068
|
set slideSize(size) {
|
|
3069
|
-
const properties = findPageLayoutProperties(this.pkg);
|
|
3069
|
+
const properties = findPageLayoutProperties$1(this.pkg);
|
|
3070
3070
|
properties.attributes = [{
|
|
3071
3071
|
name: "fo:page-width",
|
|
3072
3072
|
value: (0, odf_js.formatOdfLength)(size.widthPt)
|
|
@@ -3097,12 +3097,12 @@ function buildOdpPackage(content) {
|
|
|
3097
3097
|
if (firstSlide !== void 0) editor.slideSize = firstSlide.size;
|
|
3098
3098
|
for (const slide of content.slides) {
|
|
3099
3099
|
const odpSlide = editor.addSlide();
|
|
3100
|
-
for (const shape of slide.shapes) appendShape(odpSlide, shape);
|
|
3100
|
+
for (const shape of slide.shapes) appendShape$1(odpSlide, shape);
|
|
3101
3101
|
if (slide.notes.length > 0) odpSlide.notes = slide.notes;
|
|
3102
3102
|
}
|
|
3103
3103
|
return editor.toPackage();
|
|
3104
3104
|
}
|
|
3105
|
-
function appendShape(slide, shape) {
|
|
3105
|
+
function appendShape$1(slide, shape) {
|
|
3106
3106
|
const [onlyBlock] = shape.blocks;
|
|
3107
3107
|
if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
|
|
3108
3108
|
const imageShape = slide.addImage({
|
|
@@ -3127,31 +3127,31 @@ function appendShape(slide, shape) {
|
|
|
3127
3127
|
}
|
|
3128
3128
|
//#endregion
|
|
3129
3129
|
//#region src/edit/ods/scaffold.ts
|
|
3130
|
-
const CONTENT_NS_PREFIXES = [
|
|
3130
|
+
const CONTENT_NS_PREFIXES$1 = [
|
|
3131
3131
|
"office",
|
|
3132
3132
|
"style",
|
|
3133
3133
|
"text",
|
|
3134
3134
|
"table",
|
|
3135
3135
|
"fo"
|
|
3136
3136
|
];
|
|
3137
|
-
const STYLES_NS_PREFIXES = [
|
|
3137
|
+
const STYLES_NS_PREFIXES$1 = [
|
|
3138
3138
|
"office",
|
|
3139
3139
|
"style",
|
|
3140
3140
|
"table",
|
|
3141
3141
|
"fo"
|
|
3142
3142
|
];
|
|
3143
|
-
const META_NS_PREFIXES = [
|
|
3143
|
+
const META_NS_PREFIXES$1 = [
|
|
3144
3144
|
"office",
|
|
3145
3145
|
"meta",
|
|
3146
3146
|
"dc"
|
|
3147
3147
|
];
|
|
3148
3148
|
const OF_NAMESPACE_ATTR = { "xmlns:of": "urn:oasis:names:tc:opendocument:xmlns:of:1.2" };
|
|
3149
|
-
const ODF_VERSION = "1.3";
|
|
3150
|
-
const MASTER_PAGE_NAME = "Standard";
|
|
3149
|
+
const ODF_VERSION$1 = "1.3";
|
|
3150
|
+
const MASTER_PAGE_NAME$1 = "Standard";
|
|
3151
3151
|
const SHEET_TABLE_STYLE_NAME = "OdsTable";
|
|
3152
3152
|
const DEFAULT_SHEET_NAME = "Sheet1";
|
|
3153
3153
|
const DEFAULT_MARGIN = "2cm";
|
|
3154
|
-
function declaration() {
|
|
3154
|
+
function declaration$1() {
|
|
3155
3155
|
return {
|
|
3156
3156
|
type: "declaration",
|
|
3157
3157
|
attributes: [
|
|
@@ -3170,7 +3170,7 @@ function declaration() {
|
|
|
3170
3170
|
]
|
|
3171
3171
|
};
|
|
3172
3172
|
}
|
|
3173
|
-
function buildPageLayout() {
|
|
3173
|
+
function buildPageLayout$1() {
|
|
3174
3174
|
return el("style:page-layout", { "style:name": "PM1" }, [el("style:page-layout-properties", {
|
|
3175
3175
|
"fo:page-width": `${document_content_model.PAGE_SIZE_A4.widthPt}pt`,
|
|
3176
3176
|
"fo:page-height": `${document_content_model.PAGE_SIZE_A4.heightPt}pt`,
|
|
@@ -3180,15 +3180,15 @@ function buildPageLayout() {
|
|
|
3180
3180
|
"fo:margin-left": DEFAULT_MARGIN
|
|
3181
3181
|
})]);
|
|
3182
3182
|
}
|
|
3183
|
-
function buildStylesXml() {
|
|
3183
|
+
function buildStylesXml$1() {
|
|
3184
3184
|
return el("office:document-styles", {
|
|
3185
|
-
...(0, odf_js.xmlnsAttributes)([...STYLES_NS_PREFIXES]),
|
|
3186
|
-
"office:version": ODF_VERSION
|
|
3185
|
+
...(0, odf_js.xmlnsAttributes)([...STYLES_NS_PREFIXES$1]),
|
|
3186
|
+
"office:version": ODF_VERSION$1
|
|
3187
3187
|
}, [
|
|
3188
3188
|
el("office:styles"),
|
|
3189
|
-
el("office:automatic-styles", {}, [buildPageLayout()]),
|
|
3189
|
+
el("office:automatic-styles", {}, [buildPageLayout$1()]),
|
|
3190
3190
|
el("office:master-styles", {}, [el("style:master-page", {
|
|
3191
|
-
"style:name": MASTER_PAGE_NAME,
|
|
3191
|
+
"style:name": MASTER_PAGE_NAME$1,
|
|
3192
3192
|
"style:page-layout-name": "PM1"
|
|
3193
3193
|
})])
|
|
3194
3194
|
]);
|
|
@@ -3197,7 +3197,7 @@ function buildSheetTableStyle() {
|
|
|
3197
3197
|
return el("style:style", {
|
|
3198
3198
|
"style:name": SHEET_TABLE_STYLE_NAME,
|
|
3199
3199
|
"style:family": "table",
|
|
3200
|
-
"style:master-page-name": MASTER_PAGE_NAME
|
|
3200
|
+
"style:master-page-name": MASTER_PAGE_NAME$1
|
|
3201
3201
|
});
|
|
3202
3202
|
}
|
|
3203
3203
|
function buildCalculationSettings() {
|
|
@@ -3208,36 +3208,36 @@ function buildCalculationSettings() {
|
|
|
3208
3208
|
"table:null-year": "1950"
|
|
3209
3209
|
});
|
|
3210
3210
|
}
|
|
3211
|
-
function buildContentXml() {
|
|
3211
|
+
function buildContentXml$1() {
|
|
3212
3212
|
const table = el("table:table", {
|
|
3213
3213
|
"table:name": DEFAULT_SHEET_NAME,
|
|
3214
3214
|
"table:style-name": SHEET_TABLE_STYLE_NAME
|
|
3215
3215
|
});
|
|
3216
3216
|
return el("office:document-content", {
|
|
3217
|
-
...(0, odf_js.xmlnsAttributes)([...CONTENT_NS_PREFIXES]),
|
|
3217
|
+
...(0, odf_js.xmlnsAttributes)([...CONTENT_NS_PREFIXES$1]),
|
|
3218
3218
|
...OF_NAMESPACE_ATTR,
|
|
3219
|
-
"office:version": ODF_VERSION
|
|
3219
|
+
"office:version": ODF_VERSION$1
|
|
3220
3220
|
}, [el("office:automatic-styles", {}, [buildSheetTableStyle()]), el("office:body", {}, [el("office:spreadsheet", {}, [buildCalculationSettings(), table])])]);
|
|
3221
3221
|
}
|
|
3222
|
-
function buildMetaXml() {
|
|
3222
|
+
function buildMetaXml$1() {
|
|
3223
3223
|
return el("office:document-meta", {
|
|
3224
|
-
...(0, odf_js.xmlnsAttributes)([...META_NS_PREFIXES]),
|
|
3225
|
-
"office:version": ODF_VERSION
|
|
3224
|
+
...(0, odf_js.xmlnsAttributes)([...META_NS_PREFIXES$1]),
|
|
3225
|
+
"office:version": ODF_VERSION$1
|
|
3226
3226
|
}, [el("office:meta")]);
|
|
3227
3227
|
}
|
|
3228
3228
|
function createEmptyOdsPackage() {
|
|
3229
3229
|
const pkg = { parts: {
|
|
3230
3230
|
"content.xml": {
|
|
3231
3231
|
kind: "xml",
|
|
3232
|
-
nodes: [declaration(), buildContentXml()]
|
|
3232
|
+
nodes: [declaration$1(), buildContentXml$1()]
|
|
3233
3233
|
},
|
|
3234
3234
|
"styles.xml": {
|
|
3235
3235
|
kind: "xml",
|
|
3236
|
-
nodes: [declaration(), buildStylesXml()]
|
|
3236
|
+
nodes: [declaration$1(), buildStylesXml$1()]
|
|
3237
3237
|
},
|
|
3238
3238
|
"meta.xml": {
|
|
3239
3239
|
kind: "xml",
|
|
3240
|
-
nodes: [declaration(), buildMetaXml()]
|
|
3240
|
+
nodes: [declaration$1(), buildMetaXml$1()]
|
|
3241
3241
|
}
|
|
3242
3242
|
} };
|
|
3243
3243
|
(0, odf_js.setDocumentMediaType)(pkg, odf_js.ODF_MEDIA_TYPES.ods);
|
|
@@ -3565,20 +3565,20 @@ var OdsSheet = class {
|
|
|
3565
3565
|
};
|
|
3566
3566
|
//#endregion
|
|
3567
3567
|
//#region src/edit/ods/editor.ts
|
|
3568
|
-
const CONTENT_PART_PATH = "content.xml";
|
|
3569
|
-
function directChild(parent, tag) {
|
|
3568
|
+
const CONTENT_PART_PATH$1 = "content.xml";
|
|
3569
|
+
function directChild$1(parent, tag) {
|
|
3570
3570
|
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
3571
3571
|
}
|
|
3572
|
-
function findRoot(pkg) {
|
|
3573
|
-
const part = pkg.parts[CONTENT_PART_PATH];
|
|
3572
|
+
function findRoot$1(pkg) {
|
|
3573
|
+
const part = pkg.parts[CONTENT_PART_PATH$1];
|
|
3574
3574
|
const root = part?.kind === "xml" ? part.nodes.find((n) => n.type === "element") : void 0;
|
|
3575
|
-
if (root === void 0) throw new Error(`package has no root element at ${CONTENT_PART_PATH}`);
|
|
3575
|
+
if (root === void 0) throw new Error(`package has no root element at ${CONTENT_PART_PATH$1}`);
|
|
3576
3576
|
return root;
|
|
3577
3577
|
}
|
|
3578
3578
|
function findOfficeSpreadsheet(pkg) {
|
|
3579
|
-
const body = directChild(findRoot(pkg), "office:body");
|
|
3580
|
-
const spreadsheet = body === void 0 ? void 0 : directChild(body, "office:spreadsheet");
|
|
3581
|
-
if (spreadsheet === void 0) throw new Error(`${CONTENT_PART_PATH} has no office:body/office:spreadsheet element`);
|
|
3579
|
+
const body = directChild$1(findRoot$1(pkg), "office:body");
|
|
3580
|
+
const spreadsheet = body === void 0 ? void 0 : directChild$1(body, "office:spreadsheet");
|
|
3581
|
+
if (spreadsheet === void 0) throw new Error(`${CONTENT_PART_PATH$1} has no office:body/office:spreadsheet element`);
|
|
3582
3582
|
return spreadsheet;
|
|
3583
3583
|
}
|
|
3584
3584
|
function ensureSheetTableStyleName(pkg) {
|
|
@@ -3587,7 +3587,7 @@ function ensureSheetTableStyleName(pkg) {
|
|
|
3587
3587
|
automaticStyles.children.push(el("style:style", {
|
|
3588
3588
|
"style:name": SHEET_TABLE_STYLE_NAME,
|
|
3589
3589
|
"style:family": "table",
|
|
3590
|
-
"style:master-page-name": MASTER_PAGE_NAME
|
|
3590
|
+
"style:master-page-name": MASTER_PAGE_NAME$1
|
|
3591
3591
|
}));
|
|
3592
3592
|
return SHEET_TABLE_STYLE_NAME;
|
|
3593
3593
|
}
|
|
@@ -3659,6 +3659,598 @@ function appendCell(odsSheet, cell) {
|
|
|
3659
3659
|
if (rowSpan > 1 || colSpan > 1) odsSheet.mergeCells(cell.row, cell.column, rowSpan, colSpan);
|
|
3660
3660
|
}
|
|
3661
3661
|
//#endregion
|
|
3662
|
+
//#region src/edit/odg/scaffold.ts
|
|
3663
|
+
const CONTENT_NS_PREFIXES = [
|
|
3664
|
+
"office",
|
|
3665
|
+
"style",
|
|
3666
|
+
"text",
|
|
3667
|
+
"table",
|
|
3668
|
+
"draw",
|
|
3669
|
+
"fo",
|
|
3670
|
+
"svg",
|
|
3671
|
+
"xlink"
|
|
3672
|
+
];
|
|
3673
|
+
const STYLES_NS_PREFIXES = [
|
|
3674
|
+
"office",
|
|
3675
|
+
"style",
|
|
3676
|
+
"text",
|
|
3677
|
+
"table",
|
|
3678
|
+
"draw",
|
|
3679
|
+
"fo",
|
|
3680
|
+
"svg",
|
|
3681
|
+
"xlink"
|
|
3682
|
+
];
|
|
3683
|
+
const META_NS_PREFIXES = [
|
|
3684
|
+
"office",
|
|
3685
|
+
"meta",
|
|
3686
|
+
"dc"
|
|
3687
|
+
];
|
|
3688
|
+
const ODF_VERSION = "1.3";
|
|
3689
|
+
const MASTER_PAGE_NAME = "Standard";
|
|
3690
|
+
function declaration() {
|
|
3691
|
+
return {
|
|
3692
|
+
type: "declaration",
|
|
3693
|
+
attributes: [
|
|
3694
|
+
{
|
|
3695
|
+
name: "version",
|
|
3696
|
+
value: "1.0"
|
|
3697
|
+
},
|
|
3698
|
+
{
|
|
3699
|
+
name: "encoding",
|
|
3700
|
+
value: "UTF-8"
|
|
3701
|
+
},
|
|
3702
|
+
{
|
|
3703
|
+
name: "standalone",
|
|
3704
|
+
value: "yes"
|
|
3705
|
+
}
|
|
3706
|
+
]
|
|
3707
|
+
};
|
|
3708
|
+
}
|
|
3709
|
+
function buildPageLayout() {
|
|
3710
|
+
return el("style:page-layout", { "style:name": "PM1" }, [el("style:page-layout-properties", {
|
|
3711
|
+
"fo:page-width": `${document_content_model.PAGE_SIZE_A4.widthPt}pt`,
|
|
3712
|
+
"fo:page-height": `${document_content_model.PAGE_SIZE_A4.heightPt}pt`
|
|
3713
|
+
})]);
|
|
3714
|
+
}
|
|
3715
|
+
function buildStylesXml() {
|
|
3716
|
+
return el("office:document-styles", {
|
|
3717
|
+
...(0, odf_js.xmlnsAttributes)([...STYLES_NS_PREFIXES]),
|
|
3718
|
+
"office:version": ODF_VERSION
|
|
3719
|
+
}, [
|
|
3720
|
+
el("office:styles"),
|
|
3721
|
+
el("office:automatic-styles", {}, [buildPageLayout()]),
|
|
3722
|
+
el("office:master-styles", {}, [el("style:master-page", {
|
|
3723
|
+
"style:name": MASTER_PAGE_NAME,
|
|
3724
|
+
"style:page-layout-name": "PM1"
|
|
3725
|
+
})])
|
|
3726
|
+
]);
|
|
3727
|
+
}
|
|
3728
|
+
function buildContentXml() {
|
|
3729
|
+
return el("office:document-content", {
|
|
3730
|
+
...(0, odf_js.xmlnsAttributes)([...CONTENT_NS_PREFIXES]),
|
|
3731
|
+
"office:version": ODF_VERSION
|
|
3732
|
+
}, [el("office:automatic-styles"), el("office:body", {}, [el("office:drawing")])]);
|
|
3733
|
+
}
|
|
3734
|
+
function buildMetaXml() {
|
|
3735
|
+
return el("office:document-meta", {
|
|
3736
|
+
...(0, odf_js.xmlnsAttributes)([...META_NS_PREFIXES]),
|
|
3737
|
+
"office:version": ODF_VERSION
|
|
3738
|
+
}, [el("office:meta")]);
|
|
3739
|
+
}
|
|
3740
|
+
function createEmptyOdgPackage() {
|
|
3741
|
+
const pkg = { parts: {
|
|
3742
|
+
"content.xml": {
|
|
3743
|
+
kind: "xml",
|
|
3744
|
+
nodes: [declaration(), buildContentXml()]
|
|
3745
|
+
},
|
|
3746
|
+
"styles.xml": {
|
|
3747
|
+
kind: "xml",
|
|
3748
|
+
nodes: [declaration(), buildStylesXml()]
|
|
3749
|
+
},
|
|
3750
|
+
"meta.xml": {
|
|
3751
|
+
kind: "xml",
|
|
3752
|
+
nodes: [declaration(), buildMetaXml()]
|
|
3753
|
+
}
|
|
3754
|
+
} };
|
|
3755
|
+
(0, odf_js.setDocumentMediaType)(pkg, odf_js.ODF_MEDIA_TYPES.odg);
|
|
3756
|
+
(0, odf_js.syncManifest)(pkg);
|
|
3757
|
+
return pkg;
|
|
3758
|
+
}
|
|
3759
|
+
//#endregion
|
|
3760
|
+
//#region src/edit/odg/style.ts
|
|
3761
|
+
const GRAPHIC_STYLE_PREFIX = "gr";
|
|
3762
|
+
function graphicPropertyAttrs(init) {
|
|
3763
|
+
const attrs = {};
|
|
3764
|
+
if (init.fill === void 0) attrs["draw:fill"] = "none";
|
|
3765
|
+
else attrs["draw:fill-color"] = (0, odf_js.formatOdfColor)(init.fill);
|
|
3766
|
+
if (init.stroke === void 0) attrs["draw:stroke"] = "none";
|
|
3767
|
+
else {
|
|
3768
|
+
attrs["svg:stroke-color"] = (0, odf_js.formatOdfColor)(init.stroke.color);
|
|
3769
|
+
attrs["svg:stroke-width"] = (0, odf_js.formatOdfLength)(init.stroke.widthPt);
|
|
3770
|
+
}
|
|
3771
|
+
return attrs;
|
|
3772
|
+
}
|
|
3773
|
+
function buildGraphicStyle(pkg, init) {
|
|
3774
|
+
const automaticStyles = ensureAutomaticStyles(pkg);
|
|
3775
|
+
const name = nextStyleName(automaticStyles, "style:style", GRAPHIC_STYLE_PREFIX);
|
|
3776
|
+
automaticStyles.children.push(el("style:style", {
|
|
3777
|
+
"style:name": name,
|
|
3778
|
+
"style:family": "graphic"
|
|
3779
|
+
}, [el("style:graphic-properties", graphicPropertyAttrs(init))]));
|
|
3780
|
+
return name;
|
|
3781
|
+
}
|
|
3782
|
+
function findAutomaticStylesReadOnly(pkg) {
|
|
3783
|
+
const part = pkg.parts["content.xml"];
|
|
3784
|
+
const root = part?.kind === "xml" ? part.nodes.find((n) => n.type === "element") : void 0;
|
|
3785
|
+
if (root === void 0) return;
|
|
3786
|
+
for (const child of root.children) if (child.type === "element" && child.tag === "office:automatic-styles") return child;
|
|
3787
|
+
}
|
|
3788
|
+
function findGraphicStyle(pkg, element) {
|
|
3789
|
+
const styleName = (0, ooxml_js.attr)(element, "draw:style-name");
|
|
3790
|
+
if (styleName === void 0) return;
|
|
3791
|
+
return findAutomaticStylesReadOnly(pkg)?.children.find((c) => c.type === "element" && c.tag === "style:style" && (0, ooxml_js.attr)(c, "style:name") === styleName);
|
|
3792
|
+
}
|
|
3793
|
+
function graphicProperties(pkg, element) {
|
|
3794
|
+
return findGraphicStyle(pkg, element)?.children.find((c) => c.type === "element" && c.tag === "style:graphic-properties");
|
|
3795
|
+
}
|
|
3796
|
+
function readGraphicFill(pkg, element) {
|
|
3797
|
+
const props = graphicProperties(pkg, element);
|
|
3798
|
+
if (props === void 0 || (0, ooxml_js.attr)(props, "draw:fill") === "none") return;
|
|
3799
|
+
const value = (0, ooxml_js.attr)(props, "draw:fill-color");
|
|
3800
|
+
return value === void 0 ? void 0 : (0, odf_js.parseOdfColor)(value);
|
|
3801
|
+
}
|
|
3802
|
+
function readGraphicStroke(pkg, element) {
|
|
3803
|
+
const props = graphicProperties(pkg, element);
|
|
3804
|
+
if (props === void 0 || (0, ooxml_js.attr)(props, "draw:stroke") === "none") return;
|
|
3805
|
+
const colorValue = (0, ooxml_js.attr)(props, "svg:stroke-color");
|
|
3806
|
+
const widthValue = (0, ooxml_js.attr)(props, "svg:stroke-width");
|
|
3807
|
+
const color = colorValue === void 0 ? void 0 : (0, odf_js.parseOdfColor)(colorValue);
|
|
3808
|
+
const widthPt = widthValue === void 0 ? void 0 : (0, odf_js.parseOdfLength)(widthValue);
|
|
3809
|
+
return color === void 0 || widthPt === void 0 ? void 0 : {
|
|
3810
|
+
color,
|
|
3811
|
+
widthPt
|
|
3812
|
+
};
|
|
3813
|
+
}
|
|
3814
|
+
function setGraphicFill(pkg, element, fill) {
|
|
3815
|
+
setAttr(element, "draw:style-name", buildGraphicStyle(pkg, {
|
|
3816
|
+
fill,
|
|
3817
|
+
stroke: readGraphicStroke(pkg, element)
|
|
3818
|
+
}));
|
|
3819
|
+
}
|
|
3820
|
+
function setGraphicStroke(pkg, element, stroke) {
|
|
3821
|
+
setAttr(element, "draw:style-name", buildGraphicStyle(pkg, {
|
|
3822
|
+
fill: readGraphicFill(pkg, element),
|
|
3823
|
+
stroke
|
|
3824
|
+
}));
|
|
3825
|
+
}
|
|
3826
|
+
//#endregion
|
|
3827
|
+
//#region src/edit/odg/svg-path.ts
|
|
3828
|
+
const PATH_NUMBER_DECIMALS = 6;
|
|
3829
|
+
const PATH_NUMBER_SCALE = 10 ** PATH_NUMBER_DECIMALS;
|
|
3830
|
+
function formatPathNumber(value) {
|
|
3831
|
+
if (!Number.isFinite(value)) throw new Error(`cannot format a non-finite path coordinate: ${value}`);
|
|
3832
|
+
const rounded = Math.round(value * PATH_NUMBER_SCALE) / PATH_NUMBER_SCALE;
|
|
3833
|
+
if (rounded === 0) return "0";
|
|
3834
|
+
return rounded.toFixed(PATH_NUMBER_DECIMALS).replace(/0+$/, "").replace(/\.$/, "");
|
|
3835
|
+
}
|
|
3836
|
+
function formatPathPoint(point) {
|
|
3837
|
+
return `${formatPathNumber(point.xPt)} ${formatPathNumber(point.yPt)}`;
|
|
3838
|
+
}
|
|
3839
|
+
function buildSvgPathData(subpaths) {
|
|
3840
|
+
const commands = [];
|
|
3841
|
+
for (const subpath of subpaths) {
|
|
3842
|
+
commands.push(`M${formatPathPoint(subpath.start)}`);
|
|
3843
|
+
for (const segment of subpath.segments) if (segment.kind === "line") commands.push(`L${formatPathPoint(segment.to)}`);
|
|
3844
|
+
else commands.push(`C${formatPathPoint(segment.control1)} ${formatPathPoint(segment.control2)} ${formatPathPoint(segment.to)}`);
|
|
3845
|
+
if (subpath.closed) commands.push("Z");
|
|
3846
|
+
}
|
|
3847
|
+
return commands.join(" ");
|
|
3848
|
+
}
|
|
3849
|
+
function buildSvgViewBox(widthPt, heightPt) {
|
|
3850
|
+
return `0 0 ${formatPathNumber(widthPt)} ${formatPathNumber(heightPt)}`;
|
|
3851
|
+
}
|
|
3852
|
+
//#endregion
|
|
3853
|
+
//#region src/edit/odg/vector.ts
|
|
3854
|
+
function directTextP() {
|
|
3855
|
+
return el("text:p");
|
|
3856
|
+
}
|
|
3857
|
+
function buildBoxVectorElement(pkg, tag, init) {
|
|
3858
|
+
return el(tag, {
|
|
3859
|
+
"draw:style-name": buildGraphicStyle(pkg, {
|
|
3860
|
+
fill: init.fill,
|
|
3861
|
+
stroke: init.stroke
|
|
3862
|
+
}),
|
|
3863
|
+
"svg:x": (0, odf_js.formatOdfLength)(init.frame.xPt),
|
|
3864
|
+
"svg:y": (0, odf_js.formatOdfLength)(init.frame.yPt),
|
|
3865
|
+
"svg:width": (0, odf_js.formatOdfLength)(init.frame.widthPt),
|
|
3866
|
+
"svg:height": (0, odf_js.formatOdfLength)(init.frame.heightPt)
|
|
3867
|
+
}, [directTextP()]);
|
|
3868
|
+
}
|
|
3869
|
+
function buildRectElement(pkg, init) {
|
|
3870
|
+
return buildBoxVectorElement(pkg, "draw:rect", init);
|
|
3871
|
+
}
|
|
3872
|
+
function buildEllipseElement(pkg, init) {
|
|
3873
|
+
return buildBoxVectorElement(pkg, "draw:ellipse", init);
|
|
3874
|
+
}
|
|
3875
|
+
var OdgBoxVector = class {
|
|
3876
|
+
container;
|
|
3877
|
+
node;
|
|
3878
|
+
pkg;
|
|
3879
|
+
removed = false;
|
|
3880
|
+
constructor(container, node, pkg) {
|
|
3881
|
+
this.container = container;
|
|
3882
|
+
this.node = node;
|
|
3883
|
+
this.pkg = pkg;
|
|
3884
|
+
}
|
|
3885
|
+
live() {
|
|
3886
|
+
if (this.removed) throw new Error("this OdgBoxVector has been removed from its page and can no longer be used");
|
|
3887
|
+
return this.node;
|
|
3888
|
+
}
|
|
3889
|
+
get kind() {
|
|
3890
|
+
return this.live().tag === "draw:ellipse" ? "ellipse" : "rect";
|
|
3891
|
+
}
|
|
3892
|
+
get name() {
|
|
3893
|
+
return (0, ooxml_js.attr)(this.live(), "draw:name");
|
|
3894
|
+
}
|
|
3895
|
+
get frame() {
|
|
3896
|
+
return (0, odf_js.parseBox)(this.live());
|
|
3897
|
+
}
|
|
3898
|
+
set frame(value) {
|
|
3899
|
+
const node = this.live();
|
|
3900
|
+
setAttr(node, "svg:x", (0, odf_js.formatOdfLength)(value.xPt));
|
|
3901
|
+
setAttr(node, "svg:y", (0, odf_js.formatOdfLength)(value.yPt));
|
|
3902
|
+
setAttr(node, "svg:width", (0, odf_js.formatOdfLength)(value.widthPt));
|
|
3903
|
+
setAttr(node, "svg:height", (0, odf_js.formatOdfLength)(value.heightPt));
|
|
3904
|
+
}
|
|
3905
|
+
get fill() {
|
|
3906
|
+
return readGraphicFill(this.pkg, this.live());
|
|
3907
|
+
}
|
|
3908
|
+
set fill(value) {
|
|
3909
|
+
setGraphicFill(this.pkg, this.live(), value);
|
|
3910
|
+
}
|
|
3911
|
+
get stroke() {
|
|
3912
|
+
return readGraphicStroke(this.pkg, this.live());
|
|
3913
|
+
}
|
|
3914
|
+
set stroke(value) {
|
|
3915
|
+
setGraphicStroke(this.pkg, this.live(), value);
|
|
3916
|
+
}
|
|
3917
|
+
remove() {
|
|
3918
|
+
removeChild(this.container, this.live());
|
|
3919
|
+
this.removed = true;
|
|
3920
|
+
}
|
|
3921
|
+
};
|
|
3922
|
+
function buildLineElement(pkg, init) {
|
|
3923
|
+
return el("draw:line", {
|
|
3924
|
+
"draw:style-name": buildGraphicStyle(pkg, { stroke: init.stroke }),
|
|
3925
|
+
"svg:x1": (0, odf_js.formatOdfLength)(init.from.xPt),
|
|
3926
|
+
"svg:y1": (0, odf_js.formatOdfLength)(init.from.yPt),
|
|
3927
|
+
"svg:x2": (0, odf_js.formatOdfLength)(init.to.xPt),
|
|
3928
|
+
"svg:y2": (0, odf_js.formatOdfLength)(init.to.yPt)
|
|
3929
|
+
}, [directTextP()]);
|
|
3930
|
+
}
|
|
3931
|
+
var OdgLineVector = class {
|
|
3932
|
+
container;
|
|
3933
|
+
node;
|
|
3934
|
+
pkg;
|
|
3935
|
+
removed = false;
|
|
3936
|
+
constructor(container, node, pkg) {
|
|
3937
|
+
this.container = container;
|
|
3938
|
+
this.node = node;
|
|
3939
|
+
this.pkg = pkg;
|
|
3940
|
+
}
|
|
3941
|
+
live() {
|
|
3942
|
+
if (this.removed) throw new Error("this OdgLineVector has been removed from its page and can no longer be used");
|
|
3943
|
+
return this.node;
|
|
3944
|
+
}
|
|
3945
|
+
get name() {
|
|
3946
|
+
return (0, ooxml_js.attr)(this.live(), "draw:name");
|
|
3947
|
+
}
|
|
3948
|
+
get from() {
|
|
3949
|
+
return (0, odf_js.parseLinePoints)(this.live())?.from;
|
|
3950
|
+
}
|
|
3951
|
+
set from(value) {
|
|
3952
|
+
const node = this.live();
|
|
3953
|
+
setAttr(node, "svg:x1", (0, odf_js.formatOdfLength)(value.xPt));
|
|
3954
|
+
setAttr(node, "svg:y1", (0, odf_js.formatOdfLength)(value.yPt));
|
|
3955
|
+
}
|
|
3956
|
+
get to() {
|
|
3957
|
+
return (0, odf_js.parseLinePoints)(this.live())?.to;
|
|
3958
|
+
}
|
|
3959
|
+
set to(value) {
|
|
3960
|
+
const node = this.live();
|
|
3961
|
+
setAttr(node, "svg:x2", (0, odf_js.formatOdfLength)(value.xPt));
|
|
3962
|
+
setAttr(node, "svg:y2", (0, odf_js.formatOdfLength)(value.yPt));
|
|
3963
|
+
}
|
|
3964
|
+
get stroke() {
|
|
3965
|
+
return readGraphicStroke(this.pkg, this.live());
|
|
3966
|
+
}
|
|
3967
|
+
set stroke(value) {
|
|
3968
|
+
setGraphicStroke(this.pkg, this.live(), value);
|
|
3969
|
+
}
|
|
3970
|
+
remove() {
|
|
3971
|
+
removeChild(this.container, this.live());
|
|
3972
|
+
this.removed = true;
|
|
3973
|
+
}
|
|
3974
|
+
};
|
|
3975
|
+
function buildPathElement(pkg, init) {
|
|
3976
|
+
return el("draw:path", {
|
|
3977
|
+
"draw:style-name": buildGraphicStyle(pkg, {
|
|
3978
|
+
fill: init.fill,
|
|
3979
|
+
stroke: init.stroke
|
|
3980
|
+
}),
|
|
3981
|
+
"svg:x": (0, odf_js.formatOdfLength)(init.frame.xPt),
|
|
3982
|
+
"svg:y": (0, odf_js.formatOdfLength)(init.frame.yPt),
|
|
3983
|
+
"svg:width": (0, odf_js.formatOdfLength)(init.frame.widthPt),
|
|
3984
|
+
"svg:height": (0, odf_js.formatOdfLength)(init.frame.heightPt),
|
|
3985
|
+
"svg:viewBox": buildSvgViewBox(init.frame.widthPt, init.frame.heightPt),
|
|
3986
|
+
"svg:d": buildSvgPathData(init.subpaths)
|
|
3987
|
+
}, [directTextP()]);
|
|
3988
|
+
}
|
|
3989
|
+
var OdgPathVector = class {
|
|
3990
|
+
container;
|
|
3991
|
+
node;
|
|
3992
|
+
pkg;
|
|
3993
|
+
removed = false;
|
|
3994
|
+
constructor(container, node, pkg) {
|
|
3995
|
+
this.container = container;
|
|
3996
|
+
this.node = node;
|
|
3997
|
+
this.pkg = pkg;
|
|
3998
|
+
}
|
|
3999
|
+
live() {
|
|
4000
|
+
if (this.removed) throw new Error("this OdgPathVector has been removed from its page and can no longer be used");
|
|
4001
|
+
return this.node;
|
|
4002
|
+
}
|
|
4003
|
+
get name() {
|
|
4004
|
+
return (0, ooxml_js.attr)(this.live(), "draw:name");
|
|
4005
|
+
}
|
|
4006
|
+
get frame() {
|
|
4007
|
+
return (0, odf_js.parseBox)(this.live());
|
|
4008
|
+
}
|
|
4009
|
+
set frame(value) {
|
|
4010
|
+
const node = this.live();
|
|
4011
|
+
setAttr(node, "svg:x", (0, odf_js.formatOdfLength)(value.xPt));
|
|
4012
|
+
setAttr(node, "svg:y", (0, odf_js.formatOdfLength)(value.yPt));
|
|
4013
|
+
setAttr(node, "svg:width", (0, odf_js.formatOdfLength)(value.widthPt));
|
|
4014
|
+
setAttr(node, "svg:height", (0, odf_js.formatOdfLength)(value.heightPt));
|
|
4015
|
+
}
|
|
4016
|
+
get fill() {
|
|
4017
|
+
return readGraphicFill(this.pkg, this.live());
|
|
4018
|
+
}
|
|
4019
|
+
set fill(value) {
|
|
4020
|
+
setGraphicFill(this.pkg, this.live(), value);
|
|
4021
|
+
}
|
|
4022
|
+
get stroke() {
|
|
4023
|
+
return readGraphicStroke(this.pkg, this.live());
|
|
4024
|
+
}
|
|
4025
|
+
set stroke(value) {
|
|
4026
|
+
setGraphicStroke(this.pkg, this.live(), value);
|
|
4027
|
+
}
|
|
4028
|
+
get subpaths() {
|
|
4029
|
+
const node = this.live();
|
|
4030
|
+
const viewBoxValue = (0, ooxml_js.attr)(node, "svg:viewBox");
|
|
4031
|
+
const dValue = (0, ooxml_js.attr)(node, "svg:d");
|
|
4032
|
+
const frame = (0, odf_js.parseBox)(node);
|
|
4033
|
+
if (viewBoxValue === void 0 || dValue === void 0 || frame === void 0) return [];
|
|
4034
|
+
const viewBox = (0, odf_js.parseOdfViewBox)(viewBoxValue);
|
|
4035
|
+
if (viewBox === void 0) return [];
|
|
4036
|
+
return (0, odf_js.buildOdfSubpaths)((0, odf_js.parseOdfPathData)(dValue), viewBox, frame);
|
|
4037
|
+
}
|
|
4038
|
+
remove() {
|
|
4039
|
+
removeChild(this.container, this.live());
|
|
4040
|
+
this.removed = true;
|
|
4041
|
+
}
|
|
4042
|
+
};
|
|
4043
|
+
//#endregion
|
|
4044
|
+
//#region src/edit/odg/page.ts
|
|
4045
|
+
var OdgPage = class {
|
|
4046
|
+
container;
|
|
4047
|
+
node;
|
|
4048
|
+
context;
|
|
4049
|
+
removed = false;
|
|
4050
|
+
constructor(container, node, context) {
|
|
4051
|
+
this.container = container;
|
|
4052
|
+
this.node = node;
|
|
4053
|
+
this.context = context;
|
|
4054
|
+
}
|
|
4055
|
+
live() {
|
|
4056
|
+
if (this.removed) throw new Error("this OdgPage has been removed from the drawing and can no longer be used");
|
|
4057
|
+
return this.node;
|
|
4058
|
+
}
|
|
4059
|
+
shapes() {
|
|
4060
|
+
const node = this.live();
|
|
4061
|
+
const out = [];
|
|
4062
|
+
for (const child of node.children) if (child.type === "element" && child.tag === "draw:frame") out.push(new OdpShape(node.children, child, this.context.pkg));
|
|
4063
|
+
return out;
|
|
4064
|
+
}
|
|
4065
|
+
addTextBox(init) {
|
|
4066
|
+
const node = this.live();
|
|
4067
|
+
const frameElement = buildTextBoxFrame(this.context.pkg, init.frame, init.text);
|
|
4068
|
+
node.children.push(frameElement);
|
|
4069
|
+
return new OdpShape(node.children, frameElement, this.context.pkg);
|
|
4070
|
+
}
|
|
4071
|
+
addImage(init) {
|
|
4072
|
+
const node = this.live();
|
|
4073
|
+
const frameElement = insertImageFrameMedia({ pkg: this.context.pkg }, init.frame, init);
|
|
4074
|
+
node.children.push(frameElement);
|
|
4075
|
+
return new OdpShape(node.children, frameElement, this.context.pkg);
|
|
4076
|
+
}
|
|
4077
|
+
addRect(init) {
|
|
4078
|
+
const node = this.live();
|
|
4079
|
+
const element = buildRectElement(this.context.pkg, init);
|
|
4080
|
+
node.children.push(element);
|
|
4081
|
+
return new OdgBoxVector(node.children, element, this.context.pkg);
|
|
4082
|
+
}
|
|
4083
|
+
addEllipse(init) {
|
|
4084
|
+
const node = this.live();
|
|
4085
|
+
const element = buildEllipseElement(this.context.pkg, init);
|
|
4086
|
+
node.children.push(element);
|
|
4087
|
+
return new OdgBoxVector(node.children, element, this.context.pkg);
|
|
4088
|
+
}
|
|
4089
|
+
addLine(init) {
|
|
4090
|
+
const node = this.live();
|
|
4091
|
+
const element = buildLineElement(this.context.pkg, init);
|
|
4092
|
+
node.children.push(element);
|
|
4093
|
+
return new OdgLineVector(node.children, element, this.context.pkg);
|
|
4094
|
+
}
|
|
4095
|
+
addPath(init) {
|
|
4096
|
+
const node = this.live();
|
|
4097
|
+
const element = buildPathElement(this.context.pkg, init);
|
|
4098
|
+
node.children.push(element);
|
|
4099
|
+
return new OdgPathVector(node.children, element, this.context.pkg);
|
|
4100
|
+
}
|
|
4101
|
+
remove() {
|
|
4102
|
+
removeChild(this.container, this.live());
|
|
4103
|
+
this.removed = true;
|
|
4104
|
+
}
|
|
4105
|
+
};
|
|
4106
|
+
//#endregion
|
|
4107
|
+
//#region src/edit/odg/editor.ts
|
|
4108
|
+
const CONTENT_PART_PATH = "content.xml";
|
|
4109
|
+
const STYLES_PART_PATH = "styles.xml";
|
|
4110
|
+
function directChild(parent, tag) {
|
|
4111
|
+
for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
|
|
4112
|
+
}
|
|
4113
|
+
function findRoot(pkg, partPath) {
|
|
4114
|
+
const part = pkg.parts[partPath];
|
|
4115
|
+
const root = part?.kind === "xml" ? part.nodes.find((n) => n.type === "element") : void 0;
|
|
4116
|
+
if (root === void 0) throw new Error(`package has no root element at ${partPath}`);
|
|
4117
|
+
return root;
|
|
4118
|
+
}
|
|
4119
|
+
function findOfficeDrawing(pkg) {
|
|
4120
|
+
const body = directChild(findRoot(pkg, CONTENT_PART_PATH), "office:body");
|
|
4121
|
+
const drawing = body === void 0 ? void 0 : directChild(body, "office:drawing");
|
|
4122
|
+
if (drawing === void 0) throw new Error(`${CONTENT_PART_PATH} has no office:body/office:drawing element`);
|
|
4123
|
+
return drawing;
|
|
4124
|
+
}
|
|
4125
|
+
function findPageLayoutProperties(pkg) {
|
|
4126
|
+
const pageLayout = directChild(findRoot(pkg, STYLES_PART_PATH), "office:automatic-styles")?.children.find((c) => c.type === "element" && c.tag === "style:page-layout" && (0, ooxml_js.attr)(c, "style:name") === "PM1");
|
|
4127
|
+
const properties = pageLayout === void 0 ? void 0 : directChild(pageLayout, "style:page-layout-properties");
|
|
4128
|
+
if (properties === void 0) throw new Error(`${STYLES_PART_PATH} has no style:page-layout[style:name="PM1"]/style:page-layout-properties element`);
|
|
4129
|
+
return properties;
|
|
4130
|
+
}
|
|
4131
|
+
var OdgEditor = class {
|
|
4132
|
+
pkg;
|
|
4133
|
+
constructor(pkg) {
|
|
4134
|
+
this.pkg = pkg;
|
|
4135
|
+
}
|
|
4136
|
+
pages() {
|
|
4137
|
+
const drawing = findOfficeDrawing(this.pkg);
|
|
4138
|
+
const out = [];
|
|
4139
|
+
for (const child of drawing.children) if (child.type === "element" && child.tag === "draw:page") {
|
|
4140
|
+
const context = { pkg: this.pkg };
|
|
4141
|
+
out.push(new OdgPage(drawing.children, child, context));
|
|
4142
|
+
}
|
|
4143
|
+
return out;
|
|
4144
|
+
}
|
|
4145
|
+
addPage() {
|
|
4146
|
+
const drawing = findOfficeDrawing(this.pkg);
|
|
4147
|
+
const pageElement = el("draw:page", { "draw:master-page-name": MASTER_PAGE_NAME });
|
|
4148
|
+
drawing.children.push(pageElement);
|
|
4149
|
+
const context = { pkg: this.pkg };
|
|
4150
|
+
return new OdgPage(drawing.children, pageElement, context);
|
|
4151
|
+
}
|
|
4152
|
+
removePageAt(index) {
|
|
4153
|
+
const drawing = findOfficeDrawing(this.pkg);
|
|
4154
|
+
const target = drawing.children.filter((c) => c.type === "element" && c.tag === "draw:page")[index];
|
|
4155
|
+
if (target === void 0) throw new Error(`page index ${index} does not exist`);
|
|
4156
|
+
const listIndex = drawing.children.indexOf(target);
|
|
4157
|
+
drawing.children.splice(listIndex, 1);
|
|
4158
|
+
}
|
|
4159
|
+
get pageSize() {
|
|
4160
|
+
const properties = findPageLayoutProperties(this.pkg);
|
|
4161
|
+
const widthValue = (0, ooxml_js.attr)(properties, "fo:page-width");
|
|
4162
|
+
const heightValue = (0, ooxml_js.attr)(properties, "fo:page-height");
|
|
4163
|
+
const widthPt = widthValue === void 0 ? void 0 : (0, odf_js.parseOdfLength)(widthValue);
|
|
4164
|
+
const heightPt = heightValue === void 0 ? void 0 : (0, odf_js.parseOdfLength)(heightValue);
|
|
4165
|
+
return {
|
|
4166
|
+
widthPt: widthPt ?? 0,
|
|
4167
|
+
heightPt: heightPt ?? 0
|
|
4168
|
+
};
|
|
4169
|
+
}
|
|
4170
|
+
set pageSize(size) {
|
|
4171
|
+
const properties = findPageLayoutProperties(this.pkg);
|
|
4172
|
+
properties.attributes = [{
|
|
4173
|
+
name: "fo:page-width",
|
|
4174
|
+
value: (0, odf_js.formatOdfLength)(size.widthPt)
|
|
4175
|
+
}, {
|
|
4176
|
+
name: "fo:page-height",
|
|
4177
|
+
value: (0, odf_js.formatOdfLength)(size.heightPt)
|
|
4178
|
+
}];
|
|
4179
|
+
}
|
|
4180
|
+
toPackage() {
|
|
4181
|
+
return this.pkg;
|
|
4182
|
+
}
|
|
4183
|
+
toBytes() {
|
|
4184
|
+
return (0, odf_js.encodePackage)(this.pkg);
|
|
4185
|
+
}
|
|
4186
|
+
};
|
|
4187
|
+
function openOdg(bytes) {
|
|
4188
|
+
return new OdgEditor((0, odf_js.decodePackage)(bytes));
|
|
4189
|
+
}
|
|
4190
|
+
function createOdg() {
|
|
4191
|
+
return new OdgEditor(createEmptyOdgPackage());
|
|
4192
|
+
}
|
|
4193
|
+
//#endregion
|
|
4194
|
+
//#region src/edit/odg/content.ts
|
|
4195
|
+
function buildOdgPackage(content) {
|
|
4196
|
+
if (content.kind !== "drawing") throw new Error("buildOdgPackage requires a drawing ContentDocument");
|
|
4197
|
+
const editor = createOdg();
|
|
4198
|
+
const firstPage = content.pages[0];
|
|
4199
|
+
if (firstPage !== void 0) editor.pageSize = firstPage.size;
|
|
4200
|
+
for (const page of content.pages) {
|
|
4201
|
+
const odgPage = editor.addPage();
|
|
4202
|
+
for (const vector of page.vectors) appendVector(odgPage, vector);
|
|
4203
|
+
for (const shape of page.shapes) appendShape(odgPage, shape);
|
|
4204
|
+
}
|
|
4205
|
+
return editor.toPackage();
|
|
4206
|
+
}
|
|
4207
|
+
function appendVector(page, vector) {
|
|
4208
|
+
if (vector.kind === "rect") page.addRect({
|
|
4209
|
+
frame: vector.frame,
|
|
4210
|
+
fill: vector.fill,
|
|
4211
|
+
stroke: vector.stroke
|
|
4212
|
+
});
|
|
4213
|
+
else if (vector.kind === "ellipse") page.addEllipse({
|
|
4214
|
+
frame: vector.frame,
|
|
4215
|
+
fill: vector.fill,
|
|
4216
|
+
stroke: vector.stroke
|
|
4217
|
+
});
|
|
4218
|
+
else if (vector.kind === "line") page.addLine({
|
|
4219
|
+
from: vector.from,
|
|
4220
|
+
to: vector.to,
|
|
4221
|
+
stroke: vector.stroke
|
|
4222
|
+
});
|
|
4223
|
+
else page.addPath({
|
|
4224
|
+
frame: vector.frame,
|
|
4225
|
+
subpaths: vector.subpaths,
|
|
4226
|
+
fill: vector.fill,
|
|
4227
|
+
stroke: vector.stroke
|
|
4228
|
+
});
|
|
4229
|
+
}
|
|
4230
|
+
function appendShape(page, shape) {
|
|
4231
|
+
const [onlyBlock] = shape.blocks;
|
|
4232
|
+
if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
|
|
4233
|
+
const imageShape = page.addImage({
|
|
4234
|
+
frame: shape.frame,
|
|
4235
|
+
format: onlyBlock.format,
|
|
4236
|
+
bytes: (0, odf_js.base64ToBytes)(onlyBlock.base64),
|
|
4237
|
+
altText: onlyBlock.altText
|
|
4238
|
+
});
|
|
4239
|
+
if (shape.rotationDeg !== void 0) imageShape.rotationDeg = shape.rotationDeg;
|
|
4240
|
+
return;
|
|
4241
|
+
}
|
|
4242
|
+
const textShape = page.addTextBox({
|
|
4243
|
+
frame: shape.frame,
|
|
4244
|
+
text: ""
|
|
4245
|
+
});
|
|
4246
|
+
if (shape.rotationDeg !== void 0) textShape.rotationDeg = shape.rotationDeg;
|
|
4247
|
+
textShape.paragraphs()[0]?.remove();
|
|
4248
|
+
for (const block of shape.blocks) {
|
|
4249
|
+
if (block.kind !== "paragraph") continue;
|
|
4250
|
+
populateParagraph(textShape.appendParagraph(), block);
|
|
4251
|
+
}
|
|
4252
|
+
}
|
|
4253
|
+
//#endregion
|
|
3662
4254
|
//#region src/bytes/crc32.ts
|
|
3663
4255
|
const CRC32_POLYNOMIAL = 3988292384;
|
|
3664
4256
|
const BYTE_VALUES = 256;
|
|
@@ -10507,7 +11099,12 @@ Object.defineProperty(exports, "LAYOUT_FORMAT_VERSION", {
|
|
|
10507
11099
|
}
|
|
10508
11100
|
});
|
|
10509
11101
|
exports.NOOP_DIAGNOSTIC_SINK = NOOP_DIAGNOSTIC_SINK;
|
|
11102
|
+
exports.OdgBoxVector = OdgBoxVector;
|
|
10510
11103
|
exports.OdgBytesSchema = OdgBytesSchema;
|
|
11104
|
+
exports.OdgEditor = OdgEditor;
|
|
11105
|
+
exports.OdgLineVector = OdgLineVector;
|
|
11106
|
+
exports.OdgPage = OdgPage;
|
|
11107
|
+
exports.OdgPathVector = OdgPathVector;
|
|
10511
11108
|
exports.OdpBytesSchema = OdpBytesSchema;
|
|
10512
11109
|
exports.OdpEditor = OdpEditor;
|
|
10513
11110
|
exports.OdpShape = OdpShape;
|
|
@@ -10629,6 +11226,7 @@ Object.defineProperty(exports, "base64ToBytes", {
|
|
|
10629
11226
|
}
|
|
10630
11227
|
});
|
|
10631
11228
|
exports.buildDocxPackage = buildDocxPackage;
|
|
11229
|
+
exports.buildOdgPackage = buildOdgPackage;
|
|
10632
11230
|
exports.buildOdpPackage = buildOdpPackage;
|
|
10633
11231
|
exports.buildOdsPackage = buildOdsPackage;
|
|
10634
11232
|
exports.buildOdtPackage = buildOdtPackage;
|
|
@@ -10669,6 +11267,7 @@ exports.convertSpreadsheetToLayout = convertSpreadsheetToLayout;
|
|
|
10669
11267
|
exports.convertWordprocessingToLayout = convertWordprocessingToLayout;
|
|
10670
11268
|
exports.createDocx = createDocx;
|
|
10671
11269
|
exports.createLocalDocumentConverter = createLocalDocumentConverter;
|
|
11270
|
+
exports.createOdg = createOdg;
|
|
10672
11271
|
exports.createOdp = createOdp;
|
|
10673
11272
|
exports.createOds = createOds;
|
|
10674
11273
|
exports.createOdt = createOdt;
|
|
@@ -10744,6 +11343,7 @@ exports.odsToPdf = odsToPdf;
|
|
|
10744
11343
|
exports.odtPdfCodec = odtPdfCodec;
|
|
10745
11344
|
exports.odtToPdf = odtToPdf;
|
|
10746
11345
|
exports.openDocx = openDocx;
|
|
11346
|
+
exports.openOdg = openOdg;
|
|
10747
11347
|
exports.openOdp = openOdp;
|
|
10748
11348
|
exports.openOds = openOds;
|
|
10749
11349
|
exports.openOdt = openOdt;
|