documents.js 2.1.0 → 2.3.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 +72 -33
- package/dist/codecs/registry.cjs +7 -0
- package/dist/codecs/registry.js +7 -0
- package/dist/convert/capability.cjs +5 -0
- package/dist/convert/capability.js +5 -0
- package/dist/convert/codec.cjs +10 -0
- package/dist/convert/codec.d.cts +3 -1
- package/dist/convert/codec.d.ts +3 -1
- package/dist/convert/codec.js +11 -3
- package/dist/convert/composition.cjs +17 -0
- package/dist/convert/composition.d.cts +5 -2
- package/dist/convert/composition.d.ts +5 -2
- package/dist/convert/composition.js +17 -0
- package/dist/convert/convert.cjs +16 -0
- package/dist/convert/convert.d.cts +13 -1
- package/dist/convert/convert.d.ts +13 -1
- package/dist/convert/convert.js +13 -1
- package/dist/convert/local.cjs +2 -1
- package/dist/convert/local.js +2 -1
- package/dist/convert/port.cjs +1 -0
- package/dist/convert/port.d.cts +2 -0
- package/dist/convert/port.d.ts +2 -0
- package/dist/convert/port.js +1 -0
- package/dist/diagnostics-C5-bG09J.d.cts +18 -0
- package/dist/diagnostics-C5-bG09J.d.ts +18 -0
- package/dist/edit/odg/scaffold.js +8 -8
- package/dist/edit/odp/scaffold.js +8 -8
- package/dist/edit/ods/scaffold.js +8 -8
- package/dist/edit/odt/scaffold.js +8 -8
- package/dist/index.cjs +31 -0
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +12 -4
- package/dist/latex/diagnostics.cjs +21 -0
- package/dist/latex/diagnostics.d.cts +2 -0
- package/dist/latex/diagnostics.d.ts +2 -0
- package/dist/latex/diagnostics.js +19 -0
- package/dist/latex/lint.cjs +82 -0
- package/dist/latex/lint.d.cts +6 -0
- package/dist/latex/lint.d.ts +6 -0
- package/dist/latex/lint.js +81 -0
- package/dist/latex/lower.cjs +550 -0
- package/dist/latex/lower.d.cts +24 -0
- package/dist/latex/lower.d.ts +24 -0
- package/dist/latex/lower.js +548 -0
- package/dist/latex/rational.cjs +29 -0
- package/dist/latex/rational.d.cts +11 -0
- package/dist/latex/rational.d.ts +11 -0
- package/dist/latex/rational.js +27 -0
- package/dist/latex/symbols.cjs +128 -0
- package/dist/latex/symbols.d.cts +16 -0
- package/dist/latex/symbols.d.ts +16 -0
- package/dist/latex/symbols.js +124 -0
- package/dist/latex/temml.cjs +121 -0
- package/dist/latex/temml.d.cts +25 -0
- package/dist/latex/temml.d.ts +25 -0
- package/dist/latex/temml.js +93 -0
- package/dist/markdown/math.cjs +110 -0
- package/dist/markdown/math.d.cts +9 -0
- package/dist/markdown/math.d.ts +9 -0
- package/dist/markdown/math.js +109 -0
- package/dist/markdown/read.cjs +3 -2
- package/dist/markdown/read.d.cts +2 -1
- package/dist/markdown/read.d.ts +2 -1
- package/dist/markdown/read.js +3 -2
- package/dist/markdown/write.cjs +23 -4
- package/dist/markdown/write.js +23 -4
- package/dist/metadata/write.cjs +1 -0
- package/dist/metadata/write.js +1 -0
- package/dist/model/bytes.cjs +5 -0
- package/dist/model/bytes.d.cts +2 -1
- package/dist/model/bytes.d.ts +2 -1
- package/dist/model/bytes.js +5 -1
- package/dist/model/formula.cjs +1 -1
- package/dist/model/formula.js +1 -1
- package/dist/svg/diagnostics.cjs +19 -0
- package/dist/svg/diagnostics.d.cts +10 -0
- package/dist/svg/diagnostics.d.ts +10 -0
- package/dist/svg/diagnostics.js +18 -0
- package/dist/svg/paint.cjs +817 -0
- package/dist/svg/paint.d.cts +19 -0
- package/dist/svg/paint.d.ts +19 -0
- package/dist/svg/paint.js +814 -0
- package/dist/svg/path.cjs +337 -0
- package/dist/svg/path.d.cts +22 -0
- package/dist/svg/path.d.ts +22 -0
- package/dist/svg/path.js +336 -0
- package/dist/svg/read.cjs +677 -0
- package/dist/svg/read.d.cts +12 -0
- package/dist/svg/read.d.ts +12 -0
- package/dist/svg/read.js +675 -0
- package/dist/svg/text.cjs +22 -0
- package/dist/svg/text.d.cts +8 -0
- package/dist/svg/text.d.ts +8 -0
- package/dist/svg/text.js +19 -0
- package/dist/svg/transform.cjs +206 -0
- package/dist/svg/transform.d.cts +23 -0
- package/dist/svg/transform.d.ts +23 -0
- package/dist/svg/transform.js +197 -0
- package/dist/svg/units.cjs +47 -0
- package/dist/svg/units.d.cts +12 -0
- package/dist/svg/units.d.ts +12 -0
- package/dist/svg/units.js +44 -0
- package/dist/svg/write.cjs +127 -0
- package/dist/svg/write.d.cts +23 -0
- package/dist/svg/write.d.ts +23 -0
- package/dist/svg/write.js +123 -0
- package/dist/xml/odf-text.js +2 -2
- package/package.json +2 -1
|
@@ -18,6 +18,9 @@ import { decodeMarkdownText, encodeMarkdownText } from "../markdown/text.js";
|
|
|
18
18
|
import { decodeCsvText, encodeCsvText } from "../csv/text.js";
|
|
19
19
|
import { readCsvContent } from "../csv/read.js";
|
|
20
20
|
import { buildCsvText } from "../csv/write.js";
|
|
21
|
+
import { decodeSvgText, encodeSvgText } from "../svg/text.js";
|
|
22
|
+
import { readSvgContent } from "../svg/read.js";
|
|
23
|
+
import { buildSvgText } from "../svg/write.js";
|
|
21
24
|
import { convertWordprocessingToLayout } from "../layout/engine.js";
|
|
22
25
|
import { convertPresentationToLayout } from "../layout/slides.js";
|
|
23
26
|
import { throwIfAborted } from "../ports/abort.js";
|
|
@@ -41,6 +44,7 @@ const CONTENT_FORMATS = [
|
|
|
41
44
|
"odp",
|
|
42
45
|
"ods",
|
|
43
46
|
"odg",
|
|
47
|
+
"svg",
|
|
44
48
|
"csv",
|
|
45
49
|
"markdown"
|
|
46
50
|
];
|
|
@@ -111,6 +115,18 @@ const FORMAT_NODES = {
|
|
|
111
115
|
encode: (pkg) => encodePackage$1(pkg),
|
|
112
116
|
hasSourcePackage: true
|
|
113
117
|
},
|
|
118
|
+
svg: {
|
|
119
|
+
variant: "drawing",
|
|
120
|
+
family: "svg",
|
|
121
|
+
decode: (bytes) => decodeSvgText(bytes),
|
|
122
|
+
read: (text, options) => readSvgContent(text, { onSvgDiagnostic: options?.onSvgDiagnostic }),
|
|
123
|
+
build: (content, options) => buildSvgText(content, {
|
|
124
|
+
page: options?.page,
|
|
125
|
+
onSvgDiagnostic: options?.onSvgDiagnostic
|
|
126
|
+
}),
|
|
127
|
+
encode: (text) => encodeSvgText(text),
|
|
128
|
+
hasSourcePackage: false
|
|
129
|
+
},
|
|
114
130
|
markdown: {
|
|
115
131
|
variant: "wordprocessing",
|
|
116
132
|
family: "markdown",
|
|
@@ -146,6 +162,7 @@ const LAYOUT_CAPABLE = /* @__PURE__ */ new Set([
|
|
|
146
162
|
"odp",
|
|
147
163
|
"ods",
|
|
148
164
|
"odg",
|
|
165
|
+
"svg",
|
|
149
166
|
"markdown"
|
|
150
167
|
]);
|
|
151
168
|
const TRANSFORMS = {
|
package/dist/convert/convert.cjs
CHANGED
|
@@ -43,6 +43,9 @@ function markdownToPdf(bytes, options) {
|
|
|
43
43
|
function csvToPdf(bytes, options) {
|
|
44
44
|
return require_convert_composition.convertDocument("csv", "pdf", bytes, options);
|
|
45
45
|
}
|
|
46
|
+
function svgToPdf(bytes, options) {
|
|
47
|
+
return require_convert_composition.convertDocument("svg", "pdf", bytes, options);
|
|
48
|
+
}
|
|
46
49
|
const STANDALONE_FORMULA_SIZE_PT = 18;
|
|
47
50
|
const STANDALONE_FORMULA_MARGIN_PT = 72;
|
|
48
51
|
function odfToPdf(bytes, options) {
|
|
@@ -119,6 +122,9 @@ function pdfToMarkdown(bytes, options) {
|
|
|
119
122
|
function pdfToCsv(bytes, options) {
|
|
120
123
|
return require_convert_composition.convertDocument("pdf", "csv", bytes, options);
|
|
121
124
|
}
|
|
125
|
+
function pdfToSvg(bytes, options) {
|
|
126
|
+
return require_convert_composition.convertDocument("pdf", "svg", bytes, options);
|
|
127
|
+
}
|
|
122
128
|
function odtToDocx(bytes, options) {
|
|
123
129
|
return require_convert_composition.convertDocument("odt", "docx", bytes, options);
|
|
124
130
|
}
|
|
@@ -161,6 +167,12 @@ function csvToOds(bytes, options) {
|
|
|
161
167
|
function odsToCsv(bytes, options) {
|
|
162
168
|
return require_convert_composition.convertDocument("ods", "csv", bytes, options);
|
|
163
169
|
}
|
|
170
|
+
function svgToOdg(bytes, options) {
|
|
171
|
+
return require_convert_composition.convertDocument("svg", "odg", bytes, options);
|
|
172
|
+
}
|
|
173
|
+
function odgToSvg(bytes, options) {
|
|
174
|
+
return require_convert_composition.convertDocument("odg", "svg", bytes, options);
|
|
175
|
+
}
|
|
164
176
|
function docxToPptx(bytes, options) {
|
|
165
177
|
return require_convert_composition.convertDocument("docx", "pptx", bytes, options);
|
|
166
178
|
}
|
|
@@ -357,6 +369,7 @@ exports.odbToCsv = odbToCsv;
|
|
|
357
369
|
exports.odbToXlsx = odbToXlsx;
|
|
358
370
|
exports.odfToPdf = odfToPdf;
|
|
359
371
|
exports.odgToPdf = odgToPdf;
|
|
372
|
+
exports.odgToSvg = odgToSvg;
|
|
360
373
|
exports.odmToPdf = odmToPdf;
|
|
361
374
|
exports.odpToOdt = odpToOdt;
|
|
362
375
|
exports.odpToPdf = odpToPdf;
|
|
@@ -376,10 +389,13 @@ exports.pdfToOdp = pdfToOdp;
|
|
|
376
389
|
exports.pdfToOds = pdfToOds;
|
|
377
390
|
exports.pdfToOdt = pdfToOdt;
|
|
378
391
|
exports.pdfToPptx = pdfToPptx;
|
|
392
|
+
exports.pdfToSvg = pdfToSvg;
|
|
379
393
|
exports.pdfToXlsx = pdfToXlsx;
|
|
380
394
|
exports.pptxToDocx = pptxToDocx;
|
|
381
395
|
exports.pptxToOdp = pptxToOdp;
|
|
382
396
|
exports.pptxToPdf = pptxToPdf;
|
|
397
|
+
exports.svgToOdg = svgToOdg;
|
|
398
|
+
exports.svgToPdf = svgToPdf;
|
|
383
399
|
exports.xlsxToCsv = xlsxToCsv;
|
|
384
400
|
exports.xlsxToMarkdown = xlsxToMarkdown;
|
|
385
401
|
exports.xlsxToOds = xlsxToOds;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as ClockPort } from "../clock-C7SUuYN0.cjs";
|
|
2
|
+
import { SvgDiagnosticSink } from "../svg/diagnostics.cjs";
|
|
2
3
|
import { CellTypeInferenceSink } from "../layout/cell-typing.cjs";
|
|
3
4
|
import { t as OmmlDiagnostic } from "../shared-DLZ3IQUl.cjs";
|
|
4
5
|
import { HsqldbDecodeOptions } from "../hsqldb/rowformat.cjs";
|
|
@@ -35,7 +36,15 @@ interface CsvWriteOptions {
|
|
|
35
36
|
readonly delimiter?: string;
|
|
36
37
|
readonly sheet?: string;
|
|
37
38
|
}
|
|
39
|
+
interface SvgReadOptions {
|
|
40
|
+
readonly onSvgDiagnostic?: SvgDiagnosticSink;
|
|
41
|
+
}
|
|
42
|
+
interface SvgWriteOptions {
|
|
43
|
+
readonly page?: number;
|
|
44
|
+
readonly onSvgDiagnostic?: SvgDiagnosticSink;
|
|
45
|
+
}
|
|
38
46
|
declare function csvToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions & CsvReadOptions): Uint8Array<ArrayBuffer>;
|
|
47
|
+
declare function svgToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions & SvgReadOptions): Uint8Array<ArrayBuffer>;
|
|
39
48
|
declare function odfToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
40
49
|
interface PdfToDocumentOptions {
|
|
41
50
|
readonly signal?: AbortSignal;
|
|
@@ -50,6 +59,7 @@ declare function pdfToOdg(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumen
|
|
|
50
59
|
declare function pdfToOds(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
51
60
|
declare function pdfToMarkdown(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
52
61
|
declare function pdfToCsv(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions & CsvWriteOptions): Uint8Array<ArrayBuffer>;
|
|
62
|
+
declare function pdfToSvg(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions & SvgWriteOptions): Uint8Array<ArrayBuffer>;
|
|
53
63
|
interface DocumentBridgeOptions {
|
|
54
64
|
readonly signal?: AbortSignal;
|
|
55
65
|
readonly onDocument?: (pkg: DocumentPackage) => void;
|
|
@@ -82,6 +92,8 @@ declare function csvToXlsx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBri
|
|
|
82
92
|
declare function xlsxToCsv(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions & CsvWriteOptions): Uint8Array<ArrayBuffer>;
|
|
83
93
|
declare function csvToOds(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions & CsvReadOptions): Uint8Array<ArrayBuffer>;
|
|
84
94
|
declare function odsToCsv(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions & CsvWriteOptions): Uint8Array<ArrayBuffer>;
|
|
95
|
+
declare function svgToOdg(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions & SvgReadOptions): Uint8Array<ArrayBuffer>;
|
|
96
|
+
declare function odgToSvg(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions & SvgWriteOptions): Uint8Array<ArrayBuffer>;
|
|
85
97
|
declare function docxToPptx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
86
98
|
declare function pptxToDocx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
87
99
|
declare function odtToOdp(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -120,4 +132,4 @@ interface OdbReportToOdtOptions {
|
|
|
120
132
|
declare function odbReportToOdt(content: ContentDocument, options?: OdbReportToOdtOptions): Uint8Array<ArrayBuffer>;
|
|
121
133
|
declare function odbReportToPdf(content: ContentDocument, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
122
134
|
//#endregion
|
|
123
|
-
export { ComposedDocumentOptions, CsvReadOptions, CsvWriteOptions, DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, inlineOdmSectionToContentSection, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToOdt, odpToPdf, odpToPptx, odsToCsv, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, pdfToCsv, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToDocx, pptxToOdp, pptxToPdf, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf };
|
|
135
|
+
export { ComposedDocumentOptions, CsvReadOptions, CsvWriteOptions, DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, SvgReadOptions, SvgWriteOptions, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, inlineOdmSectionToContentSection, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odgToSvg, odmToPdf, odpToOdt, odpToPdf, odpToPptx, odsToCsv, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, pdfToCsv, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToSvg, pdfToXlsx, pptxToDocx, pptxToOdp, pptxToPdf, svgToOdg, svgToPdf, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as ClockPort } from "../clock-C7SUuYN0.js";
|
|
2
|
+
import { SvgDiagnosticSink } from "../svg/diagnostics.js";
|
|
2
3
|
import { CellTypeInferenceSink } from "../layout/cell-typing.js";
|
|
3
4
|
import { t as OmmlDiagnostic } from "../shared-DUOzjwcL.js";
|
|
4
5
|
import { HsqldbDecodeOptions } from "../hsqldb/rowformat.js";
|
|
@@ -35,7 +36,15 @@ interface CsvWriteOptions {
|
|
|
35
36
|
readonly delimiter?: string;
|
|
36
37
|
readonly sheet?: string;
|
|
37
38
|
}
|
|
39
|
+
interface SvgReadOptions {
|
|
40
|
+
readonly onSvgDiagnostic?: SvgDiagnosticSink;
|
|
41
|
+
}
|
|
42
|
+
interface SvgWriteOptions {
|
|
43
|
+
readonly page?: number;
|
|
44
|
+
readonly onSvgDiagnostic?: SvgDiagnosticSink;
|
|
45
|
+
}
|
|
38
46
|
declare function csvToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions & CsvReadOptions): Uint8Array<ArrayBuffer>;
|
|
47
|
+
declare function svgToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions & SvgReadOptions): Uint8Array<ArrayBuffer>;
|
|
39
48
|
declare function odfToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
40
49
|
interface PdfToDocumentOptions {
|
|
41
50
|
readonly signal?: AbortSignal;
|
|
@@ -50,6 +59,7 @@ declare function pdfToOdg(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumen
|
|
|
50
59
|
declare function pdfToOds(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
51
60
|
declare function pdfToMarkdown(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
52
61
|
declare function pdfToCsv(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions & CsvWriteOptions): Uint8Array<ArrayBuffer>;
|
|
62
|
+
declare function pdfToSvg(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions & SvgWriteOptions): Uint8Array<ArrayBuffer>;
|
|
53
63
|
interface DocumentBridgeOptions {
|
|
54
64
|
readonly signal?: AbortSignal;
|
|
55
65
|
readonly onDocument?: (pkg: DocumentPackage) => void;
|
|
@@ -82,6 +92,8 @@ declare function csvToXlsx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBri
|
|
|
82
92
|
declare function xlsxToCsv(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions & CsvWriteOptions): Uint8Array<ArrayBuffer>;
|
|
83
93
|
declare function csvToOds(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions & CsvReadOptions): Uint8Array<ArrayBuffer>;
|
|
84
94
|
declare function odsToCsv(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions & CsvWriteOptions): Uint8Array<ArrayBuffer>;
|
|
95
|
+
declare function svgToOdg(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions & SvgReadOptions): Uint8Array<ArrayBuffer>;
|
|
96
|
+
declare function odgToSvg(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions & SvgWriteOptions): Uint8Array<ArrayBuffer>;
|
|
85
97
|
declare function docxToPptx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
86
98
|
declare function pptxToDocx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
87
99
|
declare function odtToOdp(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -120,4 +132,4 @@ interface OdbReportToOdtOptions {
|
|
|
120
132
|
declare function odbReportToOdt(content: ContentDocument, options?: OdbReportToOdtOptions): Uint8Array<ArrayBuffer>;
|
|
121
133
|
declare function odbReportToPdf(content: ContentDocument, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
122
134
|
//#endregion
|
|
123
|
-
export { ComposedDocumentOptions, CsvReadOptions, CsvWriteOptions, DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, inlineOdmSectionToContentSection, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToOdt, odpToPdf, odpToPptx, odsToCsv, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, pdfToCsv, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToDocx, pptxToOdp, pptxToPdf, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf };
|
|
135
|
+
export { ComposedDocumentOptions, CsvReadOptions, CsvWriteOptions, DocumentBridgeOptions, DocumentToPdfOptions, OdbConversionOptions, OdbReportToDocxOptions, OdbReportToOdtOptions, OdbToCsvOptions, OdmToPdfOptions, OdmUnresolvedSectionError, PdfToDocumentOptions, SvgReadOptions, SvgWriteOptions, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, inlineOdmSectionToContentSection, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odgToSvg, odmToPdf, odpToOdt, odpToPdf, odpToPptx, odsToCsv, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, pdfToCsv, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToSvg, pdfToXlsx, pptxToDocx, pptxToOdp, pptxToPdf, svgToOdg, svgToPdf, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf };
|
package/dist/convert/convert.js
CHANGED
|
@@ -42,6 +42,9 @@ function markdownToPdf(bytes, options) {
|
|
|
42
42
|
function csvToPdf(bytes, options) {
|
|
43
43
|
return convertDocument("csv", "pdf", bytes, options);
|
|
44
44
|
}
|
|
45
|
+
function svgToPdf(bytes, options) {
|
|
46
|
+
return convertDocument("svg", "pdf", bytes, options);
|
|
47
|
+
}
|
|
45
48
|
const STANDALONE_FORMULA_SIZE_PT = 18;
|
|
46
49
|
const STANDALONE_FORMULA_MARGIN_PT = 72;
|
|
47
50
|
function odfToPdf(bytes, options) {
|
|
@@ -118,6 +121,9 @@ function pdfToMarkdown(bytes, options) {
|
|
|
118
121
|
function pdfToCsv(bytes, options) {
|
|
119
122
|
return convertDocument("pdf", "csv", bytes, options);
|
|
120
123
|
}
|
|
124
|
+
function pdfToSvg(bytes, options) {
|
|
125
|
+
return convertDocument("pdf", "svg", bytes, options);
|
|
126
|
+
}
|
|
121
127
|
function odtToDocx(bytes, options) {
|
|
122
128
|
return convertDocument("odt", "docx", bytes, options);
|
|
123
129
|
}
|
|
@@ -160,6 +166,12 @@ function csvToOds(bytes, options) {
|
|
|
160
166
|
function odsToCsv(bytes, options) {
|
|
161
167
|
return convertDocument("ods", "csv", bytes, options);
|
|
162
168
|
}
|
|
169
|
+
function svgToOdg(bytes, options) {
|
|
170
|
+
return convertDocument("svg", "odg", bytes, options);
|
|
171
|
+
}
|
|
172
|
+
function odgToSvg(bytes, options) {
|
|
173
|
+
return convertDocument("odg", "svg", bytes, options);
|
|
174
|
+
}
|
|
163
175
|
function docxToPptx(bytes, options) {
|
|
164
176
|
return convertDocument("docx", "pptx", bytes, options);
|
|
165
177
|
}
|
|
@@ -334,4 +346,4 @@ function odbReportToPdf(content, options) {
|
|
|
334
346
|
});
|
|
335
347
|
}
|
|
336
348
|
//#endregion
|
|
337
|
-
export { OdmUnresolvedSectionError, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, inlineOdmSectionToContentSection, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odmToPdf, odpToOdt, odpToPdf, odpToPptx, odsToCsv, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, pdfToCsv, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToXlsx, pptxToDocx, pptxToOdp, pptxToPdf, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf };
|
|
349
|
+
export { OdmUnresolvedSectionError, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, inlineOdmSectionToContentSection, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odfToPdf, odgToPdf, odgToSvg, odmToPdf, odpToOdt, odpToPdf, odpToPptx, odsToCsv, odsToPdf, odsToXlsx, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, pdfToCsv, pdfToDocx, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pdfToSvg, pdfToXlsx, pptxToDocx, pptxToOdp, pptxToPdf, svgToOdg, svgToPdf, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf };
|
package/dist/convert/local.cjs
CHANGED
|
@@ -45,7 +45,7 @@ function fromPdfDiagnostic(diagnostic) {
|
|
|
45
45
|
}
|
|
46
46
|
function createLocalDocumentConverter() {
|
|
47
47
|
return {
|
|
48
|
-
contractVersion:
|
|
48
|
+
contractVersion: 6,
|
|
49
49
|
conversions: SUPPORTED_CONVERSIONS,
|
|
50
50
|
convert(request, options) {
|
|
51
51
|
const { source, targetFormat } = request;
|
|
@@ -85,6 +85,7 @@ function createLocalDocumentConverter() {
|
|
|
85
85
|
images: options.images,
|
|
86
86
|
delimiter: options.delimiter,
|
|
87
87
|
sheet: options.sheet,
|
|
88
|
+
page: options.page,
|
|
88
89
|
clock: options.clock,
|
|
89
90
|
onDocument
|
|
90
91
|
});
|
package/dist/convert/local.js
CHANGED
|
@@ -44,7 +44,7 @@ function fromPdfDiagnostic(diagnostic) {
|
|
|
44
44
|
}
|
|
45
45
|
function createLocalDocumentConverter() {
|
|
46
46
|
return {
|
|
47
|
-
contractVersion:
|
|
47
|
+
contractVersion: 6,
|
|
48
48
|
conversions: SUPPORTED_CONVERSIONS,
|
|
49
49
|
convert(request, options) {
|
|
50
50
|
const { source, targetFormat } = request;
|
|
@@ -84,6 +84,7 @@ function createLocalDocumentConverter() {
|
|
|
84
84
|
images: options.images,
|
|
85
85
|
delimiter: options.delimiter,
|
|
86
86
|
sheet: options.sheet,
|
|
87
|
+
page: options.page,
|
|
87
88
|
clock: options.clock,
|
|
88
89
|
onDocument
|
|
89
90
|
});
|
package/dist/convert/port.cjs
CHANGED
package/dist/convert/port.d.cts
CHANGED
|
@@ -11,6 +11,7 @@ declare const DocumentFormatSchema: z.ZodEnum<{
|
|
|
11
11
|
odp: "odp";
|
|
12
12
|
ods: "ods";
|
|
13
13
|
odg: "odg";
|
|
14
|
+
svg: "svg";
|
|
14
15
|
odf: "odf";
|
|
15
16
|
csv: "csv";
|
|
16
17
|
markdown: "markdown";
|
|
@@ -44,6 +45,7 @@ interface ConversionOptions {
|
|
|
44
45
|
readonly images?: MarkdownImageResolver;
|
|
45
46
|
readonly delimiter?: string;
|
|
46
47
|
readonly sheet?: string;
|
|
48
|
+
readonly page?: number;
|
|
47
49
|
readonly clock?: ClockPort;
|
|
48
50
|
}
|
|
49
51
|
interface DocumentConverter {
|
package/dist/convert/port.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ declare const DocumentFormatSchema: z.ZodEnum<{
|
|
|
11
11
|
odp: "odp";
|
|
12
12
|
ods: "ods";
|
|
13
13
|
odg: "odg";
|
|
14
|
+
svg: "svg";
|
|
14
15
|
odf: "odf";
|
|
15
16
|
csv: "csv";
|
|
16
17
|
markdown: "markdown";
|
|
@@ -44,6 +45,7 @@ interface ConversionOptions {
|
|
|
44
45
|
readonly images?: MarkdownImageResolver;
|
|
45
46
|
readonly delimiter?: string;
|
|
46
47
|
readonly sheet?: string;
|
|
48
|
+
readonly page?: number;
|
|
47
49
|
readonly clock?: ClockPort;
|
|
48
50
|
}
|
|
49
51
|
interface DocumentConverter {
|
package/dist/convert/port.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/latex/diagnostics.d.ts
|
|
2
|
+
declare const LATEX_DIAGNOSTIC_CODES: readonly ["latex/parse-error", "latex/construct-unparsed", "latex/juxtaposition-unparsed", "latex/text-unparsed", "latex/subscript-unparsed", "latex/binder-bound-implicit", "latex/binder-bound-unreadable", "latex/operator-unmapped", "latex/script-base-unparsed", "latex/array-environment-unparsed", "latex/genfrac-unparsed", "latex/operator-placement-unparsed", "symbols/prose-definition-found"];
|
|
3
|
+
type LatexDiagnosticCode = (typeof LATEX_DIAGNOSTIC_CODES)[number];
|
|
4
|
+
interface LatexDiagnostic {
|
|
5
|
+
readonly code: LatexDiagnosticCode;
|
|
6
|
+
readonly detail?: string;
|
|
7
|
+
}
|
|
8
|
+
type LatexDiagnosticSink = (diagnostic: LatexDiagnostic) => void;
|
|
9
|
+
declare const MATH_LINT_CODES: readonly ["math/coherence-divergence", "math/coherence-unparseable-presentation"];
|
|
10
|
+
type MathLintCode = (typeof MATH_LINT_CODES)[number];
|
|
11
|
+
interface MathLintDiagnostic {
|
|
12
|
+
readonly code: MathLintCode;
|
|
13
|
+
readonly severity: 'warning';
|
|
14
|
+
readonly provenance?: string;
|
|
15
|
+
readonly detail?: string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MATH_LINT_CODES as a, LatexDiagnosticSink as i, LatexDiagnostic as n, MathLintCode as o, LatexDiagnosticCode as r, MathLintDiagnostic as s, LATEX_DIAGNOSTIC_CODES as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/latex/diagnostics.d.ts
|
|
2
|
+
declare const LATEX_DIAGNOSTIC_CODES: readonly ["latex/parse-error", "latex/construct-unparsed", "latex/juxtaposition-unparsed", "latex/text-unparsed", "latex/subscript-unparsed", "latex/binder-bound-implicit", "latex/binder-bound-unreadable", "latex/operator-unmapped", "latex/script-base-unparsed", "latex/array-environment-unparsed", "latex/genfrac-unparsed", "latex/operator-placement-unparsed", "symbols/prose-definition-found"];
|
|
3
|
+
type LatexDiagnosticCode = (typeof LATEX_DIAGNOSTIC_CODES)[number];
|
|
4
|
+
interface LatexDiagnostic {
|
|
5
|
+
readonly code: LatexDiagnosticCode;
|
|
6
|
+
readonly detail?: string;
|
|
7
|
+
}
|
|
8
|
+
type LatexDiagnosticSink = (diagnostic: LatexDiagnostic) => void;
|
|
9
|
+
declare const MATH_LINT_CODES: readonly ["math/coherence-divergence", "math/coherence-unparseable-presentation"];
|
|
10
|
+
type MathLintCode = (typeof MATH_LINT_CODES)[number];
|
|
11
|
+
interface MathLintDiagnostic {
|
|
12
|
+
readonly code: MathLintCode;
|
|
13
|
+
readonly severity: 'warning';
|
|
14
|
+
readonly provenance?: string;
|
|
15
|
+
readonly detail?: string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MATH_LINT_CODES as a, LatexDiagnosticSink as i, LatexDiagnostic as n, MathLintCode as o, LatexDiagnosticCode as r, MathLintDiagnostic as s, LATEX_DIAGNOSTIC_CODES as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { el, txt } from "../../xml/fragment.js";
|
|
2
|
-
import { encodeXmlText } from "../../xml/entities.js";
|
|
2
|
+
import { encodeXmlText as encodeXmlText$1 } from "../../xml/entities.js";
|
|
3
3
|
import { PAGE_SIZE_A4 } from "document-schema.js";
|
|
4
4
|
import { ODF_MEDIA_TYPES, setDocumentMediaType, syncManifest, xmlnsAttributes } from "odf.js";
|
|
5
5
|
//#region src/edit/odg/scaffold.ts
|
|
@@ -78,13 +78,13 @@ function buildContentXml() {
|
|
|
78
78
|
function buildOfficeMeta(metadata) {
|
|
79
79
|
if (metadata === void 0) return [];
|
|
80
80
|
const children = [];
|
|
81
|
-
if (metadata.title !== void 0) children.push(el("dc:title", {}, [txt(encodeXmlText(metadata.title))]));
|
|
82
|
-
if (metadata.author !== void 0) children.push(el("meta:initial-creator", {}, [txt(encodeXmlText(metadata.author))]));
|
|
83
|
-
if (metadata.subject !== void 0) children.push(el("dc:subject", {}, [txt(encodeXmlText(metadata.subject))]));
|
|
84
|
-
for (const keyword of metadata.keywords ?? []) children.push(el("meta:keyword", {}, [txt(encodeXmlText(keyword))]));
|
|
85
|
-
if (metadata.creator !== void 0) children.push(el("meta:generator", {}, [txt(encodeXmlText(metadata.creator))]));
|
|
86
|
-
if (metadata.createdIso !== void 0) children.push(el("meta:creation-date", {}, [txt(encodeXmlText(metadata.createdIso))]));
|
|
87
|
-
if (metadata.modifiedIso !== void 0) children.push(el("dc:date", {}, [txt(encodeXmlText(metadata.modifiedIso))]));
|
|
81
|
+
if (metadata.title !== void 0) children.push(el("dc:title", {}, [txt(encodeXmlText$1(metadata.title))]));
|
|
82
|
+
if (metadata.author !== void 0) children.push(el("meta:initial-creator", {}, [txt(encodeXmlText$1(metadata.author))]));
|
|
83
|
+
if (metadata.subject !== void 0) children.push(el("dc:subject", {}, [txt(encodeXmlText$1(metadata.subject))]));
|
|
84
|
+
for (const keyword of metadata.keywords ?? []) children.push(el("meta:keyword", {}, [txt(encodeXmlText$1(keyword))]));
|
|
85
|
+
if (metadata.creator !== void 0) children.push(el("meta:generator", {}, [txt(encodeXmlText$1(metadata.creator))]));
|
|
86
|
+
if (metadata.createdIso !== void 0) children.push(el("meta:creation-date", {}, [txt(encodeXmlText$1(metadata.createdIso))]));
|
|
87
|
+
if (metadata.modifiedIso !== void 0) children.push(el("dc:date", {}, [txt(encodeXmlText$1(metadata.modifiedIso))]));
|
|
88
88
|
return children;
|
|
89
89
|
}
|
|
90
90
|
function buildMetaXml(metadata) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { el, txt } from "../../xml/fragment.js";
|
|
2
|
-
import { encodeXmlText } from "../../xml/entities.js";
|
|
2
|
+
import { encodeXmlText as encodeXmlText$1 } from "../../xml/entities.js";
|
|
3
3
|
import { SLIDE_SIZE_WIDESCREEN } from "document-schema.js";
|
|
4
4
|
import { ODF_MEDIA_TYPES, setDocumentMediaType, syncManifest, xmlnsAttributes } from "odf.js";
|
|
5
5
|
//#region src/edit/odp/scaffold.ts
|
|
@@ -80,13 +80,13 @@ function buildContentXml() {
|
|
|
80
80
|
function buildOfficeMeta(metadata) {
|
|
81
81
|
if (metadata === void 0) return [];
|
|
82
82
|
const children = [];
|
|
83
|
-
if (metadata.title !== void 0) children.push(el("dc:title", {}, [txt(encodeXmlText(metadata.title))]));
|
|
84
|
-
if (metadata.author !== void 0) children.push(el("meta:initial-creator", {}, [txt(encodeXmlText(metadata.author))]));
|
|
85
|
-
if (metadata.subject !== void 0) children.push(el("dc:subject", {}, [txt(encodeXmlText(metadata.subject))]));
|
|
86
|
-
for (const keyword of metadata.keywords ?? []) children.push(el("meta:keyword", {}, [txt(encodeXmlText(keyword))]));
|
|
87
|
-
if (metadata.creator !== void 0) children.push(el("meta:generator", {}, [txt(encodeXmlText(metadata.creator))]));
|
|
88
|
-
if (metadata.createdIso !== void 0) children.push(el("meta:creation-date", {}, [txt(encodeXmlText(metadata.createdIso))]));
|
|
89
|
-
if (metadata.modifiedIso !== void 0) children.push(el("dc:date", {}, [txt(encodeXmlText(metadata.modifiedIso))]));
|
|
83
|
+
if (metadata.title !== void 0) children.push(el("dc:title", {}, [txt(encodeXmlText$1(metadata.title))]));
|
|
84
|
+
if (metadata.author !== void 0) children.push(el("meta:initial-creator", {}, [txt(encodeXmlText$1(metadata.author))]));
|
|
85
|
+
if (metadata.subject !== void 0) children.push(el("dc:subject", {}, [txt(encodeXmlText$1(metadata.subject))]));
|
|
86
|
+
for (const keyword of metadata.keywords ?? []) children.push(el("meta:keyword", {}, [txt(encodeXmlText$1(keyword))]));
|
|
87
|
+
if (metadata.creator !== void 0) children.push(el("meta:generator", {}, [txt(encodeXmlText$1(metadata.creator))]));
|
|
88
|
+
if (metadata.createdIso !== void 0) children.push(el("meta:creation-date", {}, [txt(encodeXmlText$1(metadata.createdIso))]));
|
|
89
|
+
if (metadata.modifiedIso !== void 0) children.push(el("dc:date", {}, [txt(encodeXmlText$1(metadata.modifiedIso))]));
|
|
90
90
|
return children;
|
|
91
91
|
}
|
|
92
92
|
function buildMetaXml(metadata) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { el, txt } from "../../xml/fragment.js";
|
|
2
|
-
import { encodeXmlText } from "../../xml/entities.js";
|
|
2
|
+
import { encodeXmlText as encodeXmlText$1 } from "../../xml/entities.js";
|
|
3
3
|
import { PAGE_SIZE_A4 } from "document-schema.js";
|
|
4
4
|
import { ODF_MEDIA_TYPES, setDocumentMediaType, syncManifest, xmlnsAttributes } from "odf.js";
|
|
5
5
|
//#region src/edit/ods/scaffold.ts
|
|
@@ -99,13 +99,13 @@ function buildContentXml() {
|
|
|
99
99
|
function buildOfficeMeta(metadata) {
|
|
100
100
|
if (metadata === void 0) return [];
|
|
101
101
|
const children = [];
|
|
102
|
-
if (metadata.title !== void 0) children.push(el("dc:title", {}, [txt(encodeXmlText(metadata.title))]));
|
|
103
|
-
if (metadata.author !== void 0) children.push(el("meta:initial-creator", {}, [txt(encodeXmlText(metadata.author))]));
|
|
104
|
-
if (metadata.subject !== void 0) children.push(el("dc:subject", {}, [txt(encodeXmlText(metadata.subject))]));
|
|
105
|
-
for (const keyword of metadata.keywords ?? []) children.push(el("meta:keyword", {}, [txt(encodeXmlText(keyword))]));
|
|
106
|
-
if (metadata.creator !== void 0) children.push(el("meta:generator", {}, [txt(encodeXmlText(metadata.creator))]));
|
|
107
|
-
if (metadata.createdIso !== void 0) children.push(el("meta:creation-date", {}, [txt(encodeXmlText(metadata.createdIso))]));
|
|
108
|
-
if (metadata.modifiedIso !== void 0) children.push(el("dc:date", {}, [txt(encodeXmlText(metadata.modifiedIso))]));
|
|
102
|
+
if (metadata.title !== void 0) children.push(el("dc:title", {}, [txt(encodeXmlText$1(metadata.title))]));
|
|
103
|
+
if (metadata.author !== void 0) children.push(el("meta:initial-creator", {}, [txt(encodeXmlText$1(metadata.author))]));
|
|
104
|
+
if (metadata.subject !== void 0) children.push(el("dc:subject", {}, [txt(encodeXmlText$1(metadata.subject))]));
|
|
105
|
+
for (const keyword of metadata.keywords ?? []) children.push(el("meta:keyword", {}, [txt(encodeXmlText$1(keyword))]));
|
|
106
|
+
if (metadata.creator !== void 0) children.push(el("meta:generator", {}, [txt(encodeXmlText$1(metadata.creator))]));
|
|
107
|
+
if (metadata.createdIso !== void 0) children.push(el("meta:creation-date", {}, [txt(encodeXmlText$1(metadata.createdIso))]));
|
|
108
|
+
if (metadata.modifiedIso !== void 0) children.push(el("dc:date", {}, [txt(encodeXmlText$1(metadata.modifiedIso))]));
|
|
109
109
|
return children;
|
|
110
110
|
}
|
|
111
111
|
function buildMetaXml(metadata) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { el, txt } from "../../xml/fragment.js";
|
|
2
|
-
import { encodeXmlText } from "../../xml/entities.js";
|
|
2
|
+
import { encodeXmlText as encodeXmlText$1 } from "../../xml/entities.js";
|
|
3
3
|
import { PAGE_SIZE_LETTER } from "document-schema.js";
|
|
4
4
|
import { ODF_MEDIA_TYPES, setDocumentMediaType, syncManifest, xmlnsAttributes } from "odf.js";
|
|
5
5
|
//#region src/edit/odt/scaffold.ts
|
|
@@ -83,13 +83,13 @@ function buildContentXml() {
|
|
|
83
83
|
function buildOfficeMeta(metadata) {
|
|
84
84
|
if (metadata === void 0) return [];
|
|
85
85
|
const children = [];
|
|
86
|
-
if (metadata.title !== void 0) children.push(el("dc:title", {}, [txt(encodeXmlText(metadata.title))]));
|
|
87
|
-
if (metadata.author !== void 0) children.push(el("meta:initial-creator", {}, [txt(encodeXmlText(metadata.author))]));
|
|
88
|
-
if (metadata.subject !== void 0) children.push(el("dc:subject", {}, [txt(encodeXmlText(metadata.subject))]));
|
|
89
|
-
for (const keyword of metadata.keywords ?? []) children.push(el("meta:keyword", {}, [txt(encodeXmlText(keyword))]));
|
|
90
|
-
if (metadata.creator !== void 0) children.push(el("meta:generator", {}, [txt(encodeXmlText(metadata.creator))]));
|
|
91
|
-
if (metadata.createdIso !== void 0) children.push(el("meta:creation-date", {}, [txt(encodeXmlText(metadata.createdIso))]));
|
|
92
|
-
if (metadata.modifiedIso !== void 0) children.push(el("dc:date", {}, [txt(encodeXmlText(metadata.modifiedIso))]));
|
|
86
|
+
if (metadata.title !== void 0) children.push(el("dc:title", {}, [txt(encodeXmlText$1(metadata.title))]));
|
|
87
|
+
if (metadata.author !== void 0) children.push(el("meta:initial-creator", {}, [txt(encodeXmlText$1(metadata.author))]));
|
|
88
|
+
if (metadata.subject !== void 0) children.push(el("dc:subject", {}, [txt(encodeXmlText$1(metadata.subject))]));
|
|
89
|
+
for (const keyword of metadata.keywords ?? []) children.push(el("meta:keyword", {}, [txt(encodeXmlText$1(keyword))]));
|
|
90
|
+
if (metadata.creator !== void 0) children.push(el("meta:generator", {}, [txt(encodeXmlText$1(metadata.creator))]));
|
|
91
|
+
if (metadata.createdIso !== void 0) children.push(el("meta:creation-date", {}, [txt(encodeXmlText$1(metadata.createdIso))]));
|
|
92
|
+
if (metadata.modifiedIso !== void 0) children.push(el("dc:date", {}, [txt(encodeXmlText$1(metadata.modifiedIso))]));
|
|
93
93
|
return children;
|
|
94
94
|
}
|
|
95
95
|
function buildMetaXml(metadata) {
|
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,8 @@ const require_edit_ods_content = require("./edit/ods/content.cjs");
|
|
|
37
37
|
const require_edit_odg_page = require("./edit/odg/page.cjs");
|
|
38
38
|
const require_edit_odg_editor = require("./edit/odg/editor.cjs");
|
|
39
39
|
const require_edit_odg_content = require("./edit/odg/content.cjs");
|
|
40
|
+
const require_latex_lower = require("./latex/lower.cjs");
|
|
41
|
+
const require_markdown_math = require("./markdown/math.cjs");
|
|
40
42
|
const require_markdown_read = require("./markdown/read.cjs");
|
|
41
43
|
const require_markdown_write = require("./markdown/write.cjs");
|
|
42
44
|
const require_edit_markdown_run = require("./edit/markdown/run.cjs");
|
|
@@ -53,6 +55,8 @@ const require_fonts_ooxml = require("./fonts/ooxml.cjs");
|
|
|
53
55
|
const require_fonts_registry = require("./fonts/registry.cjs");
|
|
54
56
|
const require_mathml_layout = require("./mathml/layout.cjs");
|
|
55
57
|
const require_omml_read = require("./omml/read.cjs");
|
|
58
|
+
const require_latex_diagnostics = require("./latex/diagnostics.cjs");
|
|
59
|
+
const require_latex_lint = require("./latex/lint.cjs");
|
|
56
60
|
const require_ooxml_docx_read = require("./ooxml/docx/read.cjs");
|
|
57
61
|
const require_ooxml_docx_extras = require("./ooxml/docx/extras.cjs");
|
|
58
62
|
const require_ooxml_pptx_read = require("./ooxml/pptx/read.cjs");
|
|
@@ -67,6 +71,10 @@ const require_layout_cell_typing = require("./layout/cell-typing.cjs");
|
|
|
67
71
|
const require_csv_records = require("./csv/records.cjs");
|
|
68
72
|
const require_csv_read = require("./csv/read.cjs");
|
|
69
73
|
const require_csv_write = require("./csv/write.cjs");
|
|
74
|
+
const require_svg_text = require("./svg/text.cjs");
|
|
75
|
+
const require_svg_read = require("./svg/read.cjs");
|
|
76
|
+
const require_svg_write = require("./svg/write.cjs");
|
|
77
|
+
const require_svg_diagnostics = require("./svg/diagnostics.cjs");
|
|
70
78
|
const require_markdown_render = require("./markdown/render.cjs");
|
|
71
79
|
const require_layout_engine = require("./layout/engine.cjs");
|
|
72
80
|
const require_layout_slides = require("./layout/slides.cjs");
|
|
@@ -376,6 +384,7 @@ exports.HsqldbScriptParseError = require_hsqldb_script.HsqldbScriptParseError;
|
|
|
376
384
|
exports.HsqldbSqlEvaluationError = require_odb_sql_errors.HsqldbSqlEvaluationError;
|
|
377
385
|
exports.HsqldbSqlParseError = require_odb_sql_errors.HsqldbSqlParseError;
|
|
378
386
|
exports.HsqldbSqlUnsupportedError = require_odb_sql_errors.HsqldbSqlUnsupportedError;
|
|
387
|
+
exports.LATEX_DIAGNOSTIC_CODES = require_latex_diagnostics.LATEX_DIAGNOSTIC_CODES;
|
|
379
388
|
Object.defineProperty(exports, "LAYOUT_FORMAT_VERSION", {
|
|
380
389
|
enumerable: true,
|
|
381
390
|
get: function() {
|
|
@@ -388,6 +397,7 @@ Object.defineProperty(exports, "LayoutDocumentSchema", {
|
|
|
388
397
|
return document_schema_js.LayoutDocumentSchema;
|
|
389
398
|
}
|
|
390
399
|
});
|
|
400
|
+
exports.MATH_LINT_CODES = require_latex_diagnostics.MATH_LINT_CODES;
|
|
391
401
|
exports.MarkdownBytesSchema = require_model_bytes.MarkdownBytesSchema;
|
|
392
402
|
exports.MarkdownEditor = require_edit_markdown_editor.MarkdownEditor;
|
|
393
403
|
exports.MarkdownList = require_edit_markdown_list.MarkdownList;
|
|
@@ -516,6 +526,13 @@ Object.defineProperty(exports, "SLIDE_SIZE_WIDESCREEN", {
|
|
|
516
526
|
return document_schema_js.SLIDE_SIZE_WIDESCREEN;
|
|
517
527
|
}
|
|
518
528
|
});
|
|
529
|
+
exports.SVG_DIAGNOSTIC_CODES = require_svg_diagnostics.SVG_DIAGNOSTIC_CODES;
|
|
530
|
+
exports.SvgBytesSchema = require_model_bytes.SvgBytesSchema;
|
|
531
|
+
exports.SvgInvalidUtf8Error = require_svg_text.SvgInvalidUtf8Error;
|
|
532
|
+
exports.SvgMissingRootElementError = require_svg_read.SvgMissingRootElementError;
|
|
533
|
+
exports.SvgMultiPageNotSpecifiedError = require_svg_write.SvgMultiPageNotSpecifiedError;
|
|
534
|
+
exports.SvgPageNotFoundError = require_svg_write.SvgPageNotFoundError;
|
|
535
|
+
exports.SvgUnsupportedDocumentKindError = require_svg_write.SvgUnsupportedDocumentKindError;
|
|
519
536
|
Object.defineProperty(exports, "UnrecognizedDocumentSchemaError", {
|
|
520
537
|
enumerable: true,
|
|
521
538
|
get: function() {
|
|
@@ -599,6 +616,7 @@ exports.buildOdtPackage = require_edit_odt_content.buildOdtPackage;
|
|
|
599
616
|
exports.buildOfficeMath = require_omml_write.buildOfficeMath;
|
|
600
617
|
exports.buildOfficeMathParagraph = require_omml_write.buildOfficeMathParagraph;
|
|
601
618
|
exports.buildPptxPackage = require_edit_pptx_content.buildPptxPackage;
|
|
619
|
+
exports.buildSvgText = require_svg_write.buildSvgText;
|
|
602
620
|
Object.defineProperty(exports, "buildXlsxPackage", {
|
|
603
621
|
enumerable: true,
|
|
604
622
|
get: function() {
|
|
@@ -722,6 +740,7 @@ Object.defineProperty(exports, "decodePackage", {
|
|
|
722
740
|
return ooxml_js.decodePackage;
|
|
723
741
|
}
|
|
724
742
|
});
|
|
743
|
+
exports.decodeSvgText = require_svg_text.decodeSvgText;
|
|
725
744
|
exports.deobfuscateEmbeddedFont = require_fonts_obfuscation.deobfuscateEmbeddedFont;
|
|
726
745
|
exports.deriveFontKey = require_fonts_obfuscation.deriveFontKey;
|
|
727
746
|
Object.defineProperty(exports, "describeFontFace", {
|
|
@@ -778,6 +797,7 @@ Object.defineProperty(exports, "encodePackage", {
|
|
|
778
797
|
return ooxml_js.encodePackage;
|
|
779
798
|
}
|
|
780
799
|
});
|
|
800
|
+
exports.encodeSvgText = require_svg_text.encodeSvgText;
|
|
781
801
|
exports.evaluateRptBandOutsideData = require_odb_formula_evaluate.evaluateRptBandOutsideData;
|
|
782
802
|
exports.evaluateSelect = require_odb_sql_evaluate.evaluateSelect;
|
|
783
803
|
exports.extractOdfEmbeddedFonts = require_fonts_odf.extractOdfEmbeddedFonts;
|
|
@@ -819,6 +839,7 @@ Object.defineProperty(exports, "isXmlNode", {
|
|
|
819
839
|
return ooxml_js.isXmlNode;
|
|
820
840
|
}
|
|
821
841
|
});
|
|
842
|
+
exports.latexToFormula = require_latex_lower.latexToFormula;
|
|
822
843
|
exports.layoutDocumentFromPackage = require_convert_from_package.layoutDocumentFromPackage;
|
|
823
844
|
Object.defineProperty(exports, "layoutDocumentWithSchema", {
|
|
824
845
|
enumerable: true,
|
|
@@ -827,6 +848,7 @@ Object.defineProperty(exports, "layoutDocumentWithSchema", {
|
|
|
827
848
|
}
|
|
828
849
|
});
|
|
829
850
|
exports.layoutFormula = require_mathml_layout.layoutFormula;
|
|
851
|
+
exports.lintMathCoherence = require_latex_lint.lintMathCoherence;
|
|
830
852
|
Object.defineProperty(exports, "loadMathFont", {
|
|
831
853
|
enumerable: true,
|
|
832
854
|
get: function() {
|
|
@@ -835,6 +857,8 @@ Object.defineProperty(exports, "loadMathFont", {
|
|
|
835
857
|
});
|
|
836
858
|
exports.localName = require_mathml_nodes.localName;
|
|
837
859
|
exports.looksLikeSfnt = require_fonts_obfuscation.looksLikeSfnt;
|
|
860
|
+
exports.lowerLatex = require_latex_lower.lowerLatex;
|
|
861
|
+
exports.lowerMarkdownMath = require_markdown_math.lowerMarkdownMath;
|
|
838
862
|
exports.mapMathVariant = require_mathml_variant.mapMathVariant;
|
|
839
863
|
exports.markdownDocxCodec = require_convert_codec.markdownDocxCodec;
|
|
840
864
|
exports.markdownOdtCodec = require_convert_codec.markdownOdtCodec;
|
|
@@ -855,7 +879,9 @@ exports.odbToCsv = require_convert_convert.odbToCsv;
|
|
|
855
879
|
exports.odbToXlsx = require_convert_convert.odbToXlsx;
|
|
856
880
|
exports.odfToPdf = require_convert_convert.odfToPdf;
|
|
857
881
|
exports.odgPdfCodec = require_convert_codec.odgPdfCodec;
|
|
882
|
+
exports.odgSvgCodec = require_convert_codec.odgSvgCodec;
|
|
858
883
|
exports.odgToPdf = require_convert_convert.odgToPdf;
|
|
884
|
+
exports.odgToSvg = require_convert_convert.odgToSvg;
|
|
859
885
|
exports.odmToPdf = require_convert_convert.odmToPdf;
|
|
860
886
|
exports.odpPdfCodec = require_convert_codec.odpPdfCodec;
|
|
861
887
|
exports.odpPptxCodec = require_convert_codec.odpPptxCodec;
|
|
@@ -931,6 +957,7 @@ exports.pdfToOdp = require_convert_convert.pdfToOdp;
|
|
|
931
957
|
exports.pdfToOds = require_convert_convert.pdfToOds;
|
|
932
958
|
exports.pdfToOdt = require_convert_convert.pdfToOdt;
|
|
933
959
|
exports.pdfToPptx = require_convert_convert.pdfToPptx;
|
|
960
|
+
exports.pdfToSvg = require_convert_convert.pdfToSvg;
|
|
934
961
|
exports.pdfToXlsx = require_convert_convert.pdfToXlsx;
|
|
935
962
|
exports.pptxPdfCodec = require_convert_codec.pptxPdfCodec;
|
|
936
963
|
exports.pptxToDocx = require_convert_convert.pptxToDocx;
|
|
@@ -984,6 +1011,7 @@ Object.defineProperty(exports, "readPdf", {
|
|
|
984
1011
|
}
|
|
985
1012
|
});
|
|
986
1013
|
exports.readPptxContent = require_ooxml_pptx_read.readPptxContent;
|
|
1014
|
+
exports.readSvgContent = require_svg_read.readSvgContent;
|
|
987
1015
|
Object.defineProperty(exports, "readXlsxContent", {
|
|
988
1016
|
enumerable: true,
|
|
989
1017
|
get: function() {
|
|
@@ -1039,6 +1067,9 @@ Object.defineProperty(exports, "serializePackage", {
|
|
|
1039
1067
|
}
|
|
1040
1068
|
});
|
|
1041
1069
|
exports.setDocumentMetadata = require_metadata_write.setDocumentMetadata;
|
|
1070
|
+
exports.svgPdfCodec = require_convert_codec.svgPdfCodec;
|
|
1071
|
+
exports.svgToOdg = require_convert_convert.svgToOdg;
|
|
1072
|
+
exports.svgToPdf = require_convert_convert.svgToPdf;
|
|
1042
1073
|
exports.systemClock = require_ports_clock.systemClock;
|
|
1043
1074
|
Object.defineProperty(exports, "textContent", {
|
|
1044
1075
|
enumerable: true,
|