js.documents 10.0.0 → 12.0.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.
@@ -5,6 +5,7 @@ const require_edit_table_grid = require("../table-grid.cjs");
5
5
  const require_edit_odt_automatic_styles = require("./automatic-styles.cjs");
6
6
  const require_edit_odt_paragraph = require("./paragraph.cjs");
7
7
  let ooxml_js = require("ooxml.js");
8
+ let document_schema_js = require("document-schema.js");
8
9
  let odf_js = require("odf.js");
9
10
  //#region src/edit/odt/table.ts
10
11
  const DEFAULT_TABLE_WIDTH_PT = 468;
@@ -254,12 +255,106 @@ function gridCellElements(row) {
254
255
  for (const child of row.children) if (child.type === "element" && (child.tag === "table:table-cell" || child.tag === "table:covered-table-cell")) out.push(child);
255
256
  return out;
256
257
  }
258
+ function tableRowElements(table) {
259
+ return table.children.filter((child) => child.type === "element" && child.tag === "table:table-row");
260
+ }
261
+ function placedCells(row, pkg) {
262
+ return gridCellElements(row).flatMap((element, columnIndex) => {
263
+ if (element.tag !== "table:table-cell") return [];
264
+ const cell = new OdtTableCell(element, pkg);
265
+ return [{
266
+ columnIndex,
267
+ cell,
268
+ colSpan: cell.colSpan,
269
+ rowSpan: cell.rowSpan
270
+ }];
271
+ });
272
+ }
273
+ function resolveOdtGrid(table, pkg) {
274
+ const placedRows = [];
275
+ let declaredColumns = 0;
276
+ for (const child of table.children) {
277
+ if (child.type !== "element") continue;
278
+ if (child.tag === "table:table-column") declaredColumns++;
279
+ else if (child.tag === "table:table-row") placedRows.push(placedCells(child, pkg));
280
+ }
281
+ return require_edit_table_grid.resolveLiveTableGrid(placedRows, declaredColumns);
282
+ }
283
+ function regionCovers(region, rowIndex, columnIndex) {
284
+ return region.row <= rowIndex && rowIndex < region.row + region.rowSpan && region.column <= columnIndex && columnIndex < region.column + region.columnSpan;
285
+ }
286
+ function regionsIntersect(a, b) {
287
+ return a.row < b.row + b.rowSpan && b.row < a.row + a.rowSpan && a.column < b.column + b.columnSpan && b.column < a.column + a.columnSpan;
288
+ }
289
+ function regionContains(outer, inner) {
290
+ return outer.row <= inner.row && outer.column <= inner.column && inner.row + inner.rowSpan <= outer.row + outer.rowSpan && inner.column + inner.columnSpan <= outer.column + outer.columnSpan;
291
+ }
292
+ function anchorRegions(grid) {
293
+ return grid.rows.flatMap((positions, row) => positions.flatMap((position, column) => {
294
+ if (!position?.isAnchor) return [];
295
+ const spans = {
296
+ blocks: [],
297
+ colSpan: position.cell.colSpan,
298
+ rowSpan: position.cell.rowSpan
299
+ };
300
+ return [{
301
+ row,
302
+ column,
303
+ rowSpan: (0, document_schema_js.tableCellRowSpan)(spans),
304
+ columnSpan: (0, document_schema_js.tableCellColumnSpan)(spans)
305
+ }];
306
+ }));
307
+ }
308
+ function isUnchangedAnchor(region, target) {
309
+ return target.rowSpan === 1 && region.column === target.column && region.columnSpan === target.columnSpan;
310
+ }
311
+ function describeRegionAnchor(region) {
312
+ return `the merge anchored at row ${region.row}, column ${region.column}`;
313
+ }
314
+ function refuseMerge(rowIndex, reason) {
315
+ return { refusal: {
316
+ rowIndex,
317
+ reason
318
+ } };
319
+ }
320
+ function planMerge(table, pkg, target, rows) {
321
+ const [anchorRow, ...coveredRows] = rows;
322
+ const anchorCells = gridCellElements(anchorRow);
323
+ const coveredCells = coveredRows.map(gridCellElements);
324
+ const anchor = anchorCells[target.column];
325
+ if (anchor === void 0) return refuseMerge(target.row, `column ${target.column} does not exist in this row`);
326
+ const endColumn = target.column + target.columnSpan;
327
+ for (const [offset, cells] of [anchorCells, ...coveredCells].entries()) if (endColumn > cells.length) return refuseMerge(target.row + offset, `colSpan ${target.columnSpan} starting at column ${target.column} exceeds this row's own ${cells.length} grid columns`);
328
+ const regions = anchorRegions(resolveOdtGrid(table, pkg));
329
+ if (anchor.tag === "table:covered-table-cell") {
330
+ const covering = regions.find((region) => regionCovers(region, target.row, target.column));
331
+ return refuseMerge(target.row, covering === void 0 ? `column ${target.column} is a covered position that no merge anchors` : `column ${target.column} is covered by ${describeRegionAnchor(covering)}`);
332
+ }
333
+ const cutting = regions.find((region) => regionsIntersect(region, target) && !regionContains(target, region) && !isUnchangedAnchor(region, target));
334
+ if (cutting !== void 0) {
335
+ const column = Math.max(cutting.column, target.column);
336
+ return refuseMerge(Math.max(cutting.row, target.row), `column ${column} belongs to ${describeRegionAnchor(cutting)}, which reaches outside the region being merged and cannot be merged over`);
337
+ }
338
+ return {
339
+ anchor,
340
+ consumed: [...anchorCells.slice(target.column + 1, endColumn), ...coveredCells.flatMap((cells) => cells.slice(target.column, endColumn))]
341
+ };
342
+ }
343
+ function applyMerge(plan, target, pkg) {
344
+ for (const element of plan.consumed) retagAsCovered(element);
345
+ const anchor = new OdtTableCell(plan.anchor, pkg);
346
+ anchor.colSpan = target.columnSpan;
347
+ if (target.rowSpan > 1) anchor.rowSpan = target.rowSpan;
348
+ return anchor;
349
+ }
257
350
  var OdtTableRow = class {
258
351
  node;
259
352
  pkg;
260
- constructor(node, pkg) {
353
+ table;
354
+ constructor(node, pkg, table) {
261
355
  this.node = node;
262
356
  this.pkg = pkg;
357
+ this.table = table;
263
358
  }
264
359
  cells() {
265
360
  const out = [];
@@ -296,22 +391,22 @@ var OdtTableRow = class {
296
391
  }
297
392
  mergeCellsHorizontally(startColumnIndex, colSpan) {
298
393
  if (!Number.isInteger(colSpan) || colSpan < 1) throw new Error(`mergeCellsHorizontally: colSpan must be a positive integer, got ${colSpan}`);
299
- const gridCells = gridCellElements(this.node);
300
- const anchorElement = gridCells[startColumnIndex];
301
- if (anchorElement === void 0) throw new Error(`mergeCellsHorizontally: column ${startColumnIndex} does not exist in this row`);
302
- if (anchorElement.tag === "table:covered-table-cell") throw new Error(`mergeCellsHorizontally: column ${startColumnIndex} is already covered by another merge -- address that merge's own anchor cell instead`);
303
- if (startColumnIndex + colSpan > gridCells.length) throw new Error(`mergeCellsHorizontally: colSpan ${colSpan} starting at column ${startColumnIndex} exceeds this row's own ${gridCells.length} grid columns`);
304
- for (let i = 1; i < colSpan; i++) {
305
- const consumedElement = gridCells[startColumnIndex + i];
306
- if (consumedElement !== void 0) retagAsCovered(consumedElement);
307
- }
308
- const anchor = new OdtTableCell(anchorElement, this.pkg);
309
- anchor.colSpan = colSpan;
310
- return anchor;
394
+ const target = {
395
+ row: tableRowElements(this.table).indexOf(this.node),
396
+ column: startColumnIndex,
397
+ rowSpan: 1,
398
+ columnSpan: colSpan
399
+ };
400
+ const plan = planMerge(this.table, this.pkg, target, [this.node]);
401
+ if (plan.refusal !== void 0) throw new Error(`mergeCellsHorizontally: ${plan.refusal.reason}`);
402
+ return applyMerge(plan, target, this.pkg);
311
403
  }
312
404
  markCellCovered(columnIndex) {
313
405
  const element = gridCellElements(this.node)[columnIndex];
314
406
  if (element === void 0) throw new Error(`markCellCovered: column ${columnIndex} does not exist in this row`);
407
+ const rowIndex = tableRowElements(this.table).indexOf(this.node);
408
+ const anchored = anchorRegions(resolveOdtGrid(this.table, this.pkg)).find((region) => region.row === rowIndex && region.column === columnIndex && (region.rowSpan > 1 || region.columnSpan > 1));
409
+ if (anchored !== void 0) throw new Error(`markCellCovered: column ${columnIndex} anchors a merge with rowSpan ${anchored.rowSpan} and colSpan ${anchored.columnSpan}, so covering it would leave the rest of that merge without an anchor`);
315
410
  retagAsCovered(element);
316
411
  }
317
412
  };
@@ -339,7 +434,7 @@ var OdtTable = class {
339
434
  }
340
435
  rows() {
341
436
  const out = [];
342
- for (const child of this.live().children) if (child.type === "element" && child.tag === "table:table-row") out.push(new OdtTableRow(child, this.pkg));
437
+ for (const child of this.live().children) if (child.type === "element" && child.tag === "table:table-row") out.push(new OdtTableRow(child, this.pkg, this.node));
343
438
  return out;
344
439
  }
345
440
  gridRows() {
@@ -349,27 +444,7 @@ var OdtTable = class {
349
444
  return this.grid().columnCount;
350
445
  }
351
446
  grid() {
352
- const table = this.live();
353
- const placedRows = [];
354
- let declaredColumns = 0;
355
- for (const child of table.children) {
356
- if (child.type !== "element") continue;
357
- if (child.tag === "table:table-column") declaredColumns++;
358
- else if (child.tag === "table:table-row") placedRows.push(this.placedCells(child));
359
- }
360
- return require_edit_table_grid.resolveLiveTableGrid(placedRows, declaredColumns);
361
- }
362
- placedCells(row) {
363
- return gridCellElements(row).flatMap((element, columnIndex) => {
364
- if (element.tag !== "table:table-cell") return [];
365
- const cell = new OdtTableCell(element, this.pkg);
366
- return [{
367
- columnIndex,
368
- cell,
369
- colSpan: cell.colSpan,
370
- rowSpan: cell.rowSpan
371
- }];
372
- });
447
+ return resolveOdtGrid(this.live(), this.pkg);
373
448
  }
374
449
  cell(rowIndex, columnIndex) {
375
450
  const row = this.rows()[rowIndex];
@@ -382,29 +457,29 @@ var OdtTable = class {
382
457
  const node = this.live();
383
458
  const row = buildRow(this.pkg, columnCount);
384
459
  node.children.push(row);
385
- return new OdtTableRow(row, this.pkg);
460
+ return new OdtTableRow(row, this.pkg, node);
386
461
  }
387
462
  appendEmptyRow() {
388
463
  const node = this.live();
389
464
  const row = require_xml_fragment.el("table:table-row");
390
465
  node.children.push(row);
391
- return new OdtTableRow(row, this.pkg);
466
+ return new OdtTableRow(row, this.pkg, node);
392
467
  }
393
468
  mergeCells(startRow, startColumn, rowSpan, colSpan) {
394
469
  if (!Number.isInteger(rowSpan) || rowSpan < 1 || !Number.isInteger(colSpan) || colSpan < 1) throw new Error(`mergeCells: rowSpan and colSpan must be positive integers, got rowSpan=${rowSpan}, colSpan=${colSpan}`);
395
- const rows = this.rows();
470
+ const rows = tableRowElements(this.live());
396
471
  const anchorRow = rows[startRow];
397
472
  if (anchorRow === void 0) throw new Error(`mergeCells: row ${startRow} does not exist in this table`);
398
- const anchor = anchorRow.mergeCellsHorizontally(startColumn, colSpan);
399
- if (rowSpan > 1) {
400
- anchor.rowSpan = rowSpan;
401
- for (let r = 1; r < rowSpan; r++) {
402
- const coveredRow = rows[startRow + r];
403
- if (coveredRow === void 0) throw new Error(`mergeCells: rowSpan ${rowSpan} starting at row ${startRow} exceeds this table's own ${rows.length} rows`);
404
- for (let c = 0; c < colSpan; c++) coveredRow.markCellCovered(startColumn + c);
405
- }
406
- }
407
- return anchor;
473
+ if (startRow + rowSpan > rows.length) throw new Error(`mergeCells: rowSpan ${rowSpan} starting at row ${startRow} exceeds this table's own ${rows.length} rows`);
474
+ const target = {
475
+ row: startRow,
476
+ column: startColumn,
477
+ rowSpan,
478
+ columnSpan: colSpan
479
+ };
480
+ const plan = planMerge(this.live(), this.pkg, target, [anchorRow, ...rows.slice(startRow + 1, startRow + rowSpan)]);
481
+ if (plan.refusal !== void 0) throw new Error(`mergeCells: row ${plan.refusal.rowIndex}: ${plan.refusal.reason}`);
482
+ return applyMerge(plan, target, this.pkg);
408
483
  }
409
484
  remove() {
410
485
  require_xml_edit.removeChild(this.container, this.live());
@@ -1,2 +1,2 @@
1
- import { a as OdtTableRow, c as buildTable, i as OdtTableCell, l as readCellDecoration, n as OdtCoveredTableCell, o as TableInit, r as OdtTable, s as buildCellStyle, t as CellDecoration } from "../../table-CCjF09Ho.cjs";
1
+ import { a as OdtTableRow, c as buildTable, i as OdtTableCell, l as readCellDecoration, n as OdtCoveredTableCell, o as TableInit, r as OdtTable, s as buildCellStyle, t as CellDecoration } from "../../table-BT3wN3Hd.cjs";
2
2
  export { CellDecoration, OdtCoveredTableCell, OdtTable, OdtTableCell, OdtTableRow, TableInit, buildCellStyle, buildTable, readCellDecoration };
@@ -1,2 +1,2 @@
1
- import { a as OdtTableRow, c as buildTable, i as OdtTableCell, l as readCellDecoration, n as OdtCoveredTableCell, o as TableInit, r as OdtTable, s as buildCellStyle, t as CellDecoration } from "../../table-BMYJo_-F.js";
1
+ import { a as OdtTableRow, c as buildTable, i as OdtTableCell, l as readCellDecoration, n as OdtCoveredTableCell, o as TableInit, r as OdtTable, s as buildCellStyle, t as CellDecoration } from "../../table-DhTy5Re7.js";
2
2
  export { CellDecoration, OdtCoveredTableCell, OdtTable, OdtTableCell, OdtTableRow, TableInit, buildCellStyle, buildTable, readCellDecoration };
@@ -4,6 +4,7 @@ import { resolveLiveTableGrid } from "../table-grid.js";
4
4
  import { ensureAutomaticStyles, nextStyleName } from "./automatic-styles.js";
5
5
  import { OdtParagraph, buildParagraph } from "./paragraph.js";
6
6
  import { attr } from "ooxml.js";
7
+ import { tableCellColumnSpan, tableCellRowSpan } from "document-schema.js";
7
8
  import { findStyleElement, formatOdfColor, formatOdfLength, parseOdfColor, parseOdfLength } from "odf.js";
8
9
  //#region src/edit/odt/table.ts
9
10
  const DEFAULT_TABLE_WIDTH_PT = 468;
@@ -253,12 +254,106 @@ function gridCellElements(row) {
253
254
  for (const child of row.children) if (child.type === "element" && (child.tag === "table:table-cell" || child.tag === "table:covered-table-cell")) out.push(child);
254
255
  return out;
255
256
  }
257
+ function tableRowElements(table) {
258
+ return table.children.filter((child) => child.type === "element" && child.tag === "table:table-row");
259
+ }
260
+ function placedCells(row, pkg) {
261
+ return gridCellElements(row).flatMap((element, columnIndex) => {
262
+ if (element.tag !== "table:table-cell") return [];
263
+ const cell = new OdtTableCell(element, pkg);
264
+ return [{
265
+ columnIndex,
266
+ cell,
267
+ colSpan: cell.colSpan,
268
+ rowSpan: cell.rowSpan
269
+ }];
270
+ });
271
+ }
272
+ function resolveOdtGrid(table, pkg) {
273
+ const placedRows = [];
274
+ let declaredColumns = 0;
275
+ for (const child of table.children) {
276
+ if (child.type !== "element") continue;
277
+ if (child.tag === "table:table-column") declaredColumns++;
278
+ else if (child.tag === "table:table-row") placedRows.push(placedCells(child, pkg));
279
+ }
280
+ return resolveLiveTableGrid(placedRows, declaredColumns);
281
+ }
282
+ function regionCovers(region, rowIndex, columnIndex) {
283
+ return region.row <= rowIndex && rowIndex < region.row + region.rowSpan && region.column <= columnIndex && columnIndex < region.column + region.columnSpan;
284
+ }
285
+ function regionsIntersect(a, b) {
286
+ return a.row < b.row + b.rowSpan && b.row < a.row + a.rowSpan && a.column < b.column + b.columnSpan && b.column < a.column + a.columnSpan;
287
+ }
288
+ function regionContains(outer, inner) {
289
+ return outer.row <= inner.row && outer.column <= inner.column && inner.row + inner.rowSpan <= outer.row + outer.rowSpan && inner.column + inner.columnSpan <= outer.column + outer.columnSpan;
290
+ }
291
+ function anchorRegions(grid) {
292
+ return grid.rows.flatMap((positions, row) => positions.flatMap((position, column) => {
293
+ if (!position?.isAnchor) return [];
294
+ const spans = {
295
+ blocks: [],
296
+ colSpan: position.cell.colSpan,
297
+ rowSpan: position.cell.rowSpan
298
+ };
299
+ return [{
300
+ row,
301
+ column,
302
+ rowSpan: tableCellRowSpan(spans),
303
+ columnSpan: tableCellColumnSpan(spans)
304
+ }];
305
+ }));
306
+ }
307
+ function isUnchangedAnchor(region, target) {
308
+ return target.rowSpan === 1 && region.column === target.column && region.columnSpan === target.columnSpan;
309
+ }
310
+ function describeRegionAnchor(region) {
311
+ return `the merge anchored at row ${region.row}, column ${region.column}`;
312
+ }
313
+ function refuseMerge(rowIndex, reason) {
314
+ return { refusal: {
315
+ rowIndex,
316
+ reason
317
+ } };
318
+ }
319
+ function planMerge(table, pkg, target, rows) {
320
+ const [anchorRow, ...coveredRows] = rows;
321
+ const anchorCells = gridCellElements(anchorRow);
322
+ const coveredCells = coveredRows.map(gridCellElements);
323
+ const anchor = anchorCells[target.column];
324
+ if (anchor === void 0) return refuseMerge(target.row, `column ${target.column} does not exist in this row`);
325
+ const endColumn = target.column + target.columnSpan;
326
+ for (const [offset, cells] of [anchorCells, ...coveredCells].entries()) if (endColumn > cells.length) return refuseMerge(target.row + offset, `colSpan ${target.columnSpan} starting at column ${target.column} exceeds this row's own ${cells.length} grid columns`);
327
+ const regions = anchorRegions(resolveOdtGrid(table, pkg));
328
+ if (anchor.tag === "table:covered-table-cell") {
329
+ const covering = regions.find((region) => regionCovers(region, target.row, target.column));
330
+ return refuseMerge(target.row, covering === void 0 ? `column ${target.column} is a covered position that no merge anchors` : `column ${target.column} is covered by ${describeRegionAnchor(covering)}`);
331
+ }
332
+ const cutting = regions.find((region) => regionsIntersect(region, target) && !regionContains(target, region) && !isUnchangedAnchor(region, target));
333
+ if (cutting !== void 0) {
334
+ const column = Math.max(cutting.column, target.column);
335
+ return refuseMerge(Math.max(cutting.row, target.row), `column ${column} belongs to ${describeRegionAnchor(cutting)}, which reaches outside the region being merged and cannot be merged over`);
336
+ }
337
+ return {
338
+ anchor,
339
+ consumed: [...anchorCells.slice(target.column + 1, endColumn), ...coveredCells.flatMap((cells) => cells.slice(target.column, endColumn))]
340
+ };
341
+ }
342
+ function applyMerge(plan, target, pkg) {
343
+ for (const element of plan.consumed) retagAsCovered(element);
344
+ const anchor = new OdtTableCell(plan.anchor, pkg);
345
+ anchor.colSpan = target.columnSpan;
346
+ if (target.rowSpan > 1) anchor.rowSpan = target.rowSpan;
347
+ return anchor;
348
+ }
256
349
  var OdtTableRow = class {
257
350
  node;
258
351
  pkg;
259
- constructor(node, pkg) {
352
+ table;
353
+ constructor(node, pkg, table) {
260
354
  this.node = node;
261
355
  this.pkg = pkg;
356
+ this.table = table;
262
357
  }
263
358
  cells() {
264
359
  const out = [];
@@ -295,22 +390,22 @@ var OdtTableRow = class {
295
390
  }
296
391
  mergeCellsHorizontally(startColumnIndex, colSpan) {
297
392
  if (!Number.isInteger(colSpan) || colSpan < 1) throw new Error(`mergeCellsHorizontally: colSpan must be a positive integer, got ${colSpan}`);
298
- const gridCells = gridCellElements(this.node);
299
- const anchorElement = gridCells[startColumnIndex];
300
- if (anchorElement === void 0) throw new Error(`mergeCellsHorizontally: column ${startColumnIndex} does not exist in this row`);
301
- if (anchorElement.tag === "table:covered-table-cell") throw new Error(`mergeCellsHorizontally: column ${startColumnIndex} is already covered by another merge -- address that merge's own anchor cell instead`);
302
- if (startColumnIndex + colSpan > gridCells.length) throw new Error(`mergeCellsHorizontally: colSpan ${colSpan} starting at column ${startColumnIndex} exceeds this row's own ${gridCells.length} grid columns`);
303
- for (let i = 1; i < colSpan; i++) {
304
- const consumedElement = gridCells[startColumnIndex + i];
305
- if (consumedElement !== void 0) retagAsCovered(consumedElement);
306
- }
307
- const anchor = new OdtTableCell(anchorElement, this.pkg);
308
- anchor.colSpan = colSpan;
309
- return anchor;
393
+ const target = {
394
+ row: tableRowElements(this.table).indexOf(this.node),
395
+ column: startColumnIndex,
396
+ rowSpan: 1,
397
+ columnSpan: colSpan
398
+ };
399
+ const plan = planMerge(this.table, this.pkg, target, [this.node]);
400
+ if (plan.refusal !== void 0) throw new Error(`mergeCellsHorizontally: ${plan.refusal.reason}`);
401
+ return applyMerge(plan, target, this.pkg);
310
402
  }
311
403
  markCellCovered(columnIndex) {
312
404
  const element = gridCellElements(this.node)[columnIndex];
313
405
  if (element === void 0) throw new Error(`markCellCovered: column ${columnIndex} does not exist in this row`);
406
+ const rowIndex = tableRowElements(this.table).indexOf(this.node);
407
+ const anchored = anchorRegions(resolveOdtGrid(this.table, this.pkg)).find((region) => region.row === rowIndex && region.column === columnIndex && (region.rowSpan > 1 || region.columnSpan > 1));
408
+ if (anchored !== void 0) throw new Error(`markCellCovered: column ${columnIndex} anchors a merge with rowSpan ${anchored.rowSpan} and colSpan ${anchored.columnSpan}, so covering it would leave the rest of that merge without an anchor`);
314
409
  retagAsCovered(element);
315
410
  }
316
411
  };
@@ -338,7 +433,7 @@ var OdtTable = class {
338
433
  }
339
434
  rows() {
340
435
  const out = [];
341
- for (const child of this.live().children) if (child.type === "element" && child.tag === "table:table-row") out.push(new OdtTableRow(child, this.pkg));
436
+ for (const child of this.live().children) if (child.type === "element" && child.tag === "table:table-row") out.push(new OdtTableRow(child, this.pkg, this.node));
342
437
  return out;
343
438
  }
344
439
  gridRows() {
@@ -348,27 +443,7 @@ var OdtTable = class {
348
443
  return this.grid().columnCount;
349
444
  }
350
445
  grid() {
351
- const table = this.live();
352
- const placedRows = [];
353
- let declaredColumns = 0;
354
- for (const child of table.children) {
355
- if (child.type !== "element") continue;
356
- if (child.tag === "table:table-column") declaredColumns++;
357
- else if (child.tag === "table:table-row") placedRows.push(this.placedCells(child));
358
- }
359
- return resolveLiveTableGrid(placedRows, declaredColumns);
360
- }
361
- placedCells(row) {
362
- return gridCellElements(row).flatMap((element, columnIndex) => {
363
- if (element.tag !== "table:table-cell") return [];
364
- const cell = new OdtTableCell(element, this.pkg);
365
- return [{
366
- columnIndex,
367
- cell,
368
- colSpan: cell.colSpan,
369
- rowSpan: cell.rowSpan
370
- }];
371
- });
446
+ return resolveOdtGrid(this.live(), this.pkg);
372
447
  }
373
448
  cell(rowIndex, columnIndex) {
374
449
  const row = this.rows()[rowIndex];
@@ -381,29 +456,29 @@ var OdtTable = class {
381
456
  const node = this.live();
382
457
  const row = buildRow(this.pkg, columnCount);
383
458
  node.children.push(row);
384
- return new OdtTableRow(row, this.pkg);
459
+ return new OdtTableRow(row, this.pkg, node);
385
460
  }
386
461
  appendEmptyRow() {
387
462
  const node = this.live();
388
463
  const row = el("table:table-row");
389
464
  node.children.push(row);
390
- return new OdtTableRow(row, this.pkg);
465
+ return new OdtTableRow(row, this.pkg, node);
391
466
  }
392
467
  mergeCells(startRow, startColumn, rowSpan, colSpan) {
393
468
  if (!Number.isInteger(rowSpan) || rowSpan < 1 || !Number.isInteger(colSpan) || colSpan < 1) throw new Error(`mergeCells: rowSpan and colSpan must be positive integers, got rowSpan=${rowSpan}, colSpan=${colSpan}`);
394
- const rows = this.rows();
469
+ const rows = tableRowElements(this.live());
395
470
  const anchorRow = rows[startRow];
396
471
  if (anchorRow === void 0) throw new Error(`mergeCells: row ${startRow} does not exist in this table`);
397
- const anchor = anchorRow.mergeCellsHorizontally(startColumn, colSpan);
398
- if (rowSpan > 1) {
399
- anchor.rowSpan = rowSpan;
400
- for (let r = 1; r < rowSpan; r++) {
401
- const coveredRow = rows[startRow + r];
402
- if (coveredRow === void 0) throw new Error(`mergeCells: rowSpan ${rowSpan} starting at row ${startRow} exceeds this table's own ${rows.length} rows`);
403
- for (let c = 0; c < colSpan; c++) coveredRow.markCellCovered(startColumn + c);
404
- }
405
- }
406
- return anchor;
472
+ if (startRow + rowSpan > rows.length) throw new Error(`mergeCells: rowSpan ${rowSpan} starting at row ${startRow} exceeds this table's own ${rows.length} rows`);
473
+ const target = {
474
+ row: startRow,
475
+ column: startColumn,
476
+ rowSpan,
477
+ columnSpan: colSpan
478
+ };
479
+ const plan = planMerge(this.live(), this.pkg, target, [anchorRow, ...rows.slice(startRow + 1, startRow + rowSpan)]);
480
+ if (plan.refusal !== void 0) throw new Error(`mergeCells: row ${plan.refusal.rowIndex}: ${plan.refusal.reason}`);
481
+ return applyMerge(plan, target, this.pkg);
407
482
  }
408
483
  remove() {
409
484
  removeChild(this.container, this.live());
@@ -56,12 +56,13 @@ function appendShape(slide, shape, options) {
56
56
  return;
57
57
  }
58
58
  if (shape.blocks.length === 1 && onlyBlock?.kind === "table") {
59
+ if (onlyBlock.rows.length === 0) throw new Error("buildPptxPackage: table has no rows, and a table with no rows cannot be written in every presentation format (ODF requires at least one table:table-row)");
59
60
  populatePptxTable(slide.addTable({
60
61
  frame: shape.frame,
61
62
  rotationDeg: shape.rotationDeg,
62
63
  table: {
63
64
  rows: onlyBlock.rows.length,
64
- columns: onlyBlock.columnWidthsPt.length,
65
+ columns: (0, document_schema_js.tableGridColumnCount)(onlyBlock),
65
66
  columnWidthsPt: onlyBlock.columnWidthsPt
66
67
  }
67
68
  }), onlyBlock, (url) => slide.registerHyperlink(url));
@@ -6,7 +6,7 @@ import { formulaOfBlock, formulaPlaceholderText } from "../../model/formula.js";
6
6
  import { createEmptyPptxPackage } from "./scaffold.js";
7
7
  import { PptxEditor } from "./editor.js";
8
8
  import { base64ToBytes, encodePackage } from "ooxml.js";
9
- import { resolveCellFillColor, tableCellColumnSpan, tableCellRowSpan, walkTableGrid } from "document-schema.js";
9
+ import { resolveCellFillColor, tableCellColumnSpan, tableCellRowSpan, tableGridColumnCount, walkTableGrid } from "document-schema.js";
10
10
  //#region src/edit/pptx/content.ts
11
11
  function buildPptxPackage(content, options) {
12
12
  if (content.kind !== "presentation") throw new Error("buildPptxPackage requires a presentation ContentDocument");
@@ -55,12 +55,13 @@ function appendShape(slide, shape, options) {
55
55
  return;
56
56
  }
57
57
  if (shape.blocks.length === 1 && onlyBlock?.kind === "table") {
58
+ if (onlyBlock.rows.length === 0) throw new Error("buildPptxPackage: table has no rows, and a table with no rows cannot be written in every presentation format (ODF requires at least one table:table-row)");
58
59
  populatePptxTable(slide.addTable({
59
60
  frame: shape.frame,
60
61
  rotationDeg: shape.rotationDeg,
61
62
  table: {
62
63
  rows: onlyBlock.rows.length,
63
- columns: onlyBlock.columnWidthsPt.length,
64
+ columns: tableGridColumnCount(onlyBlock),
64
65
  columnWidthsPt: onlyBlock.columnWidthsPt
65
66
  }
66
67
  }), onlyBlock, (url) => slide.registerHyperlink(url));
package/dist/index.cjs CHANGED
@@ -349,10 +349,10 @@ Object.defineProperty(exports, "ContentVectorSchema", {
349
349
  }
350
350
  });
351
351
  exports.CsvBytesSchema = require_model_bytes.CsvBytesSchema;
352
- exports.CsvInvalidUtf8Error = require_csv_text.CsvInvalidUtf8Error;
353
352
  exports.CsvParseError = require_csv_records.CsvParseError;
354
353
  exports.CsvSheetNotFoundError = require_csv_write.CsvSheetNotFoundError;
355
354
  exports.CsvSheetNotSpecifiedError = require_csv_write.CsvSheetNotSpecifiedError;
355
+ exports.CsvUndecodableTextError = require_csv_text.CsvUndecodableTextError;
356
356
  exports.CsvUnsupportedDocumentKindError = require_csv_write.CsvUnsupportedDocumentKindError;
357
357
  Object.defineProperty(exports, "DEFAULT_LAYOUT_FONT", {
358
358
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -16,7 +16,7 @@ import { PdfToDocumentOptions, ReadDocumentMetadataOptions, ReadNativeDocumentTr
16
16
  import { createLocalDocumentConverter } from "./convert/local.cjs";
17
17
  import { ReadCsvContentOptions, readCsvContent } from "./csv/read.cjs";
18
18
  import { CsvParseError } from "./csv/records.cjs";
19
- import { CsvInvalidUtf8Error, decodeCsvText, encodeCsvText } from "./csv/text.cjs";
19
+ import { CsvUndecodableTextError, decodeCsvText, encodeCsvText } from "./csv/text.cjs";
20
20
  import { BuildCsvTextOptions, CsvSheetNotFoundError, CsvSheetNotSpecifiedError, CsvUnsupportedDocumentKindError, buildCsvText } from "./csv/write.cjs";
21
21
  import { MetadataOverrides } from "./metadata/core-patch.cjs";
22
22
  import { n as RunInit, t as DocRun } from "./run-iYz2M-a_.cjs";
@@ -47,7 +47,7 @@ import { OdgPage, PageImageInit, TextBoxInit } from "./edit/odg/page.cjs";
47
47
  import { CreateOdgOptions, OdgEditor, createOdg, openOdg } from "./edit/odg/editor.cjs";
48
48
  import { CreateEmptyOdgPackageOptions } from "./edit/odg/scaffold.cjs";
49
49
  import { BuildOdpPackageOptions, buildOdpPackage } from "./edit/odp/content.cjs";
50
- import { a as OdtTableRow, i as OdtTableCell, n as OdtCoveredTableCell, o as TableInit$2, r as OdtTable } from "./table-CCjF09Ho.cjs";
50
+ import { a as OdtTableRow, i as OdtTableCell, n as OdtCoveredTableCell, o as TableInit$2, r as OdtTable } from "./table-BT3wN3Hd.cjs";
51
51
  import { OdpSlide, SlideImageInit, SlideTableInit, TextBoxInit as TextBoxInit$1 } from "./edit/odp/slide.cjs";
52
52
  import { CreateOdpOptions, OdpEditor, createOdp, openOdp } from "./edit/odp/editor.cjs";
53
53
  import { CreateEmptyOdpPackageOptions } from "./edit/odp/scaffold.cjs";
@@ -147,4 +147,4 @@ import { RtfBytesSchema, readRtfContent, writeRtfContent } from "rtf-codec";
147
147
  import { EpubBytesSchema, readEpubContent, writeEpubContent } from "epub-codec";
148
148
  import { readWpdContent } from "wpd-codec";
149
149
  import { XlsContentDocument, readXlsContent, writeXlsContent } from "xls-codec";
150
- export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildCsvTextOptions, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, type BuildSvgTextOptions, COLOR_BLACK, type CellPosition, type CellRange, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type CompositionHop, type ContentBlock, ContentBlockSchema, type ContentCellFill, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentEmbeddedObject, type ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, type ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionOptions, type ConversionPlan, type ConversionRequest, type ConversionResult, type CreateDocOptions, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptOptions, type CreatePptxOptions, type CreateXlsOptions, CsvBytesSchema, CsvInvalidUtf8Error, CsvParseError, type CsvReadOptions, CsvSheetNotFoundError, CsvSheetNotSpecifiedError, CsvUnsupportedDocumentKindError, type CsvWriteOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, DocBytesSchema, DocEditor, DocParagraph, type ParagraphInit as DocParagraphInit, DocRun, type RunInit as DocRunInit, DocSection, type SectionInit as DocSectionInit, DocTable, DocTableCell, type TableInit as DocTableInit, DocTableRow, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentFormulaEntry, type DocumentJsonResult, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocumentTree, type DocumentTreeJson, DocumentTreeSchema, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingLayoutResult, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, EpubBytesSchema, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontFace, FontFaceParseError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type Footnote, FootnoteSchema, type GridLattice, type HeaderFooterPart, HeaderFooterPartSchema, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, type HsqldbTable, LATEX_DIAGNOSTIC_CODES, LAYOUT_FORMAT_VERSION, type LatexDiagnostic, type LatexDiagnosticCode, type LatexDiagnosticSink, type LatexFormulaOptions, type LatexFormulaResult, type LatexLoweringResult, type LayoutColor, type LayoutDocument, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type LowerLatexOptions, MATH_LINT_CODES, type Margins, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, type MarkdownMathLoweringOptions, MarkdownParagraph, type ParagraphInit$1 as MarkdownParagraphInit, type MarkdownRenderDiagnostic, type MarkdownRenderDiagnosticCode, MarkdownRenderDiagnosticCodes, type MarkdownRenderDiagnosticSeverity, type MarkdownRenderDiagnosticSink, MarkdownRun, type RunInit$1 as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit$1 as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathLintCode, type MathLintDiagnostic, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdgVector, type OdgVectorKind, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtCoveredTableCell, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit$2 as OdtParagraphInit, OdtRun, type RunInit$2 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$2 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, type PatchDocxMetadataOptions, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, PdfInternalLinkItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptBytesSchema, PptEditor, PptShape, PptSlide, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadCsvContentOptions, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadNativeDocumentTreeOptions, type ReadPdfOptions, type ReadSvgContentOptions, type ReconstructOptions, type Relationship, type RenderMarkdownOptions, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, RtfBytesSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, SVG_DIAGNOSTIC_CODES, type SectionHeaderFooterReferences, SectionHeaderFooterReferencesSchema, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlFromClause, type SqlFromSource, type SqlJoinClause, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, SvgBytesSchema, type SvgDiagnostic, type SvgDiagnosticCode, type SvgDiagnosticSink, SvgInvalidUtf8Error, SvgMissingRootElementError, SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, type SvgReadOptions, SvgUnsupportedDocumentKindError, type SvgWriteOptions, type TableGridCell, type TableGridRows, type TextBoxInit$2 as TextBoxInit, type UnifiedConversionOptions, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, UnsupportedPackageFormatError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsBytesSchema, XlsCell, type XlsContentDocument, XlsEditor, XlsSheet, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildCsvText, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildSvgText, buildXlsxPackage, buildXml, bytesToBase64, cellReference, childrenWithTag, collectDocumentFormulas, collectOfficeMathElements, columnIndexToLetters, columnLettersToIndex, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDocument, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDoc, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPpt, createPptx, createStandardFontMeasurer, createXls, csvMarkdownCodec, csvPdfCodec, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, decodeCompactPackage, decodeCsvText, decodeDocumentPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodeOdbPackage, decodePackage, decodeSvgText, deobfuscateEmbeddedFont, deriveFontKey, describeFontFace, detectGridLattice, docPdfCodec, docToPdf, documentFromJson, documentSchemaKindOf, documentTreeWithSchema, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, embeddedPresentationSerialiser, encodeCompactPackage, encodeCsvText, encodeDocumentPackage, encodeMarkdownText, encodePackage, encodeSvgText, epubPdfCodec, epubToPdf, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, latexToFormula, layoutDocumentFromPackage, layoutFormula, lintMathCoherence, loadMathFont, localName, looksLikeSfnt, lowerLatex, lowerMarkdownMath, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgSvgCodec, odgToPdf, odgToSvg, odmToPdf, odpPdfCodec, odpPptxCodec, odpToOdt, odpToPdf, odpToPptx, odsCsvCodec, odsPdfCodec, odsToCsv, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, openDoc, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPpt, openPptx, openXls, operatorProperties, packageCodec, parseCellReference, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRangeReference, parseRptFormula, parseSelect, parseXml, patchDocxMetadata, pdfCodec, pdfToCsv, pdfToDoc, pdfToDocx, pdfToEpub, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPpt, pdfToPptx, pdfToRtf, pdfToSvg, pdfToXls, pdfToXlsx, pptPdfCodec, pptToPdf, pptxPdfCodec, pptxToDocx, pptxToOdp, pptxToPdf, rangeReference, readCsvContent, readDocContent, readDocumentMetadata, readDocxContent, readDocxExtras, readEpubContent, readFirebirdBackup, readMarkdownContent, readNativeDocumentTree, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptContent, readPptxContent, readRtfContent, readSvgContent, readWpdContent, readXlsContent, readXlsxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderContentDocumentToMarkdown, renderOdbReportContent, resolveCompositionPlan, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, rtfPdfCodec, rtfToPdf, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, svgPdfCodec, svgToOdg, svgToPdf, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writeDocContent, writeEpubContent, writePdf, writePptContent, writeRtfContent, writeXlsContent, displayTextOfValue as xlsDisplayTextOfValue, xlsPdfCodec, xlsToPdf, xlsxCsvCodec, xlsxMarkdownCodec, xlsxPdfCodec, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };
150
+ export { type Alignment, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, type BuildCsvTextOptions, type BuildDocxPackageOptions, type BuildOdgPackageOptions, type BuildOdpPackageOptions, type BuildOdsPackageOptions, type BuildOdtPackageOptions, type BuildPptxPackageOptions, type BuildSvgTextOptions, COLOR_BLACK, type CellPosition, type CellRange, type CellTypeDeclineReason, type CellTypeInference, type CellTypeInferenceResult, type CellTypeInferenceSink, type CellTypeRule, type ClockPort, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type CompositionHop, type ContentBlock, ContentBlockSchema, type ContentCellFill, type ContentCellValue, ContentCellValueSchema, type ContentDocument, type ContentDocumentJson, ContentDocumentSchema, type ContentDrawPage, ContentDrawPageSchema, type ContentEmbeddedObject, type ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, type ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentPathPoint, ContentPathPointSchema, type ContentPathSegment, ContentPathSegmentSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStroke, ContentStrokeSchema, type ContentSubpath, ContentSubpathSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type ContentVector, ContentVectorSchema, type ConversionOptions, type ConversionPlan, type ConversionRequest, type ConversionResult, type CreateDocOptions, type CreateDocxOptions, type CreateEmptyDocxPackageOptions, type CreateEmptyOdgPackageOptions, type CreateEmptyOdpPackageOptions, type CreateEmptyOdsPackageOptions, type CreateEmptyOdtPackageOptions, type CreateEmptyPptxPackageOptions, type CreateMarkdownEditorOptions, type CreateOdgOptions, type CreateOdpOptions, type CreateOdsOptions, type CreateOdtOptions, type CreatePdfOptions, type CreatePptOptions, type CreatePptxOptions, type CreateXlsOptions, CsvBytesSchema, CsvParseError, type CsvReadOptions, CsvSheetNotFoundError, CsvSheetNotSpecifiedError, CsvUndecodableTextError, CsvUnsupportedDocumentKindError, type CsvWriteOptions, DEFAULT_LAYOUT_FONT, DOCUMENT_FORMATS, type DefinedName, DefinedNameSchema, type Diagnostic, DocBytesSchema, DocEditor, DocParagraph, type ParagraphInit as DocParagraphInit, DocRun, type RunInit as DocRunInit, DocSection, type SectionInit as DocSectionInit, DocTable, DocTableCell, type TableInit as DocTableInit, DocTableRow, type DocumentBridgeOptions, type DocumentConverter, type DocumentFontRegistryOptions, type DocumentFormat, DocumentFormatSchema, type DocumentFormulaEntry, type DocumentJsonResult, type DocumentPayload, type DocumentSchemaKind, type DocumentToPdfOptions, type DocumentTree, type DocumentTreeJson, DocumentTreeSchema, type DocxBody, DocxBytesSchema, DocxEditor, type DocxExtras, DocxParagraph, DocxRun, DocxTable, DocxTableCell, DocxTableRow, type DocxVerticalMerge, type DrawingLayoutOptions, type DrawingLayoutResult, type DrawingParagraphInit, type DrawingRunInit, type EngineLayoutOptions, EpubBytesSchema, SUPPORTED_BACKUP_FORMAT_VERSION as FIREBIRD_SUPPORTED_BACKUP_FORMAT_VERSION, FirebirdBackupFormatError, FirebirdBackupParseError, type FirebirdBackupSummary, FirebirdCompositeRecordUnsupportedError, FirebirdDataParseError, FirebirdSchemaParseError, FirebirdUnsupportedFieldTypeError, FontDeobfuscationError, type FontFace, FontFaceParseError, type FontRegistry, type FontRegistryOptions, type FontSourcePackage, type FontSubstitution, type Footnote, FootnoteSchema, type GridLattice, type HeaderFooterPart, HeaderFooterPartSchema, type HsqldbBinaryScript, HsqldbBinaryScriptParseError, type HsqldbColumn, type HsqldbDecodeOptions, HsqldbRowFormatError, HsqldbScriptParseError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, type HsqldbTable, LATEX_DIAGNOSTIC_CODES, LAYOUT_FORMAT_VERSION, type LatexDiagnostic, type LatexDiagnosticCode, type LatexDiagnosticSink, type LatexFormulaOptions, type LatexFormulaResult, type LatexLoweringResult, type LayoutColor, type LayoutDocument, LayoutDocumentSchema, type LayoutEllipse, type LayoutFont, type LayoutFormulaOptions, type LayoutImage, type LayoutImageAsset, type LayoutItem, type LayoutLine, type LayoutLink, type LayoutMetadata, type LayoutPage, type LayoutPath, type LayoutPathSegment, type LayoutRect, type LayoutSubpath, type LayoutText, type LoadedMathFont, type LowerLatexOptions, MATH_LINT_CODES, type Margins, type MarkdownBody, MarkdownBytesSchema, MarkdownEditor, MarkdownList, type MarkdownListInit, type MarkdownMathLoweringOptions, MarkdownParagraph, type ParagraphInit$1 as MarkdownParagraphInit, type MarkdownRenderDiagnostic, type MarkdownRenderDiagnosticCode, MarkdownRenderDiagnosticCodes, type MarkdownRenderDiagnosticSeverity, type MarkdownRenderDiagnosticSink, MarkdownRun, type RunInit$1 as MarkdownRunInit, MarkdownTable, MarkdownTableCell, type TableInit$1 as MarkdownTableInit, MarkdownTableRow, type MathAssembledGlyphs, type MathBox, type MathColor, type MathDiagnostic, type MathDiagnosticKind, type MathFont, type MathFontDescriptorMetrics, type MathFontMetrics, type MathGlyphMetrics, type MathGlyphPlacement, type MathGlyphRun, type MathLayoutItem, type MathLayoutResult, type MathLintCode, type MathLintDiagnostic, type MathMlAttribute, type MathMlElement, type MathMlNode, type MathMlText, type MathRule, type MathStretchAxis, type MathStretchGlyph, type MathStretchResult, type MathStroke, type MathVariant, type MetadataOverrides, NOOP_DIAGNOSTIC_SINK, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, type OdbComponentInfo, type OdbConnectionInfo, type OdbConversionOptions, type OdbForm, type OdbFormControl, type OdbFormDefinition, type OdbInventory, OdbNoEmbeddedDataSourceError, type OdbQueryInfo, type OdbReport, type OdbReportBand, type OdbReportContentOptions, OdbReportDataSourceError, type OdbReportElement, type OdbReportFunction, type OdbReportGroup, OdbReportNotSpecifiedError, type OdbReportToDocxOptions, type OdbReportToOdtOptions, OdbTableNotFoundError, OdbTableNotSpecifiedError, type OdbToCsvOptions, type OdbUnsupportedFormat, OdbUnsupportedFormatError, OdfEmbeddedFontError, OdgBoxVector, type BoxVectorInit as OdgBoxVectorInit, OdgBytesSchema, OdgEditor, OdgLineVector, type LineVectorInit as OdgLineVectorInit, OdgPage, type PageImageInit as OdgPageImageInit, OdgPathVector, type PathVectorInit as OdgPathVectorInit, type TextBoxInit as OdgTextBoxInit, type OdgVector, type OdgVectorKind, type OdmToPdfOptions, OdmUnresolvedSectionError, OdpBytesSchema, OdpEditor, OdpShape, OdpSlide, type SlideImageInit as OdpSlideImageInit, type SlideTableInit as OdpSlideTableInit, type TextBoxInit$1 as OdpTextBoxInit, OdsBytesSchema, OdsCell, OdsEditor, OdsSheet, type OdtBody, OdtBytesSchema, OdtCoveredTableCell, OdtEditor, OdtList, OdtListItem, OdtParagraph, type ParagraphInit$2 as OdtParagraphInit, OdtRun, type RunInit$2 as OdtRunInit, OdtTable, OdtTableCell, type TableInit$2 as OdtTableInit, OdtTableRow, type OmmlDiagnostic, type OmmlDiagnosticKind, type OmmlReadResult, type OmmlWriteResult, OoxmlEmbeddedFontError, type OperatorProperties, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, PackageSchema, type PageInit, type PageSize, type Part, PartSchema, type PatchDocxMetadataOptions, PdfBytesSchema, type PdfDiagnostic, type PdfDiagnosticSeverity, type PdfDiagnosticSink, PdfEditor, type PdfEllipseInit, PdfEllipseItem, PdfEncryptedError, type PdfImageInit, PdfImageItem, PdfInternalLinkItem, type PdfItem, type PdfLineInit, PdfLineItem, type PdfLinkInit, PdfLinkItem, PdfPage, PdfParseError, type PdfPathInit, PdfPathItem, type PdfRectInit, PdfRectItem, type PdfTextInit, PdfTextItem, type PdfToDocumentOptions, type PositionedFormula, PptBytesSchema, PptEditor, PptShape, PptSlide, PptxBytesSchema, PptxEditor, PptxShape, PptxSlide, PptxTable, PptxTableCell, type PptxTableInit, PptxTableRow, type PresentationLayoutResult, type ProvidedFont, type ReadCsvContentOptions, type ReadDocumentMetadataOptions, type ReadDocxContentOptions, type ReadFirebirdBackupResult, type ReadNativeDocumentTreeOptions, type ReadPdfOptions, type ReadSvgContentOptions, type ReconstructOptions, type Relationship, type RenderMarkdownOptions, type ResolvedFace, type RptAggregateFunction, type RptBandDefinition, type RptBandInstance, type RptBandKind, type RptFormula, RptFormulaEvaluationError, RptFormulaParseError, RptFormulaUnsupportedError, type RptGroupDefinition, type RptNamedFunctionDefinition, type RptReference, type RptReportDefinition, type RptReportRun, RptReportStructureError, type RptScope, RtfBytesSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, SVG_DIAGNOSTIC_CODES, type SectionHeaderFooterReferences, SectionHeaderFooterReferencesSchema, type SetDocumentMetadataOptions, type SheetsLayoutOptions, type SlideImageInit$1 as SlideImageInit, type SlideTableInit$1 as SlideTableInit, type SlidesLayoutOptions, type SpreadsheetLayoutResult, type SqlAggregateArgument, type SqlAggregateFunction, type SqlColumnRef, type SqlComparisonOperator, type SqlFromClause, type SqlFromSource, type SqlJoinClause, type SqlLiteral, type SqlNameRef, type SqlOperand, type SqlOrderByTerm, type SqlPredicate, type SqlPunctuation, type SqlResultSet, type SqlSelectItem, type SqlSelectStatement, type SqlSortDirection, type SqlToken, SvgBytesSchema, type SvgDiagnostic, type SvgDiagnosticCode, type SvgDiagnosticSink, SvgInvalidUtf8Error, SvgMissingRootElementError, SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, type SvgReadOptions, SvgUnsupportedDocumentKindError, type SvgWriteOptions, type TableGridCell, type TableGridRows, type TextBoxInit$2 as TextBoxInit, type UnifiedConversionOptions, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, UnsupportedPackageFormatError, type WinAnsiSubstitution, type WordprocessingLayoutResult, type WritePdfOptions, XlsBytesSchema, XlsCell, type XlsContentDocument, XlsEditor, XlsSheet, XlsxBytesSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyMathVariant, attr, base64ToBytes, buildCsvText, buildDocumentBytes, buildDocxPackage, buildDrawingBlock, buildFormulaBlock, buildMarkdownText, buildOdgPackage, buildOdpPackage, buildOdsPackage, buildOdtPackage, buildOfficeMath, buildOfficeMathParagraph, buildPptxPackage, buildSvgText, buildXlsxPackage, buildXml, bytesToBase64, cellReference, childrenWithTag, collectDocumentFormulas, collectOfficeMathElements, columnIndexToLetters, columnLettersToIndex, compactCodec, compactPackageCodec, contentDocumentWithSchema, convertDocument, convertDrawingToLayout, convertPresentationToLayout, convertSpreadsheetToLayout, convertWordprocessingToLayout, createDoc, createDocumentFontRegistry, createDocx, createFontMeasurer, createFontRegistry, createLocalDocumentConverter, createMarkdownEditor, createOdg, createOdp, createOds, createOdt, createPdf, createPpt, createPptx, createStandardFontMeasurer, createXls, csvMarkdownCodec, csvPdfCodec, csvToMarkdown, csvToOds, csvToPdf, csvToXlsx, decodeCompactPackage, decodeCsvText, decodeDocumentPackage, decodeEntities, decodeHsqldbCachedTables, decodeMarkdownText, decodeOdbPackage, decodePackage, decodeSvgText, deobfuscateEmbeddedFont, deriveFontKey, describeFontFace, detectGridLattice, docPdfCodec, docToPdf, documentFromJson, documentSchemaKindOf, documentTreeWithSchema, docxPdfCodec, docxToMarkdown, docxToOdt, docxToPdf, docxToPptx, drawingOfBlock, elementChildren, elementLocalName, elementsWithTag, embeddedPresentationSerialiser, encodeCompactPackage, encodeCsvText, encodeDocumentPackage, encodeMarkdownText, encodePackage, encodeSvgText, epubPdfCodec, epubToPdf, evaluateRptBandOutsideData, evaluateSelect, extractOdfEmbeddedFonts, extractOoxmlEmbeddedFonts, extractSourceFonts, extractSourceFontsForFormat, firstChildByLocalName, fixedClock, flipY, formulaDocument, formulaOfBlock, formulaPlaceholderText, fromCompact, displayTextFor as hsqldbCellDisplayText, inferCellValue, inflateHsqldbCompressedScript, isCompactXmlNode, isContentBlock, isMathMlElement, isMathVariant, isXmlNode, latexToFormula, layoutDocumentFromPackage, layoutFormula, lintMathCoherence, loadMathFont, localName, looksLikeSfnt, lowerLatex, lowerMarkdownMath, mapMathVariant, markdownDocxCodec, markdownOdtCodec, markdownPdfCodec, markdownToCsv, markdownToDocx, markdownToOdt, markdownToPdf, markdownToXlsx, textContent as mathMlTextContent, odbReportCommandSql, odbReportGroupChain, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbTablesToSpreadsheetDocument, odbToCsv, odbToXlsx, odfToPdf, odgPdfCodec, odgSvgCodec, odgToPdf, odgToSvg, odmToPdf, odpPdfCodec, odpPptxCodec, odpToOdt, odpToPdf, odpToPptx, odsCsvCodec, odsPdfCodec, odsToCsv, odsToPdf, odsToXlsx, odsXlsxCodec, odtDocxCodec, odtPdfCodec, odtToDocx, odtToMarkdown, odtToOdp, odtToPdf, openDoc, openDocx, openMarkdown, openOdg, openOdp, openOds, openOdt, openPdf, openPpt, openPptx, openXls, operatorProperties, packageCodec, parseCellReference, parseHsqldbBinaryScript, parseHsqldbScript, parsePackage, parseRangeReference, parseRptFormula, parseSelect, parseXml, patchDocxMetadata, pdfCodec, pdfToCsv, pdfToDoc, pdfToDocx, pdfToEpub, pdfToMarkdown, pdfToOdg, pdfToOdp, pdfToOds, pdfToOdt, pdfToPpt, pdfToPptx, pdfToRtf, pdfToSvg, pdfToXls, pdfToXlsx, pptPdfCodec, pptToPdf, pptxPdfCodec, pptxToDocx, pptxToOdp, pptxToPdf, rangeReference, readCsvContent, readDocContent, readDocumentMetadata, readDocxContent, readDocxExtras, readEpubContent, readFirebirdBackup, readMarkdownContent, readNativeDocumentTree, readOdbForm, readOdbForms, readOdbInventory, readOdbReport, readOdbReportContent, readOdbReports, readOdbTables, readOdfEmbeddedFormula, readOdfFormulaContent, readOdgContent, readOdpContent, readOdsContent, readOdtContent, readOfficeMath, readPdf, readPptContent, readPptxContent, readRtfContent, readSvgContent, readWpdContent, readXlsContent, readXlsxContent, reconstructDrawing, reconstructPresentation, reconstructSpreadsheet, reconstructWordprocessing, renderContentDocumentToMarkdown, renderOdbReportContent, resolveCompositionPlan, resolveMetadataTimestamps, resolveOdbComponent, resolveOdbReportRows, resolveRelationships, rgbHexToColor, rootElement, rptBandDefinition, rptDefinitionFromReport, rtfPdfCodec, rtfToPdf, runRptReport, schemaUriFor, serializePackage, setDocumentMetadata, svgPdfCodec, svgToOdg, svgToPdf, systemClock, textContent$1 as textContent, throwIfAborted, toCompact, tokenizeSql, unzipPackage, walk, writeDocContent, writeEpubContent, writePdf, writePptContent, writeRtfContent, writeXlsContent, displayTextOfValue as xlsDisplayTextOfValue, xlsPdfCodec, xlsToPdf, xlsxCsvCodec, xlsxMarkdownCodec, xlsxPdfCodec, xlsxToCsv, xlsxToMarkdown, xlsxToOds, xlsxToPdf, xmlCodec, zipPackage };