ooxml-core 1.41.0 → 1.42.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.
- package/README.md +4 -0
- package/dist/PptxHandler-73QIJ6SD.cjs +14 -0
- package/dist/{PptxHandler-3AGIITR7.mjs → PptxHandler-A2J4PCOB.mjs} +2 -2
- package/dist/PptxHandler-OGLVLX2T.mjs +5 -0
- package/dist/{PresentationBuilder-MZBKYOYD.cjs → PresentationBuilder-6S5PJXXF.cjs} +6 -6
- package/dist/{PresentationBuilder-JNID4B4Z.mjs → PresentationBuilder-APJKCMVS.mjs} +2 -2
- package/dist/{PresentationBuilder-5DPKFUXP.mjs → PresentationBuilder-F3BWDERK.mjs} +3 -3
- package/dist/automation/index.cjs +75 -89
- package/dist/automation/index.mjs +75 -89
- package/dist/chart/index.cjs +5 -5
- package/dist/chart/index.mjs +5 -5
- package/dist/{chunk-LRBWCRQ3.cjs → chunk-3J6VIKLP.cjs} +3 -3
- package/dist/chunk-CODMW5KF.cjs +110 -0
- package/dist/{chunk-KKVD3R6O.mjs → chunk-CPSTCCRD.mjs} +4 -4
- package/dist/{chunk-P3WAKBVS.mjs → chunk-IPV3J3I5.mjs} +82 -90
- package/dist/{chunk-6LGRRQ3K.mjs → chunk-MXA67O7R.mjs} +1 -1
- package/dist/{chunk-JXR6YWBW.mjs → chunk-N6X5CJZP.mjs} +125 -126
- package/dist/chunk-O3YGBYGZ.mjs +104 -0
- package/dist/{chunk-75KBNUKS.cjs → chunk-QZPOPUI5.cjs} +82 -89
- package/dist/{chunk-UE23HF2N.mjs → chunk-VKFKEVHK.mjs} +1 -1
- package/dist/{chunk-DD7COXWR.mjs → chunk-VV724DWE.mjs} +19 -7
- package/dist/{chunk-HTELXT2N.mjs → chunk-XVB3CBNM.mjs} +19 -6
- package/dist/{chunk-3BIFRTU4.cjs → chunk-YNQRXFTC.cjs} +1283 -1270
- package/dist/{chunk-ZYCBJKAE.mjs → chunk-ZUEN4RQG.mjs} +1 -1
- package/dist/diagram/index.cjs +499 -370
- package/dist/diagram/index.d.ts +1 -0
- package/dist/diagram/index.d.ts.map +1 -1
- package/dist/diagram/index.mjs +495 -371
- package/dist/docx/embedded.cjs +67 -89
- package/dist/docx/embedded.mjs +67 -89
- package/dist/docx/index.cjs +118 -106
- package/dist/docx/index.mjs +118 -106
- package/dist/docx/layout/index.cjs +118 -106
- package/dist/docx/layout/index.mjs +118 -106
- package/dist/docx/load/index.cjs +67 -89
- package/dist/docx/load/index.mjs +67 -89
- package/dist/docx/shape-svg.d.ts.map +1 -1
- package/dist/docx/ui/index.cjs +72 -94
- package/dist/docx/ui/index.mjs +72 -94
- package/dist/drawingml/dash-pattern.d.ts +61 -0
- package/dist/drawingml/dash-pattern.d.ts.map +1 -0
- package/dist/drawingml/index.cjs +249 -43
- package/dist/drawingml/index.d.ts +3 -0
- package/dist/drawingml/index.d.ts.map +1 -1
- package/dist/drawingml/index.mjs +241 -44
- package/dist/drawingml/rect-path-gradient.d.ts +5 -0
- package/dist/drawingml/rect-path-gradient.d.ts.map +1 -1
- package/dist/drawingml/shape-path-gradient.d.ts +57 -0
- package/dist/drawingml/shape-path-gradient.d.ts.map +1 -0
- package/dist/geometry/index.cjs +68 -90
- package/dist/geometry/index.mjs +68 -90
- package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts +2 -2
- package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts.map +1 -1
- package/dist/index.cjs +686 -489
- package/dist/index.mjs +686 -489
- package/dist/pptx/automation/index.cjs +355 -191
- package/dist/pptx/automation/index.d.ts +11 -17
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +156 -71
- package/dist/pptx/chunks/{elements-6BMEOo7i.d.ts → elements-PBugbKtv.d.ts} +3 -873
- package/dist/pptx/chunks/elements-PBugbKtv.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-BbXLv6As.d.ts → index-BJuR8GLL.d.ts} +4 -4
- package/dist/pptx/chunks/{index-BbXLv6As.d.ts.map → index-BJuR8GLL.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-DvN0TkJJ.d.ts → index-Rbvl2WaM.d.ts} +14 -10
- package/dist/pptx/chunks/index-Rbvl2WaM.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-Dija_Wth.d.ts → index-xoJGYTgQ.d.ts} +5 -3
- package/dist/pptx/chunks/index-xoJGYTgQ.d.ts.map +1 -0
- package/dist/pptx/chunks/table-C7ITXL3Y.d.ts +875 -0
- package/dist/pptx/chunks/table-C7ITXL3Y.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-DorONr3h.d.ts → text-operations-BNJr7aGa.d.ts} +3 -2
- package/dist/pptx/chunks/text-operations-BNJr7aGa.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +169 -96
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +69 -91
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +15 -15
- package/dist/pptx/editor/render/find-replace.d.ts +2 -2
- package/dist/pptx/editor/render/find-replace.mjs +2 -2
- package/dist/pptx/editor/render/slide-operations.cjs +9 -9
- package/dist/pptx/editor/render/slide-operations.mjs +3 -3
- package/dist/pptx/editor/render/table-data-grid-ops.cjs +5 -5
- package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
- package/dist/pptx/editor/render/table-layout.cjs +6 -6
- package/dist/pptx/editor/render/table-layout.d.ts +8 -37
- package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
- package/dist/pptx/editor/render/table-layout.mjs +1 -1
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
- package/dist/pptx/index.cjs +214 -129
- package/dist/pptx/index.d.ts +6 -5
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/teams/index.cjs +136 -91
- package/dist/teams/index.mjs +136 -91
- package/dist/text/font-metrics/design-advances.generated.d.ts +3 -1
- package/dist/text/font-metrics/design-advances.generated.d.ts.map +1 -1
- package/dist/text/index.cjs +8 -0
- package/dist/text/index.mjs +8 -0
- package/dist/visio/index.cjs +8 -0
- package/dist/visio/index.mjs +8 -0
- package/dist/visio/ui/index.cjs +8 -0
- package/dist/visio/ui/index.mjs +8 -0
- package/dist/xlsx/collab/index.cjs +67 -89
- package/dist/xlsx/collab/index.mjs +67 -89
- package/dist/xlsx/index.cjs +116 -108
- package/dist/xlsx/index.mjs +116 -108
- package/dist/xlsx/layout/shape-paint.d.ts.map +1 -1
- package/dist/xlsx/load/index.cjs +67 -89
- package/dist/xlsx/load/index.mjs +67 -89
- package/dist/xlsx/ui/index.cjs +72 -94
- package/dist/xlsx/ui/index.mjs +72 -94
- package/package.json +1 -1
- package/dist/PptxHandler-EL4E4SPH.mjs +0 -5
- package/dist/PptxHandler-OIZ3R3DJ.cjs +0 -14
- package/dist/chunk-3IT6ZD7K.mjs +0 -213
- package/dist/chunk-FRUB573B.cjs +0 -219
- package/dist/pptx/chunks/elements-6BMEOo7i.d.ts.map +0 -1
- package/dist/pptx/chunks/index-Dija_Wth.d.ts.map +0 -1
- package/dist/pptx/chunks/index-DvN0TkJJ.d.ts.map +0 -1
- 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,
|
|
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
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
[
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
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
|
|
6240
|
-
darken(g3.circle(
|
|
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(
|
|
10463
|
-
|
|
10464
|
-
|
|
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(
|
|
10482
|
-
|
|
10483
|
-
|
|
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
|
|
75518
|
-
hMerge: cellNode
|
|
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) *
|
|
119792
|
-
heightEmu: Math.round((bottom - top) *
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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":
|
|
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;
|
|
@@ -170178,6 +170250,7 @@ __export(slide_tools_exports, {
|
|
|
170178
170250
|
setSlideTransition: () => setSlideTransition,
|
|
170179
170251
|
updateSlideProperties: () => updateSlideProperties
|
|
170180
170252
|
});
|
|
170253
|
+
init_constants();
|
|
170181
170254
|
|
|
170182
170255
|
// pptx/core/builders/sdk/slide-operations.ts
|
|
170183
170256
|
init_clone_utils();
|
|
@@ -170221,6 +170294,12 @@ function duplicateSlide(slide, newSlideNumber) {
|
|
|
170221
170294
|
return cloned;
|
|
170222
170295
|
}
|
|
170223
170296
|
|
|
170297
|
+
// pptx/core/builders/sdk/units.ts
|
|
170298
|
+
init_units2();
|
|
170299
|
+
function emuToPixels(emu2) {
|
|
170300
|
+
return Math.round(emu2 / EMU_PER_PIXEL);
|
|
170301
|
+
}
|
|
170302
|
+
|
|
170224
170303
|
// pptx/automation/tools/helpers.ts
|
|
170225
170304
|
var helpers_exports = {};
|
|
170226
170305
|
__export(helpers_exports, {
|
|
@@ -175331,18 +175410,25 @@ function setSlideTransition(ctx, params) {
|
|
|
175331
175410
|
};
|
|
175332
175411
|
}
|
|
175333
175412
|
function setCanvasSize(ctx, params) {
|
|
175334
|
-
|
|
175335
|
-
|
|
175336
|
-
|
|
175337
|
-
|
|
175338
|
-
}
|
|
175339
|
-
|
|
175340
|
-
|
|
175341
|
-
|
|
175413
|
+
const { width, height } = params;
|
|
175414
|
+
if (![width, height].every((points7) => points7 >= 72 && points7 <= 4032)) {
|
|
175415
|
+
throw new RangeError("Canvas width and height must be between 72 and 4032 points.");
|
|
175416
|
+
}
|
|
175417
|
+
const { pptxData } = ctx;
|
|
175418
|
+
const widthEmu = Math.round(width * EMU_PER_POINT);
|
|
175419
|
+
const heightEmu = Math.round(height * EMU_PER_POINT);
|
|
175420
|
+
if (pptxData.widthEmu !== widthEmu || pptxData.heightEmu !== heightEmu) {
|
|
175421
|
+
delete pptxData.slideSizeType;
|
|
175422
|
+
}
|
|
175423
|
+
pptxData.widthEmu = widthEmu;
|
|
175424
|
+
pptxData.heightEmu = heightEmu;
|
|
175425
|
+
pptxData.width = emuToPixels(widthEmu);
|
|
175426
|
+
pptxData.height = emuToPixels(heightEmu);
|
|
175342
175427
|
return {
|
|
175343
|
-
pptxData
|
|
175428
|
+
pptxData,
|
|
175344
175429
|
dirty: true,
|
|
175345
|
-
result: { canvasWidth:
|
|
175430
|
+
result: { canvasWidth: width, canvasHeight: height },
|
|
175431
|
+
saveOptions: { slideSize: { widthEmu, heightEmu, type: pptxData.slideSizeType ?? "" } }
|
|
175346
175432
|
};
|
|
175347
175433
|
}
|
|
175348
175434
|
|
|
@@ -176276,6 +176362,111 @@ __export(table_tools_exports, {
|
|
|
176276
176362
|
manageTableStructure: () => manageTableStructure,
|
|
176277
176363
|
updateTableCells: () => updateTableCells
|
|
176278
176364
|
});
|
|
176365
|
+
|
|
176366
|
+
// pptx/editor/render/table-layout.ts
|
|
176367
|
+
var DEFAULT_INSERTED_ROW_HEIGHT = 40;
|
|
176368
|
+
function createCell(text2 = "") {
|
|
176369
|
+
return { text: text2, style: {} };
|
|
176370
|
+
}
|
|
176371
|
+
function copyRows(data) {
|
|
176372
|
+
return data.rows.map((row) => ({ ...row, cells: [...row.cells] }));
|
|
176373
|
+
}
|
|
176374
|
+
function updateIntersectingMerges(source2, rows, edit) {
|
|
176375
|
+
const isRowEdit = edit.axis === "row";
|
|
176376
|
+
const inserting = edit.action === "insert";
|
|
176377
|
+
const delta2 = inserting ? 1 : -1;
|
|
176378
|
+
for (const [rowIndex, row] of source2.rows.entries()) {
|
|
176379
|
+
for (const [columnIndex, anchor2] of row.cells.entries()) {
|
|
176380
|
+
if (anchor2.hMerge || anchor2.vMerge) continue;
|
|
176381
|
+
const rowSpan = anchor2.rowSpan ?? 1;
|
|
176382
|
+
const gridSpan = anchor2.gridSpan ?? 1;
|
|
176383
|
+
const start = isRowEdit ? rowIndex : columnIndex;
|
|
176384
|
+
const span = isRowEdit ? rowSpan : gridSpan;
|
|
176385
|
+
if (edit.index < start || edit.index >= start + span || (inserting ? edit.index === start : span === 1)) {
|
|
176386
|
+
continue;
|
|
176387
|
+
}
|
|
176388
|
+
if (!Number.isInteger(rowSpan) || !Number.isInteger(gridSpan) || rowSpan < 1 || gridSpan < 1 || rowIndex + rowSpan > source2.rows.length || columnIndex + gridSpan > source2.columnWidths.length) {
|
|
176389
|
+
continue;
|
|
176390
|
+
}
|
|
176391
|
+
const height = isRowEdit ? rowSpan + delta2 : rowSpan;
|
|
176392
|
+
const width = isRowEdit ? gridSpan : gridSpan + delta2;
|
|
176393
|
+
const anchorRemoved = !inserting && edit.index === start;
|
|
176394
|
+
for (let r = rowIndex; r < rowIndex + height; r++) {
|
|
176395
|
+
for (let c = columnIndex; c < columnIndex + width; c++) {
|
|
176396
|
+
const cell2 = rows[r]?.cells[c];
|
|
176397
|
+
if (!cell2) continue;
|
|
176398
|
+
const firstRow = r === rowIndex;
|
|
176399
|
+
const firstColumn = c === columnIndex;
|
|
176400
|
+
const promote2 = anchorRemoved && firstRow && firstColumn;
|
|
176401
|
+
const content2 = promote2 && anchor2.text ? anchor2 : cell2;
|
|
176402
|
+
rows[r].cells[c] = {
|
|
176403
|
+
...cell2,
|
|
176404
|
+
text: content2.text,
|
|
176405
|
+
textRuns: content2.textRuns,
|
|
176406
|
+
paragraphs: content2.paragraphs,
|
|
176407
|
+
style: promote2 ? cell2.style ?? anchor2.style : cell2.style,
|
|
176408
|
+
rowSpan: firstRow && height > 1 ? height : void 0,
|
|
176409
|
+
gridSpan: firstColumn && width > 1 ? width : void 0,
|
|
176410
|
+
hMerge: firstColumn ? void 0 : true,
|
|
176411
|
+
vMerge: firstRow ? void 0 : true
|
|
176412
|
+
};
|
|
176413
|
+
}
|
|
176414
|
+
}
|
|
176415
|
+
}
|
|
176416
|
+
}
|
|
176417
|
+
}
|
|
176418
|
+
function normalizeWidths(widths) {
|
|
176419
|
+
const sum = widths.reduce((total, width) => total + width, 0);
|
|
176420
|
+
return sum > 0 ? widths.map((width) => width / sum) : widths;
|
|
176421
|
+
}
|
|
176422
|
+
function insertTableRow(tableData, rowIdx, position4, cellTexts) {
|
|
176423
|
+
const index2 = Math.max(0, Math.min(tableData.rows.length, rowIdx + Number(position4 === "below")));
|
|
176424
|
+
const rows = copyRows(tableData);
|
|
176425
|
+
rows.splice(index2, 0, {
|
|
176426
|
+
height: DEFAULT_INSERTED_ROW_HEIGHT,
|
|
176427
|
+
cells: tableData.columnWidths.map((_, column) => createCell(cellTexts?.[column]))
|
|
176428
|
+
});
|
|
176429
|
+
updateIntersectingMerges(tableData, rows, { axis: "row", action: "insert", index: index2 });
|
|
176430
|
+
return { ...tableData, rows };
|
|
176431
|
+
}
|
|
176432
|
+
function deleteTableRow(tableData, rowIdx) {
|
|
176433
|
+
if (tableData.rows.length <= 1 || rowIdx < 0 || rowIdx >= tableData.rows.length) {
|
|
176434
|
+
return tableData;
|
|
176435
|
+
}
|
|
176436
|
+
const rows = copyRows(tableData);
|
|
176437
|
+
rows.splice(rowIdx, 1);
|
|
176438
|
+
updateIntersectingMerges(tableData, rows, { axis: "row", action: "delete", index: rowIdx });
|
|
176439
|
+
return { ...tableData, rows };
|
|
176440
|
+
}
|
|
176441
|
+
function insertTableColumn(tableData, colIdx, position4, cellTexts) {
|
|
176442
|
+
const count2 = tableData.columnWidths.length;
|
|
176443
|
+
const index2 = Math.max(0, Math.min(count2, colIdx + Number(position4 === "right")));
|
|
176444
|
+
const columnWidths = [...tableData.columnWidths];
|
|
176445
|
+
if (count2 === 0) {
|
|
176446
|
+
columnWidths.push(1);
|
|
176447
|
+
} else {
|
|
176448
|
+
const neighbour = Math.min(index2, count2 - 1);
|
|
176449
|
+
const half = columnWidths[neighbour] / 2;
|
|
176450
|
+
columnWidths[neighbour] = half;
|
|
176451
|
+
columnWidths.splice(index2, 0, half);
|
|
176452
|
+
}
|
|
176453
|
+
const rows = copyRows(tableData);
|
|
176454
|
+
rows.forEach((row, rowIndex) => row.cells.splice(index2, 0, createCell(cellTexts?.[rowIndex])));
|
|
176455
|
+
updateIntersectingMerges(tableData, rows, { axis: "column", action: "insert", index: index2 });
|
|
176456
|
+
return { ...tableData, rows, columnWidths: normalizeWidths(columnWidths) };
|
|
176457
|
+
}
|
|
176458
|
+
function deleteTableColumn(tableData, colIdx) {
|
|
176459
|
+
if (tableData.columnWidths.length <= 1 || colIdx < 0 || colIdx >= tableData.columnWidths.length) {
|
|
176460
|
+
return tableData;
|
|
176461
|
+
}
|
|
176462
|
+
const rows = copyRows(tableData);
|
|
176463
|
+
rows.forEach((row) => row.cells.splice(colIdx, 1));
|
|
176464
|
+
updateIntersectingMerges(tableData, rows, { axis: "column", action: "delete", index: colIdx });
|
|
176465
|
+
const columnWidths = tableData.columnWidths.filter((_, index2) => index2 !== colIdx);
|
|
176466
|
+
return { ...tableData, rows, columnWidths: normalizeWidths(columnWidths) };
|
|
176467
|
+
}
|
|
176468
|
+
|
|
176469
|
+
// pptx/automation/tools/table-tools.ts
|
|
176279
176470
|
function updateTableCells(ctx, params) {
|
|
176280
176471
|
const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
|
|
176281
176472
|
if (err) {
|
|
@@ -176331,90 +176522,66 @@ function manageTableStructure(ctx, params) {
|
|
|
176331
176522
|
if (!tbl.tableData) {
|
|
176332
176523
|
throw new Error(`Table '${params.elementId}' has no tableData.`);
|
|
176333
176524
|
}
|
|
176334
|
-
const
|
|
176335
|
-
const
|
|
176336
|
-
let edit;
|
|
176525
|
+
const tableData = tbl.tableData;
|
|
176526
|
+
const { rows, columnWidths } = tableData;
|
|
176337
176527
|
const colCount = columnWidths.length;
|
|
176338
176528
|
const rowCount = rows.length;
|
|
176529
|
+
let edit;
|
|
176530
|
+
let next;
|
|
176339
176531
|
switch (params.action) {
|
|
176340
176532
|
case "insertRow": {
|
|
176341
|
-
const
|
|
176342
|
-
|
|
176343
|
-
|
|
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 };
|
|
176533
|
+
const index2 = Math.min(Math.max(params.position ?? rowCount, 0), rowCount);
|
|
176534
|
+
edit = { axis: "row", action: "insert", index: index2 };
|
|
176535
|
+
next = insertTableRow(tableData, index2, "above", params.cellTexts);
|
|
176350
176536
|
break;
|
|
176351
176537
|
}
|
|
176352
176538
|
case "deleteRow": {
|
|
176353
176539
|
if (rowCount <= 1) {
|
|
176354
176540
|
throw new Error("Cannot delete the last row of a table.");
|
|
176355
176541
|
}
|
|
176356
|
-
const
|
|
176357
|
-
if (
|
|
176358
|
-
throw new Error(`Row index ${
|
|
176542
|
+
const index2 = params.referenceIndex ?? rowCount - 1;
|
|
176543
|
+
if (index2 < 0 || index2 >= rowCount) {
|
|
176544
|
+
throw new Error(`Row index ${index2} out of range (0\u2013${rowCount - 1}).`);
|
|
176359
176545
|
}
|
|
176360
|
-
|
|
176361
|
-
|
|
176546
|
+
edit = { axis: "row", action: "delete", index: index2 };
|
|
176547
|
+
next = deleteTableRow(tableData, index2);
|
|
176362
176548
|
break;
|
|
176363
176549
|
}
|
|
176364
176550
|
case "insertColumn": {
|
|
176365
|
-
const
|
|
176366
|
-
|
|
176367
|
-
|
|
176368
|
-
|
|
176369
|
-
|
|
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
|
-
}
|
|
176551
|
+
const index2 = Math.min(Math.max(params.position ?? colCount, 0), colCount);
|
|
176552
|
+
edit = { axis: "column", action: "insert", index: index2 };
|
|
176553
|
+
next = insertTableColumn(tableData, index2, "left", params.cellTexts);
|
|
176554
|
+
next.columnWidths = columnWidths.map((width) => width * (colCount / (colCount + 1)));
|
|
176555
|
+
next.columnWidths.splice(index2, 0, 1 / (colCount + 1));
|
|
176378
176556
|
break;
|
|
176379
176557
|
}
|
|
176380
176558
|
case "deleteColumn": {
|
|
176381
176559
|
if (colCount <= 1) {
|
|
176382
176560
|
throw new Error("Cannot delete the last column of a table.");
|
|
176383
176561
|
}
|
|
176384
|
-
const
|
|
176385
|
-
if (
|
|
176386
|
-
throw new Error(`Column index ${
|
|
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);
|
|
176562
|
+
const index2 = params.referenceIndex ?? colCount - 1;
|
|
176563
|
+
if (index2 < 0 || index2 >= colCount) {
|
|
176564
|
+
throw new Error(`Column index ${index2} out of range (0\u2013${colCount - 1}).`);
|
|
176400
176565
|
}
|
|
176566
|
+
edit = { axis: "column", action: "delete", index: index2 };
|
|
176567
|
+
next = deleteTableColumn(tableData, index2);
|
|
176568
|
+
const share = columnWidths[index2] / (colCount - 1);
|
|
176569
|
+
next.columnWidths = columnWidths.filter((_, column) => column !== index2).map((width) => width + share);
|
|
176401
176570
|
break;
|
|
176402
176571
|
}
|
|
176403
176572
|
default: {
|
|
176404
176573
|
throw new Error(`Unknown action: ${String(params.action)}`);
|
|
176405
176574
|
}
|
|
176406
176575
|
}
|
|
176407
|
-
const rawXml = rebuildTableStructureInRawXml(
|
|
176576
|
+
const rawXml = rebuildTableStructureInRawXml(tbl, next, edit);
|
|
176577
|
+
tbl.tableData = next;
|
|
176408
176578
|
if (rawXml) {
|
|
176409
176579
|
tbl.rawXml = rawXml;
|
|
176410
176580
|
}
|
|
176411
176581
|
return {
|
|
176412
176582
|
pptxData: ctx.pptxData,
|
|
176413
176583
|
dirty: true,
|
|
176414
|
-
result: {
|
|
176415
|
-
rowCount: tbl.tableData.rows.length,
|
|
176416
|
-
columnCount: tbl.tableData.columnWidths.length
|
|
176417
|
-
}
|
|
176584
|
+
result: { rowCount: next.rows.length, columnCount: next.columnWidths.length }
|
|
176418
176585
|
};
|
|
176419
176586
|
}
|
|
176420
176587
|
|
|
@@ -178640,11 +178807,8 @@ async function saveDeckBytes(result, original) {
|
|
|
178640
178807
|
...result.saveOptions
|
|
178641
178808
|
});
|
|
178642
178809
|
}
|
|
178643
|
-
async function savePresentation(filePath, pptxData, rawBytes, execCtx,
|
|
178644
|
-
const outputBytes = await saveDeckBytes(
|
|
178645
|
-
{ pptxData, ...tableStyleSaveOptions && { saveOptions: tableStyleSaveOptions } },
|
|
178646
|
-
rawBytes
|
|
178647
|
-
);
|
|
178810
|
+
async function savePresentation(filePath, pptxData, rawBytes, execCtx, saveOptions) {
|
|
178811
|
+
const outputBytes = await saveDeckBytes({ pptxData, saveOptions }, rawBytes);
|
|
178648
178812
|
if (execCtx.collaboration) {
|
|
178649
178813
|
const room = execCtx.collaboration.getRoom(filePath);
|
|
178650
178814
|
if (room) {
|