js.documents 1.60.3 → 1.62.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.
Files changed (216) hide show
  1. package/README.md +84 -44
  2. package/dist/{blr-types-CYYC3yYU.d.cts → blr-types-DVgO1DQ9.d.cts} +1 -1
  3. package/dist/{blr-types-CYYC3yYU.d.ts → blr-types-DVgO1DQ9.d.ts} +1 -1
  4. package/dist/convert/capability.cjs +1 -0
  5. package/dist/convert/capability.d.cts +1 -1
  6. package/dist/convert/capability.d.ts +1 -1
  7. package/dist/convert/capability.js +1 -0
  8. package/dist/convert/convert.cjs +29 -27
  9. package/dist/convert/convert.d.cts +9 -3
  10. package/dist/convert/convert.d.ts +9 -3
  11. package/dist/convert/convert.js +29 -27
  12. package/dist/edit/docx/content.cjs +75 -13
  13. package/dist/edit/docx/content.d.cts +8 -2
  14. package/dist/edit/docx/content.d.ts +8 -2
  15. package/dist/edit/docx/content.js +75 -13
  16. package/dist/edit/docx/paragraph.cjs +14 -0
  17. package/dist/edit/docx/paragraph.d.cts +5 -0
  18. package/dist/edit/docx/paragraph.d.ts +5 -0
  19. package/dist/edit/docx/paragraph.js +14 -0
  20. package/dist/edit/docx/run.cjs +1 -1
  21. package/dist/edit/docx/run.js +1 -1
  22. package/dist/edit/docx/table.cjs +41 -0
  23. package/dist/edit/docx/table.d.cts +7 -1
  24. package/dist/edit/docx/table.d.ts +7 -1
  25. package/dist/edit/docx/table.js +42 -1
  26. package/dist/edit/geometry.cjs +38 -0
  27. package/dist/edit/geometry.d.cts +7 -0
  28. package/dist/edit/geometry.d.ts +7 -0
  29. package/dist/edit/geometry.js +36 -0
  30. package/dist/edit/odg/content.cjs +15 -12
  31. package/dist/edit/odg/content.js +15 -12
  32. package/dist/edit/odg/editor.d.cts +1 -1
  33. package/dist/edit/odg/editor.d.ts +1 -1
  34. package/dist/edit/odg/page.d.cts +3 -3
  35. package/dist/edit/odg/page.d.ts +3 -3
  36. package/dist/edit/odg/vector.cjs +22 -13
  37. package/dist/edit/odg/vector.d.cts +1 -1
  38. package/dist/edit/odg/vector.d.ts +1 -1
  39. package/dist/edit/odg/vector.js +23 -14
  40. package/dist/edit/odp/content.cjs +15 -0
  41. package/dist/edit/odp/content.js +16 -1
  42. package/dist/edit/odp/editor.d.cts +1 -1
  43. package/dist/edit/odp/editor.d.ts +1 -1
  44. package/dist/edit/odp/image.d.cts +1 -1
  45. package/dist/edit/odp/image.d.ts +1 -1
  46. package/dist/edit/odp/shape.cjs +11 -30
  47. package/dist/edit/odp/shape.d.cts +2 -2
  48. package/dist/edit/odp/shape.d.ts +2 -2
  49. package/dist/edit/odp/shape.js +13 -33
  50. package/dist/edit/odp/slide.cjs +11 -0
  51. package/dist/edit/odp/slide.d.cts +14 -4
  52. package/dist/edit/odp/slide.d.ts +14 -4
  53. package/dist/edit/odp/slide.js +12 -1
  54. package/dist/edit/odt/content.cjs +56 -16
  55. package/dist/edit/odt/content.d.cts +4 -2
  56. package/dist/edit/odt/content.d.ts +4 -2
  57. package/dist/edit/odt/content.js +56 -17
  58. package/dist/edit/odt/editor.d.cts +1 -1
  59. package/dist/edit/odt/editor.d.ts +1 -1
  60. package/dist/edit/odt/table.cjs +36 -0
  61. package/dist/edit/odt/table.d.cts +1 -36
  62. package/dist/edit/odt/table.d.ts +1 -36
  63. package/dist/edit/odt/table.js +37 -1
  64. package/dist/edit/pptx/content.cjs +71 -3
  65. package/dist/edit/pptx/content.js +71 -3
  66. package/dist/edit/pptx/editor.d.cts +1 -1
  67. package/dist/edit/pptx/editor.d.ts +1 -1
  68. package/dist/edit/pptx/image.d.cts +1 -1
  69. package/dist/edit/pptx/image.d.ts +1 -1
  70. package/dist/edit/pptx/shape.cjs +23 -1
  71. package/dist/edit/pptx/shape.d.cts +2 -2
  72. package/dist/edit/pptx/shape.d.ts +2 -2
  73. package/dist/edit/pptx/shape.js +23 -3
  74. package/dist/edit/pptx/slide.cjs +10 -1
  75. package/dist/edit/pptx/slide.d.cts +11 -4
  76. package/dist/edit/pptx/slide.d.ts +11 -4
  77. package/dist/edit/pptx/slide.js +10 -1
  78. package/dist/edit/pptx/table.cjs +136 -0
  79. package/dist/edit/pptx/table.d.cts +2 -0
  80. package/dist/edit/pptx/table.d.ts +2 -0
  81. package/dist/edit/pptx/table.js +131 -0
  82. package/dist/firebird/backup.d.cts +1 -1
  83. package/dist/firebird/backup.d.ts +1 -1
  84. package/dist/firebird/blr-types.cjs +2 -2
  85. package/dist/firebird/blr-types.d.cts +1 -1
  86. package/dist/firebird/blr-types.d.ts +1 -1
  87. package/dist/firebird/blr-types.js +2 -2
  88. package/dist/firebird/data.cjs +68 -14
  89. package/dist/firebird/data.d.cts +1 -1
  90. package/dist/firebird/data.d.ts +1 -1
  91. package/dist/firebird/data.js +68 -14
  92. package/dist/firebird/schema.cjs +13 -1
  93. package/dist/firebird/schema.d.cts +1 -1
  94. package/dist/firebird/schema.d.ts +1 -1
  95. package/dist/firebird/schema.js +13 -1
  96. package/dist/{geometry-DvwdrIij.d.cts → geometry-DaJr8yQW.d.cts} +2 -2
  97. package/dist/{geometry-DvwdrIij.d.ts → geometry-DaJr8yQW.d.ts} +2 -2
  98. package/dist/hsqldb/binary-script.cjs +154 -0
  99. package/dist/hsqldb/binary-script.d.cts +15 -0
  100. package/dist/hsqldb/binary-script.d.ts +15 -0
  101. package/dist/hsqldb/binary-script.js +151 -0
  102. package/dist/hsqldb/cache.cjs +18 -11
  103. package/dist/hsqldb/cache.d.cts +9 -4
  104. package/dist/hsqldb/cache.d.ts +9 -4
  105. package/dist/hsqldb/cache.js +18 -11
  106. package/dist/hsqldb/rowformat.cjs +60 -16
  107. package/dist/hsqldb/rowformat.d.cts +2 -21
  108. package/dist/hsqldb/rowformat.d.ts +2 -21
  109. package/dist/hsqldb/rowformat.js +60 -17
  110. package/dist/{image-BZDy72Jb.d.cts → image-7snmKIxn.d.cts} +1 -1
  111. package/dist/{image-B-xQWYYS.d.ts → image-Cs8xF753.d.ts} +1 -1
  112. package/dist/{image-CeqwL-Qs.d.ts → image-DHcA9kaK.d.ts} +1 -1
  113. package/dist/{image-DWX6cNOD.d.cts → image-M5SezZVI.d.cts} +1 -1
  114. package/dist/index.cjs +54 -3
  115. package/dist/index.d.cts +28 -20
  116. package/dist/index.d.ts +27 -19
  117. package/dist/index.js +13 -4
  118. package/dist/layout/cell-typing.cjs +209 -0
  119. package/dist/layout/cell-typing.d.cts +22 -0
  120. package/dist/layout/cell-typing.d.ts +22 -0
  121. package/dist/layout/cell-typing.js +208 -0
  122. package/dist/layout/drawing.cjs +193 -17
  123. package/dist/layout/drawing.js +193 -17
  124. package/dist/layout/engine.cjs +46 -29
  125. package/dist/layout/engine.d.cts +0 -2
  126. package/dist/layout/engine.d.ts +0 -2
  127. package/dist/layout/engine.js +47 -30
  128. package/dist/layout/lattice.cjs +139 -0
  129. package/dist/layout/lattice.d.cts +20 -0
  130. package/dist/layout/lattice.d.ts +20 -0
  131. package/dist/layout/lattice.js +135 -0
  132. package/dist/layout/reconstruct.cjs +176 -113
  133. package/dist/layout/reconstruct.d.cts +2 -0
  134. package/dist/layout/reconstruct.d.ts +2 -0
  135. package/dist/layout/reconstruct.js +173 -110
  136. package/dist/layout/shared.cjs +52 -0
  137. package/dist/layout/shared.d.cts +4 -2
  138. package/dist/layout/shared.d.ts +4 -2
  139. package/dist/layout/shared.js +51 -1
  140. package/dist/layout/sheets.cjs +45 -11
  141. package/dist/layout/sheets.js +46 -12
  142. package/dist/layout/slides.cjs +7 -7
  143. package/dist/layout/slides.d.cts +0 -3
  144. package/dist/layout/slides.d.ts +0 -3
  145. package/dist/layout/slides.js +7 -7
  146. package/dist/markdown/write.cjs +19 -6
  147. package/dist/markdown/write.js +19 -6
  148. package/dist/mathml/layout.cjs +43 -9
  149. package/dist/mathml/layout.d.cts +1 -1
  150. package/dist/mathml/layout.d.ts +1 -1
  151. package/dist/mathml/layout.js +43 -9
  152. package/dist/mathml/variant.cjs +48 -5
  153. package/dist/mathml/variant.js +48 -5
  154. package/dist/model/embedded-drawing.cjs +32 -0
  155. package/dist/model/embedded-drawing.d.cts +8 -0
  156. package/dist/model/embedded-drawing.d.ts +8 -0
  157. package/dist/model/embedded-drawing.js +30 -0
  158. package/dist/model/formula.cjs +31 -0
  159. package/dist/model/formula.d.cts +6 -6
  160. package/dist/model/formula.d.ts +6 -6
  161. package/dist/model/formula.js +27 -0
  162. package/dist/model/geometry.d.cts +1 -1
  163. package/dist/model/geometry.d.ts +1 -1
  164. package/dist/model/paint-order.cjs +15 -0
  165. package/dist/model/paint-order.d.cts +14 -0
  166. package/dist/model/paint-order.d.ts +14 -0
  167. package/dist/model/paint-order.js +14 -0
  168. package/dist/odb/components.cjs +12 -0
  169. package/dist/odb/components.d.cts +6 -0
  170. package/dist/odb/components.d.ts +6 -0
  171. package/dist/odb/components.js +10 -0
  172. package/dist/odb/read.cjs +11 -7
  173. package/dist/odb/read.d.cts +3 -2
  174. package/dist/odb/read.d.ts +3 -2
  175. package/dist/odb/read.js +11 -7
  176. package/dist/odf/formula/detect.cjs +86 -18
  177. package/dist/odf/formula/detect.d.cts +10 -6
  178. package/dist/odf/formula/detect.d.ts +10 -6
  179. package/dist/odf/formula/detect.js +86 -19
  180. package/dist/odf/formula/read.cjs +4 -16
  181. package/dist/odf/formula/read.d.cts +4 -8
  182. package/dist/odf/formula/read.d.ts +4 -8
  183. package/dist/odf/formula/read.js +5 -17
  184. package/dist/odf/odp/read.cjs +9 -19
  185. package/dist/odf/odp/read.d.cts +2 -7
  186. package/dist/odf/odp/read.d.ts +2 -7
  187. package/dist/odf/odp/read.js +10 -20
  188. package/dist/odf/odt/read.cjs +63 -23
  189. package/dist/odf/odt/read.d.cts +2 -7
  190. package/dist/odf/odt/read.d.ts +2 -7
  191. package/dist/odf/odt/read.js +64 -24
  192. package/dist/omml/write.cjs +258 -0
  193. package/dist/omml/write.d.cts +2 -0
  194. package/dist/omml/write.d.ts +2 -0
  195. package/dist/omml/write.js +256 -0
  196. package/dist/rowformat-Cl2exlEh.d.cts +25 -0
  197. package/dist/rowformat-Cl2exlEh.d.ts +25 -0
  198. package/dist/{schema-Acco3Ezi.d.cts → schema-BeR_KJ0X.d.cts} +3 -1
  199. package/dist/{schema-VkAA6pF5.d.ts → schema-CSKwSb_v.d.ts} +3 -1
  200. package/dist/{shape-BUfjw5eZ.d.cts → shape-BhkP6HB8.d.cts} +6 -2
  201. package/dist/{shape-CTkl6kt8.d.ts → shape-BkVcwPcf.d.ts} +6 -2
  202. package/dist/{shape-BfN3m52m.d.ts → shape-CVXedeL7.d.ts} +3 -2
  203. package/dist/{shape-CN2ycxOo.d.cts → shape-CXZ6fejV.d.cts} +3 -2
  204. package/dist/table-C3CPZ--2.d.cts +35 -0
  205. package/dist/table-DjYcNOFm.d.cts +44 -0
  206. package/dist/table-DqfqMkVq.d.ts +44 -0
  207. package/dist/table-DvS_7UQS.d.ts +35 -0
  208. package/dist/{vector-ClohqsOe.d.cts → vector-Puuqu_IT.d.cts} +4 -0
  209. package/dist/{vector-ClohqsOe.d.ts → vector-Puuqu_IT.d.ts} +4 -0
  210. package/dist/write-DuyfnbL_.d.cts +16 -0
  211. package/dist/write-Zqwx6pka.d.ts +16 -0
  212. package/package.json +4 -4
  213. package/dist/odf/formula/placeholder.cjs +0 -36
  214. package/dist/odf/formula/placeholder.d.cts +0 -14
  215. package/dist/odf/formula/placeholder.d.ts +0 -14
  216. package/dist/odf/formula/placeholder.js +0 -36
