ooxml-core 1.40.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-2WYH66TS.mjs → PptxHandler-A2J4PCOB.mjs} +2 -2
- package/dist/PptxHandler-OGLVLX2T.mjs +5 -0
- package/dist/{PresentationBuilder-BUUVVMNI.cjs → PresentationBuilder-6S5PJXXF.cjs} +6 -6
- package/dist/{PresentationBuilder-VHDHLGIK.mjs → PresentationBuilder-APJKCMVS.mjs} +2 -2
- package/dist/{PresentationBuilder-RTHLLHLE.mjs → PresentationBuilder-F3BWDERK.mjs} +3 -3
- package/dist/automation/index.cjs +5322 -3452
- package/dist/automation/index.mjs +5322 -3452
- package/dist/chart/index.cjs +5 -5
- package/dist/chart/index.mjs +5 -5
- package/dist/{chunk-EXSPNK6W.cjs → chunk-3J6VIKLP.cjs} +3 -3
- package/dist/chunk-CODMW5KF.cjs +110 -0
- package/dist/{chunk-3E4GSBC7.mjs → chunk-CPSTCCRD.mjs} +4 -4
- package/dist/{chunk-6XAAJTA3.mjs → chunk-IPV3J3I5.mjs} +4925 -3049
- package/dist/{chunk-HLBIT5H4.mjs → chunk-MXA67O7R.mjs} +1 -1
- package/dist/{chunk-OGD5OQK2.mjs → chunk-N6X5CJZP.mjs} +6723 -4840
- package/dist/chunk-O3YGBYGZ.mjs +104 -0
- package/dist/{chunk-SEGPDD5W.cjs → chunk-QZPOPUI5.cjs} +4925 -3048
- package/dist/{chunk-5BVSDSJZ.mjs → chunk-VKFKEVHK.mjs} +1 -1
- package/dist/{chunk-AZNF3IOI.mjs → chunk-VV724DWE.mjs} +87 -11
- package/dist/{chunk-NHV47JOE.mjs → chunk-XVB3CBNM.mjs} +53 -9
- package/dist/{chunk-U6FMLGWH.cjs → chunk-YNQRXFTC.cjs} +1317 -1273
- package/dist/{chunk-725QJW4K.mjs → chunk-ZUEN4RQG.mjs} +1 -1
- package/dist/color/index.cjs +36 -0
- package/dist/color/index.d.ts +1 -0
- package/dist/color/index.d.ts.map +1 -1
- package/dist/color/index.mjs +35 -1
- package/dist/color/office-gradient-stops.d.ts +27 -0
- package/dist/color/office-gradient-stops.d.ts.map +1 -0
- package/dist/diagram/index.cjs +5223 -3170
- package/dist/diagram/index.d.ts +1 -0
- package/dist/diagram/index.d.ts.map +1 -1
- package/dist/diagram/index.mjs +5218 -3171
- package/dist/docx/embedded.cjs +4862 -3000
- package/dist/docx/embedded.mjs +4862 -3000
- package/dist/docx/index.cjs +4970 -3072
- package/dist/docx/index.mjs +4970 -3072
- package/dist/docx/layout/index.cjs +4952 -3054
- package/dist/docx/layout/index.mjs +4952 -3054
- package/dist/docx/load/index.cjs +4999 -3137
- package/dist/docx/load/index.mjs +4999 -3137
- package/dist/docx/shape-svg.d.ts.map +1 -1
- package/dist/docx/ui/index.cjs +4907 -3045
- package/dist/docx/ui/index.mjs +4907 -3045
- package/dist/drawingml/dash-pattern.d.ts +61 -0
- package/dist/drawingml/dash-pattern.d.ts.map +1 -0
- package/dist/drawingml/index.cjs +319 -53
- package/dist/drawingml/index.d.ts +3 -0
- package/dist/drawingml/index.d.ts.map +1 -1
- package/dist/drawingml/index.mjs +310 -54
- package/dist/drawingml/path-data.d.ts.map +1 -1
- package/dist/drawingml/rect-path-gradient.d.ts +17 -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 +4117 -2254
- package/dist/geometry/index.mjs +4117 -2255
- package/dist/geometry/ooxml-arc.d.ts +10 -1
- package/dist/geometry/ooxml-arc.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-action-buttons.d.ts +7 -36
- package/dist/geometry/preset-shape-definitions-action-buttons.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-connectors-brackets.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts +19 -0
- package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-arcs.d.ts +14 -0
- package/dist/geometry/preset-shape-definitions-exact-arcs.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts +11 -0
- package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-basic.d.ts +12 -0
- package/dist/geometry/preset-shape-definitions-exact-basic.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-circular.d.ts +18 -0
- package/dist/geometry/preset-shape-definitions-exact-circular.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-ellipse-ribbons.d.ts +16 -0
- package/dist/geometry/preset-shape-definitions-exact-ellipse-ribbons.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-funnel.d.ts +13 -0
- package/dist/geometry/preset-shape-definitions-exact-funnel.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-left-right-ribbon.d.ts +13 -0
- package/dist/geometry/preset-shape-definitions-exact-left-right-ribbon.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-math.d.ts +14 -0
- package/dist/geometry/preset-shape-definitions-exact-math.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-misc.d.ts +11 -0
- package/dist/geometry/preset-shape-definitions-exact-misc.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-ribbons.d.ts +12 -0
- package/dist/geometry/preset-shape-definitions-exact-ribbons.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts +13 -0
- package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-flowchart.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-misc.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-table.d.ts.map +1 -1
- package/dist/geometry/preset-shape-exact-dsl.d.ts +30 -0
- package/dist/geometry/preset-shape-exact-dsl.d.ts.map +1 -0
- package/dist/index.cjs +7637 -5216
- package/dist/index.mjs +7637 -5216
- package/dist/pptx/automation/index.cjs +5683 -3508
- 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-DheCTwi0.d.ts → elements-PBugbKtv.d.ts} +3 -848
- package/dist/pptx/chunks/elements-PBugbKtv.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-Jcce8TlI.d.ts → index-BJuR8GLL.d.ts} +4 -4
- package/dist/pptx/chunks/{index-Jcce8TlI.d.ts.map → index-BJuR8GLL.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-CYukxWbl.d.ts → index-Rbvl2WaM.d.ts} +32 -13
- package/dist/pptx/chunks/index-Rbvl2WaM.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-B4ofjG6_.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-CdgEnFuK.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 +5419 -3335
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +4936 -2978
- 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 +7298 -5162
- package/dist/pptx/index.d.ts +7 -6
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/teams/index.cjs +5332 -3307
- package/dist/teams/index.mjs +5332 -3307
- 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/font-metrics/office-font-metrics.generated.d.ts +23 -0
- package/dist/text/font-metrics/office-font-metrics.generated.d.ts.map +1 -0
- package/dist/text/font-metrics/vertical-metrics.d.ts +35 -0
- package/dist/text/font-metrics/vertical-metrics.d.ts.map +1 -0
- package/dist/text/index.cjs +268 -0
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.mjs +267 -1
- 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 +5084 -3222
- package/dist/xlsx/collab/index.mjs +5084 -3222
- package/dist/xlsx/index.cjs +5298 -3404
- package/dist/xlsx/index.mjs +5298 -3404
- package/dist/xlsx/layout/shape-paint.d.ts.map +1 -1
- package/dist/xlsx/load/index.cjs +5103 -3241
- package/dist/xlsx/load/index.mjs +5103 -3241
- package/dist/xlsx/ui/index.cjs +5261 -3399
- package/dist/xlsx/ui/index.mjs +5261 -3399
- package/package.json +1 -1
- package/dist/PptxHandler-SD6VWF3I.mjs +0 -5
- package/dist/PptxHandler-ZHWWOO2X.cjs +0 -14
- package/dist/chunk-3IT6ZD7K.mjs +0 -213
- package/dist/chunk-FRUB573B.cjs +0 -219
- package/dist/pptx/chunks/elements-DheCTwi0.d.ts.map +0 -1
- package/dist/pptx/chunks/index-B4ofjG6_.d.ts.map +0 -1
- package/dist/pptx/chunks/index-CYukxWbl.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-CdgEnFuK.d.ts.map +0 -1
package/dist/chart/index.cjs
CHANGED
|
@@ -3860,7 +3860,7 @@ function lerpStops(a2, b, t) {
|
|
|
3860
3860
|
opacity: oa + (ob - oa) * t
|
|
3861
3861
|
};
|
|
3862
3862
|
}
|
|
3863
|
-
function
|
|
3863
|
+
function gradientColorAt(stops, position) {
|
|
3864
3864
|
const first2 = stops[0];
|
|
3865
3865
|
const last = stops[stops.length - 1];
|
|
3866
3866
|
if (position <= first2.position) {
|
|
@@ -3915,7 +3915,7 @@ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options2) {
|
|
|
3915
3915
|
if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
|
|
3916
3916
|
for (let i = bands; i >= 0; i -= 1) {
|
|
3917
3917
|
const t = i / bands;
|
|
3918
|
-
const { color: color2, opacity } =
|
|
3918
|
+
const { color: color2, opacity } = gradientColorAt(sorted, t * 100);
|
|
3919
3919
|
const left = lerpEdge(inner.left, 0, t);
|
|
3920
3920
|
const top = lerpEdge(inner.top, 0, t);
|
|
3921
3921
|
const right = lerpEdge(inner.right, 100, t);
|
|
@@ -14125,7 +14125,7 @@ function radarSvg(model, area) {
|
|
|
14125
14125
|
}
|
|
14126
14126
|
|
|
14127
14127
|
// chart/render/chart-svg-hierarchy.ts
|
|
14128
|
-
var
|
|
14128
|
+
var colorAt = (model, index) => {
|
|
14129
14129
|
const first2 = model.series[0];
|
|
14130
14130
|
const colors = first2?.pointColors;
|
|
14131
14131
|
return (colors && colors.length > 0 ? colors[index % colors.length] : void 0) ?? first2?.color ?? "#4472C4";
|
|
@@ -14154,7 +14154,7 @@ function treemapSvg(model, area) {
|
|
|
14154
14154
|
}
|
|
14155
14155
|
out.push(`<g data-chart-series="${cell2.seriesIndex}" data-chart-point="${cell2.pointIndex}">`);
|
|
14156
14156
|
out.push(
|
|
14157
|
-
rect(cell2.x, cell2.y, cell2.w, cell2.h,
|
|
14157
|
+
rect(cell2.x, cell2.y, cell2.w, cell2.h, colorAt(model, cell2.colorIndex)).replace(
|
|
14158
14158
|
"/>",
|
|
14159
14159
|
' rx="2"/>'
|
|
14160
14160
|
)
|
|
@@ -14193,7 +14193,7 @@ function sunburstSvg(model, area) {
|
|
|
14193
14193
|
);
|
|
14194
14194
|
for (const arc of arcs)
|
|
14195
14195
|
out.push(
|
|
14196
|
-
`<path d="${arc.d}" fill="${
|
|
14196
|
+
`<path d="${arc.d}" fill="${colorAt(model, arc.colorIndex)}" stroke="#FFFFFF" stroke-width="1.5"${arc.pointIndex === void 0 ? "" : ` data-chart-series="0" data-chart-point="${arc.pointIndex}"`}/>`
|
|
14197
14197
|
);
|
|
14198
14198
|
const flatLabels = levels.length > 1 || model.series.length !== 1 ? void 0 : model.categories;
|
|
14199
14199
|
for (const arc of model.hierarchy?.labels === false ? [] : arcs) {
|
package/dist/chart/index.mjs
CHANGED
|
@@ -3854,7 +3854,7 @@ function lerpStops(a2, b, t) {
|
|
|
3854
3854
|
opacity: oa + (ob - oa) * t
|
|
3855
3855
|
};
|
|
3856
3856
|
}
|
|
3857
|
-
function
|
|
3857
|
+
function gradientColorAt(stops, position) {
|
|
3858
3858
|
const first2 = stops[0];
|
|
3859
3859
|
const last = stops[stops.length - 1];
|
|
3860
3860
|
if (position <= first2.position) {
|
|
@@ -3909,7 +3909,7 @@ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options2) {
|
|
|
3909
3909
|
if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
|
|
3910
3910
|
for (let i = bands; i >= 0; i -= 1) {
|
|
3911
3911
|
const t = i / bands;
|
|
3912
|
-
const { color: color2, opacity } =
|
|
3912
|
+
const { color: color2, opacity } = gradientColorAt(sorted, t * 100);
|
|
3913
3913
|
const left = lerpEdge(inner.left, 0, t);
|
|
3914
3914
|
const top = lerpEdge(inner.top, 0, t);
|
|
3915
3915
|
const right = lerpEdge(inner.right, 100, t);
|
|
@@ -14119,7 +14119,7 @@ function radarSvg(model, area) {
|
|
|
14119
14119
|
}
|
|
14120
14120
|
|
|
14121
14121
|
// chart/render/chart-svg-hierarchy.ts
|
|
14122
|
-
var
|
|
14122
|
+
var colorAt = (model, index) => {
|
|
14123
14123
|
const first2 = model.series[0];
|
|
14124
14124
|
const colors = first2?.pointColors;
|
|
14125
14125
|
return (colors && colors.length > 0 ? colors[index % colors.length] : void 0) ?? first2?.color ?? "#4472C4";
|
|
@@ -14148,7 +14148,7 @@ function treemapSvg(model, area) {
|
|
|
14148
14148
|
}
|
|
14149
14149
|
out.push(`<g data-chart-series="${cell2.seriesIndex}" data-chart-point="${cell2.pointIndex}">`);
|
|
14150
14150
|
out.push(
|
|
14151
|
-
rect(cell2.x, cell2.y, cell2.w, cell2.h,
|
|
14151
|
+
rect(cell2.x, cell2.y, cell2.w, cell2.h, colorAt(model, cell2.colorIndex)).replace(
|
|
14152
14152
|
"/>",
|
|
14153
14153
|
' rx="2"/>'
|
|
14154
14154
|
)
|
|
@@ -14187,7 +14187,7 @@ function sunburstSvg(model, area) {
|
|
|
14187
14187
|
);
|
|
14188
14188
|
for (const arc of arcs)
|
|
14189
14189
|
out.push(
|
|
14190
|
-
`<path d="${arc.d}" fill="${
|
|
14190
|
+
`<path d="${arc.d}" fill="${colorAt(model, arc.colorIndex)}" stroke="#FFFFFF" stroke-width="1.5"${arc.pointIndex === void 0 ? "" : ` data-chart-series="0" data-chart-point="${arc.pointIndex}"`}/>`
|
|
14191
14191
|
);
|
|
14192
14192
|
const flatLabels = levels.length > 1 || model.series.length !== 1 ? void 0 : model.categories;
|
|
14193
14193
|
for (const arc of model.hierarchy?.labels === false ? [] : arcs) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQZPOPUI5_cjs = require('./chunk-QZPOPUI5.cjs');
|
|
4
4
|
var chunk5W2QL4SB_cjs = require('./chunk-5W2QL4SB.cjs');
|
|
5
5
|
|
|
6
6
|
// pptx/core/core/runtime/table-structural-helpers.ts
|
|
@@ -44,10 +44,10 @@ function flattenCellTxBodyText(txBody, ensureArray2) {
|
|
|
44
44
|
const fields = ensureArray2(paragraph?.["a:fld"]);
|
|
45
45
|
let lineText = "";
|
|
46
46
|
for (const run of runs) {
|
|
47
|
-
lineText +=
|
|
47
|
+
lineText += chunkQZPOPUI5_cjs.xmlText(run?.["a:t"]) ?? "";
|
|
48
48
|
}
|
|
49
49
|
for (const field of fields) {
|
|
50
|
-
lineText +=
|
|
50
|
+
lineText += chunkQZPOPUI5_cjs.xmlText(field?.["a:t"]) ?? "";
|
|
51
51
|
}
|
|
52
52
|
lines.push(lineText);
|
|
53
53
|
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// pptx/editor/render/table-layout.ts
|
|
4
|
+
var DEFAULT_INSERTED_ROW_HEIGHT = 40;
|
|
5
|
+
function createCell(text = "") {
|
|
6
|
+
return { text, style: {} };
|
|
7
|
+
}
|
|
8
|
+
function copyRows(data) {
|
|
9
|
+
return data.rows.map((row) => ({ ...row, cells: [...row.cells] }));
|
|
10
|
+
}
|
|
11
|
+
function updateIntersectingMerges(source, rows, edit) {
|
|
12
|
+
const isRowEdit = edit.axis === "row";
|
|
13
|
+
const inserting = edit.action === "insert";
|
|
14
|
+
const delta = inserting ? 1 : -1;
|
|
15
|
+
for (const [rowIndex, row] of source.rows.entries()) {
|
|
16
|
+
for (const [columnIndex, anchor] of row.cells.entries()) {
|
|
17
|
+
if (anchor.hMerge || anchor.vMerge) continue;
|
|
18
|
+
const rowSpan = anchor.rowSpan ?? 1;
|
|
19
|
+
const gridSpan = anchor.gridSpan ?? 1;
|
|
20
|
+
const start = isRowEdit ? rowIndex : columnIndex;
|
|
21
|
+
const span = isRowEdit ? rowSpan : gridSpan;
|
|
22
|
+
if (edit.index < start || edit.index >= start + span || (inserting ? edit.index === start : span === 1)) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (!Number.isInteger(rowSpan) || !Number.isInteger(gridSpan) || rowSpan < 1 || gridSpan < 1 || rowIndex + rowSpan > source.rows.length || columnIndex + gridSpan > source.columnWidths.length) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const height = isRowEdit ? rowSpan + delta : rowSpan;
|
|
29
|
+
const width = isRowEdit ? gridSpan : gridSpan + delta;
|
|
30
|
+
const anchorRemoved = !inserting && edit.index === start;
|
|
31
|
+
for (let r = rowIndex; r < rowIndex + height; r++) {
|
|
32
|
+
for (let c = columnIndex; c < columnIndex + width; c++) {
|
|
33
|
+
const cell = rows[r]?.cells[c];
|
|
34
|
+
if (!cell) continue;
|
|
35
|
+
const firstRow = r === rowIndex;
|
|
36
|
+
const firstColumn = c === columnIndex;
|
|
37
|
+
const promote = anchorRemoved && firstRow && firstColumn;
|
|
38
|
+
const content = promote && anchor.text ? anchor : cell;
|
|
39
|
+
rows[r].cells[c] = {
|
|
40
|
+
...cell,
|
|
41
|
+
text: content.text,
|
|
42
|
+
textRuns: content.textRuns,
|
|
43
|
+
paragraphs: content.paragraphs,
|
|
44
|
+
style: promote ? cell.style ?? anchor.style : cell.style,
|
|
45
|
+
rowSpan: firstRow && height > 1 ? height : void 0,
|
|
46
|
+
gridSpan: firstColumn && width > 1 ? width : void 0,
|
|
47
|
+
hMerge: firstColumn ? void 0 : true,
|
|
48
|
+
vMerge: firstRow ? void 0 : true
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function normalizeWidths(widths) {
|
|
56
|
+
const sum = widths.reduce((total, width) => total + width, 0);
|
|
57
|
+
return sum > 0 ? widths.map((width) => width / sum) : widths;
|
|
58
|
+
}
|
|
59
|
+
function insertTableRow(tableData, rowIdx, position, cellTexts) {
|
|
60
|
+
const index = Math.max(0, Math.min(tableData.rows.length, rowIdx + Number(position === "below")));
|
|
61
|
+
const rows = copyRows(tableData);
|
|
62
|
+
rows.splice(index, 0, {
|
|
63
|
+
height: DEFAULT_INSERTED_ROW_HEIGHT,
|
|
64
|
+
cells: tableData.columnWidths.map((_, column) => createCell(cellTexts?.[column]))
|
|
65
|
+
});
|
|
66
|
+
updateIntersectingMerges(tableData, rows, { axis: "row", action: "insert", index });
|
|
67
|
+
return { ...tableData, rows };
|
|
68
|
+
}
|
|
69
|
+
function deleteTableRow(tableData, rowIdx) {
|
|
70
|
+
if (tableData.rows.length <= 1 || rowIdx < 0 || rowIdx >= tableData.rows.length) {
|
|
71
|
+
return tableData;
|
|
72
|
+
}
|
|
73
|
+
const rows = copyRows(tableData);
|
|
74
|
+
rows.splice(rowIdx, 1);
|
|
75
|
+
updateIntersectingMerges(tableData, rows, { axis: "row", action: "delete", index: rowIdx });
|
|
76
|
+
return { ...tableData, rows };
|
|
77
|
+
}
|
|
78
|
+
function insertTableColumn(tableData, colIdx, position, cellTexts) {
|
|
79
|
+
const count = tableData.columnWidths.length;
|
|
80
|
+
const index = Math.max(0, Math.min(count, colIdx + Number(position === "right")));
|
|
81
|
+
const columnWidths = [...tableData.columnWidths];
|
|
82
|
+
if (count === 0) {
|
|
83
|
+
columnWidths.push(1);
|
|
84
|
+
} else {
|
|
85
|
+
const neighbour = Math.min(index, count - 1);
|
|
86
|
+
const half = columnWidths[neighbour] / 2;
|
|
87
|
+
columnWidths[neighbour] = half;
|
|
88
|
+
columnWidths.splice(index, 0, half);
|
|
89
|
+
}
|
|
90
|
+
const rows = copyRows(tableData);
|
|
91
|
+
rows.forEach((row, rowIndex) => row.cells.splice(index, 0, createCell(cellTexts?.[rowIndex])));
|
|
92
|
+
updateIntersectingMerges(tableData, rows, { axis: "column", action: "insert", index });
|
|
93
|
+
return { ...tableData, rows, columnWidths: normalizeWidths(columnWidths) };
|
|
94
|
+
}
|
|
95
|
+
function deleteTableColumn(tableData, colIdx) {
|
|
96
|
+
if (tableData.columnWidths.length <= 1 || colIdx < 0 || colIdx >= tableData.columnWidths.length) {
|
|
97
|
+
return tableData;
|
|
98
|
+
}
|
|
99
|
+
const rows = copyRows(tableData);
|
|
100
|
+
rows.forEach((row) => row.cells.splice(colIdx, 1));
|
|
101
|
+
updateIntersectingMerges(tableData, rows, { axis: "column", action: "delete", index: colIdx });
|
|
102
|
+
const columnWidths = tableData.columnWidths.filter((_, index) => index !== colIdx);
|
|
103
|
+
return { ...tableData, rows, columnWidths: normalizeWidths(columnWidths) };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
exports.DEFAULT_INSERTED_ROW_HEIGHT = DEFAULT_INSERTED_ROW_HEIGHT;
|
|
107
|
+
exports.deleteTableColumn = deleteTableColumn;
|
|
108
|
+
exports.deleteTableRow = deleteTableRow;
|
|
109
|
+
exports.insertTableColumn = insertTableColumn;
|
|
110
|
+
exports.insertTableRow = insertTableRow;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { findText, replaceText, replaceTextInSlide, mergePresentation } from './chunk-
|
|
2
|
-
import { PresentationBuilder, PptxHandler, SlideBuilder, validateSeriesIndex, removeEmptyDataPoint, ensureDataPoint, ensureChartData, assertChartGradientSupported, toChartGradientFill, chartFormatTargetKey, readChartElementFormat, hasGradientField, applyGradient, mirrorFlatFields, mirrorTextColor, withSeries, applyChartGroupOptionsInput, countExistingLayouts, addLayoutToSlideMaster, addLayoutContentType, createLayout, STANDARD_LAYOUTS, generateLayoutXml, layoutRelsXml, createTextElement, createShapeElement, createImageElement, createTableElement, createChartElement, createConnectorElement, createMediaElement, createGroupElement, clonePartGraph, buildBlankPresentationArchive, FILL_CHOICE_ELEMENTS, relativePartTarget, PptxXmlBuilder } from './chunk-
|
|
3
|
-
import { SP_PR_ORDER, EMU_PER_PIXEL, EMU_PER_INCH, parseXml, first, relationshipsPartFor, parseRelationships, resolvePartPath, elements, buildXml, buildRelationshipsXml, bytesToBase64, base64ToBytes, LN_CHILD_ORDER, BLIP_FILL_ORDER, EFFECT_LST_ORDER, SHAPE_STYLE_ORDER, TC_PR_BORDERS_ORDER, hasTextProperties, nextRelationshipId, escAttr, NS } from './chunk-
|
|
1
|
+
import { findText, replaceText, replaceTextInSlide, mergePresentation } from './chunk-ZUEN4RQG.mjs';
|
|
2
|
+
import { PresentationBuilder, PptxHandler, SlideBuilder, validateSeriesIndex, removeEmptyDataPoint, ensureDataPoint, ensureChartData, assertChartGradientSupported, toChartGradientFill, chartFormatTargetKey, readChartElementFormat, hasGradientField, applyGradient, mirrorFlatFields, mirrorTextColor, withSeries, applyChartGroupOptionsInput, countExistingLayouts, addLayoutToSlideMaster, addLayoutContentType, createLayout, STANDARD_LAYOUTS, generateLayoutXml, layoutRelsXml, createTextElement, createShapeElement, createImageElement, createTableElement, createChartElement, createConnectorElement, createMediaElement, createGroupElement, clonePartGraph, buildBlankPresentationArchive, FILL_CHOICE_ELEMENTS, relativePartTarget, PptxXmlBuilder } from './chunk-VV724DWE.mjs';
|
|
3
|
+
import { SP_PR_ORDER, EMU_PER_PIXEL, EMU_PER_INCH, parseXml, first, relationshipsPartFor, parseRelationships, resolvePartPath, elements, buildXml, buildRelationshipsXml, bytesToBase64, base64ToBytes, LN_CHILD_ORDER, BLIP_FILL_ORDER, EFFECT_LST_ORDER, SHAPE_STYLE_ORDER, TC_PR_BORDERS_ORDER, hasTextProperties, nextRelationshipId, escAttr, NS } from './chunk-N6X5CJZP.mjs';
|
|
4
4
|
import { openPptxZip, openZip } from './chunk-EYCM7RVL.mjs';
|
|
5
5
|
import { cloneSlide, cloneElement } from './chunk-VDUNZTJC.mjs';
|
|
6
6
|
|
|
@@ -15098,7 +15098,7 @@ async function setPresentationRunText(bytes, slideIndex, elementId, runIndex, te
|
|
|
15098
15098
|
async function createPresentationFromOutline(slides, options = {}) {
|
|
15099
15099
|
if (!(slides instanceof Array) || !slides.length || slides.length > 200)
|
|
15100
15100
|
throw new Error("A presentation outline has 1 to 200 slides");
|
|
15101
|
-
const { PresentationBuilder: PresentationBuilder2 } = await import('./PresentationBuilder-
|
|
15101
|
+
const { PresentationBuilder: PresentationBuilder2 } = await import('./PresentationBuilder-APJKCMVS.mjs');
|
|
15102
15102
|
const { handler, data, createSlide } = await PresentationBuilder2.create({
|
|
15103
15103
|
...options.title ? { title: options.title } : {}
|
|
15104
15104
|
});
|