js.documents 1.67.16 → 1.68.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 (71) hide show
  1. package/dist/color-BHhGSqAh.d.ts +2 -0
  2. package/dist/edit/docx/paragraph.d.ts +1 -1
  3. package/dist/edit/docx/props.d.ts +1 -1
  4. package/dist/edit/docx/run.d.ts +1 -1
  5. package/dist/edit/drawingml/vector.cjs +145 -0
  6. package/dist/edit/drawingml/vector.d.cts +3 -2
  7. package/dist/edit/drawingml/vector.d.ts +3 -2
  8. package/dist/edit/drawingml/vector.js +147 -3
  9. package/dist/edit/odg/page.d.ts +1 -1
  10. package/dist/edit/odp/shape.d.ts +1 -1
  11. package/dist/edit/odp/slide.d.ts +2 -2
  12. package/dist/edit/odt/content.d.ts +2 -2
  13. package/dist/edit/odt/editor.d.ts +3 -3
  14. package/dist/edit/odt/list.d.ts +1 -1
  15. package/dist/edit/odt/paragraph.d.ts +1 -1
  16. package/dist/edit/odt/run.d.ts +1 -1
  17. package/dist/edit/odt/table.d.ts +1 -1
  18. package/dist/edit/pptx/shape.d.ts +1 -1
  19. package/dist/edit/pptx/slide.d.ts +2 -2
  20. package/dist/edit/pptx/table.d.ts +1 -1
  21. package/dist/formula-B_4mdCuK.d.ts +12 -0
  22. package/dist/formula-DFc2Ofsk.d.cts +12 -0
  23. package/dist/index.d.ts +9 -9
  24. package/dist/layout/sheets.js +3 -3
  25. package/dist/{list-nlhN5bat.d.ts → list-BJVehfU8.d.ts} +1 -1
  26. package/dist/model/block-splice.cjs +18 -0
  27. package/dist/model/block-splice.d.cts +9 -0
  28. package/dist/model/block-splice.d.ts +9 -0
  29. package/dist/model/block-splice.js +17 -0
  30. package/dist/model/color.d.ts +1 -1
  31. package/dist/odf/odp/read.cjs +38 -0
  32. package/dist/odf/odp/read.js +38 -0
  33. package/dist/odf/odt/read.cjs +100 -35
  34. package/dist/odf/odt/read.js +100 -35
  35. package/dist/odf/vector/detect.cjs +52 -0
  36. package/dist/odf/vector/detect.d.cts +12 -0
  37. package/dist/odf/vector/detect.d.ts +12 -0
  38. package/dist/odf/vector/detect.js +49 -0
  39. package/dist/ooxml/docx/embedded-objects.cjs +92 -0
  40. package/dist/ooxml/docx/embedded-objects.d.cts +7 -0
  41. package/dist/ooxml/docx/embedded-objects.d.ts +7 -0
  42. package/dist/ooxml/docx/embedded-objects.js +91 -0
  43. package/dist/ooxml/docx/formula.cjs +3 -58
  44. package/dist/ooxml/docx/formula.d.cts +2 -2
  45. package/dist/ooxml/docx/formula.d.ts +2 -2
  46. package/dist/ooxml/docx/formula.js +1 -58
  47. package/dist/ooxml/docx/read.cjs +2 -2
  48. package/dist/ooxml/docx/read.d.cts +1 -1
  49. package/dist/ooxml/docx/read.d.ts +1 -1
  50. package/dist/ooxml/docx/read.js +2 -2
  51. package/dist/ooxml/docx/vector.cjs +63 -0
  52. package/dist/ooxml/docx/vector.d.cts +10 -0
  53. package/dist/ooxml/docx/vector.d.ts +10 -0
  54. package/dist/ooxml/docx/vector.js +62 -0
  55. package/dist/ooxml/pptx/read.cjs +25 -1
  56. package/dist/ooxml/pptx/read.js +26 -2
  57. package/dist/ooxml/pptx/vector.cjs +96 -0
  58. package/dist/ooxml/pptx/vector.d.cts +6 -0
  59. package/dist/ooxml/pptx/vector.d.ts +6 -0
  60. package/dist/ooxml/pptx/vector.js +95 -0
  61. package/dist/{paragraph-DndYbWuT.d.ts → paragraph-CjtZP77X.d.ts} +1 -1
  62. package/dist/{run-BhYv2wJf.d.ts → run-DDe7miD5.d.ts} +1 -1
  63. package/dist/{run-DtrwZwN6.d.ts → run-wB22_F5w.d.ts} +1 -1
  64. package/dist/{shape-B-TjU_Ej.d.ts → shape-BjX3wlig.d.ts} +1 -1
  65. package/dist/{shape-XGp__l-J.d.ts → shape-GV8i37zL.d.ts} +2 -2
  66. package/dist/{table-DQpKafyl.d.ts → table-Db91eorq.d.ts} +1 -1
  67. package/dist/{table-BHeUmLzZ.d.ts → table-Vf6nCixr.d.ts} +1 -1
  68. package/package.json +1 -1
  69. package/dist/color-C98dn-pT.d.ts +0 -2
  70. package/dist/formula-CgydMiTt.d.ts +0 -10
  71. package/dist/formula-CiwPw8nY.d.cts +0 -10
