pptx-viewer-mcp 2.4.1 → 2.5.1
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/CHANGELOG.md +19 -0
- package/dist/codec/index.d.ts +7 -7
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/index.d.ts +174 -79
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +139 -2
- package/dist/index.mjs +135 -4
- package/dist/mcp/index.js +260 -2
- package/dist/mcp/index.mjs +261 -3
- package/dist/schemas/index.d.ts +115 -73
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +49 -0
- package/dist/schemas/index.mjs +44 -1
- package/package.json +8 -7
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/execution.ts","../src/tools/slide-tools.ts","../src/tools/helpers.ts","../src/tools/element-tools.ts","../src/tools/table-tools.ts","../src/tools/table-style-tools.ts","../src/tools/style-tools.ts","../src/tools/content-tools.ts","../src/tools/conversion-tools.ts","../src/tools/theme-tools.ts","../src/tools/chart-tools.ts","../src/tools/chart-formatting-tools.ts","../src/tools/chart-user-shape-tools.ts","../src/tools/smartart-tools.ts","../src/tools/merge-tools.ts","../src/tools/template-tools.ts","../src/tools/metadata-tools.ts","../src/tools/section-tools.ts","../src/tools/export-tools.ts","../src/tools/json-tools.ts","../src/tools/hyperlink-tools.ts","../src/tools/geometry-tools.ts","../src/tools/lock-tools.ts","../src/tools/validation-tools.ts","../src/tools/presentation-tools.ts","../src/tools/layout-tools.ts"],"mappings":";;;;;;;UAOiB;;EAEhB,UAAU;;EAEV,gBAAgB,iBAAiB,QAAQ;;EAEzC,gBAAgB,iBAAiB,QAAQ;;;;;;;;;;;UAYzB;;EAEhB;;EAEA;;;;;;UAOgB,WAAW;;EAE3B,UAAU;;EAEV,QAAQ;;EAER;;;;;;EAMA,cAAc;;;;;;UAWE;;EAEhB,QAAQ;IAAqB,MAAM;;;EAEnC,SAAS;IACR,QAAQ,MAAM,KAAM,OAAO,YAAY,kBAAkB;IACzD,UAAU,MAAM,MAAO,QAAQ;;;EAGhC,YAAY;;;;;;;UAQI;EAChB,SAAS,eAAe,QAAQ;EAChC,UAAU,cAAc,MAAM,aAAa;;;;;;UAO3B;EAChB,eACC,kBACA,OAAO,YACP;IAAW;IAAoB;;EAEhC,SAAS,mBAAmB;;;;;UAMZ;;EAEhB,YAAY;;EAEZ,gBAAgB;;EAEhB,SAAS;;EAET;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/execution.ts","../src/tools/slide-tools.ts","../src/tools/helpers.ts","../src/tools/element-tools.ts","../src/tools/table-tools.ts","../src/tools/table-style-tools.ts","../src/tools/style-tools.ts","../src/tools/content-tools.ts","../src/tools/conversion-tools.ts","../src/tools/theme-tools.ts","../src/tools/chart-tools.ts","../src/tools/chart-formatting-tools.ts","../src/tools/chart-user-shape-tools.ts","../src/tools/smartart-tools.ts","../src/tools/merge-tools.ts","../src/tools/template-tools.ts","../src/tools/metadata-tools.ts","../src/tools/section-tools.ts","../src/tools/export-tools.ts","../src/tools/json-tools.ts","../src/tools/hyperlink-tools.ts","../src/tools/geometry-tools.ts","../src/tools/lock-tools.ts","../src/tools/validation-tools.ts","../src/tools/presentation-tools.ts","../src/tools/layout-tools.ts","../src/tools/ole-tools.ts"],"mappings":";;;;;;;UAOiB;;EAEhB,UAAU;;EAEV,gBAAgB,iBAAiB,QAAQ;;EAEzC,gBAAgB,iBAAiB,QAAQ;;;;;;;;;;;UAYzB;;EAEhB;;EAEA;;;;;;UAOgB,WAAW;;EAE3B,UAAU;;EAEV,QAAQ;;EAER;;;;;;EAMA,cAAc;;;;;;UAWE;;EAEhB,QAAQ;IAAqB,MAAM;;;EAEnC,SAAS;IACR,QAAQ,MAAM,KAAM,OAAO,YAAY,kBAAkB;IACzD,UAAU,MAAM,MAAO,QAAQ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B,oBAAoB;;;UCpHtC;EAChB;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;UAGgB;EAChB;EACA;;wBAGe,WACf,KAAK,aACL,QAAQ,mBACN,WAAW;UAmKG;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;EAOA,iBAAiB;EACjB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;wBAGe,cACf,KAAK,aACL,QAAQ,sBACN;EAAa;;UA6HC;EAChB;EACA;;EAEA;;wBAGe,cACf,KAAK,aACL,QAAQ,sBACN;EAAa;EAAmB;;UA4BlB;EAChB;EACA;;wBAGe,eACf,KAAK,aACL,QAAQ,uBACN;EAAa;;UA0BC;EAChB;EACA;EAEA;EACA;EAEA;EACA;;wBAGe,gBACf,KAAK,aACL,QAAQ,wBACN;EAAa;;UA6GC;EAChB;EACA;EACA;EACA;EACA;;UAGgB;EAChB;;wBAGe,aACf,KAAK,aACL,QAAQ,qBACN,WAAW;UA6CG;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;;wBAGe,oBACf,KAAK,aACL,QAAQ,4BACN;EAAa;;UAsDC;EAChB;EACA;;UAGgB;EAChB;;wBAGe,cACf,KAAK,aACL,QAAQ,sBACN,WAAW;UAmCG;EAChB;EACA;;UAGgB;EAChB;;wBAGe,gBACf,KAAK,aACL,QAAQ,wBACN,WAAW;UA6CG;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;wBAGe,oBACf,KAAK,aACL,QAAQ,4BACN;EAAa;;;;UC9zBC;EAChB;EACA;EACA,OAAO;IAAQ;IAAa;IAAa;;;wBAG1B,iBACf,KAAK,aACL,QAAQ,yBACN;EAAa;;UA6CC;EAChB;EACA;EACA;EACA;EACA;EACA;;wBAGe,qBACf,KAA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QAAQ,uBACN,QAAQ,WAAW"}
|
package/dist/index.js
CHANGED
|
@@ -1201,8 +1201,6 @@ function batchUpdateElements(ctx, params) {
|
|
|
1201
1201
|
result: { updatedCount: count }
|
|
1202
1202
|
};
|
|
1203
1203
|
}
|
|
1204
|
-
|
|
1205
|
-
// src/tools/table-tools.ts
|
|
1206
1204
|
function updateTableCells(ctx, params) {
|
|
1207
1205
|
const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
|
|
1208
1206
|
if (err) {
|
|
@@ -1259,6 +1257,8 @@ function manageTableStructure(ctx, params) {
|
|
|
1259
1257
|
throw new Error(`Table '${params.elementId}' has no tableData.`);
|
|
1260
1258
|
}
|
|
1261
1259
|
const { rows, columnWidths } = tbl.tableData;
|
|
1260
|
+
const source = { ...tbl, tableData: structuredClone(tbl.tableData) };
|
|
1261
|
+
let edit;
|
|
1262
1262
|
const colCount = columnWidths.length;
|
|
1263
1263
|
const rowCount = rows.length;
|
|
1264
1264
|
switch (params.action) {
|
|
@@ -1271,6 +1271,7 @@ function manageTableStructure(ctx, params) {
|
|
|
1271
1271
|
}))
|
|
1272
1272
|
};
|
|
1273
1273
|
rows.splice(pos, 0, newRow);
|
|
1274
|
+
edit = { axis: "row", action: "insert", index: pos };
|
|
1274
1275
|
break;
|
|
1275
1276
|
}
|
|
1276
1277
|
case "deleteRow": {
|
|
@@ -1282,6 +1283,7 @@ function manageTableStructure(ctx, params) {
|
|
|
1282
1283
|
throw new Error(`Row index ${ref} out of range (0\u2013${rowCount - 1}).`);
|
|
1283
1284
|
}
|
|
1284
1285
|
rows.splice(ref, 1);
|
|
1286
|
+
edit = { axis: "row", action: "delete", index: ref };
|
|
1285
1287
|
break;
|
|
1286
1288
|
}
|
|
1287
1289
|
case "insertColumn": {
|
|
@@ -1292,6 +1294,7 @@ function manageTableStructure(ctx, params) {
|
|
|
1292
1294
|
columnWidths[i] *= scaleFactor;
|
|
1293
1295
|
}
|
|
1294
1296
|
columnWidths.splice(pos, 0, newWidth);
|
|
1297
|
+
edit = { axis: "column", action: "insert", index: pos };
|
|
1295
1298
|
for (let r = 0; r < rows.length; r++) {
|
|
1296
1299
|
rows[r].cells.splice(pos, 0, {
|
|
1297
1300
|
text: params.cellTexts?.[r] ?? ""
|
|
@@ -1309,6 +1312,7 @@ function manageTableStructure(ctx, params) {
|
|
|
1309
1312
|
}
|
|
1310
1313
|
const removedWidth = columnWidths[ref];
|
|
1311
1314
|
columnWidths.splice(ref, 1);
|
|
1315
|
+
edit = { axis: "column", action: "delete", index: ref };
|
|
1312
1316
|
const remaining = columnWidths.length;
|
|
1313
1317
|
if (remaining > 0) {
|
|
1314
1318
|
const extra = removedWidth / remaining;
|
|
@@ -1325,6 +1329,10 @@ function manageTableStructure(ctx, params) {
|
|
|
1325
1329
|
throw new Error(`Unknown action: ${String(params.action)}`);
|
|
1326
1330
|
}
|
|
1327
1331
|
}
|
|
1332
|
+
const rawXml = pptxViewerCore.rebuildTableStructureInRawXml(source, tbl.tableData, edit);
|
|
1333
|
+
if (rawXml) {
|
|
1334
|
+
tbl.rawXml = rawXml;
|
|
1335
|
+
}
|
|
1328
1336
|
return {
|
|
1329
1337
|
pptxData: ctx.pptxData,
|
|
1330
1338
|
dirty: true,
|
|
@@ -2953,6 +2961,129 @@ function applyLayout(ctx, params) {
|
|
|
2953
2961
|
result: { slideIndex: params.slideIndex, layoutName: layout.name ?? "Unknown" }
|
|
2954
2962
|
};
|
|
2955
2963
|
}
|
|
2964
|
+
function resolveOleElement(ctx, slideIndex, elementId) {
|
|
2965
|
+
const err = validateSlideIndex(slideIndex, ctx.pptxData.slides.length);
|
|
2966
|
+
if (err) {
|
|
2967
|
+
throw new Error(err);
|
|
2968
|
+
}
|
|
2969
|
+
const slide = ctx.pptxData.slides[slideIndex];
|
|
2970
|
+
const index = slide.elements.findIndex((e) => e.id === elementId);
|
|
2971
|
+
if (index === -1) {
|
|
2972
|
+
throw new Error(`Element '${elementId}' not found on slide ${slideIndex}.`);
|
|
2973
|
+
}
|
|
2974
|
+
const element = slide.elements[index];
|
|
2975
|
+
if (element.type !== "ole") {
|
|
2976
|
+
throw new Error(`Element '${elementId}' is not an OLE object.`);
|
|
2977
|
+
}
|
|
2978
|
+
return { slide, element, index };
|
|
2979
|
+
}
|
|
2980
|
+
function commitOleElement(slide, index, updated) {
|
|
2981
|
+
slide.elements.splice(index, 1, updated);
|
|
2982
|
+
slide.isDirty = true;
|
|
2983
|
+
}
|
|
2984
|
+
async function getOleContent(ctx, params) {
|
|
2985
|
+
const { element } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
2986
|
+
const kind = await pptxViewerCore.resolveOleEditorKindFromPayload(element);
|
|
2987
|
+
const base = { pptxData: ctx.pptxData, dirty: false };
|
|
2988
|
+
switch (kind) {
|
|
2989
|
+
case "sheet-xlsx":
|
|
2990
|
+
case "sheet-xls": {
|
|
2991
|
+
const sheet = await pptxViewerCore.getOleSheetGrid(element);
|
|
2992
|
+
return { ...base, result: { elementId: element.id, kind, editable: true, sheet } };
|
|
2993
|
+
}
|
|
2994
|
+
case "document-docx":
|
|
2995
|
+
case "document-doc": {
|
|
2996
|
+
const paragraphs = await pptxViewerCore.getOleDocumentParagraphs(element);
|
|
2997
|
+
return { ...base, result: { elementId: element.id, kind, editable: true, paragraphs } };
|
|
2998
|
+
}
|
|
2999
|
+
case "deck-pptx": {
|
|
3000
|
+
const deckSlides = await pptxViewerCore.getOleNestedDeckDetail(element);
|
|
3001
|
+
return { ...base, result: { elementId: element.id, kind, editable: true, deckSlides } };
|
|
3002
|
+
}
|
|
3003
|
+
default:
|
|
3004
|
+
return {
|
|
3005
|
+
...base,
|
|
3006
|
+
result: {
|
|
3007
|
+
elementId: element.id,
|
|
3008
|
+
kind,
|
|
3009
|
+
editable: false,
|
|
3010
|
+
message: `This OLE object's content (${kind}) is not directly editable; use ole_replace_file to replace it wholesale.`
|
|
3011
|
+
}
|
|
3012
|
+
};
|
|
3013
|
+
}
|
|
3014
|
+
}
|
|
3015
|
+
async function setOleSheetCell(ctx, params) {
|
|
3016
|
+
const { slide, element, index } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
3017
|
+
const updated = await pptxViewerCore.applyOleSheetCellEdit(element, {
|
|
3018
|
+
row: params.row,
|
|
3019
|
+
col: params.col,
|
|
3020
|
+
value: params.value
|
|
3021
|
+
});
|
|
3022
|
+
const changed = updated !== element;
|
|
3023
|
+
if (changed) {
|
|
3024
|
+
commitOleElement(slide, index, updated);
|
|
3025
|
+
}
|
|
3026
|
+
return {
|
|
3027
|
+
pptxData: ctx.pptxData,
|
|
3028
|
+
dirty: changed,
|
|
3029
|
+
result: { elementId: params.elementId, changed }
|
|
3030
|
+
};
|
|
3031
|
+
}
|
|
3032
|
+
async function setOleDocumentParagraph(ctx, params) {
|
|
3033
|
+
const { slide, element, index } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
3034
|
+
const updated = await pptxViewerCore.applyOleDocumentParagraphEdit(element, params.paragraphIndex, params.text);
|
|
3035
|
+
const changed = updated !== element;
|
|
3036
|
+
if (changed) {
|
|
3037
|
+
commitOleElement(slide, index, updated);
|
|
3038
|
+
}
|
|
3039
|
+
return {
|
|
3040
|
+
pptxData: ctx.pptxData,
|
|
3041
|
+
dirty: changed,
|
|
3042
|
+
result: { elementId: params.elementId, changed }
|
|
3043
|
+
};
|
|
3044
|
+
}
|
|
3045
|
+
async function setOleDeckSlideTitle(ctx, params) {
|
|
3046
|
+
const { slide, element, index } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
3047
|
+
const updated = await pptxViewerCore.applyOleNestedDeckElementTextEdit(
|
|
3048
|
+
element,
|
|
3049
|
+
params.deckSlideIndex,
|
|
3050
|
+
params.deckElementId,
|
|
3051
|
+
params.title
|
|
3052
|
+
);
|
|
3053
|
+
const changed = updated !== element;
|
|
3054
|
+
if (changed) {
|
|
3055
|
+
commitOleElement(slide, index, updated);
|
|
3056
|
+
}
|
|
3057
|
+
return {
|
|
3058
|
+
pptxData: ctx.pptxData,
|
|
3059
|
+
dirty: changed,
|
|
3060
|
+
result: { elementId: params.elementId, changed }
|
|
3061
|
+
};
|
|
3062
|
+
}
|
|
3063
|
+
async function setOleObjectNameT(ctx, params) {
|
|
3064
|
+
const { slide, element, index } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
3065
|
+
const updated = await pptxViewerCore.setOleObjectName(element, params.name);
|
|
3066
|
+
commitOleElement(slide, index, updated);
|
|
3067
|
+
return {
|
|
3068
|
+
pptxData: ctx.pptxData,
|
|
3069
|
+
dirty: true,
|
|
3070
|
+
result: { elementId: params.elementId, changed: true }
|
|
3071
|
+
};
|
|
3072
|
+
}
|
|
3073
|
+
async function replaceOleFileT(ctx, params) {
|
|
3074
|
+
const { slide, element, index } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
3075
|
+
const parsed = pptxViewerCore.parseDataUrlToBytes(params.fileData);
|
|
3076
|
+
if (!parsed) {
|
|
3077
|
+
throw new Error('fileData must be a base64 data URL, e.g. "data:<mime-type>;base64,<...>".');
|
|
3078
|
+
}
|
|
3079
|
+
const updated = await pptxViewerCore.replaceOleFile(element, parsed.bytes, params.fileName);
|
|
3080
|
+
commitOleElement(slide, index, updated);
|
|
3081
|
+
return {
|
|
3082
|
+
pptxData: ctx.pptxData,
|
|
3083
|
+
dirty: true,
|
|
3084
|
+
result: { elementId: params.elementId, changed: true }
|
|
3085
|
+
};
|
|
3086
|
+
}
|
|
2956
3087
|
|
|
2957
3088
|
Object.defineProperty(exports, "PptxHandler", {
|
|
2958
3089
|
enumerable: true,
|
|
@@ -2992,6 +3123,7 @@ exports.generateElementId = generateElementId;
|
|
|
2992
3123
|
exports.generateSlideId = generateSlideId;
|
|
2993
3124
|
exports.getLayouts = getLayouts;
|
|
2994
3125
|
exports.getMetadata = getMetadata;
|
|
3126
|
+
exports.getOleContent = getOleContent;
|
|
2995
3127
|
exports.getPresentationProperties = getPresentationProperties;
|
|
2996
3128
|
exports.getSlide = getSlide;
|
|
2997
3129
|
exports.getThemeInfo = getThemeInfo;
|
|
@@ -3011,6 +3143,7 @@ exports.renameElement = renameElement;
|
|
|
3011
3143
|
exports.reorderSlides = reorderSlides;
|
|
3012
3144
|
exports.repairPresentation = repairPresentation;
|
|
3013
3145
|
exports.replaceGeometry = replaceGeometry;
|
|
3146
|
+
exports.replaceOleFileT = replaceOleFileT;
|
|
3014
3147
|
exports.replaceText = replaceText;
|
|
3015
3148
|
exports.runAccessibilityCheck = runAccessibilityCheck;
|
|
3016
3149
|
exports.savePresentation = savePresentation;
|
|
@@ -3019,6 +3152,10 @@ exports.setChartColorMapOverrideT = setChartColorMapOverrideT;
|
|
|
3019
3152
|
exports.setChartHelperLineT = setChartHelperLineT;
|
|
3020
3153
|
exports.setElementAnimation = setElementAnimation;
|
|
3021
3154
|
exports.setElementLockT = setElementLockT;
|
|
3155
|
+
exports.setOleDeckSlideTitle = setOleDeckSlideTitle;
|
|
3156
|
+
exports.setOleDocumentParagraph = setOleDocumentParagraph;
|
|
3157
|
+
exports.setOleObjectNameT = setOleObjectNameT;
|
|
3158
|
+
exports.setOleSheetCell = setOleSheetCell;
|
|
3022
3159
|
exports.setSlideTransition = setSlideTransition;
|
|
3023
3160
|
exports.setTableStyleSection = setTableStyleSection;
|
|
3024
3161
|
exports.ungroupElements = ungroupElements;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PptxHandler, hasTextProperties, resolveDisplayedChartTypeName, resolveThemeColorRef, cloneElement as cloneElement$1, isTemplateElementId, makeStoreAwareId, reassignDescendantIds, groupElements as groupElements$1, ungroupElements as ungroupElements$1, TABLE_STYLE_PART_SEQUENCE, normalizeTableStyleGuid, createTableStyleEntry, addTableStyleToMap, deleteTableStyleFromMap, PptxMarkdownConverter, ThemePresets, getThemePreset, setChartType, setChartTitle, setChartGrouping, setChartLegend, setChartDataLabels, setChartAxis, setChartCategories, addChartSeries, removeChartSeries, updateChartSeriesValues, ChartBuilder, setChartDataPointStyle, setChartDataPointExplosion, setChartDataPointMarker, setChartDataPointLabel, setChartSeriesMarker, setChartSeriesTrendline, setChartSeriesErrorBars, setChartHelperLine, setChartColorMapOverride, listChartUserShapes, addChartUserShape, updateChartUserShape, removeChartUserShape, decomposeSmartArt, demoteSmartArtNode, promoteSmartArtNode, reorderSmartArtNode, updateSmartArtNodeText, removeSmartArtNode, addSmartArtNode, mergePresentation, diffPresentations, findPlaceholders, applyTemplate, getSectionForSlide, moveSlidesToSection, reorderSections, removeSection, addSection, SvgExporter, buildPptxJsonDocument, deserializePptxFromJson, applyImportedPptxData, replaceWithCustomGeometry, replaceShapeGeometry, setElementLocked, validatePptx, repairPptx, findLayoutByName, findLayoutByType } from 'pptx-viewer-core';
|
|
1
|
+
import { PptxHandler, hasTextProperties, resolveDisplayedChartTypeName, resolveThemeColorRef, cloneElement as cloneElement$1, isTemplateElementId, makeStoreAwareId, reassignDescendantIds, groupElements as groupElements$1, ungroupElements as ungroupElements$1, rebuildTableStructureInRawXml, TABLE_STYLE_PART_SEQUENCE, normalizeTableStyleGuid, createTableStyleEntry, addTableStyleToMap, deleteTableStyleFromMap, PptxMarkdownConverter, ThemePresets, getThemePreset, setChartType, setChartTitle, setChartGrouping, setChartLegend, setChartDataLabels, setChartAxis, setChartCategories, addChartSeries, removeChartSeries, updateChartSeriesValues, ChartBuilder, setChartDataPointStyle, setChartDataPointExplosion, setChartDataPointMarker, setChartDataPointLabel, setChartSeriesMarker, setChartSeriesTrendline, setChartSeriesErrorBars, setChartHelperLine, setChartColorMapOverride, listChartUserShapes, addChartUserShape, updateChartUserShape, removeChartUserShape, decomposeSmartArt, demoteSmartArtNode, promoteSmartArtNode, reorderSmartArtNode, updateSmartArtNodeText, removeSmartArtNode, addSmartArtNode, mergePresentation, diffPresentations, findPlaceholders, applyTemplate, getSectionForSlide, moveSlidesToSection, reorderSections, removeSection, addSection, SvgExporter, buildPptxJsonDocument, deserializePptxFromJson, applyImportedPptxData, replaceWithCustomGeometry, replaceShapeGeometry, setElementLocked, validatePptx, repairPptx, findLayoutByName, findLayoutByType, resolveOleEditorKindFromPayload, getOleNestedDeckDetail, getOleDocumentParagraphs, getOleSheetGrid, applyOleSheetCellEdit, applyOleDocumentParagraphEdit, applyOleNestedDeckElementTextEdit, setOleObjectName, parseDataUrlToBytes, replaceOleFile } from 'pptx-viewer-core';
|
|
2
2
|
export { PptxHandler } from 'pptx-viewer-core';
|
|
3
3
|
|
|
4
4
|
// src/execution.ts
|
|
@@ -1200,8 +1200,6 @@ function batchUpdateElements(ctx, params) {
|
|
|
1200
1200
|
result: { updatedCount: count }
|
|
1201
1201
|
};
|
|
1202
1202
|
}
|
|
1203
|
-
|
|
1204
|
-
// src/tools/table-tools.ts
|
|
1205
1203
|
function updateTableCells(ctx, params) {
|
|
1206
1204
|
const err = validateSlideIndex(params.slideIndex, ctx.pptxData.slides.length);
|
|
1207
1205
|
if (err) {
|
|
@@ -1258,6 +1256,8 @@ function manageTableStructure(ctx, params) {
|
|
|
1258
1256
|
throw new Error(`Table '${params.elementId}' has no tableData.`);
|
|
1259
1257
|
}
|
|
1260
1258
|
const { rows, columnWidths } = tbl.tableData;
|
|
1259
|
+
const source = { ...tbl, tableData: structuredClone(tbl.tableData) };
|
|
1260
|
+
let edit;
|
|
1261
1261
|
const colCount = columnWidths.length;
|
|
1262
1262
|
const rowCount = rows.length;
|
|
1263
1263
|
switch (params.action) {
|
|
@@ -1270,6 +1270,7 @@ function manageTableStructure(ctx, params) {
|
|
|
1270
1270
|
}))
|
|
1271
1271
|
};
|
|
1272
1272
|
rows.splice(pos, 0, newRow);
|
|
1273
|
+
edit = { axis: "row", action: "insert", index: pos };
|
|
1273
1274
|
break;
|
|
1274
1275
|
}
|
|
1275
1276
|
case "deleteRow": {
|
|
@@ -1281,6 +1282,7 @@ function manageTableStructure(ctx, params) {
|
|
|
1281
1282
|
throw new Error(`Row index ${ref} out of range (0\u2013${rowCount - 1}).`);
|
|
1282
1283
|
}
|
|
1283
1284
|
rows.splice(ref, 1);
|
|
1285
|
+
edit = { axis: "row", action: "delete", index: ref };
|
|
1284
1286
|
break;
|
|
1285
1287
|
}
|
|
1286
1288
|
case "insertColumn": {
|
|
@@ -1291,6 +1293,7 @@ function manageTableStructure(ctx, params) {
|
|
|
1291
1293
|
columnWidths[i] *= scaleFactor;
|
|
1292
1294
|
}
|
|
1293
1295
|
columnWidths.splice(pos, 0, newWidth);
|
|
1296
|
+
edit = { axis: "column", action: "insert", index: pos };
|
|
1294
1297
|
for (let r = 0; r < rows.length; r++) {
|
|
1295
1298
|
rows[r].cells.splice(pos, 0, {
|
|
1296
1299
|
text: params.cellTexts?.[r] ?? ""
|
|
@@ -1308,6 +1311,7 @@ function manageTableStructure(ctx, params) {
|
|
|
1308
1311
|
}
|
|
1309
1312
|
const removedWidth = columnWidths[ref];
|
|
1310
1313
|
columnWidths.splice(ref, 1);
|
|
1314
|
+
edit = { axis: "column", action: "delete", index: ref };
|
|
1311
1315
|
const remaining = columnWidths.length;
|
|
1312
1316
|
if (remaining > 0) {
|
|
1313
1317
|
const extra = removedWidth / remaining;
|
|
@@ -1324,6 +1328,10 @@ function manageTableStructure(ctx, params) {
|
|
|
1324
1328
|
throw new Error(`Unknown action: ${String(params.action)}`);
|
|
1325
1329
|
}
|
|
1326
1330
|
}
|
|
1331
|
+
const rawXml = rebuildTableStructureInRawXml(source, tbl.tableData, edit);
|
|
1332
|
+
if (rawXml) {
|
|
1333
|
+
tbl.rawXml = rawXml;
|
|
1334
|
+
}
|
|
1327
1335
|
return {
|
|
1328
1336
|
pptxData: ctx.pptxData,
|
|
1329
1337
|
dirty: true,
|
|
@@ -2952,5 +2960,128 @@ function applyLayout(ctx, params) {
|
|
|
2952
2960
|
result: { slideIndex: params.slideIndex, layoutName: layout.name ?? "Unknown" }
|
|
2953
2961
|
};
|
|
2954
2962
|
}
|
|
2963
|
+
function resolveOleElement(ctx, slideIndex, elementId) {
|
|
2964
|
+
const err = validateSlideIndex(slideIndex, ctx.pptxData.slides.length);
|
|
2965
|
+
if (err) {
|
|
2966
|
+
throw new Error(err);
|
|
2967
|
+
}
|
|
2968
|
+
const slide = ctx.pptxData.slides[slideIndex];
|
|
2969
|
+
const index = slide.elements.findIndex((e) => e.id === elementId);
|
|
2970
|
+
if (index === -1) {
|
|
2971
|
+
throw new Error(`Element '${elementId}' not found on slide ${slideIndex}.`);
|
|
2972
|
+
}
|
|
2973
|
+
const element = slide.elements[index];
|
|
2974
|
+
if (element.type !== "ole") {
|
|
2975
|
+
throw new Error(`Element '${elementId}' is not an OLE object.`);
|
|
2976
|
+
}
|
|
2977
|
+
return { slide, element, index };
|
|
2978
|
+
}
|
|
2979
|
+
function commitOleElement(slide, index, updated) {
|
|
2980
|
+
slide.elements.splice(index, 1, updated);
|
|
2981
|
+
slide.isDirty = true;
|
|
2982
|
+
}
|
|
2983
|
+
async function getOleContent(ctx, params) {
|
|
2984
|
+
const { element } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
2985
|
+
const kind = await resolveOleEditorKindFromPayload(element);
|
|
2986
|
+
const base = { pptxData: ctx.pptxData, dirty: false };
|
|
2987
|
+
switch (kind) {
|
|
2988
|
+
case "sheet-xlsx":
|
|
2989
|
+
case "sheet-xls": {
|
|
2990
|
+
const sheet = await getOleSheetGrid(element);
|
|
2991
|
+
return { ...base, result: { elementId: element.id, kind, editable: true, sheet } };
|
|
2992
|
+
}
|
|
2993
|
+
case "document-docx":
|
|
2994
|
+
case "document-doc": {
|
|
2995
|
+
const paragraphs = await getOleDocumentParagraphs(element);
|
|
2996
|
+
return { ...base, result: { elementId: element.id, kind, editable: true, paragraphs } };
|
|
2997
|
+
}
|
|
2998
|
+
case "deck-pptx": {
|
|
2999
|
+
const deckSlides = await getOleNestedDeckDetail(element);
|
|
3000
|
+
return { ...base, result: { elementId: element.id, kind, editable: true, deckSlides } };
|
|
3001
|
+
}
|
|
3002
|
+
default:
|
|
3003
|
+
return {
|
|
3004
|
+
...base,
|
|
3005
|
+
result: {
|
|
3006
|
+
elementId: element.id,
|
|
3007
|
+
kind,
|
|
3008
|
+
editable: false,
|
|
3009
|
+
message: `This OLE object's content (${kind}) is not directly editable; use ole_replace_file to replace it wholesale.`
|
|
3010
|
+
}
|
|
3011
|
+
};
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
async function setOleSheetCell(ctx, params) {
|
|
3015
|
+
const { slide, element, index } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
3016
|
+
const updated = await applyOleSheetCellEdit(element, {
|
|
3017
|
+
row: params.row,
|
|
3018
|
+
col: params.col,
|
|
3019
|
+
value: params.value
|
|
3020
|
+
});
|
|
3021
|
+
const changed = updated !== element;
|
|
3022
|
+
if (changed) {
|
|
3023
|
+
commitOleElement(slide, index, updated);
|
|
3024
|
+
}
|
|
3025
|
+
return {
|
|
3026
|
+
pptxData: ctx.pptxData,
|
|
3027
|
+
dirty: changed,
|
|
3028
|
+
result: { elementId: params.elementId, changed }
|
|
3029
|
+
};
|
|
3030
|
+
}
|
|
3031
|
+
async function setOleDocumentParagraph(ctx, params) {
|
|
3032
|
+
const { slide, element, index } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
3033
|
+
const updated = await applyOleDocumentParagraphEdit(element, params.paragraphIndex, params.text);
|
|
3034
|
+
const changed = updated !== element;
|
|
3035
|
+
if (changed) {
|
|
3036
|
+
commitOleElement(slide, index, updated);
|
|
3037
|
+
}
|
|
3038
|
+
return {
|
|
3039
|
+
pptxData: ctx.pptxData,
|
|
3040
|
+
dirty: changed,
|
|
3041
|
+
result: { elementId: params.elementId, changed }
|
|
3042
|
+
};
|
|
3043
|
+
}
|
|
3044
|
+
async function setOleDeckSlideTitle(ctx, params) {
|
|
3045
|
+
const { slide, element, index } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
3046
|
+
const updated = await applyOleNestedDeckElementTextEdit(
|
|
3047
|
+
element,
|
|
3048
|
+
params.deckSlideIndex,
|
|
3049
|
+
params.deckElementId,
|
|
3050
|
+
params.title
|
|
3051
|
+
);
|
|
3052
|
+
const changed = updated !== element;
|
|
3053
|
+
if (changed) {
|
|
3054
|
+
commitOleElement(slide, index, updated);
|
|
3055
|
+
}
|
|
3056
|
+
return {
|
|
3057
|
+
pptxData: ctx.pptxData,
|
|
3058
|
+
dirty: changed,
|
|
3059
|
+
result: { elementId: params.elementId, changed }
|
|
3060
|
+
};
|
|
3061
|
+
}
|
|
3062
|
+
async function setOleObjectNameT(ctx, params) {
|
|
3063
|
+
const { slide, element, index } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
3064
|
+
const updated = await setOleObjectName(element, params.name);
|
|
3065
|
+
commitOleElement(slide, index, updated);
|
|
3066
|
+
return {
|
|
3067
|
+
pptxData: ctx.pptxData,
|
|
3068
|
+
dirty: true,
|
|
3069
|
+
result: { elementId: params.elementId, changed: true }
|
|
3070
|
+
};
|
|
3071
|
+
}
|
|
3072
|
+
async function replaceOleFileT(ctx, params) {
|
|
3073
|
+
const { slide, element, index } = resolveOleElement(ctx, params.slideIndex, params.elementId);
|
|
3074
|
+
const parsed = parseDataUrlToBytes(params.fileData);
|
|
3075
|
+
if (!parsed) {
|
|
3076
|
+
throw new Error('fileData must be a base64 data URL, e.g. "data:<mime-type>;base64,<...>".');
|
|
3077
|
+
}
|
|
3078
|
+
const updated = await replaceOleFile(element, parsed.bytes, params.fileName);
|
|
3079
|
+
commitOleElement(slide, index, updated);
|
|
3080
|
+
return {
|
|
3081
|
+
pptxData: ctx.pptxData,
|
|
3082
|
+
dirty: true,
|
|
3083
|
+
result: { elementId: params.elementId, changed: true }
|
|
3084
|
+
};
|
|
3085
|
+
}
|
|
2955
3086
|
|
|
2956
|
-
export { addChartSeriesT, addChartUserShapeT, addElement, addSlide, applyLayout, applyTemplateT, applyThemePreset, arrangeElements, assignTableStyle, batchUpdateElements, cloneElement, convertToMarkdown, createChart, createTableStyle, deleteElements, deleteSlides, deleteTableStyle, describeElement, diffPresentationsT, duplicateSlide, executeToolWithContext, exportSlideSvg, exportToJson, exportToSvg, extractSlideText, findPlaceholdersT, findText, formatChartDataLabel, formatChartDataPoint, formatChartSeries, generateElementId, generateSlideId, getLayouts, getMetadata, getPresentationProperties, getSlide, getThemeInfo, groupElements, importFromJson, listChartUserShapesT, loadPresentation, manageComments, manageHyperlinks, manageSections, manageSmartArt, manageTableStructure, mergePresentationT, removeChartSeriesT, removeChartUserShapeT, renameElement, reorderSlides, repairPresentation, replaceGeometry, replaceText, runAccessibilityCheck, savePresentation, setCanvasSize, setChartColorMapOverrideT, setChartHelperLineT, setElementAnimation, setElementLockT, setSlideTransition, setTableStyleSection, ungroupElements, updateChart, updateChartSeriesData, updateChartUserShapeT, updateElement, updateElementStyle, updateMetadata, updatePresentationProperties, updateSlideProperties, updateTableCells, updateThemeColors, updateThemeFonts, validatePresentation, validateSlideIndex };
|
|
3087
|
+
export { addChartSeriesT, addChartUserShapeT, addElement, addSlide, applyLayout, applyTemplateT, applyThemePreset, arrangeElements, assignTableStyle, batchUpdateElements, cloneElement, convertToMarkdown, createChart, createTableStyle, deleteElements, deleteSlides, deleteTableStyle, describeElement, diffPresentationsT, duplicateSlide, executeToolWithContext, exportSlideSvg, exportToJson, exportToSvg, extractSlideText, findPlaceholdersT, findText, formatChartDataLabel, formatChartDataPoint, formatChartSeries, generateElementId, generateSlideId, getLayouts, getMetadata, getOleContent, getPresentationProperties, getSlide, getThemeInfo, groupElements, importFromJson, listChartUserShapesT, loadPresentation, manageComments, manageHyperlinks, manageSections, manageSmartArt, manageTableStructure, mergePresentationT, removeChartSeriesT, removeChartUserShapeT, renameElement, reorderSlides, repairPresentation, replaceGeometry, replaceOleFileT, replaceText, runAccessibilityCheck, savePresentation, setCanvasSize, setChartColorMapOverrideT, setChartHelperLineT, setElementAnimation, setElementLockT, setOleDeckSlideTitle, setOleDocumentParagraph, setOleObjectNameT, setOleSheetCell, setSlideTransition, setTableStyleSection, ungroupElements, updateChart, updateChartSeriesData, updateChartUserShapeT, updateElement, updateElementStyle, updateMetadata, updatePresentationProperties, updateSlideProperties, updateTableCells, updateThemeColors, updateThemeFonts, validatePresentation, validateSlideIndex };
|