js.documents 1.87.5 → 1.88.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/dist/convert/convert.cjs
CHANGED
|
@@ -165,7 +165,10 @@ function odgToPdf(bytes, options) {
|
|
|
165
165
|
function markdownToPdf(bytes, options) {
|
|
166
166
|
require_ports_abort.throwIfAborted(options?.signal);
|
|
167
167
|
const text = require_markdown_text.decodeMarkdownText(bytes);
|
|
168
|
-
const content = require_markdown_read.readMarkdownContent(text, {
|
|
168
|
+
const content = require_markdown_read.readMarkdownContent(text, {
|
|
169
|
+
signal: options?.signal,
|
|
170
|
+
images: options?.images
|
|
171
|
+
});
|
|
169
172
|
if (content.kind !== "wordprocessing") throw new Error("readMarkdownContent returned a non-wordprocessing ContentDocument");
|
|
170
173
|
const fonts = (0, pdf_codec.createFontRegistry)({
|
|
171
174
|
fonts: options?.fonts,
|
|
@@ -396,7 +399,10 @@ function xlsxToOds(bytes, options) {
|
|
|
396
399
|
function markdownToDocx(bytes, options) {
|
|
397
400
|
require_ports_abort.throwIfAborted(options?.signal);
|
|
398
401
|
const text = require_markdown_text.decodeMarkdownText(bytes);
|
|
399
|
-
const content = require_markdown_read.readMarkdownContent(text, {
|
|
402
|
+
const content = require_markdown_read.readMarkdownContent(text, {
|
|
403
|
+
signal: options?.signal,
|
|
404
|
+
images: options?.images
|
|
405
|
+
});
|
|
400
406
|
if (content.kind !== "wordprocessing") throw new Error("readMarkdownContent returned a non-wordprocessing ContentDocument");
|
|
401
407
|
require_ports_abort.throwIfAborted(options?.signal);
|
|
402
408
|
options?.onDocument?.({
|
|
@@ -421,7 +427,10 @@ function docxToMarkdown(bytes, options) {
|
|
|
421
427
|
function markdownToOdt(bytes, options) {
|
|
422
428
|
require_ports_abort.throwIfAborted(options?.signal);
|
|
423
429
|
const text = require_markdown_text.decodeMarkdownText(bytes);
|
|
424
|
-
const content = require_markdown_read.readMarkdownContent(text, {
|
|
430
|
+
const content = require_markdown_read.readMarkdownContent(text, {
|
|
431
|
+
signal: options?.signal,
|
|
432
|
+
images: options?.images
|
|
433
|
+
});
|
|
425
434
|
if (content.kind !== "wordprocessing") throw new Error("readMarkdownContent returned a non-wordprocessing ContentDocument");
|
|
426
435
|
require_ports_abort.throwIfAborted(options?.signal);
|
|
427
436
|
options?.onDocument?.({
|
|
@@ -4,6 +4,7 @@ import { t as DocumentFontRegistryOptions } from "../registry-CeZB1W_p.cjs";
|
|
|
4
4
|
import { ContentDocument, ContentSection, DocumentPackage } from "document-schema.js";
|
|
5
5
|
import { PdfDiagnosticSink, WinAnsiSubstitution } from "pdf-codec";
|
|
6
6
|
import { OdmSection, Package } from "odf.js";
|
|
7
|
+
import { MarkdownImageResolver } from "markdown-codec";
|
|
7
8
|
//#region src/convert/convert.d.ts
|
|
8
9
|
interface DocumentToPdfOptions extends DocumentFontRegistryOptions {
|
|
9
10
|
readonly signal?: AbortSignal;
|
|
@@ -14,6 +15,7 @@ interface DocumentToPdfOptions extends DocumentFontRegistryOptions {
|
|
|
14
15
|
readonly onMathDiagnostic?: (diagnostic: OmmlDiagnostic, context: {
|
|
15
16
|
readonly sourcePath?: string;
|
|
16
17
|
}) => void;
|
|
18
|
+
readonly images?: MarkdownImageResolver;
|
|
17
19
|
}
|
|
18
20
|
declare function docxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
19
21
|
declare function odtToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -41,6 +43,7 @@ interface DocumentBridgeOptions {
|
|
|
41
43
|
readonly onMathDiagnostic?: (diagnostic: OmmlDiagnostic, context: {
|
|
42
44
|
readonly sourcePath?: string;
|
|
43
45
|
}) => void;
|
|
46
|
+
readonly images?: MarkdownImageResolver;
|
|
44
47
|
}
|
|
45
48
|
declare function odtToDocx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
46
49
|
declare function docxToOdt(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -3,6 +3,7 @@ import { t as OmmlDiagnostic } from "../shared-DUOzjwcL.js";
|
|
|
3
3
|
import { t as DocumentFontRegistryOptions } from "../registry-CrSqLIcn.js";
|
|
4
4
|
import { ContentDocument, ContentSection, DocumentPackage } from "document-schema.js";
|
|
5
5
|
import { OdmSection, Package } from "odf.js";
|
|
6
|
+
import { MarkdownImageResolver } from "markdown-codec";
|
|
6
7
|
import { PdfDiagnosticSink, WinAnsiSubstitution } from "pdf-codec";
|
|
7
8
|
//#region src/convert/convert.d.ts
|
|
8
9
|
interface DocumentToPdfOptions extends DocumentFontRegistryOptions {
|
|
@@ -14,6 +15,7 @@ interface DocumentToPdfOptions extends DocumentFontRegistryOptions {
|
|
|
14
15
|
readonly onMathDiagnostic?: (diagnostic: OmmlDiagnostic, context: {
|
|
15
16
|
readonly sourcePath?: string;
|
|
16
17
|
}) => void;
|
|
18
|
+
readonly images?: MarkdownImageResolver;
|
|
17
19
|
}
|
|
18
20
|
declare function docxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
19
21
|
declare function odtToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -41,6 +43,7 @@ interface DocumentBridgeOptions {
|
|
|
41
43
|
readonly onMathDiagnostic?: (diagnostic: OmmlDiagnostic, context: {
|
|
42
44
|
readonly sourcePath?: string;
|
|
43
45
|
}) => void;
|
|
46
|
+
readonly images?: MarkdownImageResolver;
|
|
44
47
|
}
|
|
45
48
|
declare function odtToDocx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
46
49
|
declare function docxToOdt(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
package/dist/convert/convert.js
CHANGED
|
@@ -164,7 +164,10 @@ function odgToPdf(bytes, options) {
|
|
|
164
164
|
function markdownToPdf(bytes, options) {
|
|
165
165
|
throwIfAborted(options?.signal);
|
|
166
166
|
const text = decodeMarkdownText(bytes);
|
|
167
|
-
const content = readMarkdownContent(text, {
|
|
167
|
+
const content = readMarkdownContent(text, {
|
|
168
|
+
signal: options?.signal,
|
|
169
|
+
images: options?.images
|
|
170
|
+
});
|
|
168
171
|
if (content.kind !== "wordprocessing") throw new Error("readMarkdownContent returned a non-wordprocessing ContentDocument");
|
|
169
172
|
const fonts = createFontRegistry({
|
|
170
173
|
fonts: options?.fonts,
|
|
@@ -395,7 +398,10 @@ function xlsxToOds(bytes, options) {
|
|
|
395
398
|
function markdownToDocx(bytes, options) {
|
|
396
399
|
throwIfAborted(options?.signal);
|
|
397
400
|
const text = decodeMarkdownText(bytes);
|
|
398
|
-
const content = readMarkdownContent(text, {
|
|
401
|
+
const content = readMarkdownContent(text, {
|
|
402
|
+
signal: options?.signal,
|
|
403
|
+
images: options?.images
|
|
404
|
+
});
|
|
399
405
|
if (content.kind !== "wordprocessing") throw new Error("readMarkdownContent returned a non-wordprocessing ContentDocument");
|
|
400
406
|
throwIfAborted(options?.signal);
|
|
401
407
|
options?.onDocument?.({
|
|
@@ -420,7 +426,10 @@ function docxToMarkdown(bytes, options) {
|
|
|
420
426
|
function markdownToOdt(bytes, options) {
|
|
421
427
|
throwIfAborted(options?.signal);
|
|
422
428
|
const text = decodeMarkdownText(bytes);
|
|
423
|
-
const content = readMarkdownContent(text, {
|
|
429
|
+
const content = readMarkdownContent(text, {
|
|
430
|
+
signal: options?.signal,
|
|
431
|
+
images: options?.images
|
|
432
|
+
});
|
|
424
433
|
if (content.kind !== "wordprocessing") throw new Error("readMarkdownContent returned a non-wordprocessing ContentDocument");
|
|
425
434
|
throwIfAborted(options?.signal);
|
|
426
435
|
options?.onDocument?.({
|
package/package.json
CHANGED