js.documents 1.65.0 → 1.66.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 +9 -6
- package/dist/color-C98dn-pT.d.ts +2 -0
- 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 +5 -5
- package/dist/index.d.ts +11 -11
- package/dist/index.js +2 -2
- package/dist/layout/shared.cjs +1 -0
- package/dist/layout/shared.js +1 -0
- 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 +2 -2
- package/dist/color-Bo228AY2.d.ts +0 -2
package/dist/edit/odg/vector.cjs
CHANGED
|
@@ -13,7 +13,8 @@ function directTextP() {
|
|
|
13
13
|
function buildBoxVectorElement(pkg, tag, init) {
|
|
14
14
|
const styleName = require_edit_odg_style.buildGraphicStyle(pkg, {
|
|
15
15
|
fill: init.fill,
|
|
16
|
-
stroke: init.stroke
|
|
16
|
+
stroke: init.stroke,
|
|
17
|
+
textFlowAnchored: init.textFlowAnchored
|
|
17
18
|
});
|
|
18
19
|
return require_xml_fragment.el(tag, {
|
|
19
20
|
"draw:style-name": styleName,
|
|
@@ -81,7 +82,10 @@ var OdgBoxVector = class {
|
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
84
|
function buildLineElement(pkg, init) {
|
|
84
|
-
const styleName = require_edit_odg_style.buildGraphicStyle(pkg, {
|
|
85
|
+
const styleName = require_edit_odg_style.buildGraphicStyle(pkg, {
|
|
86
|
+
stroke: init.stroke,
|
|
87
|
+
textFlowAnchored: init.textFlowAnchored
|
|
88
|
+
});
|
|
85
89
|
return require_xml_fragment.el("draw:line", {
|
|
86
90
|
"draw:style-name": styleName,
|
|
87
91
|
"svg:x1": (0, odf_js.formatOdfLength)(init.from.xPt),
|
|
@@ -91,6 +95,7 @@ function buildLineElement(pkg, init) {
|
|
|
91
95
|
}, [directTextP()]);
|
|
92
96
|
}
|
|
93
97
|
var OdgLineVector = class {
|
|
98
|
+
kind = "line";
|
|
94
99
|
container;
|
|
95
100
|
node;
|
|
96
101
|
pkg;
|
|
@@ -137,7 +142,8 @@ var OdgLineVector = class {
|
|
|
137
142
|
function buildPathElement(pkg, init) {
|
|
138
143
|
const styleName = require_edit_odg_style.buildGraphicStyle(pkg, {
|
|
139
144
|
fill: init.fill,
|
|
140
|
-
stroke: init.stroke
|
|
145
|
+
stroke: init.stroke,
|
|
146
|
+
textFlowAnchored: init.textFlowAnchored
|
|
141
147
|
});
|
|
142
148
|
return require_xml_fragment.el("draw:path", {
|
|
143
149
|
"draw:style-name": styleName,
|
|
@@ -150,6 +156,7 @@ function buildPathElement(pkg, init) {
|
|
|
150
156
|
}, [directTextP()]);
|
|
151
157
|
}
|
|
152
158
|
var OdgPathVector = class {
|
|
159
|
+
kind = "path";
|
|
153
160
|
container;
|
|
154
161
|
node;
|
|
155
162
|
pkg;
|
|
@@ -207,11 +214,66 @@ var OdgPathVector = class {
|
|
|
207
214
|
this.removed = true;
|
|
208
215
|
}
|
|
209
216
|
};
|
|
217
|
+
function wrapVectorElement(container, node, pkg) {
|
|
218
|
+
switch (node.tag) {
|
|
219
|
+
case "draw:rect":
|
|
220
|
+
case "draw:ellipse": return new OdgBoxVector(container, node, pkg);
|
|
221
|
+
case "draw:line": return new OdgLineVector(container, node, pkg);
|
|
222
|
+
case "draw:path": return new OdgPathVector(container, node, pkg);
|
|
223
|
+
default: return;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function buildVectorElement(pkg, vector, options) {
|
|
227
|
+
const textFlowAnchored = options?.textFlowAnchored;
|
|
228
|
+
const element = buildUnanchoredVectorElement(pkg, vector, textFlowAnchored);
|
|
229
|
+
if (textFlowAnchored === true) require_xml_edit.setAttr(element, "text:anchor-type", "paragraph");
|
|
230
|
+
return element;
|
|
231
|
+
}
|
|
232
|
+
function appendVectorTo(container, pkg, vector, options) {
|
|
233
|
+
const element = buildVectorElement(pkg, vector, options);
|
|
234
|
+
container.push(element);
|
|
235
|
+
switch (vector.kind) {
|
|
236
|
+
case "line": return new OdgLineVector(container, element, pkg);
|
|
237
|
+
case "path": return new OdgPathVector(container, element, pkg);
|
|
238
|
+
case "rect":
|
|
239
|
+
case "ellipse": return new OdgBoxVector(container, element, pkg);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function buildUnanchoredVectorElement(pkg, vector, textFlowAnchored) {
|
|
243
|
+
if (vector.kind === "line") return buildLineElement(pkg, {
|
|
244
|
+
from: vector.from,
|
|
245
|
+
to: vector.to,
|
|
246
|
+
stroke: vector.stroke,
|
|
247
|
+
textFlowAnchored
|
|
248
|
+
});
|
|
249
|
+
const element = vector.kind === "rect" ? buildRectElement(pkg, {
|
|
250
|
+
frame: vector.frame,
|
|
251
|
+
fill: vector.fill,
|
|
252
|
+
stroke: vector.stroke,
|
|
253
|
+
textFlowAnchored
|
|
254
|
+
}) : vector.kind === "ellipse" ? buildEllipseElement(pkg, {
|
|
255
|
+
frame: vector.frame,
|
|
256
|
+
fill: vector.fill,
|
|
257
|
+
stroke: vector.stroke,
|
|
258
|
+
textFlowAnchored
|
|
259
|
+
}) : buildPathElement(pkg, {
|
|
260
|
+
frame: vector.frame,
|
|
261
|
+
subpaths: vector.subpaths,
|
|
262
|
+
fill: vector.fill,
|
|
263
|
+
stroke: vector.stroke,
|
|
264
|
+
textFlowAnchored
|
|
265
|
+
});
|
|
266
|
+
if (vector.rotationDeg !== void 0) require_edit_geometry.applyOdfGeometry(element, vector.frame, vector.rotationDeg);
|
|
267
|
+
return element;
|
|
268
|
+
}
|
|
210
269
|
//#endregion
|
|
211
270
|
exports.OdgBoxVector = OdgBoxVector;
|
|
212
271
|
exports.OdgLineVector = OdgLineVector;
|
|
213
272
|
exports.OdgPathVector = OdgPathVector;
|
|
273
|
+
exports.appendVectorTo = appendVectorTo;
|
|
214
274
|
exports.buildEllipseElement = buildEllipseElement;
|
|
215
275
|
exports.buildLineElement = buildLineElement;
|
|
216
276
|
exports.buildPathElement = buildPathElement;
|
|
217
277
|
exports.buildRectElement = buildRectElement;
|
|
278
|
+
exports.buildVectorElement = buildVectorElement;
|
|
279
|
+
exports.wrapVectorElement = wrapVectorElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OdgLineVector, c as
|
|
2
|
-
export { BoxVectorInit, LineVectorInit, OdgBoxVector, OdgBoxVectorKind, OdgLineVector, OdgPathVector, PathVectorInit, buildEllipseElement, buildLineElement, buildPathElement, buildRectElement };
|
|
1
|
+
import { _ as wrapVectorElement, a as OdgLineVector, c as OdgVectorKind, d as appendVectorTo, f as buildEllipseElement, g as buildVectorElement, h as buildRectElement, i as OdgBoxVectorKind, l as PathVectorInit, m as buildPathElement, n as LineVectorInit, o as OdgPathVector, p as buildLineElement, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit, u as VectorElementOptions } from "../../vector-D03KX8Ux.cjs";
|
|
2
|
+
export { BoxVectorInit, LineVectorInit, OdgBoxVector, OdgBoxVectorKind, OdgLineVector, OdgPathVector, OdgVector, OdgVectorKind, PathVectorInit, VectorElementOptions, appendVectorTo, buildEllipseElement, buildLineElement, buildPathElement, buildRectElement, buildVectorElement, wrapVectorElement };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OdgLineVector, c as
|
|
2
|
-
export { BoxVectorInit, LineVectorInit, OdgBoxVector, OdgBoxVectorKind, OdgLineVector, OdgPathVector, PathVectorInit, buildEllipseElement, buildLineElement, buildPathElement, buildRectElement };
|
|
1
|
+
import { _ as wrapVectorElement, a as OdgLineVector, c as OdgVectorKind, d as appendVectorTo, f as buildEllipseElement, g as buildVectorElement, h as buildRectElement, i as OdgBoxVectorKind, l as PathVectorInit, m as buildPathElement, n as LineVectorInit, o as OdgPathVector, p as buildLineElement, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit, u as VectorElementOptions } from "../../vector-D03KX8Ux.js";
|
|
2
|
+
export { BoxVectorInit, LineVectorInit, OdgBoxVector, OdgBoxVectorKind, OdgLineVector, OdgPathVector, OdgVector, OdgVectorKind, PathVectorInit, VectorElementOptions, appendVectorTo, buildEllipseElement, buildLineElement, buildPathElement, buildRectElement, buildVectorElement, wrapVectorElement };
|
package/dist/edit/odg/vector.js
CHANGED
|
@@ -12,7 +12,8 @@ function directTextP() {
|
|
|
12
12
|
function buildBoxVectorElement(pkg, tag, init) {
|
|
13
13
|
const styleName = buildGraphicStyle(pkg, {
|
|
14
14
|
fill: init.fill,
|
|
15
|
-
stroke: init.stroke
|
|
15
|
+
stroke: init.stroke,
|
|
16
|
+
textFlowAnchored: init.textFlowAnchored
|
|
16
17
|
});
|
|
17
18
|
return el(tag, {
|
|
18
19
|
"draw:style-name": styleName,
|
|
@@ -80,7 +81,10 @@ var OdgBoxVector = class {
|
|
|
80
81
|
}
|
|
81
82
|
};
|
|
82
83
|
function buildLineElement(pkg, init) {
|
|
83
|
-
const styleName = buildGraphicStyle(pkg, {
|
|
84
|
+
const styleName = buildGraphicStyle(pkg, {
|
|
85
|
+
stroke: init.stroke,
|
|
86
|
+
textFlowAnchored: init.textFlowAnchored
|
|
87
|
+
});
|
|
84
88
|
return el("draw:line", {
|
|
85
89
|
"draw:style-name": styleName,
|
|
86
90
|
"svg:x1": formatOdfLength(init.from.xPt),
|
|
@@ -90,6 +94,7 @@ function buildLineElement(pkg, init) {
|
|
|
90
94
|
}, [directTextP()]);
|
|
91
95
|
}
|
|
92
96
|
var OdgLineVector = class {
|
|
97
|
+
kind = "line";
|
|
93
98
|
container;
|
|
94
99
|
node;
|
|
95
100
|
pkg;
|
|
@@ -136,7 +141,8 @@ var OdgLineVector = class {
|
|
|
136
141
|
function buildPathElement(pkg, init) {
|
|
137
142
|
const styleName = buildGraphicStyle(pkg, {
|
|
138
143
|
fill: init.fill,
|
|
139
|
-
stroke: init.stroke
|
|
144
|
+
stroke: init.stroke,
|
|
145
|
+
textFlowAnchored: init.textFlowAnchored
|
|
140
146
|
});
|
|
141
147
|
return el("draw:path", {
|
|
142
148
|
"draw:style-name": styleName,
|
|
@@ -149,6 +155,7 @@ function buildPathElement(pkg, init) {
|
|
|
149
155
|
}, [directTextP()]);
|
|
150
156
|
}
|
|
151
157
|
var OdgPathVector = class {
|
|
158
|
+
kind = "path";
|
|
152
159
|
container;
|
|
153
160
|
node;
|
|
154
161
|
pkg;
|
|
@@ -206,5 +213,57 @@ var OdgPathVector = class {
|
|
|
206
213
|
this.removed = true;
|
|
207
214
|
}
|
|
208
215
|
};
|
|
216
|
+
function wrapVectorElement(container, node, pkg) {
|
|
217
|
+
switch (node.tag) {
|
|
218
|
+
case "draw:rect":
|
|
219
|
+
case "draw:ellipse": return new OdgBoxVector(container, node, pkg);
|
|
220
|
+
case "draw:line": return new OdgLineVector(container, node, pkg);
|
|
221
|
+
case "draw:path": return new OdgPathVector(container, node, pkg);
|
|
222
|
+
default: return;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function buildVectorElement(pkg, vector, options) {
|
|
226
|
+
const textFlowAnchored = options?.textFlowAnchored;
|
|
227
|
+
const element = buildUnanchoredVectorElement(pkg, vector, textFlowAnchored);
|
|
228
|
+
if (textFlowAnchored === true) setAttr(element, "text:anchor-type", "paragraph");
|
|
229
|
+
return element;
|
|
230
|
+
}
|
|
231
|
+
function appendVectorTo(container, pkg, vector, options) {
|
|
232
|
+
const element = buildVectorElement(pkg, vector, options);
|
|
233
|
+
container.push(element);
|
|
234
|
+
switch (vector.kind) {
|
|
235
|
+
case "line": return new OdgLineVector(container, element, pkg);
|
|
236
|
+
case "path": return new OdgPathVector(container, element, pkg);
|
|
237
|
+
case "rect":
|
|
238
|
+
case "ellipse": return new OdgBoxVector(container, element, pkg);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
function buildUnanchoredVectorElement(pkg, vector, textFlowAnchored) {
|
|
242
|
+
if (vector.kind === "line") return buildLineElement(pkg, {
|
|
243
|
+
from: vector.from,
|
|
244
|
+
to: vector.to,
|
|
245
|
+
stroke: vector.stroke,
|
|
246
|
+
textFlowAnchored
|
|
247
|
+
});
|
|
248
|
+
const element = vector.kind === "rect" ? buildRectElement(pkg, {
|
|
249
|
+
frame: vector.frame,
|
|
250
|
+
fill: vector.fill,
|
|
251
|
+
stroke: vector.stroke,
|
|
252
|
+
textFlowAnchored
|
|
253
|
+
}) : vector.kind === "ellipse" ? buildEllipseElement(pkg, {
|
|
254
|
+
frame: vector.frame,
|
|
255
|
+
fill: vector.fill,
|
|
256
|
+
stroke: vector.stroke,
|
|
257
|
+
textFlowAnchored
|
|
258
|
+
}) : buildPathElement(pkg, {
|
|
259
|
+
frame: vector.frame,
|
|
260
|
+
subpaths: vector.subpaths,
|
|
261
|
+
fill: vector.fill,
|
|
262
|
+
stroke: vector.stroke,
|
|
263
|
+
textFlowAnchored
|
|
264
|
+
});
|
|
265
|
+
if (vector.rotationDeg !== void 0) applyOdfGeometry(element, vector.frame, vector.rotationDeg);
|
|
266
|
+
return element;
|
|
267
|
+
}
|
|
209
268
|
//#endregion
|
|
210
|
-
export { OdgBoxVector, OdgLineVector, OdgPathVector, buildEllipseElement, buildLineElement, buildPathElement, buildRectElement };
|
|
269
|
+
export { OdgBoxVector, OdgLineVector, OdgPathVector, appendVectorTo, buildEllipseElement, buildLineElement, buildPathElement, buildRectElement, buildVectorElement, wrapVectorElement };
|
|
@@ -18,7 +18,10 @@ function buildOdpPackage(content) {
|
|
|
18
18
|
}
|
|
19
19
|
function appendShape(slide, shape) {
|
|
20
20
|
const [onlyBlock] = shape.blocks;
|
|
21
|
-
if (shape.blocks.length === 1 && onlyBlock?.kind === "embeddedObject" && require_model_embedded_drawing.drawingOfBlock(onlyBlock) !== void 0)
|
|
21
|
+
if (shape.blocks.length === 1 && onlyBlock?.kind === "embeddedObject" && require_model_embedded_drawing.drawingOfBlock(onlyBlock) !== void 0) {
|
|
22
|
+
for (const vector of require_model_embedded_drawing.embeddedDrawingVectors(onlyBlock, shape.frame)) slide.addVector(vector);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
22
25
|
if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
|
|
23
26
|
const imageShape = slide.addImage({
|
|
24
27
|
frame: shape.frame,
|
package/dist/edit/odp/content.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { drawingOfBlock } from "../../model/embedded-drawing.js";
|
|
1
|
+
import { drawingOfBlock, embeddedDrawingVectors } from "../../model/embedded-drawing.js";
|
|
2
2
|
import { populateOdtTable, populateParagraph } from "../odt/content.js";
|
|
3
3
|
import { createOdp } from "./editor.js";
|
|
4
4
|
import { base64ToBytes } from "odf.js";
|
|
@@ -17,7 +17,10 @@ function buildOdpPackage(content) {
|
|
|
17
17
|
}
|
|
18
18
|
function appendShape(slide, shape) {
|
|
19
19
|
const [onlyBlock] = shape.blocks;
|
|
20
|
-
if (shape.blocks.length === 1 && onlyBlock?.kind === "embeddedObject" && drawingOfBlock(onlyBlock) !== void 0)
|
|
20
|
+
if (shape.blocks.length === 1 && onlyBlock?.kind === "embeddedObject" && drawingOfBlock(onlyBlock) !== void 0) {
|
|
21
|
+
for (const vector of embeddedDrawingVectors(onlyBlock, shape.frame)) slide.addVector(vector);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
21
24
|
if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
|
|
22
25
|
const imageShape = slide.addImage({
|
|
23
26
|
frame: shape.frame,
|
package/dist/edit/odp/shape.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
3
3
|
const require_xml_edit = require("../../xml/edit.cjs");
|
|
4
|
+
const require_edit_geometry = require("../geometry.cjs");
|
|
4
5
|
const require_edit_odt_paragraph = require("../odt/paragraph.cjs");
|
|
5
6
|
const require_edit_odt_list = require("../odt/list.cjs");
|
|
6
|
-
const require_edit_geometry = require("../geometry.cjs");
|
|
7
7
|
let ooxml_js = require("ooxml.js");
|
|
8
8
|
let odf_js = require("odf.js");
|
|
9
9
|
//#region src/edit/odp/shape.ts
|
|
@@ -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-C8qDhn0l.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-XGp__l-J.js";
|
|
2
2
|
export { OdpShape, buildImageFrame, buildTableFrame, buildTextBoxFrame };
|
package/dist/edit/odp/shape.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { el } from "../../xml/fragment.js";
|
|
2
2
|
import { removeChild } from "../../xml/edit.js";
|
|
3
|
+
import { applyOdfGeometry } from "../geometry.js";
|
|
3
4
|
import { OdtParagraph, buildParagraph } from "../odt/paragraph.js";
|
|
4
5
|
import { OdtList, buildList } from "../odt/list.js";
|
|
5
|
-
import { applyOdfGeometry } from "../geometry.js";
|
|
6
6
|
import { attr } from "ooxml.js";
|
|
7
7
|
import { formatOdfLength, resolveOdfShapeGeometry } from "odf.js";
|
|
8
8
|
//#region src/edit/odp/shape.ts
|
package/dist/edit/odp/slide.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_xml_fragment = require("../../xml/fragment.cjs");
|
|
3
3
|
const require_xml_edit = require("../../xml/edit.cjs");
|
|
4
|
+
const require_edit_odg_vector = require("../odg/vector.cjs");
|
|
4
5
|
const require_xml_odf_text = require("../../xml/odf-text.cjs");
|
|
5
6
|
const require_edit_odt_paragraph = require("../odt/paragraph.cjs");
|
|
6
7
|
const require_edit_odt_table = require("../odt/table.cjs");
|
|
@@ -70,6 +71,9 @@ var OdpSlide = class {
|
|
|
70
71
|
table: new require_edit_odt_table.OdtTable(frameElement.children, tableElement, this.context.pkg)
|
|
71
72
|
};
|
|
72
73
|
}
|
|
74
|
+
addVector(vector) {
|
|
75
|
+
return require_edit_odg_vector.appendVectorTo(this.live().children, this.context.pkg, vector);
|
|
76
|
+
}
|
|
73
77
|
get notes() {
|
|
74
78
|
const notesElement = directChild(this.live(), "presentation:notes");
|
|
75
79
|
if (notesElement === void 0) return "";
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { t as Box } from "../../geometry-DaJr8yQW.cjs";
|
|
1
|
+
import { t as Box$1 } from "../../geometry-DaJr8yQW.cjs";
|
|
2
2
|
import { t as ImageInit } from "../../image-M5SezZVI.cjs";
|
|
3
|
-
import { t as OdpShape } from "../../shape-
|
|
3
|
+
import { t as OdpShape } from "../../shape-C8qDhn0l.cjs";
|
|
4
|
+
import { s as OdgVector } from "../../vector-D03KX8Ux.cjs";
|
|
4
5
|
import { i as TableInit, t as OdtTable } from "../../table-DjYcNOFm.cjs";
|
|
6
|
+
import { ContentVector } from "document-schema.js";
|
|
5
7
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
6
8
|
//#region src/edit/odp/slide.d.ts
|
|
7
9
|
interface TextBoxInit {
|
|
8
|
-
readonly frame: Box;
|
|
10
|
+
readonly frame: Box$1;
|
|
9
11
|
readonly text: string;
|
|
10
12
|
}
|
|
11
13
|
interface SlideImageInit extends ImageInit {
|
|
12
|
-
readonly frame: Box;
|
|
14
|
+
readonly frame: Box$1;
|
|
13
15
|
}
|
|
14
16
|
interface SlideTableInit {
|
|
15
|
-
readonly frame: Box;
|
|
17
|
+
readonly frame: Box$1;
|
|
16
18
|
readonly table: TableInit;
|
|
17
19
|
}
|
|
18
20
|
interface SlideContext {
|
|
@@ -33,6 +35,7 @@ declare class OdpSlide {
|
|
|
33
35
|
addTextBox(init: TextBoxInit): OdpShape;
|
|
34
36
|
addImage(init: SlideImageInit): OdpShape;
|
|
35
37
|
addTable(init: SlideTableInit): OdpTableShape;
|
|
38
|
+
addVector(vector: ContentVector): OdgVector;
|
|
36
39
|
get notes(): string;
|
|
37
40
|
set notes(value: string);
|
|
38
41
|
remove(): void;
|
package/dist/edit/odp/slide.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { t as Box } from "../../geometry-DaJr8yQW.js";
|
|
1
|
+
import { t as Box$1 } from "../../geometry-DaJr8yQW.js";
|
|
2
2
|
import { t as ImageInit } from "../../image-DHcA9kaK.js";
|
|
3
|
-
import { t as OdpShape } from "../../shape-
|
|
4
|
-
import {
|
|
3
|
+
import { t as OdpShape } from "../../shape-XGp__l-J.js";
|
|
4
|
+
import { s as OdgVector } from "../../vector-D03KX8Ux.js";
|
|
5
|
+
import { i as TableInit, t as OdtTable } from "../../table-BHeUmLzZ.js";
|
|
6
|
+
import { ContentVector } from "document-schema.js";
|
|
5
7
|
import { Package, XmlElement, XmlNode } from "odf.js";
|
|
6
8
|
//#region src/edit/odp/slide.d.ts
|
|
7
9
|
interface TextBoxInit {
|
|
8
|
-
readonly frame: Box;
|
|
10
|
+
readonly frame: Box$1;
|
|
9
11
|
readonly text: string;
|
|
10
12
|
}
|
|
11
13
|
interface SlideImageInit extends ImageInit {
|
|
12
|
-
readonly frame: Box;
|
|
14
|
+
readonly frame: Box$1;
|
|
13
15
|
}
|
|
14
16
|
interface SlideTableInit {
|
|
15
|
-
readonly frame: Box;
|
|
17
|
+
readonly frame: Box$1;
|
|
16
18
|
readonly table: TableInit;
|
|
17
19
|
}
|
|
18
20
|
interface SlideContext {
|
|
@@ -33,6 +35,7 @@ declare class OdpSlide {
|
|
|
33
35
|
addTextBox(init: TextBoxInit): OdpShape;
|
|
34
36
|
addImage(init: SlideImageInit): OdpShape;
|
|
35
37
|
addTable(init: SlideTableInit): OdpTableShape;
|
|
38
|
+
addVector(vector: ContentVector): OdgVector;
|
|
36
39
|
get notes(): string;
|
|
37
40
|
set notes(value: string);
|
|
38
41
|
remove(): void;
|
package/dist/edit/odp/slide.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { el } from "../../xml/fragment.js";
|
|
2
2
|
import { removeChild } from "../../xml/edit.js";
|
|
3
|
+
import { appendVectorTo } from "../odg/vector.js";
|
|
3
4
|
import { decodeOdfText as decodeOdfText$1 } from "../../xml/odf-text.js";
|
|
4
5
|
import { buildParagraph } from "../odt/paragraph.js";
|
|
5
6
|
import { OdtTable, buildTable } from "../odt/table.js";
|
|
@@ -69,6 +70,9 @@ var OdpSlide = class {
|
|
|
69
70
|
table: new OdtTable(frameElement.children, tableElement, this.context.pkg)
|
|
70
71
|
};
|
|
71
72
|
}
|
|
73
|
+
addVector(vector) {
|
|
74
|
+
return appendVectorTo(this.live().children, this.context.pkg, vector);
|
|
75
|
+
}
|
|
72
76
|
get notes() {
|
|
73
77
|
const notesElement = directChild(this.live(), "presentation:notes");
|
|
74
78
|
if (notesElement === void 0) return "";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_model_embedded_drawing = require("../../model/embedded-drawing.cjs");
|
|
2
3
|
const require_model_formula = require("../../model/formula.cjs");
|
|
3
4
|
const require_edit_odt_editor = require("./editor.cjs");
|
|
4
5
|
//#region src/edit/odt/content.ts
|
|
@@ -137,6 +138,10 @@ function appendBlock(body, block) {
|
|
|
137
138
|
else if (block.kind === "embeddedObject") appendEmbeddedObject(body, block);
|
|
138
139
|
}
|
|
139
140
|
function appendEmbeddedObject(body, block) {
|
|
141
|
+
if (require_model_embedded_drawing.drawingOfBlock(block) !== void 0) {
|
|
142
|
+
body.appendVectors(require_model_embedded_drawing.embeddedDrawingVectors(block, require_model_embedded_drawing.FLOW_CONTAINER_ORIGIN));
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
140
145
|
const formula = require_model_formula.formulaOfBlock(block);
|
|
141
146
|
if (formula === void 0) return;
|
|
142
147
|
if (formula.mathml.length === 0) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as OdtParagraph } from "../../paragraph-
|
|
2
|
-
import { t as OdtTable } from "../../table-
|
|
1
|
+
import { t as OdtParagraph } from "../../paragraph-DndYbWuT.js";
|
|
2
|
+
import { t as OdtTable } from "../../table-BHeUmLzZ.js";
|
|
3
3
|
import { ContentDocument, ContentParagraph, ContentTable } from "document-schema.js";
|
|
4
4
|
import { Package } from "odf.js";
|
|
5
5
|
//#region src/edit/odt/content.d.ts
|
package/dist/edit/odt/content.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FLOW_CONTAINER_ORIGIN, drawingOfBlock, embeddedDrawingVectors } from "../../model/embedded-drawing.js";
|
|
1
2
|
import { formulaOfBlock, formulaPlaceholderText } from "../../model/formula.js";
|
|
2
3
|
import { createOdt } from "./editor.js";
|
|
3
4
|
//#region src/edit/odt/content.ts
|
|
@@ -136,6 +137,10 @@ function appendBlock(body, block) {
|
|
|
136
137
|
else if (block.kind === "embeddedObject") appendEmbeddedObject(body, block);
|
|
137
138
|
}
|
|
138
139
|
function appendEmbeddedObject(body, block) {
|
|
140
|
+
if (drawingOfBlock(block) !== void 0) {
|
|
141
|
+
body.appendVectors(embeddedDrawingVectors(block, FLOW_CONTAINER_ORIGIN));
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
139
144
|
const formula = formulaOfBlock(block);
|
|
140
145
|
if (formula === void 0) return;
|
|
141
146
|
if (formula.mathml.length === 0) {
|
package/dist/edit/odt/editor.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_edit_odt_automatic_styles = require("./automatic-styles.cjs");
|
|
3
|
+
const require_edit_odg_vector = require("../odg/vector.cjs");
|
|
3
4
|
const require_edit_odt_formula = require("./formula.cjs");
|
|
4
5
|
const require_edit_odt_paragraph = require("./paragraph.cjs");
|
|
5
6
|
const require_edit_odt_list = require("./list.cjs");
|
|
@@ -51,6 +52,12 @@ var OdtBodyImpl = class {
|
|
|
51
52
|
this.officeText.children.push(paragraphElement);
|
|
52
53
|
return new require_edit_odt_paragraph.OdtParagraph(this.officeText.children, paragraphElement, this.pkg);
|
|
53
54
|
}
|
|
55
|
+
appendVectors(vectors) {
|
|
56
|
+
const paragraphElement = require_edit_odt_paragraph.buildParagraph(this.pkg);
|
|
57
|
+
for (const vector of vectors) paragraphElement.children.push(require_edit_odg_vector.buildVectorElement(this.pkg, vector, { textFlowAnchored: true }));
|
|
58
|
+
this.officeText.children.push(paragraphElement);
|
|
59
|
+
return new require_edit_odt_paragraph.OdtParagraph(this.officeText.children, paragraphElement, this.pkg);
|
|
60
|
+
}
|
|
54
61
|
appendPageBreak() {
|
|
55
62
|
const paragraphElement = require_edit_odt_paragraph.buildParagraph(this.pkg);
|
|
56
63
|
paragraphElement.attributes.push({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as Box$1 } 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 { i as TableInit, t as OdtTable } from "../../table-DjYcNOFm.cjs";
|
|
5
|
-
import { ContentFormula } from "document-schema.js";
|
|
5
|
+
import { ContentFormula, ContentVector } from "document-schema.js";
|
|
6
6
|
import { Package } from "odf.js";
|
|
7
7
|
//#region src/edit/odt/editor.d.ts
|
|
8
8
|
interface OdtBody {
|
|
@@ -11,6 +11,7 @@ interface OdtBody {
|
|
|
11
11
|
appendList(): OdtList;
|
|
12
12
|
appendPageBreak(): void;
|
|
13
13
|
appendFormula(formula: ContentFormula, frame: Box$1): OdtParagraph;
|
|
14
|
+
appendVectors(vectors: readonly ContentVector[]): OdtParagraph;
|
|
14
15
|
}
|
|
15
16
|
declare class OdtEditor {
|
|
16
17
|
readonly body: OdtBody;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as Box$1 } from "../../geometry-DaJr8yQW.js";
|
|
2
|
-
import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-
|
|
3
|
-
import { t as OdtList } from "../../list-
|
|
4
|
-
import { i as TableInit, t as OdtTable } from "../../table-
|
|
5
|
-
import { ContentFormula } from "document-schema.js";
|
|
2
|
+
import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-DndYbWuT.js";
|
|
3
|
+
import { t as OdtList } from "../../list-nlhN5bat.js";
|
|
4
|
+
import { i as TableInit, t as OdtTable } from "../../table-BHeUmLzZ.js";
|
|
5
|
+
import { ContentFormula, ContentVector } from "document-schema.js";
|
|
6
6
|
import { Package } from "odf.js";
|
|
7
7
|
//#region src/edit/odt/editor.d.ts
|
|
8
8
|
interface OdtBody {
|
|
@@ -11,6 +11,7 @@ interface OdtBody {
|
|
|
11
11
|
appendList(): OdtList;
|
|
12
12
|
appendPageBreak(): void;
|
|
13
13
|
appendFormula(formula: ContentFormula, frame: Box$1): OdtParagraph;
|
|
14
|
+
appendVectors(vectors: readonly ContentVector[]): OdtParagraph;
|
|
14
15
|
}
|
|
15
16
|
declare class OdtEditor {
|
|
16
17
|
readonly body: OdtBody;
|
package/dist/edit/odt/editor.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ensurePageBreakStyleName } from "./automatic-styles.js";
|
|
2
|
+
import { buildVectorElement } from "../odg/vector.js";
|
|
2
3
|
import { insertFormulaFrameMedia } from "./formula.js";
|
|
3
4
|
import { OdtParagraph, buildParagraph } from "./paragraph.js";
|
|
4
5
|
import { OdtList, buildList } from "./list.js";
|
|
@@ -50,6 +51,12 @@ var OdtBodyImpl = class {
|
|
|
50
51
|
this.officeText.children.push(paragraphElement);
|
|
51
52
|
return new OdtParagraph(this.officeText.children, paragraphElement, this.pkg);
|
|
52
53
|
}
|
|
54
|
+
appendVectors(vectors) {
|
|
55
|
+
const paragraphElement = buildParagraph(this.pkg);
|
|
56
|
+
for (const vector of vectors) paragraphElement.children.push(buildVectorElement(this.pkg, vector, { textFlowAnchored: true }));
|
|
57
|
+
this.officeText.children.push(paragraphElement);
|
|
58
|
+
return new OdtParagraph(this.officeText.children, paragraphElement, this.pkg);
|
|
59
|
+
}
|
|
53
60
|
appendPageBreak() {
|
|
54
61
|
const paragraphElement = buildParagraph(this.pkg);
|
|
55
62
|
paragraphElement.attributes.push({
|
package/dist/edit/odt/list.cjs
CHANGED
|
@@ -33,6 +33,19 @@ var OdtListItem = class {
|
|
|
33
33
|
this.node = node;
|
|
34
34
|
this.pkg = pkg;
|
|
35
35
|
}
|
|
36
|
+
paragraphs() {
|
|
37
|
+
const out = [];
|
|
38
|
+
for (const child of this.node.children) if (child.type === "element" && child.tag === "text:p") out.push(new require_edit_odt_paragraph.OdtParagraph(this.node.children, child, this.pkg));
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
get text() {
|
|
42
|
+
return this.paragraphs().map((p) => p.text).join("\n");
|
|
43
|
+
}
|
|
44
|
+
nestedLists() {
|
|
45
|
+
const out = [];
|
|
46
|
+
for (const child of this.node.children) if (child.type === "element" && child.tag === "text:list") out.push(new OdtList(this.node.children, child, this.pkg));
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
36
49
|
appendParagraph(init) {
|
|
37
50
|
const paragraphElement = require_edit_odt_paragraph.buildParagraph(this.pkg, init);
|
|
38
51
|
this.node.children.push(paragraphElement);
|
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-BzcN-LTJ.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-nlhN5bat.js";
|
|
2
2
|
export { OdtList, OdtListItem, buildList };
|
package/dist/edit/odt/list.js
CHANGED
|
@@ -32,6 +32,19 @@ var OdtListItem = class {
|
|
|
32
32
|
this.node = node;
|
|
33
33
|
this.pkg = pkg;
|
|
34
34
|
}
|
|
35
|
+
paragraphs() {
|
|
36
|
+
const out = [];
|
|
37
|
+
for (const child of this.node.children) if (child.type === "element" && child.tag === "text:p") out.push(new OdtParagraph(this.node.children, child, this.pkg));
|
|
38
|
+
return out;
|
|
39
|
+
}
|
|
40
|
+
get text() {
|
|
41
|
+
return this.paragraphs().map((p) => p.text).join("\n");
|
|
42
|
+
}
|
|
43
|
+
nestedLists() {
|
|
44
|
+
const out = [];
|
|
45
|
+
for (const child of this.node.children) if (child.type === "element" && child.tag === "text:list") out.push(new OdtList(this.node.children, child, this.pkg));
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
35
48
|
appendParagraph(init) {
|
|
36
49
|
const paragraphElement = buildParagraph(this.pkg, init);
|
|
37
50
|
this.node.children.push(paragraphElement);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-
|
|
1
|
+
import { n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-DndYbWuT.js";
|
|
2
2
|
export { OdtParagraph, ParagraphInit, buildParagraph };
|
package/dist/edit/odt/run.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RunInit, r as buildRun, t as OdtRun } from "../../run-
|
|
1
|
+
import { n as RunInit, r as buildRun, t as OdtRun } from "../../run-DtrwZwN6.js";
|
|
2
2
|
export { OdtRun, RunInit, buildRun };
|
package/dist/edit/odt/table.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as buildTable, i as TableInit, n as OdtTableCell, r as OdtTableRow, t as OdtTable } from "../../table-
|
|
1
|
+
import { a as buildTable, i as TableInit, n as OdtTableCell, r as OdtTableRow, t as OdtTable } from "../../table-BHeUmLzZ.js";
|
|
2
2
|
export { OdtTable, OdtTableCell, OdtTableRow, TableInit, buildTable };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_edit_pptx_editor = require("./editor.cjs");
|
|
3
2
|
const require_model_embedded_drawing = require("../../model/embedded-drawing.cjs");
|
|
3
|
+
const require_edit_pptx_editor = require("./editor.cjs");
|
|
4
4
|
let ooxml_js = require("ooxml.js");
|
|
5
5
|
//#region src/edit/pptx/content.ts
|
|
6
6
|
function buildPptxPackage(content) {
|
|
@@ -17,7 +17,10 @@ function buildPptxPackage(content) {
|
|
|
17
17
|
}
|
|
18
18
|
function appendShape(slide, shape) {
|
|
19
19
|
const [onlyBlock] = shape.blocks;
|
|
20
|
-
if (shape.blocks.length === 1 && onlyBlock?.kind === "embeddedObject" && require_model_embedded_drawing.drawingOfBlock(onlyBlock) !== void 0)
|
|
20
|
+
if (shape.blocks.length === 1 && onlyBlock?.kind === "embeddedObject" && require_model_embedded_drawing.drawingOfBlock(onlyBlock) !== void 0) {
|
|
21
|
+
for (const vector of require_model_embedded_drawing.embeddedDrawingVectors(onlyBlock, shape.frame)) slide.addVector(vector);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
21
24
|
if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
|
|
22
25
|
const imageShape = slide.addImage({
|
|
23
26
|
frame: shape.frame,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { drawingOfBlock, embeddedDrawingVectors } from "../../model/embedded-drawing.js";
|
|
1
2
|
import { createPptx } from "./editor.js";
|
|
2
|
-
import { drawingOfBlock } from "../../model/embedded-drawing.js";
|
|
3
3
|
import { base64ToBytes } from "ooxml.js";
|
|
4
4
|
//#region src/edit/pptx/content.ts
|
|
5
5
|
function buildPptxPackage(content) {
|
|
@@ -16,7 +16,10 @@ function buildPptxPackage(content) {
|
|
|
16
16
|
}
|
|
17
17
|
function appendShape(slide, shape) {
|
|
18
18
|
const [onlyBlock] = shape.blocks;
|
|
19
|
-
if (shape.blocks.length === 1 && onlyBlock?.kind === "embeddedObject" && drawingOfBlock(onlyBlock) !== void 0)
|
|
19
|
+
if (shape.blocks.length === 1 && onlyBlock?.kind === "embeddedObject" && drawingOfBlock(onlyBlock) !== void 0) {
|
|
20
|
+
for (const vector of embeddedDrawingVectors(onlyBlock, shape.frame)) slide.addVector(vector);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
20
23
|
if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
|
|
21
24
|
const imageShape = slide.addImage({
|
|
22
25
|
frame: shape.frame,
|