* compact bottom toolbar
* put menu trigger to top left
* add popup to switch between grouped tool types
* add a dedicated mobile toolbar
* update position for mobile
* fix active tool type
* add mobile mode as well
* mobile actions
* remove refactored popups
* excali logo mobile
* include mobile
* update mobile menu layout
* move selection and deletion back to right
* do not fill eraser
* fix styling
* fix active styling
* bigger buttons, smaller gaps
* fix other tools not opened
* fix: Style panel persistence and restore
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* move hidden action btns to extra popover
* fix dropdown overlapping with welcome screen
* replace custom popup with popover
* improve button styles
* swapping redo and delete
* always show undo & redo and improve styling
* change background
* toolbar styles
* no any
* persist perferred selection tool and align tablet as well
* add a renderTopLeftUI to props
* tweak border and bg
* show combined properties only when using suitable tools
* fix preferred tool
* new stroke icon
* hide color picker hot keys
* init preferred tool based on device
* fix main menu sizing
* fix welcome screen offset
* put text before image
* disable call highlight on buttons
* fix renderTopLeftUI
---------
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* feat: allow the hiding of top picks
* feat: allow the hiding of default fonts
* refactor: rename to compactMode
* feat: introduce layout (incomplete)
* tweak icons
* do not show border
* lint
* add isTouchMobile to device
* add isTouchMobile to device
* refactor to use showCompactSidebar instead
* hide library label in compact
* fix icon color in dark theme
* fix library and share btns getting hidden in smaller tablet widths
* update tests
* use a smaller gap between shapes
* proper fix of range
* quicker switching between different popovers
* to not show properties panel at all when editing text
* fix switching between different popovers for texts
* fix popover not closable and font search auto focus
* change properties for a new or editing text
* change icon for more style settings
* use bolt icon for extra actions
* fix breakpoints
* use rem for icon sizes
* fix tests
* improve switching between triggers (incomplete)
* improve trigger switching (complete)
* clean up code
* put compact into app state
* fix button size
* remove redundant PanelComponentProps["compactMode"]
* move fontSize UI on top
* mobile detection (breakpoints incomplete)
* tweak compact mode detection
* rename appState prop & values
* update snapshots
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Tests added
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
Fix curve test
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
No center focus point
90% inside center binding
Fixing tests
fix: Elbow arrow fixes
fix: More arrow fixes
Do not trigger arrow binding for linear elements
fix: Linear elements
fix: Refactor actionFinalize for linear
Binding tests updated
fix: Jump when cursor not moved
fix: history tests
Fix history snapshot
Fix undo issue
fix(eraser): Remove binding from the other element
fix(tests): Update tests
chore: Attempt filtering new set state
Fix excessive history recording
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix all tests
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
fix(transform): Fix group resize and rotate
fix(binding): Harmonize binding param usage
fix: Center focus point
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
chore: Trigger build
Remove binding gap
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Binding highlight refactor
fix: Refactored timeout bind mode handling
fix: Center when orbiting
feat: Color change on highlight
Fix orbit binding highlight
fix: hiding arrow
Fix arrow binding
Fix arrow drag selection logic
Binding highlight is now hot pink
Change inside binding logic for start point
Render focus point in debug mode
Fix snap to center
Fix actionFinalize for new arrow creation
fix: snapToCenter()
80% by length
fix: attempt at fixing the dancing arrows
feat: No center snap when start is not bound
Fix centering for existing arrows
tweak binding highlight color
change `appState.suggestedBindings` -> `suggestedBinding` & remove unused code
Refactor delayed bind mode change
Binding highlight rotation support + image support
fix(highlight): Overdraw fixes
feat: Do not allow drag bound arrow closer to the shape than dragging distance
feat: Stroke width adaptive fixed binding distance
chore: More point dragging centralization
New element behavior
Refactor dragging
Fix incorrect highlight sizing
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix delayed bind mode for multiElement arrows
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix multi-point
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fix elbow arrows
Simplify state
Small positional fixes
Fix jiggly arrows
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Fixes for arrow dragging
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Elbow arrow fixes
Highlight fixes
Fix elbow arrow binding
Frame highlight
Fix elbow mid-point binding
Fix binding suggestion for disabled binding state
Implement Alt
Remove debug
* 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>
* crowfoot many
* crowfoot one
* one or many
* add icons for crowfoot
* add crowfoot icons
* adjust arrowhead selection popover
* make options collapsible
* swap triangle and bar
* switch to radix popover
* put triangle outline in the first row
* align shadow with new design spec
* remove unused flag
* swap order
* tweak labels
* handle shift+tab
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Co-authored-by: Jakub Królak <108676707+j-krolak@users.noreply.github.com>
* Flipping action now properly mirrors selections with elbow arrows
* Flipping action now re-centers the selection to the original center to avoid "walking" selections on repeated flipping
* 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>
* 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
* fix: remove scene from getElementAbsoluteCoords and dependent functions and use elementsMap
* lint
* fix
* use non deleted elements where possible
* use non deleted elements map in actions
* pass elementsMap instead of array to elementOverlapsWithFrame
* lint
* fix
* pass elementsMap to getElementsCorners
* pass elementsMap to getEligibleElementsForBinding
* pass elementsMap in bindOrUnbindSelectedElements and unbindLinearElements
* pass elementsMap in elementsAreInFrameBounds,elementOverlapsWithFrame,isCursorInFrame,getElementsInResizingFrame
* pass elementsMap in getElementsWithinSelection, getElementsCompletelyInFrame, isElementContainingFrame, getElementsInNewFrame
* pass elementsMap to getElementWithTransformHandleType
* pass elementsMap to getVisibleGaps, getMaximumGroups,getReferenceSnapPoints,snapDraggedElements
* lint
* pass elementsMap to bindTextToShapeAfterDuplication,bindLinearElementToElement,getTextBindableContainerAtPosition
* revert changes for bindTextToShapeAfterDuplication