js.documents 1.88.0 → 1.89.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.
@@ -2,9 +2,9 @@ import { n as HsqldbDecodeOptions } from "../rowformat-Cl2exlEh.cjs";
2
2
  import { t as OmmlDiagnostic } from "../shared-DLZ3IQUl.cjs";
3
3
  import { t as DocumentFontRegistryOptions } from "../registry-CeZB1W_p.cjs";
4
4
  import { ContentDocument, ContentSection, DocumentPackage } from "document-schema.js";
5
+ import { MarkdownImageResolver } from "markdown-codec";
5
6
  import { PdfDiagnosticSink, WinAnsiSubstitution } from "pdf-codec";
6
7
  import { OdmSection, Package } from "odf.js";
7
- import { MarkdownImageResolver } from "markdown-codec";
8
8
  //#region src/convert/convert.d.ts
9
9
  interface DocumentToPdfOptions extends DocumentFontRegistryOptions {
10
10
  readonly signal?: AbortSignal;
@@ -30,7 +30,7 @@ function fromPdfDiagnostic(diagnostic) {
30
30
  }
31
31
  function createLocalDocumentConverter() {
32
32
  return {
33
- contractVersion: 3,
33
+ contractVersion: 4,
34
34
  conversions: SUPPORTED_CONVERSIONS,
35
35
  convert(request, options) {
36
36
  const { source, targetFormat } = request;
@@ -52,7 +52,8 @@ function createLocalDocumentConverter() {
52
52
  onSubstitution: (s, c) => diagnostics.push(substitutionDiagnostic(s, c)),
53
53
  onDocument,
54
54
  fonts: options.fonts,
55
- onFontSubstitution
55
+ onFontSubstitution,
56
+ images: options.images
56
57
  });
57
58
  return Promise.resolve({
58
59
  document: {
@@ -80,7 +81,8 @@ function createLocalDocumentConverter() {
80
81
  }
81
82
  const bytes = edge.convert(source.bytes, {
82
83
  signal: options.signal,
83
- onDocument
84
+ onDocument,
85
+ images: options.images
84
86
  });
85
87
  return Promise.resolve({
86
88
  document: {
@@ -29,7 +29,7 @@ function fromPdfDiagnostic(diagnostic) {
29
29
  }
30
30
  function createLocalDocumentConverter() {
31
31
  return {
32
- contractVersion: 3,
32
+ contractVersion: 4,
33
33
  conversions: SUPPORTED_CONVERSIONS,
34
34
  convert(request, options) {
35
35
  const { source, targetFormat } = request;
@@ -51,7 +51,8 @@ function createLocalDocumentConverter() {
51
51
  onSubstitution: (s, c) => diagnostics.push(substitutionDiagnostic(s, c)),
52
52
  onDocument,
53
53
  fonts: options.fonts,
54
- onFontSubstitution
54
+ onFontSubstitution,
55
+ images: options.images
55
56
  });
56
57
  return Promise.resolve({
57
58
  document: {
@@ -79,7 +80,8 @@ function createLocalDocumentConverter() {
79
80
  }
80
81
  const bytes = edge.convert(source.bytes, {
81
82
  signal: options.signal,
82
- onDocument
83
+ onDocument,
84
+ images: options.images
83
85
  });
84
86
  return Promise.resolve({
85
87
  document: {
@@ -1,4 +1,5 @@
1
1
  import { DocumentPackage } from "document-schema.js";
2
+ import { MarkdownImageResolver } from "markdown-codec";
2
3
  import { FontSubstitution, ProvidedFont } from "pdf-codec";
3
4
  import { z } from "zod";
4
5
  //#region src/convert/port.d.ts
@@ -39,6 +40,7 @@ interface ConversionOptions {
39
40
  readonly signal: AbortSignal;
40
41
  readonly fonts?: readonly ProvidedFont[];
41
42
  readonly onFontSubstitution?: (substitution: FontSubstitution) => void;
43
+ readonly images?: MarkdownImageResolver;
42
44
  }
43
45
  interface DocumentConverter {
44
46
  readonly contractVersion: number;
@@ -1,5 +1,6 @@
1
1
  import { DocumentPackage } from "document-schema.js";
2
2
  import { z } from "zod";
3
+ import { MarkdownImageResolver } from "markdown-codec";
3
4
  import { FontSubstitution, ProvidedFont } from "pdf-codec";
4
5
  //#region src/convert/port.d.ts
5
6
  declare const DocumentFormatSchema: z.ZodEnum<{
@@ -39,6 +40,7 @@ interface ConversionOptions {
39
40
  readonly signal: AbortSignal;
40
41
  readonly fonts?: readonly ProvidedFont[];
41
42
  readonly onFontSubstitution?: (substitution: FontSubstitution) => void;
43
+ readonly images?: MarkdownImageResolver;
42
44
  }
43
45
  interface DocumentConverter {
44
46
  readonly contractVersion: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js.documents",
3
- "version": "1.88.0",
3
+ "version": "1.89.0",
4
4
  "description": "Bidirectional docx/pptx <-> PDF conversion and a read+write editable OOXML document model, built on ooxml.js and Zod 4 codecs.",
5
5
  "type": "module",
6
6
  "repository": {