js.documents 1.54.6 → 1.56.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 +14 -0
- package/dist/index.cjs +63 -11
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +11 -13
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -102,6 +102,20 @@ const { document, package: pkg } = await converter.convert(
|
|
|
102
102
|
|
|
103
103
|
For the six PDF-bypassing bridges, `pkg.layout` is always `undefined` — a bridge never runs a layout engine, so there is nothing to populate it with; running one purely to fill this field would be wasted work no caller asked for.
|
|
104
104
|
|
|
105
|
+
Turning that `DocumentPackage` into self-describing JSON — re-exported from `document-schema.js`, which owns the pivot schemas and the published `.schema.json` files (see that package's own README) — via `documentPackageWithSchema`, which stamps a `$schema` property pointing at the matching schema file for the currently installed `document-schema.js` version, and reading one back via `documentFromJson`, which uses that same `$schema` property to work out which of `DocumentPackage`/`ContentDocument`/`LayoutDocument` a value is before validating it:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import { documentFromJson, documentPackageWithSchema } from 'documents.js';
|
|
109
|
+
|
|
110
|
+
const tagged = documentPackageWithSchema(pkg);
|
|
111
|
+
writeFileSync('converted.doc.json', JSON.stringify(tagged, null, 2));
|
|
112
|
+
|
|
113
|
+
const { kind, value } = documentFromJson(JSON.parse(readFileSync('converted.doc.json', 'utf8')));
|
|
114
|
+
// kind: 'DocumentPackage' (here) | 'ContentDocument' | 'LayoutDocument'
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`contentDocumentWithSchema`/`layoutDocumentWithSchema` are the `ContentDocument`/`LayoutDocument` equivalents — note these operate on `document-schema.js`'s own `ContentDocument` shape, not this package's own, differently-shaped `ContentDocument`/`ContentDocumentSchema` (a thinner per-conversion envelope wrapping `ContentSection`/`ContentSlide`/`ContentSheet`/`ContentDrawPage`, exported above); import `ContentDocument`/`ContentDocumentSchema` directly from `document-schema.js` if you need to construct one for `contentDocumentWithSchema`.
|
|
118
|
+
|
|
105
119
|
Reading and editing docx/pptx content directly, without going through PDF at all:
|
|
106
120
|
|
|
107
121
|
```ts
|
package/dist/index.cjs
CHANGED
|
@@ -6185,15 +6185,14 @@ function layoutTable$1(element, ctx) {
|
|
|
6185
6185
|
});
|
|
6186
6186
|
cursorYTopPt += rowAscentPt + rowDescentPt + (rowIndex < rowCells.length - 1 ? rowGapPt : 0);
|
|
6187
6187
|
});
|
|
6188
|
-
const totalHeightPt = cursorYTopPt;
|
|
6189
6188
|
const widthPt = columnWidthsPt.reduce((sum, w) => sum + w, 0) + columnGapPt * Math.max(0, columnCount - 1);
|
|
6190
|
-
let descentPt =
|
|
6189
|
+
let descentPt = cursorYTopPt - (cursorYTopPt / 2 + ctx.metrics.axisHeightPt);
|
|
6191
6190
|
if (descentPt < 0) descentPt = 0;
|
|
6192
6191
|
return {
|
|
6193
6192
|
widthPt,
|
|
6194
|
-
ascentPt:
|
|
6193
|
+
ascentPt: cursorYTopPt - descentPt,
|
|
6195
6194
|
descentPt,
|
|
6196
|
-
heightPt:
|
|
6195
|
+
heightPt: cursorYTopPt,
|
|
6197
6196
|
items
|
|
6198
6197
|
};
|
|
6199
6198
|
}
|
|
@@ -7186,13 +7185,12 @@ function renderCellText(cell, rowCells, columnAxis, rowAxis, gridLeftXPt, gridTo
|
|
|
7186
7185
|
}
|
|
7187
7186
|
}
|
|
7188
7187
|
function renderHeaderLabels(gutter, columnAxis, rowAxis, gridLeftXPt, gridTopYDownPt, pageHeightPt, measurer, out) {
|
|
7189
|
-
const
|
|
7190
|
-
const
|
|
7191
|
-
const ascentPt = measurer.ascenderAtSize(labelFont, HEADER_LABEL_SIZE_PT);
|
|
7188
|
+
const lineHeightPt = measurer.lineHeightAtSize(document_schema_js.DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
7189
|
+
const ascentPt = measurer.ascenderAtSize(document_schema_js.DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
7192
7190
|
columnAxis.indices.forEach((columnIndex, position) => {
|
|
7193
7191
|
const label = columnLetters(columnIndex);
|
|
7194
7192
|
const widthPt = columnAxis.sizesPt[position];
|
|
7195
|
-
const labelWidthPt = measurer.widthOfTextAtSize(label,
|
|
7193
|
+
const labelWidthPt = measurer.widthOfTextAtSize(label, document_schema_js.DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
7196
7194
|
const xPt = gridLeftXPt + columnAxis.offsetsPt[position] + alignmentOffsetPt("center", widthPt, labelWidthPt);
|
|
7197
7195
|
const baselineYDownPt = gridTopYDownPt - gutter.heightPt + (gutter.heightPt - lineHeightPt) / 2 + ascentPt;
|
|
7198
7196
|
out.push({
|
|
@@ -7200,7 +7198,7 @@ function renderHeaderLabels(gutter, columnAxis, rowAxis, gridLeftXPt, gridTopYDo
|
|
|
7200
7198
|
text: label,
|
|
7201
7199
|
xPt,
|
|
7202
7200
|
yPt: pageHeightPt - baselineYDownPt,
|
|
7203
|
-
font:
|
|
7201
|
+
font: document_schema_js.DEFAULT_LAYOUT_FONT,
|
|
7204
7202
|
sizePt: HEADER_LABEL_SIZE_PT,
|
|
7205
7203
|
color: HEADER_LABEL_COLOR
|
|
7206
7204
|
});
|
|
@@ -7208,7 +7206,7 @@ function renderHeaderLabels(gutter, columnAxis, rowAxis, gridLeftXPt, gridTopYDo
|
|
|
7208
7206
|
rowAxis.indices.forEach((rowIndex, position) => {
|
|
7209
7207
|
const label = String(rowIndex + 1);
|
|
7210
7208
|
const heightPt = rowAxis.sizesPt[position];
|
|
7211
|
-
const labelWidthPt = measurer.widthOfTextAtSize(label,
|
|
7209
|
+
const labelWidthPt = measurer.widthOfTextAtSize(label, document_schema_js.DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
7212
7210
|
const xPt = gridLeftXPt - gutter.widthPt + Math.max(HEADER_LABEL_PADDING_PT, gutter.widthPt - HEADER_LABEL_PADDING_PT - labelWidthPt);
|
|
7213
7211
|
const baselineYDownPt = gridTopYDownPt + rowAxis.offsetsPt[position] + Math.max(0, (heightPt - lineHeightPt) / 2) + ascentPt;
|
|
7214
7212
|
out.push({
|
|
@@ -7216,7 +7214,7 @@ function renderHeaderLabels(gutter, columnAxis, rowAxis, gridLeftXPt, gridTopYDo
|
|
|
7216
7214
|
text: label,
|
|
7217
7215
|
xPt,
|
|
7218
7216
|
yPt: pageHeightPt - baselineYDownPt,
|
|
7219
|
-
font:
|
|
7217
|
+
font: document_schema_js.DEFAULT_LAYOUT_FONT,
|
|
7220
7218
|
sizePt: HEADER_LABEL_SIZE_PT,
|
|
7221
7219
|
color: HEADER_LABEL_COLOR
|
|
7222
7220
|
});
|
|
@@ -10934,6 +10932,12 @@ Object.defineProperty(exports, "DefinedNameSchema", {
|
|
|
10934
10932
|
return ooxml_js.DefinedNameSchema;
|
|
10935
10933
|
}
|
|
10936
10934
|
});
|
|
10935
|
+
Object.defineProperty(exports, "DocumentPackageSchema", {
|
|
10936
|
+
enumerable: true,
|
|
10937
|
+
get: function() {
|
|
10938
|
+
return document_schema_js.DocumentPackageSchema;
|
|
10939
|
+
}
|
|
10940
|
+
});
|
|
10937
10941
|
exports.DocxBytesSchema = DocxBytesSchema;
|
|
10938
10942
|
exports.DocxEditor = DocxEditor;
|
|
10939
10943
|
exports.DocxParagraph = DocxParagraph;
|
|
@@ -10956,6 +10960,12 @@ Object.defineProperty(exports, "LAYOUT_FORMAT_VERSION", {
|
|
|
10956
10960
|
return document_schema_js.LAYOUT_FORMAT_VERSION;
|
|
10957
10961
|
}
|
|
10958
10962
|
});
|
|
10963
|
+
Object.defineProperty(exports, "LayoutDocumentSchema", {
|
|
10964
|
+
enumerable: true,
|
|
10965
|
+
get: function() {
|
|
10966
|
+
return document_schema_js.LayoutDocumentSchema;
|
|
10967
|
+
}
|
|
10968
|
+
});
|
|
10959
10969
|
Object.defineProperty(exports, "NOOP_DIAGNOSTIC_SINK", {
|
|
10960
10970
|
enumerable: true,
|
|
10961
10971
|
get: function() {
|
|
@@ -11043,6 +11053,12 @@ Object.defineProperty(exports, "SLIDE_SIZE_WIDESCREEN", {
|
|
|
11043
11053
|
return document_schema_js.SLIDE_SIZE_WIDESCREEN;
|
|
11044
11054
|
}
|
|
11045
11055
|
});
|
|
11056
|
+
Object.defineProperty(exports, "UnrecognizedDocumentSchemaError", {
|
|
11057
|
+
enumerable: true,
|
|
11058
|
+
get: function() {
|
|
11059
|
+
return document_schema_js.UnrecognizedDocumentSchemaError;
|
|
11060
|
+
}
|
|
11061
|
+
});
|
|
11046
11062
|
exports.XlsxBytesSchema = XlsxBytesSchema;
|
|
11047
11063
|
Object.defineProperty(exports, "XmlCdataSchema", {
|
|
11048
11064
|
enumerable: true,
|
|
@@ -11141,6 +11157,12 @@ Object.defineProperty(exports, "compactPackageCodec", {
|
|
|
11141
11157
|
return ooxml_js.compactPackageCodec;
|
|
11142
11158
|
}
|
|
11143
11159
|
});
|
|
11160
|
+
Object.defineProperty(exports, "contentDocumentWithSchema", {
|
|
11161
|
+
enumerable: true,
|
|
11162
|
+
get: function() {
|
|
11163
|
+
return document_schema_js.contentDocumentWithSchema;
|
|
11164
|
+
}
|
|
11165
|
+
});
|
|
11144
11166
|
exports.convertDrawingToLayout = convertDrawingToLayout;
|
|
11145
11167
|
exports.convertPresentationToLayout = convertPresentationToLayout;
|
|
11146
11168
|
exports.convertSpreadsheetToLayout = convertSpreadsheetToLayout;
|
|
@@ -11171,6 +11193,24 @@ Object.defineProperty(exports, "decodePackage", {
|
|
|
11171
11193
|
return ooxml_js.decodePackage;
|
|
11172
11194
|
}
|
|
11173
11195
|
});
|
|
11196
|
+
Object.defineProperty(exports, "documentFromJson", {
|
|
11197
|
+
enumerable: true,
|
|
11198
|
+
get: function() {
|
|
11199
|
+
return document_schema_js.documentFromJson;
|
|
11200
|
+
}
|
|
11201
|
+
});
|
|
11202
|
+
Object.defineProperty(exports, "documentPackageWithSchema", {
|
|
11203
|
+
enumerable: true,
|
|
11204
|
+
get: function() {
|
|
11205
|
+
return document_schema_js.documentPackageWithSchema;
|
|
11206
|
+
}
|
|
11207
|
+
});
|
|
11208
|
+
Object.defineProperty(exports, "documentSchemaKindOf", {
|
|
11209
|
+
enumerable: true,
|
|
11210
|
+
get: function() {
|
|
11211
|
+
return document_schema_js.documentSchemaKindOf;
|
|
11212
|
+
}
|
|
11213
|
+
});
|
|
11174
11214
|
exports.docxPdfCodec = docxPdfCodec;
|
|
11175
11215
|
exports.docxToOdt = docxToOdt;
|
|
11176
11216
|
exports.docxToPdf = docxToPdf;
|
|
@@ -11224,6 +11264,12 @@ Object.defineProperty(exports, "isXmlNode", {
|
|
|
11224
11264
|
return ooxml_js.isXmlNode;
|
|
11225
11265
|
}
|
|
11226
11266
|
});
|
|
11267
|
+
Object.defineProperty(exports, "layoutDocumentWithSchema", {
|
|
11268
|
+
enumerable: true,
|
|
11269
|
+
get: function() {
|
|
11270
|
+
return document_schema_js.layoutDocumentWithSchema;
|
|
11271
|
+
}
|
|
11272
|
+
});
|
|
11227
11273
|
exports.layoutFormula = layoutFormula;
|
|
11228
11274
|
Object.defineProperty(exports, "loadMathFont", {
|
|
11229
11275
|
enumerable: true,
|
|
@@ -11332,6 +11378,12 @@ Object.defineProperty(exports, "rootElement", {
|
|
|
11332
11378
|
return ooxml_js.rootElement;
|
|
11333
11379
|
}
|
|
11334
11380
|
});
|
|
11381
|
+
Object.defineProperty(exports, "schemaUriFor", {
|
|
11382
|
+
enumerable: true,
|
|
11383
|
+
get: function() {
|
|
11384
|
+
return document_schema_js.schemaUriFor;
|
|
11385
|
+
}
|
|
11386
|
+
});
|
|
11335
11387
|
Object.defineProperty(exports, "serializePackage", {
|
|
11336
11388
|
enumerable: true,
|
|
11337
11389
|
get: function() {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Package, Package as Package$1, PackageSchema, Part, PartSchema, Relationship, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElement as XmlElement$1, XmlElementSchema, XmlNode, XmlNode as XmlNode$1, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, attr, base64ToBytes, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, resolveRelationships, rootElement, serializePackage, textContent as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
|
|
2
|
-
import { Alignment, Box, Box as Box$1, COLOR_BLACK, Color, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValue as ContentCellValue$1, ContentCellValueSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPoint as ContentPathPoint$1, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRun as ContentRun$1, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettings as ContentSheetPrintSettings$1, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStroke as ContentStroke$1, ContentStrokeSchema, ContentSubpath, ContentSubpath as ContentSubpath$1, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DocumentPackage, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocument as LayoutDocument$1, LayoutEllipse, LayoutFont, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutMetadata as LayoutMetadata$1, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, isContentBlock, rgbHexToColor } from "document-schema.js";
|
|
2
|
+
import { Alignment, Box, Box as Box$1, COLOR_BLACK, Color, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValue as ContentCellValue$1, ContentCellValueSchema, ContentDocumentJson, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPoint as ContentPathPoint$1, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRun as ContentRun$1, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettings as ContentSheetPrintSettings$1, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStroke as ContentStroke$1, ContentStrokeSchema, ContentSubpath, ContentSubpath as ContentSubpath$1, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DocumentJsonResult, DocumentPackage, DocumentPackage as DocumentPackage$1, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocument as LayoutDocument$1, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutFont, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutMetadata as LayoutMetadata$1, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, rgbHexToColor, schemaUriFor } from "document-schema.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Package as Package$2, XmlElement as XmlElement$2, XmlNode as XmlNode$2 } from "odf.js";
|
|
5
5
|
import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfDiagnosticSink as PdfDiagnosticSink$1, PdfEncryptedError, PdfParseError, PositionedFormula, PositionedFormula as PositionedFormula$1, ReadPdfOptions, TextMeasurer, WinAnsiSubstitution, WinAnsiSubstitution as WinAnsiSubstitution$1, WritePdfOptions, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
|
|
@@ -1210,7 +1210,7 @@ interface DocumentToPdfOptions {
|
|
|
1210
1210
|
readonly onSubstitution?: (substitution: WinAnsiSubstitution$1, context: {
|
|
1211
1211
|
readonly pageIndex: number;
|
|
1212
1212
|
}) => void;
|
|
1213
|
-
readonly onDocument?: (pkg: DocumentPackage) => void;
|
|
1213
|
+
readonly onDocument?: (pkg: DocumentPackage$1) => void;
|
|
1214
1214
|
}
|
|
1215
1215
|
declare function docxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
1216
1216
|
declare function odtToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -1222,7 +1222,7 @@ declare function odfToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPd
|
|
|
1222
1222
|
interface PdfToDocumentOptions {
|
|
1223
1223
|
readonly signal?: AbortSignal;
|
|
1224
1224
|
readonly sink?: PdfDiagnosticSink$1;
|
|
1225
|
-
readonly onDocument?: (pkg: DocumentPackage) => void;
|
|
1225
|
+
readonly onDocument?: (pkg: DocumentPackage$1) => void;
|
|
1226
1226
|
}
|
|
1227
1227
|
declare function pdfToDocx(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
1228
1228
|
declare function pdfToPptx(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -1232,7 +1232,7 @@ declare function pdfToOdg(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumen
|
|
|
1232
1232
|
declare function pdfToOds(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
1233
1233
|
interface DocumentBridgeOptions {
|
|
1234
1234
|
readonly signal?: AbortSignal;
|
|
1235
|
-
readonly onDocument?: (pkg: DocumentPackage) => void;
|
|
1235
|
+
readonly onDocument?: (pkg: DocumentPackage$1) => void;
|
|
1236
1236
|
}
|
|
1237
1237
|
declare function odtToDocx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
1238
1238
|
declare function docxToOdt(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -1378,7 +1378,7 @@ interface ConversionRequest {
|
|
|
1378
1378
|
interface ConversionResult {
|
|
1379
1379
|
readonly document: DocumentPayload;
|
|
1380
1380
|
readonly diagnostics: readonly Diagnostic[];
|
|
1381
|
-
readonly package?: DocumentPackage;
|
|
1381
|
+
readonly package?: DocumentPackage$1;
|
|
1382
1382
|
}
|
|
1383
1383
|
interface DocumentConverter {
|
|
1384
1384
|
readonly contractVersion: number;
|
|
@@ -1404,4 +1404,4 @@ declare function fixedClock(date: Date): ClockPort;
|
|
|
1404
1404
|
//#region src/ports/abort.d.ts
|
|
1405
1405
|
declare function throwIfAborted(signal: AbortSignal | undefined): void;
|
|
1406
1406
|
//#endregion
|
|
1407
|
-
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentPayload, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EmbeddedFormula, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, type HsqldbColumn, HsqldbRowFormatError, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, type OdpContentResult, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, type OdtContentResult, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type PresentationLayoutResult, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type StandaloneFormulaContent, type TextBoxInit$2 as TextBoxInit, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodePackage, docxPdfCodec, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutFormula, loadMathFont, localName, mapMathVariant, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxToOds, xmlCodec, zipPackage };
|
|
1407
|
+
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EmbeddedFormula, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, type HsqldbColumn, HsqldbRowFormatError, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, type OdpContentResult, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, type OdtContentResult, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type PresentationLayoutResult, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type StandaloneFormulaContent, type TextBoxInit$2 as TextBoxInit, UnrecognizedDocumentSchemaError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodePackage, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, mapMathVariant, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxToOds, xmlCodec, zipPackage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Package, Package as Package$1, PackageSchema, Part, PartSchema, Relationship, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElement as XmlElement$1, XmlElementSchema, XmlNode, XmlNode as XmlNode$1, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, attr, base64ToBytes, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, resolveRelationships, rootElement, serializePackage, textContent as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
|
|
2
|
-
import { Alignment, Box, Box as Box$1, COLOR_BLACK, Color, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValue as ContentCellValue$1, ContentCellValueSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPoint as ContentPathPoint$1, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRun as ContentRun$1, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettings as ContentSheetPrintSettings$1, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStroke as ContentStroke$1, ContentStrokeSchema, ContentSubpath, ContentSubpath as ContentSubpath$1, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DocumentPackage, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocument as LayoutDocument$1, LayoutEllipse, LayoutFont, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutMetadata as LayoutMetadata$1, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, isContentBlock, rgbHexToColor } from "document-schema.js";
|
|
2
|
+
import { Alignment, Box, Box as Box$1, COLOR_BLACK, Color, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellValue, ContentCellValue as ContentCellValue$1, ContentCellValueSchema, ContentDocumentJson, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembership as ContentListMembership$1, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPoint as ContentPathPoint$1, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRun as ContentRun$1, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettings as ContentSheetPrintSettings$1, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStroke as ContentStroke$1, ContentStrokeSchema, ContentSubpath, ContentSubpath as ContentSubpath$1, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DocumentJsonResult, DocumentPackage, DocumentPackage as DocumentPackage$1, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocument as LayoutDocument$1, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutFont, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutMetadata, LayoutMetadata as LayoutMetadata$1, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, Margins, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, rgbHexToColor, schemaUriFor } from "document-schema.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Package as Package$2, XmlElement as XmlElement$2, XmlNode as XmlNode$2 } from "odf.js";
|
|
5
5
|
import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfDiagnosticSink as PdfDiagnosticSink$1, PdfEncryptedError, PdfParseError, PositionedFormula, PositionedFormula as PositionedFormula$1, ReadPdfOptions, TextMeasurer, WinAnsiSubstitution, WinAnsiSubstitution as WinAnsiSubstitution$1, WritePdfOptions, loadMathFont, pdfCodec, readPdf, writePdf } from "pdf-codec";
|
|
@@ -1210,7 +1210,7 @@ interface DocumentToPdfOptions {
|
|
|
1210
1210
|
readonly onSubstitution?: (substitution: WinAnsiSubstitution$1, context: {
|
|
1211
1211
|
readonly pageIndex: number;
|
|
1212
1212
|
}) => void;
|
|
1213
|
-
readonly onDocument?: (pkg: DocumentPackage) => void;
|
|
1213
|
+
readonly onDocument?: (pkg: DocumentPackage$1) => void;
|
|
1214
1214
|
}
|
|
1215
1215
|
declare function docxToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
1216
1216
|
declare function odtToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPdfOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -1222,7 +1222,7 @@ declare function odfToPdf(bytes: Uint8Array<ArrayBuffer>, options?: DocumentToPd
|
|
|
1222
1222
|
interface PdfToDocumentOptions {
|
|
1223
1223
|
readonly signal?: AbortSignal;
|
|
1224
1224
|
readonly sink?: PdfDiagnosticSink$1;
|
|
1225
|
-
readonly onDocument?: (pkg: DocumentPackage) => void;
|
|
1225
|
+
readonly onDocument?: (pkg: DocumentPackage$1) => void;
|
|
1226
1226
|
}
|
|
1227
1227
|
declare function pdfToDocx(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
1228
1228
|
declare function pdfToPptx(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -1232,7 +1232,7 @@ declare function pdfToOdg(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumen
|
|
|
1232
1232
|
declare function pdfToOds(bytes: Uint8Array<ArrayBuffer>, options?: PdfToDocumentOptions): Uint8Array<ArrayBuffer>;
|
|
1233
1233
|
interface DocumentBridgeOptions {
|
|
1234
1234
|
readonly signal?: AbortSignal;
|
|
1235
|
-
readonly onDocument?: (pkg: DocumentPackage) => void;
|
|
1235
|
+
readonly onDocument?: (pkg: DocumentPackage$1) => void;
|
|
1236
1236
|
}
|
|
1237
1237
|
declare function odtToDocx(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
1238
1238
|
declare function docxToOdt(bytes: Uint8Array<ArrayBuffer>, options?: DocumentBridgeOptions): Uint8Array<ArrayBuffer>;
|
|
@@ -1378,7 +1378,7 @@ interface ConversionRequest {
|
|
|
1378
1378
|
interface ConversionResult {
|
|
1379
1379
|
readonly document: DocumentPayload;
|
|
1380
1380
|
readonly diagnostics: readonly Diagnostic[];
|
|
1381
|
-
readonly package?: DocumentPackage;
|
|
1381
|
+
readonly package?: DocumentPackage$1;
|
|
1382
1382
|
}
|
|
1383
1383
|
interface DocumentConverter {
|
|
1384
1384
|
readonly contractVersion: number;
|
|
@@ -1404,4 +1404,4 @@ declare function fixedClock(date: Date): ClockPort;
|
|
|
1404
1404
|
//#region src/ports/abort.d.ts
|
|
1405
1405
|
declare function throwIfAborted(signal: AbortSignal | undefined): void;
|
|
1406
1406
|
//#endregion
|
|
1407
|
-
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentPayload, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EmbeddedFormula, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, type HsqldbColumn, HsqldbRowFormatError, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, type OdpContentResult, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, type OdtContentResult, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type PresentationLayoutResult, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type StandaloneFormulaContent, type TextBoxInit$2 as TextBoxInit, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodePackage, docxPdfCodec, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutFormula, loadMathFont, localName, mapMathVariant, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxToOds, xmlCodec, zipPackage };
|
|
1407
|
+
export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, COLOR_BLACK, CONTENT_FORMAT_VERSION, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ContentBlock, ContentBlockSchema, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionRequest, type ConversionResult, DEFAULT_LAYOUT_FONT, type DefinedName, DefinedNameSchema, type Diagnostic, type DocumentBridgeOptions, type DocumentConverter, type DocumentFormat, type DocumentJsonResult, type DocumentPackage, type DocumentPackageJson, DocumentPackageSchema, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocxBody, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DrawingLayoutOptions, type DrawingParagraphInit, type DrawingRunInit, type EmbeddedFormula, type EngineLayoutOptions, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, type HsqldbColumn, HsqldbRowFormatError, HsqldbScriptParseError, type HsqldbTable, LAYOUT_FORMAT_VERSION, type LayoutColor, type LayoutDocument, type LayoutDocumentJson, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type Margins, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStroke, type MathVariant, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, type OdpContentResult, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, type OdtContentResult, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit as OdtParagraphInit, OdtRun, type RunInit as OdtRunInit, OdtTable, OdtTableCell, type TableInit as OdtTableInit, OdtTableRow, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageSize, type Part, PartSchema, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEncryptedError, PdfParseError, type PdfToDocumentOptions, type PositionedFormula, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, type PresentationLayoutResult, type ReadFirebirdBackupResult, type ReadPdfOptions, type ReconstructOptions, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlidesLayoutOptions, type StandaloneFormulaContent, type TextBoxInit$2 as TextBoxInit, UnrecognizedDocumentSchemaError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodePackage, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, mapMathVariant, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxToOds, xmlCodec, zipPackage };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AttributeSchema, BinaryPartSchema, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, DefinedNameSchema, PackageSchema, PartSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, attr, attr as attr$1, base64ToBytes, base64ToBytes as base64ToBytes$1, buildXlsxPackage, buildXml, bytesToBase64, bytesToBase64 as bytesToBase64$1, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, decodePackage as decodePackage$1, elementsWithTag, elementsWithTag as elementsWithTag$1, encodeCompactPackage, encodePackage, encodePackage as encodePackage$1, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, readDocx, readPptx, readXlsxContent, resolveRelationships, resolveRelationships as resolveRelationships$1, rootElement, rootElement as rootElement$1, serializePackage, textContent as textContent$1, textContent as textContent$2, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
|
|
2
|
-
import { COLOR_BLACK, COLOR_BLACK as COLOR_BLACK$1, ContentBlockSchema, ContentCellValueSchema, ContentDrawPageSchema, ContentDrawPageSchema as ContentDrawPageSchema$1, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentSectionSchema as ContentSectionSchema$1, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSheetSchema as ContentSheetSchema$1, ContentSlideSchema, ContentSlideSchema as ContentSlideSchema$1, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DOCUMENT_PACKAGE_FORMAT_VERSION, LAYOUT_FORMAT_VERSION, LAYOUT_FORMAT_VERSION as LAYOUT_FORMAT_VERSION$1, LayoutMetadataSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, colorToRgbHex, isContentBlock, rgbHexToColor } from "document-schema.js";
|
|
2
|
+
import { COLOR_BLACK, COLOR_BLACK as COLOR_BLACK$1, ContentBlockSchema, ContentCellValueSchema, ContentDrawPageSchema, ContentDrawPageSchema as ContentDrawPageSchema$1, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentSectionSchema as ContentSectionSchema$1, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSheetSchema as ContentSheetSchema$1, ContentSlideSchema, ContentSlideSchema as ContentSlideSchema$1, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DOCUMENT_PACKAGE_FORMAT_VERSION, DocumentPackageSchema, LAYOUT_FORMAT_VERSION, LAYOUT_FORMAT_VERSION as LAYOUT_FORMAT_VERSION$1, LayoutDocumentSchema, LayoutMetadataSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, colorToRgbHex, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, layoutDocumentWithSchema, rgbHexToColor, schemaUriFor } from "document-schema.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ODF_MEDIA_TYPES, StyleRegistry, applyOdfTransform, attrValue, base64ToBytes as base64ToBytes$2, buildOdfSubpaths, bytesToBase64 as bytesToBase64$2, childrenWithTag as childrenWithTag$1, decodeOdfText, decodePackage as decodePackage$2, encodePackage as encodePackage$2, findChildElement, findStyleElement, formatOdfColor, formatOdfLength, parseBox, parseCellReference, parseLinePoints, parseMargins, parseOdfColor, parseOdfLength, parseOdfPathData, parseOdfViewBox, parsePageSize, readDrawFrame, readManifest, readOdbInventory, readOdfFormula, readOdfMetadata, readOdfParagraph, readOdfTable, readOdg, readOdm, readOdp, readOds, readOdt, resolveOdfShapeGeometry, resolvePageLayoutProperties, resolveStyle, rootElement as rootElement$2, setDocumentMediaType, syncManifest, syncManifest as syncManifest$1, xmlnsAttributes } from "odf.js";
|
|
5
5
|
import { NOOP_DIAGNOSTIC_SINK, PdfEncryptedError, PdfParseError, STANDARD_METRICS, crc32, createStandardFontMeasurer, decodePng, loadMathFont, loadMathFont as loadMathFont$1, pdfCodec, readJpegInfo, readPdf, readPdf as readPdf$1, resolveStandardFont, rotatePointAboutCenter, wrapRunsToWidth, writePdf, writePdf as writePdf$1 } from "pdf-codec";
|
|
@@ -6184,15 +6184,14 @@ function layoutTable$1(element, ctx) {
|
|
|
6184
6184
|
});
|
|
6185
6185
|
cursorYTopPt += rowAscentPt + rowDescentPt + (rowIndex < rowCells.length - 1 ? rowGapPt : 0);
|
|
6186
6186
|
});
|
|
6187
|
-
const totalHeightPt = cursorYTopPt;
|
|
6188
6187
|
const widthPt = columnWidthsPt.reduce((sum, w) => sum + w, 0) + columnGapPt * Math.max(0, columnCount - 1);
|
|
6189
|
-
let descentPt =
|
|
6188
|
+
let descentPt = cursorYTopPt - (cursorYTopPt / 2 + ctx.metrics.axisHeightPt);
|
|
6190
6189
|
if (descentPt < 0) descentPt = 0;
|
|
6191
6190
|
return {
|
|
6192
6191
|
widthPt,
|
|
6193
|
-
ascentPt:
|
|
6192
|
+
ascentPt: cursorYTopPt - descentPt,
|
|
6194
6193
|
descentPt,
|
|
6195
|
-
heightPt:
|
|
6194
|
+
heightPt: cursorYTopPt,
|
|
6196
6195
|
items
|
|
6197
6196
|
};
|
|
6198
6197
|
}
|
|
@@ -7185,13 +7184,12 @@ function renderCellText(cell, rowCells, columnAxis, rowAxis, gridLeftXPt, gridTo
|
|
|
7185
7184
|
}
|
|
7186
7185
|
}
|
|
7187
7186
|
function renderHeaderLabels(gutter, columnAxis, rowAxis, gridLeftXPt, gridTopYDownPt, pageHeightPt, measurer, out) {
|
|
7188
|
-
const
|
|
7189
|
-
const
|
|
7190
|
-
const ascentPt = measurer.ascenderAtSize(labelFont, HEADER_LABEL_SIZE_PT);
|
|
7187
|
+
const lineHeightPt = measurer.lineHeightAtSize(DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
7188
|
+
const ascentPt = measurer.ascenderAtSize(DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
7191
7189
|
columnAxis.indices.forEach((columnIndex, position) => {
|
|
7192
7190
|
const label = columnLetters(columnIndex);
|
|
7193
7191
|
const widthPt = columnAxis.sizesPt[position];
|
|
7194
|
-
const labelWidthPt = measurer.widthOfTextAtSize(label,
|
|
7192
|
+
const labelWidthPt = measurer.widthOfTextAtSize(label, DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
7195
7193
|
const xPt = gridLeftXPt + columnAxis.offsetsPt[position] + alignmentOffsetPt("center", widthPt, labelWidthPt);
|
|
7196
7194
|
const baselineYDownPt = gridTopYDownPt - gutter.heightPt + (gutter.heightPt - lineHeightPt) / 2 + ascentPt;
|
|
7197
7195
|
out.push({
|
|
@@ -7199,7 +7197,7 @@ function renderHeaderLabels(gutter, columnAxis, rowAxis, gridLeftXPt, gridTopYDo
|
|
|
7199
7197
|
text: label,
|
|
7200
7198
|
xPt,
|
|
7201
7199
|
yPt: pageHeightPt - baselineYDownPt,
|
|
7202
|
-
font:
|
|
7200
|
+
font: DEFAULT_LAYOUT_FONT,
|
|
7203
7201
|
sizePt: HEADER_LABEL_SIZE_PT,
|
|
7204
7202
|
color: HEADER_LABEL_COLOR
|
|
7205
7203
|
});
|
|
@@ -7207,7 +7205,7 @@ function renderHeaderLabels(gutter, columnAxis, rowAxis, gridLeftXPt, gridTopYDo
|
|
|
7207
7205
|
rowAxis.indices.forEach((rowIndex, position) => {
|
|
7208
7206
|
const label = String(rowIndex + 1);
|
|
7209
7207
|
const heightPt = rowAxis.sizesPt[position];
|
|
7210
|
-
const labelWidthPt = measurer.widthOfTextAtSize(label,
|
|
7208
|
+
const labelWidthPt = measurer.widthOfTextAtSize(label, DEFAULT_LAYOUT_FONT, HEADER_LABEL_SIZE_PT);
|
|
7211
7209
|
const xPt = gridLeftXPt - gutter.widthPt + Math.max(HEADER_LABEL_PADDING_PT, gutter.widthPt - HEADER_LABEL_PADDING_PT - labelWidthPt);
|
|
7212
7210
|
const baselineYDownPt = gridTopYDownPt + rowAxis.offsetsPt[position] + Math.max(0, (heightPt - lineHeightPt) / 2) + ascentPt;
|
|
7213
7211
|
out.push({
|
|
@@ -7215,7 +7213,7 @@ function renderHeaderLabels(gutter, columnAxis, rowAxis, gridLeftXPt, gridTopYDo
|
|
|
7215
7213
|
text: label,
|
|
7216
7214
|
xPt,
|
|
7217
7215
|
yPt: pageHeightPt - baselineYDownPt,
|
|
7218
|
-
font:
|
|
7216
|
+
font: DEFAULT_LAYOUT_FONT,
|
|
7219
7217
|
sizePt: HEADER_LABEL_SIZE_PT,
|
|
7220
7218
|
color: HEADER_LABEL_COLOR
|
|
7221
7219
|
});
|
|
@@ -10727,4 +10725,4 @@ function fixedClock(date) {
|
|
|
10727
10725
|
return { now: () => date };
|
|
10728
10726
|
}
|
|
10729
10727
|
//#endregion
|
|
10730
|
-
export { AttributeSchema, BinaryPartSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DefinedNameSchema, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, HsqldbRowFormatError, HsqldbScriptParseError, LAYOUT_FORMAT_VERSION, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdgBoxVector, OdgBytesSchema, OdgEditor, OdgLineVector, OdgPage, OdgPathVector, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, OdtRun, OdtTable, OdtTableCell, OdtTableRow, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PackageSchema, PartSchema, PdfBytesSchema, PdfEncryptedError, PdfParseError, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, XlsxBytesSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodePackage, docxPdfCodec, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutFormula, loadMathFont, localName, mapMathVariant, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxToOds, xmlCodec, zipPackage };
|
|
10728
|
+
export { AttributeSchema, BinaryPartSchema, COLOR_BLACK, CONTENT_FORMAT_VERSION, CommentSchema, CompactPackageSchema, CompactPartSchema, CompactXmlNodeSchema, ContentBlockSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentImageBlockSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DefinedNameSchema, DocumentPackageSchema, DocxBytesSchema, DocxEditor, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, HsqldbRowFormatError, HsqldbScriptParseError, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, NOOP_DIAGNOSTIC_SINK, OdbNoEmbeddedDataSourceError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdgBoxVector, OdgBytesSchema, OdgEditor, OdgLineVector, OdgPage, OdgPathVector, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, OdtBytesSchema, OdtEditor, OdtList, OdtListItem, OdtParagraph, OdtRun, OdtTable, OdtTableCell, OdtTableRow, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PackageSchema, PartSchema, PdfBytesSchema, PdfEncryptedError, PdfParseError, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, XlsxBytesSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildDocxPackage, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildPptxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDocx, createLocalDocumentConverter, createOdg, createOdp, createOds, createOdt, createPptx, decodeCompactPackage, decodeEntities, decodeHsqldbCachedTables, decodePackage, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, docxPdfCodec, docxToOdt, docxToPdf, elementChildren, elementLocalName, elementsWithTag, encodeCompactPackage, encodePackage, firstChildByLocalName, fixedClock, flipY, fromCompact, displayTextFor as hsqldbCellDisplayText, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, layoutDocumentWithSchema, layoutFormula, loadMathFont, localName, mapMathVariant, textContent as mathMlTextContent, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgToPdf, odmToPdf, odpPdfCodec, odpPptxCodec, odpToPdf, odpToPptx, odsPdfCodec, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToPdf, openDocx, openOdg, openOdp, openOds, openOdt, openPptx, operatorProperties, packageCodec, parseHsqldbScript, parsePackage, parseXml, pdfCodec, pdfToDocx, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPptx, pptxPdfCodec, pptxToOdp, pptxToPdf, readDocxContent, readFirebirdBackup, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readPdf, readPptxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, resolveRelationships, rgbHexToColor, rootElement, schemaUriFor, serializePackage, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, unzipPackage, walk, writePdf, xlsxToOds, xmlCodec, zipPackage };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js.documents",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.56.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": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
],
|
|
51
51
|
"license": "MIT",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"document-schema.js": "^1.
|
|
53
|
+
"document-schema.js": "^1.7.0",
|
|
54
54
|
"fflate": "^0.8.3",
|
|
55
55
|
"odf.js": "^1.10.3",
|
|
56
56
|
"ooxml.js": "^2.2.3",
|