js.documents 6.5.1 → 6.5.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/dist/edit/docx/content.cjs +13 -8
- package/dist/edit/docx/content.js +13 -8
- package/dist/edit/docx/image.cjs +4 -0
- package/dist/edit/docx/image.d.cts +2 -2
- package/dist/edit/docx/image.d.ts +2 -2
- package/dist/edit/docx/image.js +4 -1
- package/dist/edit/docx/paragraph.d.cts +1 -1
- package/dist/edit/docx/paragraph.d.ts +1 -1
- package/dist/edit/odg/page.d.cts +2 -2
- package/dist/edit/odg/page.d.ts +2 -2
- package/dist/edit/odp/image.d.cts +1 -1
- package/dist/edit/odp/image.d.ts +1 -1
- package/dist/edit/odp/shape.d.cts +1 -1
- package/dist/edit/odp/shape.d.ts +1 -1
- package/dist/edit/odp/slide.d.cts +3 -3
- package/dist/edit/odp/slide.d.ts +3 -3
- package/dist/edit/odt/content.d.cts +2 -2
- package/dist/edit/odt/content.d.ts +2 -2
- package/dist/edit/odt/editor.d.cts +3 -3
- package/dist/edit/odt/editor.d.ts +3 -3
- package/dist/edit/odt/image.d.cts +1 -1
- package/dist/edit/odt/image.d.ts +1 -1
- package/dist/edit/odt/list.d.cts +1 -1
- package/dist/edit/odt/list.d.ts +1 -1
- package/dist/edit/odt/paragraph.d.cts +1 -1
- package/dist/edit/odt/paragraph.d.ts +1 -1
- package/dist/edit/odt/table.d.cts +1 -1
- package/dist/edit/odt/table.d.ts +1 -1
- package/dist/edit/pptx/content.cjs +1 -0
- package/dist/edit/pptx/content.js +1 -0
- package/dist/edit/pptx/image.d.cts +1 -1
- package/dist/edit/pptx/image.d.ts +1 -1
- package/dist/edit/pptx/slide.d.cts +1 -1
- package/dist/edit/pptx/slide.d.ts +1 -1
- package/dist/{image-DQxA-zGN.d.ts → image-BqMIKksf.d.cts} +1 -1
- package/dist/{image-DQxA-zGN.d.cts → image-BqMIKksf.d.ts} +1 -1
- package/dist/{image-fah3VkZg.d.cts → image-C3L2cCLQ.d.cts} +1 -1
- package/dist/{image-CwbCQ49u.d.ts → image-CAeD6ZbR.d.ts} +1 -1
- package/dist/{image-BQ7F9xxz.d.cts → image-CRzkqiWd.d.cts} +3 -2
- package/dist/{image-BQ7F9xxz.d.ts → image-CRzkqiWd.d.ts} +3 -2
- package/dist/{image-DzqEWMDw.d.ts → image-D1z0T9Za.d.cts} +1 -1
- package/dist/{image-DzqEWMDw.d.cts → image-D1z0T9Za.d.ts} +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/layout/shared.cjs +1 -0
- package/dist/layout/shared.js +1 -0
- package/dist/{list-B_Sy668f.d.ts → list-C32h8MNc.d.ts} +1 -1
- package/dist/{list-BiTN6oop.d.cts → list-yc0dJrOX.d.cts} +1 -1
- package/dist/odf-package/media.d.cts +1 -1
- package/dist/odf-package/media.d.ts +1 -1
- package/dist/opc/content-types.cjs +2 -1
- package/dist/opc/content-types.js +2 -1
- package/dist/opc/media.cjs +2 -3
- package/dist/opc/media.d.cts +1 -1
- package/dist/opc/media.d.ts +1 -1
- package/dist/opc/media.js +2 -3
- package/dist/{paragraph-BBmkECjw.d.cts → paragraph-CRaLSzWz.d.cts} +1 -1
- package/dist/{paragraph-D_fDin5K.d.ts → paragraph-D4f705GG.d.ts} +1 -1
- package/dist/{shape-CQa4zif9.d.cts → shape-CAm2tKw5.d.cts} +2 -2
- package/dist/{shape-B_vI18gH.d.ts → shape-DAt3nOQm.d.ts} +2 -2
- package/dist/{table-CpEmblWG.d.cts → table-CnRh10dW.d.cts} +1 -1
- package/dist/{table-Ck0fyr8d.d.ts → table-DCqmpGAB.d.ts} +1 -1
- package/package.json +13 -13
|
@@ -4,6 +4,7 @@ const require_ports_clock = require("../../ports/clock.cjs");
|
|
|
4
4
|
const require_opc_rels = require("../../opc/rels.cjs");
|
|
5
5
|
const require_model_units = require("../../model/units.cjs");
|
|
6
6
|
const require_opc_content_types = require("../../opc/content-types.cjs");
|
|
7
|
+
const require_edit_docx_image = require("./image.cjs");
|
|
7
8
|
const require_edit_docx_scaffold = require("./scaffold.cjs");
|
|
8
9
|
const require_edit_docx_editor = require("./editor.cjs");
|
|
9
10
|
const require_model_embedded_drawing = require("../../model/embedded-drawing.cjs");
|
|
@@ -105,6 +106,7 @@ function appendBlocks(body, blocks, options) {
|
|
|
105
106
|
paragraph.styleId = block.styleId;
|
|
106
107
|
paragraph.alignment = block.alignment;
|
|
107
108
|
paragraph.list = block.list;
|
|
109
|
+
require_edit_docx_image.assertDocxWritableImageFormat(next.format);
|
|
108
110
|
paragraph.insertImageAfter({
|
|
109
111
|
format: next.format,
|
|
110
112
|
bytes: (0, ooxml_js.base64ToBytes)(next.base64),
|
|
@@ -201,14 +203,17 @@ function appendCellBlock(cell, block) {
|
|
|
201
203
|
}
|
|
202
204
|
function appendBlock(body, block, options) {
|
|
203
205
|
if (block.kind === "paragraph") populateParagraph(body.appendParagraph(), block);
|
|
204
|
-
else if (block.kind === "image")
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
206
|
+
else if (block.kind === "image") {
|
|
207
|
+
const paragraph = body.appendParagraph();
|
|
208
|
+
require_edit_docx_image.assertDocxWritableImageFormat(block.format);
|
|
209
|
+
paragraph.insertImageAfter({
|
|
210
|
+
format: block.format,
|
|
211
|
+
bytes: (0, ooxml_js.base64ToBytes)(block.base64),
|
|
212
|
+
widthPt: block.widthPt,
|
|
213
|
+
heightPt: block.heightPt,
|
|
214
|
+
altText: block.altText
|
|
215
|
+
});
|
|
216
|
+
} else if (block.kind === "pageBreak") body.appendPageBreak();
|
|
212
217
|
else if (block.kind === "table") appendTable(body, block);
|
|
213
218
|
else if (block.kind === "embeddedObject") appendEmbeddedObject(body, block, options);
|
|
214
219
|
}
|
|
@@ -3,6 +3,7 @@ import { systemClock } from "../../ports/clock.js";
|
|
|
3
3
|
import { addRelationship } from "../../opc/rels.js";
|
|
4
4
|
import { ptToTwips } from "../../model/units.js";
|
|
5
5
|
import { ensureContentTypeOverride } from "../../opc/content-types.js";
|
|
6
|
+
import { assertDocxWritableImageFormat } from "./image.js";
|
|
6
7
|
import { createEmptyDocxPackage } from "./scaffold.js";
|
|
7
8
|
import { DocxEditor } from "./editor.js";
|
|
8
9
|
import { FLOW_CONTAINER_ORIGIN, drawingOfBlock, embeddedDrawingVectors } from "../../model/embedded-drawing.js";
|
|
@@ -104,6 +105,7 @@ function appendBlocks(body, blocks, options) {
|
|
|
104
105
|
paragraph.styleId = block.styleId;
|
|
105
106
|
paragraph.alignment = block.alignment;
|
|
106
107
|
paragraph.list = block.list;
|
|
108
|
+
assertDocxWritableImageFormat(next.format);
|
|
107
109
|
paragraph.insertImageAfter({
|
|
108
110
|
format: next.format,
|
|
109
111
|
bytes: base64ToBytes(next.base64),
|
|
@@ -200,14 +202,17 @@ function appendCellBlock(cell, block) {
|
|
|
200
202
|
}
|
|
201
203
|
function appendBlock(body, block, options) {
|
|
202
204
|
if (block.kind === "paragraph") populateParagraph(body.appendParagraph(), block);
|
|
203
|
-
else if (block.kind === "image")
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
205
|
+
else if (block.kind === "image") {
|
|
206
|
+
const paragraph = body.appendParagraph();
|
|
207
|
+
assertDocxWritableImageFormat(block.format);
|
|
208
|
+
paragraph.insertImageAfter({
|
|
209
|
+
format: block.format,
|
|
210
|
+
bytes: base64ToBytes(block.base64),
|
|
211
|
+
widthPt: block.widthPt,
|
|
212
|
+
heightPt: block.heightPt,
|
|
213
|
+
altText: block.altText
|
|
214
|
+
});
|
|
215
|
+
} else if (block.kind === "pageBreak") body.appendPageBreak();
|
|
211
216
|
else if (block.kind === "table") appendTable(body, block);
|
|
212
217
|
else if (block.kind === "embeddedObject") appendEmbeddedObject(body, block, options);
|
|
213
218
|
}
|
package/dist/edit/docx/image.cjs
CHANGED
|
@@ -3,6 +3,9 @@ const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
|
3
3
|
const require_model_units = require("../../model/units.cjs");
|
|
4
4
|
const require_opc_media = require("../../opc/media.cjs");
|
|
5
5
|
//#region src/edit/docx/image.ts
|
|
6
|
+
function assertDocxWritableImageFormat(format) {
|
|
7
|
+
if (format === "svg") throw new Error("buildDocxPackage: an image block in svg format has no OOXML blip this writer can produce (WordprocessingML's a:blip only references a raster part Word decodes directly -- png/jpeg/gif)");
|
|
8
|
+
}
|
|
6
9
|
const DRAWING_NS = {
|
|
7
10
|
wp: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",
|
|
8
11
|
a: "http://schemas.openxmlformats.org/drawingml/2006/main",
|
|
@@ -70,6 +73,7 @@ function insertImageMedia(context, documentRoot, image) {
|
|
|
70
73
|
return buildInlineDrawing(relationshipId, image.widthPt, image.heightPt, id, image.altText);
|
|
71
74
|
}
|
|
72
75
|
//#endregion
|
|
76
|
+
exports.assertDocxWritableImageFormat = assertDocxWritableImageFormat;
|
|
73
77
|
exports.buildInlineDrawing = buildInlineDrawing;
|
|
74
78
|
exports.insertImageMedia = insertImageMedia;
|
|
75
79
|
exports.nextDrawingId = nextDrawingId;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { ImageInit, MediaContext, buildInlineDrawing, insertImageMedia, nextDrawingId };
|
|
1
|
+
import { a as insertImageMedia, i as buildInlineDrawing, n as MediaContext, o as nextDrawingId, r as assertDocxWritableImageFormat, t as ImageInit } from "../../image-CRzkqiWd.cjs";
|
|
2
|
+
export { ImageInit, MediaContext, assertDocxWritableImageFormat, buildInlineDrawing, insertImageMedia, nextDrawingId };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { ImageInit, MediaContext, buildInlineDrawing, insertImageMedia, nextDrawingId };
|
|
1
|
+
import { a as insertImageMedia, i as buildInlineDrawing, n as MediaContext, o as nextDrawingId, r as assertDocxWritableImageFormat, t as ImageInit } from "../../image-CRzkqiWd.js";
|
|
2
|
+
export { ImageInit, MediaContext, assertDocxWritableImageFormat, buildInlineDrawing, insertImageMedia, nextDrawingId };
|
package/dist/edit/docx/image.js
CHANGED
|
@@ -2,6 +2,9 @@ import { el } from "../../xml/fragment.js";
|
|
|
2
2
|
import { ptToEmu } from "../../model/units.js";
|
|
3
3
|
import { addImageMedia } from "../../opc/media.js";
|
|
4
4
|
//#region src/edit/docx/image.ts
|
|
5
|
+
function assertDocxWritableImageFormat(format) {
|
|
6
|
+
if (format === "svg") throw new Error("buildDocxPackage: an image block in svg format has no OOXML blip this writer can produce (WordprocessingML's a:blip only references a raster part Word decodes directly -- png/jpeg/gif)");
|
|
7
|
+
}
|
|
5
8
|
const DRAWING_NS = {
|
|
6
9
|
wp: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",
|
|
7
10
|
a: "http://schemas.openxmlformats.org/drawingml/2006/main",
|
|
@@ -69,4 +72,4 @@ function insertImageMedia(context, documentRoot, image) {
|
|
|
69
72
|
return buildInlineDrawing(relationshipId, image.widthPt, image.heightPt, id, image.altText);
|
|
70
73
|
}
|
|
71
74
|
//#endregion
|
|
72
|
-
export { buildInlineDrawing, insertImageMedia, nextDrawingId };
|
|
75
|
+
export { assertDocxWritableImageFormat, buildInlineDrawing, insertImageMedia, nextDrawingId };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as MathMlNode$1 } from "../../nodes-jrlUmrNs.cjs";
|
|
2
2
|
import { t as OmmlWriteResult } from "../../write-DWupt1QI.cjs";
|
|
3
|
-
import { n as MediaContext, t as ImageInit } from "../../image-
|
|
3
|
+
import { n as MediaContext, t as ImageInit } from "../../image-CRzkqiWd.cjs";
|
|
4
4
|
import { n as RunInit, t as DocxRun } from "../../run-swnb_wQO.cjs";
|
|
5
5
|
import { ContentListMembership, ContentVector } from "document-schema.js";
|
|
6
6
|
import { Package, XmlElement, XmlNode } from "ooxml.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as MathMlNode$1 } from "../../nodes-jrlUmrNs.js";
|
|
2
2
|
import { t as OmmlWriteResult } from "../../write-qKlz1R0J.js";
|
|
3
|
-
import { n as MediaContext, t as ImageInit } from "../../image-
|
|
3
|
+
import { n as MediaContext, t as ImageInit } from "../../image-CRzkqiWd.js";
|
|
4
4
|
import { n as RunInit, t as DocxRun } from "../../run-Bv6gpAMj.js";
|
|
5
5
|
import { Package, XmlElement, XmlNode } from "ooxml.js";
|
|
6
6
|
import { ContentListMembership, ContentVector } from "document-schema.js";
|
package/dist/edit/odg/page.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ImageInit } from "../../image-
|
|
2
|
-
import { t as OdpShape } from "../../shape-
|
|
1
|
+
import { t as ImageInit } from "../../image-D1z0T9Za.cjs";
|
|
2
|
+
import { t as OdpShape } from "../../shape-CAm2tKw5.cjs";
|
|
3
3
|
import { a as OdgLineVector, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "../../vector-DDP7hgvm.cjs";
|
|
4
4
|
import { Box, ContentVector } from "document-schema.js";
|
|
5
5
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
package/dist/edit/odg/page.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ImageInit } from "../../image-
|
|
2
|
-
import { t as OdpShape } from "../../shape-
|
|
1
|
+
import { t as ImageInit } from "../../image-D1z0T9Za.js";
|
|
2
|
+
import { t as OdpShape } from "../../shape-DAt3nOQm.js";
|
|
3
3
|
import { a as OdgLineVector, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "../../vector-DDP7hgvm.js";
|
|
4
4
|
import { Box, ContentVector } from "document-schema.js";
|
|
5
5
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MediaContext, r as insertImageFrameMedia, t as ImageInit } from "../../image-
|
|
1
|
+
import { n as MediaContext, r as insertImageFrameMedia, t as ImageInit } from "../../image-D1z0T9Za.cjs";
|
|
2
2
|
export { ImageInit, MediaContext, insertImageFrameMedia };
|
package/dist/edit/odp/image.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MediaContext, r as insertImageFrameMedia, t as ImageInit } from "../../image-
|
|
1
|
+
import { n as MediaContext, r as insertImageFrameMedia, t as ImageInit } from "../../image-D1z0T9Za.js";
|
|
2
2
|
export { ImageInit, MediaContext, insertImageFrameMedia };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-
|
|
1
|
+
import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-CAm2tKw5.cjs";
|
|
2
2
|
export { OdpShape, buildImageFrame, buildTableFrame, buildTextBoxFrame };
|
package/dist/edit/odp/shape.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-
|
|
1
|
+
import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-DAt3nOQm.js";
|
|
2
2
|
export { OdpShape, buildImageFrame, buildTableFrame, buildTextBoxFrame };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as ImageInit } from "../../image-
|
|
2
|
-
import { t as OdpShape } from "../../shape-
|
|
1
|
+
import { t as ImageInit } from "../../image-D1z0T9Za.cjs";
|
|
2
|
+
import { t as OdpShape } from "../../shape-CAm2tKw5.cjs";
|
|
3
3
|
import { s as OdgVector } from "../../vector-DDP7hgvm.cjs";
|
|
4
|
-
import { a as TableInit, n as OdtTable } from "../../table-
|
|
4
|
+
import { a as TableInit, n as OdtTable } from "../../table-CnRh10dW.cjs";
|
|
5
5
|
import { Box, ContentFormula, ContentVector } from "document-schema.js";
|
|
6
6
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
7
7
|
//#region src/edit/odp/slide.d.ts
|
package/dist/edit/odp/slide.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as ImageInit } from "../../image-
|
|
2
|
-
import { t as OdpShape } from "../../shape-
|
|
1
|
+
import { t as ImageInit } from "../../image-D1z0T9Za.js";
|
|
2
|
+
import { t as OdpShape } from "../../shape-DAt3nOQm.js";
|
|
3
3
|
import { s as OdgVector } from "../../vector-DDP7hgvm.js";
|
|
4
|
-
import { a as TableInit, n as OdtTable } from "../../table-
|
|
4
|
+
import { a as TableInit, n as OdtTable } from "../../table-DCqmpGAB.js";
|
|
5
5
|
import { Box, ContentFormula, ContentVector } from "document-schema.js";
|
|
6
6
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
7
7
|
//#region src/edit/odp/slide.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as ClockPort } from "../../clock-C7SUuYN0.cjs";
|
|
2
|
-
import { t as OdtParagraph } from "../../paragraph-
|
|
3
|
-
import { n as OdtTable } from "../../table-
|
|
2
|
+
import { t as OdtParagraph } from "../../paragraph-CRaLSzWz.cjs";
|
|
3
|
+
import { n as OdtTable } from "../../table-CnRh10dW.cjs";
|
|
4
4
|
import { ContentDocument, ContentParagraph, ContentTable } from "document-schema.js";
|
|
5
5
|
import { Package } from "odf.js";
|
|
6
6
|
//#region src/edit/odt/content.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as ClockPort } from "../../clock-C7SUuYN0.js";
|
|
2
|
-
import { t as OdtParagraph } from "../../paragraph-
|
|
3
|
-
import { n as OdtTable } from "../../table-
|
|
2
|
+
import { t as OdtParagraph } from "../../paragraph-D4f705GG.js";
|
|
3
|
+
import { n as OdtTable } from "../../table-DCqmpGAB.js";
|
|
4
4
|
import { ContentDocument, ContentParagraph, ContentTable } from "document-schema.js";
|
|
5
5
|
import { Package } from "odf.js";
|
|
6
6
|
//#region src/edit/odt/content.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as ClockPort } from "../../clock-C7SUuYN0.cjs";
|
|
2
|
-
import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-
|
|
3
|
-
import { t as OdtList } from "../../list-
|
|
4
|
-
import { a as TableInit, n as OdtTable } from "../../table-
|
|
2
|
+
import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-CRaLSzWz.cjs";
|
|
3
|
+
import { t as OdtList } from "../../list-yc0dJrOX.cjs";
|
|
4
|
+
import { a as TableInit, n as OdtTable } from "../../table-CnRh10dW.cjs";
|
|
5
5
|
import { Box, ContentFormula, ContentVector } from "document-schema.js";
|
|
6
6
|
import { Package } from "odf.js";
|
|
7
7
|
//#region src/edit/odt/editor.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as ClockPort } from "../../clock-C7SUuYN0.js";
|
|
2
|
-
import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-
|
|
3
|
-
import { t as OdtList } from "../../list-
|
|
4
|
-
import { a as TableInit, n as OdtTable } from "../../table-
|
|
2
|
+
import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-D4f705GG.js";
|
|
3
|
+
import { t as OdtList } from "../../list-C32h8MNc.js";
|
|
4
|
+
import { a as TableInit, n as OdtTable } from "../../table-DCqmpGAB.js";
|
|
5
5
|
import { Box, ContentFormula, ContentVector } from "document-schema.js";
|
|
6
6
|
import { Package } from "odf.js";
|
|
7
7
|
//#region src/edit/odt/editor.d.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as buildImageFrame, r as insertImageFrameMedia, t as ImageInit } from "../../image-
|
|
1
|
+
import { n as buildImageFrame, r as insertImageFrameMedia, t as ImageInit } from "../../image-BqMIKksf.cjs";
|
|
2
2
|
export { ImageInit, buildImageFrame, insertImageFrameMedia };
|
package/dist/edit/odt/image.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as buildImageFrame, r as insertImageFrameMedia, t as ImageInit } from "../../image-
|
|
1
|
+
import { n as buildImageFrame, r as insertImageFrameMedia, t as ImageInit } from "../../image-BqMIKksf.js";
|
|
2
2
|
export { ImageInit, buildImageFrame, insertImageFrameMedia };
|
package/dist/edit/odt/list.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-
|
|
1
|
+
import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-yc0dJrOX.cjs";
|
|
2
2
|
export { OdtList, OdtListItem, buildList };
|
package/dist/edit/odt/list.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-
|
|
1
|
+
import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-C32h8MNc.js";
|
|
2
2
|
export { OdtList, OdtListItem, buildList };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as headingStyleName, n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-
|
|
1
|
+
import { i as headingStyleName, n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-CRaLSzWz.cjs";
|
|
2
2
|
export { OdtParagraph, ParagraphInit, buildParagraph, headingStyleName };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as headingStyleName, n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-
|
|
1
|
+
import { i as headingStyleName, n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-D4f705GG.js";
|
|
2
2
|
export { OdtParagraph, ParagraphInit, buildParagraph, headingStyleName };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TableInit, c as readCellDecoration, i as OdtTableRow, n as OdtTable, o as buildCellStyle, r as OdtTableCell, s as buildTable, t as CellDecoration } from "../../table-
|
|
1
|
+
import { a as TableInit, c as readCellDecoration, i as OdtTableRow, n as OdtTable, o as buildCellStyle, r as OdtTableCell, s as buildTable, t as CellDecoration } from "../../table-CnRh10dW.cjs";
|
|
2
2
|
export { CellDecoration, OdtTable, OdtTableCell, OdtTableRow, TableInit, buildCellStyle, buildTable, readCellDecoration };
|
package/dist/edit/odt/table.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TableInit, c as readCellDecoration, i as OdtTableRow, n as OdtTable, o as buildCellStyle, r as OdtTableCell, s as buildTable, t as CellDecoration } from "../../table-
|
|
1
|
+
import { a as TableInit, c as readCellDecoration, i as OdtTableRow, n as OdtTable, o as buildCellStyle, r as OdtTableCell, s as buildTable, t as CellDecoration } from "../../table-DCqmpGAB.js";
|
|
2
2
|
export { CellDecoration, OdtTable, OdtTableCell, OdtTableRow, TableInit, buildCellStyle, buildTable, readCellDecoration };
|
|
@@ -42,6 +42,7 @@ function appendShape(slide, shape, options) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
|
|
45
|
+
if (onlyBlock.format === "svg") throw new Error("buildPptxPackage: an image block in svg format has no OOXML blip this writer can produce (PresentationML's a:blip only references a raster part PowerPoint decodes directly -- png/jpeg/gif)");
|
|
45
46
|
const imageShape = slide.addImage({
|
|
46
47
|
frame: shape.frame,
|
|
47
48
|
format: onlyBlock.format,
|
|
@@ -41,6 +41,7 @@ function appendShape(slide, shape, options) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
|
|
44
|
+
if (onlyBlock.format === "svg") throw new Error("buildPptxPackage: an image block in svg format has no OOXML blip this writer can produce (PresentationML's a:blip only references a raster part PowerPoint decodes directly -- png/jpeg/gif)");
|
|
44
45
|
const imageShape = slide.addImage({
|
|
45
46
|
frame: shape.frame,
|
|
46
47
|
format: onlyBlock.format,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MediaContext, r as insertPictureShapeMedia, t as ImageInit } from "../../image-
|
|
1
|
+
import { n as MediaContext, r as insertPictureShapeMedia, t as ImageInit } from "../../image-C3L2cCLQ.cjs";
|
|
2
2
|
export { ImageInit, MediaContext, insertPictureShapeMedia };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MediaContext, r as insertPictureShapeMedia, t as ImageInit } from "../../image-
|
|
1
|
+
import { n as MediaContext, r as insertPictureShapeMedia, t as ImageInit } from "../../image-CAeD6ZbR.js";
|
|
2
2
|
export { ImageInit, MediaContext, insertPictureShapeMedia };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ImageInit } from "../../image-
|
|
1
|
+
import { t as ImageInit } from "../../image-C3L2cCLQ.cjs";
|
|
2
2
|
import { r as PptxShape } from "../../shape-C2ef6uwC.cjs";
|
|
3
3
|
import { r as PptxTableInit, t as PptxTable } from "../../table-CtbzOK8s.cjs";
|
|
4
4
|
import { Box, ContentVector } from "document-schema.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ImageInit } from "../../image-
|
|
1
|
+
import { t as ImageInit } from "../../image-CAeD6ZbR.js";
|
|
2
2
|
import { r as PptxShape } from "../../shape-DwZouh8R.js";
|
|
3
3
|
import { r as PptxTableInit, t as PptxTable } from "../../table-D2CgT0Gf.js";
|
|
4
4
|
import { Package, XmlElement, XmlNode } from "ooxml.js";
|
|
@@ -2,7 +2,7 @@ import { Box } from "document-schema.js";
|
|
|
2
2
|
import { Package, XmlElement } from "odf.js";
|
|
3
3
|
//#region src/edit/odt/image.d.ts
|
|
4
4
|
interface ImageInit {
|
|
5
|
-
readonly format: "png" | "jpeg";
|
|
5
|
+
readonly format: "png" | "jpeg" | "svg" | "gif";
|
|
6
6
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
7
7
|
readonly widthPt: number;
|
|
8
8
|
readonly heightPt: number;
|
|
@@ -2,7 +2,7 @@ import { Box } from "document-schema.js";
|
|
|
2
2
|
import { Package, XmlElement } from "odf.js";
|
|
3
3
|
//#region src/edit/odt/image.d.ts
|
|
4
4
|
interface ImageInit {
|
|
5
|
-
readonly format: "png" | "jpeg";
|
|
5
|
+
readonly format: "png" | "jpeg" | "svg" | "gif";
|
|
6
6
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
7
7
|
readonly widthPt: number;
|
|
8
8
|
readonly heightPt: number;
|
|
@@ -2,7 +2,7 @@ import { Box } from "document-schema.js";
|
|
|
2
2
|
import { Package, XmlElement } from "ooxml.js";
|
|
3
3
|
//#region src/edit/pptx/image.d.ts
|
|
4
4
|
interface ImageInit {
|
|
5
|
-
readonly format: "png" | "jpeg";
|
|
5
|
+
readonly format: "png" | "jpeg" | "gif";
|
|
6
6
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
7
7
|
readonly altText?: string;
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import { Package, XmlElement } from "ooxml.js";
|
|
|
2
2
|
import { Box } from "document-schema.js";
|
|
3
3
|
//#region src/edit/pptx/image.d.ts
|
|
4
4
|
interface ImageInit {
|
|
5
|
-
readonly format: "png" | "jpeg";
|
|
5
|
+
readonly format: "png" | "jpeg" | "gif";
|
|
6
6
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
7
7
|
readonly altText?: string;
|
|
8
8
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Package, XmlElement, XmlNode } from "ooxml.js";
|
|
2
2
|
//#region src/edit/docx/image.d.ts
|
|
3
3
|
interface ImageInit {
|
|
4
|
-
readonly format: "png" | "jpeg";
|
|
4
|
+
readonly format: "png" | "jpeg" | "gif";
|
|
5
5
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
6
6
|
readonly widthPt: number;
|
|
7
7
|
readonly heightPt: number;
|
|
8
8
|
readonly altText?: string;
|
|
9
9
|
}
|
|
10
|
+
declare function assertDocxWritableImageFormat(format: "png" | "jpeg" | "svg" | "gif"): asserts format is "png" | "jpeg" | "gif";
|
|
10
11
|
declare function nextDrawingId(documentRoot: XmlElement): number;
|
|
11
12
|
declare function buildInlineDrawing(relationshipId: string, widthPt: number, heightPt: number, id: number, altText: string | undefined): XmlElement;
|
|
12
13
|
interface MediaContext {
|
|
@@ -16,4 +17,4 @@ interface MediaContext {
|
|
|
16
17
|
}
|
|
17
18
|
declare function insertImageMedia(context: MediaContext, documentRoot: XmlElement, image: ImageInit): XmlNode;
|
|
18
19
|
//#endregion
|
|
19
|
-
export {
|
|
20
|
+
export { insertImageMedia as a, buildInlineDrawing as i, MediaContext as n, nextDrawingId as o, assertDocxWritableImageFormat as r, ImageInit as t };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Package, XmlElement, XmlNode } from "ooxml.js";
|
|
2
2
|
//#region src/edit/docx/image.d.ts
|
|
3
3
|
interface ImageInit {
|
|
4
|
-
readonly format: "png" | "jpeg";
|
|
4
|
+
readonly format: "png" | "jpeg" | "gif";
|
|
5
5
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
6
6
|
readonly widthPt: number;
|
|
7
7
|
readonly heightPt: number;
|
|
8
8
|
readonly altText?: string;
|
|
9
9
|
}
|
|
10
|
+
declare function assertDocxWritableImageFormat(format: "png" | "jpeg" | "svg" | "gif"): asserts format is "png" | "jpeg" | "gif";
|
|
10
11
|
declare function nextDrawingId(documentRoot: XmlElement): number;
|
|
11
12
|
declare function buildInlineDrawing(relationshipId: string, widthPt: number, heightPt: number, id: number, altText: string | undefined): XmlElement;
|
|
12
13
|
interface MediaContext {
|
|
@@ -16,4 +17,4 @@ interface MediaContext {
|
|
|
16
17
|
}
|
|
17
18
|
declare function insertImageMedia(context: MediaContext, documentRoot: XmlElement, image: ImageInit): XmlNode;
|
|
18
19
|
//#endregion
|
|
19
|
-
export {
|
|
20
|
+
export { insertImageMedia as a, buildInlineDrawing as i, MediaContext as n, nextDrawingId as o, assertDocxWritableImageFormat as r, ImageInit as t };
|
|
@@ -2,7 +2,7 @@ import { Box } from "document-schema.js";
|
|
|
2
2
|
import { Package, XmlElement } from "odf.js";
|
|
3
3
|
//#region src/edit/odp/image.d.ts
|
|
4
4
|
interface ImageInit {
|
|
5
|
-
readonly format: "png" | "jpeg";
|
|
5
|
+
readonly format: "png" | "jpeg" | "svg" | "gif";
|
|
6
6
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
7
7
|
readonly altText?: string;
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import { Box } from "document-schema.js";
|
|
|
2
2
|
import { Package, XmlElement } from "odf.js";
|
|
3
3
|
//#region src/edit/odp/image.d.ts
|
|
4
4
|
interface ImageInit {
|
|
5
|
-
readonly format: "png" | "jpeg";
|
|
5
|
+
readonly format: "png" | "jpeg" | "svg" | "gif";
|
|
6
6
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
7
7
|
readonly altText?: string;
|
|
8
8
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -33,15 +33,15 @@ import { MarkdownTable, MarkdownTableCell, MarkdownTableRow, TableInit } from ".
|
|
|
33
33
|
import { CreateMarkdownEditorOptions, MarkdownBody, MarkdownEditor, createMarkdownEditor, openMarkdown } from "./edit/markdown/editor.cjs";
|
|
34
34
|
import { BuildOdgPackageOptions, buildOdgPackage } from "./edit/odg/content.cjs";
|
|
35
35
|
import { n as RunInit$1, t as OdtRun } from "./run-mzBHuFWz.cjs";
|
|
36
|
-
import { n as ParagraphInit$1, t as OdtParagraph } from "./paragraph-
|
|
37
|
-
import { n as OdtListItem, t as OdtList } from "./list-
|
|
38
|
-
import { t as OdpShape } from "./shape-
|
|
36
|
+
import { n as ParagraphInit$1, t as OdtParagraph } from "./paragraph-CRaLSzWz.cjs";
|
|
37
|
+
import { n as OdtListItem, t as OdtList } from "./list-yc0dJrOX.cjs";
|
|
38
|
+
import { t as OdpShape } from "./shape-CAm2tKw5.cjs";
|
|
39
39
|
import { a as OdgLineVector, c as OdgVectorKind, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "./vector-DDP7hgvm.cjs";
|
|
40
40
|
import { OdgPage, PageImageInit, TextBoxInit } from "./edit/odg/page.cjs";
|
|
41
41
|
import { CreateOdgOptions, OdgEditor, createOdg, openOdg } from "./edit/odg/editor.cjs";
|
|
42
42
|
import { CreateEmptyOdgPackageOptions } from "./edit/odg/scaffold.cjs";
|
|
43
43
|
import { BuildOdpPackageOptions, buildOdpPackage } from "./edit/odp/content.cjs";
|
|
44
|
-
import { a as TableInit$1, i as OdtTableRow, n as OdtTable, r as OdtTableCell } from "./table-
|
|
44
|
+
import { a as TableInit$1, i as OdtTableRow, n as OdtTable, r as OdtTableCell } from "./table-CnRh10dW.cjs";
|
|
45
45
|
import { OdpSlide, SlideImageInit, SlideTableInit, TextBoxInit as TextBoxInit$1 } from "./edit/odp/slide.cjs";
|
|
46
46
|
import { CreateOdpOptions, OdpEditor, createOdp, openOdp } from "./edit/odp/editor.cjs";
|
|
47
47
|
import { CreateEmptyOdpPackageOptions } from "./edit/odp/scaffold.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -33,15 +33,15 @@ import { MarkdownTable, MarkdownTableCell, MarkdownTableRow, TableInit } from ".
|
|
|
33
33
|
import { CreateMarkdownEditorOptions, MarkdownBody, MarkdownEditor, createMarkdownEditor, openMarkdown } from "./edit/markdown/editor.js";
|
|
34
34
|
import { BuildOdgPackageOptions, buildOdgPackage } from "./edit/odg/content.js";
|
|
35
35
|
import { n as RunInit$1, t as OdtRun } from "./run-mzBHuFWz.js";
|
|
36
|
-
import { n as ParagraphInit$1, t as OdtParagraph } from "./paragraph-
|
|
37
|
-
import { n as OdtListItem, t as OdtList } from "./list-
|
|
38
|
-
import { t as OdpShape } from "./shape-
|
|
36
|
+
import { n as ParagraphInit$1, t as OdtParagraph } from "./paragraph-D4f705GG.js";
|
|
37
|
+
import { n as OdtListItem, t as OdtList } from "./list-C32h8MNc.js";
|
|
38
|
+
import { t as OdpShape } from "./shape-DAt3nOQm.js";
|
|
39
39
|
import { a as OdgLineVector, c as OdgVectorKind, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "./vector-DDP7hgvm.js";
|
|
40
40
|
import { OdgPage, PageImageInit, TextBoxInit } from "./edit/odg/page.js";
|
|
41
41
|
import { CreateOdgOptions, OdgEditor, createOdg, openOdg } from "./edit/odg/editor.js";
|
|
42
42
|
import { CreateEmptyOdgPackageOptions } from "./edit/odg/scaffold.js";
|
|
43
43
|
import { BuildOdpPackageOptions, buildOdpPackage } from "./edit/odp/content.js";
|
|
44
|
-
import { a as TableInit$1, i as OdtTableRow, n as OdtTable, r as OdtTableCell } from "./table-
|
|
44
|
+
import { a as TableInit$1, i as OdtTableRow, n as OdtTable, r as OdtTableCell } from "./table-DCqmpGAB.js";
|
|
45
45
|
import { OdpSlide, SlideImageInit, SlideTableInit, TextBoxInit as TextBoxInit$1 } from "./edit/odp/slide.js";
|
|
46
46
|
import { CreateOdpOptions, OdpEditor, createOdp, openOdp } from "./edit/odp/editor.js";
|
|
47
47
|
import { CreateEmptyOdpPackageOptions } from "./edit/odp/scaffold.js";
|
package/dist/layout/shared.cjs
CHANGED
|
@@ -198,6 +198,7 @@ function decodeImageDimensions(format, bytes) {
|
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
200
|
function registerImage(block, images) {
|
|
201
|
+
if (block.format === "svg" || block.format === "gif") throw new Error(`registerImage: an image block in ${block.format} format cannot be laid out to PDF -- pdf-codec's own LayoutImageAsset registry (and its writer, byte-codec's image encoders) supports png and jpeg only`);
|
|
201
202
|
const bytes = (0, ooxml_js.base64ToBytes)(block.base64);
|
|
202
203
|
const imageId = `img${(0, byte_codec.crc32)(bytes).toString(16)}`;
|
|
203
204
|
if (!(imageId in images)) {
|
package/dist/layout/shared.js
CHANGED
|
@@ -197,6 +197,7 @@ function decodeImageDimensions(format, bytes) {
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
function registerImage(block, images) {
|
|
200
|
+
if (block.format === "svg" || block.format === "gif") throw new Error(`registerImage: an image block in ${block.format} format cannot be laid out to PDF -- pdf-codec's own LayoutImageAsset registry (and its writer, byte-codec's image encoders) supports png and jpeg only`);
|
|
200
201
|
const bytes = base64ToBytes(block.base64);
|
|
201
202
|
const imageId = `img${crc32(bytes).toString(16)}`;
|
|
202
203
|
if (!(imageId in images)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-
|
|
1
|
+
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-D4f705GG.js";
|
|
2
2
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
3
3
|
//#region src/edit/odt/list.d.ts
|
|
4
4
|
declare class OdtListItem {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-
|
|
1
|
+
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-CRaLSzWz.cjs";
|
|
2
2
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
3
3
|
//#region src/edit/odt/list.d.ts
|
|
4
4
|
declare class OdtListItem {
|
|
@@ -3,6 +3,6 @@ import { Package } from "odf.js";
|
|
|
3
3
|
interface AddedOdfMedia {
|
|
4
4
|
readonly partPath: string;
|
|
5
5
|
}
|
|
6
|
-
declare function addImageMedia(pkg: Package, imageBytes: Uint8Array<ArrayBuffer>, format: "png" | "jpeg"): AddedOdfMedia;
|
|
6
|
+
declare function addImageMedia(pkg: Package, imageBytes: Uint8Array<ArrayBuffer>, format: "png" | "jpeg" | "svg" | "gif"): AddedOdfMedia;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { AddedOdfMedia, addImageMedia };
|
|
@@ -3,6 +3,6 @@ import { Package } from "odf.js";
|
|
|
3
3
|
interface AddedOdfMedia {
|
|
4
4
|
readonly partPath: string;
|
|
5
5
|
}
|
|
6
|
-
declare function addImageMedia(pkg: Package, imageBytes: Uint8Array<ArrayBuffer>, format: "png" | "jpeg"): AddedOdfMedia;
|
|
6
|
+
declare function addImageMedia(pkg: Package, imageBytes: Uint8Array<ArrayBuffer>, format: "png" | "jpeg" | "svg" | "gif"): AddedOdfMedia;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { AddedOdfMedia, addImageMedia };
|
|
@@ -7,7 +7,8 @@ const CONTENT_TYPES_NAMESPACE = "http://schemas.openxmlformats.org/package/2006/
|
|
|
7
7
|
const DEFAULT_CONTENT_TYPES = {
|
|
8
8
|
png: "image/png",
|
|
9
9
|
jpeg: "image/jpeg",
|
|
10
|
-
jpg: "image/jpeg"
|
|
10
|
+
jpg: "image/jpeg",
|
|
11
|
+
gif: "image/gif"
|
|
11
12
|
};
|
|
12
13
|
function defaultContentTypeForExtension(extension) {
|
|
13
14
|
const contentType = DEFAULT_CONTENT_TYPES[extension.toLowerCase()];
|
|
@@ -6,7 +6,8 @@ const CONTENT_TYPES_NAMESPACE = "http://schemas.openxmlformats.org/package/2006/
|
|
|
6
6
|
const DEFAULT_CONTENT_TYPES = {
|
|
7
7
|
png: "image/png",
|
|
8
8
|
jpeg: "image/jpeg",
|
|
9
|
-
jpg: "image/jpeg"
|
|
9
|
+
jpg: "image/jpeg",
|
|
10
|
+
gif: "image/gif"
|
|
10
11
|
};
|
|
11
12
|
function defaultContentTypeForExtension(extension) {
|
|
12
13
|
const contentType = DEFAULT_CONTENT_TYPES[extension.toLowerCase()];
|
package/dist/opc/media.cjs
CHANGED
|
@@ -24,14 +24,13 @@ function nextMediaIndex(pkg, mediaDir, fileNamePrefix, extension) {
|
|
|
24
24
|
return max + 1;
|
|
25
25
|
}
|
|
26
26
|
function addImageMedia(pkg, fromPartPath, mediaDir, format, bytes) {
|
|
27
|
-
const extension = format === "jpeg" ? "jpeg" : "png";
|
|
28
27
|
const fileNamePrefix = "image";
|
|
29
|
-
const partPath = `${mediaDir}/${fileNamePrefix}${nextMediaIndex(pkg, mediaDir, fileNamePrefix,
|
|
28
|
+
const partPath = `${mediaDir}/${fileNamePrefix}${nextMediaIndex(pkg, mediaDir, fileNamePrefix, format)}.${format}`;
|
|
30
29
|
pkg.parts[partPath] = {
|
|
31
30
|
kind: "binary",
|
|
32
31
|
base64: (0, ooxml_js.bytesToBase64)(bytes)
|
|
33
32
|
};
|
|
34
|
-
require_opc_content_types.ensureDefaultContentType(pkg,
|
|
33
|
+
require_opc_content_types.ensureDefaultContentType(pkg, format, require_opc_content_types.defaultContentTypeForExtension(format));
|
|
35
34
|
const target = require_opc_paths.buildRelativeTarget(fromPartPath, partPath);
|
|
36
35
|
return {
|
|
37
36
|
partPath,
|
package/dist/opc/media.d.cts
CHANGED
|
@@ -5,6 +5,6 @@ interface AddedMedia {
|
|
|
5
5
|
readonly relationshipId: string;
|
|
6
6
|
}
|
|
7
7
|
declare function addImageMedia(pkg: Package, fromPartPath: string, mediaDir: string // e.g. 'word/media' or 'ppt/media'
|
|
8
|
-
, format: "png" | "jpeg", bytes: Uint8Array<ArrayBuffer>): AddedMedia;
|
|
8
|
+
, format: "png" | "jpeg" | "gif", bytes: Uint8Array<ArrayBuffer>): AddedMedia;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { AddedMedia, addImageMedia };
|
package/dist/opc/media.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ interface AddedMedia {
|
|
|
5
5
|
readonly relationshipId: string;
|
|
6
6
|
}
|
|
7
7
|
declare function addImageMedia(pkg: Package, fromPartPath: string, mediaDir: string // e.g. 'word/media' or 'ppt/media'
|
|
8
|
-
, format: "png" | "jpeg", bytes: Uint8Array<ArrayBuffer>): AddedMedia;
|
|
8
|
+
, format: "png" | "jpeg" | "gif", bytes: Uint8Array<ArrayBuffer>): AddedMedia;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { AddedMedia, addImageMedia };
|
package/dist/opc/media.js
CHANGED
|
@@ -23,14 +23,13 @@ function nextMediaIndex(pkg, mediaDir, fileNamePrefix, extension) {
|
|
|
23
23
|
return max + 1;
|
|
24
24
|
}
|
|
25
25
|
function addImageMedia(pkg, fromPartPath, mediaDir, format, bytes) {
|
|
26
|
-
const extension = format === "jpeg" ? "jpeg" : "png";
|
|
27
26
|
const fileNamePrefix = "image";
|
|
28
|
-
const partPath = `${mediaDir}/${fileNamePrefix}${nextMediaIndex(pkg, mediaDir, fileNamePrefix,
|
|
27
|
+
const partPath = `${mediaDir}/${fileNamePrefix}${nextMediaIndex(pkg, mediaDir, fileNamePrefix, format)}.${format}`;
|
|
29
28
|
pkg.parts[partPath] = {
|
|
30
29
|
kind: "binary",
|
|
31
30
|
base64: bytesToBase64(bytes)
|
|
32
31
|
};
|
|
33
|
-
ensureDefaultContentType(pkg,
|
|
32
|
+
ensureDefaultContentType(pkg, format, defaultContentTypeForExtension(format));
|
|
34
33
|
const target = buildRelativeTarget(fromPartPath, partPath);
|
|
35
34
|
return {
|
|
36
35
|
partPath,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ImageInit } from "./image-
|
|
1
|
+
import { t as ImageInit } from "./image-BqMIKksf.cjs";
|
|
2
2
|
import { n as RunInit, t as OdtRun } from "./run-mzBHuFWz.cjs";
|
|
3
3
|
import { Alignment } from "document-schema.js";
|
|
4
4
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ImageInit } from "./image-
|
|
1
|
+
import { t as ImageInit } from "./image-BqMIKksf.js";
|
|
2
2
|
import { n as RunInit, t as OdtRun } from "./run-mzBHuFWz.js";
|
|
3
3
|
import { Alignment } from "document-schema.js";
|
|
4
4
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-
|
|
2
|
-
import { t as OdtList } from "./list-
|
|
1
|
+
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-CRaLSzWz.cjs";
|
|
2
|
+
import { t as OdtList } from "./list-yc0dJrOX.cjs";
|
|
3
3
|
import { Box } from "document-schema.js";
|
|
4
4
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
5
5
|
//#region src/edit/odp/shape.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-
|
|
2
|
-
import { t as OdtList } from "./list-
|
|
1
|
+
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-D4f705GG.js";
|
|
2
|
+
import { t as OdtList } from "./list-C32h8MNc.js";
|
|
3
3
|
import { Box } from "document-schema.js";
|
|
4
4
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
5
5
|
//#region src/edit/odp/shape.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-
|
|
1
|
+
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-CRaLSzWz.cjs";
|
|
2
2
|
import { Color, ContentCellBorders } from "document-schema.js";
|
|
3
3
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
4
4
|
//#region src/edit/odt/table.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-
|
|
1
|
+
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-D4f705GG.js";
|
|
2
2
|
import { Color, ContentCellBorders } from "document-schema.js";
|
|
3
3
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
4
4
|
//#region src/edit/odt/table.d.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js.documents",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.3",
|
|
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": {
|
|
@@ -77,21 +77,21 @@
|
|
|
77
77
|
],
|
|
78
78
|
"license": "MIT",
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"archive-codec": "^1.4.
|
|
81
|
-
"byte-codec": "^1.2.
|
|
82
|
-
"doc-codec": "^1.1.
|
|
83
|
-
"document-schema.js": "^5.
|
|
80
|
+
"archive-codec": "^1.4.2",
|
|
81
|
+
"byte-codec": "^1.2.1",
|
|
82
|
+
"doc-codec": "^1.1.2",
|
|
83
|
+
"document-schema.js": "^5.6.0",
|
|
84
84
|
"fflate": "^0.8.3",
|
|
85
|
-
"markdown-codec": "^6.1.
|
|
86
|
-
"odf.js": "^6.4.
|
|
87
|
-
"ooxml.js": "^6.3.
|
|
88
|
-
"pdf-codec": "^3.6.
|
|
89
|
-
"ppt-codec": "^1.1.
|
|
90
|
-
"rtf-codec": "^1.1.
|
|
85
|
+
"markdown-codec": "^6.1.6",
|
|
86
|
+
"odf.js": "^6.4.1",
|
|
87
|
+
"ooxml.js": "^6.3.7",
|
|
88
|
+
"pdf-codec": "^3.6.5",
|
|
89
|
+
"ppt-codec": "^1.1.2",
|
|
90
|
+
"rtf-codec": "^1.1.2",
|
|
91
91
|
"temml": "0.13.4",
|
|
92
|
-
"xls-codec": "^2.0.
|
|
92
|
+
"xls-codec": "^2.0.2",
|
|
93
93
|
"zod": "^4.4.3",
|
|
94
|
-
"wpd-codec": "^1.1.
|
|
94
|
+
"wpd-codec": "^1.1.3"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@arethetypeswrong/cli": "^0.18.5",
|