@@ -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_geometry = require("../geometry.cjs");
4
5
  const require_edit_odg_style = require("./style.cjs");
5
6
  const require_edit_odg_svg_path = require("./svg-path.cjs");
6
7
  let ooxml_js = require("ooxml.js");
@@ -49,14 +50,18 @@ var OdgBoxVector = class {
49
50
  return (0, ooxml_js.attr)(this.live(), "draw:name");
50
51
  }
51
52
  get frame() {
52
- return (0, odf_js.parseBox)(this.live());
53
+ return (0, odf_js.resolveOdfShapeGeometry)(this.live())?.frame;
53
54
  }
54
55
  set frame(value) {
55
- const node = this.live();
56
- require_xml_edit.setAttr(node, "svg:x", (0, odf_js.formatOdfLength)(value.xPt));
57
- require_xml_edit.setAttr(node, "svg:y", (0, odf_js.formatOdfLength)(value.yPt));
58
- require_xml_edit.setAttr(node, "svg:width", (0, odf_js.formatOdfLength)(value.widthPt));
59
- require_xml_edit.setAttr(node, "svg:height", (0, odf_js.formatOdfLength)(value.heightPt));
56
+ require_edit_geometry.applyOdfGeometry(this.live(), value, this.rotationDeg);
57
+ }
58
+ get rotationDeg() {
59
+ return (0, odf_js.resolveOdfShapeGeometry)(this.live())?.rotationDeg;
60
+ }
61
+ set rotationDeg(value) {
62
+ const currentFrame = this.frame;
63
+ if (currentFrame === void 0) throw new Error("cannot set rotationDeg on a vector with no resolvable frame (missing svg:width/svg:height)");
64
+ require_edit_geometry.applyOdfGeometry(this.live(), currentFrame, value);
60
65
  }
