ooxml-core 0.6.0 → 0.8.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 (41) hide show
  1. package/dist/docx/embedded.cjs +23 -2
  2. package/dist/docx/embedded.mjs +23 -2
  3. package/dist/docx/index.cjs +23 -2
  4. package/dist/docx/index.mjs +23 -2
  5. package/dist/docx/layout/index.cjs +2 -0
  6. package/dist/docx/layout/index.mjs +2 -0
  7. package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
  8. package/dist/docx/layout/result.d.ts +3 -0
  9. package/dist/docx/layout/result.d.ts.map +1 -1
  10. package/dist/docx/load/index.cjs +23 -2
  11. package/dist/docx/load/index.mjs +23 -2
  12. package/dist/docx/write-table-properties.d.ts +2 -0
  13. package/dist/docx/write-table-properties.d.ts.map +1 -1
  14. package/dist/docx/write-table.d.ts.map +1 -1
  15. package/dist/visio/cell-formula.d.ts +9 -0
  16. package/dist/visio/cell-formula.d.ts.map +1 -0
  17. package/dist/visio/edit-commands.d.ts +33 -0
  18. package/dist/visio/edit-commands.d.ts.map +1 -0
  19. package/dist/visio/edit-geometry-admission.d.ts +10 -0
  20. package/dist/visio/edit-geometry-admission.d.ts.map +1 -0
  21. package/dist/visio/edit-geometry.d.ts +3 -0
  22. package/dist/visio/edit-geometry.d.ts.map +1 -0
  23. package/dist/visio/edit-recalculate-index.d.ts +25 -0
  24. package/dist/visio/edit-recalculate-index.d.ts.map +1 -0
  25. package/dist/visio/edit-recalculate.d.ts +11 -0
  26. package/dist/visio/edit-recalculate.d.ts.map +1 -0
  27. package/dist/visio/edit-scope.d.ts +5 -0
  28. package/dist/visio/edit-scope.d.ts.map +1 -0
  29. package/dist/visio/edit.d.ts +4 -8
  30. package/dist/visio/edit.d.ts.map +1 -1
  31. package/dist/visio/formula-evaluate.d.ts +10 -0
  32. package/dist/visio/formula-evaluate.d.ts.map +1 -0
  33. package/dist/visio/formula-theme.d.ts +2 -0
  34. package/dist/visio/formula-theme.d.ts.map +1 -0
  35. package/dist/visio/formula.d.ts +52 -0
  36. package/dist/visio/formula.d.ts.map +1 -0
  37. package/dist/visio/index.cjs +1605 -232
  38. package/dist/visio/index.d.ts +2 -1
  39. package/dist/visio/index.d.ts.map +1 -1
  40. package/dist/visio/index.mjs +1601 -233
  41. package/package.json +1 -1
@@ -1790,6 +1790,26 @@ var CELL_ORDER = [
1790
1790
  ];
1791
1791
  var CELL_BORDER_ORDER = ["top", "start", "left", "bottom", "end", "right", "insideH", "insideV"];
1792
1792
  var CELL_SIDES = ["top", "left", "bottom", "right"];
1793
+ function patchCellVerticalAlignment(doc, tc, next, base) {
1794
+ if (next === base) return;
1795
+ if (next !== void 0 && !isStVerticalJc(next))
1796
+ throw new Error("Cell vertical alignment must be a valid ST_VerticalJc value.");
1797
+ let props = first2(tc, "tcPr");
1798
+ if (!props) {
1799
+ if (next === void 0) return;
1800
+ props = makeW(doc, "tcPr");
1801
+ tc.insertBefore(props, tc.firstChild);
1802
+ }
1803
+ const alignment = first2(props, "vAlign") ?? makeW(doc, "vAlign");
1804
+ for (const old of children2(props, "vAlign")) props.removeChild(old);
1805
+ if (next !== void 0) {
1806
+ alignment.setAttributeNS(WORD_NS, "w:val", next);
1807
+ props.appendChild(alignment);
1808
+ }
1809
+ orderChildren(props, CELL_ORDER);
1810
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1) && !props.attributes.length)
1811
+ tc.removeChild(props);
1812
+ }
1793
1813
  function patchCellMargins(doc, tc, next, base) {
1794
1814
  patchMarginProperties(doc, tc, "tcPr", "tcMar", CELL_ORDER, next, base);
1795
1815
  }
@@ -1880,7 +1900,7 @@ var TABLE_DESCRIPTOR_KEYS = [
1880
1900
  "style",
1881
1901
  "look"
1882
1902
  ];
1883
- var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips", "verticalAlign"];
1903
+ var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips"];
1884
1904
  function pick(source, keys) {
1885
1905
  const record = source;
1886
1906
  const result = {};
@@ -1906,7 +1926,7 @@ function assertNoDescriptorEdits(table, base) {
1906
1926
  if (!source) continue;
1907
1927
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
1908
1928
  throw new Error(
1909
- "Cannot edit table cell width, merge or vertical alignment on an existing cell; only cell text, borders, shading and margins are supported. The original DOCX package remains unchanged."
1929
+ "Cannot edit table cell width or merge on an existing cell; cell text, borders, shading, margins and vertical alignment are supported. The original DOCX package remains unchanged."
1910
1930
  );
1911
1931
  }
1912
1932
  }
