js.documents 1.91.8 → 1.92.1
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/dist/convert/capability.cjs +24 -0
- package/dist/convert/capability.js +25 -1
- package/dist/convert/convert.cjs +55 -0
- package/dist/convert/convert.d.cts +5 -1
- package/dist/convert/convert.d.ts +5 -1
- package/dist/convert/convert.js +57 -6
- package/dist/convert/variant-bridges.cjs +74 -0
- package/dist/convert/variant-bridges.d.cts +12 -0
- package/dist/convert/variant-bridges.d.ts +12 -0
- package/dist/convert/variant-bridges.js +72 -0
- package/dist/edit/geometry.d.ts +1 -1
- package/dist/edit/markdown/editor.d.ts +1 -1
- package/dist/edit/odg/editor.d.ts +1 -1
- package/dist/edit/odg/page.d.ts +2 -2
- package/dist/edit/odp/editor.d.ts +1 -1
- package/dist/edit/odp/image.d.ts +1 -1
- package/dist/edit/odp/shape.d.ts +1 -1
- package/dist/edit/odp/slide.d.ts +4 -4
- package/dist/edit/odt/content.d.ts +2 -2
- package/dist/edit/odt/editor.d.ts +4 -4
- package/dist/edit/odt/formula.d.ts +1 -1
- package/dist/edit/odt/image.d.ts +1 -1
- package/dist/edit/odt/list.d.ts +1 -1
- package/dist/edit/odt/paragraph.d.ts +1 -1
- package/dist/edit/odt/table.d.ts +1 -1
- package/dist/edit/pdf/util.cjs +4 -4
- package/dist/edit/pdf/util.js +1 -1
- package/dist/edit/pptx/editor.d.ts +1 -1
- package/dist/edit/pptx/image.d.ts +1 -1
- package/dist/edit/pptx/shape.d.ts +1 -1
- package/dist/edit/pptx/slide.d.ts +4 -4
- package/dist/edit/pptx/table.d.ts +1 -1
- package/dist/geometry-BG4fX9Rw.d.ts +6 -0
- package/dist/{image-BgN3j3ly.d.ts → image-CE7nO8YY.d.ts} +1 -1
- package/dist/{image-BFn8Rm6P.d.ts → image-CsyoXX7d.d.ts} +1 -1
- package/dist/{image-CNuBLN5L.d.ts → image-hTGo7C8g.d.ts} +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +9 -9
- package/dist/index.js +2 -2
- package/dist/layout/shared.cjs +4 -4
- package/dist/layout/shared.js +1 -1
- package/dist/{list-CSIIzXAV.d.ts → list-BrAIR4Sv.d.ts} +1 -1
- package/dist/model/geometry.d.ts +1 -1
- package/dist/odb/report/render.js +3 -3
- package/dist/odb/spreadsheet.js +2 -2
- package/dist/odf/formula/detect.d.ts +1 -1
- package/dist/odf/shared/flow-anchor.d.ts +1 -1
- package/dist/{paragraph--0f7PjzJ.d.ts → paragraph-DZyHl2e4.d.ts} +1 -1
- package/dist/{shape-CnYhKn5U.d.ts → shape-D4xELCZY.d.ts} +1 -1
- package/dist/{shape-tOOiQ2UZ.d.ts → shape-DGlNMY73.d.ts} +3 -3
- package/dist/{table-ce9uQfqn.d.ts → table-DQksyfnT.d.ts} +2 -2
- package/dist/{table-DUM0vvIO.d.ts → table-qaDB5iJO.d.ts} +1 -1
- package/package.json +2 -1
- package/dist/geometry-DUF273hM.d.ts +0 -6
|
@@ -214,6 +214,30 @@ const DIRECT_EDGES = [
|
|
|
214
214
|
source: "odt",
|
|
215
215
|
target: "markdown",
|
|
216
216
|
convert: require_convert_convert.odtToMarkdown
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
kind: "bridge",
|
|
220
|
+
source: "docx",
|
|
221
|
+
target: "pptx",
|
|
222
|
+
convert: require_convert_convert.docxToPptx
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
kind: "bridge",
|
|
226
|
+
source: "pptx",
|
|
227
|
+
target: "docx",
|
|
228
|
+
convert: require_convert_convert.pptxToDocx
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
kind: "bridge",
|
|
232
|
+
source: "odt",
|
|
233
|
+
target: "odp",
|
|
234
|
+
convert: require_convert_convert.odtToOdp
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
kind: "bridge",
|
|
238
|
+
source: "odp",
|
|
239
|
+
target: "odt",
|
|
240
|
+
convert: require_convert_convert.odpToOdt
|
|
217
241
|
}
|
|
218
242
|
];
|
|
219
243
|
function resolveConversionPath(source, target, edges = DIRECT_EDGES) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { docxToMarkdown, docxToOdt, docxToPdf, markdownToDocx, markdownToOdt, markdownToPdf, odfToPdf, odgToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf } from "./convert.js";
|
|
1
|
+
import { docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, markdownToDocx, markdownToOdt, markdownToPdf, odfToPdf, odgToPdf, odpToOdt, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToDocx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf } from "./convert.js";
|
|
2
2
|
//#region src/convert/capability.ts
|
|
3
3
|
const FORMAT_CAPABILITIES = {
|
|
4
4
|
docx: {
|
|
@@ -213,6 +213,30 @@ const DIRECT_EDGES = [
|
|
|
213
213
|
source: "odt",
|
|
214
214
|
target: "markdown",
|
|
215
215
|
convert: odtToMarkdown
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
kind: "bridge",
|
|
219
|
+
source: "docx",
|
|
220
|
+
target: "pptx",
|
|
221
|
+
convert: docxToPptx
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
kind: "bridge",
|
|
225
|
+
source: "pptx",
|
|
226
|
+
target: "docx",
|
|
227
|
+
convert: pptxToDocx
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
kind: "bridge",
|
|
231
|
+
source: "odt",
|
|
232
|
+
target: "odp",
|
|
233
|
+
convert: odtToOdp
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
kind: "bridge",
|
|
237
|
+
source: "odp",
|
|
238
|
+
target: "odt",
|
|
239
|
+
convert: odpToOdt
|
|
216
240
|
}
|
|
217
241
|
];
|
|
218
242
|
function resolveConversionPath(source, target, edges = DIRECT_EDGES) {
|
package/dist/convert/convert.cjs
CHANGED
|
@@ -29,6 +29,7 @@ const require_layout_reconstruct = require("../layout/reconstruct.cjs");
|
|
|
29
29
|
const require_odb_csv = require("../odb/csv.cjs");
|
|
30
30
|
const require_odb_read = require("../odb/read.cjs");
|
|
31
31
|
const require_odb_spreadsheet = require("../odb/spreadsheet.cjs");
|
|
32
|
+
const require_convert_variant_bridges = require("./variant-bridges.cjs");
|
|
32
33
|
let ooxml_js = require("ooxml.js");
|
|
33
34
|
let document_schema_js = require("document-schema.js");
|
|
34
35
|
let odf_js = require("odf.js");
|
|
@@ -469,6 +470,56 @@ function odtToMarkdown(bytes, options) {
|
|
|
469
470
|
const text = require_markdown_write.buildMarkdownText(content);
|
|
470
471
|
return require_markdown_text.encodeMarkdownText(text);
|
|
471
472
|
}
|
|
473
|
+
function docxToPptx(bytes, options) {
|
|
474
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
475
|
+
const content = require_ooxml_docx_read.readDocxContent((0, odf_js.decodePackage)(bytes));
|
|
476
|
+
if (content.kind !== "wordprocessing") throw new Error("readDocxContent returned a non-wordprocessing ContentDocument");
|
|
477
|
+
const presentation = require_convert_variant_bridges.wordprocessingToPresentation(content);
|
|
478
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
479
|
+
options?.onDocument?.({
|
|
480
|
+
formatVersion: document_schema_js.DOCUMENT_PACKAGE_FORMAT_VERSION,
|
|
481
|
+
content: presentation
|
|
482
|
+
});
|
|
483
|
+
return (0, ooxml_js.encodePackage)(require_edit_pptx_content.buildPptxPackage(presentation));
|
|
484
|
+
}
|
|
485
|
+
function pptxToDocx(bytes, options) {
|
|
486
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
487
|
+
const content = require_ooxml_pptx_read.readPptxContent((0, odf_js.decodePackage)(bytes));
|
|
488
|
+
if (content.kind !== "presentation") throw new Error("readPptxContent returned a non-presentation ContentDocument");
|
|
489
|
+
const wordprocessing = require_convert_variant_bridges.presentationToWordprocessing(content);
|
|
490
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
491
|
+
options?.onDocument?.({
|
|
492
|
+
formatVersion: document_schema_js.DOCUMENT_PACKAGE_FORMAT_VERSION,
|
|
493
|
+
content: wordprocessing
|
|
494
|
+
});
|
|
495
|
+
return (0, ooxml_js.encodePackage)(require_edit_docx_content.buildDocxPackage(wordprocessing, { onMathDiagnostic: options?.onMathDiagnostic }));
|
|
496
|
+
}
|
|
497
|
+
function odtToOdp(bytes, options) {
|
|
498
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
499
|
+
const pkg = (0, odf_js.decodePackage)(bytes);
|
|
500
|
+
const content = require_odf_odt_read.readOdtContent(pkg);
|
|
501
|
+
if (content.kind !== "wordprocessing") throw new Error("readOdtContent returned a non-wordprocessing ContentDocument");
|
|
502
|
+
const presentation = require_convert_variant_bridges.wordprocessingToPresentation(content);
|
|
503
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
504
|
+
options?.onDocument?.({
|
|
505
|
+
formatVersion: document_schema_js.DOCUMENT_PACKAGE_FORMAT_VERSION,
|
|
506
|
+
content: presentation
|
|
507
|
+
});
|
|
508
|
+
return (0, ooxml_js.encodePackage)(require_edit_odp_content.buildOdpPackage(presentation));
|
|
509
|
+
}
|
|
510
|
+
function odpToOdt(bytes, options) {
|
|
511
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
512
|
+
const pkg = (0, odf_js.decodePackage)(bytes);
|
|
513
|
+
const content = require_odf_odp_read.readOdpContent(pkg);
|
|
514
|
+
if (content.kind !== "presentation") throw new Error("readOdpContent returned a non-presentation ContentDocument");
|
|
515
|
+
const wordprocessing = require_convert_variant_bridges.presentationToWordprocessing(content);
|
|
516
|
+
require_ports_abort.throwIfAborted(options?.signal);
|
|
517
|
+
options?.onDocument?.({
|
|
518
|
+
formatVersion: document_schema_js.DOCUMENT_PACKAGE_FORMAT_VERSION,
|
|
519
|
+
content: wordprocessing
|
|
520
|
+
});
|
|
521
|
+
return (0, ooxml_js.encodePackage)(require_edit_odt_content.buildOdtPackage(wordprocessing));
|
|
522
|
+
}
|
|
472
523
|
function xlsxToPdf(bytes, options) {
|
|
473
524
|
require_ports_abort.throwIfAborted(options?.signal);
|
|
474
525
|
const odsBytes = xlsxToOds(bytes, { signal: options?.signal });
|
|
@@ -641,6 +692,7 @@ exports.OdmUnresolvedSectionError = OdmUnresolvedSectionError;
|
|
|
641
692
|
exports.docxToMarkdown = docxToMarkdown;
|
|
642
693
|
exports.docxToOdt = docxToOdt;
|
|
643
694
|
exports.docxToPdf = docxToPdf;
|
|
695
|
+
exports.docxToPptx = docxToPptx;
|
|
644
696
|
exports.inlineOdmSectionToContentSection = inlineOdmSectionToContentSection;
|
|
645
697
|
exports.markdownToDocx = markdownToDocx;
|
|
646
698
|
exports.markdownToOdt = markdownToOdt;
|
|
@@ -653,12 +705,14 @@ exports.odbToXlsx = odbToXlsx;
|
|
|
653
705
|
exports.odfToPdf = odfToPdf;
|
|
654
706
|
exports.odgToPdf = odgToPdf;
|
|
655
707
|
exports.odmToPdf = odmToPdf;
|
|
708
|
+
exports.odpToOdt = odpToOdt;
|
|
656
709
|
exports.odpToPdf = odpToPdf;
|
|
657
710
|
exports.odpToPptx = odpToPptx;
|
|
658
711
|
exports.odsToPdf = odsToPdf;
|
|
659
712
|
exports.odsToXlsx = odsToXlsx;
|
|
660
713
|
exports.odtToDocx = odtToDocx;
|
|
661
714
|
exports.odtToMarkdown = odtToMarkdown;
|
|
715
|
+
exports.odtToOdp = odtToOdp;
|
|
662
716
|
exports.odtToPdf = odtToPdf;
|
|
663
717
|
exports.pdfToDocx = pdfToDocx;
|
|
664
718
|
exports.pdfToMarkdown = pdfToMarkdown;
|
|
@@ -668,6 +722,7 @@ exports.pdfToOds = pdfToOds;
|
|
|
668
722
|
exports.pdfToOdt = pdfToOdt;
|
|
669
723
|
exports.pdfToPptx = pdfToPptx;
|
|
670
724
|
exports.pdfToXlsx = pdfToXlsx;
|
|
725
|
+
exports.pptxToDocx = pptxToDocx;
|
|
671
726
|
exports.pptxToOdp = pptxToOdp;
|
|
672
727
|
exports.pptxToPdf = pptxToPdf;
|
|
673
728
|
exports.xlsxToOds = xlsxToOds;
|
|
@@ -55,6 +55,10 @@ declare function markdownToDocx(bytes: Uint8Array<ArrayBuffer>, options?: Docume
|
|
|
55
55
|
declare function docxToMarkdown(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
56
56
|
declare function markdownToOdt(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
57
57
|
declare function odtToMarkdown(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
58
|
+
declare function docxToPptx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
59
|
+
declare function pptxToDocx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
60
|
+
declare function odtToOdp(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
61
|
+
declare function odpToOdt(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
58
62
|
declare function xlsxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
59
63
|
declare function pdfToXlsx(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
60
64
|
interface OdmToPdfOptions extends DocumentToPdfOptions {
|
|
@@ -85,4 +89,4 @@ interface OdbReportToOdtOptions {
|
|
|
85
89
|
declare function odbReportToOdt(content: ContentDocument, options?: OdbReportToOdtOptions): Uint8Array<ArrayBuffer>;
|
|
86
90
|
declare function odbReportToPdf(content: ContentDocument, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
87
91
|
//#endregion
|
|
88
|
-
export { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, inlineOdmSectionToContentSection, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf };
|
|
92
|
+
export { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, inlineOdmSectionToContentSection, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToOdt, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToDocx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf };
|
|
@@ -55,6 +55,10 @@ declare function markdownToDocx(bytes: Uint8Array<ArrayBuffer>, options?: Docume
|
|
|
55
55
|
declare function docxToMarkdown(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
56
56
|
declare function markdownToOdt(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
57
57
|
declare function odtToMarkdown(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
58
|
+
declare function docxToPptx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
59
|
+
declare function pptxToDocx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
60
|
+
declare function odtToOdp(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
61
|
+
declare function odpToOdt(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
58
62
|
declare function xlsxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
59
63
|
declare function pdfToXlsx(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
60
64
|
interface OdmToPdfOptions extends DocumentToPdfOptions {
|
|
@@ -85,4 +89,4 @@ interface OdbReportToOdtOptions {
|
|
|
85
89
|
declare function odbReportToOdt(content: ContentDocument, options?: OdbReportToOdtOptions): Uint8Array<ArrayBuffer>;
|
|
86
90
|
declare function odbReportToPdf(content: ContentDocument, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
87
91
|
//#endregion
|
|
88
|
-
export { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, inlineOdmSectionToContentSection, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf };
|
|
92
|
+
export { DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, inlineOdmSectionToContentSection, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToOdt, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToDocx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf };
|
package/dist/convert/convert.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PAGE_SIZE_A4, flipY } from "../model/geometry.js";
|
|
1
|
+
import { PAGE_SIZE_A4 as PAGE_SIZE_A4$1, flipY } from "../model/geometry.js";
|
|
2
2
|
import { openDocx } from "../edit/docx/editor.js";
|
|
3
3
|
import { buildDocxPackage } from "../edit/docx/content.js";
|
|
4
4
|
import { openPptx } from "../edit/pptx/editor.js";
|
|
@@ -28,6 +28,7 @@ import { reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, re
|
|
|
28
28
|
import { buildOdbTableCsv } from "../odb/csv.js";
|
|
29
29
|
import { readOdbTables } from "../odb/read.js";
|
|
30
30
|
import { odbTablesToSpreadsheetDocument } from "../odb/spreadsheet.js";
|
|
31
|
+
import { presentationToWordprocessing, wordprocessingToPresentation } from "./variant-bridges.js";
|
|
31
32
|
import { buildXlsxPackage, decodePackage, encodePackage, readXlsxContent } from "ooxml.js";
|
|
32
33
|
import { COLOR_BLACK, CONTENT_FORMAT_VERSION, DOCUMENT_PACKAGE_FORMAT_VERSION, LAYOUT_FORMAT_VERSION } from "document-schema.js";
|
|
33
34
|
import { decodePackage as decodePackage$1, encodePackage as encodePackage$1, readOdfMetadata, readOdfParagraph, readOdfTable, readOdm } from "odf.js";
|
|
@@ -221,13 +222,13 @@ function odfToPdf(bytes, options) {
|
|
|
221
222
|
yPt: STANDALONE_FORMULA_MARGIN_PT,
|
|
222
223
|
widthPt: box.widthPt,
|
|
223
224
|
heightPt: box.heightPt
|
|
224
|
-
}, PAGE_SIZE_A4.heightPt);
|
|
225
|
+
}, PAGE_SIZE_A4$1.heightPt);
|
|
225
226
|
const layout = {
|
|
226
227
|
formatVersion: LAYOUT_FORMAT_VERSION,
|
|
227
228
|
metadata: content.metadata,
|
|
228
229
|
pages: [{
|
|
229
|
-
widthPt: PAGE_SIZE_A4.widthPt,
|
|
230
|
-
heightPt: PAGE_SIZE_A4.heightPt,
|
|
230
|
+
widthPt: PAGE_SIZE_A4$1.widthPt,
|
|
231
|
+
heightPt: PAGE_SIZE_A4$1.heightPt,
|
|
231
232
|
items: []
|
|
232
233
|
}],
|
|
233
234
|
images: {}
|
|
@@ -468,6 +469,56 @@ function odtToMarkdown(bytes, options) {
|
|
|
468
469
|
const text = buildMarkdownText(content);
|
|
469
470
|
return encodeMarkdownText(text);
|
|
470
471
|
}
|
|
472
|
+
function docxToPptx(bytes, options) {
|
|
473
|
+
throwIfAborted(options?.signal);
|
|
474
|
+
const content = readDocxContent(decodePackage$1(bytes));
|
|
475
|
+
if (content.kind !== "wordprocessing") throw new Error("readDocxContent returned a non-wordprocessing ContentDocument");
|
|
476
|
+
const presentation = wordprocessingToPresentation(content);
|
|
477
|
+
throwIfAborted(options?.signal);
|
|
478
|
+
options?.onDocument?.({
|
|
479
|
+
formatVersion: DOCUMENT_PACKAGE_FORMAT_VERSION,
|
|
480
|
+
content: presentation
|
|
481
|
+
});
|
|
482
|
+
return encodePackage(buildPptxPackage(presentation));
|
|
483
|
+
}
|
|
484
|
+
function pptxToDocx(bytes, options) {
|
|
485
|
+
throwIfAborted(options?.signal);
|
|
486
|
+
const content = readPptxContent(decodePackage$1(bytes));
|
|
487
|
+
if (content.kind !== "presentation") throw new Error("readPptxContent returned a non-presentation ContentDocument");
|
|
488
|
+
const wordprocessing = presentationToWordprocessing(content);
|
|
489
|
+
throwIfAborted(options?.signal);
|
|
490
|
+
options?.onDocument?.({
|
|
491
|
+
formatVersion: DOCUMENT_PACKAGE_FORMAT_VERSION,
|
|
492
|
+
content: wordprocessing
|
|
493
|
+
});
|
|
494
|
+
return encodePackage(buildDocxPackage(wordprocessing, { onMathDiagnostic: options?.onMathDiagnostic }));
|
|
495
|
+
}
|
|
496
|
+
function odtToOdp(bytes, options) {
|
|
497
|
+
throwIfAborted(options?.signal);
|
|
498
|
+
const pkg = decodePackage$1(bytes);
|
|
499
|
+
const content = readOdtContent(pkg);
|
|
500
|
+
if (content.kind !== "wordprocessing") throw new Error("readOdtContent returned a non-wordprocessing ContentDocument");
|
|
501
|
+
const presentation = wordprocessingToPresentation(content);
|
|
502
|
+
throwIfAborted(options?.signal);
|
|
503
|
+
options?.onDocument?.({
|
|
504
|
+
formatVersion: DOCUMENT_PACKAGE_FORMAT_VERSION,
|
|
505
|
+
content: presentation
|
|
506
|
+
});
|
|
507
|
+
return encodePackage(buildOdpPackage(presentation));
|
|
508
|
+
}
|
|
509
|
+
function odpToOdt(bytes, options) {
|
|
510
|
+
throwIfAborted(options?.signal);
|
|
511
|
+
const pkg = decodePackage$1(bytes);
|
|
512
|
+
const content = readOdpContent(pkg);
|
|
513
|
+
if (content.kind !== "presentation") throw new Error("readOdpContent returned a non-presentation ContentDocument");
|
|
514
|
+
const wordprocessing = presentationToWordprocessing(content);
|
|
515
|
+
throwIfAborted(options?.signal);
|
|
516
|
+
options?.onDocument?.({
|
|
517
|
+
formatVersion: DOCUMENT_PACKAGE_FORMAT_VERSION,
|
|
518
|
+
content: wordprocessing
|
|
519
|
+
});
|
|
520
|
+
return encodePackage(buildOdtPackage(wordprocessing));
|
|
521
|
+
}
|
|
471
522
|
function xlsxToPdf(bytes, options) {
|
|
472
523
|
throwIfAborted(options?.signal);
|
|
473
524
|
const odsBytes = xlsxToOds(bytes, { signal: options?.signal });
|
|
@@ -515,7 +566,7 @@ function inlineOdmSectionToContentSection(section, pkg) {
|
|
|
515
566
|
else if (node.tag === "table:table") blocks.push(readOdfTable(node, pkg));
|
|
516
567
|
}
|
|
517
568
|
return {
|
|
518
|
-
pageSize: PAGE_SIZE_A4,
|
|
569
|
+
pageSize: PAGE_SIZE_A4$1,
|
|
519
570
|
margins: INLINE_SECTION_MARGINS,
|
|
520
571
|
blocks
|
|
521
572
|
};
|
|
@@ -636,4 +687,4 @@ function odbReportToPdf(content, options) {
|
|
|
636
687
|
});
|
|
637
688
|
}
|
|
638
689
|
//#endregion
|
|
639
|
-
export { OdmUnresolvedSectionError, docxToMarkdown, docxToOdt, docxToPdf, inlineOdmSectionToContentSection, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf };
|
|
690
|
+
export { OdmUnresolvedSectionError, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, inlineOdmSectionToContentSection, markdownToDocx, markdownToOdt, markdownToPdf, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToOdt, odpToPdf, odpToPptx, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToDocx, pptxToOdp, pptxToPdf, xlsxToOds, xlsxToPdf };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let document_schema_js = require("document-schema.js");
|
|
3
|
+
//#region src/convert/variant-bridges.ts
|
|
4
|
+
const DEFAULT_INSET_LEFT_PT = 9.14;
|
|
5
|
+
const DEFAULT_INSET_TOP_PT = 4.57;
|
|
6
|
+
const DEFAULT_INSET_RIGHT_PT = 9.14;
|
|
7
|
+
const DEFAULT_INSET_BOTTOM_PT = 4.57;
|
|
8
|
+
function startsNewSlide(block) {
|
|
9
|
+
if (block.kind === "pageBreak") return true;
|
|
10
|
+
if (block.kind === "paragraph" && block.styleId?.startsWith("Heading") === true) return true;
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
function wordprocessingToPresentation(doc) {
|
|
14
|
+
const allBlocks = doc.sections.flatMap((section) => section.blocks);
|
|
15
|
+
const slideSize = doc.sections[0]?.pageSize ?? document_schema_js.SLIDE_SIZE_WIDESCREEN;
|
|
16
|
+
const slideGroups = [];
|
|
17
|
+
let current = [];
|
|
18
|
+
for (const block of allBlocks) {
|
|
19
|
+
if (startsNewSlide(block) && current.length > 0) {
|
|
20
|
+
slideGroups.push(current);
|
|
21
|
+
current = [];
|
|
22
|
+
}
|
|
23
|
+
if (block.kind !== "pageBreak") current.push(block);
|
|
24
|
+
}
|
|
25
|
+
if (current.length > 0 || slideGroups.length === 0) slideGroups.push(current);
|
|
26
|
+
const slides = slideGroups.map((blocks) => {
|
|
27
|
+
const shape = {
|
|
28
|
+
frame: {
|
|
29
|
+
xPt: 0,
|
|
30
|
+
yPt: 0,
|
|
31
|
+
widthPt: slideSize.widthPt,
|
|
32
|
+
heightPt: slideSize.heightPt
|
|
33
|
+
},
|
|
34
|
+
insetLeftPt: DEFAULT_INSET_LEFT_PT,
|
|
35
|
+
insetTopPt: DEFAULT_INSET_TOP_PT,
|
|
36
|
+
insetRightPt: DEFAULT_INSET_RIGHT_PT,
|
|
37
|
+
insetBottomPt: DEFAULT_INSET_BOTTOM_PT,
|
|
38
|
+
blocks
|
|
39
|
+
};
|
|
40
|
+
return {
|
|
41
|
+
size: slideSize,
|
|
42
|
+
shapes: [shape],
|
|
43
|
+
notes: ""
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
kind: "presentation",
|
|
48
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
|
|
49
|
+
metadata: doc.metadata,
|
|
50
|
+
slides
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function presentationToWordprocessing(doc) {
|
|
54
|
+
const allBlocks = doc.slides.flatMap((slide) => slide.shapes.flatMap((shape) => shape.blocks));
|
|
55
|
+
const section = {
|
|
56
|
+
pageSize: document_schema_js.PAGE_SIZE_A4,
|
|
57
|
+
margins: {
|
|
58
|
+
topPt: 72,
|
|
59
|
+
rightPt: 72,
|
|
60
|
+
bottomPt: 72,
|
|
61
|
+
leftPt: 72
|
|
62
|
+
},
|
|
63
|
+
blocks: allBlocks
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
kind: "wordprocessing",
|
|
67
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
|
|
68
|
+
metadata: doc.metadata,
|
|
69
|
+
sections: [section]
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
exports.presentationToWordprocessing = presentationToWordprocessing;
|
|
74
|
+
exports.wordprocessingToPresentation = wordprocessingToPresentation;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ContentDocument } from "document-schema.js";
|
|
2
|
+
//#region src/convert/variant-bridges.d.ts
|
|
3
|
+
type WordprocessingContentDocument = Extract<ContentDocument, {
|
|
4
|
+
kind: 'wordprocessing';
|
|
5
|
+
}>;
|
|
6
|
+
type PresentationContentDocument = Extract<ContentDocument, {
|
|
7
|
+
kind: 'presentation';
|
|
8
|
+
}>;
|
|
9
|
+
declare function wordprocessingToPresentation(doc: WordprocessingContentDocument): PresentationContentDocument;
|
|
10
|
+
declare function presentationToWordprocessing(doc: PresentationContentDocument): WordprocessingContentDocument;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { presentationToWordprocessing, wordprocessingToPresentation };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ContentDocument } from "document-schema.js";
|
|
2
|
+
//#region src/convert/variant-bridges.d.ts
|
|
3
|
+
type WordprocessingContentDocument = Extract<ContentDocument, {
|
|
4
|
+
kind: 'wordprocessing';
|
|
5
|
+
}>;
|
|
6
|
+
type PresentationContentDocument = Extract<ContentDocument, {
|
|
7
|
+
kind: 'presentation';
|
|
8
|
+
}>;
|
|
9
|
+
declare function wordprocessingToPresentation(doc: WordprocessingContentDocument): PresentationContentDocument;
|
|
10
|
+
declare function presentationToWordprocessing(doc: PresentationContentDocument): WordprocessingContentDocument;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { presentationToWordprocessing, wordprocessingToPresentation };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CONTENT_FORMAT_VERSION, PAGE_SIZE_A4, SLIDE_SIZE_WIDESCREEN } from "document-schema.js";
|
|
2
|
+
//#region src/convert/variant-bridges.ts
|
|
3
|
+
const DEFAULT_INSET_LEFT_PT = 9.14;
|
|
4
|
+
const DEFAULT_INSET_TOP_PT = 4.57;
|
|
5
|
+
const DEFAULT_INSET_RIGHT_PT = 9.14;
|
|
6
|
+
const DEFAULT_INSET_BOTTOM_PT = 4.57;
|
|
7
|
+
function startsNewSlide(block) {
|
|
8
|
+
if (block.kind === "pageBreak") return true;
|
|
9
|
+
if (block.kind === "paragraph" && block.styleId?.startsWith("Heading") === true) return true;
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
function wordprocessingToPresentation(doc) {
|
|
13
|
+
const allBlocks = doc.sections.flatMap((section) => section.blocks);
|
|
14
|
+
const slideSize = doc.sections[0]?.pageSize ?? SLIDE_SIZE_WIDESCREEN;
|
|
15
|
+
const slideGroups = [];
|
|
16
|
+
let current = [];
|
|
17
|
+
for (const block of allBlocks) {
|
|
18
|
+
if (startsNewSlide(block) && current.length > 0) {
|
|
19
|
+
slideGroups.push(current);
|
|
20
|
+
current = [];
|
|
21
|
+
}
|
|
22
|
+
if (block.kind !== "pageBreak") current.push(block);
|
|
23
|
+
}
|
|
24
|
+
if (current.length > 0 || slideGroups.length === 0) slideGroups.push(current);
|
|
25
|
+
const slides = slideGroups.map((blocks) => {
|
|
26
|
+
const shape = {
|
|
27
|
+
frame: {
|
|
28
|
+
xPt: 0,
|
|
29
|
+
yPt: 0,
|
|
30
|
+
widthPt: slideSize.widthPt,
|
|
31
|
+
heightPt: slideSize.heightPt
|
|
32
|
+
},
|
|
33
|
+
insetLeftPt: DEFAULT_INSET_LEFT_PT,
|
|
34
|
+
insetTopPt: DEFAULT_INSET_TOP_PT,
|
|
35
|
+
insetRightPt: DEFAULT_INSET_RIGHT_PT,
|
|
36
|
+
insetBottomPt: DEFAULT_INSET_BOTTOM_PT,
|
|
37
|
+
blocks
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
size: slideSize,
|
|
41
|
+
shapes: [shape],
|
|
42
|
+
notes: ""
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
kind: "presentation",
|
|
47
|
+
formatVersion: CONTENT_FORMAT_VERSION,
|
|
48
|
+
metadata: doc.metadata,
|
|
49
|
+
slides
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function presentationToWordprocessing(doc) {
|
|
53
|
+
const allBlocks = doc.slides.flatMap((slide) => slide.shapes.flatMap((shape) => shape.blocks));
|
|
54
|
+
const section = {
|
|
55
|
+
pageSize: PAGE_SIZE_A4,
|
|
56
|
+
margins: {
|
|
57
|
+
topPt: 72,
|
|
58
|
+
rightPt: 72,
|
|
59
|
+
bottomPt: 72,
|
|
60
|
+
leftPt: 72
|
|
61
|
+
},
|
|
62
|
+
blocks: allBlocks
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
kind: "wordprocessing",
|
|
66
|
+
formatVersion: CONTENT_FORMAT_VERSION,
|
|
67
|
+
metadata: doc.metadata,
|
|
68
|
+
sections: [section]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { presentationToWordprocessing, wordprocessingToPresentation };
|
package/dist/edit/geometry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClockPort } from "../../ports/clock.js";
|
|
2
|
-
import { r as Margins, s as PageSize$1 } from "../../geometry-
|
|
2
|
+
import { r as Margins, s as PageSize$1 } from "../../geometry-BG4fX9Rw.js";
|
|
3
3
|
import { MarkdownParagraph, ParagraphInit } from "./paragraph.js";
|
|
4
4
|
import { MarkdownList, MarkdownListInit } from "./list.js";
|
|
5
5
|
import { MarkdownTable, TableInit } from "./table.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClockPort } from "../../ports/clock.js";
|
|
2
|
-
import { s as PageSize } from "../../geometry-
|
|
2
|
+
import { s as PageSize } from "../../geometry-BG4fX9Rw.js";
|
|
3
3
|
import { OdgPage } from "./page.js";
|
|
4
4
|
import { Package } from "odf.js";
|
|
5
5
|
//#region src/edit/odg/editor.d.ts
|
package/dist/edit/odg/page.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ImageInit } from "../../image-
|
|
2
|
-
import { t as OdpShape } from "../../shape-
|
|
1
|
+
import { t as ImageInit } from "../../image-hTGo7C8g.js";
|
|
2
|
+
import { t as OdpShape } from "../../shape-DGlNMY73.js";
|
|
3
3
|
import { a as OdgLineVector, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "../../vector-D03KX8Ux.js";
|
|
4
4
|
import { Box, ContentVector } from "document-schema.js";
|
|
5
5
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClockPort } from "../../ports/clock.js";
|
|
2
|
-
import { s as PageSize } from "../../geometry-
|
|
2
|
+
import { s as PageSize } from "../../geometry-BG4fX9Rw.js";
|
|
3
3
|
import { OdpSlide } from "./slide.js";
|
|
4
4
|
import { Package } from "odf.js";
|
|
5
5
|
//#region src/edit/odp/editor.d.ts
|
package/dist/edit/odp/image.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MediaContext, r as insertImageFrameMedia, t as ImageInit } from "../../image-
|
|
1
|
+
import { n as MediaContext, r as insertImageFrameMedia, t as ImageInit } from "../../image-hTGo7C8g.js";
|
|
2
2
|
export { ImageInit, MediaContext, insertImageFrameMedia };
|
package/dist/edit/odp/shape.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-
|
|
1
|
+
import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-DGlNMY73.js";
|
|
2
2
|
export { OdpShape, buildImageFrame, buildTableFrame, buildTextBoxFrame };
|
package/dist/edit/odp/slide.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as Box$1 } from "../../geometry-
|
|
2
|
-
import { t as ImageInit } from "../../image-
|
|
3
|
-
import { t as OdpShape } from "../../shape-
|
|
1
|
+
import { t as Box$1 } from "../../geometry-BG4fX9Rw.js";
|
|
2
|
+
import { t as ImageInit } from "../../image-hTGo7C8g.js";
|
|
3
|
+
import { t as OdpShape } from "../../shape-DGlNMY73.js";
|
|
4
4
|
import { s as OdgVector } from "../../vector-D03KX8Ux.js";
|
|
5
|
-
import { a as TableInit, n as OdtTable } from "../../table-
|
|
5
|
+
import { a as TableInit, n as OdtTable } from "../../table-qaDB5iJO.js";
|
|
6
6
|
import { ContentVector } from "document-schema.js";
|
|
7
7
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
8
8
|
//#region src/edit/odp/slide.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClockPort } from "../../ports/clock.js";
|
|
2
|
-
import { t as OdtParagraph } from "../../paragraph
|
|
3
|
-
import { n as OdtTable } from "../../table-
|
|
2
|
+
import { t as OdtParagraph } from "../../paragraph-DZyHl2e4.js";
|
|
3
|
+
import { n as OdtTable } from "../../table-qaDB5iJO.js";
|
|
4
4
|
import { ContentDocument, ContentParagraph, ContentTable } from "document-schema.js";
|
|
5
5
|
import { Package } from "odf.js";
|
|
6
6
|
//#region src/edit/odt/content.d.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ClockPort } from "../../ports/clock.js";
|
|
2
|
-
import { t as Box$1 } from "../../geometry-
|
|
3
|
-
import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph
|
|
4
|
-
import { t as OdtList } from "../../list-
|
|
5
|
-
import { a as TableInit, n as OdtTable } from "../../table-
|
|
2
|
+
import { t as Box$1 } from "../../geometry-BG4fX9Rw.js";
|
|
3
|
+
import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-DZyHl2e4.js";
|
|
4
|
+
import { t as OdtList } from "../../list-BrAIR4Sv.js";
|
|
5
|
+
import { a as TableInit, n as OdtTable } from "../../table-qaDB5iJO.js";
|
|
6
6
|
import { ContentFormula, ContentVector } from "document-schema.js";
|
|
7
7
|
import { Package } from "odf.js";
|
|
8
8
|
//#region src/edit/odt/editor.d.ts
|
package/dist/edit/odt/image.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as buildImageFrame, r as insertImageFrameMedia, t as ImageInit } from "../../image-
|
|
1
|
+
import { n as buildImageFrame, r as insertImageFrameMedia, t as ImageInit } from "../../image-CsyoXX7d.js";
|
|
2
2
|
export { ImageInit, buildImageFrame, insertImageFrameMedia };
|
package/dist/edit/odt/list.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-
|
|
1
|
+
import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-BrAIR4Sv.js";
|
|
2
2
|
export { OdtList, OdtListItem, buildList };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph
|
|
1
|
+
import { n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-DZyHl2e4.js";
|
|
2
2
|
export { OdtParagraph, ParagraphInit, buildParagraph };
|
package/dist/edit/odt/table.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TableInit, c as readCellDecoration, i as OdtTableRow, n as OdtTable, o as buildCellStyle, r as OdtTableCell, s as buildTable, t as CellDecoration } from "../../table-
|
|
1
|
+
import { a as TableInit, c as readCellDecoration, i as OdtTableRow, n as OdtTable, o as buildCellStyle, r as OdtTableCell, s as buildTable, t as CellDecoration } from "../../table-qaDB5iJO.js";
|
|
2
2
|
export { CellDecoration, OdtTable, OdtTableCell, OdtTableRow, TableInit, buildCellStyle, buildTable, readCellDecoration };
|
package/dist/edit/pdf/util.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let ooxml_js = require("ooxml.js");
|
|
3
|
-
let
|
|
3
|
+
let byte_codec = require("byte-codec");
|
|
4
4
|
//#region src/edit/pdf/util.ts
|
|
5
5
|
function spliceOut(container, node) {
|
|
6
6
|
const index = container.indexOf(node);
|
|
@@ -8,20 +8,20 @@ function spliceOut(container, node) {
|
|
|
8
8
|
}
|
|
9
9
|
function decodeImageDimensions(format, bytes) {
|
|
10
10
|
if (format === "jpeg") {
|
|
11
|
-
const info = (0,
|
|
11
|
+
const info = (0, byte_codec.readJpegInfo)(bytes);
|
|
12
12
|
return {
|
|
13
13
|
widthPx: info.width,
|
|
14
14
|
heightPx: info.height
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
const raw = (0,
|
|
17
|
+
const raw = (0, byte_codec.decodePng)(bytes);
|
|
18
18
|
return {
|
|
19
19
|
widthPx: raw.width,
|
|
20
20
|
heightPx: raw.height
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
function registerImageBytes(bytes, format, images) {
|
|
24
|
-
const imageId = `img${(0,
|
|
24
|
+
const imageId = `img${(0, byte_codec.crc32)(bytes).toString(16)}`;
|
|
25
25
|
if (!(imageId in images)) {
|
|
26
26
|
const { widthPx, heightPx } = decodeImageDimensions(format, bytes);
|
|
27
27
|
images[imageId] = {
|
package/dist/edit/pdf/util.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bytesToBase64 } from "ooxml.js";
|
|
2
|
-
import { crc32, decodePng, readJpegInfo } from "
|
|
2
|
+
import { crc32, decodePng, readJpegInfo } from "byte-codec";
|
|
3
3
|
//#region src/edit/pdf/util.ts
|
|
4
4
|
function spliceOut(container, node) {
|
|
5
5
|
const index = container.indexOf(node);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClockPort } from "../../ports/clock.js";
|
|
2
|
-
import { s as PageSize } from "../../geometry-
|
|
2
|
+
import { s as PageSize } from "../../geometry-BG4fX9Rw.js";
|
|
3
3
|
import { PptxSlide } from "./slide.js";
|
|
4
4
|
import { Package } from "ooxml.js";
|
|
5
5
|
//#region src/edit/pptx/editor.d.ts
|