documents.js 1.60.1 → 1.60.3
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 +4 -4
- package/dist/convert/convert.cjs +1 -2
- package/dist/convert/convert.js +2 -3
- package/dist/edit/docx/content.d.cts +1 -1
- package/dist/edit/docx/content.d.ts +1 -1
- package/dist/edit/odg/content.d.cts +1 -1
- package/dist/edit/odg/content.d.ts +1 -1
- package/dist/edit/odp/content.d.cts +1 -1
- package/dist/edit/odp/content.d.ts +1 -1
- package/dist/edit/ods/cell.cjs +5 -0
- package/dist/edit/ods/cell.js +5 -0
- package/dist/edit/ods/content.cjs +2 -2
- package/dist/edit/ods/content.d.cts +1 -1
- package/dist/edit/ods/content.d.ts +1 -1
- package/dist/edit/ods/content.js +2 -2
- package/dist/edit/odt/content.d.cts +1 -2
- package/dist/edit/odt/content.d.ts +1 -2
- package/dist/edit/pptx/content.d.cts +1 -1
- package/dist/edit/pptx/content.d.ts +1 -1
- package/dist/hsqldb/script.cjs +1 -0
- package/dist/hsqldb/script.js +1 -0
- package/dist/index.cjs +12 -3
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/layout/drawing.d.cts +1 -2
- package/dist/layout/drawing.d.ts +1 -2
- package/dist/layout/engine.d.cts +1 -2
- package/dist/layout/engine.d.ts +1 -2
- package/dist/layout/reconstruct.cjs +5 -5
- package/dist/layout/reconstruct.d.cts +1 -2
- package/dist/layout/reconstruct.d.ts +1 -2
- package/dist/layout/reconstruct.js +5 -5
- package/dist/layout/sheets.cjs +3 -3
- package/dist/layout/sheets.d.cts +1 -2
- package/dist/layout/sheets.d.ts +1 -2
- package/dist/layout/sheets.js +3 -3
- package/dist/layout/slides.d.cts +1 -2
- package/dist/layout/slides.d.ts +1 -2
- package/dist/markdown/read.cjs +5 -7
- package/dist/markdown/read.d.cts +1 -1
- package/dist/markdown/read.d.ts +1 -1
- package/dist/markdown/read.js +5 -7
- package/dist/markdown/write.cjs +34 -1
- package/dist/markdown/write.d.cts +1 -1
- package/dist/markdown/write.d.ts +1 -1
- package/dist/markdown/write.js +35 -2
- package/dist/odb/spreadsheet.cjs +1 -2
- package/dist/odb/spreadsheet.d.cts +1 -1
- package/dist/odb/spreadsheet.d.ts +1 -1
- package/dist/odb/spreadsheet.js +2 -2
- package/dist/odf/formula/placeholder.cjs +1 -2
- package/dist/odf/formula/placeholder.d.cts +4 -4
- package/dist/odf/formula/placeholder.d.ts +4 -4
- package/dist/odf/formula/placeholder.js +2 -2
- package/dist/odf/odg/read.cjs +2 -2
- package/dist/odf/odg/read.d.cts +1 -1
- package/dist/odf/odg/read.d.ts +1 -1
- package/dist/odf/odg/read.js +2 -2
- package/dist/odf/odp/read.cjs +2 -2
- package/dist/odf/odp/read.d.cts +1 -1
- package/dist/odf/odp/read.d.ts +1 -1
- package/dist/odf/odp/read.js +2 -2
- package/dist/odf/ods/read.cjs +2 -2
- package/dist/odf/ods/read.d.cts +1 -1
- package/dist/odf/ods/read.d.ts +1 -1
- package/dist/odf/ods/read.js +2 -2
- package/dist/odf/odt/read.cjs +2 -2
- package/dist/odf/odt/read.d.cts +1 -1
- package/dist/odf/odt/read.d.ts +1 -1
- package/dist/odf/odt/read.js +2 -2
- package/dist/ooxml/docx/read.cjs +2 -2
- package/dist/ooxml/docx/read.d.cts +1 -1
- package/dist/ooxml/docx/read.d.ts +1 -1
- package/dist/ooxml/docx/read.js +2 -2
- package/dist/ooxml/pptx/read.cjs +2 -2
- package/dist/ooxml/pptx/read.d.cts +1 -1
- package/dist/ooxml/pptx/read.d.ts +1 -1
- package/dist/ooxml/pptx/read.js +2 -2
- package/package.json +5 -5
- package/dist/model/content.cjs +0 -34
- package/dist/model/content.d.cts +0 -362
- package/dist/model/content.d.ts +0 -362
- package/dist/model/content.js +0 -32
package/dist/layout/sheets.cjs
CHANGED
|
@@ -53,7 +53,7 @@ function resolveAxis(entries, start, end, defaultSizePt) {
|
|
|
53
53
|
let currentHidden = false;
|
|
54
54
|
for (let index = start; index <= end; index++) {
|
|
55
55
|
while (pointer < sorted.length && sorted[pointer].index <= index) {
|
|
56
|
-
currentSizePt = sorted[pointer].sizePt;
|
|
56
|
+
currentSizePt = sorted[pointer].sizePt ?? defaultSizePt;
|
|
57
57
|
currentHidden = sorted[pointer].hidden ?? false;
|
|
58
58
|
pointer++;
|
|
59
59
|
}
|
|
@@ -77,7 +77,7 @@ function computeHeaderGutter(printSettings, range, measurer) {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
function resolveScale(printSettings, availableWidthPt, availableHeightPt, totalContentWidthPt, totalContentHeightPt) {
|
|
80
|
-
if (printSettings.
|
|
80
|
+
if (printSettings.scalePercent !== void 0) return Math.max(printSettings.scalePercent / 100, MINIMUM_SCALE);
|
|
81
81
|
if (printSettings.fitToPages !== void 0) {
|
|
82
82
|
const budgetWidthPt = availableWidthPt * printSettings.fitToPages.width;
|
|
83
83
|
const budgetHeightPt = availableHeightPt * printSettings.fitToPages.height;
|
|
@@ -125,7 +125,7 @@ function cellStyledRuns(cell) {
|
|
|
125
125
|
}];
|
|
126
126
|
}
|
|
127
127
|
function isNumericLikeValue(kind) {
|
|
128
|
-
return kind === "number" || kind === "percentage" || kind === "currency" || kind === "date" || kind === "time";
|
|
128
|
+
return kind === "number" || kind === "percentage" || kind === "currency" || kind === "date" || kind === "time" || kind === "dateTime";
|
|
129
129
|
}
|
|
130
130
|
function defaultAlignmentForValue(kind) {
|
|
131
131
|
if (isNumericLikeValue(kind)) return "right";
|
package/dist/layout/sheets.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ContentDocument } from "
|
|
2
|
-
import { LayoutDocument } from "document-schema.js";
|
|
1
|
+
import { ContentDocument, LayoutDocument } from "document-schema.js";
|
|
3
2
|
import { TextMeasurer } from "pdf-codec";
|
|
4
3
|
//#region src/layout/sheets.d.ts
|
|
5
4
|
interface SheetsLayoutOptions {
|
package/dist/layout/sheets.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ContentDocument } from "
|
|
2
|
-
import { LayoutDocument } from "document-schema.js";
|
|
1
|
+
import { ContentDocument, LayoutDocument } from "document-schema.js";
|
|
3
2
|
import { TextMeasurer } from "pdf-codec";
|
|
4
3
|
//#region src/layout/sheets.d.ts
|
|
5
4
|
interface SheetsLayoutOptions {
|
package/dist/layout/sheets.js
CHANGED
|
@@ -54,7 +54,7 @@ function resolveAxis(entries, start, end, defaultSizePt) {
|
|
|
54
54
|
let currentHidden = false;
|
|
55
55
|
for (let index = start; index <= end; index++) {
|
|
56
56
|
while (pointer < sorted.length && sorted[pointer].index <= index) {
|
|
57
|
-
currentSizePt = sorted[pointer].sizePt;
|
|
57
|
+
currentSizePt = sorted[pointer].sizePt ?? defaultSizePt;
|
|
58
58
|
currentHidden = sorted[pointer].hidden ?? false;
|
|
59
59
|
pointer++;
|
|
60
60
|
}
|
|
@@ -78,7 +78,7 @@ function computeHeaderGutter(printSettings, range, measurer) {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
function resolveScale(printSettings, availableWidthPt, availableHeightPt, totalContentWidthPt, totalContentHeightPt) {
|
|
81
|
-
if (printSettings.
|
|
81
|
+
if (printSettings.scalePercent !== void 0) return Math.max(printSettings.scalePercent / 100, MINIMUM_SCALE);
|
|
82
82
|
if (printSettings.fitToPages !== void 0) {
|
|
83
83
|
const budgetWidthPt = availableWidthPt * printSettings.fitToPages.width;
|
|
84
84
|
const budgetHeightPt = availableHeightPt * printSettings.fitToPages.height;
|
|
@@ -126,7 +126,7 @@ function cellStyledRuns(cell) {
|
|
|
126
126
|
}];
|
|
127
127
|
}
|
|
128
128
|
function isNumericLikeValue(kind) {
|
|
129
|
-
return kind === "number" || kind === "percentage" || kind === "currency" || kind === "date" || kind === "time";
|
|
129
|
+
return kind === "number" || kind === "percentage" || kind === "currency" || kind === "date" || kind === "time" || kind === "dateTime";
|
|
130
130
|
}
|
|
131
131
|
function defaultAlignmentForValue(kind) {
|
|
132
132
|
if (isNumericLikeValue(kind)) return "right";
|
package/dist/layout/slides.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ContentDocument } from "../model/content.cjs";
|
|
2
1
|
import { EmbeddedFormula } from "../model/formula.cjs";
|
|
3
|
-
import { ContentShape, LayoutDocument, LayoutImageAsset, LayoutItem } from "document-schema.js";
|
|
2
|
+
import { ContentDocument, ContentShape, LayoutDocument, LayoutImageAsset, LayoutItem } from "document-schema.js";
|
|
4
3
|
import { PositionedFormula, TextMeasurer } from "pdf-codec";
|
|
5
4
|
//#region src/layout/slides.d.ts
|
|
6
5
|
interface SlidesLayoutOptions {
|
package/dist/layout/slides.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ContentDocument } from "../model/content.js";
|
|
2
1
|
import { EmbeddedFormula } from "../model/formula.js";
|
|
3
|
-
import { ContentShape, LayoutDocument, LayoutImageAsset, LayoutItem } from "document-schema.js";
|
|
2
|
+
import { ContentDocument, ContentShape, LayoutDocument, LayoutImageAsset, LayoutItem } from "document-schema.js";
|
|
4
3
|
import { PositionedFormula, TextMeasurer } from "pdf-codec";
|
|
5
4
|
//#region src/layout/slides.d.ts
|
|
6
5
|
interface SlidesLayoutOptions {
|
package/dist/markdown/read.cjs
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("
|
|
2
|
+
let document_schema_js = require("document-schema.js");
|
|
3
3
|
let markdown_codec = require("markdown-codec");
|
|
4
4
|
//#region src/markdown/read.ts
|
|
5
5
|
function readMarkdownContent(text, options) {
|
|
6
6
|
const { document } = (0, markdown_codec.readMarkdown)(text, options);
|
|
7
7
|
if (document.kind !== "wordprocessing") throw new Error("readMarkdown returned a non-wordprocessing ContentDocument");
|
|
8
|
-
return {
|
|
9
|
-
|
|
10
|
-
formatVersion:
|
|
11
|
-
|
|
12
|
-
sections: document.sections
|
|
13
|
-
};
|
|
8
|
+
return document_schema_js.ContentDocumentSchema.parse({
|
|
9
|
+
...document,
|
|
10
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION
|
|
11
|
+
});
|
|
14
12
|
}
|
|
15
13
|
//#endregion
|
|
16
14
|
exports.readMarkdownContent = readMarkdownContent;
|
package/dist/markdown/read.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentDocument } from "
|
|
1
|
+
import { ContentDocument } from "document-schema.js";
|
|
2
2
|
import { ReadMarkdownOptions } from "markdown-codec";
|
|
3
3
|
//#region src/markdown/read.d.ts
|
|
4
4
|
declare function readMarkdownContent(text: string, options?: ReadMarkdownOptions): ContentDocument;
|
package/dist/markdown/read.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentDocument } from "
|
|
1
|
+
import { ContentDocument } from "document-schema.js";
|
|
2
2
|
import { ReadMarkdownOptions } from "markdown-codec";
|
|
3
3
|
//#region src/markdown/read.d.ts
|
|
4
4
|
declare function readMarkdownContent(text: string, options?: ReadMarkdownOptions): ContentDocument;
|
package/dist/markdown/read.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import { CONTENT_FORMAT_VERSION, ContentDocumentSchema } from "document-schema.js";
|
|
2
2
|
import { readMarkdown } from "markdown-codec";
|
|
3
3
|
//#region src/markdown/read.ts
|
|
4
4
|
function readMarkdownContent(text, options) {
|
|
5
5
|
const { document } = readMarkdown(text, options);
|
|
6
6
|
if (document.kind !== "wordprocessing") throw new Error("readMarkdown returned a non-wordprocessing ContentDocument");
|
|
7
|
-
return {
|
|
8
|
-
|
|
9
|
-
formatVersion:
|
|
10
|
-
|
|
11
|
-
sections: document.sections
|
|
12
|
-
};
|
|
7
|
+
return ContentDocumentSchema.parse({
|
|
8
|
+
...document,
|
|
9
|
+
formatVersion: CONTENT_FORMAT_VERSION
|
|
10
|
+
});
|
|
13
11
|
}
|
|
14
12
|
//#endregion
|
|
15
13
|
export { readMarkdownContent };
|
package/dist/markdown/write.cjs
CHANGED
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let markdown_codec = require("markdown-codec");
|
|
3
3
|
//#region src/markdown/write.ts
|
|
4
|
+
function toLegacyEmbeddedDocument(document) {
|
|
5
|
+
if (document.kind !== "wordprocessing") throw new markdown_codec.MarkdownUnsupportedDocumentKindError(document.kind);
|
|
6
|
+
return toLegacyWordprocessingDocument(document);
|
|
7
|
+
}
|
|
8
|
+
function toLegacyBlock(block) {
|
|
9
|
+
if (block.kind === "table") return {
|
|
10
|
+
...block,
|
|
11
|
+
rows: block.rows.map((row) => ({
|
|
12
|
+
...row,
|
|
13
|
+
cells: row.cells.map((cell) => ({
|
|
14
|
+
...cell,
|
|
15
|
+
blocks: cell.blocks.map(toLegacyBlock)
|
|
16
|
+
}))
|
|
17
|
+
}))
|
|
18
|
+
};
|
|
19
|
+
if (block.kind === "embeddedObject") return {
|
|
20
|
+
...block,
|
|
21
|
+
document: toLegacyEmbeddedDocument(block.document)
|
|
22
|
+
};
|
|
23
|
+
return block;
|
|
24
|
+
}
|
|
25
|
+
function toLegacyWordprocessingDocument(document) {
|
|
26
|
+
return {
|
|
27
|
+
kind: "wordprocessing",
|
|
28
|
+
formatVersion: 1,
|
|
29
|
+
metadata: document.metadata,
|
|
30
|
+
sections: document.sections.map((section) => ({
|
|
31
|
+
...section,
|
|
32
|
+
blocks: section.blocks.map(toLegacyBlock)
|
|
33
|
+
}))
|
|
34
|
+
};
|
|
35
|
+
}
|
|
4
36
|
function buildMarkdownText(document, options) {
|
|
5
|
-
|
|
37
|
+
if (document.kind !== "wordprocessing") throw new markdown_codec.MarkdownUnsupportedDocumentKindError(document.kind);
|
|
38
|
+
return (0, markdown_codec.writeMarkdown)(toLegacyWordprocessingDocument(document), options);
|
|
6
39
|
}
|
|
7
40
|
//#endregion
|
|
8
41
|
exports.buildMarkdownText = buildMarkdownText;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentDocument } from "
|
|
1
|
+
import { ContentDocument } from "document-schema.js";
|
|
2
2
|
import { WriteMarkdownOptions } from "markdown-codec";
|
|
3
3
|
//#region src/markdown/write.d.ts
|
|
4
4
|
declare function buildMarkdownText(document: ContentDocument, options?: WriteMarkdownOptions): string;
|
package/dist/markdown/write.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentDocument } from "
|
|
1
|
+
import { ContentDocument } from "document-schema.js";
|
|
2
2
|
import { WriteMarkdownOptions } from "markdown-codec";
|
|
3
3
|
//#region src/markdown/write.d.ts
|
|
4
4
|
declare function buildMarkdownText(document: ContentDocument, options?: WriteMarkdownOptions): string;
|
package/dist/markdown/write.js
CHANGED
|
@@ -1,7 +1,40 @@
|
|
|
1
|
-
import { writeMarkdown } from "markdown-codec";
|
|
1
|
+
import { MarkdownUnsupportedDocumentKindError, writeMarkdown } from "markdown-codec";
|
|
2
2
|
//#region src/markdown/write.ts
|
|
3
|
+
function toLegacyEmbeddedDocument(document) {
|
|
4
|
+
if (document.kind !== "wordprocessing") throw new MarkdownUnsupportedDocumentKindError(document.kind);
|
|
5
|
+
return toLegacyWordprocessingDocument(document);
|
|
6
|
+
}
|
|
7
|
+
function toLegacyBlock(block) {
|
|
8
|
+
if (block.kind === "table") return {
|
|
9
|
+
...block,
|
|
10
|
+
rows: block.rows.map((row) => ({
|
|
11
|
+
...row,
|
|
12
|
+
cells: row.cells.map((cell) => ({
|
|
13
|
+
...cell,
|
|
14
|
+
blocks: cell.blocks.map(toLegacyBlock)
|
|
15
|
+
}))
|
|
16
|
+
}))
|
|
17
|
+
};
|
|
18
|
+
if (block.kind === "embeddedObject") return {
|
|
19
|
+
...block,
|
|
20
|
+
document: toLegacyEmbeddedDocument(block.document)
|
|
21
|
+
};
|
|
22
|
+
return block;
|
|
23
|
+
}
|
|
24
|
+
function toLegacyWordprocessingDocument(document) {
|
|
25
|
+
return {
|
|
26
|
+
kind: "wordprocessing",
|
|
27
|
+
formatVersion: 1,
|
|
28
|
+
metadata: document.metadata,
|
|
29
|
+
sections: document.sections.map((section) => ({
|
|
30
|
+
...section,
|
|
31
|
+
blocks: section.blocks.map(toLegacyBlock)
|
|
32
|
+
}))
|
|
33
|
+
};
|
|
34
|
+
}
|
|
3
35
|
function buildMarkdownText(document, options) {
|
|
4
|
-
|
|
36
|
+
if (document.kind !== "wordprocessing") throw new MarkdownUnsupportedDocumentKindError(document.kind);
|
|
37
|
+
return writeMarkdown(toLegacyWordprocessingDocument(document), options);
|
|
5
38
|
}
|
|
6
39
|
//#endregion
|
|
7
40
|
export { buildMarkdownText };
|
package/dist/odb/spreadsheet.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../model/content.cjs");
|
|
3
2
|
const require_hsqldb_script = require("../hsqldb/script.cjs");
|
|
4
3
|
let document_schema_js = require("document-schema.js");
|
|
5
4
|
//#region src/odb/spreadsheet.ts
|
|
@@ -59,7 +58,7 @@ function tableToSheet(table) {
|
|
|
59
58
|
function odbTablesToSpreadsheetDocument(tables) {
|
|
60
59
|
return {
|
|
61
60
|
kind: "spreadsheet",
|
|
62
|
-
formatVersion:
|
|
61
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
|
|
63
62
|
metadata: {},
|
|
64
63
|
sheets: tables.map(tableToSheet)
|
|
65
64
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContentDocument } from "../model/content.cjs";
|
|
2
1
|
import { HsqldbTable } from "../hsqldb/script.cjs";
|
|
2
|
+
import { ContentDocument } from "document-schema.js";
|
|
3
3
|
//#region src/odb/spreadsheet.d.ts
|
|
4
4
|
declare function odbTablesToSpreadsheetDocument(tables: readonly HsqldbTable[]): ContentDocument;
|
|
5
5
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContentDocument } from "../model/content.js";
|
|
2
1
|
import { HsqldbTable } from "../hsqldb/script.js";
|
|
2
|
+
import { ContentDocument } from "document-schema.js";
|
|
3
3
|
//#region src/odb/spreadsheet.d.ts
|
|
4
4
|
declare function odbTablesToSpreadsheetDocument(tables: readonly HsqldbTable[]): ContentDocument;
|
|
5
5
|
//#endregion
|
package/dist/odb/spreadsheet.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../model/content.js";
|
|
2
1
|
import { PAGE_SIZE_A4 } from "../model/geometry.js";
|
|
3
2
|
import { displayTextFor } from "../hsqldb/script.js";
|
|
3
|
+
import { CONTENT_FORMAT_VERSION } from "document-schema.js";
|
|
4
4
|
//#region src/odb/spreadsheet.ts
|
|
5
5
|
const HEADER_ROW_INDEX = 0;
|
|
6
6
|
const COLUMN_WIDTH_PT = 64;
|
|
@@ -58,7 +58,7 @@ function tableToSheet(table) {
|
|
|
58
58
|
function odbTablesToSpreadsheetDocument(tables) {
|
|
59
59
|
return {
|
|
60
60
|
kind: "spreadsheet",
|
|
61
|
-
formatVersion:
|
|
61
|
+
formatVersion: CONTENT_FORMAT_VERSION,
|
|
62
62
|
metadata: {},
|
|
63
63
|
sheets: tables.map(tableToSheet)
|
|
64
64
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../model/content.cjs");
|
|
3
2
|
let document_schema_js = require("document-schema.js");
|
|
4
3
|
//#region src/odf/formula/placeholder.ts
|
|
5
4
|
const ZERO_MARGINS = {
|
|
@@ -12,7 +11,7 @@ function placeholderFormulaDocument(formula) {
|
|
|
12
11
|
const text = formula.starMath ?? "[formula]";
|
|
13
12
|
return {
|
|
14
13
|
kind: "wordprocessing",
|
|
15
|
-
formatVersion:
|
|
14
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
|
|
16
15
|
metadata: {},
|
|
17
16
|
sections: [{
|
|
18
17
|
pageSize: document_schema_js.PAGE_SIZE_A4,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Box } from "../../geometry-DvwdrIij.cjs";
|
|
1
|
+
import { t as Box$1 } from "../../geometry-DvwdrIij.cjs";
|
|
3
2
|
import { EmbeddedFormula } from "../../model/formula.cjs";
|
|
3
|
+
import { ContentDocument } from "document-schema.js";
|
|
4
4
|
//#region src/odf/formula/placeholder.d.ts
|
|
5
5
|
interface FormulaPlaceholderBlock {
|
|
6
6
|
readonly kind: 'embeddedObject';
|
|
7
7
|
readonly objectKind: 'formula';
|
|
8
8
|
readonly document: ContentDocument;
|
|
9
|
-
readonly frame: Box;
|
|
9
|
+
readonly frame: Box$1;
|
|
10
10
|
readonly sourcePath: string;
|
|
11
11
|
}
|
|
12
|
-
declare function buildFormulaPlaceholderBlock(formula: EmbeddedFormula, frame: Box, sourcePath: string): FormulaPlaceholderBlock;
|
|
12
|
+
declare function buildFormulaPlaceholderBlock(formula: EmbeddedFormula, frame: Box$1, sourcePath: string): FormulaPlaceholderBlock;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { FormulaPlaceholderBlock, buildFormulaPlaceholderBlock };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Box } from "../../geometry-DvwdrIij.js";
|
|
1
|
+
import { t as Box$1 } from "../../geometry-DvwdrIij.js";
|
|
3
2
|
import { EmbeddedFormula } from "../../model/formula.js";
|
|
3
|
+
import { ContentDocument } from "document-schema.js";
|
|
4
4
|
//#region src/odf/formula/placeholder.d.ts
|
|
5
5
|
interface FormulaPlaceholderBlock {
|
|
6
6
|
readonly kind: 'embeddedObject';
|
|
7
7
|
readonly objectKind: 'formula';
|
|
8
8
|
readonly document: ContentDocument;
|
|
9
|
-
readonly frame: Box;
|
|
9
|
+
readonly frame: Box$1;
|
|
10
10
|
readonly sourcePath: string;
|
|
11
11
|
}
|
|
12
|
-
declare function buildFormulaPlaceholderBlock(formula: EmbeddedFormula, frame: Box, sourcePath: string): FormulaPlaceholderBlock;
|
|
12
|
+
declare function buildFormulaPlaceholderBlock(formula: EmbeddedFormula, frame: Box$1, sourcePath: string): FormulaPlaceholderBlock;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { FormulaPlaceholderBlock, buildFormulaPlaceholderBlock };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../model/content.js";
|
|
2
1
|
import { PAGE_SIZE_A4 } from "../../model/geometry.js";
|
|
2
|
+
import { CONTENT_FORMAT_VERSION } from "document-schema.js";
|
|
3
3
|
//#region src/odf/formula/placeholder.ts
|
|
4
4
|
const ZERO_MARGINS = {
|
|
5
5
|
topPt: 0,
|
|
@@ -11,7 +11,7 @@ function placeholderFormulaDocument(formula) {
|
|
|
11
11
|
const text = formula.starMath ?? "[formula]";
|
|
12
12
|
return {
|
|
13
13
|
kind: "wordprocessing",
|
|
14
|
-
formatVersion:
|
|
14
|
+
formatVersion: CONTENT_FORMAT_VERSION,
|
|
15
15
|
metadata: {},
|
|
16
16
|
sections: [{
|
|
17
17
|
pageSize: PAGE_SIZE_A4,
|
package/dist/odf/odg/read.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("
|
|
2
|
+
let document_schema_js = require("document-schema.js");
|
|
3
3
|
let odf_js = require("odf.js");
|
|
4
4
|
//#region src/odf/odg/read.ts
|
|
5
5
|
function readOdgContent(pkg) {
|
|
6
6
|
const odgDoc = (0, odf_js.readOdg)(pkg);
|
|
7
7
|
return {
|
|
8
8
|
kind: "drawing",
|
|
9
|
-
formatVersion:
|
|
9
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
|
|
10
10
|
metadata: { ...odgDoc.metadata },
|
|
11
11
|
pages: odgDoc.pages
|
|
12
12
|
};
|
package/dist/odf/odg/read.d.cts
CHANGED
package/dist/odf/odg/read.d.ts
CHANGED
package/dist/odf/odg/read.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import { CONTENT_FORMAT_VERSION } from "document-schema.js";
|
|
2
2
|
import { readOdg } from "odf.js";
|
|
3
3
|
//#region src/odf/odg/read.ts
|
|
4
4
|
function readOdgContent(pkg) {
|
|
5
5
|
const odgDoc = readOdg(pkg);
|
|
6
6
|
return {
|
|
7
7
|
kind: "drawing",
|
|
8
|
-
formatVersion:
|
|
8
|
+
formatVersion: CONTENT_FORMAT_VERSION,
|
|
9
9
|
metadata: { ...odgDoc.metadata },
|
|
10
10
|
pages: odgDoc.pages
|
|
11
11
|
};
|
package/dist/odf/odp/read.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../model/content.cjs");
|
|
3
2
|
const require_odf_formula_detect = require("../formula/detect.cjs");
|
|
4
3
|
const require_odf_formula_placeholder = require("../formula/placeholder.cjs");
|
|
4
|
+
let document_schema_js = require("document-schema.js");
|
|
5
5
|
let odf_js = require("odf.js");
|
|
6
6
|
//#region src/odf/odp/read.ts
|
|
7
7
|
function readOdpContent(pkg) {
|
|
@@ -34,7 +34,7 @@ function readOdpContent(pkg) {
|
|
|
34
34
|
return {
|
|
35
35
|
document: {
|
|
36
36
|
kind: "presentation",
|
|
37
|
-
formatVersion:
|
|
37
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
|
|
38
38
|
metadata: { ...odpDoc.metadata },
|
|
39
39
|
slides: odpDoc.slides
|
|
40
40
|
},
|
package/dist/odf/odp/read.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContentDocument } from "../../model/content.cjs";
|
|
2
1
|
import { EmbeddedFormula } from "../../model/formula.cjs";
|
|
2
|
+
import { ContentDocument } from "document-schema.js";
|
|
3
3
|
import { Package } from "odf.js";
|
|
4
4
|
//#region src/odf/odp/read.d.ts
|
|
5
5
|
interface OdpContentResult {
|
package/dist/odf/odp/read.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContentDocument } from "../../model/content.js";
|
|
2
1
|
import { EmbeddedFormula } from "../../model/formula.js";
|
|
2
|
+
import { ContentDocument } from "document-schema.js";
|
|
3
3
|
import { Package } from "odf.js";
|
|
4
4
|
//#region src/odf/odp/read.d.ts
|
|
5
5
|
interface OdpContentResult {
|
package/dist/odf/odp/read.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../model/content.js";
|
|
2
1
|
import { detectEmbeddedFormulaFrames } from "../formula/detect.js";
|
|
3
2
|
import { buildFormulaPlaceholderBlock } from "../formula/placeholder.js";
|
|
3
|
+
import { CONTENT_FORMAT_VERSION } from "document-schema.js";
|
|
4
4
|
import { childrenWithTag, findChildElement, readOdp, rootElement } from "odf.js";
|
|
5
5
|
//#region src/odf/odp/read.ts
|
|
6
6
|
function readOdpContent(pkg) {
|
|
@@ -33,7 +33,7 @@ function readOdpContent(pkg) {
|
|
|
33
33
|
return {
|
|
34
34
|
document: {
|
|
35
35
|
kind: "presentation",
|
|
36
|
-
formatVersion:
|
|
36
|
+
formatVersion: CONTENT_FORMAT_VERSION,
|
|
37
37
|
metadata: { ...odpDoc.metadata },
|
|
38
38
|
slides: odpDoc.slides
|
|
39
39
|
},
|
package/dist/odf/ods/read.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("
|
|
2
|
+
let document_schema_js = require("document-schema.js");
|
|
3
3
|
let odf_js = require("odf.js");
|
|
4
4
|
//#region src/odf/ods/read.ts
|
|
5
5
|
function readOdsContent(pkg) {
|
|
6
6
|
const odsDoc = (0, odf_js.readOds)(pkg);
|
|
7
7
|
return {
|
|
8
8
|
kind: "spreadsheet",
|
|
9
|
-
formatVersion:
|
|
9
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
|
|
10
10
|
metadata: { ...odsDoc.metadata },
|
|
11
11
|
sheets: odsDoc.sheets
|
|
12
12
|
};
|
package/dist/odf/ods/read.d.cts
CHANGED
package/dist/odf/ods/read.d.ts
CHANGED
package/dist/odf/ods/read.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import { CONTENT_FORMAT_VERSION } from "document-schema.js";
|
|
2
2
|
import { readOds } from "odf.js";
|
|
3
3
|
//#region src/odf/ods/read.ts
|
|
4
4
|
function readOdsContent(pkg) {
|
|
5
5
|
const odsDoc = readOds(pkg);
|
|
6
6
|
return {
|
|
7
7
|
kind: "spreadsheet",
|
|
8
|
-
formatVersion:
|
|
8
|
+
formatVersion: CONTENT_FORMAT_VERSION,
|
|
9
9
|
metadata: { ...odsDoc.metadata },
|
|
10
10
|
sheets: odsDoc.sheets
|
|
11
11
|
};
|
package/dist/odf/odt/read.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../model/content.cjs");
|
|
3
2
|
const require_odf_formula_detect = require("../formula/detect.cjs");
|
|
4
3
|
const require_odf_formula_placeholder = require("../formula/placeholder.cjs");
|
|
4
|
+
let document_schema_js = require("document-schema.js");
|
|
5
5
|
let odf_js = require("odf.js");
|
|
6
6
|
//#region src/odf/odt/read.ts
|
|
7
7
|
function readOdtContent(pkg) {
|
|
@@ -32,7 +32,7 @@ function readOdtContent(pkg) {
|
|
|
32
32
|
return {
|
|
33
33
|
document: {
|
|
34
34
|
kind: "wordprocessing",
|
|
35
|
-
formatVersion:
|
|
35
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
|
|
36
36
|
metadata: { ...odtDoc.metadata },
|
|
37
37
|
sections: odtDoc.sections
|
|
38
38
|
},
|
package/dist/odf/odt/read.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContentDocument } from "../../model/content.cjs";
|
|
2
1
|
import { EmbeddedFormula } from "../../model/formula.cjs";
|
|
2
|
+
import { ContentDocument } from "document-schema.js";
|
|
3
3
|
import { Package } from "odf.js";
|
|
4
4
|
//#region src/odf/odt/read.d.ts
|
|
5
5
|
interface OdtContentResult {
|
package/dist/odf/odt/read.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContentDocument } from "../../model/content.js";
|
|
2
1
|
import { EmbeddedFormula } from "../../model/formula.js";
|
|
2
|
+
import { ContentDocument } from "document-schema.js";
|
|
3
3
|
import { Package } from "odf.js";
|
|
4
4
|
//#region src/odf/odt/read.d.ts
|
|
5
5
|
interface OdtContentResult {
|
package/dist/odf/odt/read.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../model/content.js";
|
|
2
1
|
import { detectEmbeddedFormulaFrames } from "../formula/detect.js";
|
|
3
2
|
import { buildFormulaPlaceholderBlock } from "../formula/placeholder.js";
|
|
3
|
+
import { CONTENT_FORMAT_VERSION } from "document-schema.js";
|
|
4
4
|
import { findChildElement, readOdt, rootElement } from "odf.js";
|
|
5
5
|
//#region src/odf/odt/read.ts
|
|
6
6
|
function readOdtContent(pkg) {
|
|
@@ -31,7 +31,7 @@ function readOdtContent(pkg) {
|
|
|
31
31
|
return {
|
|
32
32
|
document: {
|
|
33
33
|
kind: "wordprocessing",
|
|
34
|
-
formatVersion:
|
|
34
|
+
formatVersion: CONTENT_FORMAT_VERSION,
|
|
35
35
|
metadata: { ...odtDoc.metadata },
|
|
36
36
|
sections: odtDoc.sections
|
|
37
37
|
},
|
package/dist/ooxml/docx/read.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../model/content.cjs");
|
|
3
2
|
let ooxml_js = require("ooxml.js");
|
|
3
|
+
let document_schema_js = require("document-schema.js");
|
|
4
4
|
//#region src/ooxml/docx/read.ts
|
|
5
5
|
function readDocxContent(pkg) {
|
|
6
6
|
const docxDoc = (0, ooxml_js.readDocx)(pkg);
|
|
7
7
|
return {
|
|
8
8
|
kind: "wordprocessing",
|
|
9
|
-
formatVersion:
|
|
9
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
|
|
10
10
|
metadata: { ...docxDoc.metadata },
|
|
11
11
|
sections: docxDoc.sections
|
|
12
12
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContentDocument } from "../../model/content.js";
|
|
2
1
|
import { Package } from "ooxml.js";
|
|
2
|
+
import { ContentDocument } from "document-schema.js";
|
|
3
3
|
//#region src/ooxml/docx/read.d.ts
|
|
4
4
|
declare function readDocxContent(pkg: Package): ContentDocument;
|
|
5
5
|
//#endregion
|
package/dist/ooxml/docx/read.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "../../model/content.js";
|
|
2
1
|
import { readDocx } from "ooxml.js";
|
|
2
|
+
import { CONTENT_FORMAT_VERSION } from "document-schema.js";
|
|
3
3
|
//#region src/ooxml/docx/read.ts
|
|
4
4
|
function readDocxContent(pkg) {
|
|
5
5
|
const docxDoc = readDocx(pkg);
|
|
6
6
|
return {
|
|
7
7
|
kind: "wordprocessing",
|
|
8
|
-
formatVersion:
|
|
8
|
+
formatVersion: CONTENT_FORMAT_VERSION,
|
|
9
9
|
metadata: { ...docxDoc.metadata },
|
|
10
10
|
sections: docxDoc.sections
|
|
11
11
|
};
|
package/dist/ooxml/pptx/read.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../model/content.cjs");
|
|
3
2
|
let ooxml_js = require("ooxml.js");
|
|
3
|
+
let document_schema_js = require("document-schema.js");
|
|
4
4
|
//#region src/ooxml/pptx/read.ts
|
|
5
5
|
function readPptxContent(pkg) {
|
|
6
6
|
const pptxDoc = (0, ooxml_js.readPptx)(pkg);
|
|
7
7
|
return {
|
|
8
8
|
kind: "presentation",
|
|
9
|
-
formatVersion:
|
|
9
|
+
formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
|
|
10
10
|
metadata: { ...pptxDoc.metadata },
|
|
11
11
|
slides: pptxDoc.slides
|
|
12
12
|
};
|