js.documents 1.65.0 → 1.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -11
- package/dist/color-C98dn-pT.d.ts +2 -0
- package/dist/convert/convert.cjs +2 -1
- package/dist/convert/convert.js +2 -1
- package/dist/edit/docx/content.cjs +5 -0
- package/dist/edit/docx/content.js +5 -0
- package/dist/edit/docx/image.cjs +1 -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 +1 -1
- package/dist/edit/docx/paragraph.cjs +10 -1
- package/dist/edit/docx/paragraph.d.cts +4 -3
- package/dist/edit/docx/paragraph.d.ts +4 -3
- package/dist/edit/docx/paragraph.js +13 -4
- package/dist/edit/docx/props.d.ts +1 -1
- package/dist/edit/docx/run.cjs +8 -1
- package/dist/edit/docx/run.d.cts +2 -2
- package/dist/edit/docx/run.d.ts +2 -2
- package/dist/edit/docx/run.js +8 -2
- package/dist/edit/docx/vector.cjs +69 -0
- package/dist/edit/docx/vector.d.cts +6 -0
- package/dist/edit/docx/vector.d.ts +6 -0
- package/dist/edit/docx/vector.js +68 -0
- package/dist/edit/drawingml/vector.cjs +113 -0
- package/dist/edit/drawingml/vector.d.cts +9 -0
- package/dist/edit/drawingml/vector.d.ts +9 -0
- package/dist/edit/drawingml/vector.js +109 -0
- package/dist/edit/odg/content.cjs +1 -26
- package/dist/edit/odg/content.js +1 -26
- package/dist/edit/odg/page.cjs +14 -1
- package/dist/edit/odg/page.d.cts +5 -3
- package/dist/edit/odg/page.d.ts +5 -3
- package/dist/edit/odg/page.js +14 -1
- package/dist/edit/odg/style.cjs +17 -3
- package/dist/edit/odg/style.d.cts +1 -0
- package/dist/edit/odg/style.d.ts +1 -0
- package/dist/edit/odg/style.js +17 -3
- package/dist/edit/odg/vector.cjs +65 -3
- package/dist/edit/odg/vector.d.cts +2 -2
- package/dist/edit/odg/vector.d.ts +2 -2
- package/dist/edit/odg/vector.js +63 -4
- package/dist/edit/odp/content.cjs +4 -1
- package/dist/edit/odp/content.js +5 -2
- package/dist/edit/odp/shape.cjs +1 -1
- package/dist/edit/odp/shape.d.cts +1 -1
- package/dist/edit/odp/shape.d.ts +1 -1
- package/dist/edit/odp/shape.js +1 -1
- package/dist/edit/odp/slide.cjs +4 -0
- package/dist/edit/odp/slide.d.cts +8 -5
- package/dist/edit/odp/slide.d.ts +9 -6
- package/dist/edit/odp/slide.js +4 -0
- package/dist/edit/odt/content.cjs +5 -0
- package/dist/edit/odt/content.d.ts +2 -2
- package/dist/edit/odt/content.js +5 -0
- package/dist/edit/odt/editor.cjs +7 -0
- package/dist/edit/odt/editor.d.cts +3 -2
- package/dist/edit/odt/editor.d.ts +5 -4
- package/dist/edit/odt/editor.js +7 -0
- package/dist/edit/odt/list.cjs +13 -0
- package/dist/edit/odt/list.d.cts +1 -1
- package/dist/edit/odt/list.d.ts +1 -1
- package/dist/edit/odt/list.js +13 -0
- package/dist/edit/odt/paragraph.d.ts +1 -1
- package/dist/edit/odt/run.d.ts +1 -1
- package/dist/edit/odt/table.d.ts +1 -1
- package/dist/edit/pptx/content.cjs +5 -2
- package/dist/edit/pptx/content.js +5 -2
- package/dist/edit/pptx/shape.cjs +2 -5
- package/dist/edit/pptx/shape.d.ts +1 -1
- package/dist/edit/pptx/shape.js +2 -5
- package/dist/edit/pptx/slide.cjs +7 -0
- package/dist/edit/pptx/slide.d.cts +6 -4
- package/dist/edit/pptx/slide.d.ts +8 -6
- package/dist/edit/pptx/slide.js +7 -0
- package/dist/edit/pptx/table.d.ts +1 -1
- package/dist/edit/pptx/vector.cjs +17 -0
- package/dist/edit/pptx/vector.d.cts +6 -0
- package/dist/edit/pptx/vector.d.ts +6 -0
- package/dist/edit/pptx/vector.js +16 -0
- package/dist/{image-BfRLAD9B.d.cts → image-DRqXQmEg.d.cts} +2 -1
- package/dist/{image-BfRLAD9B.d.ts → image-DRqXQmEg.d.ts} +2 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +12 -12
- package/dist/index.js +2 -2
- package/dist/layout/engine.cjs +1 -5
- package/dist/layout/engine.js +1 -5
- package/dist/layout/shared.cjs +6 -0
- package/dist/layout/shared.d.cts +2 -1
- package/dist/layout/shared.d.ts +2 -1
- package/dist/layout/shared.js +6 -1
- package/dist/layout/sheets.cjs +70 -9
- package/dist/layout/sheets.d.cts +7 -3
- package/dist/layout/sheets.d.ts +7 -3
- package/dist/layout/sheets.js +72 -11
- package/dist/layout/slides.cjs +1 -5
- package/dist/layout/slides.js +1 -5
- package/dist/{list-BuBM9rwQ.d.cts → list-BzcN-LTJ.d.cts} +3 -0
- package/dist/{list-CvKxhy3y.d.ts → list-nlhN5bat.d.ts} +4 -1
- package/dist/markdown/write.cjs +1 -1
- package/dist/markdown/write.js +1 -1
- package/dist/model/color.d.ts +1 -1
- package/dist/model/embedded-drawing.cjs +47 -0
- package/dist/model/embedded-drawing.d.cts +4 -2
- package/dist/model/embedded-drawing.d.ts +4 -2
- package/dist/model/embedded-drawing.js +46 -1
- package/dist/{paragraph-CoUi_88j.d.ts → paragraph-DndYbWuT.d.ts} +1 -1
- package/dist/{run-D2rTWHbt.d.ts → run-BhYv2wJf.d.ts} +3 -2
- package/dist/{run-CJfh8rv3.d.ts → run-DtrwZwN6.d.ts} +1 -1
- package/dist/{run-B3GNScJH.d.cts → run-P0b2pDdX.d.cts} +2 -1
- package/dist/{shape-BkVcwPcf.d.ts → shape-B-TjU_Ej.d.ts} +1 -1
- package/dist/{shape-CXZ6fejV.d.cts → shape-C8qDhn0l.d.cts} +1 -1
- package/dist/{shape-CVXedeL7.d.ts → shape-XGp__l-J.d.ts} +2 -2
- package/dist/{table-DqfqMkVq.d.ts → table-BHeUmLzZ.d.ts} +1 -1
- package/dist/{table-DvS_7UQS.d.ts → table-DQpKafyl.d.ts} +1 -1
- package/dist/{vector-Puuqu_IT.d.cts → vector-D03KX8Ux.d.cts} +15 -2
- package/dist/{vector-Puuqu_IT.d.ts → vector-D03KX8Ux.d.ts} +15 -2
- package/package.json +3 -3
- package/dist/color-Bo228AY2.d.ts +0 -2
package/dist/markdown/write.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { formulaOfBlock, formulaPlaceholderText } from "../model/formula.js";
|
|
2
1
|
import { drawingOfBlock } from "../model/embedded-drawing.js";
|
|
2
|
+
import { formulaOfBlock, formulaPlaceholderText } from "../model/formula.js";
|
|
3
3
|
import { MarkdownUnsupportedDocumentKindError, writeMarkdown } from "markdown-codec";
|
|
4
4
|
//#region src/markdown/write.ts
|
|
5
5
|
function toLegacyEmbeddedDocument(document) {
|
package/dist/model/color.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as rgbHexToColor, i as colorToRgbHex, n as LayoutColor, r as LayoutColorSchema, t as COLOR_BLACK } from "../color-
|
|
1
|
+
import { a as rgbHexToColor, i as colorToRgbHex, n as LayoutColor, r as LayoutColorSchema, t as COLOR_BLACK } from "../color-C98dn-pT.js";
|
|
2
2
|
export { COLOR_BLACK, type LayoutColor, LayoutColorSchema, colorToRgbHex, rgbHexToColor };
|
|
@@ -27,6 +27,53 @@ function buildDrawingBlock(size, vectors) {
|
|
|
27
27
|
function drawingOfBlock(block) {
|
|
28
28
|
return block.document.kind === "drawing" ? block.document : void 0;
|
|
29
29
|
}
|
|
30
|
+
function shiftBox(frame, dxPt, dyPt) {
|
|
31
|
+
return {
|
|
32
|
+
...frame,
|
|
33
|
+
xPt: frame.xPt + dxPt,
|
|
34
|
+
yPt: frame.yPt + dyPt
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function shiftPoint(point, dxPt, dyPt) {
|
|
38
|
+
return {
|
|
39
|
+
xPt: point.xPt + dxPt,
|
|
40
|
+
yPt: point.yPt + dyPt
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function translateVector(vector, dxPt, dyPt) {
|
|
44
|
+
switch (vector.kind) {
|
|
45
|
+
case "line": return {
|
|
46
|
+
...vector,
|
|
47
|
+
from: shiftPoint(vector.from, dxPt, dyPt),
|
|
48
|
+
to: shiftPoint(vector.to, dxPt, dyPt)
|
|
49
|
+
};
|
|
50
|
+
case "rect": return {
|
|
51
|
+
...vector,
|
|
52
|
+
frame: shiftBox(vector.frame, dxPt, dyPt)
|
|
53
|
+
};
|
|
54
|
+
case "ellipse": return {
|
|
55
|
+
...vector,
|
|
56
|
+
frame: shiftBox(vector.frame, dxPt, dyPt)
|
|
57
|
+
};
|
|
58
|
+
case "path": return {
|
|
59
|
+
...vector,
|
|
60
|
+
frame: shiftBox(vector.frame, dxPt, dyPt)
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const FLOW_CONTAINER_ORIGIN = {
|
|
65
|
+
xPt: 0,
|
|
66
|
+
yPt: 0
|
|
67
|
+
};
|
|
68
|
+
function embeddedDrawingVectors(block, containerOriginPt) {
|
|
69
|
+
const drawing = drawingOfBlock(block);
|
|
70
|
+
if (drawing === void 0) return [];
|
|
71
|
+
const dxPt = block.frame.xPt + containerOriginPt.xPt;
|
|
72
|
+
const dyPt = block.frame.yPt + containerOriginPt.yPt;
|
|
73
|
+
return drawing.pages.flatMap((page) => page.vectors.map((vector) => translateVector(vector, dxPt, dyPt)));
|
|
74
|
+
}
|
|
30
75
|
//#endregion
|
|
76
|
+
exports.FLOW_CONTAINER_ORIGIN = FLOW_CONTAINER_ORIGIN;
|
|
31
77
|
exports.buildDrawingBlock = buildDrawingBlock;
|
|
32
78
|
exports.drawingOfBlock = drawingOfBlock;
|
|
79
|
+
exports.embeddedDrawingVectors = embeddedDrawingVectors;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { ContentDocument, ContentEmbeddedObjectBlock, ContentVector, PageSize } from "document-schema.js";
|
|
1
|
+
import { ContentDocument, ContentEmbeddedObjectBlock, ContentPathPoint, ContentVector, PageSize } from "document-schema.js";
|
|
2
2
|
//#region src/model/embedded-drawing.d.ts
|
|
3
3
|
declare function buildDrawingBlock(size: PageSize, vectors: readonly ContentVector[]): ContentEmbeddedObjectBlock;
|
|
4
4
|
declare function drawingOfBlock(block: ContentEmbeddedObjectBlock): Extract<ContentDocument, {
|
|
5
5
|
kind: 'drawing';
|
|
6
6
|
}> | undefined;
|
|
7
|
+
declare const FLOW_CONTAINER_ORIGIN: ContentPathPoint;
|
|
8
|
+
declare function embeddedDrawingVectors(block: ContentEmbeddedObjectBlock, containerOriginPt: ContentPathPoint): ContentVector[];
|
|
7
9
|
//#endregion
|
|
8
|
-
export { buildDrawingBlock, drawingOfBlock };
|
|
10
|
+
export { FLOW_CONTAINER_ORIGIN, buildDrawingBlock, drawingOfBlock, embeddedDrawingVectors };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { ContentDocument, ContentEmbeddedObjectBlock, ContentVector, PageSize } from "document-schema.js";
|
|
1
|
+
import { ContentDocument, ContentEmbeddedObjectBlock, ContentPathPoint, ContentVector, PageSize } from "document-schema.js";
|
|
2
2
|
//#region src/model/embedded-drawing.d.ts
|
|
3
3
|
declare function buildDrawingBlock(size: PageSize, vectors: readonly ContentVector[]): ContentEmbeddedObjectBlock;
|
|
4
4
|
declare function drawingOfBlock(block: ContentEmbeddedObjectBlock): Extract<ContentDocument, {
|
|
5
5
|
kind: 'drawing';
|
|
6
6
|
}> | undefined;
|
|
7
|
+
declare const FLOW_CONTAINER_ORIGIN: ContentPathPoint;
|
|
8
|
+
declare function embeddedDrawingVectors(block: ContentEmbeddedObjectBlock, containerOriginPt: ContentPathPoint): ContentVector[];
|
|
7
9
|
//#endregion
|
|
8
|
-
export { buildDrawingBlock, drawingOfBlock };
|
|
10
|
+
export { FLOW_CONTAINER_ORIGIN, buildDrawingBlock, drawingOfBlock, embeddedDrawingVectors };
|
|
@@ -26,5 +26,50 @@ function buildDrawingBlock(size, vectors) {
|
|
|
26
26
|
function drawingOfBlock(block) {
|
|
27
27
|
return block.document.kind === "drawing" ? block.document : void 0;
|
|
28
28
|
}
|
|
29
|
+
function shiftBox(frame, dxPt, dyPt) {
|
|
30
|
+
return {
|
|
31
|
+
...frame,
|
|
32
|
+
xPt: frame.xPt + dxPt,
|
|
33
|
+
yPt: frame.yPt + dyPt
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function shiftPoint(point, dxPt, dyPt) {
|
|
37
|
+
return {
|
|
38
|
+
xPt: point.xPt + dxPt,
|
|
39
|
+
yPt: point.yPt + dyPt
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function translateVector(vector, dxPt, dyPt) {
|
|
43
|
+
switch (vector.kind) {
|
|
44
|
+
case "line": return {
|
|
45
|
+
...vector,
|
|
46
|
+
from: shiftPoint(vector.from, dxPt, dyPt),
|
|
47
|
+
to: shiftPoint(vector.to, dxPt, dyPt)
|
|
48
|
+
};
|
|
49
|
+
case "rect": return {
|
|
50
|
+
...vector,
|
|
51
|
+
frame: shiftBox(vector.frame, dxPt, dyPt)
|
|
52
|
+
};
|
|
53
|
+
case "ellipse": return {
|
|
54
|
+
...vector,
|
|
55
|
+
frame: shiftBox(vector.frame, dxPt, dyPt)
|
|
56
|
+
};
|
|
57
|
+
case "path": return {
|
|
58
|
+
...vector,
|
|
59
|
+
frame: shiftBox(vector.frame, dxPt, dyPt)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const FLOW_CONTAINER_ORIGIN = {
|
|
64
|
+
xPt: 0,
|
|
65
|
+
yPt: 0
|
|
66
|
+
};
|
|
67
|
+
function embeddedDrawingVectors(block, containerOriginPt) {
|
|
68
|
+
const drawing = drawingOfBlock(block);
|
|
69
|
+
if (drawing === void 0) return [];
|
|
70
|
+
const dxPt = block.frame.xPt + containerOriginPt.xPt;
|
|
71
|
+
const dyPt = block.frame.yPt + containerOriginPt.yPt;
|
|
72
|
+
return drawing.pages.flatMap((page) => page.vectors.map((vector) => translateVector(vector, dxPt, dyPt)));
|
|
73
|
+
}
|
|
29
74
|
//#endregion
|
|
30
|
-
export { buildDrawingBlock, drawingOfBlock };
|
|
75
|
+
export { FLOW_CONTAINER_ORIGIN, buildDrawingBlock, drawingOfBlock, embeddedDrawingVectors };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as Alignment } from "./style-DkamR3aY.js";
|
|
2
|
-
import { n as RunInit, t as OdtRun } from "./run-
|
|
2
|
+
import { n as RunInit, t as OdtRun } from "./run-DtrwZwN6.js";
|
|
3
3
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
4
4
|
//#region src/edit/odt/paragraph.d.ts
|
|
5
5
|
interface ParagraphInit {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { n as LayoutColor } from "./color-
|
|
1
|
+
import { n as LayoutColor } from "./color-C98dn-pT.js";
|
|
2
2
|
import { XmlElement, XmlNode } from "ooxml.js";
|
|
3
3
|
//#region src/edit/docx/run.d.ts
|
|
4
|
+
declare function wordprocessingText(element: XmlElement): string;
|
|
4
5
|
interface RunInit {
|
|
5
6
|
readonly text?: string;
|
|
6
7
|
readonly bold?: boolean;
|
|
@@ -35,4 +36,4 @@ declare class DocxRun {
|
|
|
35
36
|
}
|
|
36
37
|
declare function buildRun(init?: RunInit): XmlElement;
|
|
37
38
|
//#endregion
|
|
38
|
-
export { RunInit as n, buildRun as r, DocxRun as t };
|
|
39
|
+
export { wordprocessingText as i, RunInit as n, buildRun as r, DocxRun as t };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { n as LayoutColor } from "./color-71eoF1Up.cjs";
|
|
2
2
|
import { XmlElement, XmlNode } from "ooxml.js";
|
|
3
3
|
//#region src/edit/docx/run.d.ts
|
|
4
|
+
declare function wordprocessingText(element: XmlElement): string;
|
|
4
5
|
interface RunInit {
|
|
5
6
|
readonly text?: string;
|
|
6
7
|
readonly bold?: boolean;
|
|
@@ -35,4 +36,4 @@ declare class DocxRun {
|
|
|
35
36
|
}
|
|
36
37
|
declare function buildRun(init?: RunInit): XmlElement;
|
|
37
38
|
//#endregion
|
|
38
|
-
export { RunInit as n, buildRun as r, DocxRun as t };
|
|
39
|
+
export { wordprocessingText as i, RunInit as n, buildRun as r, DocxRun as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as LayoutColor } from "./color-
|
|
1
|
+
import { n as LayoutColor } from "./color-C98dn-pT.js";
|
|
2
2
|
import { t as Box } from "./geometry-DaJr8yQW.js";
|
|
3
3
|
import { t as Alignment } from "./style-DkamR3aY.js";
|
|
4
4
|
import { XmlElement, XmlNode } from "ooxml.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Box } from "./geometry-DaJr8yQW.cjs";
|
|
2
2
|
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-BXbXKPy3.cjs";
|
|
3
|
-
import { t as OdtList } from "./list-
|
|
3
|
+
import { t as OdtList } from "./list-BzcN-LTJ.cjs";
|
|
4
4
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
5
5
|
//#region src/edit/odp/shape.d.ts
|
|
6
6
|
declare class OdpShape {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Box } from "./geometry-DaJr8yQW.js";
|
|
2
|
-
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-
|
|
3
|
-
import { t as OdtList } from "./list-
|
|
2
|
+
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-DndYbWuT.js";
|
|
3
|
+
import { t as OdtList } from "./list-nlhN5bat.js";
|
|
4
4
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
5
5
|
//#region src/edit/odp/shape.d.ts
|
|
6
6
|
declare class OdpShape {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-
|
|
1
|
+
import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-DndYbWuT.js";
|
|
2
2
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
3
3
|
//#region src/edit/odt/table.d.ts
|
|
4
4
|
interface TableInit {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as Box } from "./geometry-DaJr8yQW.js";
|
|
2
|
-
import { t as DrawingParagraphInit } from "./shape-
|
|
2
|
+
import { t as DrawingParagraphInit } from "./shape-B-TjU_Ej.js";
|
|
3
3
|
import { XmlElement } from "ooxml.js";
|
|
4
4
|
//#region src/edit/pptx/table.d.ts
|
|
5
5
|
interface PptxTableInit {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Box, Color, ContentPathPoint, ContentStroke, ContentSubpath } from "document-schema.js";
|
|
1
|
+
import { Box, Color, ContentPathPoint, ContentStroke, ContentSubpath, ContentVector } from "document-schema.js";
|
|
2
2
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
3
3
|
//#region src/edit/odg/vector.d.ts
|
|
4
4
|
interface BoxVectorInit {
|
|
5
5
|
readonly frame: Box;
|
|
6
6
|
readonly fill?: Color;
|
|
7
7
|
readonly stroke?: ContentStroke;
|
|
8
|
+
readonly textFlowAnchored?: boolean;
|
|
8
9
|
}
|
|
9
10
|
type OdgBoxVectorKind = 'rect' | 'ellipse';
|
|
10
11
|
declare function buildRectElement(pkg: Package, init: BoxVectorInit): XmlElement;
|
|
@@ -32,9 +33,11 @@ interface LineVectorInit {
|
|
|
32
33
|
readonly from: ContentPathPoint;
|
|
33
34
|
readonly to: ContentPathPoint;
|
|
34
35
|
readonly stroke: ContentStroke;
|
|
36
|
+
readonly textFlowAnchored?: boolean;
|
|
35
37
|
}
|
|
36
38
|
declare function buildLineElement(pkg: Package, init: LineVectorInit): XmlElement;
|
|
37
39
|
declare class OdgLineVector {
|
|
40
|
+
readonly kind = "line";
|
|
38
41
|
private readonly container;
|
|
39
42
|
private readonly node;
|
|
40
43
|
private readonly pkg;
|
|
@@ -55,9 +58,11 @@ interface PathVectorInit {
|
|
|
55
58
|
readonly subpaths: readonly ContentSubpath[];
|
|
56
59
|
readonly fill?: Color;
|
|
57
60
|
readonly stroke?: ContentStroke;
|
|
61
|
+
readonly textFlowAnchored?: boolean;
|
|
58
62
|
}
|
|
59
63
|
declare function buildPathElement(pkg: Package, init: PathVectorInit): XmlElement;
|
|
60
64
|
declare class OdgPathVector {
|
|
65
|
+
readonly kind = "path";
|
|
61
66
|
private readonly container;
|
|
62
67
|
private readonly node;
|
|
63
68
|
private readonly pkg;
|
|
@@ -76,5 +81,13 @@ declare class OdgPathVector {
|
|
|
76
81
|
get subpaths(): ContentSubpath[];
|
|
77
82
|
remove(): void;
|
|
78
83
|
}
|
|
84
|
+
type OdgVectorKind = OdgBoxVectorKind | 'line' | 'path';
|
|
85
|
+
type OdgVector = OdgBoxVector | OdgLineVector | OdgPathVector;
|
|
86
|
+
declare function wrapVectorElement(container: XmlNode[], node: XmlElement, pkg: Package): OdgVector | undefined;
|
|
87
|
+
interface VectorElementOptions {
|
|
88
|
+
readonly textFlowAnchored?: boolean;
|
|
89
|
+
}
|
|
90
|
+
declare function buildVectorElement(pkg: Package, vector: ContentVector, options?: VectorElementOptions): XmlElement;
|
|
91
|
+
declare function appendVectorTo(container: XmlNode[], pkg: Package, vector: ContentVector, options?: VectorElementOptions): OdgVector;
|
|
79
92
|
//#endregion
|
|
80
|
-
export { OdgLineVector as a,
|
|
93
|
+
export { wrapVectorElement as _, OdgLineVector as a, OdgVectorKind as c, appendVectorTo as d, buildEllipseElement as f, buildVectorElement as g, buildRectElement as h, OdgBoxVectorKind as i, PathVectorInit as l, buildPathElement as m, LineVectorInit as n, OdgPathVector as o, buildLineElement as p, OdgBoxVector as r, OdgVector as s, BoxVectorInit as t, VectorElementOptions as u };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Box, Color, ContentPathPoint, ContentStroke, ContentSubpath } from "document-schema.js";
|
|
1
|
+
import { Box, Color, ContentPathPoint, ContentStroke, ContentSubpath, ContentVector } from "document-schema.js";
|
|
2
2
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
3
3
|
//#region src/edit/odg/vector.d.ts
|
|
4
4
|
interface BoxVectorInit {
|
|
5
5
|
readonly frame: Box;
|
|
6
6
|
readonly fill?: Color;
|
|
7
7
|
readonly stroke?: ContentStroke;
|
|
8
|
+
readonly textFlowAnchored?: boolean;
|
|
8
9
|
}
|
|
9
10
|
type OdgBoxVectorKind = 'rect' | 'ellipse';
|
|
10
11
|
declare function buildRectElement(pkg: Package, init: BoxVectorInit): XmlElement;
|
|
@@ -32,9 +33,11 @@ interface LineVectorInit {
|
|
|
32
33
|
readonly from: ContentPathPoint;
|
|
33
34
|
readonly to: ContentPathPoint;
|
|
34
35
|
readonly stroke: ContentStroke;
|
|
36
|
+
readonly textFlowAnchored?: boolean;
|
|
35
37
|
}
|
|
36
38
|
declare function buildLineElement(pkg: Package, init: LineVectorInit): XmlElement;
|
|
37
39
|
declare class OdgLineVector {
|
|
40
|
+
readonly kind = "line";
|
|
38
41
|
private readonly container;
|
|
39
42
|
private readonly node;
|
|
40
43
|
private readonly pkg;
|
|
@@ -55,9 +58,11 @@ interface PathVectorInit {
|
|
|
55
58
|
readonly subpaths: readonly ContentSubpath[];
|
|
56
59
|
readonly fill?: Color;
|
|
57
60
|
readonly stroke?: ContentStroke;
|
|
61
|
+
readonly textFlowAnchored?: boolean;
|
|
58
62
|
}
|
|
59
63
|
declare function buildPathElement(pkg: Package, init: PathVectorInit): XmlElement;
|
|
60
64
|
declare class OdgPathVector {
|
|
65
|
+
readonly kind = "path";
|
|
61
66
|
private readonly container;
|
|
62
67
|
private readonly node;
|
|
63
68
|
private readonly pkg;
|
|
@@ -76,5 +81,13 @@ declare class OdgPathVector {
|
|
|
76
81
|
get subpaths(): ContentSubpath[];
|
|
77
82
|
remove(): void;
|
|
78
83
|
}
|
|
84
|
+
type OdgVectorKind = OdgBoxVectorKind | 'line' | 'path';
|
|
85
|
+
type OdgVector = OdgBoxVector | OdgLineVector | OdgPathVector;
|
|
86
|
+
declare function wrapVectorElement(container: XmlNode[], node: XmlElement, pkg: Package): OdgVector | undefined;
|
|
87
|
+
interface VectorElementOptions {
|
|
88
|
+
readonly textFlowAnchored?: boolean;
|
|
89
|
+
}
|
|
90
|
+
declare function buildVectorElement(pkg: Package, vector: ContentVector, options?: VectorElementOptions): XmlElement;
|
|
91
|
+
declare function appendVectorTo(container: XmlNode[], pkg: Package, vector: ContentVector, options?: VectorElementOptions): OdgVector;
|
|
79
92
|
//#endregion
|
|
80
|
-
export { OdgLineVector as a,
|
|
93
|
+
export { wrapVectorElement as _, OdgLineVector as a, OdgVectorKind as c, appendVectorTo as d, buildEllipseElement as f, buildVectorElement as g, buildRectElement as h, OdgBoxVectorKind as i, PathVectorInit as l, buildPathElement as m, LineVectorInit as n, OdgPathVector as o, buildLineElement as p, OdgBoxVector as r, OdgVector as s, BoxVectorInit as t, VectorElementOptions as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js.documents",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.67.0",
|
|
4
4
|
"description": "Bidirectional docx/pptx <-> PDF conversion and a read+write editable OOXML document model, built on ooxml.js and Zod 4 codecs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
],
|
|
59
59
|
"license": "MIT",
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"document-schema.js": "^2.
|
|
61
|
+
"document-schema.js": "^2.2.0",
|
|
62
62
|
"fflate": "^0.8.3",
|
|
63
63
|
"markdown-codec": "github:ExaDev/markdown-codec#beda0a89d92fffd153d5dcd05d767b404b721cda",
|
|
64
|
-
"odf.js": "^2.
|
|
64
|
+
"odf.js": "^2.2.0",
|
|
65
65
|
"ooxml.js": "^2.6.1",
|
|
66
66
|
"pdf-codec": "^1.8.0",
|
|
67
67
|
"zod": "^4.4.3"
|
package/dist/color-Bo228AY2.d.ts
DELETED