@@ -1977,6 +1997,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
1977
1997
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
1978
1998
  patchCellShading(doc, tc, cell, source?.model);
1979
1999
  patchCellMargins(doc, tc, cell.margins, source?.model.margins);
2000
+ patchCellVerticalAlignment(doc, tc, cell.verticalAlign, source?.model.verticalAlign);
1980
2001
  const oldParagraphs = children2(tc, "p");
1981
2002
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
1982
2003
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -1784,6 +1784,26 @@ var CELL_ORDER = [
1784
1784
  ];
1785
1785
  var CELL_BORDER_ORDER = ["top", "start", "left", "bottom", "end", "right", "insideH", "insideV"];
1786
1786
  var CELL_SIDES = ["top", "left", "bottom", "right"];
1787
+ function patchCellVerticalAlignment(doc, tc, next, base) {
1788
+ if (next === base) return;
1789
+ if (next !== void 0 && !isStVerticalJc(next))
1790
+ throw new Error("Cell vertical alignment must be a valid ST_VerticalJc value.");
1791
+ let props = first2(tc, "tcPr");
1792
+ if (!props) {
1793
+ if (next === void 0) return;
1794
+ props = makeW(doc, "tcPr");
1795
+ tc.insertBefore(props, tc.firstChild);
1796
+ }
1797
+ const alignment = first2(props, "vAlign") ?? makeW(doc, "vAlign");
1798
+ for (const old of children2(props, "vAlign")) props.removeChild(old);
1799
+ if (next !== void 0) {
1800
+ alignment.setAttributeNS(WORD_NS, "w:val", next);
1801
+ props.appendChild(alignment);
1802
+ }
1803
+ orderChildren(props, CELL_ORDER);
1804
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1) && !props.attributes.length)
1805
+ tc.removeChild(props);
1806
+ }
1787
1807
  function patchCellMargins(doc, tc, next, base) {
1788
1808
  patchMarginProperties(doc, tc, "tcPr", "tcMar", CELL_ORDER, next, base);
1789
1809
  }
@@ -1874,7 +1894,7 @@ var TABLE_DESCRIPTOR_KEYS = [
1874
1894
  "style",
1875
1895
  "look"
1876
1896
  ];
1877
- var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips", "verticalAlign"];
1897
+ var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips"];
1878
1898
  function pick(source, keys) {
1879
1899
  const record = source;
1880
1900
  const result = {};
@@ -1900,7 +1920,7 @@ function assertNoDescriptorEdits(table, base) {
1900
1920
  if (!source) continue;
1901
1921
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
1902
1922
  throw new Error(
1903
- "Cannot edit table cell width, merge or vertical alignment on an existing cell; only cell text, borders, shading and margins are supported. The original DOCX package remains unchanged."
1923
+ "Cannot edit table cell width or merge on an existing cell; cell text, borders, shading, margins and vertical alignment are supported. The original DOCX package remains unchanged."
1904
1924
  );
1905
1925
  }
1906
1926
  }
@@ -1971,6 +1991,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
1971
1991
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
1972
1992
  patchCellShading(doc, tc, cell, source?.model);
1973
1993
  patchCellMargins(doc, tc, cell.margins, source?.model.margins);
1994
+ patchCellVerticalAlignment(doc, tc, cell.verticalAlign, source?.model.verticalAlign);
1974
1995
  const oldParagraphs = children2(tc, "p");
1975
1996
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
1976
1997
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -2435,6 +2435,26 @@ var CELL_ORDER = [
2435
2435
  ];
2436
2436
  var CELL_BORDER_ORDER = ["top", "start", "left", "bottom", "end", "right", "insideH", "insideV"];
2437
2437
  var CELL_SIDES = ["top", "left", "bottom", "right"];
2438
+ function patchCellVerticalAlignment(doc, tc, next, base) {
2439
+ if (next === base) return;
2440
+ if (next !== void 0 && !isStVerticalJc(next))
2441
+ throw new Error("Cell vertical alignment must be a valid ST_VerticalJc value.");
2442
+ let props = first2(tc, "tcPr");
2443
+ if (!props) {
2444
+ if (next === void 0) return;
2445
+ props = makeW(doc, "tcPr");
2446
+ tc.insertBefore(props, tc.firstChild);
2447
+ }
2448
+ const alignment = first2(props, "vAlign") ?? makeW(doc, "vAlign");
2449
+ for (const old of children2(props, "vAlign")) props.removeChild(old);
2450
+ if (next !== void 0) {
2451
+ alignment.setAttributeNS(WORD_NS, "w:val", next);
2452
+ props.appendChild(alignment);
2453
+ }
2454
+ orderChildren(props, CELL_ORDER);
2455
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1) && !props.attributes.length)
2456
+ tc.removeChild(props);
2457
+ }
2438
2458
  function patchCellMargins(doc, tc, next, base) {
2439
2459
  patchMarginProperties(doc, tc, "tcPr", "tcMar", CELL_ORDER, next, base);
2440
2460
  }
