Commit Graph

71 Commits (fb4bb29aa5d9f03c60afc9984b01f25bcd117970)

Author SHA1 Message Date
David Luzar 3cfcc7b489
feat: split `gridSize` from enabled state & support custom `gridStep` (#8364) 6 months ago
David Luzar 4320a3cf41
feat: improve zoom-to-content when creating flowchart (#8368) 6 months ago
Márk Tolmács 8420e1aa13
fix: Reimplement rectangle intersection (#8367) 6 months ago
Márk Tolmács 5daf1a1b4e
fix: Round coordinates and sizes for rectangle intersection (#8366)
Round coordinates and sizes for rectangle intersection
6 months ago
David Luzar 97981804d7
feat: Stats popup style tweaks (#8361) 6 months ago
Clarence Chan f7b3befd0a
fix: text content with tab characters act different in view/edit (#8336)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
6 months ago
Márk Tolmács 99b91c46f7
fix: Yet more patching of intersect code (#8352)
* Yet more patching of intersect code
6 months ago
David Luzar 1ea5b26f25
fix: missing `act()` in flowchart tests (#8354) 6 months ago
Márk Tolmács 261304c1a4
fix: Patch over intersection calculation issue (#8350)
* Patch over intersection calculation issue
6 months ago
Márk Tolmács 84398a7e5c
fix: Point duplication in LEE on ALT+click (#8347) 6 months ago
Ryan Di 54491d13d4
feat: create flowcharts from a generic element using elbow arrows (#8329)
Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
6 months ago
Márk Tolmács dd1370381d
chore: Refactor and remove scene from elbow arrow generation (#8342)
* Refactor and remove scene from elbow arrow generation
6 months ago
Márk Tolmács 72d6ee48fc
fix: Do not allow resizing unbound elbow arrows either (#8333)
* Fix resizing of unbound elbow arrows
6 months ago
David Luzar f19ce30dfe
chore: bump `@testing-library/react` `12.1.5` -> `16.0.0` (#8322) 6 months ago
Ryan Di 3cf14c73a3
refactor: rename `draggingElement` -> `newElement` (#8294)
* add newElement to appState

* freedraw should not be an editing element

* do not set editing element for freedraw and generic

* remove ununsed `appState.draggingElement`

* remove setting dragged for new linear element

* decouple selection element from new element

* fix hint for text bindables

* update snapshot

* fixes

* fix frame regressions

* add comments to types

* document `editingElement`

---------

Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
6 months ago
zsviczian c67815f7b0
fix: Duplicating arrow without bound elements throws error (#8316)
Co-authored-by: David Luzar <5153846+dwelle@users.noreply.github.com>
6 months ago
David Luzar e63dd025c9
fix: allow binding elbow arrows to frame children (#8309) 6 months ago
Márk Tolmács 15e019706d
feat: Orthogonal (elbow) arrows for diagramming (#8299)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
6 months ago
Ryan Di 7b36de0476
fix: linear elements not selected on pointer up from hitting its bound text (#8285)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
6 months ago
Marcel Mraz 62228e0bbb
feat: introduce font picker (#8012)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
6 months ago
David Luzar 1d5b41dabb
fix: stop updating text versions on init (#8191) 7 months ago
Márk Tolmács 66a2f24296
fix: Add binding update to manual stat changes (#8183)
Manual stats changes now respect previous element bindings.
7 months ago
Márk Tolmács 04668d8263
fix: Binding after duplicating is now applied for both the old and duplicate shapes (#8185)
Using ALT/OPT + drag to clone does not transfer the bindings (or leaves the duplicates in place of the old one , which are also not bound).

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
7 months ago
Márk Tolmács ba8c09d529
fix: Incorrect point offsetting in LinearElementEditor.movePoints() (#8145)
The LinearElementEditor.movePoints() function incorrectly calculates the offset for local linear element points when multiple targetPoints are provided, one of those target points is index === 0 AND the other points are moved in the negative direction, and ending up with negative local coordinates.

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
7 months ago
zsviczian a1ffa064df
fix: only bind arrow (#8152)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
8 months ago
David Luzar 4dc4590f24
fix: repair invalid binding on restore & fix type check (#8133) 8 months ago
Ryan Di d2f67e619f
feat: editable element stats (#6382)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
8 months ago
David Luzar 08b13f971d
fix: wysiwyg blur-submit on mobile (#8075) 8 months ago
David Luzar 69f4cc70cb
feat: stop autoselecting text on text edit on mobile (#8076) 8 months ago
Ryan Di 860308eb27
feat: create new text with width (#8038)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
8 months ago
Marcel Mraz 661d6a4a75
fix: flaky snapshot tests with floating point precision issues (#8049) 8 months ago
Ryan Di c540bd68aa
feat: wrap long text when pasting (#8026)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
9 months ago
Ryan Di 971b4d4ae6
feat: text wrapping (#7999)
* 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>
9 months ago
Marcel Mraz dc66261c19
fix: re-introduce wysiwyg width offset (#8014) 9 months ago
David Luzar 273ba803d9
fix: font not rendered correctly on init (#8002) 9 months ago
Aakansha Doshi 1ed53b153c
build: enable consistent type imports eslint rule (#7992)
* build: enable consistent type imports eslint rule

* change to warn

* fix the warning in example and excalidraw-app

* fix packages

* enable type annotations and throw error for the rule
9 months ago
Márk Tolmács d9bbf1eda6
feat: Allow binding only via linear element ends (#7946)
Arrows now only bind to new shapes if their start or end point is dragged close to them. Arrows previously bound to shapes remain bound on move and drag if at the end of the drag/move the points remain in the original shapes' binding area.

---------

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Co-authored-by: Sammy Lee <sammy.joe.lee@gmail.com>
9 months ago
Ryan Di 88812e0386
feat: resize elements from the sides (#7855)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
9 months ago
Márk Tolmács a04676d423
fix: CTRL/CMD & arrow point drag unbinds both sides (#6459) (#7877) 9 months ago
Marcel Mraz 015b46ab23
feat: expose `StoreAction` in relation to multiplayer history (#7898)
Improved Store API and improved handling of actions to eliminate potential concurrency issues
9 months ago
Marcel Mraz 530617be90
feat: multiplayer undo / redo (#7348) 10 months ago
David Luzar da2e507298
fix: allow same origin for all necessary domains (#7889) 10 months ago
David Luzar afcde542f9
fix: parse embeddable srcdoc urls strictly (#7884) 10 months ago
David Luzar 0ae9b383d6
fix: Gist embed allowing unsafe html (#7883) 10 months ago
Ryan Di 4987cc53d0
fix: include borders when testing insides of a shape (#7865) 10 months ago
Ryan Di 32df5502ae
feat: fractional indexing (#7359)
* Introducing fractional indices as part of `element.index`

* Ensuring invalid fractional indices are always synchronized with the array order

* Simplifying reconciliation based on the fractional indices

* Moving reconciliation inside the `@excalidraw/excalidraw` package

---------

Co-authored-by: Marcel Mraz <marcel@excalidraw.com>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
10 months ago
Ryan Di bbdcd30a73
refactor: update collision from ga to vector geometry (#7636)
* new collision api

* isPointOnShape

* removed redundant code

* new collision methods in app

* curve shape takes starting point

* clean up geometry

* curve rotation

* freedraw

* inside curve

* improve ellipse inside check

* ellipse distance func

* curve inside

* include frame name bounds

* replace previous private methods for getting elements at x,y

* arrow bound text hit detection

* keep iframes on top

* remove dependence on old collision methods from app

* remove old collision functions

* move some hit functions outside of app

* code refactor

* type

* text collision from inside

* fix context menu test

* highest z-index collision

* fix 1px away binding test

* strictly less

* remove unused imports

* lint

* 'ignore' resize flipping test

* more lint fix

* skip 'flips while resizing' test

* more test

* fix merge errors

* fix selection in resize test

* added a bit more comment

---------

Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
10 months ago
Ryan Di 550a388b2b
feat: command palette (#7804)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
10 months ago
David Luzar 2382fad4f6
feat: store library to IndexedDB & support storage adapters (#7655) 11 months ago
Marcel Mraz 480572f893
fix: correcting Assistant metrics (#7758)
* Changed Assistant metrics to the corrrect ones from OS/2 table

* Adding more information about font metrics

* Adding branded types to avoid future mistakes
11 months ago