From 50e58abfd3fdb582705bc48e13cf10f1d8cf1c73 Mon Sep 17 00:00:00 2001 From: Mark Tolmacs Date: Wed, 17 Sep 2025 20:52:52 +0200 Subject: [PATCH] fix:Tool lock binding behavior restored --- .../tests/linearElementEditor.test.tsx | 5 +- packages/excalidraw/components/App.tsx | 5 +- .../tests/__snapshots__/history.test.tsx.snap | 815 ------------------ .../regressionTests.test.tsx.snap | 40 +- packages/excalidraw/tests/move.test.tsx | 2 +- 5 files changed, 38 insertions(+), 829 deletions(-) diff --git a/packages/element/tests/linearElementEditor.test.tsx b/packages/element/tests/linearElementEditor.test.tsx index 0d6524fd9c..be5ff26d95 100644 --- a/packages/element/tests/linearElementEditor.test.tsx +++ b/packages/element/tests/linearElementEditor.test.tsx @@ -217,7 +217,7 @@ describe("Test Linear Elements", () => { // drag line from midpoint drag(midpoint, pointFrom(midpoint[0] + delta, midpoint[1] + delta)); - expect(renderInteractiveScene.mock.calls.length).toMatchInlineSnapshot(`9`); + expect(renderInteractiveScene.mock.calls.length).toMatchInlineSnapshot(`8`); expect(renderStaticScene.mock.calls.length).toMatchInlineSnapshot(`7`); expect(line.points.length).toEqual(3); expect(line.points).toMatchInlineSnapshot(` @@ -329,7 +329,7 @@ describe("Test Linear Elements", () => { expect(h.state.selectedLinearElement?.isEditing).toBe(false); mouse.doubleClick(); - expect(h.state.selectedLinearElement).toBe(null); + expect(h.state.selectedLinearElement?.isEditing).toBe(false); await getTextEditor(); }); @@ -357,6 +357,7 @@ describe("Test Linear Elements", () => { const originalY = line.y; enterLineEditingMode(line); + expect(h.state.selectedLinearElement?.isEditing).toBe(true); expect(line.points.length).toEqual(2); mouse.clickAt(midpoint[0], midpoint[1]); diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index d300ae4d4a..14562a3a06 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -7809,7 +7809,10 @@ class App extends React.Component { selectedLinearElement: prevState.selectedLinearElement ? { ...prevState.selectedLinearElement, - isEditing: isBindingElement(hitElement), + isEditing: + !!hitElement && + hitElement.id === + this.state.selectedLinearElement?.elementId, } : null, selectedElementIds: prevState.selectedLinearElement diff --git a/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap index a4106dab24..79245af873 100644 --- a/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap +++ b/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap @@ -234,7 +234,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": undefined, "type": "arrow", "updated": 1, "version": 37, @@ -363,40 +362,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], "mode": "orbit", }, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id4", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id0", - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 493213705, - "width": 100, - "x": -100, - "y": -50, - }, "version": 36, "width": 88, "y": "16.71973", @@ -429,40 +394,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], "mode": "orbit", }, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id4", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id1", - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "version": 33, "width": 88, "y": "10.00000", @@ -520,7 +451,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], "mode": "inside", }, - "suggestedBinding": undefined, "version": 37, "width": 94, "x": 0, @@ -546,40 +476,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], "mode": "orbit", }, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id4", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id0", - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 493213705, - "width": 100, - "x": -100, - "y": -50, - }, "version": 36, "width": 88, "x": 6, @@ -999,7 +895,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": undefined, "type": "arrow", "updated": 1, "version": 34, @@ -1071,40 +966,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], "mode": "orbit", }, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id4", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id0", - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 493213705, - "width": 100, - "x": -100, - "y": -50, - }, "version": 33, "width": "44.00000", "y": "2.93333", @@ -1137,40 +998,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], "mode": "orbit", }, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id4", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id1", - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1996028265, - "width": 100, - "x": 100, - "y": -50, - }, "version": 31, "width": "6.00000", "y": 10, @@ -1220,7 +1047,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], "mode": "inside", }, - "suggestedBinding": undefined, "version": 34, "width": 0, "x": 250, @@ -1246,40 +1072,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl ], "mode": "orbit", }, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id4", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id0", - "index": "a0", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 493213705, - "width": 100, - "x": -100, - "y": -50, - }, "version": 33, "width": "44.00000", "x": 144, @@ -2694,40 +2486,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id4", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id1", - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 640725609, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "updated": 1, "version": 13, @@ -2894,40 +2652,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id4", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id1", - "index": "a1", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 640725609, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "version": 13, "width": 488, @@ -16600,40 +16324,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "updated": 1, "version": 13, @@ -16689,40 +16379,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding ], "mode": "orbit", }, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "version": 13, }, "inserted": { @@ -16743,35 +16399,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding ], "mode": "orbit", }, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 4, - "versionNonce": 888958951, - "width": 100, - "x": 100, - "y": -50, - }, "version": 10, }, }, @@ -17113,40 +16740,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "version": 9, "width": 88, @@ -17479,40 +17072,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "updated": 1, "version": 13, @@ -17819,40 +17378,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "version": 13, "width": "88.00000", @@ -18193,40 +17718,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "updated": 1, "version": 13, @@ -18533,40 +18024,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "version": 13, "width": "88.00000", @@ -18905,40 +18362,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "updated": 1, "version": 13, @@ -19010,40 +18433,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding ], "mode": "orbit", }, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "version": 13, }, "inserted": { @@ -19056,40 +18445,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "mode": "orbit", }, "startBinding": null, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "version": 10, }, }, @@ -19399,40 +18754,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "version": 9, "width": 88, @@ -19793,40 +19114,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "updated": 1, "version": 14, @@ -19909,79 +19196,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding ], "mode": "orbit", }, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "version": 14, }, "inserted": { "endBinding": null, "startBinding": null, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "version": 11, }, }, @@ -20283,40 +19502,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding "strokeColor": "#1e1e1e", "strokeStyle": "solid", "strokeWidth": 2, - "suggestedBinding": { - "angle": 0, - "backgroundColor": "transparent", - "boundElements": [ - { - "id": "id13", - "type": "arrow", - }, - ], - "customData": undefined, - "fillStyle": "solid", - "frameId": null, - "groupIds": [], - "height": 100, - "id": "id2", - "index": "a2", - "isDeleted": false, - "link": null, - "locked": false, - "opacity": 100, - "roughness": 1, - "roundness": null, - "seed": 1, - "strokeColor": "#1e1e1e", - "strokeStyle": "solid", - "strokeWidth": 2, - "type": "rectangle", - "updated": 1, - "version": 3, - "versionNonce": 1163661225, - "width": 100, - "x": 100, - "y": -50, - }, "type": "arrow", "version": 9, "width": 88, diff --git a/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap index dde3f7a8a7..f1e89604b3 100644 --- a/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap +++ b/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap @@ -6235,7 +6235,34 @@ exports[`regression tests > draw every type of shape > [end of test] appState 1` "selectedElementIds": {}, "selectedElementsAreBeingDragged": false, "selectedGroupIds": {}, - "selectedLinearElement": null, + "selectedLinearElement": { + "customLineAngle": null, + "elbowed": false, + "elementId": "id20", + "hoverPointIndex": -1, + "initialState": { + "arrowStartIsInside": false, + "lastClickedPoint": -1, + "origin": null, + "prevSelectedPointsIndices": null, + "segmentMidpoint": { + "added": false, + "index": null, + "value": null, + }, + }, + "isDragging": false, + "isEditing": false, + "lastCommittedPoint": null, + "lastUncommittedPoint": null, + "pointerDownState": undefined, + "pointerOffset": { + "x": 0, + "y": 0, + }, + "segmentMidPointHoveredCoords": null, + "selectedPointsIndices": null, + }, "selectionElement": null, "shouldCacheIgnoreZoom": false, "showHyperlinkPopup": false, @@ -6863,15 +6890,8 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack { "appState": AppStateDelta { "delta": Delta { - "deleted": { - "selectedLinearElement": null, - }, - "inserted": { - "selectedLinearElement": { - "elementId": "id20", - "isEditing": false, - }, - }, + "deleted": {}, + "inserted": {}, }, }, "elements": { diff --git a/packages/excalidraw/tests/move.test.tsx b/packages/excalidraw/tests/move.test.tsx index dc7b92b007..6fe3d8d1a1 100644 --- a/packages/excalidraw/tests/move.test.tsx +++ b/packages/excalidraw/tests/move.test.tsx @@ -102,7 +102,7 @@ describe("move element", () => { new Pointer("mouse").clickOn(rectB); expect(renderInteractiveScene.mock.calls.length).toMatchInlineSnapshot( - `16`, + `15`, ); expect(renderStaticScene.mock.calls.length).toMatchInlineSnapshot(`14`); expect(h.state.selectionElement).toBeNull();