@@ -2525,7 +2545,7 @@ var TABLE_DESCRIPTOR_KEYS = [
2525
2545
  "style",
2526
2546
  "look"
2527
2547
  ];
2528
- var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips", "verticalAlign"];
2548
+ var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips"];
2529
2549
  function pick(source, keys) {
2530
2550
  const record = source;
2531
2551
  const result = {};
@@ -2551,7 +2571,7 @@ function assertNoDescriptorEdits(table, base) {
2551
2571
  if (!source) continue;
2552
2572
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
2553
2573
  throw new Error(
2554
- "Cannot edit table cell width, merge or vertical alignment on an existing cell; only cell text, borders, shading and margins are supported. The original DOCX package remains unchanged."
2574
+ "Cannot edit table cell width or merge on an existing cell; cell text, borders, shading, margins and vertical alignment are supported. The original DOCX package remains unchanged."
2555
2575
  );
2556
2576
  }
2557
2577
  }
@@ -2622,6 +2642,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
2622
2642
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
2623
2643
  patchCellShading(doc, tc, cell, source?.model);
2624
2644
  patchCellMargins(doc, tc, cell.margins, source?.model.margins);
2645
+ patchCellVerticalAlignment(doc, tc, cell.verticalAlign, source?.model.verticalAlign);
2625
2646
  const oldParagraphs = children2(tc, "p");
2626
2647
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
2627
2648
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -2429,6 +2429,26 @@ var CELL_ORDER = [
2429
2429
  ];
2430
2430
  var CELL_BORDER_ORDER = ["top", "start", "left", "bottom", "end", "right", "insideH", "insideV"];
2431
2431
  var CELL_SIDES = ["top", "left", "bottom", "right"];
2432
+ function patchCellVerticalAlignment(doc, tc, next, base) {
2433
+ if (next === base) return;
2434
+ if (next !== void 0 && !isStVerticalJc(next))
2435
+ throw new Error("Cell vertical alignment must be a valid ST_VerticalJc value.");
2436
+ let props = first2(tc, "tcPr");
2437
+ if (!props) {
2438
+ if (next === void 0) return;
2439
+ props = makeW(doc, "tcPr");
2440
+ tc.insertBefore(props, tc.firstChild);
2441
+ }
2442
+ const alignment = first2(props, "vAlign") ?? makeW(doc, "vAlign");
2443
+ for (const old of children2(props, "vAlign")) props.removeChild(old);
2444
+ if (next !== void 0) {
2445
+ alignment.setAttributeNS(WORD_NS, "w:val", next);
2446
+ props.appendChild(alignment);
2447
+ }
2448
+ orderChildren(props, CELL_ORDER);
2449
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1) && !props.attributes.length)
2450
+ tc.removeChild(props);
2451
+ }
2432
2452
  function patchCellMargins(doc, tc, next, base) {
2433
2453
  patchMarginProperties(doc, tc, "tcPr", "tcMar", CELL_ORDER, next, base);
2434
2454
  }
@@ -2519,7 +2539,7 @@ var TABLE_DESCRIPTOR_KEYS = [
2519
2539
  "style",
2520
2540
  "look"
2521
2541
  ];
2522
- var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips", "verticalAlign"];
2542
+ var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips"];
2523
2543
  function pick(source, keys) {
2524
2544
  const record = source;
2525
2545
  const result = {};
@@ -2545,7 +2565,7 @@ function assertNoDescriptorEdits(table, base) {
2545
2565
  if (!source) continue;
2546
2566
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
2547
2567
  throw new Error(
2548
- "Cannot edit table cell width, merge or vertical alignment on an existing cell; only cell text, borders, shading and margins are supported. The original DOCX package remains unchanged."
2568
+ "Cannot edit table cell width or merge on an existing cell; cell text, borders, shading, margins and vertical alignment are supported. The original DOCX package remains unchanged."
2549
2569
  );
2550
2570
  }
2551
2571
  }
@@ -2616,6 +2636,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
2616
2636
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
2617
2637
  patchCellShading(doc, tc, cell, source?.model);
2618
2638
  patchCellMargins(doc, tc, cell.margins, source?.model.margins);
2639
+ patchCellVerticalAlignment(doc, tc, cell.verticalAlign, source?.model.verticalAlign);
2619
2640
  const oldParagraphs = children2(tc, "p");
