* feat: redesign arrows and lines
* set selectedLinearElement on pointerup
* fix tests
* fix lint
* set selectionLinearElement to null when element is not selected
* fix
* don't set selectedElementIds to empty object when linear element selected
* don't move arrows when clicked on bounding box
* don't consider bounding box when linear element selected
* better hitbox
* show pointer when over the points in linear elements
* highlight points when hovered
* tweak design whene editing linear element points
* tweak
* fix test
* fix multi point editing
* cleanup
* fix
* fix
* remove stroke when hovered
* account for zoom when hover
* review fix
* set selectedLinearElement to null when selectedElementIds doesn't contain the linear element
* remove hover affect when moved away from linear element
* don't set selectedLinearAElement if already set
* fix selection
* render reduced in test :p
* fix box selection for single linear element
* set selectedLinearElement when deselecting selected elements and linear element is selected
* don't show linear element handles when element locked
* selected linear element when only linear present and selected with selectAll
* don't set selectedLinearElement if already set
* store selectedLinearElement in browser to persist
* remove redundant checks
* test fix
* select linear element handles when user has finished multipoint editing
* fix snap
* add comments
* show bounding box for locked linear elements
* add stroke param to fillCircle and remove stroke when linear element point hovered
* set selectedLinearElement when thats the only element left when deselcting others
* skip tests instead of removing for rotation
* (un)bind on pointerUp when moving linear element points outside editor
* render bounding box for linear elements as a fallback on state mismatch
* simplify and remove type assertion
Co-authored-by: dwelle <luzar.david@gmail.com>
exports[`regression tests draw every type of shape: [end of test] number of elements 1`] = `8`;
exports[`regression tests draw every type of shape: [end of test] number of renders 1`] = `52`;
exports[`regression tests draw every type of shape: [end of test] number of renders 1`] = `56`;
exports[`regression tests given a group of selected elements with an element that is not selected inside the group common bounding box when element that is not selected is clicked should switch selection to not selected element on pointer up: [end of test] appState 1`] = `
Object {
@ -9199,6 +9219,7 @@ Object {
"id4": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -9599,6 +9620,7 @@ Object {
"id3": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -9874,6 +9896,7 @@ Object {
"id3": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -10113,6 +10136,7 @@ Object {
"id3": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -10415,6 +10439,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -10593,6 +10618,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -10771,6 +10797,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -10949,6 +10976,23 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": LinearElementEditor {
"elementId": "id0",
"endBindingElement": "keep",
"hoverPointIndex": -1,
"isDragging": false,
"lastUncommittedPoint": null,
"pointerDownState": Object {
"lastClickedPoint": -1,
"prevSelectedPointsIndices": null,
},
"pointerOffset": Object {
"x": 0,
"y": 0,
},
"selectedPointsIndices": null,
"startBindingElement": "keep",
},
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -11157,6 +11201,23 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": LinearElementEditor {
"elementId": "id0",
"endBindingElement": "keep",
"hoverPointIndex": -1,
"isDragging": false,
"lastUncommittedPoint": null,
"pointerDownState": Object {
"lastClickedPoint": -1,
"prevSelectedPointsIndices": null,
},
"pointerOffset": Object {
"x": 0,
"y": 0,
},
"selectedPointsIndices": null,
"startBindingElement": "keep",
},
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -11365,6 +11426,7 @@ Object {
"id0": false,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -11591,6 +11653,23 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": LinearElementEditor {
"elementId": "id0",
"endBindingElement": "keep",
"hoverPointIndex": -1,
"isDragging": false,
"lastUncommittedPoint": null,
"pointerDownState": Object {
"lastClickedPoint": -1,
"prevSelectedPointsIndices": null,
},
"pointerOffset": Object {
"x": 0,
"y": 0,
},
"selectedPointsIndices": null,
"startBindingElement": "keep",
},
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -11799,6 +11878,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -11977,6 +12057,23 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": LinearElementEditor {
"elementId": "id0",
"endBindingElement": "keep",
"hoverPointIndex": -1,
"isDragging": false,
"lastUncommittedPoint": null,
"pointerDownState": Object {
"lastClickedPoint": -1,
"prevSelectedPointsIndices": null,
},
"pointerOffset": Object {
"x": 0,
"y": 0,
},
"selectedPointsIndices": null,
"startBindingElement": "keep",
},
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -12185,6 +12282,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -12363,6 +12461,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -12541,6 +12640,7 @@ Object {
"id0": false,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -12778,6 +12878,7 @@ Object {
"selectedGroupIds": Object {
"id4": true,
},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -13566,6 +13667,7 @@ Object {
"id4": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -13839,6 +13941,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": true,
"showHelpDialog": false,
@ -13946,6 +14049,7 @@ Object {
"scrolledOutside": false,
"selectedElementIds": Object {},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -14058,6 +14162,7 @@ Object {
"id1": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -14245,6 +14350,7 @@ Object {
"id4": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -14588,6 +14694,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -14817,6 +14924,7 @@ Object {
"selectedGroupIds": Object {
"id10": true,
},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -15717,6 +15825,7 @@ Object {
"scrolledOutside": false,
"selectedElementIds": Object {},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -15828,6 +15937,7 @@ Object {
"id1": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -16670,6 +16780,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": Object {
"angle": 0,
"backgroundColor": "transparent",
@ -17116,6 +17227,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": Object {
"angle": 0,
"backgroundColor": "transparent",
@ -17414,6 +17526,7 @@ Object {
"id0": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": true,
"showHelpDialog": false,
@ -17523,6 +17636,7 @@ Object {
"id1": true,
},
"selectedGroupIds": Object {},
"selectedLinearElement": null,
"selectionElement": null,
"shouldCacheIgnoreZoom": false,
"showHelpDialog": false,
@ -18000,7 +18114,7 @@ Object {
exports[`regression tests undo/redo drawing an element: [end of test] number of elements 1`] = `3`;
exports[`regression tests undo/redo drawing an element: [end of test] number of renders 1`] = `29`;
exports[`regression tests undo/redo drawing an element: [end of test] number of renders 1`] = `30`;