* Initial commit
* Segments detection
* Remove aspect ratio
* Refactor
* Fix tests
* Toggle shapeSnap
* Fix linting
* debug: live preview
* Rebase fixes
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* Bind to elements (no hover background)
* Shape closed
* Fix rad calc + rename segments
* Comments
* Fix binding highlighting + lints
* Rename to convert to shape
* fix: Binding
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* chore: Refactor spline simplification
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* chore: Remove unused doBoundsIntersect
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Restore type signature
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Propose new button shapes
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* chore: Remove unused types
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* chore: Icon shapes
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Element cloning
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Element cloning
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Remove unused
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Shape settings in recognition mode
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* chore: Remove debug
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Actions
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Lint
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Arrowheads for freedraw
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Draw shape tool instead of freedraw
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Test
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Lint
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Keyboard shortcut visibility
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Unique cursor for draw shape
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Remove selection
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Shape selection
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Improve shape recognition
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Further refine shape recognition
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Preview
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Add hint
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Refined shape recognition
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Less ellipse more rectanguloid
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Refined arrow recognition
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Refinerecognition
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* chore: Lower linear threshold
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Rectangle head arrow
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: More arrowhead sizes
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Arrow remains an arrow
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Draw line between elements converts to arrow
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* remove pendingDrawShapeElement
* fix: Arrow start point binding
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Different arrow endpoint heuristic
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Point type
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Various small fixes
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Avoid recompute
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Type issues
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* test(editor): cover the drawShape (snap-to-shape) tool
The drawShape tool had no dedicated tests, which let master's toolbar /
active-tool rewrite silently break it during the merge: actionFinalize
reverted to the selection tool after every sketch, because the drawShape
flow finalizes without a `newElement` and so failed master's new
`&& element` guard.
Covers the behavior the merge had to preserve:
- sketch recognition (rectangle, ellipse) and the too-small no-op
- the tool stays active after finalizing, so shapes can be sketched
consecutively (regression guard for the above)
- activation via the S shortcut and the extra-tools dropdown
- the tool's own cursor
Points are fed into the trail directly rather than through pointermove,
which is rAF-throttled and would drop all but one point per frame — the
same approach lasso.test.tsx uses.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat: Add test
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: Breakout from App.tsx
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Shortcut is now Shift+X
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: No selecting arrows for shape recog
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Double history
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* feat: PCA + feature extraction recognition
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* reduce and normalize min-size gates
* never select newElement when shape recog tool active
* simplify lifecycle & remove double finalize
* make arrows bindings orbit
* funnel though actionFinalize & fix two unrelated cleanup cases
* use crosshair cursor
* show strokeWidth
* switch icons for drawShape & extraTools
* dedupe getBoundsFromPoints
* remove unused helpers
* jsdoc cleanup
* dynamic trail size
* improve rectangle recognition
* disallow linears to deviate too much from a straight line
* put under freedraw tool on tablet/mobile
* tweak label
* rename `drawShape` -> `autoshape`
---------
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Closes#8518. Fixes the issue when adding a new child to a flowchart node that already has children (after the first creation session was committed), the new child could land on top of, or misaligned with, an existing sibling.
---------
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
* fix(editor): align constant freedraw stroke width more with generic shapes
* reduce streamline for non-mouse
* do not change `currentItemStrokeVariability` unintentionally
* render penMode button under compact styles panel on tablets
* show stroke variability as standalone button in compact actions menu
* improve toolbar clicking UX with pen
* change streamline defaults
* change to `variable` stroke if toggling penMode for the first time
* fix(editor): elements duplicated when moving frame children
* fix(editor): accumulate reorders across frames in bring-to-front/back
* add invalid-order tests
* fix: make sure moved indices are within range
* add length/duplicate elements guards
* fix: Group selection
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Tests
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Frames and overlap
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: Remove unnecessary crust
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* revert unused Set signature
* skip ignored elements from group condition
when wrap-mode selecting grouped elements, we should not require to select those we ignore (bound elements or locked ones), else it's impossible to select grouped text containers
unclear whether locked elements should also be excluded - but it feels like a good heuristic on the whole
* apply exclusion
* simplify
* feat: return all elements in group for overlap selection
---------
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
- Vendored fractional-indexing and converted to TypeScript
- Stricter index format validation in fractional-indexing
- Added format validation to fractional index validation
---
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* fix: Make OOB not fatal
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* fix: More conservative temp arrow state update
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* chore: Capture condition variables in binding restoration failure
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
---------
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>