From 8701a5f843ff782be8d58fc5c31b7629802c4f1a Mon Sep 17 00:00:00 2001 From: dwelle <5153846+dwelle@users.noreply.github.com> Date: Thu, 10 Oct 2024 23:58:52 +0200 Subject: [PATCH] fix: actionCropEditor not working --- packages/excalidraw/actions/actionCropEditor.tsx | 3 +-- .../excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/excalidraw/actions/actionCropEditor.tsx b/packages/excalidraw/actions/actionCropEditor.tsx index 9c1a7179d..24b64783b 100644 --- a/packages/excalidraw/actions/actionCropEditor.tsx +++ b/packages/excalidraw/actions/actionCropEditor.tsx @@ -10,7 +10,6 @@ export const actionToggleCropEditor = register({ name: "cropEditor", label: "helpDialog.cropStart", icon: cropIcon, - paletteName: "Finish image cropping", viewMode: true, trackEvent: { category: "menu" }, keywords: ["image", "crop"], @@ -24,7 +23,7 @@ export const actionToggleCropEditor = register({ appState: { ...appState, isCropping: false, - croppingElement: selectedElement, + croppingElementId: selectedElement.id, }, storeAction: StoreAction.CAPTURE, }; diff --git a/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap index ad82985d7..afd6bd2b7 100644 --- a/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap +++ b/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap @@ -152,7 +152,6 @@ exports[`contextMenu element > right-clicking on a group should select whole gro ], "label": "helpDialog.cropStart", "name": "cropEditor", - "paletteName": "Finish image cropping", "perform": [Function], "predicate": [Function], "trackEvent": { @@ -4738,7 +4737,6 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi ], "label": "helpDialog.cropStart", "name": "cropEditor", - "paletteName": "Finish image cropping", "perform": [Function], "predicate": [Function], "trackEvent": { @@ -5912,7 +5910,6 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro ], "label": "helpDialog.cropStart", "name": "cropEditor", - "paletteName": "Finish image cropping", "perform": [Function], "predicate": [Function], "trackEvent": { @@ -7808,7 +7805,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap ], "label": "helpDialog.cropStart", "name": "cropEditor", - "paletteName": "Finish image cropping", "perform": [Function], "predicate": [Function], "trackEvent": { @@ -8749,7 +8745,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap ], "label": "helpDialog.cropStart", "name": "cropEditor", - "paletteName": "Finish image cropping", "perform": [Function], "predicate": [Function], "trackEvent": {