@@ -0,0 +1,2 @@
1
+ import { COLOR_BLACK as COLOR_BLACK$1, Color as LayoutColor, ColorSchema as LayoutColorSchema, colorToRgbHex as colorToRgbHex$1, rgbHexToColor as rgbHexToColor$1 } from "document-schema.js";
2
+ export { rgbHexToColor$1 as a, colorToRgbHex$1 as i, LayoutColor as n, LayoutColorSchema as r, COLOR_BLACK$1 as t };
@@ -1,7 +1,7 @@
1
1
  import { r as MathMlNode$1 } from "../../nodes-pArN9ilm.js";
2
2
  import { t as OmmlWriteResult } from "../../write-THs7ipBq.js";
3
3
  import { n as MediaContext, t as ImageInit } from "../../image-DRqXQmEg.js";
4
- import { n as RunInit, t as DocxRun } from "../../run-BhYv2wJf.js";
4
+ import { n as RunInit, t as DocxRun } from "../../run-DDe7miD5.js";
5
5
  import { Package, XmlElement, XmlNode } from "ooxml.js";
6
6
  import { ContentListMembership, ContentVector } from "document-schema.js";
7
7
  //#region src/edit/docx/paragraph.d.ts
@@ -1,4 +1,4 @@
1
- import { n as LayoutColor } from "../../color-C98dn-pT.js";
1
+ import { n as LayoutColor } from "../../color-BHhGSqAh.js";
2
2
  import { XmlElement } from "ooxml.js";
3
3
  //#region src/edit/docx/props.d.ts
4
4
  declare const RPR_ORDER: readonly string[];
@@ -1,2 +1,2 @@
1
- import { i as wordprocessingText, n as RunInit, r as buildRun, t as DocxRun } from "../../run-BhYv2wJf.js";
1
+ import { i as wordprocessingText, n as RunInit, r as buildRun, t as DocxRun } from "../../run-DDe7miD5.js";
2
2
  export { DocxRun, RunInit, buildRun, wordprocessingText };
@@ -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_model_units = require("../../model/units.cjs");
4
+ let ooxml_js = require("ooxml.js");
4
5
  let document_schema_js = require("document-schema.js");
5
6
  //#region src/edit/drawingml/vector.ts