61
66
  get fill() {
62
67
  return require_edit_odg_style.readGraphicFill(this.pkg, this.live());
@@ -162,14 +167,18 @@ var OdgPathVector = class {
162
167
  return (0, ooxml_js.attr)(this.live(), "draw:name");
163
168
  }
164
169
  get frame() {
165
- return (0, odf_js.parseBox)(this.live());
170
+ return (0, odf_js.resolveOdfShapeGeometry)(this.live())?.frame;
166
171
  }
167
172
  set frame(value) {
168
- const node = this.live();
169
- require_xml_edit.setAttr(node, "svg:x", (0, odf_js.formatOdfLength)(value.xPt));
170
- require_xml_edit.setAttr(node, "svg:y", (0, odf_js.formatOdfLength)(value.yPt));
171
- require_xml_edit.setAttr(node, "svg:width", (0, odf_js.formatOdfLength)(value.widthPt));
172
- require_xml_edit.setAttr(node, "svg:height", (0, odf_js.formatOdfLength)(value.heightPt));
173
+ require_edit_geometry.applyOdfGeometry(this.live(), value, this.rotationDeg);
174
+ }
175
+ get rotationDeg() {
176
+ return (0, odf_js.resolveOdfShapeGeometry)(this.live())?.rotationDeg;
177
+ }
178
+ set rotationDeg(value) {
179
+ const currentFrame = this.frame;
180
+ if (currentFrame === void 0) throw new Error("cannot set rotationDeg on a vector with no resolvable frame (missing svg:width/svg:height)");
181
+ require_edit_geometry.applyOdfGeometry(this.live(), currentFrame, value);
173
182
  }
174
183
  get fill() {
175
184
  return require_edit_odg_style.readGraphicFill(this.pkg, this.live());
@@ -187,7 +196,7 @@ var OdgPathVector = class {
187
196
  const node = this.live();
188
197
  const viewBoxValue = (0, ooxml_js.attr)(node, "svg:viewBox");
189
198
  const dValue = (0, ooxml_js.attr)(node, "svg:d");
190
- const frame = (0, odf_js.parseBox)(node);
199
+ const frame = (0, odf_js.resolveOdfShapeGeometry)(node)?.frame;
191
200
  if (viewBoxValue === void 0 || dValue === void 0 || frame === void 0) return [];
192
201
  const viewBox = (0, odf_js.parseOdfViewBox)(viewBoxValue);
193
202
  if (viewBox === void 0) return [];
@@ -1,2 +1,2 @@
1
- import { a as OdgLineVector, c as buildEllipseElement, d as buildRectElement, i as OdgBoxVectorKind, l as buildLineElement, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as PathVectorInit, t as BoxVectorInit, u as buildPathElement } from "../../vector-ClohqsOe.cjs";
1
+ import { a as OdgLineVector, c as buildEllipseElement, d as buildRectElement, i as OdgBoxVectorKind, l as buildLineElement, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as PathVectorInit, t as BoxVectorInit, u as buildPathElement } from "../../vector-Puuqu_IT.cjs";
2
2
  export { BoxVectorInit, LineVectorInit, OdgBoxVector, OdgBoxVectorKind, OdgLineVector, OdgPathVector, PathVectorInit, buildEllipseElement, buildLineElement, buildPathElement, buildRectElement };
@@ -1,2 +1,2 @@
1
- import { a as OdgLineVector, c as buildEllipseElement, d as buildRectElement, i as OdgBoxVectorKind, l as buildLineElement, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as PathVectorInit, t as BoxVectorInit, u as buildPathElement } from "../../vector-ClohqsOe.js";
1
+ import { a as OdgLineVector, c as buildEllipseElement, d as buildRectElement, i as OdgBoxVectorKind, l as buildLineElement, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as PathVectorInit, t as BoxVectorInit, u as buildPathElement } from "../../vector-Puuqu_IT.js";
2
2
  export { BoxVectorInit, LineVectorInit, OdgBoxVector, OdgBoxVectorKind, OdgLineVector, OdgPathVector, PathVectorInit, buildEllipseElement, buildLineElement, buildPathElement, buildRectElement };
@@ -1,9 +1,10 @@
1
1
  import { el } from "../../xml/fragment.js";
2
2
  import { removeChild, setAttr } from "../../xml/edit.js";
3
+ import { applyOdfGeometry } from "../geometry.js";
3
4
  import { buildGraphicStyle, readGraphicFill, readGraphicStroke, setGraphicFill, setGraphicStroke } from "./style.js";
4
5
  import { buildSvgPathData, buildSvgViewBox } from "./svg-path.js";
5
6
  import { attr } from "ooxml.js";
6
- import { buildOdfSubpaths, formatOdfLength, parseBox, parseLinePoints, parseOdfPathData, parseOdfViewBox } from "odf.js";
7
+ import { buildOdfSubpaths, formatOdfLength, parseLinePoints, parseOdfPathData, parseOdfViewBox, resolveOdfShapeGeometry } from "odf.js";
7
8
  //#region src/edit/odg/vector.ts
8
9
  function directTextP() {
9
10
  return el("text:p");
@@ -48,14 +49,18 @@ var OdgBoxVector = class {
48
49
  return attr(this.live(), "draw:name");
49
50
  }
50
51
  get frame() {
51
- return parseBox(this.live());
52
+ return resolveOdfShapeGeometry(this.live())?.frame;
52
53
  }
53
54
  set frame(value) {
54
- const node = this.live();
55
- setAttr(node, "svg:x", formatOdfLength(value.xPt));
56
- setAttr(node, "svg:y", formatOdfLength(value.yPt));
57
- setAttr(node, "svg:width", formatOdfLength(value.widthPt));
58
- setAttr(node, "svg:height", formatOdfLength(value.heightPt));
55
+ applyOdfGeometry(this.live(), value, this.rotationDeg);
56
+ }
57
+ get rotationDeg() {
58
+ return resolveOdfShapeGeometry(this.live())?.rotationDeg;
59
+ }
60
+ set rotationDeg(value) {
61
+ const currentFrame = this.frame;
62
+ if (currentFrame === void 0) throw new Error("cannot set rotationDeg on a vector with no resolvable frame (missing svg:width/svg:height)");
63
+ applyOdfGeometry(this.live(), currentFrame, value);
59
64
  }
60
65
  get fill() {
61
66
  return readGraphicFill(this.pkg, this.live());
@@ -161,14 +166,18 @@ var OdgPathVector = class {
161
166
  return attr(this.live(), "draw:name");
162
167
  }
163
168
  get frame() {
164
- return parseBox(this.live());
169
+ return resolveOdfShapeGeometry(this.live())?.frame;
165
170
  }
166
171
  set frame(value) {
167
- const node = this.live();
168
- setAttr(node, "svg:x", formatOdfLength(value.xPt));
169
- setAttr(node, "svg:y", formatOdfLength(value.yPt));
170
- setAttr(node, "svg:width", formatOdfLength(value.widthPt));
171
- setAttr(node, "svg:height", formatOdfLength(value.heightPt));
172
+ applyOdfGeometry(this.live(), value, this.rotationDeg);
173
+ }
174
+ get rotationDeg() {
175
+ return resolveOdfShapeGeometry(this.live())?.rotationDeg;
176
+ }
177
+ set rotationDeg(value) {
178
+ const currentFrame = this.frame;
179
+ if (currentFrame === void 0) throw new Error("cannot set rotationDeg on a vector with no resolvable frame (missing svg:width/svg:height)");
180
+ applyOdfGeometry(this.live(), currentFrame, value);
172
181
  }
173
182
  get fill() {
174
183
  return readGraphicFill(this.pkg, this.live());
@@ -186,7 +195,7 @@ var OdgPathVector = class {
186
195
  const node = this.live();
187
196
  const viewBoxValue = attr(node, "svg:viewBox");
188
197
  const dValue = attr(node, "svg:d");
189
- const frame = parseBox(node);
198
+ const frame = resolveOdfShapeGeometry(node)?.frame;
190
199
  if (viewBoxValue === void 0 || dValue === void 0 || frame === void 0) return [];
191
200
  const viewBox = parseOdfViewBox(viewBoxValue);
192
201
  if (viewBox === 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_edit_odt_content = require("../odt/content.cjs");
3
4
  const require_edit_odp_editor = require("./editor.cjs");
4
5
  let odf_js = require("odf.js");
@@ -17,6 +18,7 @@ function buildOdpPackage(content) {
17
18
  }
18
19
  function appendShape(slide, shape) {
19
20
  const [onlyBlock] = shape.blocks;
21
+ if (shape.blocks.length === 1 && onlyBlock?.kind === "embeddedObject" && require_model_embedded_drawing.drawingOfBlock(onlyBlock) !== void 0) return;
20
22
  if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
21
23
  const imageShape = slide.addImage({
22
24
  frame: shape.frame,
@@ -27,6 +29,19 @@ function appendShape(slide, shape) {
27
29
  if (shape.rotationDeg !== void 0) imageShape.rotationDeg = shape.rotationDeg;
28
30
  return;
29
31
  }
32
+ if (shape.blocks.length === 1 && onlyBlock?.kind === "table") {
33
+ const { shape: tableFrame, table } = slide.addTable({
34
+ frame: shape.frame,
35
+ table: {
36
+ rows: onlyBlock.rows.length,
37
+ columns: onlyBlock.columnWidthsPt.length,
38
+ columnWidthsPt: onlyBlock.columnWidthsPt
39
+ }
40
+ });
41
+ if (shape.rotationDeg !== void 0) tableFrame.rotationDeg = shape.rotationDeg;
42
+ require_edit_odt_content.populateOdtTable(table, onlyBlock);
43
+ return;
44
+ }
30
45
  const textShape = slide.addTextBox({
31
46
  frame: shape.frame,
32
47
  text: ""
@@ -1,4 +1,5 @@
1
- import { populateParagraph } from "../odt/content.js";
1
+ import { drawingOfBlock } from "../../model/embedded-drawing.js";
2
+ import { populateOdtTable, populateParagraph } from "../odt/content.js";
2
3
  import { createOdp } from "./editor.js";
3
4
  import { base64ToBytes } from "odf.js";
4
5
  //#region src/edit/odp/content.ts
@@ -16,6 +17,7 @@ function buildOdpPackage(content) {
16
17
  }
17
18
  function appendShape(slide, shape) {
18
19
  const [onlyBlock] = shape.blocks;
20
+ if (shape.blocks.length === 1 && onlyBlock?.kind === "embeddedObject" && drawingOfBlock(onlyBlock) !== void 0) return;
19
21
  if (shape.blocks.length === 1 && onlyBlock?.kind === "image") {
20
22
  const imageShape = slide.addImage({
21
23
  frame: shape.frame,
@@ -26,6 +28,19 @@ function appendShape(slide, shape) {
26
28
  if (shape.rotationDeg !== void 0) imageShape.rotationDeg = shape.rotationDeg;
27
29
  return;
28
30
  }
31
+ if (shape.blocks.length === 1 && onlyBlock?.kind === "table") {
32
+ const { shape: tableFrame, table } = slide.addTable({
33
+ frame: shape.frame,
34
+ table: {
35
+ rows: onlyBlock.rows.length,
36
+ columns: onlyBlock.columnWidthsPt.length,
37
+ columnWidthsPt: onlyBlock.columnWidthsPt
38
+ }
39
+ });
40
+ if (shape.rotationDeg !== void 0) tableFrame.rotationDeg = shape.rotationDeg;
41
+ populateOdtTable(table, onlyBlock);
42
+ return;
43
+ }
29
44
  const textShape = slide.addTextBox({
30
45
  frame: shape.frame,
31
46
  text: ""
@@ -1,4 +1,4 @@
1
- import { s as PageSize } from "../../geometry-DvwdrIij.cjs";
1
+ import { s as PageSize } from "../../geometry-DaJr8yQW.cjs";
2
2
  import { OdpSlide } from "./slide.cjs";
3
3
  import { Package } from "odf.js";
4
4
  //#region src/edit/odp/editor.d.ts
@@ -1,4 +1,4 @@
1
- import { s as PageSize } from "../../geometry-DvwdrIij.js";
1
+ import { s as PageSize } from "../../geometry-DaJr8yQW.js";
2
2
  import { OdpSlide } from "./slide.js";
3
3
  import { Package } from "odf.js";
4
4
  //#region src/edit/odp/editor.d.ts
@@ -1,2 +1,2 @@
1
- import { n as MediaContext, r as insertImageFrameMedia, t as ImageInit } from "../../image-DWX6cNOD.cjs";
1
+ import { n as MediaContext, r as insertImageFrameMedia, t as ImageInit } from "../../image-M5SezZVI.cjs";
2
2
  export { ImageInit, MediaContext, insertImageFrameMedia };
@@ -1,2 +1,2 @@
1
- import { n as MediaContext, r as insertImageFrameMedia, t as ImageInit } from "../../image-CeqwL-Qs.js";
1
+ import { n as MediaContext, r as insertImageFrameMedia, t as ImageInit } from "../../image-DHcA9kaK.js";
2
2
  export { ImageInit, MediaContext, insertImageFrameMedia };
@@ -3,30 +3,13 @@ const require_xml_fragment = require("../../xml/fragment.cjs");
3
3
  const require_xml_edit = require("../../xml/edit.cjs");
4
4
  const require_edit_odt_paragraph = require("../odt/paragraph.cjs");
5
5
  const require_edit_odt_list = require("../odt/list.cjs");
6
+ const require_edit_geometry = require("../geometry.cjs");
6
7
  let ooxml_js = require("ooxml.js");
7
8
  let odf_js = require("odf.js");
8
9
  //#region src/edit/odp/shape.ts
9
10
  function directChild(parent, tag) {
10
11
  for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
11
12
  }
12
- function buildTransformAttr(frame, rotationDeg) {
13
- const angleRad = -rotationDeg * Math.PI / 180;
14
- const localCenter = {
15
- xPt: frame.widthPt / 2,
16
- yPt: frame.heightPt / 2
17
- };
18
- const rotatedCenter = (0, odf_js.applyOdfTransform)([{
19
- kind: "rotate",
20
- angleRad
21
- }], localCenter);
22
- const desiredCenter = {
23
- xPt: frame.xPt + frame.widthPt / 2,
24
- yPt: frame.yPt + frame.heightPt / 2
25
- };
26
- const txPt = desiredCenter.xPt - rotatedCenter.xPt;
27
- const tyPt = desiredCenter.yPt - rotatedCenter.yPt;
28
- return `rotate(${angleRad}) translate(${(0, odf_js.formatOdfLength)(txPt)} ${(0, odf_js.formatOdfLength)(tyPt)})`;
29
- }
30
13
  var OdpShape = class {
31
14
  container;
32
15
  node;
@@ -59,18 +42,7 @@ var OdpShape = class {
59
42
  this.applyGeometry(currentFrame, value);
60
43
  }
61
44
  applyGeometry(frame, rotationDeg) {
62
- const node = this.live();
63
- require_xml_edit.setAttr(node, "svg:width", (0, odf_js.formatOdfLength)(frame.widthPt));
64
- require_xml_edit.setAttr(node, "svg:height", (0, odf_js.formatOdfLength)(frame.heightPt));
65
- if (rotationDeg === void 0 || rotationDeg === 0) {
66
- require_xml_edit.removeAttr(node, "draw:transform");
67
- require_xml_edit.setAttr(node, "svg:x", (0, odf_js.formatOdfLength)(frame.xPt));
68
- require_xml_edit.setAttr(node, "svg:y", (0, odf_js.formatOdfLength)(frame.yPt));
69
- } else {
70
- require_xml_edit.removeAttr(node, "svg:x");
71
- require_xml_edit.removeAttr(node, "svg:y");
72
- require_xml_edit.setAttr(node, "draw:transform", buildTransformAttr(frame, rotationDeg));
73
- }
45
+ require_edit_geometry.applyOdfGeometry(this.live(), frame, rotationDeg);
74
46
  }
75
47
  textBox(create) {
76
48
  const node = this.live();
@@ -127,7 +99,16 @@ function buildImageFrame(partPath, frame) {
127
99
  "svg:height": (0, odf_js.formatOdfLength)(frame.heightPt)
128
100
  }, [require_xml_fragment.el("draw:image", { "xlink:href": partPath })]);
129
101
  }
102
+ function buildTableFrame(frame, tableElement) {
103
+ return require_xml_fragment.el("draw:frame", {
104
+ "svg:x": (0, odf_js.formatOdfLength)(frame.xPt),
105
+ "svg:y": (0, odf_js.formatOdfLength)(frame.yPt),
106
+ "svg:width": (0, odf_js.formatOdfLength)(frame.widthPt),
107
+ "svg:height": (0, odf_js.formatOdfLength)(frame.heightPt)
108
+ }, [tableElement]);
109
+ }
130
110
  //#endregion
131
111
  exports.OdpShape = OdpShape;
132
112
  exports.buildImageFrame = buildImageFrame;
113
+ exports.buildTableFrame = buildTableFrame;
133
114
  exports.buildTextBoxFrame = buildTextBoxFrame;
@@ -1,2 +1,2 @@
1
- import { n as buildImageFrame, r as buildTextBoxFrame, t as OdpShape } from "../../shape-CN2ycxOo.cjs";
2
- export { OdpShape, buildImageFrame, buildTextBoxFrame };
1
+ import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-CXZ6fejV.cjs";
2
+ export { OdpShape, buildImageFrame, buildTableFrame, buildTextBoxFrame };
@@ -1,2 +1,2 @@
1
- import { n as buildImageFrame, r as buildTextBoxFrame, t as OdpShape } from "../../shape-BfN3m52m.js";
2
- export { OdpShape, buildImageFrame, buildTextBoxFrame };
1
+ import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-CVXedeL7.js";
2
+ export { OdpShape, buildImageFrame, buildTableFrame, buildTextBoxFrame };
@@ -1,31 +1,14 @@
1
1
  import { el } from "../../xml/fragment.js";
2
- import { removeAttr, removeChild, setAttr } from "../../xml/edit.js";
2
+ import { removeChild } from "../../xml/edit.js";
3
3
  import { OdtParagraph, buildParagraph } from "../odt/paragraph.js";
4
4
  import { OdtList, buildList } from "../odt/list.js";
5
+ import { applyOdfGeometry } from "../geometry.js";
5
6
  import { attr } from "ooxml.js";
6
- import { applyOdfTransform, formatOdfLength, resolveOdfShapeGeometry } from "odf.js";
7
+ import { formatOdfLength, resolveOdfShapeGeometry } from "odf.js";
7
8
  //#region src/edit/odp/shape.ts
8
9
  function directChild(parent, tag) {
9
10
  for (const child of parent.children) if (child.type === "element" && child.tag === tag) return child;
10
11
  }
11
- function buildTransformAttr(frame, rotationDeg) {
12
- const angleRad = -rotationDeg * Math.PI / 180;
13
- const localCenter = {
14
- xPt: frame.widthPt / 2,
15
- yPt: frame.heightPt / 2
16
- };
17
- const rotatedCenter = applyOdfTransform([{
18
- kind: "rotate",
19
- angleRad
20
- }], localCenter);
21
- const desiredCenter = {
22
- xPt: frame.xPt + frame.widthPt / 2,
23
- yPt: frame.yPt + frame.heightPt / 2
24
- };
25
- const txPt = desiredCenter.xPt - rotatedCenter.xPt;
26
- const tyPt = desiredCenter.yPt - rotatedCenter.yPt;
27
- return `rotate(${angleRad}) translate(${formatOdfLength(txPt)} ${formatOdfLength(tyPt)})`;
28
- }
29
12
  var OdpShape = class {
30
13
  container;
31
14
  node;
@@ -58,18 +41,7 @@ var OdpShape = class {
58
41
  this.applyGeometry(currentFrame, value);
59
42
  }
60
43
  applyGeometry(frame, rotationDeg) {
61
- const node = this.live();
62
- setAttr(node, "svg:width", formatOdfLength(frame.widthPt));
63
- setAttr(node, "svg:height", formatOdfLength(frame.heightPt));
64
- if (rotationDeg === void 0 || rotationDeg === 0) {
65
- removeAttr(node, "draw:transform");
66
- setAttr(node, "svg:x", formatOdfLength(frame.xPt));
67
- setAttr(node, "svg:y", formatOdfLength(frame.yPt));
68
- } else {
69
- removeAttr(node, "svg:x");
70
- removeAttr(node, "svg:y");
71
- setAttr(node, "draw:transform", buildTransformAttr(frame, rotationDeg));
72
- }
44
+ applyOdfGeometry(this.live(), frame, rotationDeg);
73
45
  }
74
46
  textBox(create) {
75
47
  const node = this.live();
@@ -126,5 +98,13 @@ function buildImageFrame(partPath, frame) {
126
98
  "svg:height": formatOdfLength(frame.heightPt)
127
99
  }, [el("draw:image", { "xlink:href": partPath })]);
128
100
  }
101
+ function buildTableFrame(frame, tableElement) {
102
+ return el("draw:frame", {
103
+ "svg:x": formatOdfLength(frame.xPt),
104
+ "svg:y": formatOdfLength(frame.yPt),
105
+ "svg:width": formatOdfLength(frame.widthPt),
106
+ "svg:height": formatOdfLength(frame.heightPt)
107
+ }, [tableElement]);
108
+ }
129
109
  //#endregion
130
- export { OdpShape, buildImageFrame, buildTextBoxFrame };
110
+ export { OdpShape, buildImageFrame, buildTableFrame, buildTextBoxFrame };
@@ -3,6 +3,7 @@ const require_xml_fragment = require("../../xml/fragment.cjs");
3
3
  const require_xml_edit = require("../../xml/edit.cjs");
4
4
  const require_xml_odf_text = require("../../xml/odf-text.cjs");
5
5
  const require_edit_odt_paragraph = require("../odt/paragraph.cjs");
6
+ const require_edit_odt_table = require("../odt/table.cjs");
6
7
  const require_edit_odp_shape = require("./shape.cjs");
7
8
  const require_edit_odp_image = require("./image.cjs");
8
9
  let ooxml_js = require("ooxml.js");
@@ -59,6 +60,16 @@ var OdpSlide = class {
59
60
  node.children.push(frameElement);
60
61
  return new require_edit_odp_shape.OdpShape(node.children, frameElement, this.context.pkg);
61
62
  }
63
+ addTable(init) {
64
+ const node = this.live();
65
+ const tableElement = require_edit_odt_table.buildTable(this.context.pkg, init.table);
66
+ const frameElement = require_edit_odp_shape.buildTableFrame(init.frame, tableElement);
67
+ node.children.push(frameElement);
68
+ return {
69
+ shape: new require_edit_odp_shape.OdpShape(node.children, frameElement, this.context.pkg),
70
+ table: new require_edit_odt_table.OdtTable(frameElement.children, tableElement, this.context.pkg)
71
+ };
72
+ }
62
73
  get notes() {
63
74
  const notesElement = directChild(this.live(), "presentation:notes");
64
75
  if (notesElement === void 0) return "";
@@ -1,6 +1,7 @@
1
- import { t as Box } from "../../geometry-DvwdrIij.cjs";
2
- import { t as ImageInit } from "../../image-DWX6cNOD.cjs";
3
- import { t as OdpShape } from "../../shape-CN2ycxOo.cjs";
1
+ import { t as Box } from "../../geometry-DaJr8yQW.cjs";
2
+ import { t as ImageInit } from "../../image-M5SezZVI.cjs";
3
+ import { t as OdpShape } from "../../shape-CXZ6fejV.cjs";
4
+ import { i as TableInit, t as OdtTable } from "../../table-DjYcNOFm.cjs";
4
5
  import { Package, XmlElement, XmlNode } from "odf.js";
5
6
  //#region src/edit/odp/slide.d.ts
6
7
  interface TextBoxInit {
@@ -10,9 +11,17 @@ interface TextBoxInit {
10
11
  interface SlideImageInit extends ImageInit {
11
12
  readonly frame: Box;
12
13
  }
14
+ interface SlideTableInit {
15
+ readonly frame: Box;
16
+ readonly table: TableInit;
17
+ }
13
18
  interface SlideContext {
14
19
  readonly pkg: Package;
15
20
  }
21
+ interface OdpTableShape {
22
+ readonly shape: OdpShape;
23
+ readonly table: OdtTable;
24
+ }
16
25
  declare class OdpSlide {
17
26
  private readonly container;
18
27
  private readonly node;
@@ -23,9 +32,10 @@ declare class OdpSlide {
23
32
  shapes(): OdpShape[];
24
33
  addTextBox(init: TextBoxInit): OdpShape;
25
34
  addImage(init: SlideImageInit): OdpShape;
35
+ addTable(init: SlideTableInit): OdpTableShape;
26
36
  get notes(): string;
27
37
  set notes(value: string);
28
38
  remove(): void;
29
39
  }
30
40
  //#endregion
31
- export { OdpSlide, SlideContext, SlideImageInit, TextBoxInit };
41
+ export { OdpSlide, OdpTableShape, SlideContext, SlideImageInit, SlideTableInit, TextBoxInit };
@@ -1,6 +1,7 @@
1
- import { t as Box } from "../../geometry-DvwdrIij.js";
2
- import { t as ImageInit } from "../../image-CeqwL-Qs.js";
3
- import { t as OdpShape } from "../../shape-BfN3m52m.js";
1
+ import { t as Box } from "../../geometry-DaJr8yQW.js";
2
+ import { t as ImageInit } from "../../image-DHcA9kaK.js";
3
+ import { t as OdpShape } from "../../shape-CVXedeL7.js";
4
+ import { i as TableInit, t as OdtTable } from "../../table-DqfqMkVq.js";
4
5
  import { Package, XmlElement, XmlNode } from "odf.js";
5
6
  //#region src/edit/odp/slide.d.ts
6
7
  interface TextBoxInit {
@@ -10,9 +11,17 @@ interface TextBoxInit {
10
11
  interface SlideImageInit extends ImageInit {
11
12
  readonly frame: Box;
12
13
  }
14
+ interface SlideTableInit {
15
+ readonly frame: Box;
16
+ readonly table: TableInit;
17
+ }
13
18
  interface SlideContext {
14
19
  readonly pkg: Package;
15
20
  }
21
+ interface OdpTableShape {
22
+ readonly shape: OdpShape;
23
+ readonly table: OdtTable;
24
+ }
16
25
  declare class OdpSlide {
17
26
  private readonly container;
18
27
  private readonly node;
@@ -23,9 +32,10 @@ declare class OdpSlide {
23
32
  shapes(): OdpShape[];
24
33
  addTextBox(init: TextBoxInit): OdpShape;
25
34
  addImage(init: SlideImageInit): OdpShape;
35
+ addTable(init: SlideTableInit): OdpTableShape;
26
36
  get notes(): string;
27
37
  set notes(value: string);
28
38
  remove(): void;
29
39
  }
30
40
  //#endregion
31
- export { OdpSlide, SlideContext, SlideImageInit, TextBoxInit };
41
+ export { OdpSlide, OdpTableShape, SlideContext, SlideImageInit, SlideTableInit, TextBoxInit };
@@ -2,7 +2,8 @@ import { el } from "../../xml/fragment.js";
2
2
  import { removeChild } from "../../xml/edit.js";
3
3
  import { decodeOdfText as decodeOdfText$1 } from "../../xml/odf-text.js";
4
4
  import { buildParagraph } from "../odt/paragraph.js";
5
- import { OdpShape, buildTextBoxFrame } from "./shape.js";
5
+ import { OdtTable, buildTable } from "../odt/table.js";
6
+ import { OdpShape, buildTableFrame, buildTextBoxFrame } from "./shape.js";
6
7
  import { insertImageFrameMedia } from "./image.js";
7
8
  import { elementsWithTag } from "ooxml.js";
8
9
  import { formatOdfLength } from "odf.js";
@@ -58,6 +59,16 @@ var OdpSlide = class {
58
59
  node.children.push(frameElement);
59
60
  return new OdpShape(node.children, frameElement, this.context.pkg);
60
61
  }
62
+ addTable(init) {
63
+ const node = this.live();
64
+ const tableElement = buildTable(this.context.pkg, init.table);
65
+ const frameElement = buildTableFrame(init.frame, tableElement);
66
+ node.children.push(frameElement);
67
+ return {
68
+ shape: new OdpShape(node.children, frameElement, this.context.pkg),
69
+ table: new OdtTable(frameElement.children, tableElement, this.context.pkg)
70
+ };
71
+ }
61
72
  get notes() {
62
73
  const notesElement = directChild(this.live(), "presentation:notes");
63
74
  if (notesElement === void 0) return "";
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_model_formula = require("../../model/formula.cjs");
2
3
  const require_edit_odt_editor = require("./editor.cjs");
3
4
  //#region src/edit/odt/content.ts
4
5
  function buildOdtPackage(content) {
@@ -75,27 +76,56 @@ function populateParagraph(paragraph, block) {
75
76
  if (run.color !== void 0) odtRun.color = run.color;
76
77
  }
77
78
  }
79
+ function populateCellBlocks(cell, blocks) {
80
+ const [firstBlock, ...restBlocks] = blocks;
81
+ const firstParagraph = cell.paragraphs()[0];
82
+ if (firstBlock?.kind === "paragraph" && firstParagraph !== void 0) populateParagraph(firstParagraph, firstBlock);
83
+ else if (firstBlock !== void 0) appendCellBlock(cell, firstBlock);
84
+ for (const remaining of restBlocks) appendCellBlock(cell, remaining);
85
+ }
86
+ function populateOdtTable(table, block) {
87
+ const verticalMerges = /* @__PURE__ */ new Map();
88
+ block.rows.forEach((row) => {
89
+ const tableRow = table.appendEmptyRow();
90
+ let colIndex = 0;
91
+ let horizontalCoverRemaining = 0;
92
+ row.cells.forEach((cell) => {
93
+ if (horizontalCoverRemaining > 0) {
94
+ tableRow.appendCoveredCell();
95
+ horizontalCoverRemaining -= 1;
96
+ colIndex += 1;
97
+ return;
98
+ }
99
+ const verticalRemaining = verticalMerges.get(colIndex);
100
+ if (verticalRemaining !== void 0 && verticalRemaining > 0) {
101
+ tableRow.appendCoveredCell();
102
+ verticalMerges.set(colIndex, verticalRemaining - 1);
103
+ colIndex += 1;
104
+ return;
105
+ }
106
+ const tableCell = tableRow.appendCell();
107
+ const span = cell.colSpan ?? 1;
108
+ if (span > 1) {
109
+ tableCell.colSpan = span;
110
+ horizontalCoverRemaining = span - 1;
111
+ }
112
+ if (cell.rowSpan !== void 0 && cell.rowSpan > 1) {
113
+ tableCell.rowSpan = cell.rowSpan;
114
+ for (let c = 0; c < span; c++) verticalMerges.set(colIndex + c, cell.rowSpan - 1);
115
+ }
116
+ populateCellBlocks(tableCell, cell.blocks);
117
+ colIndex += 1;
118
+ });
119
+ });
120
+ }
78
121
  function appendTable(body, block) {
79
122
  const columns = block.columnWidthsPt.length;
80
123
  if (block.rows.length === 0 || columns === 0) return;
81
- const table = body.appendTable({
82
- rows: block.rows.length,
124
+ populateOdtTable(body.appendTable({
125
+ rows: 0,
83
126
  columns,
84
127
  columnWidthsPt: block.columnWidthsPt
85
- });
86
- block.rows.forEach((row, rowIndex) => {
87
- const tableRow = table.rows()[rowIndex];
88
- if (tableRow === void 0) return;
89
- row.cells.forEach((cell, cellIndex) => {
90
- const tableCell = tableRow.cells()[cellIndex];
91
- if (tableCell === void 0) return;
92
- const [firstBlock, ...restBlocks] = cell.blocks;
93
- const firstParagraph = tableCell.paragraphs()[0];
94
- if (firstBlock?.kind === "paragraph" && firstParagraph !== void 0) populateParagraph(firstParagraph, firstBlock);
95
- else if (firstBlock !== void 0) appendCellBlock(tableCell, firstBlock);
96
- for (const remaining of restBlocks) appendCellBlock(tableCell, remaining);
97
- });
98
- });
128
+ }), block);
99
129
  }
100
130
  function appendCellBlock(cell, block) {
101
131
  if (block.kind === "paragraph") populateParagraph(cell.appendParagraph(), block);
@@ -104,7 +134,17 @@ function appendBlock(body, block) {
104
134
  if (block.kind === "paragraph") populateParagraph(body.appendParagraph(), block);
105
135
  else if (block.kind === "pageBreak") body.appendPageBreak();
106
136
  else if (block.kind === "table") appendTable(body, block);
137
+ else if (block.kind === "embeddedObject") appendEmbeddedObject(body, block);
138
+ }
139
+ function appendEmbeddedObject(body, block) {
140
+ const formula = require_model_formula.formulaOfBlock(block);
141
+ if (formula === void 0) return;
142
+ populateParagraph(body.appendParagraph(), {
143
+ kind: "paragraph",
144
+ runs: [{ text: require_model_formula.formulaPlaceholderText(formula) }]
145
+ });
107
146
  }
108
147
  //#endregion
109
148
  exports.buildOdtPackage = buildOdtPackage;
149
+ exports.populateOdtTable = populateOdtTable;
110
150
  exports.populateParagraph = populateParagraph;
@@ -1,8 +1,10 @@
1
1
  import { t as OdtParagraph } from "../../paragraph-BXbXKPy3.cjs";
2
- import { ContentDocument, ContentParagraph } from "document-schema.js";
2
+ import { t as OdtTable } from "../../table-DjYcNOFm.cjs";
3
+ import { ContentDocument, ContentParagraph, ContentTable } from "document-schema.js";
3
4
  import { Package } from "odf.js";
4
5
  //#region src/edit/odt/content.d.ts
5
6
  declare function buildOdtPackage(content: ContentDocument): Package;
6
7
  declare function populateParagraph(paragraph: OdtParagraph, block: ContentParagraph): void;
8
+ declare function populateOdtTable(table: OdtTable, block: ContentTable): void;
7
9
  //#endregion
8
- export { buildOdtPackage, populateParagraph };
10
+ export { buildOdtPackage, populateOdtTable, populateParagraph };
@@ -1,8 +1,10 @@
1
1
  import { t as OdtParagraph } from "../../paragraph-CoUi_88j.js";
2
- import { ContentDocument, ContentParagraph } from "document-schema.js";
2
+ import { t as OdtTable } from "../../table-DqfqMkVq.js";
3
+ import { ContentDocument, ContentParagraph, ContentTable } from "document-schema.js";
3
4
  import { Package } from "odf.js";
4
5
  //#region src/edit/odt/content.d.ts
5
6
  declare function buildOdtPackage(content: ContentDocument): Package;
6
7
  declare function populateParagraph(paragraph: OdtParagraph, block: ContentParagraph): void;
8
+ declare function populateOdtTable(table: OdtTable, block: ContentTable): void;
7
9
  //#endregion
8
- export { buildOdtPackage, populateParagraph };
10
+ export { buildOdtPackage, populateOdtTable, populateParagraph };