Fix binding
Remove unneeded params
Unfinished simple arrow avoidance
Fix newly created jumping arrow when gets outside
Do not apply the jumping logic to elbow arrows for new elements
Existing arrows now jump out
Type updates to support fixed binding for simple arrows
Fix crash for elbow arrws in mutateElement()
Refactored simple arrow creation
Updating tests
No confirm threshold when inside biding range
Fix multi-point arrow grid off
Make elbow arrows respect grids
Unbind arrow if bound and moved at shaft of arrow key
Fix binding test
Fix drag unbind when the bound element is in the selection
Do not move mid point for simple arrows bound on both ends
Add test for mobing mid points for simple arrows when bound on the same element on both ends
Fix linear editor bug when both midpoint and endpoint is moved
Fix all point multipoint arrow highlight and binding
Arrow dragging gets a little drag to avoid accidental unbinding
Fixed point binding for simple arrows when the arrow doesn't point to the element
Fix binding disabled use-case triggering arrow editor
Timed binding mode change for simple arrows
Apply fixes
Remove code to unbind on drag
Update simple arrow fixed point when arrow is dragged or moved by arrow keys
Binding highlight fixes
Change bind mode timeout logic
Fix tests
Add Alt bindMode switch
No dragging of arrows when bound, similar to elbow
Fix timeout not taking effect immediately
Bumop z-index for arrows when dragged
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Only transparent bindables allow binding fallthrough
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix lint
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix point click array creation interaction with fixed point binding
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Restrict new behavior to arrows only
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Allow binding inside images
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix already existing fixed binding retention
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Refactor and implement fixed point binding for unfilled elements
Restore drag
Removed point binding
Binding code refactor
Added centered focus point
Binding & focus point debug
Add invariants to check binding integrity in elements
Binding fixes
Small refactors
Completely rewritten binding
Include point updates after binding update
Fix point updates when endpoint dragged and opposite endpoint orbits
centered focus point only for new arrows
Make z-index arrow reorder on bind
Turn off inside binding mode after leaving a shape
Remove invariants from debug
feat: expose `applyTo` options, don't commit empty text element (#9744)
* Expose applyTo options, skip re-draw for empty text
* Don't commit empty text elements
test: added test file for distribute (#9754)
z-index update
Bind mode on precise binding
Fix binding to inside element
Fix initial arrow not following cursor (white dot)
Fix elbow arrow
Fix z-index so it works on hover
Fix fixed angle orbiting
Move point click arrow creation over to common strategy
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Add binding strategy for drag arrow creation
Fix elbow arrow
Fix point handles
Snap to center
Fix transparent shape binding
Internal arrow creation fix
Fix point binding
Fix selection bug
Fix new arrow focus point
Images now always bind inside
Flashing arrow creation on binding band
Add watchState debug method to window.h
Fix debug canvas crash
Remove non-needed bind mode
Fix restore
No keyboard movement when bound
Add actionFinalize when arrow in edit mode
Add drag to the Stats panel when bound arrow is moved
Further simplify curve tracking
Add typing to action register()
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix point at finalize
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix type errors
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
New arrow binding rules
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix cyclical dep
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix jiggly arrows
Fix jiggly arrow x2
Long inside-other binding
Click-click binding
Fix arrows
Performance
[PERF] Replace in-place Jacobian derivation with analytical version
Different approach to inside binding
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fixes
Fix inconsistent arrow start jump out
Change how images are bound to on new arrow creation
Lower timeout
Small insurance fix
* feat: drag, resize, and rotate after selecting in lasso
* alternative ux: drag with lasso right away
* fix: lasso dragging should snap too
* fix: alt+cmd getting stuck
* test: snapshots
* alternatvie: keep lasso drag to only mobile
* alternative: drag after selection on PCs
* improve mobile dection
* add mobile lasso icon
* add default selection tool
* render according to default selection tool
* return to default selection tool after deletion
* reset to default tool after clearing out the canvas
* return to default tool after eraser toggle
* if default lasso, close lasso toggle
* finalize to default selection tool
* toggle between laser and default selection
* return to default selection tool after creation
* double click to add text when using default selection tool
* set to default selection tool after unlocking tool
* paste to center on touch screen
* switch to default selection tool after pasting
* lint
* fix tests
* show welcome screen when using default selection tool
* fix tests
* fix snapshots
* fix context menu not opening
* prevent potential displacement issue
* prevent element jumping during lasso selection
* fix dragging on mobile
* use same selection icon
* fix alt+cmd lasso getting cut off
* fix: shortcut handling
* lint
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* fix: awkward point adding and removing on touch device
* feat: move finalize to next to last point
* feat: on touch screen, click would create a default line/arrow
* fix: make default adaptive to zoom
* fix: increase padding to avoid cutoffs
* refactor: simplify
* fix: only use bigger padding when needed
* center arrow horizontally on pointer
* increase min drag distance before we start 2-point-arrow-drag-creating
* do not render 0-width arrow while creating
* dead code
* fix tests
* fix: remove redundant code
* do not enter line editor on creation
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* Loop Lock/Unlock
* fixed condition. 4 line points are required for the action to be available
* extracted updateLoopLock to improve readability. Removed unnecessary SVG attributes
* lint + added loopLock to restore.ts
* added loopLock to newElement, updated test snapshots
* lint
* dislocate enpoint when breaking the loop.
* change icon & turn into a state style button
* POC: auto-transform to polygon on bg set
* keep polygon icon constant
* do not split points on de-polygonizing & highlight overlapping points
* rewrite color picker to support no (mixed) colors & fix focus handling
* refactor
* tweak point rendering inside line editor
* do not disable polygon when creating new points via alt
* auto-enable polygon when aligning start/end points
* TBD: remove bg color when disabling polygon
* TBD: only show polygon button for enabled polygons
* fix polygon behavior when adding/removing/moving points within line editor
* convert to polygon when creating line
* labels tweak
* add to command palette
* loopLock -> polygon
* restore `polygon` state on type conversions
* update snapshots
* naming
* break polygon on restore/finalize if invalid & prevent creation
* snapshots
* fix: merge issue and forgotten debug
* snaps
* do not merge points for 3-point lines
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* fix frame name clipping on zooming
* include assistant font
* default frame name
* extend search to frame names
* add a simple test
* collpase search match items
* id check out of loop
* fix frame name check
* include focusedId for small perf improvement
* optionally show and hide collapse icon
* update section title
* fix tests
* rename `serverSide` -> `private`
* revert: do not reset zoom on zoom change
* feat: do not close menu on repeated ctrl+f
* remove collapsible
* tweak results CSS
* remove redundant check
* set `appState.searchMatches` to null if empty
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* feat: switch between basic shapes
* add tab for testing
* style tweaks
* only show hint when a new node is created
* fix panel state
* refactor
* combine captures into one
* keep original font size
* switch multi
* switch different types altogether
* use tab only
* fix font size atom
* do not switch from active tool change
* prefer generic when mixed
* provide an optional direction when shape switching
* adjust panel bg & shadow
* redraw to correctly position text
* remove redundant code
* only tab to switch if focusing on app container
* limit which linear elements can be switched
* add shape switch to command palette
* remove hint
* cache initial panel position
* bend line to elbow if needed
* remove debug logic
* clean switch of arrows using app state
* safe conversion between line, sharp, curved, and elbow
* cache linear when panel shows up
* type safe element conversion
* rename type
* respect initial type when switching between linears
* fix elbow segment indexing
* use latest linear
* merge converted elbow points if too close
* focus on panel after click
* set roudness to null to fix drag points offset for elbows
* remove Mutable
* add arrowBoundToElement check
* make it dependent on one signle state
* unmount when not showing
* simpler types, tidy up code
* can change linear when it's linear + non-generic
* fix popup component lifecycle
* move constant to CLASSES
* DRY out type detection
* file & variable renaming
* refactor
* throw in not-prod instead
* simplify
* semi-fix bindings on `generic` type conversion
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* Expose renderScrollbars to AppState
* fix: scrollbar rendering should use al renderable elements
* remove `appState.renderScrollbars`
* clean unused
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* Add DOCTYPE and XML preamble in exported SVG documents
* Update packages/excalidraw/data/index.ts
---------
Co-authored-by: David Luzar <5153846+dwelle@users.noreply.github.com>
* lasso without 'real' shape detection
* select a single linear el
* improve ux
* feed segments to worker
* simplify path threshold adaptive to zoom
* add a tiny threshold for checks
* refactor code
* lasso tests
* fix: ts
* do not capture lasso tool
* try worker-loader in next config
* update config
* refactor
* lint
* feat: show active tool when using "more tools"
* keep lasso if selected from toolbar
* fix incorrect checks for resetting to selection
* shift for additive selection
* bound text related fixes
* lint
* keep alt toggled lasso selection if shift pressed
* fix regression
* fix 'dead' lassos
* lint
* use workerpool and polyfill
* fix worker bundled with window related code
* refactor
* add file extension for worker constructor error
* another attempt at constructor error
* attempt at build issue
* attempt with dynamic import
* test not importing from math
* narrow down imports
* Reusing existing workers infrastructure (fallback to the main thread, type-safety)
* Points on curve inside the shared chunk
* Give up on experimental code splitting
* Remove potentially unnecessary optimisation
* Removing workers as the complexit is much worse, while perf. does not seem to be much better
* fix selecting text containers and containing frames together
* render fill directly from animated trail
* do not re-render static when setting selected element ids in lasso
* remove unnecessary property
* tweak trail animation
* slice points to remove notch
* always start alt-lasso from initial point
* revert build & worker changes (unused)
* remove `lasso` from `hasStrokeColor`
* label change
* remove unused props
* remove unsafe optimization
* snaps
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Co-authored-by: Marcel Mraz <marcel@excalidraw.com>