6
7
  function drawingMlColorHex(color) {
@@ -106,8 +107,152 @@ function vectorPlacementBox(vector) {
106
107
  function vectorShapeName(vector, id) {
107
108
  return `${vector.kind.charAt(0).toUpperCase()}${vector.kind.slice(1)} ${id}`;
108
109
  }
110
+ function requireChild(parent, tag) {
111
+ const [child] = (0, ooxml_js.childrenWithTag)(parent, tag);
112
+ if (child === void 0) throw new Error(`expected a ${tag} child of ${parent.tag}`);
113
+ return child;
114
+ }
115
+ function requireAttrNumber(element, name) {
116
+ const value = (0, ooxml_js.attr)(element, name);
117
+ if (value === void 0) throw new Error(`expected a ${name} attribute on ${element.tag}`);
118
+ const parsed = Number.parseInt(value, 10);
119
+ if (Number.isNaN(parsed)) throw new Error(`${element.tag}/@${name} is not an integer: ${value}`);
120
+ return parsed;
121
+ }
122
+ function readSrgbColor(parent) {
123
+ const value = (0, ooxml_js.attr)(requireChild(parent, "a:srgbClr"), "val");
124
+ if (value === void 0) throw new Error("expected a val attribute on a:srgbClr");
125
+ return (0, document_schema_js.rgbHexToColor)(value);
126
+ }
127
+ function readFill(parent) {
128
+ if ((0, ooxml_js.childrenWithTag)(parent, "a:noFill").length > 0) return;
129
+ return readSrgbColor(requireChild(parent, "a:solidFill"));
130
+ }
131
+ function readOutline(spPr) {
132
+ const ln = requireChild(spPr, "a:ln");
133
+ const color = readFill(ln);
134
+ if (color === void 0) return;
135
+ return {
136
+ color,
137
+ widthPt: require_model_units.emuToPt(requireAttrNumber(ln, "w"))
138
+ };
139
+ }
140
+ function readPlacement(spPr) {
141
+ const xfrm = requireChild(spPr, "a:xfrm");
142
+ const off = requireChild(xfrm, "a:off");
143
+ const ext = requireChild(xfrm, "a:ext");
144
+ const rot = (0, ooxml_js.attr)(xfrm, "rot");
145
+ return {
146
+ frame: {
147
+ xPt: require_model_units.emuToPt(requireAttrNumber(off, "x")),
148
+ yPt: require_model_units.emuToPt(requireAttrNumber(off, "y")),
149
+ widthPt: require_model_units.emuToPt(requireAttrNumber(ext, "cx")),
150
+ heightPt: require_model_units.emuToPt(requireAttrNumber(ext, "cy"))
151
+ },
152
+ rotationDeg: rot === void 0 ? void 0 : Number.parseInt(rot, 10) / ROTATION_UNITS_PER_DEGREE,
153
+ flipH: (0, ooxml_js.attr)(xfrm, "flipH") === "1",
154
+ flipV: (0, ooxml_js.attr)(xfrm, "flipV") === "1"
155
+ };
156
+ }
157
+ function readPoint(container, index) {
158
+ const point = (0, ooxml_js.childrenWithTag)(container, "a:pt")[index];
159
+ if (point === void 0) throw new Error(`expected an a:pt at index ${index} of ${container.tag}`);
160
+ return {
161
+ xPt: require_model_units.emuToPt(requireAttrNumber(point, "x")),
162
+ yPt: require_model_units.emuToPt(requireAttrNumber(point, "y"))
163
+ };
164
+ }
165
+ function readSubpaths(custGeom) {
166
+ return (0, ooxml_js.childrenWithTag)(requireChild(custGeom, "a:pathLst"), "a:path").map((path) => {
167
+ const segments = [];
168
+ let start;
169
+ let closed = false;
170
+ for (const command of path.children) {
171
+ if (command.type !== "element") continue;
172
+ switch (command.tag) {
173
+ case "a:moveTo":
174
+ start = readPoint(command, 0);
175
+ break;
176
+ case "a:lnTo":
177
+ segments.push({
178
+ kind: "line",
179
+ to: readPoint(command, 0)
180
+ });
181
+ break;
182
+ case "a:cubicBezTo":
183
+ segments.push({
184
+ kind: "cubic",
185
+ control1: readPoint(command, 0),
186
+ control2: readPoint(command, 1),
187
+ to: readPoint(command, 2)
188
+ });
189
+ break;
190
+ case "a:close":
191
+ closed = true;
192
+ break;
193
+ default: throw new Error(`unrecognised a:path command: ${command.tag}`);
194
+ }
195
+ }
196
+ if (start === void 0) throw new Error("an a:path carried no a:moveTo");
197
+ return {
198
+ start,
199
+ segments,
200
+ closed
201
+ };
202
+ });
203
+ }
204
+ function readDrawingMlVectorOrThrow(spPr, frameOverride) {
205
+ const rawPlacement = readPlacement(spPr);
206
+ const placement = frameOverride === void 0 ? rawPlacement : {
207
+ ...rawPlacement,
208
+ frame: frameOverride
209
+ };
210
+ const stroke = readOutline(spPr);
211
+ const [custGeom] = (0, ooxml_js.childrenWithTag)(spPr, "a:custGeom");
212
+ if (custGeom !== void 0) return {
213
+ kind: "path",
214
+ frame: placement.frame,
215
+ rotationDeg: placement.rotationDeg,
216
+ subpaths: readSubpaths(custGeom),
217
+ fill: readFill(spPr),
218
+ stroke
219
+ };
220
+ const preset = (0, ooxml_js.attr)(requireChild(spPr, "a:prstGeom"), "prst");
221
+ if (preset === "line") {
222
+ if (stroke === void 0) throw new Error("a line preset with no outline: ContentVector's own line variant requires a stroke");
223
+ const { xPt, yPt, widthPt, heightPt } = placement.frame;
224
+ return {
225
+ kind: "line",
226
+ from: {
227
+ xPt: placement.flipH ? xPt + widthPt : xPt,
228
+ yPt: placement.flipV ? yPt + heightPt : yPt
229
+ },
230
+ to: {
231
+ xPt: placement.flipH ? xPt : xPt + widthPt,
232
+ yPt: placement.flipV ? yPt : yPt + heightPt
233
+ },
234
+ stroke
235
+ };
236
+ }
237
+ if (preset === "rect" || preset === "ellipse") return {
238
+ kind: preset,
239
+ frame: placement.frame,
240
+ rotationDeg: placement.rotationDeg,
241
+ fill: readFill(spPr),
242
+ stroke
243
+ };
244
+ throw new Error(`unrecognised a:prstGeom preset: ${String(preset)}`);
245
+ }
246
+ function readDrawingMlVector(spPr, frameOverride) {
247
+ try {
248
+ return readDrawingMlVectorOrThrow(spPr, frameOverride);
249
+ } catch {
250
+ return;
251
+ }
252
+ }
109
253
  //#endregion
110
254
  exports.buildVectorShapeProperties = buildVectorShapeProperties;
111
255
  exports.drawingMlColorHex = drawingMlColorHex;
256
+ exports.readDrawingMlVector = readDrawingMlVector;
112
257
  exports.vectorPlacementBox = vectorPlacementBox;
113
258
  exports.vectorShapeName = vectorShapeName;
@@ -1,9 +1,10 @@
1
1
  import { Box, Color, ContentVector } from "document-schema.js";
2
- import { XmlNode } from "ooxml.js";
2
+ import { XmlElement, XmlNode } from "ooxml.js";
3
3
  //#region src/edit/drawingml/vector.d.ts
4
4
  declare function drawingMlColorHex(color: Color): string;
5
5
  declare function buildVectorShapeProperties(vector: ContentVector): XmlNode[];
6
6
  declare function vectorPlacementBox(vector: ContentVector): Box;
7
7
  declare function vectorShapeName(vector: ContentVector, id: number): string;
8
+ declare function readDrawingMlVector(spPr: XmlElement, frameOverride?: Box): ContentVector | undefined;
8
9
  //#endregion
9
- export { buildVectorShapeProperties, drawingMlColorHex, vectorPlacementBox, vectorShapeName };
10
+ export { buildVectorShapeProperties, drawingMlColorHex, readDrawingMlVector, vectorPlacementBox, vectorShapeName };
@@ -1,9 +1,10 @@
1
- import { XmlNode } from "ooxml.js";
1
+ import { XmlElement, XmlNode } from "ooxml.js";
2
2
  import { Box, Color, ContentVector } from "document-schema.js";
3
3
  //#region src/edit/drawingml/vector.d.ts
4
4
  declare function drawingMlColorHex(color: Color): string;
5
5
  declare function buildVectorShapeProperties(vector: ContentVector): XmlNode[];
6
6
  declare function vectorPlacementBox(vector: ContentVector): Box;
7
7
  declare function vectorShapeName(vector: ContentVector, id: number): string;
8
+ declare function readDrawingMlVector(spPr: XmlElement, frameOverride?: Box): ContentVector | undefined;
8
9
  //#endregion
9
- export { buildVectorShapeProperties, drawingMlColorHex, vectorPlacementBox, vectorShapeName };
10
+ export { buildVectorShapeProperties, drawingMlColorHex, readDrawingMlVector, vectorPlacementBox, vectorShapeName };
@@ -1,6 +1,7 @@
1
1
  import { el } from "../../xml/fragment.js";
2
- import { ptToEmu } from "../../model/units.js";
3
- import { colorToRgbHex } from "document-schema.js";
2
+ import { emuToPt, ptToEmu } from "../../model/units.js";
3
+ import { attr, childrenWithTag } from "ooxml.js";
4
+ import { colorToRgbHex, rgbHexToColor } from "document-schema.js";
4
5
  //#region src/edit/drawingml/vector.ts
5
6
  function drawingMlColorHex(color) {
6
7
  return colorToRgbHex(color).toUpperCase();
@@ -105,5 +106,148 @@ function vectorPlacementBox(vector) {
105
106
  function vectorShapeName(vector, id) {
106
107
  return `${vector.kind.charAt(0).toUpperCase()}${vector.kind.slice(1)} ${id}`;
107
108
  }
109
+ function requireChild(parent, tag) {
110
+ const [child] = childrenWithTag(parent, tag);
111
+ if (child === void 0) throw new Error(`expected a ${tag} child of ${parent.tag}`);
112
+ return child;
113
+ }
114
+ function requireAttrNumber(element, name) {
115
+ const value = attr(element, name);
116
+ if (value === void 0) throw new Error(`expected a ${name} attribute on ${element.tag}`);
117
+ const parsed = Number.parseInt(value, 10);
118
+ if (Number.isNaN(parsed)) throw new Error(`${element.tag}/@${name} is not an integer: ${value}`);
119
+ return parsed;
120
+ }
121
+ function readSrgbColor(parent) {
122
+ const value = attr(requireChild(parent, "a:srgbClr"), "val");
123
+ if (value === void 0) throw new Error("expected a val attribute on a:srgbClr");
124
+ return rgbHexToColor(value);
125
+ }
126
+ function readFill(parent) {
127
+ if (childrenWithTag(parent, "a:noFill").length > 0) return;
128
+ return readSrgbColor(requireChild(parent, "a:solidFill"));
129
+ }
130
+ function readOutline(spPr) {
131
+ const ln = requireChild(spPr, "a:ln");
132
+ const color = readFill(ln);
133
+ if (color === void 0) return;
134
+ return {
135
+ color,
136
+ widthPt: emuToPt(requireAttrNumber(ln, "w"))
137
+ };
138
+ }
139
+ function readPlacement(spPr) {
140
+ const xfrm = requireChild(spPr, "a:xfrm");
141
+ const off = requireChild(xfrm, "a:off");
142
+ const ext = requireChild(xfrm, "a:ext");
143
+ const rot = attr(xfrm, "rot");
144
+ return {
145
+ frame: {
146
+ xPt: emuToPt(requireAttrNumber(off, "x")),
147
+ yPt: emuToPt(requireAttrNumber(off, "y")),
148
+ widthPt: emuToPt(requireAttrNumber(ext, "cx")),
149
+ heightPt: emuToPt(requireAttrNumber(ext, "cy"))
150
+ },
151
+ rotationDeg: rot === void 0 ? void 0 : Number.parseInt(rot, 10) / ROTATION_UNITS_PER_DEGREE,
152
+ flipH: attr(xfrm, "flipH") === "1",
153
+ flipV: attr(xfrm, "flipV") === "1"
154
+ };
155
+ }
156
+ function readPoint(container, index) {
157
+ const point = childrenWithTag(container, "a:pt")[index];
158
+ if (point === void 0) throw new Error(`expected an a:pt at index ${index} of ${container.tag}`);
159
+ return {
160
+ xPt: emuToPt(requireAttrNumber(point, "x")),
161
+ yPt: emuToPt(requireAttrNumber(point, "y"))
162
+ };
163
+ }
164
+ function readSubpaths(custGeom) {
165
+ return childrenWithTag(requireChild(custGeom, "a:pathLst"), "a:path").map((path) => {
166
+ const segments = [];
167
+ let start;
168
+ let closed = false;
169
+ for (const command of path.children) {
170
+ if (command.type !== "element") continue;
171
+ switch (command.tag) {
172
+ case "a:moveTo":
173
+ start = readPoint(command, 0);
174
+ break;
175
+ case "a:lnTo":
176
+ segments.push({
177
+ kind: "line",
178
+ to: readPoint(command, 0)
179
+ });
180
+ break;
181
+ case "a:cubicBezTo":
182
+ segments.push({
183
+ kind: "cubic",
184
+ control1: readPoint(command, 0),
185
+ control2: readPoint(command, 1),
186
+ to: readPoint(command, 2)
187
+ });
188
+ break;
189
+ case "a:close":
190
+ closed = true;
191
+ break;
192
+ default: throw new Error(`unrecognised a:path command: ${command.tag}`);
193
+ }
194
+ }
195
+ if (start === void 0) throw new Error("an a:path carried no a:moveTo");
196
+ return {
197
+ start,
198
+ segments,
199
+ closed
200
+ };
201
+ });
202
+ }
203
+ function readDrawingMlVectorOrThrow(spPr, frameOverride) {
204
+ const rawPlacement = readPlacement(spPr);
205
+ const placement = frameOverride === void 0 ? rawPlacement : {
206
+ ...rawPlacement,
207
+ frame: frameOverride
208
+ };
209
+ const stroke = readOutline(spPr);
210
+ const [custGeom] = childrenWithTag(spPr, "a:custGeom");
211
+ if (custGeom !== void 0) return {
212
+ kind: "path",
213
+ frame: placement.frame,
214
+ rotationDeg: placement.rotationDeg,
215
+ subpaths: readSubpaths(custGeom),
216
+ fill: readFill(spPr),
217
+ stroke
218
+ };
219
+ const preset = attr(requireChild(spPr, "a:prstGeom"), "prst");
220
+ if (preset === "line") {
221
+ if (stroke === void 0) throw new Error("a line preset with no outline: ContentVector's own line variant requires a stroke");
222
+ const { xPt, yPt, widthPt, heightPt } = placement.frame;
223
+ return {
224
+ kind: "line",
225
+ from: {
226
+ xPt: placement.flipH ? xPt + widthPt : xPt,
227
+ yPt: placement.flipV ? yPt + heightPt : yPt
228
+ },
229
+ to: {
230
+ xPt: placement.flipH ? xPt : xPt + widthPt,
231
+ yPt: placement.flipV ? yPt : yPt + heightPt
232
+ },
233
+ stroke
234
+ };
235
+ }
236
+ if (preset === "rect" || preset === "ellipse") return {
237
+ kind: preset,
238
+ frame: placement.frame,
239
+ rotationDeg: placement.rotationDeg,
240
+ fill: readFill(spPr),
241
+ stroke
242
+ };
243
+ throw new Error(`unrecognised a:prstGeom preset: ${String(preset)}`);
244
+ }
245
+ function readDrawingMlVector(spPr, frameOverride) {
246
+ try {
247
+ return readDrawingMlVectorOrThrow(spPr, frameOverride);
248
+ } catch {
249
+ return;
250
+ }
251
+ }
108
252
  //#endregion
109
- export { buildVectorShapeProperties, drawingMlColorHex, vectorPlacementBox, vectorShapeName };
253
+ export { buildVectorShapeProperties, drawingMlColorHex, readDrawingMlVector, vectorPlacementBox, vectorShapeName };
@@ -1,5 +1,5 @@
1
1
  import { t as ImageInit } from "../../image-DHcA9kaK.js";
2
- import { t as OdpShape } from "../../shape-XGp__l-J.js";
2
+ import { t as OdpShape } from "../../shape-GV8i37zL.js";
3
3
  import { a as OdgLineVector, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "../../vector-D03KX8Ux.js";
4
4
  import { Box, ContentVector } from "document-schema.js";
5
5
  import { Package, XmlElement, XmlNode } from "odf.js";
@@ -1,2 +1,2 @@
1
- import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-XGp__l-J.js";
1
+ import { i as buildTextBoxFrame, n as buildImageFrame, r as buildTableFrame, t as OdpShape } from "../../shape-GV8i37zL.js";
2
2
  export { OdpShape, buildImageFrame, buildTableFrame, buildTextBoxFrame };
@@ -1,8 +1,8 @@
1
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-XGp__l-J.js";
3
+ import { t as OdpShape } from "../../shape-GV8i37zL.js";
4
4
  import { s as OdgVector } from "../../vector-D03KX8Ux.js";
5
- import { i as TableInit, t as OdtTable } from "../../table-BHeUmLzZ.js";
5
+ import { i as TableInit, t as OdtTable } from "../../table-Vf6nCixr.js";
6
6
  import { ContentVector } from "document-schema.js";
7
7
  import { Package, XmlElement, XmlNode } from "odf.js";
8
8
  //#region src/edit/odp/slide.d.ts
@@ -1,5 +1,5 @@
1
- import { t as OdtParagraph } from "../../paragraph-DndYbWuT.js";
2
- import { t as OdtTable } from "../../table-BHeUmLzZ.js";
1
+ import { t as OdtParagraph } from "../../paragraph-CjtZP77X.js";
2
+ import { t as OdtTable } from "../../table-Vf6nCixr.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
@@ -1,7 +1,7 @@
1
1
  import { t as Box$1 } from "../../geometry-DaJr8yQW.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";
2
+ import { n as ParagraphInit, t as OdtParagraph } from "../../paragraph-CjtZP77X.js";
3
+ import { t as OdtList } from "../../list-BJVehfU8.js";
4
+ import { i as TableInit, t as OdtTable } from "../../table-Vf6nCixr.js";
5
5
  import { ContentFormula, ContentVector } from "document-schema.js";
6
6
  import { Package } from "odf.js";
7
7
  //#region src/edit/odt/editor.d.ts
@@ -1,2 +1,2 @@
1
- import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-nlhN5bat.js";
1
+ import { n as OdtListItem, r as buildList, t as OdtList } from "../../list-BJVehfU8.js";
2
2
  export { OdtList, OdtListItem, buildList };
@@ -1,2 +1,2 @@
1
- import { n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-DndYbWuT.js";
1
+ import { n as ParagraphInit, r as buildParagraph, t as OdtParagraph } from "../../paragraph-CjtZP77X.js";
2
2
  export { OdtParagraph, ParagraphInit, buildParagraph };
@@ -1,2 +1,2 @@
1
- import { n as RunInit, r as buildRun, t as OdtRun } from "../../run-DtrwZwN6.js";
1
+ import { n as RunInit, r as buildRun, t as OdtRun } from "../../run-wB22_F5w.js";
2
2
  export { OdtRun, RunInit, buildRun };
@@ -1,2 +1,2 @@
1
- import { a as buildTable, i as TableInit, n as OdtTableCell, r as OdtTableRow, t as OdtTable } from "../../table-BHeUmLzZ.js";
1
+ import { a as buildTable, i as TableInit, n as OdtTableCell, r as OdtTableRow, t as OdtTable } from "../../table-Vf6nCixr.js";
2
2
  export { OdtTable, OdtTableCell, OdtTableRow, TableInit, buildTable };
@@ -1,2 +1,2 @@
1
- import { a as buildDrawingParagraph, i as ROTATION_UNITS_PER_DEGREE, n as DrawingRunInit, o as buildPictureShape, r as PptxShape, s as buildTextBoxShape, t as DrawingParagraphInit } from "../../shape-B-TjU_Ej.js";
1
+ import { a as buildDrawingParagraph, i as ROTATION_UNITS_PER_DEGREE, n as DrawingRunInit, o as buildPictureShape, r as PptxShape, s as buildTextBoxShape, t as DrawingParagraphInit } from "../../shape-BjX3wlig.js";
2
2
  export { DrawingParagraphInit, DrawingRunInit, PptxShape, ROTATION_UNITS_PER_DEGREE, buildDrawingParagraph, buildPictureShape, buildTextBoxShape };
@@ -1,7 +1,7 @@
1
1
  import { t as Box$1 } from "../../geometry-DaJr8yQW.js";
2
2
  import { t as ImageInit } from "../../image-Cs8xF753.js";
3
- import { r as PptxShape } from "../../shape-B-TjU_Ej.js";
4
- import { r as PptxTableInit, t as PptxTable } from "../../table-DQpKafyl.js";
3
+ import { r as PptxShape } from "../../shape-BjX3wlig.js";
4
+ import { r as PptxTableInit, t as PptxTable } from "../../table-Db91eorq.js";
5
5
  import { Package, XmlElement, XmlNode } from "ooxml.js";
6
6
  import { ContentVector } from "document-schema.js";
7
7
  //#region src/edit/pptx/slide.d.ts
@@ -1,2 +1,2 @@
1
- import { a as buildDrawingTable, i as PptxTableRow, n as PptxTableCell, o as buildTableGraphicFrame, r as PptxTableInit, t as PptxTable } from "../../table-DQpKafyl.js";
1
+ import { a as buildDrawingTable, i as PptxTableRow, n as PptxTableCell, o as buildTableGraphicFrame, r as PptxTableInit, t as PptxTable } from "../../table-Db91eorq.js";
2
2
  export { PptxTable, PptxTableCell, PptxTableInit, PptxTableRow, buildDrawingTable, buildTableGraphicFrame };
@@ -0,0 +1,12 @@
1
+ import { t as OmmlDiagnostic } from "./shared-DUOzjwcL.js";
2
+ import { XmlElement, XmlNode } from "ooxml.js";
3
+ import { Box } from "document-schema.js";
4
+ //#region src/ooxml/docx/formula.d.ts
5
+ type OmmlDiagnosticSink = (diagnostic: OmmlDiagnostic, context: {
6
+ readonly sourcePath?: string;
7
+ }) => void;
8
+ declare function collectBodyParagraphs(nodes: readonly XmlNode[], out: XmlElement[]): void;
9
+ declare const PARAGRAPH_NON_CONTENT_TAGS: ReadonlySet<string>;
10
+ declare function equationFrame(equation: XmlElement): Box;
11
+ //#endregion
12
+ export { equationFrame as i, PARAGRAPH_NON_CONTENT_TAGS as n, collectBodyParagraphs as r, OmmlDiagnosticSink as t };
@@ -0,0 +1,12 @@
1
+ import { t as OmmlDiagnostic } from "./shared-DLZ3IQUl.cjs";
2
+ import { Box } from "document-schema.js";
3
+ import { XmlElement, XmlNode } from "ooxml.js";
4
+ //#region src/ooxml/docx/formula.d.ts
5
+ type OmmlDiagnosticSink = (diagnostic: OmmlDiagnostic, context: {
6
+ readonly sourcePath?: string;
7
+ }) => void;
8
+ declare function collectBodyParagraphs(nodes: readonly XmlNode[], out: XmlElement[]): void;
9
+ declare const PARAGRAPH_NON_CONTENT_TAGS: ReadonlySet<string>;
10
+ declare function equationFrame(equation: XmlElement): Box;
11
+ //#endregion
12
+ export { equationFrame as i, PARAGRAPH_NON_CONTENT_TAGS as n, collectBodyParagraphs as r, OmmlDiagnosticSink as t };
package/dist/index.d.ts CHANGED
@@ -9,23 +9,23 @@ import { createLocalDocumentConverter } from "./convert/local.js";
9
9
  import { BuildDocxPackageOptions, buildDocxPackage } from "./edit/docx/content.js";
10
10
  import { c as firstChildByLocalName, d as textContent, i as MathMlText, l as isMathMlElement, n as MathMlElement, o as elementChildren, r as MathMlNode, s as elementLocalName, t as MathMlAttribute, u as localName } from "./nodes-pArN9ilm.js";
11
11
  import { n as buildOfficeMath, r as buildOfficeMathParagraph, t as OmmlWriteResult } from "./write-THs7ipBq.js";
12
- import { a as rgbHexToColor, n as LayoutColor, t as COLOR_BLACK } from "./color-C98dn-pT.js";
13
- import { t as DocxRun } from "./run-BhYv2wJf.js";
12
+ import { a as rgbHexToColor, n as LayoutColor, t as COLOR_BLACK } from "./color-BHhGSqAh.js";
13
+ import { t as DocxRun } from "./run-DDe7miD5.js";
14
14
  import { DocxParagraph } from "./edit/docx/paragraph.js";
15
15
  import { DocxTable, DocxTableCell, DocxTableRow, DocxVerticalMerge } from "./edit/docx/table.js";
16
16
  import { DocxBody, DocxEditor, createDocx, openDocx } from "./edit/docx/editor.js";
17
17
  import { a as PAGE_SIZE_A4, d as flipY, l as SLIDE_SIZE_STANDARD, o as PAGE_SIZE_LETTER, r as Margins, s as PageSize, t as Box, u as SLIDE_SIZE_WIDESCREEN } from "./geometry-DaJr8yQW.js";
18
18
  import { buildOdgPackage } from "./edit/odg/content.js";
19
19
  import { i as LayoutFont, r as DEFAULT_LAYOUT_FONT, t as Alignment } from "./style-DkamR3aY.js";
20
- import { n as RunInit, t as OdtRun } from "./run-DtrwZwN6.js";
21
- import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-DndYbWuT.js";
22
- import { n as OdtListItem, t as OdtList } from "./list-nlhN5bat.js";
23
- import { t as OdpShape } from "./shape-XGp__l-J.js";
20
+ import { n as RunInit, t as OdtRun } from "./run-wB22_F5w.js";
21
+ import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-CjtZP77X.js";
22
+ import { n as OdtListItem, t as OdtList } from "./list-BJVehfU8.js";
23
+ import { t as OdpShape } from "./shape-GV8i37zL.js";
24
24
  import { a as OdgLineVector, c as OdgVectorKind, l as PathVectorInit, n as LineVectorInit, o as OdgPathVector, r as OdgBoxVector, s as OdgVector, t as BoxVectorInit } from "./vector-D03KX8Ux.js";
25
25
  import { OdgPage, PageImageInit, TextBoxInit } from "./edit/odg/page.js";
26
26
  import { OdgEditor, createOdg, openOdg } from "./edit/odg/editor.js";
27
27
  import { buildOdpPackage } from "./edit/odp/content.js";
28
- import { i as TableInit, n as OdtTableCell, r as OdtTableRow, t as OdtTable } from "./table-BHeUmLzZ.js";
28
+ import { i as TableInit, n as OdtTableCell, r as OdtTableRow, t as OdtTable } from "./table-Vf6nCixr.js";
29
29
  import { OdpSlide, SlideImageInit, SlideTableInit, TextBoxInit as TextBoxInit$1 } from "./edit/odp/slide.js";
30
30
  import { OdpEditor, createOdp, openOdp } from "./edit/odp/editor.js";
31
31
  import { t as OdsCell } from "./cell-CNHPsDEk.js";
@@ -35,8 +35,8 @@ import { OdsEditor, createOds, openOds } from "./edit/ods/editor.js";
35
35
  import { buildOdtPackage } from "./edit/odt/content.js";
36
36
  import { OdtBody, OdtEditor, createOdt, openOdt } from "./edit/odt/editor.js";
37
37
  import { buildPptxPackage } from "./edit/pptx/content.js";
38
- import { n as DrawingRunInit, r as PptxShape, t as DrawingParagraphInit } from "./shape-B-TjU_Ej.js";
39
- import { i as PptxTableRow, n as PptxTableCell, r as PptxTableInit, t as PptxTable } from "./table-DQpKafyl.js";
38
+ import { n as DrawingRunInit, r as PptxShape, t as DrawingParagraphInit } from "./shape-BjX3wlig.js";
39
+ import { i as PptxTableRow, n as PptxTableCell, r as PptxTableInit, t as PptxTable } from "./table-Db91eorq.js";
40
40
  import { PptxSlide, SlideImageInit as SlideImageInit$1, SlideTableInit as SlideTableInit$1, TextBoxInit as TextBoxInit$2 } from "./edit/pptx/slide.js";
41
41
  import { PptxEditor, createPptx, openPptx } from "./edit/pptx/editor.js";
42
42
  import { a as parseHsqldbScript, i as displayTextFor, n as HsqldbScriptParseError, r as HsqldbTable, t as HsqldbColumn } from "./script-DsGGIzGU.js";
@@ -1,5 +1,5 @@
1
1
  import { flipY } from "../model/geometry.js";
2
- import { COLOR_BLACK as COLOR_BLACK$1, rgbHexToColor } from "../model/color.js";
2
+ import { COLOR_BLACK as COLOR_BLACK$1, rgbHexToColor as rgbHexToColor$1 } from "../model/color.js";
3
3
  import { DEFAULT_LAYOUT_FONT } from "../model/style.js";
4
4
  import { layoutFormula } from "../mathml/layout.js";
5
5
  import { alignmentOffsetPt, formulaSizePtFromFrame, justifyLineGapsPt, lineNaturalHeightPt, pushCellBorderLines, sumColumnWidthsPt, toStyledRuns } from "./shared.js";
@@ -36,9 +36,9 @@ const CELL_TEXT_PADDING_PT = 2;
36
36
  const HEADER_LABEL_PADDING_PT = 2;
37
37
  const MINIMUM_SCALE = .01;
38
38
  const NUMERIC_OVERFLOW_TEXT = "###";
39
- const GRIDLINE_COLOR = rgbHexToColor("#D0D0D0");
39
+ const GRIDLINE_COLOR = rgbHexToColor$1("#D0D0D0");
40
40
  const GRIDLINE_WIDTH_PT = .5;
41
- const HEADER_LABEL_COLOR = rgbHexToColor("#606060");
41
+ const HEADER_LABEL_COLOR = rgbHexToColor$1("#606060");
42
42
  function columnLetters(index) {
43
43
  let n = index + 1;
44
44
  let letters = "";
@@ -1,4 +1,4 @@
1
- import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-DndYbWuT.js";
1
+ import { n as ParagraphInit, t as OdtParagraph } from "./paragraph-CjtZP77X.js";
2
2
  import { Package, XmlElement, XmlNode } from "odf.js";
3
3
  //#region src/edit/odt/list.d.ts
4
4
  declare class OdtListItem {
@@ -0,0 +1,18 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/model/block-splice.ts
3
+ function spliceBlocks(blocks, placements, consumedIndices, sourcePathFor) {
4
+ const out = [];
5
+ let next = 0;
6
+ for (let index = 0; index <= blocks.length; index++) {
7
+ while (next < placements.length && placements[next].index === index) {
8
+ const { build } = placements[next];
9
+ out.push(build(sourcePathFor(out.length)));
10
+ next += 1;
11
+ }
12
+ const block = blocks[index];
13
+ if (block !== void 0 && !consumedIndices.has(index)) out.push(block);
14
+ }
15
+ return out;
16
+ }
17
+ //#endregion
18
+ exports.spliceBlocks = spliceBlocks;
@@ -0,0 +1,9 @@
1
+ import { ContentBlock } from "document-schema.js";
2
+ //#region src/model/block-splice.d.ts
3
+ interface BlockPlacement {
4
+ readonly index: number;
5
+ readonly build: (sourcePath: string) => ContentBlock;
6
+ }
7
+ declare function spliceBlocks(blocks: readonly ContentBlock[], placements: readonly BlockPlacement[], consumedIndices: ReadonlySet<number>, sourcePathFor: (position: number) => string): ContentBlock[];
8
+ //#endregion
9
+ export { BlockPlacement, spliceBlocks };
@@ -0,0 +1,9 @@
1
+ import { ContentBlock } from "document-schema.js";
2
+ //#region src/model/block-splice.d.ts
3
+ interface BlockPlacement {
4
+ readonly index: number;
5
+ readonly build: (sourcePath: string) => ContentBlock;
6
+ }
7
+ declare function spliceBlocks(blocks: readonly ContentBlock[], placements: readonly BlockPlacement[], consumedIndices: ReadonlySet<number>, sourcePathFor: (position: number) => string): ContentBlock[];
8
+ //#endregion
9
+ export { BlockPlacement, spliceBlocks };
@@ -0,0 +1,17 @@
1
+ //#region src/model/block-splice.ts
2
+ function spliceBlocks(blocks, placements, consumedIndices, sourcePathFor) {
3
+ const out = [];
4
+ let next = 0;
5
+ for (let index = 0; index <= blocks.length; index++) {
6
+ while (next < placements.length && placements[next].index === index) {
7
+ const { build } = placements[next];
8
+ out.push(build(sourcePathFor(out.length)));
9
+ next += 1;
10
+ }
11
+ const block = blocks[index];
12
+ if (block !== void 0 && !consumedIndices.has(index)) out.push(block);
13
+ }
14
+ return out;
15
+ }
16
+ //#endregion
17
+ export { spliceBlocks };
@@ -1,2 +1,2 @@
1
- import { a as rgbHexToColor, i as colorToRgbHex, n as LayoutColor, r as LayoutColorSchema, t as COLOR_BLACK } from "../color-C98dn-pT.js";
1
+ import { a as rgbHexToColor, i as colorToRgbHex, n as LayoutColor, r as LayoutColorSchema, t as COLOR_BLACK } from "../color-BHhGSqAh.js";
2
2
  export { COLOR_BLACK, type LayoutColor, LayoutColorSchema, colorToRgbHex, rgbHexToColor };