2620
2641
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
2621
2642
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -1130,6 +1130,8 @@ function layoutParagraph(paragraph, contentWidthPx, measurer, note, lineBox, sta
1130
1130
  rendered.forEach(({ token }, index) => {
1131
1131
  const extent2 = tokenExtent(token, paragraph, fonts, measurer);
1132
1132
  const fragment = expectDefined(fragments[index], "fragment for rendered token");
1133
+ fragment.sourceStart = globalOffset(token);
1134
+ fragment.sourceEnd = fragment.sourceStart + (paragraph.runs[token.runIndex]?.synthetic ? 0 : token.kind === "word" || token.kind === "space" ? token.text.length : 1);
1133
1135
  fragment.topPx = baselinePx - extent2.above;
1134
1136
  if (token.kind !== "object") fragment.boxHeightPx = extent2.ascent + extent2.descent;
1135
1137
  });
@@ -1128,6 +1128,8 @@ function layoutParagraph(paragraph, contentWidthPx, measurer, note, lineBox, sta
1128
1128
  rendered.forEach(({ token }, index) => {
1129
1129
  const extent2 = tokenExtent(token, paragraph, fonts, measurer);
1130
1130
  const fragment = expectDefined(fragments[index], "fragment for rendered token");
1131
+ fragment.sourceStart = globalOffset(token);
1132
+ fragment.sourceEnd = fragment.sourceStart + (paragraph.runs[token.runIndex]?.synthetic ? 0 : token.kind === "word" || token.kind === "space" ? token.text.length : 1);
1131
1133
  fragment.topPx = baselinePx - extent2.above;
1132
1134
  if (token.kind !== "object") fragment.boxHeightPx = extent2.ascent + extent2.descent;
1133
1135
  });
@@ -1 +1 @@
1
- {"version":3,"file":"paragraph-layout.d.ts","sourceRoot":"","sources":["../../../src/docx/layout/paragraph-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAkB,UAAU,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAclD,MAAM,WAAW,qBAAqB;IACrC,uFAAuF;IACvF,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAA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EAAuE;IACvE,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC7B;AAED;;;;;;GAMG;AACH;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,CACvB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,KACZ;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE,wBAAgB,eAAe,CAC9B,SAAS,EAAE,eAAe,EAC1B,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EAC/B,OAAO,CAAC,EAAE,SAAS,EACnB,UAAU,SAAI,GACZ,qBAAqB,CA2PvB"}
@@ -4,6 +4,9 @@ export interface LayoutFragment {
4
4
  xPx: number;
5
5
  widthPx: number;
6
6
  runIndex: number;
7
+ /** Paragraph source range represented by this fragment; generated list labels have an empty range. */
8
+ sourceStart?: number;
9
+ sourceEnd?: number;
7
10
  bold?: boolean;
8
11
  italic?: boolean;
9
12
  fontFamily?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/docx/layout/result.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB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IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,uGAAuG;IACvG,cAAc,EAAE,MAAM,EAAE,CAAC;CACzB"}
@@ -1036,6 +1036,26 @@ var CELL_ORDER = [
1036
1036
  ];
1037
1037
  var CELL_BORDER_ORDER = ["top", "start", "left", "bottom", "end", "right", "insideH", "insideV"];
1038
1038
  var CELL_SIDES = ["top", "left", "bottom", "right"];
1039
+ function patchCellVerticalAlignment(doc, tc, next, base) {
1040
+ if (next === base) return;
1041
+ if (next !== void 0 && !isStVerticalJc(next))
1042
+ throw new Error("Cell vertical alignment must be a valid ST_VerticalJc value.");
1043
+ let props = first2(tc, "tcPr");
1044
+ if (!props) {
1045
+ if (next === void 0) return;
1046
+ props = makeW(doc, "tcPr");
1047
+ tc.insertBefore(props, tc.firstChild);
1048
+ }
1049
+ const alignment = first2(props, "vAlign") ?? makeW(doc, "vAlign");
1050
+ for (const old of children2(props, "vAlign")) props.removeChild(old);
1051
+ if (next !== void 0) {
1052
+ alignment.setAttributeNS(WORD_NS, "w:val", next);
1053
+ props.appendChild(alignment);
1054
+ }
1055
+ orderChildren(props, CELL_ORDER);
1056
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1) && !props.attributes.length)
1057
+ tc.removeChild(props);
1058
+ }
1039
1059
  function patchCellMargins(doc, tc, next, base) {
1040
1060
  patchMarginProperties(doc, tc, "tcPr", "tcMar", CELL_ORDER, next, base);
1041
1061
  }
@@ -1126,7 +1146,7 @@ var TABLE_DESCRIPTOR_KEYS = [
1126
1146
  "style",
1127
1147
  "look"
1128
1148
  ];
1129
- var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips", "verticalAlign"];
1149
+ var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips"];
1130
1150
  function pick(source, keys) {
1131
1151
  const record = source;
1132
1152
  const result = {};
@@ -1152,7 +1172,7 @@ function assertNoDescriptorEdits(table, base) {
1152
1172
  if (!source) continue;
1153
1173
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
1154
1174
  throw new Error(
1155
- "Cannot edit table cell width, merge or vertical alignment on an existing cell; only cell text, borders, shading and margins are supported. The original DOCX package remains unchanged."
1175
+ "Cannot edit table cell width or merge on an existing cell; cell text, borders, shading, margins and vertical alignment are supported. The original DOCX package remains unchanged."
1156
1176
  );
1157
1177
  }
1158
1178
  }
@@ -1223,6 +1243,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
1223
1243
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
1224
1244
  patchCellShading(doc, tc, cell, source?.model);
1225
1245
  patchCellMargins(doc, tc, cell.margins, source?.model.margins);
1246
+ patchCellVerticalAlignment(doc, tc, cell.verticalAlign, source?.model.verticalAlign);
1226
1247
  const oldParagraphs = children2(tc, "p");
1227
1248
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
1228
1249
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -1030,6 +1030,26 @@ var CELL_ORDER = [
1030
1030
  ];
1031
1031
  var CELL_BORDER_ORDER = ["top", "start", "left", "bottom", "end", "right", "insideH", "insideV"];
1032
1032
  var CELL_SIDES = ["top", "left", "bottom", "right"];
1033
+ function patchCellVerticalAlignment(doc, tc, next, base) {
1034
+ if (next === base) return;
1035
+ if (next !== void 0 && !isStVerticalJc(next))
1036
+ throw new Error("Cell vertical alignment must be a valid ST_VerticalJc value.");
1037
+ let props = first2(tc, "tcPr");
1038
+ if (!props) {
1039
+ if (next === void 0) return;
1040
+ props = makeW(doc, "tcPr");
1041
+ tc.insertBefore(props, tc.firstChild);
1042
+ }
1043
+ const alignment = first2(props, "vAlign") ?? makeW(doc, "vAlign");
1044
+ for (const old of children2(props, "vAlign")) props.removeChild(old);
1045
+ if (next !== void 0) {
1046
+ alignment.setAttributeNS(WORD_NS, "w:val", next);
1047
+ props.appendChild(alignment);
1048
+ }
1049
+ orderChildren(props, CELL_ORDER);
1050
+ if (!Array.from(props.childNodes).some((node) => node.nodeType === 1) && !props.attributes.length)
1051
+ tc.removeChild(props);
1052
+ }
1033
1053
  function patchCellMargins(doc, tc, next, base) {
1034
1054
  patchMarginProperties(doc, tc, "tcPr", "tcMar", CELL_ORDER, next, base);
1035
1055
  }
@@ -1120,7 +1140,7 @@ var TABLE_DESCRIPTOR_KEYS = [
1120
1140
  "style",
1121
1141
  "look"
1122
1142
  ];
1123
- var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips", "verticalAlign"];
1143
+ var CELL_DESCRIPTOR_KEYS = ["gridSpan", "verticalMerge", "widthTwips"];
1124
1144
  function pick(source, keys) {
1125
1145
  const record = source;
1126
1146
  const result = {};
@@ -1146,7 +1166,7 @@ function assertNoDescriptorEdits(table, base) {
1146
1166
  if (!source) continue;
1147
1167
  if (JSON.stringify(pick(cell, CELL_DESCRIPTOR_KEYS)) !== JSON.stringify(pick(source, CELL_DESCRIPTOR_KEYS)))
1148
1168
  throw new Error(
1149
- "Cannot edit table cell width, merge or vertical alignment on an existing cell; only cell text, borders, shading and margins are supported. The original DOCX package remains unchanged."
1169
+ "Cannot edit table cell width or merge on an existing cell; cell text, borders, shading, margins and vertical alignment are supported. The original DOCX package remains unchanged."
1150
1170
  );
1151
1171
  }
1152
1172
  }
@@ -1217,6 +1237,7 @@ function writeTable(doc, table, node, base, writeParagraph, replaceSlots2) {
1217
1237
  patchCellBorders(doc, tc, cell.borders, source?.model.borders);
1218
1238
  patchCellShading(doc, tc, cell, source?.model);
1219
1239
  patchCellMargins(doc, tc, cell.margins, source?.model.margins);
1240
+ patchCellVerticalAlignment(doc, tc, cell.verticalAlign, source?.model.verticalAlign);
1220
1241
  const oldParagraphs = children2(tc, "p");
1221
1242
  const nextParagraphs = cell.paragraphs.map((paragraph) => {
1222
1243
  const index = source?.paragraphs.findIndex((p) => p.id === paragraph.id) ?? -1;
@@ -5,6 +5,8 @@ import { type XmlDocument, type XmlElement } from './xml.js';
5
5
  export declare function patchRowProperties(doc: XmlDocument, tr: XmlElement, next: TableRowProperties | undefined, base: TableRowProperties | undefined): void;
6
6
  /** Updates table defaults without replacing borders, style, look or extension XML. */
7
7
  export declare function patchTableMargins(doc: XmlDocument, table: Table, node: XmlElement, base?: Table): void;
8
+ /** Patches only vertical alignment; undefined restores table/style default inheritance. */
9
+ export declare function patchCellVerticalAlignment(doc: XmlDocument, tc: XmlElement, next: TableCell['verticalAlign'], base: TableCell['verticalAlign']): void;
8
10
  /** Changes individual cell overrides; deleting an override restores table/default inheritance. */
9
11
  export declare function patchCellMargins(doc: XmlDocument, tc: XmlElement, next: TableCellMargins | undefined, base: TableCellMargins | undefined): void;
10
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"write-table-properties.d.ts","sourceRoot":"","sources":["../../src/docx/write-table-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAK3F,OAAO,EAA0B,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAwCrF,0FAA0F;AAC1F,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,kBAAkB,GAAG,SAAS,EACpC,IAAI,EAAE,kBAAkB,GAAG,SAAS,GAClC,IAAI,CAmBN;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAChC,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,UAAU,EAChB,IAAI,CAAC,EAAE,KAAK,GACV,IAAI,CAUN;AAyBD,kGAAkG;AAClG,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,gBAAgB,GAAG,SAAS,EAClC,IAAI,EAAE,gBAAgB,GAAG,SAAS,GAChC,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,YAAY,GAAG,SAAS,EAC9B,IAAI,EAAE,YAAY,GAAG,SAAS,GAC5B,IAAI,CA0BN;AAED,iGAAiG;AACjG,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,SAAS,EACf,IAAI,CAAC,EAAE,SAAS,GACd,IAAI,CAmBN"}
1
+ {"version":3,"file":"write-table-properties.d.ts","sourceRoot":"","sources":["../../src/docx/write-table-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAK3F,OAAO,EAAmC,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAyC9F,0FAA0F;AAC1F,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,kBAAkB,GAAG,SAAS,EACpC,IAAI,EAAE,kBAAkB,GAAG,SAAS,GAClC,IAAI,CAmBN;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAChC,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,KAAK,EACZ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UAAU,EAAE,EACjB,IAAI,EAAE,UAAU,EAAE,KACd,IAAI,CAAC;AAEV,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAiChE;AAwDD,wBAAgB,UAAU,CACzB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,KAAK,GAAG,SAAS,EACvB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,WAAW,GACvB,UAAU,CAuHZ"}
1
+ {"version":3,"file":"write-table.d.ts","sourceRoot":"","sources":["../../src/docx/write-table.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAa,MAAM,YAAY,CAAC;AAS9D,OAAO,EAMN,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,MAAM,UAAU,CAAC;AAElB,KAAK,eAAe,GAAG,CACtB,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,UAAU,EAChB,IAAI,CAAC,EAAE,SAAS,KACZ,UAAU,CAAC;AAChB,KAAK,WAAW,GAAG,CAClB,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,UAAU,EAAE,EACjB,IAAI,EAAE,UAAU,EAAE,KACd,IAAI,CAAC;AAEV,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAiChE;AAwDD,wBAAgB,UAAU,CACzB,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,KAAK,GAAG,SAAS,EACvB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,WAAW,GACvB,UAAU,CAwHZ"}
@@ -0,0 +1,9 @@
1
+ /** Microsoft Cell_Type F markers are distinct from executable formulas.
2
+ * No Formula locally deletes/blocks a formula; Inh delegates to inheritance.
3
+ * https://learn.microsoft.com/en-us/office/client-developer/visio/cell-element-geometry-sectionvisio-xml
4
+ * Keep exact spelling: an unknown string must never become an inert marker.
5
+ */
6
+ export declare function executableCellFormula(source: string | undefined): string | undefined;
7
+ /** Literal double-click handlers execute only on user activation, never on a transform. */
8
+ export declare function inertDoubleClickFormula(cell: string, source: string): boolean;
9
+ //# sourceMappingURL=cell-formula.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cell-formula.d.ts","sourceRoot":"","sources":["../../src/visio/cell-formula.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAEpF;AAED,2FAA2F;AAC3F,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAE7E"}
@@ -0,0 +1,33 @@
1
+ export interface VisioTextEdit {
2
+ type: 'replace-plain-text';
3
+ pageId: string;
4
+ shapeId: string;
5
+ text: string;
6
+ }
7
+ interface Target {
8
+ pageId: string;
9
+ shapeId: string;
10
+ }
11
+ /** Drawing inches; bottom-left origin, up-positive rotation pin. */
12
+ export type VisioGeometryEdit = (Target & {
13
+ type: 'create-rectangle';
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ text?: string;
19
+ }) | (Target & {
20
+ type: 'move-shape';
21
+ x: number;
22
+ y: number;
23
+ }) | (Target & {
24
+ type: 'resize-shape';
25
+ width: number;
26
+ height: number;
27
+ }) | (Target & {
28
+ type: 'delete-shape';
29
+ });
30
+ export type VisioEdit = VisioTextEdit | VisioGeometryEdit;
31
+ export declare function snapshotVisioEdits(edits: readonly VisioEdit[], maxEdits: number, maxText: number): VisioEdit[];
32
+ export {};
33
+ //# sourceMappingURL=edit-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-commands.d.ts","sourceRoot":"","sources":["../../src/visio/edit-commands.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACb;AACD,UAAU,MAAM;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB;AACD,oEAAoE;AACpE,MAAM,MAAM,iBAAiB,GAC1B,CAAC,MAAM,GAAG;IACV,IAAI,EAAE,kBAAkB,CAAC;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACb,CAAC,GACF,CAAC,MAAM,GAAG;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GACvD,CAAC,MAAM,GAAG;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GAClE,CAAC,MAAM,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC,CAAC;AACvC,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAE1D,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACb,SAAS,EAAE,CAuEb"}
@@ -0,0 +1,10 @@
1
+ import type { VisioGeometryEdit } from './edit-commands.js';
2
+ export declare const cells: (shape: Element) => Map<string, Element>;
3
+ export declare function numeric(node: Element | undefined, fallback?: number): number;
4
+ export declare function editableCell(node: Element | undefined): void;
5
+ export declare function setCell(shape: Element, name: string, value: number, formula?: string): void;
6
+ export declare function admitted(root: Element, shapeId: string): Element;
7
+ /** Only proven inactive inherited scalar protection is admitted; masters remain unsupported. */
8
+ export declare function protectedShape(shape: Element, document: Element): void;
9
+ export declare function resizeGeometry(shape: Element, roots: ReadonlyMap<string, Element>, edit: VisioGeometryEdit, check: () => void): void;
10
+ //# sourceMappingURL=edit-geometry-admission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-geometry-admission.d.ts","sourceRoot":"","sources":["../../src/visio/edit-geometry-admission.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAW5D,eAAO,MAAM,KAAK,GAAI,OAAO,OAAO,yBAC+C,CAAC;AACpF,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ5E;AACD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAsB5D;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAa3F;AACD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAyChE;AACD,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAiGtE;AACD,wBAAgB,cAAc,CAC7B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,IAAI,GACf,IAAI,CA+CN"}
@@ -0,0 +1,3 @@
1
+ import type { VisioGeometryEdit } from './edit-commands.js';
2
+ export declare function applyGeometryEdit(roots: ReadonlyMap<string, Element>, document: Element, edit: VisioGeometryEdit, check: () => void): readonly string[];
3
+ //# sourceMappingURL=edit-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-geometry.d.ts","sourceRoot":"","sources":["../../src/visio/edit-geometry.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AA4E5D,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,IAAI,GACf,SAAS,MAAM,EAAE,CAgHnB"}
@@ -0,0 +1,25 @@
1
+ import { parseVisioFormula, type VisioFormulaValue } from './formula.js';
2
+ export interface VisioCellKey {
3
+ pageId: string;
4
+ shapeId: string;
5
+ cell: string;
6
+ }
7
+ export interface VisioRecalculationOptions {
8
+ maxCells?: number;
9
+ maxAffectedCells?: number;
10
+ maxSteps?: number;
11
+ maxDepth?: number;
12
+ check?: () => void;
13
+ }
14
+ export interface IndexedCell extends VisioCellKey {
15
+ node?: Element;
16
+ formula?: ReturnType<typeof parseVisioFormula>;
17
+ dependencies: string[];
18
+ unsafe: boolean;
19
+ unit: VisioFormulaValue['unit'];
20
+ }
21
+ export declare const key: (cell: VisioCellKey) => string;
22
+ export declare function bound(value: number | undefined, fallback: number): number;
23
+ /** All local sheets participate, including sections, named rows, and static Sheet.ID references. */
24
+ export declare function indexCells(roots: ReadonlyMap<string, Element>, options: VisioRecalculationOptions): Map<string, IndexedCell>;
25
+ //# sourceMappingURL=edit-recalculate-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-recalculate-index.d.ts","sourceRoot":"","sources":["../../src/visio/edit-recalculate-index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAuB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAG9F,MAAM,WAAW,YAAY;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACnB;AACD,MAAM,WAAW,WAAY,SAAQ,YAAY;IAChD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAC/C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;CAChC;AACD,eAAO,MAAM,GAAG,GAAI,MAAM,YAAY,WAC+B,CAAC;AACtE,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKzE;AAWD,oGAAoG;AACpG,wBAAgB,UAAU,CACzB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,EAAE,yBAAyB,4BA0JlC"}
@@ -0,0 +1,11 @@
1
+ import { type VisioCellKey, type VisioRecalculationOptions } from './edit-recalculate-index.js';
2
+ export type { VisioCellKey, VisioRecalculationOptions } from './edit-recalculate-index.js';
3
+ /** Compute first, write caches only after the entire affected closure succeeds. F and U remain untouched. */
4
+ export declare function recalculateVisioCells(roots: ReadonlyMap<string, Element>, changed: readonly VisioCellKey[], options?: VisioRecalculationOptions): readonly string[];
5
+ /** Deletion is only admitted when no static formula or Connect record refers to the shape. */
6
+ export declare function assertVisioShapeUnreferenced(roots: ReadonlyMap<string, Element>, pageId: string, shapeId: string, options?: VisioRecalculationOptions): void;
7
+ /** Static transitive proof for admission of dimension-dependent absolute geometry. */
8
+ export declare function visioCellDependsOn(roots: ReadonlyMap<string, Element>, source: VisioCellKey, targets: readonly VisioCellKey[], options?: VisioRecalculationOptions): boolean;
9
+ /** Reuse a bounded index for package admission instead of rebuilding it per reference. */
10
+ export declare function createVisioDependencyQuery(roots: ReadonlyMap<string, Element>, options?: VisioRecalculationOptions): (source: VisioCellKey, targets: readonly VisioCellKey[]) => boolean;
11
+ //# sourceMappingURL=edit-recalculate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-recalculate.d.ts","sourceRoot":"","sources":["../../src/visio/edit-recalculate.ts"],"names":[],"mappings":"AAQA,OAAO,EAIN,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAE3F,6GAA6G;AAC7G,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,OAAO,GAAE,yBAA8B,GACrC,SAAS,MAAM,EAAE,CA4FnB;AAED,8FAA8F;AAC9F,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,yBAA8B,GACrC,IAAI,CAmBN;AAED,sFAAsF;AACtF,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,OAAO,GAAE,yBAA8B,GACrC,OAAO,CAET;AAED,0FAA0F;AAC1F,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,GAAE,yBAA8B,GACrC,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,YAAY,EAAE,KAAK,OAAO,CAuBrE"}
@@ -0,0 +1,5 @@
1
+ import type { VisioGeometryEdit } from './edit-commands.js';
2
+ import type { VisioPackage } from './package.js';
3
+ /** Separate master and page ShapeSheet ID namespaces; refuse unsupported affected metadata and inheritance. */
4
+ export declare function assertGeometryPackageScope(pkg: VisioPackage, pagePaths: ReadonlySet<string>, commands: readonly VisioGeometryEdit[], check: () => void, roots: ReadonlyMap<string, Element>): Promise<void>;
5
+ //# sourceMappingURL=edit-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-scope.d.ts","sourceRoot":"","sources":["../../src/visio/edit-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAyCjD,+GAA+G;AAC/G,wBAAsB,0BAA0B,CAC/C,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,EAC9B,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EACtC,KAAK,EAAE,MAAM,IAAI,EACjB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC,CAiOf"}
@@ -1,10 +1,6 @@
1
1
  import { type VisioPackageLimits } from './package-common.js';
2
- export interface VisioTextEdit {
3
- type: 'replace-plain-text';
4
- pageId: string;
5
- shapeId: string;
6
- text: string;
7
- }
2
+ import { type VisioEdit } from './edit-commands.js';
3
+ export type { VisioEdit, VisioTextEdit, VisioGeometryEdit } from './edit-commands.js';
8
4
  export interface EditVsdxOptions {
9
5
  limits?: Partial<VisioPackageLimits>;
10
6
  maxEdits?: number;
@@ -19,8 +15,8 @@ export interface EditVsdxResult {
19
15
  message: string;
20
16
  }[];
21
17
  }
22
- /** Experimental source-backed plain-text transaction. No formulas are recalculated.
18
+ /** Experimental source-backed atomic text and conservative geometry transaction.
23
19
  * Untouched part payloads are byte-preserved; edited XML and ZIP representation are not.
24
20
  */
25
- export declare function editVsdx(input: Uint8Array | ArrayBuffer, edits: readonly VisioTextEdit[], options?: EditVsdxOptions): Promise<EditVsdxResult>;
21
+ export declare function editVsdx(input: Uint8Array | ArrayBuffer, edits: readonly VisioEdit[], options?: EditVsdxOptions): Promise<EditVsdxResult>;
26
22
  //# sourceMappingURL=edit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/visio/edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAK9E,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,eAAe;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,UAAU,CAAC;IAClB,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,WAAW,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1D;AAMD;;GAEG;AACH,wBAAsB,QAAQ,CAC7B,KAAK,EAAE,UAAU,GAAG,WAAW,EAC/B,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,OAAO,GAAE,eAAoB,GAC3B,OAAO,CAAC,cAAc,CAAC,CA8FzB"}
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/visio/edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9E,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGxE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,MAAM,WAAW,eAAe;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,UAAU,CAAC;IAClB,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,WAAW,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1D;AAMD;;GAEG;AACH,wBAAsB,QAAQ,CAC7B,KAAK,EAAE,UAAU,GAAG,WAAW,EAC/B,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,OAAO,GAAE,eAAoB,GAC3B,OAAO,CAAC,cAAc,CAAC,CA2GzB"}
@@ -0,0 +1,10 @@
1
+ import type { VisioFormulaAst, VisioFormulaLimits, VisioFormulaReference, VisioFormulaValue } from './formula.js';
2
+ export interface VisioFormulaAnalysis {
3
+ references: VisioFormulaReference[];
4
+ unsupportedFunctions: string[];
5
+ dynamic: boolean;
6
+ guarded: boolean;
7
+ }
8
+ export declare function analyzeVisioFormula(source: string | VisioFormulaAst, limits?: VisioFormulaLimits): VisioFormulaAnalysis;
9
+ export declare function evaluateVisioFormula(source: string | VisioFormulaAst, resolve: (reference: VisioFormulaReference) => VisioFormulaValue, limits?: VisioFormulaLimits): VisioFormulaValue;
10
+ //# sourceMappingURL=formula-evaluate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formula-evaluate.d.ts","sourceRoot":"","sources":["../../src/visio/formula-evaluate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,cAAc,CAAC;AAmEtB,MAAM,WAAW,oBAAoB;IACpC,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CACjB;AAoBD,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,GAAG,eAAe,EAChC,MAAM,GAAE,kBAAuB,GAC7B,oBAAoB,CAmCtB;AAkDD,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,MAAM,GAAG,eAAe,EAChC,OAAO,EAAE,CAAC,SAAS,EAAE,qBAAqB,KAAK,iBAAiB,EAChE,MAAM,GAAE,kBAAuB,GAC7B,iBAAiB,CAmGnB"}
@@ -0,0 +1,2 @@
1
+ export declare const themeInputs: string[];
2
+ //# sourceMappingURL=formula-theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formula-theme.d.ts","sourceRoot":"","sources":["../../src/visio/formula-theme.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,UAcvB,CAAC"}