* resize single elements from the side
* fix lint
* do not resize texts from the sides (for we want to wrap/unwrap)
* omit side handles for frames too
* upgrade types
* enable resizing from the sides for multiple elements as well
* fix lint
* maintain aspect ratio when elements are not of the same angle
* lint
* always resize proportionally for multiple elements
* increase side resizing padding
* code cleanup
* adaptive handles
* do not resize for linear elements with only two points
* prioritize point dragging over edge resizing
* lint
* allow free resizing for multiple elements at degree 0
* always resize from the sides
* reduce hit threshold
* make small multiple elements movable
* lint
* show side handles on touch screen and mobile devices
* differentiate touchscreens
* keep proportional with text in multi-element resizing
* update snapshot
* update multi elements resizing logic
* lint
* reduce side resizing padding
* bound texts do not scale in normal cases
* lint
* test sides for texts
* wrap text
* do not update text size when changing its alignment
* keep text wrapped/unwrapped when editing
* change wrapped size to auto size from context menu
* fix test
* lint
* increase min width for wrapped texts
* wrap wrapped text in container
* unwrap when binding text to container
* rename `wrapped` to `autoResize`
* fix lint
* revert: use `center` align when wrapping text in container
* update snaps
* fix lint
* simplify logic on autoResize
* lint and test
* snapshots
* remove unnecessary code
* snapshots
* fix: defaults not set correctly
* tests for wrapping texts when resized
* tests for text wrapping when edited
* fix autoResize refactor
* include autoResize flag check
* refactor
* feat: rename action label & change contextmenu position
* fix: update version on `autoResize` action
* fix infinite loop when editing text in a container
* simplify
* always maintain `width` if `!autoResize`
* maintain `x` if `!autoResize`
* maintain `y` pos after fontSize change if `!autoResize`
* refactor
* when editing, do not wrap text in textWysiwyg
* simplify text editor
* make test more readable
* comment
* rename action to match file name
* revert function signature change
* only update in app
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
@ -2584,6 +2584,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] element 1 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": null,
"containerId": null,
@ -2624,6 +2625,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] element 2 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the container is added through the history > [end of test] element 2 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id138",
"containerId": "id138",
@ -2873,6 +2875,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] element 1 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id141",
"containerId": "id141",
@ -2913,6 +2916,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] element 2 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should preserve latest remotely added binding and unbind previous one when the text is added through history > [end of test] element 2 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id141",
"containerId": "id141",
@ -3147,6 +3151,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] element 1 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id128",
"containerId": "id128",
@ -3187,6 +3192,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] element 2 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the container got bound to a different text in the meantime > [end of test] element 2 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": null,
"containerId": null,
@ -3463,6 +3469,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the text got bound to a different container in the meantime > [end of test] element 2 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and the text got bound to a different container in the meantime > [end of test] element 2 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id133",
"containerId": "id133",
@ -3703,6 +3710,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and there no conflicting updates in the meantime > [end of test] element 1 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind bindings when both are updated through the history and there no conflicting updates in the meantime > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": null,
"containerId": null,
@ -3934,6 +3942,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added bound text when it's container is added through the history > [end of test] element 1 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added bound text when it's container is added through the history > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id134",
"containerId": "id134",
@ -4184,6 +4193,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added container when it's bound text is added through the history > [end of test] element 1 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should rebind remotely added container when it's bound text is added through the history > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id136",
"containerId": "id136",
@ -4244,6 +4254,7 @@ History {
"id137" => Delta {
"id137" => Delta {
"deleted": {
"deleted": {
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id136",
"containerId": "id136",
@ -4447,6 +4458,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw bound text to match container dimensions when the bound text is updated through the history > [end of test] element 1 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw bound text to match container dimensions when the bound text is updated through the history > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id150",
"containerId": "id150",
@ -4669,6 +4681,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw remotely added bound text when it's container is updated through the history > [end of test] element 1 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should redraw remotely added bound text when it's container is updated through the history > [end of test] element 1 1`] = `
{
{
"angle": 90,
"angle": 90,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id148",
"containerId": "id148",
@ -4886,6 +4899,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted bound text from container when the container is added through the history > [end of test] element 1 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted bound text from container when the container is added through the history > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id144",
"containerId": "id144",
@ -5111,6 +5125,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted container from bound text when the text is added through the history > [end of test] element 1 1`] = `
exports[`history > multiplayer undo/redo > conflicts in bound text elements and their containers > should unbind remotely deleted container from bound text when the text is added through the history > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": null,
"containerId": null,
@ -13502,6 +13517,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on deletion and rebind on undo > [end of test] element 1 1`] = `
exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on deletion and rebind on undo > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id50",
"containerId": "id50",
@ -13761,6 +13777,7 @@ History {
"id51" => Delta {
"id51" => Delta {
"deleted": {
"deleted": {
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": null,
"containerId": null,
@ -14182,6 +14199,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on undo and rebind on redo > [end of test] element 1 1`] = `
exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind arrow from non deleted bindable elements on undo and rebind on redo > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id44",
"containerId": "id44",
@ -14365,6 +14383,7 @@ History {
"id45" => Delta {
"id45" => Delta {
"deleted": {
"deleted": {
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": null,
"containerId": null,
@ -14786,6 +14805,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind everything from non deleted elements when iterating through the whole undo stack and vice versa rebind everything on redo > [end of test] element 1 1`] = `
exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind everything from non deleted elements when iterating through the whole undo stack and vice versa rebind everything on redo > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id56",
"containerId": "id56",
@ -14969,6 +14989,7 @@ History {
"id57" => Delta {
"id57" => Delta {
"deleted": {
"deleted": {
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": null,
"containerId": null,
@ -15388,6 +15409,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangle from arrow on deletion and rebind on undo > [end of test] element 1 1`] = `
exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangle from arrow on deletion and rebind on undo > [end of test] element 1 1`] = `
{
{
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": "id62",
"containerId": "id62",
@ -15641,6 +15663,7 @@ History {
"id63" => Delta {
"id63" => Delta {
"deleted": {
"deleted": {
"angle": 0,
"angle": 0,
"autoResize": true,
"backgroundColor": "transparent",
"backgroundColor": "transparent",
"boundElements": null,
"boundElements": null,
"containerId": null,
"containerId": null,
@ -16086,6 +16109,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangles from arrow on deletion and rebind on undo > [end of test] element 1 1`] = `
exports[`history > singleplayer undo/redo > should support bidirectional bindings > should unbind rectangles from arrow on deletion and rebind on undo > [end of test] element 1 1`] = `