js.documents 7.2.5 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codecs/read.cjs +1 -1
- package/dist/codecs/read.js +1 -1
- package/dist/convert/composition.cjs +1 -1
- package/dist/convert/composition.js +1 -1
- package/dist/edit/docx/content.cjs +2 -2
- package/dist/edit/docx/content.js +2 -2
- package/dist/edit/docx/editor.cjs +8 -1
- package/dist/edit/docx/editor.d.cts +3 -0
- package/dist/edit/docx/editor.d.ts +3 -0
- package/dist/edit/docx/editor.js +9 -2
- package/dist/edit/docx/run.cjs +1 -1
- package/dist/edit/docx/run.js +1 -1
- package/dist/edit/odg/editor.cjs +8 -1
- package/dist/edit/odg/editor.d.cts +3 -1
- package/dist/edit/odg/editor.d.ts +3 -1
- package/dist/edit/odg/editor.js +9 -2
- package/dist/edit/odg/scaffold.cjs +5 -4
- package/dist/edit/odg/scaffold.d.cts +2 -1
- package/dist/edit/odg/scaffold.d.ts +2 -1
- package/dist/edit/odg/scaffold.js +5 -5
- package/dist/edit/odp/editor.cjs +8 -1
- package/dist/edit/odp/editor.d.cts +3 -1
- package/dist/edit/odp/editor.d.ts +3 -1
- package/dist/edit/odp/editor.js +9 -2
- package/dist/edit/odp/scaffold.cjs +5 -4
- package/dist/edit/odp/scaffold.d.cts +2 -1
- package/dist/edit/odp/scaffold.d.ts +2 -1
- package/dist/edit/odp/scaffold.js +5 -5
- package/dist/edit/odp/shape.cjs +1 -1
- package/dist/edit/odp/shape.js +1 -1
- package/dist/edit/ods/editor.cjs +8 -1
- package/dist/edit/ods/editor.d.cts +3 -0
- package/dist/edit/ods/editor.d.ts +3 -0
- package/dist/edit/ods/editor.js +9 -2
- package/dist/edit/ods/scaffold.cjs +5 -4
- package/dist/edit/ods/scaffold.d.cts +2 -1
- package/dist/edit/ods/scaffold.d.ts +2 -1
- package/dist/edit/ods/scaffold.js +5 -5
- package/dist/edit/odt/editor.cjs +7 -0
- package/dist/edit/odt/editor.d.cts +3 -1
- package/dist/edit/odt/editor.d.ts +3 -1
- package/dist/edit/odt/editor.js +8 -1
- package/dist/edit/odt/scaffold.cjs +5 -4
- package/dist/edit/odt/scaffold.d.cts +2 -1
- package/dist/edit/odt/scaffold.d.ts +2 -1
- package/dist/edit/odt/scaffold.js +5 -5
- package/dist/edit/pptx/editor.cjs +10 -3
- package/dist/edit/pptx/editor.d.cts +3 -1
- package/dist/edit/pptx/editor.d.ts +3 -1
- package/dist/edit/pptx/editor.js +11 -4
- package/dist/edit/pptx/scaffold.cjs +1 -1
- package/dist/edit/pptx/scaffold.js +1 -1
- package/dist/edit/pptx/shape.cjs +1 -1
- package/dist/edit/pptx/shape.js +1 -1
- package/dist/edit/pptx/slide.cjs +2 -2
- package/dist/edit/pptx/slide.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/metadata/core-patch.cjs +29 -0
- package/dist/metadata/core-patch.d.cts +15 -0
- package/dist/metadata/core-patch.d.ts +15 -0
- package/dist/metadata/core-patch.js +26 -0
- package/dist/metadata/write.cjs +4 -17
- package/dist/metadata/write.d.cts +2 -7
- package/dist/metadata/write.d.ts +2 -7
- package/dist/metadata/write.js +3 -16
- package/dist/odf-package/formula.cjs +1 -1
- package/dist/odf-package/formula.js +1 -1
- package/dist/omml/write.cjs +1 -1
- package/dist/omml/write.js +1 -1
- package/dist/ooxml/docx/embedded-objects.cjs +75 -14
- package/dist/ooxml/docx/embedded-objects.d.cts +2 -2
- package/dist/ooxml/docx/embedded-objects.d.ts +2 -2
- package/dist/ooxml/docx/embedded-objects.js +76 -15
- package/dist/ooxml/docx/read.cjs +1 -1
- package/dist/ooxml/docx/read.js +1 -1
- package/dist/ooxml/legacy-embedded.cjs +29 -0
- package/dist/ooxml/legacy-embedded.d.cts +9 -0
- package/dist/ooxml/legacy-embedded.d.ts +9 -0
- package/dist/ooxml/legacy-embedded.js +28 -0
- package/dist/ooxml/pptx/legacy-embedded.cjs +56 -0
- package/dist/ooxml/pptx/legacy-embedded.d.cts +6 -0
- package/dist/ooxml/pptx/legacy-embedded.d.ts +6 -0
- package/dist/ooxml/pptx/legacy-embedded.js +55 -0
- package/dist/ooxml/pptx/read.cjs +5 -2
- package/dist/ooxml/pptx/read.js +5 -2
- package/dist/opc/core-properties.cjs +2 -2
- package/dist/opc/core-properties.js +2 -2
- package/dist/opc/media.cjs +1 -1
- package/dist/opc/media.js +1 -1
- package/dist/xml/odf-text.cjs +1 -1
- package/dist/xml/odf-text.js +1 -1
- package/package.json +3 -3
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { t as ClockPort } from "../../clock-C7SUuYN0.js";
|
|
2
2
|
import { OdsSheet } from "./sheet.js";
|
|
3
|
+
import { LayoutMetadata } from "document-schema.js";
|
|
3
4
|
import { Package } from "odf.js";
|
|
4
5
|
//#region src/edit/ods/editor.d.ts
|
|
5
6
|
declare class OdsEditor {
|
|
6
7
|
private readonly pkg;
|
|
7
8
|
constructor(pkg: Package);
|
|
9
|
+
get metadata(): LayoutMetadata;
|
|
10
|
+
set metadata(value: LayoutMetadata);
|
|
8
11
|
sheets(): OdsSheet[];
|
|
9
12
|
sheet(name: string): OdsSheet;
|
|
10
13
|
addSheet(name: string): OdsSheet;
|
package/dist/edit/ods/editor.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { el } from "../../xml/fragment.js";
|
|
2
|
+
import { patchOdfMetadataOnPackage } from "../../metadata/core-patch.js";
|
|
1
3
|
import { resolveMetadataTimestamps } from "../../model/metadata.js";
|
|
2
4
|
import { systemClock } from "../../ports/clock.js";
|
|
3
|
-
import { el } from "../../xml/fragment.js";
|
|
4
5
|
import { ensureAutomaticStyles } from "../odt/automatic-styles.js";
|
|
5
6
|
import { MASTER_PAGE_NAME, SHEET_TABLE_STYLE_NAME, createEmptyOdsPackage } from "./scaffold.js";
|
|
6
7
|
import { OdsSheet } from "./sheet.js";
|
|
7
8
|
import { attr } from "ooxml.js";
|
|
8
|
-
import { decodePackage as decodePackage$1, encodePackage as encodePackage$1 } from "odf.js";
|
|
9
|
+
import { decodePackage as decodePackage$1, encodePackage as encodePackage$1, readOdfMetadata } from "odf.js";
|
|
9
10
|
//#region src/edit/ods/editor.ts
|
|
10
11
|
const CONTENT_PART_PATH = "content.xml";
|
|
11
12
|
function directChild(parent, tag) {
|
|
@@ -38,6 +39,12 @@ var OdsEditor = class {
|
|
|
38
39
|
constructor(pkg) {
|
|
39
40
|
this.pkg = pkg;
|
|
40
41
|
}
|
|
42
|
+
get metadata() {
|
|
43
|
+
return readOdfMetadata(this.pkg);
|
|
44
|
+
}
|
|
45
|
+
set metadata(value) {
|
|
46
|
+
patchOdfMetadataOnPackage(this.pkg, value, "1.3");
|
|
47
|
+
}
|
|
41
48
|
sheets() {
|
|
42
49
|
const spreadsheet = findOfficeSpreadsheet(this.pkg);
|
|
43
50
|
const out = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
3
2
|
const require_xml_entities = require("../../xml/entities.cjs");
|
|
3
|
+
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
4
4
|
let document_schema_js = require("document-schema.js");
|
|
5
5
|
let odf_js = require("odf.js");
|
|
6
6
|
//#region src/edit/ods/scaffold.ts
|
|
@@ -61,7 +61,7 @@ function buildPageLayout() {
|
|
|
61
61
|
function buildStylesXml() {
|
|
62
62
|
return require_xml_fragment.el("office:document-styles", {
|
|
63
63
|
...(0, odf_js.xmlnsAttributes)([...STYLES_NS_PREFIXES]),
|
|
64
|
-
"office:version":
|
|
64
|
+
"office:version": "1.3"
|
|
65
65
|
}, [
|
|
66
66
|
require_xml_fragment.el("office:styles"),
|
|
67
67
|
require_xml_fragment.el("office:automatic-styles", {}, [buildPageLayout()]),
|
|
@@ -94,7 +94,7 @@ function buildContentXml() {
|
|
|
94
94
|
return require_xml_fragment.el("office:document-content", {
|
|
95
95
|
...(0, odf_js.xmlnsAttributes)([...CONTENT_NS_PREFIXES]),
|
|
96
96
|
...OF_NAMESPACE_ATTR,
|
|
97
|
-
"office:version":
|
|
97
|
+
"office:version": "1.3"
|
|
98
98
|
}, [require_xml_fragment.el("office:automatic-styles", {}, [buildSheetTableStyle()]), require_xml_fragment.el("office:body", {}, [require_xml_fragment.el("office:spreadsheet", {}, [buildCalculationSettings(), table])])]);
|
|
99
99
|
}
|
|
100
100
|
function buildOfficeMeta(metadata) {
|
|
@@ -112,7 +112,7 @@ function buildOfficeMeta(metadata) {
|
|
|
112
112
|
function buildMetaXml(metadata) {
|
|
113
113
|
return require_xml_fragment.el("office:document-meta", {
|
|
114
114
|
...(0, odf_js.xmlnsAttributes)([...META_NS_PREFIXES]),
|
|
115
|
-
"office:version":
|
|
115
|
+
"office:version": "1.3"
|
|
116
116
|
}, [require_xml_fragment.el("office:meta", {}, buildOfficeMeta(metadata))]);
|
|
117
117
|
}
|
|
118
118
|
function createEmptyOdsPackage(options) {
|
|
@@ -137,6 +137,7 @@ function createEmptyOdsPackage(options) {
|
|
|
137
137
|
//#endregion
|
|
138
138
|
exports.DEFAULT_SHEET_NAME = DEFAULT_SHEET_NAME;
|
|
139
139
|
exports.MASTER_PAGE_NAME = MASTER_PAGE_NAME;
|
|
140
|
+
exports.ODF_VERSION = ODF_VERSION;
|
|
140
141
|
exports.PAGE_LAYOUT_NAME = PAGE_LAYOUT_NAME;
|
|
141
142
|
exports.SHEET_TABLE_STYLE_NAME = SHEET_TABLE_STYLE_NAME;
|
|
142
143
|
exports.createEmptyOdsPackage = createEmptyOdsPackage;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LayoutMetadata } from "document-schema.js";
|
|
2
2
|
import { Package } from "odf.js";
|
|
3
3
|
//#region src/edit/ods/scaffold.d.ts
|
|
4
|
+
declare const ODF_VERSION = "1.3";
|
|
4
5
|
declare const PAGE_LAYOUT_NAME = "PM1";
|
|
5
6
|
declare const MASTER_PAGE_NAME = "Standard";
|
|
6
7
|
declare const SHEET_TABLE_STYLE_NAME = "OdsTable";
|
|
@@ -10,4 +11,4 @@ interface CreateEmptyOdsPackageOptions {
|
|
|
10
11
|
}
|
|
11
12
|
declare function createEmptyOdsPackage(options?: CreateEmptyOdsPackageOptions): Package;
|
|
12
13
|
//#endregion
|
|
13
|
-
export { CreateEmptyOdsPackageOptions, DEFAULT_SHEET_NAME, MASTER_PAGE_NAME, PAGE_LAYOUT_NAME, SHEET_TABLE_STYLE_NAME, createEmptyOdsPackage };
|
|
14
|
+
export { CreateEmptyOdsPackageOptions, DEFAULT_SHEET_NAME, MASTER_PAGE_NAME, ODF_VERSION, PAGE_LAYOUT_NAME, SHEET_TABLE_STYLE_NAME, createEmptyOdsPackage };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LayoutMetadata } from "document-schema.js";
|
|
2
2
|
import { Package } from "odf.js";
|
|
3
3
|
//#region src/edit/ods/scaffold.d.ts
|
|
4
|
+
declare const ODF_VERSION = "1.3";
|
|
4
5
|
declare const PAGE_LAYOUT_NAME = "PM1";
|
|
5
6
|
declare const MASTER_PAGE_NAME = "Standard";
|
|
6
7
|
declare const SHEET_TABLE_STYLE_NAME = "OdsTable";
|
|
@@ -10,4 +11,4 @@ interface CreateEmptyOdsPackageOptions {
|
|
|
10
11
|
}
|
|
11
12
|
declare function createEmptyOdsPackage(options?: CreateEmptyOdsPackageOptions): Package;
|
|
12
13
|
//#endregion
|
|
13
|
-
export { CreateEmptyOdsPackageOptions, DEFAULT_SHEET_NAME, MASTER_PAGE_NAME, PAGE_LAYOUT_NAME, SHEET_TABLE_STYLE_NAME, createEmptyOdsPackage };
|
|
14
|
+
export { CreateEmptyOdsPackageOptions, DEFAULT_SHEET_NAME, MASTER_PAGE_NAME, ODF_VERSION, PAGE_LAYOUT_NAME, SHEET_TABLE_STYLE_NAME, createEmptyOdsPackage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { el, txt } from "../../xml/fragment.js";
|
|
2
1
|
import { encodeXmlText as encodeXmlText$1 } from "../../xml/entities.js";
|
|
2
|
+
import { el, txt } from "../../xml/fragment.js";
|
|
3
3
|
import { PAGE_SIZE_A4 } from "document-schema.js";
|
|
4
4
|
import { ODF_MEDIA_TYPES, setDocumentMediaType, syncManifest, xmlnsAttributes } from "odf.js";
|
|
5
5
|
//#region src/edit/ods/scaffold.ts
|
|
@@ -60,7 +60,7 @@ function buildPageLayout() {
|
|
|
60
60
|
function buildStylesXml() {
|
|
61
61
|
return el("office:document-styles", {
|
|
62
62
|
...xmlnsAttributes([...STYLES_NS_PREFIXES]),
|
|
63
|
-
"office:version":
|
|
63
|
+
"office:version": "1.3"
|
|
64
64
|
}, [
|
|
65
65
|
el("office:styles"),
|
|
66
66
|
el("office:automatic-styles", {}, [buildPageLayout()]),
|
|
@@ -93,7 +93,7 @@ function buildContentXml() {
|
|
|
93
93
|
return el("office:document-content", {
|
|
94
94
|
...xmlnsAttributes([...CONTENT_NS_PREFIXES]),
|
|
95
95
|
...OF_NAMESPACE_ATTR,
|
|
96
|
-
"office:version":
|
|
96
|
+
"office:version": "1.3"
|
|
97
97
|
}, [el("office:automatic-styles", {}, [buildSheetTableStyle()]), el("office:body", {}, [el("office:spreadsheet", {}, [buildCalculationSettings(), table])])]);
|
|
98
98
|
}
|
|
99
99
|
function buildOfficeMeta(metadata) {
|
|
@@ -111,7 +111,7 @@ function buildOfficeMeta(metadata) {
|
|
|
111
111
|
function buildMetaXml(metadata) {
|
|
112
112
|
return el("office:document-meta", {
|
|
113
113
|
...xmlnsAttributes([...META_NS_PREFIXES]),
|
|
114
|
-
"office:version":
|
|
114
|
+
"office:version": "1.3"
|
|
115
115
|
}, [el("office:meta", {}, buildOfficeMeta(metadata))]);
|
|
116
116
|
}
|
|
117
117
|
function createEmptyOdsPackage(options) {
|
|
@@ -134,4 +134,4 @@ function createEmptyOdsPackage(options) {
|
|
|
134
134
|
return pkg;
|
|
135
135
|
}
|
|
136
136
|
//#endregion
|
|
137
|
-
export { DEFAULT_SHEET_NAME, MASTER_PAGE_NAME, PAGE_LAYOUT_NAME, SHEET_TABLE_STYLE_NAME, createEmptyOdsPackage };
|
|
137
|
+
export { DEFAULT_SHEET_NAME, MASTER_PAGE_NAME, ODF_VERSION, PAGE_LAYOUT_NAME, SHEET_TABLE_STYLE_NAME, createEmptyOdsPackage };
|
package/dist/edit/odt/editor.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_metadata_core_patch = require("../../metadata/core-patch.cjs");
|
|
2
3
|
const require_model_metadata = require("../../model/metadata.cjs");
|
|
3
4
|
const require_ports_clock = require("../../ports/clock.cjs");
|
|
4
5
|
const require_edit_odt_automatic_styles = require("./automatic-styles.cjs");
|
|
@@ -77,6 +78,12 @@ var OdtEditor = class {
|
|
|
77
78
|
const officeText = findOfficeText(findContentRoot(pkg));
|
|
78
79
|
this.body = new OdtBodyImpl(officeText, pkg);
|
|
79
80
|
}
|
|
81
|
+
get metadata() {
|
|
82
|
+
return (0, odf_js.readOdfMetadata)(this.pkg);
|
|
83
|
+
}
|
|
84
|
+
set metadata(value) {
|
|
85
|
+
require_metadata_core_patch.patchOdfMetadataOnPackage(this.pkg, value, "1.3");
|
|
86
|
+
}
|
|
80
87
|
paragraphs() {
|
|
81
88
|
const officeText = findOfficeText(findContentRoot(this.pkg));
|
|
82
89
|
const out = [];
|
|
@@ -2,7 +2,7 @@ import { t as ClockPort } from "../../clock-C7SUuYN0.cjs";
|
|
|
2
2
|
import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-CRaLSzWz.cjs";
|
|
3
3
|
import { t as OdtList } from "../../list-yc0dJrOX.cjs";
|
|
4
4
|
import { a as TableInit, n as OdtTable } from "../../table-COmzfIOe.cjs";
|
|
5
|
-
import { Box, ContentFormula, ContentVector } from "document-schema.js";
|
|
5
|
+
import { Box, ContentFormula, ContentVector, LayoutMetadata } from "document-schema.js";
|
|
6
6
|
import { Package } from "odf.js";
|
|
7
7
|
//#region src/edit/odt/editor.d.ts
|
|
8
8
|
interface OdtBody {
|
|
@@ -17,6 +17,8 @@ declare class OdtEditor {
|
|
|
17
17
|
readonly body: OdtBody;
|
|
18
18
|
private readonly pkg;
|
|
19
19
|
constructor(pkg: Package);
|
|
20
|
+
get metadata(): LayoutMetadata;
|
|
21
|
+
set metadata(value: LayoutMetadata);
|
|
20
22
|
paragraphs(): OdtParagraph[];
|
|
21
23
|
tables(): OdtTable[];
|
|
22
24
|
lists(): OdtList[];
|
|
@@ -2,7 +2,7 @@ import { t as ClockPort } from "../../clock-C7SUuYN0.js";
|
|
|
2
2
|
import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-D4f705GG.js";
|
|
3
3
|
import { t as OdtList } from "../../list-C32h8MNc.js";
|
|
4
4
|
import { a as TableInit, n as OdtTable } from "../../table-BmMyqRML.js";
|
|
5
|
-
import { Box, ContentFormula, ContentVector } from "document-schema.js";
|
|
5
|
+
import { Box, ContentFormula, ContentVector, LayoutMetadata } from "document-schema.js";
|
|
6
6
|
import { Package } from "odf.js";
|
|
7
7
|
//#region src/edit/odt/editor.d.ts
|
|
8
8
|
interface OdtBody {
|
|
@@ -17,6 +17,8 @@ declare class OdtEditor {
|
|
|
17
17
|
readonly body: OdtBody;
|
|
18
18
|
private readonly pkg;
|
|
19
19
|
constructor(pkg: Package);
|
|
20
|
+
get metadata(): LayoutMetadata;
|
|
21
|
+
set metadata(value: LayoutMetadata);
|
|
20
22
|
paragraphs(): OdtParagraph[];
|
|
21
23
|
tables(): OdtTable[];
|
|
22
24
|
lists(): OdtList[];
|
package/dist/edit/odt/editor.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { patchOdfMetadataOnPackage } from "../../metadata/core-patch.js";
|
|
1
2
|
import { resolveMetadataTimestamps } from "../../model/metadata.js";
|
|
2
3
|
import { systemClock } from "../../ports/clock.js";
|
|
3
4
|
import { ensurePageBreakStyleName } from "./automatic-styles.js";
|
|
@@ -7,7 +8,7 @@ import { OdtParagraph, buildParagraph } from "./paragraph.js";
|
|
|
7
8
|
import { OdtList, buildList } from "./list.js";
|
|
8
9
|
import { createEmptyOdtPackage } from "./scaffold.js";
|
|
9
10
|
import { OdtTable, buildTable } from "./table.js";
|
|
10
|
-
import { decodePackage, encodePackage } from "odf.js";
|
|
11
|
+
import { decodePackage, encodePackage, readOdfMetadata } from "odf.js";
|
|
11
12
|
//#region src/edit/odt/editor.ts
|
|
12
13
|
const CONTENT_PART_PATH = "content.xml";
|
|
13
14
|
function findContentRoot(pkg) {
|
|
@@ -76,6 +77,12 @@ var OdtEditor = class {
|
|
|
76
77
|
const officeText = findOfficeText(findContentRoot(pkg));
|
|
77
78
|
this.body = new OdtBodyImpl(officeText, pkg);
|
|
78
79
|
}
|
|
80
|
+
get metadata() {
|
|
81
|
+
return readOdfMetadata(this.pkg);
|
|
82
|
+
}
|
|
83
|
+
set metadata(value) {
|
|
84
|
+
patchOdfMetadataOnPackage(this.pkg, value, "1.3");
|
|
85
|
+
}
|
|
79
86
|
paragraphs() {
|
|
80
87
|
const officeText = findOfficeText(findContentRoot(this.pkg));
|
|
81
88
|
const out = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
3
2
|
const require_xml_entities = require("../../xml/entities.cjs");
|
|
3
|
+
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
4
4
|
const require_layout_shared = require("../../layout/shared.cjs");
|
|
5
5
|
let document_schema_js = require("document-schema.js");
|
|
6
6
|
let odf_js = require("odf.js");
|
|
@@ -76,7 +76,7 @@ function buildHeadingStyles() {
|
|
|
76
76
|
function buildStylesXml() {
|
|
77
77
|
return require_xml_fragment.el("office:document-styles", {
|
|
78
78
|
...(0, odf_js.xmlnsAttributes)([...STYLES_NS_PREFIXES]),
|
|
79
|
-
"office:version":
|
|
79
|
+
"office:version": "1.3"
|
|
80
80
|
}, [
|
|
81
81
|
require_xml_fragment.el("office:styles", {}, buildHeadingStyles()),
|
|
82
82
|
require_xml_fragment.el("office:automatic-styles", {}, [buildPageLayout()]),
|
|
@@ -89,7 +89,7 @@ function buildStylesXml() {
|
|
|
89
89
|
function buildContentXml() {
|
|
90
90
|
return require_xml_fragment.el("office:document-content", {
|
|
91
91
|
...(0, odf_js.xmlnsAttributes)([...CONTENT_NS_PREFIXES]),
|
|
92
|
-
"office:version":
|
|
92
|
+
"office:version": "1.3"
|
|
93
93
|
}, [require_xml_fragment.el("office:automatic-styles"), require_xml_fragment.el("office:body", {}, [require_xml_fragment.el("office:text")])]);
|
|
94
94
|
}
|
|
95
95
|
function buildOfficeMeta(metadata) {
|
|
@@ -107,7 +107,7 @@ function buildOfficeMeta(metadata) {
|
|
|
107
107
|
function buildMetaXml(metadata) {
|
|
108
108
|
return require_xml_fragment.el("office:document-meta", {
|
|
109
109
|
...(0, odf_js.xmlnsAttributes)([...META_NS_PREFIXES]),
|
|
110
|
-
"office:version":
|
|
110
|
+
"office:version": "1.3"
|
|
111
111
|
}, [require_xml_fragment.el("office:meta", {}, buildOfficeMeta(metadata))]);
|
|
112
112
|
}
|
|
113
113
|
function createEmptyOdtPackage(options) {
|
|
@@ -130,4 +130,5 @@ function createEmptyOdtPackage(options) {
|
|
|
130
130
|
return pkg;
|
|
131
131
|
}
|
|
132
132
|
//#endregion
|
|
133
|
+
exports.ODF_VERSION = ODF_VERSION;
|
|
133
134
|
exports.createEmptyOdtPackage = createEmptyOdtPackage;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LayoutMetadata } from "document-schema.js";
|
|
2
2
|
import { Package } from "odf.js";
|
|
3
3
|
//#region src/edit/odt/scaffold.d.ts
|
|
4
|
+
declare const ODF_VERSION = "1.3";
|
|
4
5
|
interface CreateEmptyOdtPackageOptions {
|
|
5
6
|
readonly metadata?: LayoutMetadata;
|
|
6
7
|
}
|
|
7
8
|
declare function createEmptyOdtPackage(options?: CreateEmptyOdtPackageOptions): Package;
|
|
8
9
|
//#endregion
|
|
9
|
-
export { CreateEmptyOdtPackageOptions, createEmptyOdtPackage };
|
|
10
|
+
export { CreateEmptyOdtPackageOptions, ODF_VERSION, createEmptyOdtPackage };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LayoutMetadata } from "document-schema.js";
|
|
2
2
|
import { Package } from "odf.js";
|
|
3
3
|
//#region src/edit/odt/scaffold.d.ts
|
|
4
|
+
declare const ODF_VERSION = "1.3";
|
|
4
5
|
interface CreateEmptyOdtPackageOptions {
|
|
5
6
|
readonly metadata?: LayoutMetadata;
|
|
6
7
|
}
|
|
7
8
|
declare function createEmptyOdtPackage(options?: CreateEmptyOdtPackageOptions): Package;
|
|
8
9
|
//#endregion
|
|
9
|
-
export { CreateEmptyOdtPackageOptions, createEmptyOdtPackage };
|
|
10
|
+
export { CreateEmptyOdtPackageOptions, ODF_VERSION, createEmptyOdtPackage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { el, txt } from "../../xml/fragment.js";
|
|
2
1
|
import { encodeXmlText as encodeXmlText$1 } from "../../xml/entities.js";
|
|
2
|
+
import { el, txt } from "../../xml/fragment.js";
|
|
3
3
|
import { HEADING_STYLES } from "../../layout/shared.js";
|
|
4
4
|
import { PAGE_SIZE_LETTER } from "document-schema.js";
|
|
5
5
|
import { ODF_MEDIA_TYPES, setDocumentMediaType, syncManifest, xmlnsAttributes } from "odf.js";
|
|
@@ -75,7 +75,7 @@ function buildHeadingStyles() {
|
|
|
75
75
|
function buildStylesXml() {
|
|
76
76
|
return el("office:document-styles", {
|
|
77
77
|
...xmlnsAttributes([...STYLES_NS_PREFIXES]),
|
|
78
|
-
"office:version":
|
|
78
|
+
"office:version": "1.3"
|
|
79
79
|
}, [
|
|
80
80
|
el("office:styles", {}, buildHeadingStyles()),
|
|
81
81
|
el("office:automatic-styles", {}, [buildPageLayout()]),
|
|
@@ -88,7 +88,7 @@ function buildStylesXml() {
|
|
|
88
88
|
function buildContentXml() {
|
|
89
89
|
return el("office:document-content", {
|
|
90
90
|
...xmlnsAttributes([...CONTENT_NS_PREFIXES]),
|
|
91
|
-
"office:version":
|
|
91
|
+
"office:version": "1.3"
|
|
92
92
|
}, [el("office:automatic-styles"), el("office:body", {}, [el("office:text")])]);
|
|
93
93
|
}
|
|
94
94
|
function buildOfficeMeta(metadata) {
|
|
@@ -106,7 +106,7 @@ function buildOfficeMeta(metadata) {
|
|
|
106
106
|
function buildMetaXml(metadata) {
|
|
107
107
|
return el("office:document-meta", {
|
|
108
108
|
...xmlnsAttributes([...META_NS_PREFIXES]),
|
|
109
|
-
"office:version":
|
|
109
|
+
"office:version": "1.3"
|
|
110
110
|
}, [el("office:meta", {}, buildOfficeMeta(metadata))]);
|
|
111
111
|
}
|
|
112
112
|
function createEmptyOdtPackage(options) {
|
|
@@ -129,4 +129,4 @@ function createEmptyOdtPackage(options) {
|
|
|
129
129
|
return pkg;
|
|
130
130
|
}
|
|
131
131
|
//#endregion
|
|
132
|
-
export { createEmptyOdtPackage };
|
|
132
|
+
export { ODF_VERSION, createEmptyOdtPackage };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_model_metadata = require("../../model/metadata.cjs");
|
|
3
|
-
const require_ports_clock = require("../../ports/clock.cjs");
|
|
4
2
|
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
3
|
+
const require_opc_content_types = require("../../opc/content-types.cjs");
|
|
5
4
|
const require_opc_paths = require("../../opc/paths.cjs");
|
|
6
5
|
const require_opc_rels = require("../../opc/rels.cjs");
|
|
6
|
+
const require_metadata_core_patch = require("../../metadata/core-patch.cjs");
|
|
7
|
+
const require_model_metadata = require("../../model/metadata.cjs");
|
|
8
|
+
const require_ports_clock = require("../../ports/clock.cjs");
|
|
7
9
|
const require_model_units = require("../../model/units.cjs");
|
|
8
|
-
const require_opc_content_types = require("../../opc/content-types.cjs");
|
|
9
10
|
const require_edit_pptx_scaffold = require("./scaffold.cjs");
|
|
10
11
|
const require_edit_pptx_slide = require("./slide.cjs");
|
|
11
12
|
let ooxml_js = require("ooxml.js");
|
|
@@ -71,6 +72,12 @@ var PptxEditor = class {
|
|
|
71
72
|
constructor(pkg) {
|
|
72
73
|
this.pkg = pkg;
|
|
73
74
|
}
|
|
75
|
+
get metadata() {
|
|
76
|
+
return (0, ooxml_js.readCoreProperties)(this.pkg);
|
|
77
|
+
}
|
|
78
|
+
set metadata(value) {
|
|
79
|
+
require_metadata_core_patch.patchOoxmlCorePropertiesOnPackage(this.pkg, value);
|
|
80
|
+
}
|
|
74
81
|
slides() {
|
|
75
82
|
const sldIdLst = findSldIdLst(findPresentationRoot(this.pkg));
|
|
76
83
|
const presentationRels = (0, ooxml_js.resolveRelationships)(this.pkg, PRESENTATION_PART_PATH);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { t as ClockPort } from "../../clock-C7SUuYN0.cjs";
|
|
2
2
|
import { PptxSlide } from "./slide.cjs";
|
|
3
|
-
import { PageSize } from "document-schema.js";
|
|
3
|
+
import { LayoutMetadata, PageSize } from "document-schema.js";
|
|
4
4
|
import { Package } from "ooxml.js";
|
|
5
5
|
//#region src/edit/pptx/editor.d.ts
|
|
6
6
|
declare class PptxEditor {
|
|
7
7
|
private readonly pkg;
|
|
8
8
|
constructor(pkg: Package);
|
|
9
|
+
get metadata(): LayoutMetadata;
|
|
10
|
+
set metadata(value: LayoutMetadata);
|
|
9
11
|
slides(): PptxSlide[];
|
|
10
12
|
addSlide(): PptxSlide;
|
|
11
13
|
removeSlideAt(index: number): void;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { t as ClockPort } from "../../clock-C7SUuYN0.js";
|
|
2
2
|
import { PptxSlide } from "./slide.js";
|
|
3
3
|
import { Package } from "ooxml.js";
|
|
4
|
-
import { PageSize } from "document-schema.js";
|
|
4
|
+
import { LayoutMetadata, PageSize } from "document-schema.js";
|
|
5
5
|
//#region src/edit/pptx/editor.d.ts
|
|
6
6
|
declare class PptxEditor {
|
|
7
7
|
private readonly pkg;
|
|
8
8
|
constructor(pkg: Package);
|
|
9
|
+
get metadata(): LayoutMetadata;
|
|
10
|
+
set metadata(value: LayoutMetadata);
|
|
9
11
|
slides(): PptxSlide[];
|
|
10
12
|
addSlide(): PptxSlide;
|
|
11
13
|
removeSlideAt(index: number): void;
|
package/dist/edit/pptx/editor.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { resolveMetadataTimestamps } from "../../model/metadata.js";
|
|
2
|
-
import { systemClock } from "../../ports/clock.js";
|
|
3
1
|
import { el } from "../../xml/fragment.js";
|
|
2
|
+
import { ensureContentTypeOverride } from "../../opc/content-types.js";
|
|
4
3
|
import { buildRelativeTarget } from "../../opc/paths.js";
|
|
5
4
|
import { addRelationship } from "../../opc/rels.js";
|
|
5
|
+
import { patchOoxmlCorePropertiesOnPackage } from "../../metadata/core-patch.js";
|
|
6
|
+
import { resolveMetadataTimestamps } from "../../model/metadata.js";
|
|
7
|
+
import { systemClock } from "../../ports/clock.js";
|
|
6
8
|
import { emuToPt, ptToEmu } from "../../model/units.js";
|
|
7
|
-
import { ensureContentTypeOverride } from "../../opc/content-types.js";
|
|
8
9
|
import { DML_NS, PML_NS, R_NS, SLIDE_LAYOUT_PART_PATH, SLIDE_LAYOUT_REL_TYPE, buildEmptyGroupSpTree, createEmptyPptxPackage } from "./scaffold.js";
|
|
9
10
|
import { PptxSlide } from "./slide.js";
|
|
10
|
-
import { decodePackage, encodePackage, resolveRelationships, rootElement } from "ooxml.js";
|
|
11
|
+
import { decodePackage, encodePackage, readCoreProperties, resolveRelationships, rootElement } from "ooxml.js";
|
|
11
12
|
//#region src/edit/pptx/editor.ts
|
|
12
13
|
const PRESENTATION_PART_PATH = "ppt/presentation.xml";
|
|
13
14
|
const MEDIA_DIR = "ppt/media";
|
|
@@ -70,6 +71,12 @@ var PptxEditor = class {
|
|
|
70
71
|
constructor(pkg) {
|
|
71
72
|
this.pkg = pkg;
|
|
72
73
|
}
|
|
74
|
+
get metadata() {
|
|
75
|
+
return readCoreProperties(this.pkg);
|
|
76
|
+
}
|
|
77
|
+
set metadata(value) {
|
|
78
|
+
patchOoxmlCorePropertiesOnPackage(this.pkg, value);
|
|
79
|
+
}
|
|
73
80
|
slides() {
|
|
74
81
|
const sldIdLst = findSldIdLst(findPresentationRoot(this.pkg));
|
|
75
82
|
const presentationRels = resolveRelationships(this.pkg, PRESENTATION_PART_PATH);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
3
|
+
const require_opc_content_types = require("../../opc/content-types.cjs");
|
|
3
4
|
const require_opc_paths = require("../../opc/paths.cjs");
|
|
4
5
|
const require_opc_rels = require("../../opc/rels.cjs");
|
|
5
|
-
const require_opc_content_types = require("../../opc/content-types.cjs");
|
|
6
6
|
const require_opc_core_properties = require("../../opc/core-properties.cjs");
|
|
7
7
|
//#region src/edit/pptx/scaffold.ts
|
|
8
8
|
const CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { el } from "../../xml/fragment.js";
|
|
2
|
+
import { ensureContentTypeOverride } from "../../opc/content-types.js";
|
|
2
3
|
import { buildRelativeTarget } from "../../opc/paths.js";
|
|
3
4
|
import { addRelationship } from "../../opc/rels.js";
|
|
4
|
-
import { ensureContentTypeOverride } from "../../opc/content-types.js";
|
|
5
5
|
import { addCoreProperties } from "../../opc/core-properties.js";
|
|
6
6
|
//#region src/edit/pptx/scaffold.ts
|
|
7
7
|
const CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types";
|
package/dist/edit/pptx/shape.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
3
2
|
const require_xml_entities = require("../../xml/entities.cjs");
|
|
3
|
+
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
4
4
|
const require_omml_write = require("../../omml/write.cjs");
|
|
5
5
|
const require_model_units = require("../../model/units.cjs");
|
|
6
6
|
const require_xml_edit = require("../../xml/edit.cjs");
|
package/dist/edit/pptx/shape.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { el, txt } from "../../xml/fragment.js";
|
|
2
1
|
import { encodeXmlText, needsSpacePreserve } from "../../xml/entities.js";
|
|
2
|
+
import { el, txt } from "../../xml/fragment.js";
|
|
3
3
|
import { buildOfficeMathParagraph } from "../../omml/write.js";
|
|
4
4
|
import { emuToPt, ptToEmu } from "../../model/units.js";
|
|
5
5
|
import { removeAttr, removeChild, setAttr } from "../../xml/edit.js";
|
package/dist/edit/pptx/slide.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_xml_entities = require("../../xml/entities.cjs");
|
|
2
3
|
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
4
|
+
const require_opc_content_types = require("../../opc/content-types.cjs");
|
|
3
5
|
const require_opc_paths = require("../../opc/paths.cjs");
|
|
4
6
|
const require_opc_rels = require("../../opc/rels.cjs");
|
|
5
|
-
const require_xml_entities = require("../../xml/entities.cjs");
|
|
6
7
|
const require_xml_edit = require("../../xml/edit.cjs");
|
|
7
|
-
const require_opc_content_types = require("../../opc/content-types.cjs");
|
|
8
8
|
const require_edit_pptx_scaffold = require("./scaffold.cjs");
|
|
9
9
|
const require_edit_pptx_shape = require("./shape.cjs");
|
|
10
10
|
const require_edit_pptx_image = require("./image.cjs");
|
package/dist/edit/pptx/slide.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { encodeXmlText } from "../../xml/entities.js";
|
|
1
2
|
import { el, txt } from "../../xml/fragment.js";
|
|
3
|
+
import { ensureContentTypeOverride } from "../../opc/content-types.js";
|
|
2
4
|
import { buildRelativeTarget } from "../../opc/paths.js";
|
|
3
5
|
import { addRelationship } from "../../opc/rels.js";
|
|
4
|
-
import { encodeXmlText } from "../../xml/entities.js";
|
|
5
6
|
import { removeChild } from "../../xml/edit.js";
|
|
6
|
-
import { ensureContentTypeOverride } from "../../opc/content-types.js";
|
|
7
7
|
import { DML_NS, NOTES_MASTER_REL_TYPE, PML_NS, buildEmptyGroupSpTree, ensureNotesMaster } from "./scaffold.js";
|
|
8
8
|
import { PptxShape, buildTextBoxShape } from "./shape.js";
|
|
9
9
|
import { insertPictureShapeMedia } from "./image.js";
|
package/dist/index.cjs
CHANGED
|
@@ -57,6 +57,7 @@ const require_fonts_registry = require("./fonts/registry.cjs");
|
|
|
57
57
|
const require_omml_read = require("./omml/read.cjs");
|
|
58
58
|
const require_latex_diagnostics = require("./latex/diagnostics.cjs");
|
|
59
59
|
const require_latex_lint = require("./latex/lint.cjs");
|
|
60
|
+
const require_ppt_read = require("./ppt/read.cjs");
|
|
60
61
|
const require_ooxml_docx_read = require("./ooxml/docx/read.cjs");
|
|
61
62
|
const require_ooxml_docx_extras = require("./ooxml/docx/extras.cjs");
|
|
62
63
|
const require_ooxml_pptx_read = require("./ooxml/pptx/read.cjs");
|
|
@@ -75,7 +76,6 @@ const require_svg_text = require("./svg/text.cjs");
|
|
|
75
76
|
const require_svg_read = require("./svg/read.cjs");
|
|
76
77
|
const require_svg_write = require("./svg/write.cjs");
|
|
77
78
|
const require_svg_diagnostics = require("./svg/diagnostics.cjs");
|
|
78
|
-
const require_ppt_read = require("./ppt/read.cjs");
|
|
79
79
|
const require_ppt_write = require("./ppt/write.cjs");
|
|
80
80
|
const require_markdown_render = require("./markdown/render.cjs");
|
|
81
81
|
const require_layout_engine = require("./layout/engine.cjs");
|
package/dist/index.d.cts
CHANGED
|
@@ -125,7 +125,8 @@ import { OdbReportContentOptions, OdbReportNotSpecifiedError, readOdbReportConte
|
|
|
125
125
|
import { renderOdbReportContent } from "./odb/report/render.cjs";
|
|
126
126
|
import { OdbReportDataSourceError, odbReportCommandSql, resolveOdbReportRows } from "./odb/report/source.cjs";
|
|
127
127
|
import { UnsupportedPackageFormatError, decodeDocumentPackage, decodeOdbPackage, encodeDocumentPackage } from "./package-codec.cjs";
|
|
128
|
-
import { MetadataOverrides
|
|
128
|
+
import { MetadataOverrides } from "./metadata/core-patch.cjs";
|
|
129
|
+
import { PatchDocxMetadataOptions, SetDocumentMetadataOptions, patchDocxMetadata, setDocumentMetadata } from "./metadata/write.cjs";
|
|
129
130
|
import { throwIfAborted } from "./ports/abort.cjs";
|
|
130
131
|
import { Alignment, Box, COLOR_BLACK, CellPosition, CellRange, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellFill, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentJson, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DocumentJsonResult, DocumentSchemaKind, DocumentTree, DocumentTreeJson, DocumentTreeSchema, FontFace, LayoutFont, LayoutMetadata, Margins, MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PositionedFormula, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, cellReference, columnIndexToLetters, columnLettersToIndex, contentDocumentWithSchema, documentFromJson, documentSchemaKindOf, documentTreeWithSchema, isContentBlock, parseCellReference, parseRangeReference, rangeReference, rgbHexToColor, schemaUriFor } from "document-schema.js";
|
|
131
132
|
import { FontFaceParseError, FontRegistry, FontRegistryOptions, FontSubstitution, LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutImage, LayoutImageAsset, LayoutItem, LayoutLine, LayoutLink, LayoutPage, LayoutPath, LayoutPathSegment, LayoutRect, LayoutSubpath, LayoutText, LoadedMathFont, MathFont, MathFontDescriptorMetrics, NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, ProvidedFont, ReadPdfOptions, ResolvedFace, WinAnsiSubstitution, WritePdfOptions, createFontMeasurer, createFontRegistry, createStandardFontMeasurer, loadMathFont, pdfCodec, readFontFace as describeFontFace, readPdf, writePdf } from "pdf-codec";
|
package/dist/index.d.ts
CHANGED
|
@@ -125,7 +125,8 @@ import { OdbReportContentOptions, OdbReportNotSpecifiedError, readOdbReportConte
|
|
|
125
125
|
import { renderOdbReportContent } from "./odb/report/render.js";
|
|
126
126
|
import { OdbReportDataSourceError, odbReportCommandSql, resolveOdbReportRows } from "./odb/report/source.js";
|
|
127
127
|
import { UnsupportedPackageFormatError, decodeDocumentPackage, decodeOdbPackage, encodeDocumentPackage } from "./package-codec.js";
|
|
128
|
-
import { MetadataOverrides
|
|
128
|
+
import { MetadataOverrides } from "./metadata/core-patch.js";
|
|
129
|
+
import { PatchDocxMetadataOptions, SetDocumentMetadataOptions, patchDocxMetadata, setDocumentMetadata } from "./metadata/write.js";
|
|
129
130
|
import { throwIfAborted } from "./ports/abort.js";
|
|
130
131
|
import { Attribute, AttributeSchema, BinaryPart, BinaryPartSchema, Comment, CommentSchema, CompactAttrPairs, CompactPackage, CompactPackageSchema, CompactPart, CompactPartSchema, CompactXmlNode, CompactXmlNodeSchema, DefinedName, DefinedNameSchema, Footnote, FootnoteSchema, HeaderFooterPart, HeaderFooterPartSchema, NumberingDefinition, NumberingDefinitionSchema, NumberingDefinitions, NumberingLevel, NumberingLevelSchema, Package, PackageSchema, Part, PartSchema, Relationship, SectionHeaderFooterReferences, SectionHeaderFooterReferencesSchema, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, attr, base64ToBytes, buildXlsxPackageFromContent as buildXlsxPackage, buildXml, bytesToBase64, childrenWithTag, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, elementsWithTag, encodeCompactPackage, encodePackage, fromCompact, isCompactXmlNode, isXmlNode, packageCodec, parsePackage, parseXml, readXlsxContent, resolveRelationships, rootElement, serializePackage, textContent as textContent$1, toCompact, unzipPackage, walk, xmlCodec, zipPackage } from "ooxml.js";
|
|
131
132
|
import { Alignment, Box, COLOR_BLACK, CellPosition, CellRange, Color as LayoutColor, ContentBlock, ContentBlockSchema, ContentCellFill, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentJson, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DocumentJsonResult, DocumentSchemaKind, DocumentTree, DocumentTreeJson, DocumentTreeSchema, FontFace, LayoutFont, LayoutMetadata, Margins, MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PositionedFormula, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, cellReference, columnIndexToLetters, columnLettersToIndex, contentDocumentWithSchema, documentFromJson, documentSchemaKindOf, documentTreeWithSchema, isContentBlock, parseCellReference, parseRangeReference, rangeReference, rgbHexToColor, schemaUriFor } from "document-schema.js";
|
package/dist/index.js
CHANGED
|
@@ -56,6 +56,7 @@ import { createDocumentFontRegistry, extractSourceFonts } from "./fonts/registry
|
|
|
56
56
|
import { collectOfficeMathElements, readOfficeMath } from "./omml/read.js";
|
|
57
57
|
import { LATEX_DIAGNOSTIC_CODES, MATH_LINT_CODES } from "./latex/diagnostics.js";
|
|
58
58
|
import { lintMathCoherence } from "./latex/lint.js";
|
|
59
|
+
import { readPptContent } from "./ppt/read.js";
|
|
59
60
|
import { readDocxContent } from "./ooxml/docx/read.js";
|
|
60
61
|
import { readDocxExtras } from "./ooxml/docx/extras.js";
|
|
61
62
|
import { readPptxContent } from "./ooxml/pptx/read.js";
|
|
@@ -74,7 +75,6 @@ import { SvgInvalidUtf8Error, decodeSvgText, encodeSvgText } from "./svg/text.js
|
|
|
74
75
|
import { SvgMissingRootElementError, readSvgContent } from "./svg/read.js";
|
|
75
76
|
import { SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, SvgUnsupportedDocumentKindError, buildSvgText } from "./svg/write.js";
|
|
76
77
|
import { SVG_DIAGNOSTIC_CODES } from "./svg/diagnostics.js";
|
|
77
|
-
import { readPptContent } from "./ppt/read.js";
|
|
78
78
|
import { writePptContent } from "./ppt/write.js";
|
|
79
79
|
import { MarkdownRenderDiagnosticCodes, renderContentDocumentToMarkdown } from "./markdown/render.js";
|
|
80
80
|
import { convertWordprocessingToLayout } from "./layout/engine.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_opc_core_properties = require("../opc/core-properties.cjs");
|
|
3
|
+
let ooxml_js = require("ooxml.js");
|
|
4
|
+
let odf_js = require("odf.js");
|
|
5
|
+
//#region src/metadata/core-patch.ts
|
|
6
|
+
function mergeMetadata(current, overrides) {
|
|
7
|
+
return {
|
|
8
|
+
...current,
|
|
9
|
+
...overrides.title !== void 0 ? { title: overrides.title } : {},
|
|
10
|
+
...overrides.author !== void 0 ? { author: overrides.author } : {},
|
|
11
|
+
...overrides.subject !== void 0 ? { subject: overrides.subject } : {},
|
|
12
|
+
...overrides.keywords !== void 0 ? { keywords: overrides.keywords } : {}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function hasWritableMetadataOverride(overrides) {
|
|
16
|
+
return overrides.title !== void 0 || overrides.author !== void 0 || overrides.subject !== void 0 || overrides.keywords !== void 0 && overrides.keywords.length > 0;
|
|
17
|
+
}
|
|
18
|
+
function patchOoxmlCorePropertiesOnPackage(pkg, overrides) {
|
|
19
|
+
if ((0, ooxml_js.hasCoreProperties)(pkg)) (0, ooxml_js.patchCoreProperties)(pkg, overrides);
|
|
20
|
+
else if (hasWritableMetadataOverride(overrides)) require_opc_core_properties.addCoreProperties(pkg, mergeMetadata({}, overrides));
|
|
21
|
+
}
|
|
22
|
+
function patchOdfMetadataOnPackage(pkg, overrides, version) {
|
|
23
|
+
if ((0, odf_js.hasOdfMetadata)(pkg)) (0, odf_js.patchOdfMetadata)(pkg, overrides);
|
|
24
|
+
else if (hasWritableMetadataOverride(overrides)) (0, odf_js.writeOdfMetadata)(pkg, mergeMetadata({}, overrides), version);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.mergeMetadata = mergeMetadata;
|
|
28
|
+
exports.patchOdfMetadataOnPackage = patchOdfMetadataOnPackage;
|
|
29
|
+
exports.patchOoxmlCorePropertiesOnPackage = patchOoxmlCorePropertiesOnPackage;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LayoutMetadata } from "document-schema.js";
|
|
2
|
+
import { Package } from "ooxml.js";
|
|
3
|
+
import { Package as Package$1 } from "odf.js";
|
|
4
|
+
//#region src/metadata/core-patch.d.ts
|
|
5
|
+
interface MetadataOverrides {
|
|
6
|
+
readonly title?: string;
|
|
7
|
+
readonly author?: string;
|
|
8
|
+
readonly subject?: string;
|
|
9
|
+
readonly keywords?: string[];
|
|
10
|
+
}
|
|
11
|
+
declare function mergeMetadata(current: LayoutMetadata, overrides: MetadataOverrides): LayoutMetadata;
|
|
12
|
+
declare function patchOoxmlCorePropertiesOnPackage(pkg: Package, overrides: MetadataOverrides): void;
|
|
13
|
+
declare function patchOdfMetadataOnPackage(pkg: Package$1, overrides: MetadataOverrides, version: string): void;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MetadataOverrides, mergeMetadata, patchOdfMetadataOnPackage, patchOoxmlCorePropertiesOnPackage };
|