Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Andrey Antukh
2026-03-23 10:15:30 +01:00
2 changed files with 6 additions and 3 deletions

View File

@@ -115,6 +115,7 @@
## 2.13.0
### :heart: Community contributions (Thank you!)
- Add 'page' special shapeId to MCP export_shape tool for full-page snapshots [Github #8689](https://github.com/penpot/penpot/issues/8689)
- Fix mask issues with component swap (by @dfelinto) [Github #7675](https://github.com/penpot/penpot/issues/7675)

View File

@@ -16,8 +16,8 @@ export class ExportShapeArgs {
.string()
.min(1, "shapeId cannot be empty")
.describe(
"Identifier of the shape to export. Use the special identifier 'selection' to " +
"export the first shape currently selected by the user."
"Identifier of the shape to export. " +
"Special identifiers you can use: 'selection' (first shape currently selected by the user), 'page' (entire current page)"
),
format: z.enum(["svg", "png"]).default("png").describe("The output format, either 'png' (default) or 'svg'."),
mode: z
@@ -71,7 +71,7 @@ export class ExportShapeTool extends Tool<ExportShapeArgs> {
public getToolDescription(): string {
let description =
"Exports a shape (or a shape's image fill) from the Penpot design to a PNG or SVG image, " +
"such that you can get an impression of what it looks like. ";
"such that you can get an impression of what it looks like.";
if (this.mcpServer.isFileSystemAccessEnabled()) {
description += "\nAlternatively, you can save it to a file.";
}
@@ -88,6 +88,8 @@ export class ExportShapeTool extends Tool<ExportShapeArgs> {
let shapeCode: string;
if (args.shapeId === "selection") {
shapeCode = `penpot.selection[0]`;
} else if (args.shapeId === "page") {
shapeCode = `penpot.root`;
} else {
shapeCode = `penpotUtils.findShapeById("${args.shapeId}")`;
}