excalidraw/packages/element/src
Ryan Di 195a743874
Some checks failed
Auto release excalidraw next / Auto-release-excalidraw-next (push) Failing after 47s
Build Docker image / build-docker (push) Successful in 2m4s
Cancel previous runs / cancel (push) Failing after 3s
Publish Docker / publish-docker (push) Failing after 1m42s
New Sentry production release / sentry (push) Failing after 12s
feat: switch between basic shapes (#9270)
* 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>
2025-04-30 18:07:31 +02:00
..
align.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
binding.ts feat: switch between basic shapes (#9270) 2025-04-30 18:07:31 +02:00
bounds.ts feat: add props.renderScrollbars (#9399) 2025-04-19 21:50:44 +00:00
collision.ts chore: Element center point util (#9298) 2025-04-09 17:04:51 +02:00
comparisons.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
containerCache.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
cropElement.ts chore: Element center point util (#9298) 2025-04-09 17:04:51 +02:00
distance.ts chore: Element center point util (#9298) 2025-04-09 17:04:51 +02:00
distribute.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
dragElements.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
duplicate.ts fix: keep orig elem in place on alt-duplication (#9403) 2025-04-17 16:08:07 +02:00
elbowArrow.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
elementLink.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
embeddable.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
flowchart.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
fractionalIndex.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
frame.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
groups.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
heading.ts fix: Rounded diamond edge elbow arrow U route (#9349) 2025-04-07 10:43:07 +02:00
image.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
index.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
linearElementEditor.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
mutateElement.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
newElement.ts feat: switch between basic shapes (#9270) 2025-04-30 18:07:31 +02:00
renderElement.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
resizeElements.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
resizeTest.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
Scene.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
selection.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
Shape.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
ShapeCache.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
shapes.ts chore: Element center point util (#9298) 2025-04-09 17:04:51 +02:00
showSelectedShapeActions.ts feat: lasso selection (#9169) 2025-04-07 16:44:25 +10:00
sizeHelpers.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
sortElements.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
textElement.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
textMeasurements.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
textWrapping.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
transformHandles.ts refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00
typeChecks.ts feat: switch between basic shapes (#9270) 2025-04-30 18:07:31 +02:00
types.ts feat: switch between basic shapes (#9270) 2025-04-30 18:07:31 +02:00
utils.ts chore: Element center point util (#9298) 2025-04-09 17:04:51 +02:00
zindex.ts refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00