js.documents 14.4.56 → 14.4.57
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/codecs/read.cjs +2 -2
- package/dist/codecs/read.js +1 -1
- package/dist/composition-plan-CfvhXeOC.cjs +627 -0
- package/dist/composition-plan-DU9nPPN7.d.cts +102 -0
- package/dist/composition-plan-f0zaExUW.js +508 -0
- package/dist/composition-plan-l6QPO4FX.d.ts +102 -0
- package/dist/convert/composition-plan.cjs +7 -0
- package/dist/convert/composition-plan.d.cts +2 -0
- package/dist/convert/composition-plan.d.ts +2 -0
- package/dist/convert/composition-plan.js +2 -0
- package/dist/convert/composition-to-pdf.cjs +12 -12
- package/dist/convert/composition-to-pdf.d.cts +1 -1
- package/dist/convert/composition-to-pdf.d.ts +1 -1
- package/dist/convert/composition-to-pdf.js +2 -2
- package/dist/convert/composition.cjs +16 -511
- package/dist/convert/composition.d.cts +2 -85
- package/dist/convert/composition.d.ts +2 -85
- package/dist/convert/composition.js +2 -502
- package/dist/convert/convert.cjs +2 -2
- package/dist/convert/convert.js +1 -1
- package/dist/convert/from-package.cjs +3 -3
- package/dist/convert/from-package.js +2 -2
- package/dist/convert/from-pdf.cjs +18 -18
- package/dist/convert/from-pdf.js +2 -2
- package/dist/convert/local.cjs +3 -3
- package/dist/convert/local.js +1 -1
- package/dist/edit/odp/slide.cjs +4 -4
- package/dist/edit/odp/slide.d.cts +1 -1
- package/dist/edit/odp/slide.d.ts +1 -1
- package/dist/edit/odp/slide.js +1 -1
- package/dist/edit/odt/content.d.cts +1 -1
- package/dist/edit/odt/content.d.ts +1 -1
- package/dist/edit/odt/editor.cjs +4 -4
- package/dist/edit/odt/editor.d.cts +1 -1
- package/dist/edit/odt/editor.d.ts +1 -1
- package/dist/edit/odt/editor.js +1 -1
- package/dist/edit/odt/table-grid.cjs +23 -0
- package/dist/edit/odt/table-grid.d.cts +54 -0
- package/dist/edit/odt/table-grid.d.ts +54 -0
- package/dist/edit/odt/table-grid.js +2 -0
- package/dist/edit/odt/table.cjs +12 -653
- package/dist/edit/odt/table.d.cts +2 -2
- package/dist/edit/odt/table.d.ts +2 -2
- package/dist/edit/odt/table.js +2 -647
- package/dist/{evaluate-BbOsgdmN.d.cts → evaluate-BSEUxiUK.d.cts} +3 -1
- package/dist/evaluate-CEzsBx3w.cjs +564 -0
- package/dist/{evaluate-C7fmk69X.d.ts → evaluate-D8fG2ZeB.d.ts} +3 -1
- package/dist/evaluate-IK-3aMv5.js +445 -0
- package/dist/evaluate-columns-CyqKHkIW.d.cts +41 -0
- package/dist/evaluate-columns-cOo8fOfT.d.ts +41 -0
- package/dist/index.cjs +24 -24
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +8 -8
- package/dist/latex/lint.cjs +2 -2
- package/dist/latex/lint.js +1 -1
- package/dist/latex/lower-fold.cjs +6 -0
- package/dist/latex/lower-fold.d.cts +17 -0
- package/dist/latex/lower-fold.d.ts +17 -0
- package/dist/latex/lower-fold.js +2 -0
- package/dist/latex/lower.cjs +11 -617
- package/dist/latex/lower.d.cts +18 -1
- package/dist/latex/lower.d.ts +18 -1
- package/dist/latex/lower.js +2 -616
- package/dist/latex/symbols.d.cts +1 -15
- package/dist/latex/symbols.d.ts +1 -15
- package/dist/latex/temml.d.cts +1 -24
- package/dist/latex/temml.d.ts +1 -24
- package/dist/layout/engine.cjs +2 -2
- package/dist/layout/engine.js +1 -1
- package/dist/layout/reconstruct-lines.cjs +315 -0
- package/dist/layout/reconstruct-lines.d.cts +2 -0
- package/dist/layout/reconstruct-lines.d.ts +2 -0
- package/dist/layout/reconstruct-lines.js +297 -0
- package/dist/layout/reconstruct-presentations-prod.cjs +9 -0
- package/dist/layout/reconstruct-presentations-prod.d.cts +26 -0
- package/dist/layout/reconstruct-presentations-prod.d.ts +26 -0
- package/dist/layout/reconstruct-presentations-prod.js +2 -0
- package/dist/layout/reconstruct-tables.cjs +5 -0
- package/dist/layout/reconstruct-tables.d.cts +22 -0
- package/dist/layout/reconstruct-tables.d.ts +22 -0
- package/dist/layout/reconstruct-tables.js +2 -0
- package/dist/layout/reconstruct.cjs +11 -1545
- package/dist/layout/reconstruct.d.cts +2 -14
- package/dist/layout/reconstruct.d.ts +2 -14
- package/dist/layout/reconstruct.js +2 -1542
- package/dist/layout/shared.cjs +2 -2
- package/dist/layout/shared.js +1 -1
- package/dist/layout/sheets-render.cjs +19 -0
- package/dist/layout/sheets-render.d.cts +41 -0
- package/dist/layout/sheets-render.d.ts +41 -0
- package/dist/layout/sheets-render.js +2 -0
- package/dist/layout/sheets.cjs +10 -544
- package/dist/layout/sheets.d.cts +13 -2
- package/dist/layout/sheets.d.ts +13 -2
- package/dist/layout/sheets.js +2 -543
- package/dist/layout/slides.cjs +2 -2
- package/dist/layout/slides.js +1 -1
- package/dist/layout-DIJzJk4x.js +526 -0
- package/dist/layout-iuiyl_Fk.cjs +621 -0
- package/dist/layout-types-oSbHvZid.d.cts +13 -0
- package/dist/layout-types-oSbHvZid.d.ts +13 -0
- package/dist/lower-DCs3rWI7.js +618 -0
- package/dist/lower-DzOb13w4.cjs +701 -0
- package/dist/markdown/math.cjs +2 -2
- package/dist/markdown/math.js +1 -1
- package/dist/mathml/layout-stretch.cjs +16 -0
- package/dist/mathml/layout-stretch.d.cts +24 -0
- package/dist/mathml/layout-stretch.d.ts +24 -0
- package/dist/mathml/layout-stretch.js +2 -0
- package/dist/mathml/layout-types.d.cts +1 -12
- package/dist/mathml/layout-types.d.ts +1 -12
- package/dist/mathml/layout.cjs +3 -525
- package/dist/mathml/layout.d.cts +2 -2
- package/dist/mathml/layout.d.ts +2 -2
- package/dist/mathml/layout.js +1 -523
- package/dist/odb/formula/evaluate.d.cts +1 -1
- package/dist/odb/formula/evaluate.d.ts +1 -1
- package/dist/odb/report/render.d.cts +1 -1
- package/dist/odb/report/render.d.ts +1 -1
- package/dist/odb/report/source.cjs +2 -2
- package/dist/odb/report/source.d.cts +1 -1
- package/dist/odb/report/source.d.ts +1 -1
- package/dist/odb/report/source.js +1 -1
- package/dist/odb/sql/evaluate-columns.cjs +122 -0
- package/dist/odb/sql/evaluate-columns.d.cts +2 -0
- package/dist/odb/sql/evaluate-columns.d.ts +2 -0
- package/dist/odb/sql/evaluate-columns.js +114 -0
- package/dist/odb/sql/evaluate-predicates.cjs +16 -0
- package/dist/odb/sql/evaluate-predicates.d.cts +23 -0
- package/dist/odb/sql/evaluate-predicates.d.ts +23 -0
- package/dist/odb/sql/evaluate-predicates.js +2 -0
- package/dist/odb/sql/evaluate.cjs +7 -556
- package/dist/odb/sql/evaluate.d.cts +2 -2
- package/dist/odb/sql/evaluate.d.ts +2 -2
- package/dist/odb/sql/evaluate.js +2 -552
- package/dist/read-BSH--XB4.js +682 -0
- package/dist/read-CahCZMwG.cjs +759 -0
- package/dist/reconstruct-BKOCAedo.d.ts +29 -0
- package/dist/reconstruct-D4TEteZ6.d.cts +29 -0
- package/dist/reconstruct-lines-B7t66ICm.d.cts +33 -0
- package/dist/reconstruct-lines-B7t66ICm.d.ts +33 -0
- package/dist/reconstruct-presentations-prod-B5fkPiRZ.js +1256 -0
- package/dist/reconstruct-presentations-prod-X315aBmI.cjs +1375 -0
- package/dist/sheets-BQCpNXsE.cjs +700 -0
- package/dist/sheets-DWDvGN-g.js +545 -0
- package/dist/svg/read-geometry.cjs +10 -0
- package/dist/svg/read-geometry.d.cts +24 -0
- package/dist/svg/read-geometry.d.ts +24 -0
- package/dist/svg/read-geometry.js +2 -0
- package/dist/svg/read.cjs +6 -680
- package/dist/svg/read.d.cts +17 -2
- package/dist/svg/read.d.ts +17 -2
- package/dist/svg/read.js +2 -679
- package/dist/symbols-BlzXfLEe.d.cts +16 -0
- package/dist/symbols-CKm2r4D0.d.ts +16 -0
- package/dist/table-B5gSMY7w.js +649 -0
- package/dist/{table-DrE6jEWv.d.cts → table-BK_Ao-Y6.d.cts} +9 -1
- package/dist/{table-B5htMG3g.d.ts → table-CxY85YUj.d.ts} +9 -1
- package/dist/table-DqUIOSPV.cjs +840 -0
- package/dist/temml-1-I9N9DD.d.cts +25 -0
- package/dist/temml-1-I9N9DD.d.ts +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { t as ClockPort } from "./clock-Cewekmhw.js";
|
|
2
|
+
import { DocumentFormat } from "./convert/port.js";
|
|
3
|
+
import { t as ContentVariant } from "./capability-BmRwrPL9.js";
|
|
4
|
+
import { i as SvgDiagnosticSink } from "./diagnostics-DVAXKgcf.js";
|
|
5
|
+
import { i as CellTypeInferenceSink } from "./cell-typing-BQ-xQ5X5.js";
|
|
6
|
+
import { a as ReconstructOptions } from "./reconstruct-BKOCAedo.js";
|
|
7
|
+
import { t as OmmlDiagnostic } from "./shared-DHu5jDJf.js";
|
|
8
|
+
import { Package } from "ooxml.js";
|
|
9
|
+
import { ContentDocument, DocumentTree, FontSubstitution, ProvidedFont } from "document-schema.js";
|
|
10
|
+
import { LayoutDocument, PdfDiagnosticSink, WinAnsiSubstitution } from "pdf-codec";
|
|
11
|
+
import { MarkdownImageResolver } from "markdown-codec";
|
|
12
|
+
//#region src/convert/composition.d.ts
|
|
13
|
+
declare const THROUGH_PDF_EDGE_COST = 3;
|
|
14
|
+
declare const MAX_CONVERSION_PATH_NODES = 4;
|
|
15
|
+
declare const FORMAT_NODES: Readonly<Record<ContentFormat, FormatNode>>;
|
|
16
|
+
type SourcePackage = Package;
|
|
17
|
+
interface UnifiedConversionOptions {
|
|
18
|
+
readonly signal?: AbortSignal;
|
|
19
|
+
readonly onDocument?: (pkg: DocumentTree) => void;
|
|
20
|
+
readonly fonts?: readonly ProvidedFont[];
|
|
21
|
+
readonly onFontSubstitution?: (substitution: FontSubstitution) => void;
|
|
22
|
+
readonly onSubstitution?: (substitution: WinAnsiSubstitution, context: {
|
|
23
|
+
readonly pageIndex: number;
|
|
24
|
+
}) => void;
|
|
25
|
+
readonly sink?: PdfDiagnosticSink;
|
|
26
|
+
readonly onMathDiagnostic?: (diagnostic: OmmlDiagnostic, context: {
|
|
27
|
+
readonly sourcePath?: string;
|
|
28
|
+
}) => void;
|
|
29
|
+
readonly images?: MarkdownImageResolver;
|
|
30
|
+
readonly delimiter?: string;
|
|
31
|
+
readonly sheet?: string;
|
|
32
|
+
readonly onCellTypeInference?: CellTypeInferenceSink;
|
|
33
|
+
readonly page?: number;
|
|
34
|
+
readonly onSvgDiagnostic?: SvgDiagnosticSink;
|
|
35
|
+
readonly clock?: ClockPort;
|
|
36
|
+
}
|
|
37
|
+
type ContentFormat = "docx" | "pptx" | "xlsx" | "odt" | "odp" | "ods" | "odg" | "svg" | "csv" | "markdown" | "rtf" | "doc" | "xls" | "ppt" | "epub";
|
|
38
|
+
declare const CONTENT_FORMATS: readonly ContentFormat[];
|
|
39
|
+
type LayoutVariant = Exclude<ContentVariant, "formula">;
|
|
40
|
+
interface PackageFormatNode {
|
|
41
|
+
readonly variant: LayoutVariant;
|
|
42
|
+
readonly family: "ooxml" | "odf";
|
|
43
|
+
readonly decode: (bytes: Uint8Array<ArrayBuffer>) => SourcePackage;
|
|
44
|
+
readonly read: (pkg: SourcePackage, options?: UnifiedConversionOptions) => ContentDocument;
|
|
45
|
+
readonly build: (content: ContentDocument, options?: UnifiedConversionOptions) => SourcePackage;
|
|
46
|
+
readonly encode: (pkg: SourcePackage) => Uint8Array<ArrayBuffer>;
|
|
47
|
+
readonly hasSourcePackage: true;
|
|
48
|
+
}
|
|
49
|
+
interface TextFormatNode {
|
|
50
|
+
readonly variant: LayoutVariant;
|
|
51
|
+
readonly family: "markdown" | "csv" | "svg" | "rtf" | "doc" | "xls" | "ppt" | "epub";
|
|
52
|
+
readonly decode: (bytes: Uint8Array<ArrayBuffer>) => string;
|
|
53
|
+
readonly read: (text: string, options?: UnifiedConversionOptions) => ContentDocument;
|
|
54
|
+
readonly build: (content: ContentDocument, options?: UnifiedConversionOptions) => string;
|
|
55
|
+
readonly encode: (text: string) => Uint8Array<ArrayBuffer>;
|
|
56
|
+
readonly hasSourcePackage: false;
|
|
57
|
+
}
|
|
58
|
+
type FormatNode = PackageFormatNode | TextFormatNode;
|
|
59
|
+
declare function isTextFormatNode(node: FormatNode): node is TextFormatNode;
|
|
60
|
+
type ReadOnlyContentFormat = "wpd";
|
|
61
|
+
declare const READ_ONLY_CONTENT_FORMATS: readonly ReadOnlyContentFormat[];
|
|
62
|
+
interface ReadOnlyFormatNode {
|
|
63
|
+
readonly variant: LayoutVariant;
|
|
64
|
+
readonly read: (bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions) => ContentDocument;
|
|
65
|
+
}
|
|
66
|
+
declare const READ_ONLY_FORMAT_NODES: Readonly<Record<ReadOnlyContentFormat, ReadOnlyFormatNode>>;
|
|
67
|
+
type SourceContentFormat = ContentFormat | ReadOnlyContentFormat;
|
|
68
|
+
declare function isReadOnlyContentFormat(format: DocumentFormat): format is ReadOnlyContentFormat;
|
|
69
|
+
declare const LAYOUT_CAPABLE: ReadonlySet<SourceContentFormat>;
|
|
70
|
+
declare const TRANSFORMS: Readonly<Record<string, (doc: ContentDocument) => ContentDocument>>;
|
|
71
|
+
declare const RECONSTRUCTORS: Readonly<Record<LayoutVariant, (doc: LayoutDocument, options?: ReconstructOptions) => ContentDocument>>;
|
|
72
|
+
declare function executeBridge(source: SourceContentFormat, target: ContentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
|
|
73
|
+
declare function executeFromPdf(target: ContentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
|
|
74
|
+
interface CompositionExecutorBinding {
|
|
75
|
+
readonly bridge: (source: SourceContentFormat, target: ContentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions) => Uint8Array<ArrayBuffer>;
|
|
76
|
+
readonly fromPdf: (target: ContentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions) => Uint8Array<ArrayBuffer>;
|
|
77
|
+
readonly toPdf?: (source: SourceContentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions) => Uint8Array<ArrayBuffer>;
|
|
78
|
+
}
|
|
79
|
+
declare function runCompositionPlan(plan: ConversionPlan, bytes: Uint8Array<ArrayBuffer>, options: UnifiedConversionOptions | undefined, executors: CompositionExecutorBinding): Uint8Array<ArrayBuffer>;
|
|
80
|
+
declare function convertDocumentFromPdf(target: ContentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/convert/composition-plan.d.ts
|
|
83
|
+
type HopExecutor = "bridge" | "toPdf" | "fromPdf";
|
|
84
|
+
interface CompositionHop {
|
|
85
|
+
readonly executor: HopExecutor;
|
|
86
|
+
readonly from: DocumentFormat;
|
|
87
|
+
readonly to: DocumentFormat;
|
|
88
|
+
}
|
|
89
|
+
interface ConversionPlan {
|
|
90
|
+
readonly hops: readonly CompositionHop[];
|
|
91
|
+
}
|
|
92
|
+
interface GraphEdge {
|
|
93
|
+
readonly to: DocumentFormat;
|
|
94
|
+
readonly cost: number;
|
|
95
|
+
}
|
|
96
|
+
declare function buildCompositionGraph(): ReadonlyMap<DocumentFormat, readonly GraphEdge[]>;
|
|
97
|
+
declare function shortestPath(source: DocumentFormat, target: DocumentFormat): readonly DocumentFormat[] | undefined;
|
|
98
|
+
declare function resolveCompositionPlan(source: DocumentFormat, target: DocumentFormat): ConversionPlan | undefined;
|
|
99
|
+
declare function isContentFormat(format: DocumentFormat): format is ContentFormat;
|
|
100
|
+
declare function isSourceContentFormat(format: DocumentFormat): format is SourceContentFormat;
|
|
101
|
+
//#endregion
|
|
102
|
+
export { isTextFormatNode as A, THROUGH_PDF_EDGE_COST as C, executeBridge as D, convertDocumentFromPdf as E, executeFromPdf as O, SourceContentFormat as S, UnifiedConversionOptions as T, READ_ONLY_CONTENT_FORMATS as _, buildCompositionGraph as a, ReadOnlyContentFormat as b, resolveCompositionPlan as c, CompositionExecutorBinding as d, ContentFormat as f, MAX_CONVERSION_PATH_NODES as g, LAYOUT_CAPABLE as h, HopExecutor as i, runCompositionPlan as j, isReadOnlyContentFormat as k, shortestPath as l, FormatNode as m, ConversionPlan as n, isContentFormat as o, FORMAT_NODES as p, GraphEdge as r, isSourceContentFormat as s, CompositionHop as t, CONTENT_FORMATS as u, READ_ONLY_FORMAT_NODES as v, TRANSFORMS as w, ReadOnlyFormatNode as x, RECONSTRUCTORS as y };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_composition_plan = require("../composition-plan-CfvhXeOC.cjs");
|
|
3
|
+
exports.buildCompositionGraph = require_composition_plan.buildCompositionGraph;
|
|
4
|
+
exports.isContentFormat = require_composition_plan.isContentFormat;
|
|
5
|
+
exports.isSourceContentFormat = require_composition_plan.isSourceContentFormat;
|
|
6
|
+
exports.resolveCompositionPlan = require_composition_plan.resolveCompositionPlan;
|
|
7
|
+
exports.shortestPath = require_composition_plan.shortestPath;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as buildCompositionGraph, c as resolveCompositionPlan, i as HopExecutor, l as shortestPath, n as ConversionPlan, o as isContentFormat, r as GraphEdge, s as isSourceContentFormat, t as CompositionHop } from "../composition-plan-DU9nPPN7.cjs";
|
|
2
|
+
export { CompositionHop, ConversionPlan, GraphEdge, HopExecutor, buildCompositionGraph, isContentFormat, isSourceContentFormat, resolveCompositionPlan, shortestPath };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as buildCompositionGraph, c as resolveCompositionPlan, i as HopExecutor, l as shortestPath, n as ConversionPlan, o as isContentFormat, r as GraphEdge, s as isSourceContentFormat, t as CompositionHop } from "../composition-plan-l6QPO4FX.js";
|
|
2
|
+
export { CompositionHop, ConversionPlan, GraphEdge, HopExecutor, buildCompositionGraph, isContentFormat, isSourceContentFormat, resolveCompositionPlan, shortestPath };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as shortestPath, i as resolveCompositionPlan, n as isContentFormat, r as isSourceContentFormat, t as buildCompositionGraph } from "../composition-plan-f0zaExUW.js";
|
|
2
|
+
export { buildCompositionGraph, isContentFormat, isSourceContentFormat, resolveCompositionPlan, shortestPath };
|
|
@@ -4,10 +4,10 @@ const require_fonts_registry = require("../fonts/registry.cjs");
|
|
|
4
4
|
const require_layout_engine = require("../layout/engine.cjs");
|
|
5
5
|
const require_layout_slides = require("../layout/slides.cjs");
|
|
6
6
|
const require_ports_abort = require("../ports/abort.cjs");
|
|
7
|
-
const
|
|
7
|
+
const require_sheets = require("../sheets-BQCpNXsE.cjs");
|
|
8
8
|
const require_layout_drawing = require("../layout/drawing.cjs");
|
|
9
9
|
const require_convert_capability = require("./capability.cjs");
|
|
10
|
-
const
|
|
10
|
+
const require_composition_plan = require("../composition-plan-CfvhXeOC.cjs");
|
|
11
11
|
let document_schema_js = require("document-schema.js");
|
|
12
12
|
let pdf_codec = require("pdf-codec");
|
|
13
13
|
//#region src/convert/composition-to-pdf.ts
|
|
@@ -15,17 +15,17 @@ const mathMetricsAt = (sizePt) => (0, pdf_codec.loadMathFont)().metricsAt(sizePt
|
|
|
15
15
|
const LAYOUT_ENGINES = {
|
|
16
16
|
wordprocessing: require_layout_engine.convertWordprocessingToLayout,
|
|
17
17
|
presentation: require_layout_slides.convertPresentationToLayout,
|
|
18
|
-
spreadsheet:
|
|
18
|
+
spreadsheet: require_sheets.convertSpreadsheetToLayout,
|
|
19
19
|
drawing: require_layout_drawing.convertDrawingToLayout
|
|
20
20
|
};
|
|
21
21
|
function executeToPdf(format, bytes, options) {
|
|
22
|
-
if (!
|
|
22
|
+
if (!require_composition_plan.LAYOUT_CAPABLE.has(format)) throw new Error(`executeToPdf: '${format}' has no layout engine of its own`);
|
|
23
23
|
let content;
|
|
24
24
|
let fonts;
|
|
25
25
|
let sourceFaces;
|
|
26
|
-
if (
|
|
26
|
+
if (require_composition_plan.isReadOnlyContentFormat(format)) {
|
|
27
27
|
require_ports_abort.throwIfAborted(options?.signal);
|
|
28
|
-
const read =
|
|
28
|
+
const read = require_composition_plan.READ_ONLY_FORMAT_NODES[format].read(bytes, options);
|
|
29
29
|
content = {
|
|
30
30
|
...read,
|
|
31
31
|
metadata: require_model_metadata.resolveMetadataTimestamps(read.metadata, options?.clock)
|
|
@@ -36,8 +36,8 @@ function executeToPdf(format, bytes, options) {
|
|
|
36
36
|
});
|
|
37
37
|
return renderToPdf(content, fonts, options);
|
|
38
38
|
}
|
|
39
|
-
const node =
|
|
40
|
-
if (
|
|
39
|
+
const node = require_composition_plan.FORMAT_NODES[format];
|
|
40
|
+
if (require_composition_plan.isTextFormatNode(node)) {
|
|
41
41
|
require_ports_abort.throwIfAborted(options?.signal);
|
|
42
42
|
const text = node.decode(bytes);
|
|
43
43
|
const read = node.read(text, options);
|
|
@@ -145,11 +145,11 @@ function reportTree(content, pages, sourceFaces) {
|
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
function convertDocument(source, target, bytes, options) {
|
|
148
|
-
const plan =
|
|
148
|
+
const plan = require_composition_plan.resolveCompositionPlan(source, target);
|
|
149
149
|
if (plan === void 0) throw new require_convert_capability.UnsupportedConversionError(source, target);
|
|
150
|
-
return
|
|
151
|
-
bridge:
|
|
152
|
-
fromPdf:
|
|
150
|
+
return require_composition_plan.runCompositionPlan(plan, bytes, options, {
|
|
151
|
+
bridge: require_composition_plan.executeBridge,
|
|
152
|
+
fromPdf: require_composition_plan.executeFromPdf,
|
|
153
153
|
toPdf: executeToPdf
|
|
154
154
|
});
|
|
155
155
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFormat } from "./port.cjs";
|
|
2
|
-
import { SourceContentFormat, UnifiedConversionOptions } from "
|
|
2
|
+
import { S as SourceContentFormat, T as UnifiedConversionOptions } from "../composition-plan-DU9nPPN7.cjs";
|
|
3
3
|
//#region src/convert/composition-to-pdf.d.ts
|
|
4
4
|
declare function executeToPdf(format: SourceContentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
|
|
5
5
|
declare function convertDocument(source: DocumentFormat, target: DocumentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFormat } from "./port.js";
|
|
2
|
-
import { SourceContentFormat, UnifiedConversionOptions } from "
|
|
2
|
+
import { S as SourceContentFormat, T as UnifiedConversionOptions } from "../composition-plan-l6QPO4FX.js";
|
|
3
3
|
//#region src/convert/composition-to-pdf.d.ts
|
|
4
4
|
declare function executeToPdf(format: SourceContentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
|
|
5
5
|
declare function convertDocument(source: DocumentFormat, target: DocumentFormat, bytes: Uint8Array<ArrayBuffer>, options?: UnifiedConversionOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -3,10 +3,10 @@ import { createDocumentFontRegistry, treeEmbeddedFontsOf } from "../fonts/regist
|
|
|
3
3
|
import { convertWordprocessingToLayout } from "../layout/engine.js";
|
|
4
4
|
import { convertPresentationToLayout } from "../layout/slides.js";
|
|
5
5
|
import { throwIfAborted } from "../ports/abort.js";
|
|
6
|
-
import { convertSpreadsheetToLayout } from "../
|
|
6
|
+
import { l as convertSpreadsheetToLayout } from "../sheets-DWDvGN-g.js";
|
|
7
7
|
import { convertDrawingToLayout } from "../layout/drawing.js";
|
|
8
8
|
import { UnsupportedConversionError } from "./capability.js";
|
|
9
|
-
import {
|
|
9
|
+
import { _ as executeFromPdf, b as runCompositionPlan, c as LAYOUT_CAPABLE, d as READ_ONLY_FORMAT_NODES, g as executeBridge, i as resolveCompositionPlan, s as FORMAT_NODES, v as isReadOnlyContentFormat, y as isTextFormatNode } from "../composition-plan-f0zaExUW.js";
|
|
10
10
|
import { assembleTree } from "document-schema.js";
|
|
11
11
|
import { createFontMeasurer, createFontRegistry, loadMathFont, writePdf } from "pdf-codec";
|
|
12
12
|
//#region src/convert/composition-to-pdf.ts
|