ooxml-core 1.41.0 → 1.43.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 (166) hide show
  1. package/README.md +4 -0
  2. package/dist/{PptxHandler-3AGIITR7.mjs → PptxHandler-3VAVJDFB.mjs} +2 -2
  3. package/dist/PptxHandler-V23RDNEX.cjs +14 -0
  4. package/dist/PptxHandler-WB3KL2WH.mjs +5 -0
  5. package/dist/{PresentationBuilder-JNID4B4Z.mjs → PresentationBuilder-7LJMTRJ6.mjs} +2 -2
  6. package/dist/{PresentationBuilder-MZBKYOYD.cjs → PresentationBuilder-KHL6GONR.cjs} +6 -6
  7. package/dist/{PresentationBuilder-5DPKFUXP.mjs → PresentationBuilder-PY2GB4IG.mjs} +3 -3
  8. package/dist/automation/index.cjs +79 -91
  9. package/dist/automation/index.mjs +79 -91
  10. package/dist/chart/index.cjs +12 -9
  11. package/dist/chart/index.mjs +12 -9
  12. package/dist/{chunk-ZYCBJKAE.mjs → chunk-243ZYX2B.mjs} +1 -1
  13. package/dist/{chunk-LRBWCRQ3.cjs → chunk-3J6VIKLP.cjs} +3 -3
  14. package/dist/{chunk-DD7COXWR.mjs → chunk-4LEVL6ZW.mjs} +30 -13
  15. package/dist/chunk-CODMW5KF.cjs +110 -0
  16. package/dist/{chunk-HTELXT2N.mjs → chunk-HLYOHD2Z.mjs} +30 -12
  17. package/dist/{chunk-P3WAKBVS.mjs → chunk-IPV3J3I5.mjs} +82 -90
  18. package/dist/{chunk-6LGRRQ3K.mjs → chunk-JHYU7HGG.mjs} +1 -1
  19. package/dist/{chunk-JXR6YWBW.mjs → chunk-KCDLTVUI.mjs} +125 -126
  20. package/dist/chunk-O3YGBYGZ.mjs +104 -0
  21. package/dist/{chunk-75KBNUKS.cjs → chunk-QZPOPUI5.cjs} +82 -89
  22. package/dist/{chunk-3BIFRTU4.cjs → chunk-RNZQ2OU4.cjs} +1294 -1276
  23. package/dist/{chunk-UE23HF2N.mjs → chunk-VKFKEVHK.mjs} +1 -1
  24. package/dist/{chunk-KKVD3R6O.mjs → chunk-WEAWSXUX.mjs} +4 -4
  25. package/dist/diagram/index.cjs +499 -370
  26. package/dist/diagram/index.d.ts +1 -0
  27. package/dist/diagram/index.d.ts.map +1 -1
  28. package/dist/diagram/index.mjs +495 -371
  29. package/dist/docx/embedded.cjs +67 -89
  30. package/dist/docx/embedded.mjs +67 -89
  31. package/dist/docx/index.cjs +125 -110
  32. package/dist/docx/index.mjs +125 -110
  33. package/dist/docx/layout/index.cjs +257 -110
  34. package/dist/docx/layout/index.d.ts +1 -0
  35. package/dist/docx/layout/index.d.ts.map +1 -1
  36. package/dist/docx/layout/index.mjs +257 -111
  37. package/dist/docx/layout/webfont-runs.d.ts +5 -0
  38. package/dist/docx/layout/webfont-runs.d.ts.map +1 -0
  39. package/dist/docx/load/index.cjs +67 -89
  40. package/dist/docx/load/index.mjs +67 -89
  41. package/dist/docx/shape-svg.d.ts.map +1 -1
  42. package/dist/docx/ui/index.cjs +79 -98
  43. package/dist/docx/ui/index.mjs +79 -98
  44. package/dist/drawingml/dash-pattern.d.ts +61 -0
  45. package/dist/drawingml/dash-pattern.d.ts.map +1 -0
  46. package/dist/drawingml/index.cjs +249 -43
  47. package/dist/drawingml/index.d.ts +3 -0
  48. package/dist/drawingml/index.d.ts.map +1 -1
  49. package/dist/drawingml/index.mjs +241 -44
  50. package/dist/drawingml/rect-path-gradient.d.ts +5 -0
  51. package/dist/drawingml/rect-path-gradient.d.ts.map +1 -1
  52. package/dist/drawingml/shape-path-gradient.d.ts +57 -0
  53. package/dist/drawingml/shape-path-gradient.d.ts.map +1 -0
  54. package/dist/geometry/index.cjs +68 -90
  55. package/dist/geometry/index.mjs +68 -90
  56. package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts +2 -2
  57. package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts.map +1 -1
  58. package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts.map +1 -1
  59. package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts.map +1 -1
  60. package/dist/index.cjs +2937 -493
  61. package/dist/index.mjs +2937 -493
  62. package/dist/pptx/automation/index.cjs +366 -197
  63. package/dist/pptx/automation/index.d.ts +11 -17
  64. package/dist/pptx/automation/index.d.ts.map +1 -1
  65. package/dist/pptx/automation/index.mjs +156 -71
  66. package/dist/pptx/chunks/{elements-6BMEOo7i.d.ts → elements-PBugbKtv.d.ts} +3 -873
  67. package/dist/pptx/chunks/elements-PBugbKtv.d.ts.map +1 -0
  68. package/dist/pptx/chunks/{index-BbXLv6As.d.ts → index-Bj-hur0D.d.ts} +4 -4
  69. package/dist/pptx/chunks/{index-BbXLv6As.d.ts.map → index-Bj-hur0D.d.ts.map} +1 -1
  70. package/dist/pptx/chunks/{index-DvN0TkJJ.d.ts → index-CCJiD-Bm.d.ts} +14 -10
  71. package/dist/pptx/chunks/index-CCJiD-Bm.d.ts.map +1 -0
  72. package/dist/pptx/chunks/{index-Dija_Wth.d.ts → index-CGNb1TV9.d.ts} +22 -4
  73. package/dist/pptx/chunks/index-CGNb1TV9.d.ts.map +1 -0
  74. package/dist/pptx/chunks/table-C7ITXL3Y.d.ts +875 -0
  75. package/dist/pptx/chunks/table-C7ITXL3Y.d.ts.map +1 -0
  76. package/dist/pptx/chunks/{text-operations-DorONr3h.d.ts → text-operations-BNJr7aGa.d.ts} +3 -2
  77. package/dist/pptx/chunks/text-operations-BNJr7aGa.d.ts.map +1 -0
  78. package/dist/pptx/cli/index.cjs +180 -102
  79. package/dist/pptx/cli/index.d.ts +1 -1
  80. package/dist/pptx/cli/index.mjs +4 -4
  81. package/dist/pptx/converter/index.cjs +69 -91
  82. package/dist/pptx/converter/index.d.ts +1 -1
  83. package/dist/pptx/converter/index.mjs +2 -2
  84. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  85. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  86. package/dist/pptx/editor/render/find-replace.cjs +15 -15
  87. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  88. package/dist/pptx/editor/render/find-replace.mjs +2 -2
  89. package/dist/pptx/editor/render/slide-operations.cjs +9 -9
  90. package/dist/pptx/editor/render/slide-operations.mjs +3 -3
  91. package/dist/pptx/editor/render/table-data-grid-ops.cjs +5 -5
  92. package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
  93. package/dist/pptx/editor/render/table-layout.cjs +6 -6
  94. package/dist/pptx/editor/render/table-layout.d.ts +8 -37
  95. package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
  96. package/dist/pptx/editor/render/table-layout.mjs +1 -1
  97. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
  98. package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
  99. package/dist/pptx/index.cjs +225 -135
  100. package/dist/pptx/index.d.ts +6 -5
  101. package/dist/pptx/index.mjs +5 -5
  102. package/dist/pptx/node/index.d.ts +1 -1
  103. package/dist/teams/index.cjs +136 -91
  104. package/dist/teams/index.mjs +136 -91
  105. package/dist/text/css-font-family.d.ts.map +1 -1
  106. package/dist/text/font-metrics/design-advances.generated.d.ts +3 -1
  107. package/dist/text/font-metrics/design-advances.generated.d.ts.map +1 -1
  108. package/dist/text/index.cjs +2252 -0
  109. package/dist/text/index.d.ts +1 -0
  110. package/dist/text/index.d.ts.map +1 -1
  111. package/dist/text/index.mjs +2231 -1
  112. package/dist/text/metric-font-family.d.ts.map +1 -1
  113. package/dist/text/webfonts/font-weight-names.d.ts +66 -0
  114. package/dist/text/webfonts/font-weight-names.d.ts.map +1 -0
  115. package/dist/text/webfonts/google-fonts-catalogue.d.ts +14 -0
  116. package/dist/text/webfonts/google-fonts-catalogue.d.ts.map +1 -0
  117. package/dist/text/webfonts/google-fonts-lookup.d.ts +7 -0
  118. package/dist/text/webfonts/google-fonts-lookup.d.ts.map +1 -0
  119. package/dist/text/webfonts/google-fonts-request.d.ts +57 -0
  120. package/dist/text/webfonts/google-fonts-request.d.ts.map +1 -0
  121. package/dist/text/webfonts/index.d.ts +12 -0
  122. package/dist/text/webfonts/index.d.ts.map +1 -0
  123. package/dist/text/webfonts/metric-clones.d.ts +17 -0
  124. package/dist/text/webfonts/metric-clones.d.ts.map +1 -0
  125. package/dist/text/webfonts/webfont-faces.d.ts +24 -0
  126. package/dist/text/webfonts/webfont-faces.d.ts.map +1 -0
  127. package/dist/visio/index.cjs +64 -0
  128. package/dist/visio/index.d.ts +1 -0
  129. package/dist/visio/index.d.ts.map +1 -1
  130. package/dist/visio/index.mjs +64 -1
  131. package/dist/visio/ui/index.cjs +8 -0
  132. package/dist/visio/ui/index.mjs +8 -0
  133. package/dist/visio/webfont-runs.d.ts +27 -0
  134. package/dist/visio/webfont-runs.d.ts.map +1 -0
  135. package/dist/xlsx/collab/index.cjs +67 -89
  136. package/dist/xlsx/collab/index.mjs +67 -89
  137. package/dist/xlsx/index.cjs +2253 -118
  138. package/dist/xlsx/index.mjs +2249 -119
  139. package/dist/xlsx/layout/font-stack.d.ts +8 -0
  140. package/dist/xlsx/layout/font-stack.d.ts.map +1 -0
  141. package/dist/xlsx/layout/index.d.ts +3 -1
  142. package/dist/xlsx/layout/index.d.ts.map +1 -1
  143. package/dist/xlsx/layout/shape-paint.d.ts.map +1 -1
  144. package/dist/xlsx/layout/shape-view.d.ts.map +1 -1
  145. package/dist/xlsx/layout/style-view.d.ts +2 -0
  146. package/dist/xlsx/layout/style-view.d.ts.map +1 -1
  147. package/dist/xlsx/layout/webfont-runs.d.ts +11 -0
  148. package/dist/xlsx/layout/webfont-runs.d.ts.map +1 -0
  149. package/dist/xlsx/load/index.cjs +67 -89
  150. package/dist/xlsx/load/index.mjs +67 -89
  151. package/dist/xlsx/ui/commands/util.d.ts.map +1 -1
  152. package/dist/xlsx/ui/context.d.ts +5 -0
  153. package/dist/xlsx/ui/context.d.ts.map +1 -1
  154. package/dist/xlsx/ui/grid/cell-paint.d.ts +3 -2
  155. package/dist/xlsx/ui/grid/cell-paint.d.ts.map +1 -1
  156. package/dist/xlsx/ui/index.cjs +2093 -102
  157. package/dist/xlsx/ui/index.mjs +2093 -103
  158. package/package.json +1 -1
  159. package/dist/PptxHandler-EL4E4SPH.mjs +0 -5
  160. package/dist/PptxHandler-OIZ3R3DJ.cjs +0 -14
  161. package/dist/chunk-3IT6ZD7K.mjs +0 -213
  162. package/dist/chunk-FRUB573B.cjs +0 -219
  163. package/dist/pptx/chunks/elements-6BMEOo7i.d.ts.map +0 -1
  164. package/dist/pptx/chunks/index-Dija_Wth.d.ts.map +0 -1
  165. package/dist/pptx/chunks/index-DvN0TkJJ.d.ts.map +0 -1
  166. package/dist/pptx/chunks/text-operations-DorONr3h.d.ts.map +0 -1
