arrows: separate out handle behavior from labels (#2621)

This is a followup on the arrows work.
- allow labels to go to the ends if no arrowhead is present
- avoid using / overloading TLHandle and use a new PointingLabel state
to specifically address label movement
- removes the feature flag to launch this feature!

### Change Type

- [x] `patch` — Bug fix

### Release Notes

- Arrow labels: provide more polish on label placement

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
This commit is contained in:
Mime Čuvalo 2024-01-31 11:17:03 +00:00 committed by GitHub
parent f87702bda4
commit 34a95b2ec8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 572 additions and 445 deletions

View file

@ -14,14 +14,6 @@ export type TLHandleComponent = ComponentType<{
/** @public */
export const DefaultHandle: TLHandleComponent = ({ handle, isCoarse, className, zoom }) => {
if (handle.type === 'text-adjust') {
return (
<g className={classNames('tl-handle', 'tl-handle__text-adjust', className)}>
<rect rx={4} ry={4} width={handle.w} height={handle.h} />
</g>
)
}
const bgRadius = (isCoarse ? COARSE_HANDLE_RADIUS : HANDLE_RADIUS) / zoom
const fgRadius = (handle.type === 'create' && isCoarse ? 3 : 4) / zoom