@@ -27,6 +27,15 @@ var __export = (target, all) => {
27
27
  __defProp(target, name, { get: all[name], enumerable: true });
28
28
  };
29
29
 
30
+ // units/constants.ts
31
+ var EMU_PER_PIXEL, EMU_PER_POINT;
32
+ var init_constants = __esm({
33
+ "units/constants.ts"() {
34
+ EMU_PER_PIXEL = 9525;
35
+ EMU_PER_POINT = 12700;
36
+ }
37
+ });
38
+
30
39
  // pptx/core/utils/clone-utils.ts
31
40
  function isPlainRecord(value) {
32
41
  if (typeof value !== "object" || value === null) {
@@ -98,6 +107,20 @@ var init_clone_utils = __esm({
98
107
  }
99
108
  });
100
109
 
110
+ // units/units.ts
111
+ var init_units = __esm({
112
+ "units/units.ts"() {
113
+ }
114
+ });
115
+
116
+ // units/index.ts
117
+ var init_units2 = __esm({
118
+ "units/index.ts"() {
119
+ init_units();
120
+ init_constants();
121
+ }
122
+ });
123
+
101
124
  // pptx/core/types/common.ts
102
125
  var init_common = __esm({
103
126
  "pptx/core/types/common.ts"() {
@@ -1866,29 +1889,6 @@ var init_custom_geometry = __esm({
1866
1889
  }
1867
1890
  });
1868
1891
 
1869
- // units/units.ts
1870
- var init_units = __esm({
1871
- "units/units.ts"() {
1872
- }
1873
- });
1874
-
1875
- // units/constants.ts
1876
- var EMU_PER_PIXEL, EMU_PER_POINT;
1877
- var init_constants = __esm({
1878
- "units/constants.ts"() {
1879
- EMU_PER_PIXEL = 9525;
1880
- EMU_PER_POINT = 12700;
1881
- }
1882
- });
1883
-
1884
- // units/index.ts
1885
- var init_units2 = __esm({
1886
- "units/index.ts"() {
1887
- init_units();
1888
- init_constants();
1889
- }
1890
- });
1891
-
1892
1892
  // pptx/core/constants-colors.ts
1893
1893
  var PRESET_COLOR_MAP, SYSTEM_COLOR_MAP;
1894
1894
  var init_constants_colors = __esm({
@@ -5986,7 +5986,7 @@ function build(name, glyph) {
5986
5986
  const paths = glyph(g3);
5987
5987
  return exactDef(name, void 0, g3.guides(), "l t r b", [p(FACE), ...paths]);
5988
5988
  }
5989
- var Glyph, FACE, D, darken, darkenLess, lighten, triangle, QUESTION, MOVIE, buttons, EXACT_ACTION_BUTTON_PRESET_DEFINITIONS;
5989
+ var Glyph, FACE, D, darken, darkenLess, lighten, triangle, U, question, MOVIE, buttons, EXACT_ACTION_BUTTON_PRESET_DEFINITIONS;
5990
5990
  var init_preset_shape_definitions_exact_action_buttons = __esm({
5991
5991
  "geometry/preset-shape-definitions-exact-action-buttons.ts"() {
5992
5992
  init_preset_shape_exact_dsl();
@@ -6052,84 +6052,22 @@ var init_preset_shape_definitions_exact_action_buttons = __esm({
6052
6052
  [D * dir, 0],
6053
6053
  [-D * dir, D]
6054
6054
  ]);
6055
- QUESTION = [
6056
- [-4.8, -33.7],
6057
- [-6.3, -31.5],
6058
- [-7.8, -31.5],
6059
- [-12.3, -28.5],
6060
- [-14.5, -28.5],
6061
- [-15.3, -27.7],
6062
- [-15.3, -25.5],
6063
- [-18.3, -21],
6064
- [-19, -17.2],
6065
- [-20.5, -16.5],
6066
- [-20.5, -12.7],
6067
- [-19, -12.7],
6068
- [-18.3, -14.2],
6069
- [-10.8, -14.2],
6070
- [-10, -13.5],
6071
- [-8.5, -13.5],
6072
- [-9.3, -17.2],
6073
- [-7.8, -19.5],
6074
- [-4, -22.5],
6075
- [-3.3, -21.7],
6076
- [-1.8, -21.7],
6077
- [-1, -23.2],
6078
- [0.5, -23.2],
6079
- [1.2, -21.7],
6080
- [2.7, -21.7],
6081
- [3.5, -22.5],
6082
- [8, -18.7],
6083
- [8.7, -17.2],
6084
- [8, -16.5],
6085
- [8, -15],
6086
- [9.5, -14.2],
6087
- [9.5, -13.5],
6088
- [8, -12.7],
6089
- [8.7, -9.7],
6090
- [5, -6],
6091
- [2, -6],
6092
- [-2.5, -2.2],
6093
- [-3.3, 0.8],
6094
- [-5.5, 2.3],
6095
- [-4.8, 6.8],
6096
- [-6.3, 7.5],
6097
- [-6.3, 18],
6098
- [-4.8, 18],
6099
- [-4, 17.3],
6100
- [4.2, 17.3],
6101
- [4.2, 6.8],
6102
- [6.5, 5.3],
6103
- [6.5, 3.8],
6104
- [8, 3],
6105
- [8, 1.5],
6106
- [8.7, 0.8],
6107
- [13.2, 0],
6108
- [17, -4.5],
6109
- [18.5, -4.5],
6110
- [18.5, -6],
6111
- [17.7, -6.7],
6112
- [18.5, -8.2],
6113
- [18.5, -15],
6114
- [20, -15.7],
6115
- [20, -18],
6116
- [17.7, -19.5],
6117
- [17.7, -21],
6118
- [15.5, -24.7],
6119
- [15.5, -27],
6120
- [14, -27],
6121
- [13.2, -27.7],
6122
- [13.2, -29.2],
6123
- [9.5, -30],
6124
- [8.7, -30.7],
6125
- [8.7, -32.2],
6126
- [5.7, -31.5],
6127
- [4.2, -33.7],
6128
- [2.7, -33.7],
6129
- [2, -32.2],
6130
- [-2.5, -32.2],
6131
- [-3.3, -33.7]
6132
- ];
6055
+ U = 90;
6056
+ question = (g3) => {
6057
+ const x = (v) => g3.x(v * U);
6058
+ const y = (v) => g3.y(v * U);
6059
+ const r = (v) => g3.len(v * U);
6060
+ return [
6061
+ `M ${x(-0.214)} ${y(-0.162)} A ${r(0.214)} ${r(0.2125)} 10800000 10800000`,
6062
+ `A ${r(0.108)} ${r(0.162)} 0 5400000`,
6063
+ `A ${r(0.053)} ${r(0.085)} 16200000 -5400000`,
6064
+ `L ${x(0.053)} ${y(0.187)} L ${x(-0.053)} ${y(0.187)} L ${x(-0.053)} ${y(0.08)}`,
6065
+ `A ${r(0.108)} ${r(0.16)} 10800000 5400000`,
6066
+ `A ${r(0.052)} ${r(0.082)} 5400000 -5400000`,
6067
+ `A ${r(0.107)} ${r(0.1065)} 0 -10800000`,
6068
+ `L ${x(-0.214)} ${y(-0.162)} Z`
6069
+ ].join(" ");
6070
+ };
6133
6071
  MOVIE = [
6134
6072
  [-33.75, -16.5],
6135
6073
  [-33.75, -3],
@@ -6236,8 +6174,8 @@ var init_preset_shape_definitions_exact_action_buttons = __esm({
6236
6174
  )
6237
6175
  ]),
6238
6176
  actionButtonHelp: build("actionButtonHelp", (g3) => [
6239
- darken(g3.poly(QUESTION)),
6240
- darken(g3.circle(-0.2, 27.4, 7))
6177
+ darken(question(g3)),
6178
+ darken(g3.circle(0, 0.295 * U, 0.08 * U))
6241
6179
  ]),
6242
6180
  actionButtonInformation: build("actionButtonInformation", (g3) => [
6243
6181
  darken(g3.circle(0, 0.4, 34)),
@@ -9484,7 +9422,7 @@ var init_preset_shape_definitions_exact_arcs = __esm({
9484
9422
  });
9485
9423
 
9486
9424
  // geometry/preset-shape-definitions-exact-arrows.ts
9487
- var leftRightArrow2, upDownArrow2, quadArrow2, leftUpArrow2, leftRightUpArrow2, EXACT_ARROW_PRESET_DEFINITIONS;
9425
+ var leftRightArrow2, upDownArrow2, quadArrow2, leftUpArrow2, leftRightUpArrow2, swooshArrow3, EXACT_ARROW_PRESET_DEFINITIONS;
9488
9426
  var init_preset_shape_definitions_exact_arrows = __esm({
9489
9427
  "geometry/preset-shape-definitions-exact-arrows.ts"() {
9490
9428
  init_preset_shape_exact_dsl();
@@ -9618,12 +9556,46 @@ var init_preset_shape_definitions_exact_arrows = __esm({
9618
9556
  )
9619
9557
  ]
9620
9558
  );
9559
+ swooshArrow3 = exactDef(
9560
+ "swooshArrow",
9561
+ { adj1: 25e3, adj2: 16667 },
9562
+ [
9563
+ "a1 pin 1 adj1 75000",
9564
+ "maxAdj2 */ 70000 w ss",
9565
+ "a2 pin 0 adj2 maxAdj2",
9566
+ "ad1 */ h a1 100000",
9567
+ "ad2 */ ss a2 100000",
9568
+ "xB +- r 0 ad2",
9569
+ "yB +- t ssd8 0",
9570
+ "alfa */ cd4 1 14",
9571
+ "dx0 tan ssd8 alfa",
9572
+ "xC +- xB 0 dx0",
9573
+ "dx1 tan ad1 alfa",
9574
+ "yF +- yB ad1 0",
9575
+ "xF +- xB dx1 0",
9576
+ "xE +- xF dx0 0",
9577
+ "yE +- yF ssd8 0",
9578
+ "dy2 +- yE 0 t",
9579
+ "dy22 */ dy2 1 2",
9580
+ "dy3 */ h 1 20",
9581
+ "yD +- dy22 0 dy3",
9582
+ "dy4 */ hd6 1 1",
9583
+ "yP1 +- hd6 dy4 0",
9584
+ "xP1 val wd6",
9585
+ "dy5 */ hd6 1 2",
9586
+ "yP2 +- yF dy5 0",
9587
+ "xP2 val wd4"
9588
+ ],
9589
+ "l t r b",
9590
+ [p("M l b Q xP1 yP1 xB yB L xC t L r yD L xE yE L xF yF Q xP2 yP2 l b Z")]
9591
+ );
9621
9592
  EXACT_ARROW_PRESET_DEFINITIONS = {
9622
9593
  leftRightArrow: leftRightArrow2,
9623
9594
  upDownArrow: upDownArrow2,
9624
9595
  quadArrow: quadArrow2,
9625
9596
  leftUpArrow: leftUpArrow2,
9626
- leftRightUpArrow: leftRightUpArrow2
9597
+ leftRightUpArrow: leftRightUpArrow2,
9598
+ swooshArrow: swooshArrow3
9627
9599
  };
9628
9600
  }
9629
9601
  });
@@ -10459,10 +10431,13 @@ var init_preset_shape_definitions_exact_scrolls = __esm({
10459
10431
  p(
10460
10432
  "M ch ch2 A ch2 ch2 10800000 5400000 L x6 t A ch2 ch2 16200000 10800000 L x4 ch L x4 y4 A ch2 ch2 0 5400000 L ch2 b A ch2 ch2 5400000 10800000 L ch y3 Z"
10461
10433
  ),
10462
- p("M l y4 A ch2 ch2 10800000 21600000 Z M xsw cy3 A ch4 ch4 0 21600000 Z", {
10463
- fill: "darkenLess",
10464
- stroke: false
10465
- }),
10434
+ p(
10435
+ "M ch y4 A ch2 ch2 0 5400000 A ch2 ch2 5400000 10800000 A ch4 ch4 16200000 10800000 Z M x3b ch2 A ch2 ch2 0 5400000 A ch4 ch4 5400000 10800000 Z",
10436
+ {
10437
+ fill: "darkenLess",
10438
+ stroke: false
10439
+ }
10440
+ ),
10466
10441
  p(
10467
10442
  "M x3 t A ch2 ch2 16200000 10800000 L x4 ch M ch2 y4 L ch y4 M x3b ch2 L x3 ch2 A ch4 ch4 16200000 -10800000",
10468
10443
  { fill: "none" }
@@ -10478,10 +10453,13 @@ var init_preset_shape_definitions_exact_scrolls = __esm({
10478
10453
  p(
10479
10454
  "M ch2 ch A ch2 ch2 16200000 -5400000 L l x6 A ch2 ch2 10800000 -10800000 L ch x4 L y4 x4 A ch2 ch2 5400000 -5400000 L r ch2 A ch2 ch2 0 -10800000 L y3 ch Z"
10480
10455
  ),
10481
- p("M y4 t A ch2 ch2 16200000 21600000 Z M ch cyw A ch4 ch4 0 21600000 Z", {
10482
- fill: "darkenLess",
10483
- stroke: false
10484
- }),
10456
+ p(
10457
+ "M y4 ch A ch2 ch2 5400000 -5400000 A ch2 ch2 0 -10800000 A ch4 ch4 10800000 -10800000 Z M ch2 x3b A ch2 ch2 5400000 -5400000 A ch4 ch4 0 -10800000 Z",
10458
+ {
10459
+ fill: "darkenLess",
10460
+ stroke: false
10461
+ }
10462
+ ),
10485
10463
  p(
10486
10464
  "M l x3 A ch2 ch2 10800000 -10800000 L ch x4 M y4 ch2 L y4 ch M ch2 x3b L ch2 x3 A ch4 ch4 10800000 10800000",
10487
10465
  { fill: "none" }
@@ -20588,6 +20566,20 @@ function xmlAttrNumber(node2, name) {
20588
20566
  const parsed = Number(raw2);
20589
20567
  return Number.isFinite(parsed) ? parsed : void 0;
20590
20568
  }
20569
+ function xmlAttrBool(node2, name) {
20570
+ const raw2 = xmlAttr(node2, name);
20571
+ if (raw2 === void 0) {
20572
+ return void 0;
20573
+ }
20574
+ const normalized = raw2.trim().toLowerCase();
20575
+ if (normalized === "1" || normalized === "true") {
20576
+ return true;
20577
+ }
20578
+ if (normalized === "0" || normalized === "false") {
20579
+ return false;
20580
+ }
20581
+ return void 0;
20582
+ }
20591
20583
  function xmlText(node2) {
20592
20584
  if (!isXmlObject(node2)) {
20593
20585
  return coerceString(node2);
@@ -49906,6 +49898,72 @@ var init_rect_path_gradient = __esm({
49906
49898
  "drawingml/rect-path-gradient.ts"() {
49907
49899
  }
49908
49900
  });
49901
+ var init_shape_path_gradient = __esm({
49902
+ "drawingml/shape-path-gradient.ts"() {
49903
+ new Set(
49904
+ [
49905
+ "chevron",
49906
+ "rightArrow",
49907
+ "leftArrow",
49908
+ "upArrow",
49909
+ "downArrow",
49910
+ "stripedRightArrow",
49911
+ "notchedRightArrow",
49912
+ "bentUpArrow",
49913
+ "bentArrow",
49914
+ "uturnArrow",
49915
+ "leftRightArrow",
49916
+ "upDownArrow",
49917
+ "leftUpArrow",
49918
+ "leftRightUpArrow",
49919
+ "quadArrow",
49920
+ "curvedRightArrow",
49921
+ "curvedLeftArrow",
49922
+ "curvedUpArrow",
49923
+ "curvedDownArrow",
49924
+ "swooshArrow",
49925
+ "lightningBolt",
49926
+ "sun",
49927
+ "moon",
49928
+ "smileyFace",
49929
+ "ribbon",
49930
+ "ribbon2",
49931
+ "ellipseRibbon",
49932
+ "ellipseRibbon2",
49933
+ "leftRightRibbon",
49934
+ "verticalScroll",
49935
+ "horizontalScroll",
49936
+ "wave",
49937
+ "doubleWave",
49938
+ "flowChartDocument",
49939
+ "flowChartMultidocument",
49940
+ "flowChartPunchedTape",
49941
+ "flowChartMagneticDisk",
49942
+ "flowChartDisplay"
49943
+ ].map((name) => name.toLowerCase())
49944
+ );
49945
+ new Set(
49946
+ [
49947
+ "donut",
49948
+ "noSmoking",
49949
+ "blockArc",
49950
+ "frame",
49951
+ "chord",
49952
+ "funnel",
49953
+ "mathDivide",
49954
+ "mathNotEqual",
49955
+ "cornerTabs",
49956
+ "squareTabs",
49957
+ "plaqueTabs",
49958
+ "circularArrow",
49959
+ "leftCircularArrow",
49960
+ "leftRightCircularArrow",
49961
+ "flowChartMagneticTape",
49962
+ "flowChartMagneticDrum"
49963
+ ].map((name) => name.toLowerCase())
49964
+ );
49965
+ }
49966
+ });
49909
49967
 
49910
49968
  // diagram/index.ts
49911
49969
  var init_diagram = __esm({
@@ -49947,6 +50005,7 @@ var init_diagram = __esm({
49947
50005
  init_gradient_presets();
49948
50006
  init_gradient_geometry();
49949
50007
  init_rect_path_gradient();
50008
+ init_shape_path_gradient();
49950
50009
  }
49951
50010
  });
49952
50011
 
@@ -75462,6 +75521,7 @@ var PptxTableDataParser;
75462
75521
  var init_PptxTableDataParser = __esm({
75463
75522
  "pptx/core/core/builders/PptxTableDataParser.ts"() {
75464
75523
  init_utils();
75524
+ init_xml_access();
75465
75525
  init_table_style_effect_parse();
75466
75526
  init_table_style_fill_parse();
75467
75527
  init_table_cell_3d_helpers();
@@ -75514,8 +75574,8 @@ var init_PptxTableDataParser = __esm({
75514
75574
  style: this.extractTableCellStyleFromXml(cellNode, slidePath),
75515
75575
  gridSpan: cellNode["@_gridSpan"] ? parseInt(String(cellNode["@_gridSpan"]), 10) : void 0,
75516
75576
  rowSpan: cellNode["@_rowSpan"] ? parseInt(String(cellNode["@_rowSpan"]), 10) : void 0,
75517
- vMerge: cellNode["@_vMerge"] === "1",
75518
- hMerge: cellNode["@_hMerge"] === "1",
75577
+ vMerge: xmlAttrBool(cellNode, "vMerge") ?? false,
75578
+ hMerge: xmlAttrBool(cellNode, "hMerge") ?? false,
75519
75579
  ...extraAttributes ? { extraAttributes } : {}
75520
75580
  };
75521
75581
  })
@@ -119788,8 +119848,8 @@ function wmfPicture(bytes) {
119788
119848
  bytes: bytes.subarray(22),
119789
119849
  metafile: {
119790
119850
  bounds: [left, top, right, bottom],
119791
- widthEmu: Math.round((right - left) * EMU_PER_INCH / inch),
119792
- heightEmu: Math.round((bottom - top) * EMU_PER_INCH / inch)
119851
+ widthEmu: Math.round((right - left) * EMU_PER_INCH2 / inch),
119852
+ heightEmu: Math.round((bottom - top) * EMU_PER_INCH2 / inch)
119793
119853
  }
119794
119854
  };
119795
119855
  }
@@ -119838,13 +119898,13 @@ function bytesToPicture(bytes) {
119838
119898
  return void 0;
119839
119899
  }
119840
119900
  }
119841
- var EMU_PER_HUNDREDTH_MM, EMU_PER_INCH;
119901
+ var EMU_PER_HUNDREDTH_MM, EMU_PER_INCH2;
119842
119902
  var init_picture_encode = __esm({
119843
119903
  "pptx/core/ppt/writer/picture-encode.ts"() {
119844
119904
  init_gif_decode();
119845
119905
  init_png_encoder_compressed();
119846
119906
  EMU_PER_HUNDREDTH_MM = 360;
119847
- EMU_PER_INCH = 914400;
119907
+ EMU_PER_INCH2 = 914400;
119848
119908
  }
119849
119909
  });
119850
119910
 
@@ -142647,8 +142707,7 @@ function cells(row) {
142647
142707
  }
142648
142708
  function promoteTextBody(source2, next, removed, survivor, axis) {
142649
142709
  const span = axis === "row" ? "rowSpan" : "gridSpan";
142650
- const continuation = axis === "row" ? "vMerge" : "hMerge";
142651
- if (!source2?.text || !next || !removed || !survivor || source2[continuation] || (source2[span] ?? 1) <= 1 || next[continuation] || (next[span] ?? 1) !== (source2[span] ?? 1) - 1) {
142710
+ if (!source2?.text || !next || !removed || !survivor || source2.hMerge || source2.vMerge || (source2[span] ?? 1) <= 1 || next.hMerge || next.vMerge || (next[span] ?? 1) !== (source2[span] ?? 1) - 1) {
142652
142711
  return;
142653
142712
  }
142654
142713
  if (removed["a:txBody"] !== void 0) {
@@ -146918,7 +146977,10 @@ var init_PptxHandlerRuntimeSaveEffectsWriter = __esm({
146918
146977
  });
146919
146978
 
146920
146979
  // pptx/core/core/runtime/PptxHandlerRuntimeSaveTextWriter.ts
146921
- var PptxHandlerRuntime31;
146980
+ function firstWarpGuideName(preset) {
146981
+ return preset !== void 0 && ADJ1_WARP_PRESETS.has(preset) ? "adj1" : "adj";
146982
+ }
146983
+ var ADJ1_WARP_PRESETS, PptxHandlerRuntime31;
146922
146984
  var init_PptxHandlerRuntimeSaveTextWriter = __esm({
146923
146985
  "pptx/core/core/runtime/PptxHandlerRuntimeSaveTextWriter.ts"() {
146924
146986
  init_body_properties_parser();
@@ -146929,6 +146991,16 @@ var init_PptxHandlerRuntimeSaveTextWriter = __esm({
146929
146991
  init_paragraph_scoped_segment_state();
146930
146992
  init_PptxHandlerRuntimeSaveEffectsWriter();
146931
146993
  init_PptxHandlerRuntimeSaveParagraphHelpers();
146994
+ ADJ1_WARP_PRESETS = /* @__PURE__ */ new Set([
146995
+ "textWave1",
146996
+ "textWave2",
146997
+ "textWave4",
146998
+ "textDoubleWave1",
146999
+ "textArchUpPour",
147000
+ "textArchDownPour",
147001
+ "textCirclePour",
147002
+ "textButtonPour"
147003
+ ]);
146932
147004
  PptxHandlerRuntime31 = class _PptxHandlerRuntime extends PptxHandlerRuntime30 {
146933
147005
  /**
146934
147006
  * Build and write the text body (`p:txBody`) for shapes, text boxes,
@@ -147014,7 +147086,7 @@ var init_PptxHandlerRuntimeSaveTextWriter = __esm({
147014
147086
  const adjGds = [];
147015
147087
  if (el.textStyle.textWarpAdj !== void 0 && Number.isFinite(el.textStyle.textWarpAdj)) {
147016
147088
  adjGds.push({
147017
- "@_name": "adj",
147089
+ "@_name": firstWarpGuideName(el.textStyle.textWarpPreset),
147018
147090
  "@_fmla": `val ${el.textStyle.textWarpAdj}`
147019
147091
  });
147020
147092
  }
@@ -155302,7 +155374,7 @@ var init_PptxHandlerRuntimeShapeBodyParsing = __esm({
155302
155374
  if (!Number.isFinite(val)) {
155303
155375
  continue;
155304
155376
  }
155305
- if (name === "adj") {
155377
+ if (name === "adj" || name === "adj1") {
155306
155378
  textStyle.textWarpAdj = val;
155307
155379
  } else if (name === "adj2") {
155308
155380
  textStyle.textWarpAdj2 = val;
@@ -164957,7 +165029,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
164957
165029
  init_PptxHandlerRuntimeLoadSession();
164958
165030
  init_slide_fingerprint();
164959
165031
  PptxHandlerRuntime101 = class extends PptxHandlerRuntime100 {
164960
- async buildLoadData(presentationState, slidesWithWarnings, slideMasters) {
165032
+ async buildLoadData(presentationState, slidesWithWarnings, slideMasters, embedded) {
164961
165033
  const headerFooter = this.extractHeaderFooter();
164962
165034
  const presentationProperties = await this.parsePresentationProperties();
164963
165035
  const viewProperties = await this.parseViewProperties();
@@ -164965,8 +165037,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
164965
165037
  const customShows = this.parseCustomShows();
164966
165038
  const tableStyleMap = await this.parseTableStyles();
164967
165039
  const tableStylesDefaultId = this.loadedTableStylesDefaultId;
164968
- const embeddedFontList = parseEmbeddedFontList(this.presentationData);
164969
- const embeddedFonts = await this.getEmbeddedFonts(embeddedFontList);
165040
+ const { list: embeddedFontList, fonts: embeddedFonts } = embedded;
164970
165041
  this.loadedEmbeddedFonts = embeddedFonts;
164971
165042
  this.loadedEmbeddedFontList = embeddedFontList;
164972
165043
  const themeOptions = await this.parseThemeOptions();
@@ -165155,7 +165226,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
165155
165226
  await this.initializeLoadSession(data, options2);
165156
165227
  reader2 = this.beginPartReads();
165157
165228
  try {
165158
- return await this.loadInitializedSession();
165229
+ return await this.loadInitializedSession(options2.onSlidesParsed);
165159
165230
  } catch (error62) {
165160
165231
  if (error62 instanceof PptxLoadLimitError) {
165161
165232
  this.dispose();
@@ -165166,7 +165237,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
165166
165237
  this.endPartReads(reader2);
165167
165238
  }
165168
165239
  }
165169
- async loadInitializedSession() {
165240
+ async loadInitializedSession(onSlidesParsed) {
165170
165241
  await this.detectAndPreserveVbaProject();
165171
165242
  this.detectDigitalSignatureParts();
165172
165243
  await this.parseCustomXmlParts();
@@ -165177,7 +165248,13 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
165177
165248
  const slidesWithWarnings = this.attachSlideWarnings(slides);
165178
165249
  this.resetElementIdCounter(slides);
165179
165250
  recordSlideFingerprints(this.savedSlideFingerprints, slidesWithWarnings);
165180
- return this.buildLoadData(presentationState, slidesWithWarnings, slideMasters);
165251
+ const embeddedFontList = parseEmbeddedFontList(this.presentationData);
165252
+ const embeddedFonts = await this.getEmbeddedFonts(embeddedFontList);
165253
+ onSlidesParsed?.({ slides: slidesWithWarnings, embeddedFonts });
165254
+ return this.buildLoadData(presentationState, slidesWithWarnings, slideMasters, {
165255
+ list: embeddedFontList,
165256
+ fonts: embeddedFonts
165257
+ });
165181
165258
  }
165182
165259
  /**
165183
165260
  * Retrieve the current background colour for a layout or master.
@@ -170178,6 +170255,7 @@ __export(slide_tools_exports, {
170178
170255
  setSlideTransition: () => setSlideTransition,
170179
170256
  updateSlideProperties: () => updateSlideProperties
170180
170257
  });
170258
+ init_constants();
170181
170259
 
170182
170260
  // pptx/core/builders/sdk/slide-operations.ts
170183
170261
  init_clone_utils();
@@ -170221,6 +170299,12 @@ function duplicateSlide(slide, newSlideNumber) {
170221
170299
  return cloned;
170222
170300
  }
170223
170301
 
170302
+ // pptx/core/builders/sdk/units.ts
170303
+ init_units2();
170304
+ function emuToPixels(emu2) {
170305
+ return Math.round(emu2 / EMU_PER_PIXEL);
170306
+ }
170307
+
170224
170308
  // pptx/automation/tools/helpers.ts
170225
170309
  var helpers_exports = {};
170226
170310
  __export(helpers_exports, {
@@ -175331,18 +175415,25 @@ function setSlideTransition(ctx, params) {
175331
175415
  };
175332
175416
  }
175333
175417
  function setCanvasSize(ctx, params) {
175334
- ctx.pptxData.width = params.width;
175335
- ctx.pptxData.height = params.height;
175336
- if (ctx.pptxData.widthEmu !== void 0) {
175337
- ctx.pptxData.widthEmu = Math.round(params.width * 12700);
175338
- }
175339
- if (ctx.pptxData.heightEmu !== void 0) {
175340
- ctx.pptxData.heightEmu = Math.round(params.height * 12700);
175341
- }
175418
+ const { width, height } = params;
175419
+ if (![width, height].every((points7) => points7 >= 72 && points7 <= 4032)) {
175420
+ throw new RangeError("Canvas width and height must be between 72 and 4032 points.");
175421
+ }
175422
+ const { pptxData } = ctx;
175423
+ const widthEmu = Math.round(width * EMU_PER_POINT);
175424
+ const heightEmu = Math.round(height * EMU_PER_POINT);
175425
+ if (pptxData.widthEmu !== widthEmu || pptxData.heightEmu !== heightEmu) {
175426
+ delete pptxData.slideSizeType;
175427
+ }
175428
+ pptxData.widthEmu = widthEmu;
175429
+ pptxData.heightEmu = heightEmu;
175430
+ pptxData.width = emuToPixels(widthEmu);
175431
+ pptxData.height = emuToPixels(heightEmu);
175342
175432
  return {
175343
- pptxData: ctx.pptxData,
175433
+ pptxData,
175344
175434
  dirty: true,
175345
- result: { canvasWidth: params.width, canvasHeight: params.height }
175435
+ result: { canvasWidth: width, canvasHeight: height },
175436
+ saveOptions: { slideSize: { widthEmu, heightEmu, type: pptxData.slideSizeType ?? "" } }
175346
175437
  };
175347
175438
  }
175348
175439
 
@@ -176276,6 +176367,111 @@ __export(table_tools_exports, {
176276
176367
  manageTableStructure: () => manageTableStructure,
176277
176368
  updateTableCells: () => updateTableCells
176278
176369
  });
176370
+
176371
+ // pptx/editor/render/table-layout.ts
176372
+ var DEFAULT_INSERTED_ROW_HEIGHT = 40;
176373
+ function createCell(text2 = "") {
176374
+ return { text: text2, style: {} };
176375
+ }
176376
+ function copyRows(data) {
176377
+ return data.rows.map((row) => ({ ...row, cells: [...row.cells] }));
176378
+ }
176379
+ function updateIntersectingMerges(source2, rows, edit) {
176380
+ const isRowEdit = edit.axis === "row";
176381
+ const inserting = edit.action === "insert";
176382
+ const delta2 = inserting ? 1 : -1;
176383
+ for (const [rowIndex, row] of source2.rows.entries()) {
176384
+ for (const [columnIndex, anchor2] of row.cells.entries()) {
176385
+ if (anchor2.hMerge || anchor2.vMerge) continue;
176386
+ const rowSpan = anchor2.rowSpan ?? 1;
176387
+ const gridSpan = anchor2.gridSpan ?? 1;
176388
+ const start = isRowEdit ? rowIndex : columnIndex;
176389
+ const span = isRowEdit ? rowSpan : gridSpan;
176390
+ if (edit.index < start || edit.index >= start + span || (inserting ? edit.index === start : span === 1)) {
176391
+ continue;
176392
+ }
176393
+ if (!Number.isInteger(rowSpan) || !Number.isInteger(gridSpan) || rowSpan < 1 || gridSpan < 1 || rowIndex + rowSpan > source2.rows.length || columnIndex + gridSpan > source2.columnWidths.length) {
176394
+ continue;
176395
+ }
176396
+ const height = isRowEdit ? rowSpan + delta2 : rowSpan;
176397
+ const width = isRowEdit ? gridSpan : gridSpan + delta2;
176398
+ const anchorRemoved = !inserting && edit.index === start;
176399
+ for (let r = rowIndex; r < rowIndex + height; r++) {
176400
+ for (let c = columnIndex; c < columnIndex + width; c++) {
176401
+ const cell2 = rows[r]?.cells[c];
176402
+ if (!cell2) continue;
176403
+ const firstRow = r === rowIndex;
176404
+ const firstColumn = c === columnIndex;
176405
+ const promote2 = anchorRemoved && firstRow && firstColumn;
176406
+ const content2 = promote2 && anchor2.text ? anchor2 : cell2;
176407
+ rows[r].cells[c] = {
176408
+ ...cell2,
176409
+ text: content2.text,
176410
+ textRuns: content2.textRuns,
176411
+ paragraphs: content2.paragraphs,
176412
+ style: promote2 ? cell2.style ?? anchor2.style : cell2.style,
176413
+ rowSpan: firstRow && height > 1 ? height : void 0,
176414
+ gridSpan: firstColumn && width > 1 ? width : void 0,
176415
+ hMerge: firstColumn ? void 0 : true,
176416
+ vMerge: firstRow ? void 0 : true
176417
+ };
176418
+ }
176419
+ }
176420
+ }
176421
+ }
176422
+ }
176423
+ function normalizeWidths(widths) {
176424
+ const sum = widths.reduce((total, width) => total + width, 0);
176425
+ return sum > 0 ? widths.map((width) => width / sum) : widths;
176426
+ }
176427
+ function insertTableRow(tableData, rowIdx, position4, cellTexts) {
176428
+ const index2 = Math.max(0, Math.min(tableData.rows.length, rowIdx + Number(position4 === "below")));
176429
+ const rows = copyRows(tableData);
176430
+ rows.splice(index2, 0, {
176431
+ height: DEFAULT_INSERTED_ROW_HEIGHT,
176432
+ cells: tableData.columnWidths.map((_, column) => createCell(cellTexts?.[column]))
176433
+ });
176434
+ updateIntersectingMerges(tableData, rows, { axis: "row", action: "insert", index: index2 });
176435
+ return { ...tableData, rows };
176436
+ }
176437
+ function deleteTableRow(tableData, rowIdx) {
176438
+ if (tableData.rows.length <= 1 || rowIdx < 0 || rowIdx >= tableData.rows.length) {
176439
+ return tableData;
176440
+ }
176441
+ const rows = copyRows(tableData);
176442
+ rows.splice(rowIdx, 1);
176443
+ updateIntersectingMerges(tableData, rows, { axis: "row", action: "delete", index: rowIdx });
176444
+ return { ...tableData, rows };
176445
+ }
176446
+ function insertTableColumn(tableData, colIdx, position4, cellTexts) {
176447
+ const count2 = tableData.columnWidths.length;
176448
+ const index2 = Math.max(0, Math.min(count2, colIdx + Number(position4 === "right")));
176449
+ const columnWidths = [...tableData.columnWidths];
176450
+ if (count2 === 0) {
176451
+ columnWidths.push(1);
176452
+ } else {
176453
+ const neighbour = Math.min(index2, count2 - 1);
176454
+ const half = columnWidths[neighbour] / 2;
176455
+ columnWidths[neighbour] = half;
176456
+ columnWidths.splice(index2, 0, half);
176457
+ }
176458
+ const rows = copyRows(tableData);
176459
+ rows.forEach((row, rowIndex) => row.cells.splice(index2, 0, createCell(cellTexts?.[rowIndex])));
176460
+ updateIntersectingMerges(tableData, rows, { axis: "column", action: "insert", index: index2 });
176461
+ return { ...tableData, rows, columnWidths: normalizeWidths(columnWidths) };
176462
+ }
176463
+ function deleteTableColumn(tableData, colIdx) {
176464
+ if (tableData.columnWidths.length <= 1 || colIdx < 0 || colIdx >= tableData.columnWidths.length) {
176465
+ return tableData;
176466
+ }
176467
+ const rows = copyRows(tableData);
176468
+ rows.forEach((row) => row.cells.splice(colIdx, 1));
176469
+ updateIntersectingMerges(tableData, rows, { axis: "column", action: "delete", index: colIdx });
176470
+ const columnWidths = tableData.columnWidths.filter((_, index2) => index2 !== colIdx);
176471
+ return { ...tableData, rows, columnWidths: normalizeWidths(columnWidths) };
176472
+ }
176473
+
176474
+ // pptx/automation/tools/table-tools.ts
176279
176475
  function updateTableCells(ctx, params) {
176280
176476
  const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
176281
176477
  if (err) {
@@ -176331,90 +176527,66 @@ function manageTableStructure(ctx, params) {
176331
176527
  if (!tbl.tableData) {
176332
176528
  throw new Error(`Table '${params.elementId}' has no tableData.`);
176333
176529
  }
176334
- const { rows, columnWidths } = tbl.tableData;
176335
- const source2 = { ...tbl, tableData: structuredClone(tbl.tableData) };
176336
- let edit;
176530
+ const tableData = tbl.tableData;
176531
+ const { rows, columnWidths } = tableData;
176337
176532
  const colCount = columnWidths.length;
176338
176533
  const rowCount = rows.length;
176534
+ let edit;
176535
+ let next;
176339
176536
  switch (params.action) {
176340
176537
  case "insertRow": {
176341
- const pos2 = params.position !== void 0 ? Math.min(Math.max(params.position, 0), rowCount) : rowCount;
176342
- const newRow = {
176343
- height: 40,
176344
- cells: Array.from({ length: colCount }, (_, c) => ({
176345
- text: params.cellTexts?.[c] ?? ""
176346
- }))
176347
- };
176348
- rows.splice(pos2, 0, newRow);
176349
- edit = { axis: "row", action: "insert", index: pos2 };
176538
+ const index2 = Math.min(Math.max(params.position ?? rowCount, 0), rowCount);
176539
+ edit = { axis: "row", action: "insert", index: index2 };
176540
+ next = insertTableRow(tableData, index2, "above", params.cellTexts);
176350
176541
  break;
176351
176542
  }
176352
176543
  case "deleteRow": {
176353
176544
  if (rowCount <= 1) {
176354
176545
  throw new Error("Cannot delete the last row of a table.");
176355
176546
  }
176356
- const ref = params.referenceIndex ?? rowCount - 1;
176357
- if (ref < 0 || ref >= rowCount) {
176358
- throw new Error(`Row index ${ref} out of range (0\u2013${rowCount - 1}).`);
176547
+ const index2 = params.referenceIndex ?? rowCount - 1;
176548
+ if (index2 < 0 || index2 >= rowCount) {
176549
+ throw new Error(`Row index ${index2} out of range (0\u2013${rowCount - 1}).`);
176359
176550
  }
176360
- rows.splice(ref, 1);
176361
- edit = { axis: "row", action: "delete", index: ref };
176551
+ edit = { axis: "row", action: "delete", index: index2 };
176552
+ next = deleteTableRow(tableData, index2);
176362
176553
  break;
176363
176554
  }
176364
176555
  case "insertColumn": {
176365
- const pos2 = params.position !== void 0 ? Math.min(Math.max(params.position, 0), colCount) : colCount;
176366
- const newWidth = 1 / (colCount + 1);
176367
- const scaleFactor = colCount / (colCount + 1);
176368
- for (let i2 = 0; i2 < columnWidths.length; i2++) {
176369
- columnWidths[i2] *= scaleFactor;
176370
- }
176371
- columnWidths.splice(pos2, 0, newWidth);
176372
- edit = { axis: "column", action: "insert", index: pos2 };
176373
- for (let r = 0; r < rows.length; r++) {
176374
- rows[r].cells.splice(pos2, 0, {
176375
- text: params.cellTexts?.[r] ?? ""
176376
- });
176377
- }
176556
+ const index2 = Math.min(Math.max(params.position ?? colCount, 0), colCount);
176557
+ edit = { axis: "column", action: "insert", index: index2 };
176558
+ next = insertTableColumn(tableData, index2, "left", params.cellTexts);
176559
+ next.columnWidths = columnWidths.map((width) => width * (colCount / (colCount + 1)));
176560
+ next.columnWidths.splice(index2, 0, 1 / (colCount + 1));
176378
176561
  break;
176379
176562
  }
176380
176563
  case "deleteColumn": {
176381
176564
  if (colCount <= 1) {
176382
176565
  throw new Error("Cannot delete the last column of a table.");
176383
176566
  }
176384
- const ref = params.referenceIndex ?? colCount - 1;
176385
- if (ref < 0 || ref >= colCount) {
176386
- throw new Error(`Column index ${ref} out of range (0\u2013${colCount - 1}).`);
176387
- }
176388
- const removedWidth = columnWidths[ref];
176389
- columnWidths.splice(ref, 1);
176390
- edit = { axis: "column", action: "delete", index: ref };
176391
- const remaining = columnWidths.length;
176392
- if (remaining > 0) {
176393
- const extra = removedWidth / remaining;
176394
- for (let i2 = 0; i2 < columnWidths.length; i2++) {
176395
- columnWidths[i2] += extra;
176396
- }
176397
- }
176398
- for (const row of rows) {
176399
- row.cells.splice(ref, 1);
176567
+ const index2 = params.referenceIndex ?? colCount - 1;
176568
+ if (index2 < 0 || index2 >= colCount) {
176569
+ throw new Error(`Column index ${index2} out of range (0\u2013${colCount - 1}).`);
176400
176570
  }
176571
+ edit = { axis: "column", action: "delete", index: index2 };
176572
+ next = deleteTableColumn(tableData, index2);
176573
+ const share = columnWidths[index2] / (colCount - 1);
176574
+ next.columnWidths = columnWidths.filter((_, column) => column !== index2).map((width) => width + share);
176401
176575
  break;
176402
176576
  }
176403
176577
  default: {
176404
176578
  throw new Error(`Unknown action: ${String(params.action)}`);
176405
176579
  }
176406
176580
  }
176407
- const rawXml = rebuildTableStructureInRawXml(source2, tbl.tableData, edit);
176581
+ const rawXml = rebuildTableStructureInRawXml(tbl, next, edit);
176582
+ tbl.tableData = next;
176408
176583
  if (rawXml) {
176409
176584
  tbl.rawXml = rawXml;
176410
176585
  }
176411
176586
  return {
176412
176587
  pptxData: ctx.pptxData,
176413
176588
  dirty: true,
176414
- result: {
176415
- rowCount: tbl.tableData.rows.length,
176416
- columnCount: tbl.tableData.columnWidths.length
176417
- }
176589
+ result: { rowCount: next.rows.length, columnCount: next.columnWidths.length }
176418
176590
  };
176419
176591
  }
176420
176592
 
@@ -178640,11 +178812,8 @@ async function saveDeckBytes(result, original) {
178640
178812
  ...result.saveOptions
178641
178813
  });
178642
178814
  }
178643
- async function savePresentation(filePath, pptxData, rawBytes, execCtx, tableStyleSaveOptions) {
178644
- const outputBytes = await saveDeckBytes(
178645
- { pptxData, ...tableStyleSaveOptions && { saveOptions: tableStyleSaveOptions } },
178646
- rawBytes
178647
- );
178815
+ async function savePresentation(filePath, pptxData, rawBytes, execCtx, saveOptions) {
178816
+ const outputBytes = await saveDeckBytes({ pptxData, saveOptions }, rawBytes);
178648
178817
  if (execCtx.collaboration) {
178649
178818
  const room = execCtx.collaboration.getRoom(filePath);
178650
178819
  if (room) {